import { inject as qt, ref as de, provide as Xt, readonly as X8, computed as A, reactive as Bn, Fragment as tt, isVNode as or, Comment as SA, Text as pw, defineComponent as Oe, getCurrentInstance as sr, onMounted as Lt, onUpdated as Ns, onUnmounted as wo, watch as _e, unref as I, shallowRef as Te, watchEffect as zt, onBeforeUnmount as tn, triggerRef as Z8, createVNode as v, h as lo, Transition as zr, withDirectives as fa, resolveDirective as G8, cloneVNode as Eu, render as _u, nextTick as rn, toRef as on, withModifiers as la, vShow as Qa, onBeforeMount as R0, Teleport as D0, createTextVNode as Ve, isRef as wA, toRefs as _c, toRaw as rr, useAttrs as U8, onBeforeUpdate as gw, getCurrentScope as CA, onScopeDispose as $A, TransitionGroup as mw, onActivated as kA, openBlock as re, createElementBlock as be, normalizeStyle as Yt, normalizeClass as Tt, renderSlot as _o, createCommentVNode as et, renderList as Jt, createBlock as ut, mergeProps as J8, withCtx as ye, createSlots as bx, createElementVNode as F, toDisplayString as se, useSlots as eB, resolveComponent as Rn, resolveDynamicComponent as TA, toValue as tB, normalizeProps as nB, guardReactiveProps as iB } from "vue";
import { merge as Zk, isEmpty as PA } from "lodash-es";
import { defineStore as vw } from "pinia";
import EA from "lodash-es/isPlainObject";
import yw from "lodash-es/isEqual";
import gb from "lodash-es/uniq";
import oB from "lodash-es/fromPairs";
import _A from "lodash-es/debounce";
import Xi from "dayjs";
import rB from "dayjs/plugin/weekday";
import aB from "dayjs/plugin/localeData";
import lB from "dayjs/plugin/weekOfYear";
import sB from "dayjs/plugin/weekYear";
import uB from "dayjs/plugin/quarterOfYear";
import cB from "dayjs/plugin/advancedFormat";
import dB from "dayjs/plugin/customParseFormat";
import Gm from "lodash-es/cloneDeep";
import fB from "lodash-es/find";
import hB from "lodash-es/intersection";
import pB from "lodash-es/omit";
import IA from "lodash-es/pick";
import { isNumber as gB, isString as xx, isBoolean as mB } from "lodash";
const vB = {
  "common.auto": "Auto",
  "common.all": "All",
  "app.tab.dashboard": "Dashboard",
  "app.tab.scene": "Scene View",
  "app.tab.topology": "Topology",
  "app.tab.logs": "Logs",
  "app.tab.traces": "Traces",
  "app.tab.querybuilder": "Query Builder",
  "app.tab.grafana": "Grafana Data",
  "app.tab.zabbix": "Zabbix",
  "app.theme.toDark": "Switch to Dark",
  "app.theme.toLight": "Switch to Light",
  "time.last1h": "Last 1 hour",
  "time.last3h": "Last 3 hours",
  "time.last6h": "Last 6 hours",
  "time.last24h": "Last 24 hours",
  "time.last7d": "Last 7 days",
  "time.last30d": "Last 30 days",
  "panel.menu.edit": "Edit",
  "panel.menu.clone": "Clone",
  "panel.menu.fullscreen": "Fullscreen",
  "panel.menu.refresh": "Refresh",
  "panel.menu.remove": "Remove",
  "panel.remove.title": 'Remove "{title}"?',
  "panel.remove.content": "This action cannot be undone.",
  "panel.remove.ok": "Remove",
  "panel.remove.cancel": "Cancel",
  "dashboard.edit": "Edit",
  "dashboard.save": "Save",
  "dashboard.cancel": "Cancel",
  "dashboard.cancelConfirmTitle": "Discard unsaved changes?",
  "dashboard.cancelConfirmOk": "Discard changes",
  "dashboard.cancelConfirmCancel": "Keep editing",
  "dashboard.addPanel": "Add Panel",
  "dashboard.clearPanels": "Clear Panels",
  "dashboard.clearConfirmTitle": "Clear all panels?",
  "dashboard.clearConfirmOk": "Clear all",
  "dashboard.export": "Export",
  "dashboard.import": "Import",
  "dashboard.exportSuccess": "Dashboard exported",
  "dashboard.importSuccess": "Dashboard imported",
  "dashboard.importError": "Invalid dashboard JSON",
  "config.section.general": "General",
  "config.section.value": "Stat Style",
  "config.section.style": "Style",
  "config.section.tooltip": "Tooltip",
  "config.section.format": "Formatting",
  "config.section.thresholds": "Thresholds ({n})",
  "config.section.axes": "Axes",
  "config.section.links": "Links ({n})",
  "config.section.gaugeStyle": "Gauge Style",
  "config.section.pieStyle": "Pie Style",
  "config.section.histStyle": "Histogram Style",
  "config.section.tableStyle": "Table Style",
  "config.section.overrides": "Field Overrides",
  "config.type.timeseries": "Time Series",
  "config.type.bar": "Bar Chart",
  "config.type.histogram": "Histogram",
  "config.type.stat": "Stat / Value",
  "config.type.gauge": "Gauge",
  "config.type.table": "Table",
  "config.type.pie": "Pie Chart",
  "panel.type.desc.timeseries": "Line/area chart with time axis",
  "panel.type.desc.bar": "Grouped or stacked bars",
  "panel.type.desc.histogram": "Distribution buckets",
  "panel.type.desc.stat": "Single value with sparkline",
  "panel.type.desc.gauge": "Circular gauge meter",
  "panel.type.desc.table": "Sortable data table",
  "panel.type.desc.pie": "Pie or donut chart",
  "config.field.title": "Title",
  "config.field.description": "Description",
  "config.field.panelType": "Panel Type",
  "config.field.colorScheme": "Color Scheme",
  "config.field.lineWidth": "Line Width",
  "config.field.fillOpacity": "Fill Opacity",
  "config.field.drawStyle": "Style",
  "config.field.interpolation": "Interpolation",
  "config.field.lineStyle": "Line Style",
  "config.field.showPoints": "Show Points",
  "config.field.legendPosition": "Legend Position",
  "config.field.unit": "Unit",
  "config.field.decimals": "Decimals",
  "config.field.min": "Min",
  "config.field.max": "Max",
  "config.field.reducer": "Calculation",
  "config.field.tooltipMode": "Tooltip Mode",
  "config.field.softMin": "Soft Min",
  "config.field.softMax": "Soft Max",
  "config.field.logScale": "Log Scale",
  "config.field.axisPlacement": "Placement",
  "config.field.showGridLines": "Grid Lines",
  "config.field.scaleDistribution": "Scale",
  "config.field.centeredZero": "Centered Zero",
  "config.field.stacked": "Stacked",
  "config.interp.linear": "Linear",
  "config.interp.smooth": "Smooth",
  "config.interp.step": "Step",
  "config.linestyle.solid": "Solid",
  "config.linestyle.dashed": "Dashed",
  "config.linestyle.dotted": "Dotted",
  "config.legend.bottom": "Bottom",
  "config.legend.right": "Right",
  "config.legend.hidden": "Hidden",
  "config.unit.none": "None",
  "config.unit.ms": "Milliseconds (ms)",
  "config.unit.percent": "Percent (0-100)",
  "config.unit.reqps": "Requests/sec",
  "config.threshold.label": "Label",
  "config.threshold.base": "Base",
  "config.threshold.add": "Add Threshold",
  "config.threshold.mode": "Threshold Mode",
  "config.threshold.modeAbsolute": "Absolute",
  "config.threshold.modePercentage": "Percentage",
  "dashboard.refresh": "Refresh",
  "dashboard.empty": "No panels yet",
  "dashboard.emptyHint": 'Click "Edit" then "Add Panel" to get started',
  "variable.modal.placeholder": 'Click "Add Variable" on the left to start',
  "variable.custom.title": "Custom Options",
  "variable.custom.add": "Add Option",
  "variable.custom.allValue": "All Value",
  "variable.custom.allValue.placeholder": "$_all",
  "variable.custom.col.text": "Display text",
  "variable.custom.col.value": "Value",
  "variable.custom.text.placeholder": "Display text",
  "variable.custom.value.placeholder": "Value",
  "variable.custom.addOption": "Add option",
  "variable.custom.allowCustomValue": "Allow custom values",
  "variable.custom.allowClear": "Allow clear",
  "variable.custom.multi": "Multi-value",
  "variable.custom.includeAll": "Include All option",
  "variable.general.label.placeholder": "Display label",
  "variable.general.description": "Description",
  "variable.general.description.placeholder": "Variable description",
  "variable.general.name.required": "Name is required",
  "variable.general.type.required": "Please select a type",
  "variable.general.showOn": "Show on dashboard",
  "variable.general.showOn.labelAndValue": "Label and value",
  "variable.general.showOn.value": "Value only",
  "variable.general.showOn.nothing": "Nothing",
  "variable.textbox.title": "Text box options",
  "variable.textbox.default": "Default value",
  "variable.textbox.default.placeholder": "Default value",
  "variable.textbox.width": "Input width",
  "variable.constant.title": "Constant options",
  "variable.constant.value": "Value",
  "variable.constant.value.required": "Value is required",
  "variable.constant.value.notNumber": "Please enter a valid number",
  "variable.constant.valueType": "Value type",
  "variable.constant.valueType.string": "String",
  "variable.constant.valueType.number": "Number",
  "variable.constant.hideFromList": "Hide from variable list",
  "variable.query.dsUid": "Datasource UID",
  "variable.query.dsUid.placeholder": "Enter datasource UID",
  "variable.query.queryType": "Query type",
  "variable.query.queryType.placeholder": "Select query type",
  "variable.query.queryType.group": "Host group",
  "variable.query.queryType.host": "Host",
  "variable.query.queryType.item": "Item",
  "variable.query.queryType.labelValues": "Label values",
  "variable.query.query": "Query",
  "variable.query.query.placeholder": "Query expression",
  "variable.query.regex": "Regex filter",
  "variable.query.regex.placeholder": "/regex/",
  "variable.query.sort": "Sort",
  "variable.query.sort.disabled": "Disabled",
  "variable.query.sort.alphabetical": "Alphabetical",
  "variable.query.sort.numeric": "Numerical",
  "variable.query.preview": "Preview",
  "variable.query.preview.placeholder": "(Refresh after save)",
  "config.scheme.grafana-classic": "Grafana Classic",
  "config.scheme.green-yellow-red": "Green-Yellow-Red",
  "config.scheme.red-yellow-green": "Red-Yellow-Green",
  "config.scheme.blue-yellow-red": "Blue-Yellow-Red",
  "config.scheme.blue-purple": "Blue-Purple",
  "config.scheme.yellow-blue": "Yellow-Blue",
  "config.scheme.blues": "Blues",
  "config.scheme.reds": "Reds",
  "config.scheme.GrYlRd": "GrYlRd",
  "config.scheme.purple-orange": "Purple-Orange",
  "variable.modal.title": "Variable Config",
  "variable.modal.save": "Save",
  "variable.modal.cancel": "Cancel",
  "variable.modal.delete": "Delete Variable",
  "variable.modal.add": "Add Variable",
  "variable.modal.empty": 'Click "Add Variable" on the left to start',
  "variable.nav.count": "Variables ({n})",
  "variable.nav.unnamed": "(unnamed)",
  "variable.general.title": "General",
  "variable.general.type": "Type",
  "variable.general.name": "Name",
  "variable.general.label": "Label",
  "variable.type.custom": "Custom",
  "variable.type.query": "Query",
  "variable.type.textbox": "Text box",
  "variable.type.datasource": "Data source",
  "variable.type.constant": "Constant",
  "variable.query.title": "Query options",
  "variable.query.multi": "Multi-value",
  "variable.query.includeAll": "Include All option",
  "variable.query.refresh": "Refresh",
  "variable.query.refresh.onLoad": "On dashboard load",
  "variable.query.refresh.onTimeChange": "On time range change",
  "qb.datasource": "Data Source",
  "qb.addQuery": "Add Query",
  "qb.queryOptions": "Query options",
  "qb.pattern": "Pattern",
  "qb.pattern.sine": "Sine wave",
  "qb.pattern.spike": "Spike",
  "qb.pattern.step": "Step",
  "qb.pattern.sawtooth": "Sawtooth",
  "qb.pattern.noise": "Random noise",
  "qb.pattern.trendUp": "Trend up",
  "qb.pattern.trendDown": "Trend down",
  "qb.pattern.plateau": "Plateau",
  "qb.pattern.randomWalk": "Random walk",
  "qb.pattern.live": "Live",
  "qb.seriesCount": "Series Count",
  "qb.liveAmplitude": "Amplitude",
  "qb.functions": "Functions",
  "qb.functions.add": "Add",
  "qb.options": "Options",
  "qb.queryOptions.maxDataPoints": "Max data points",
  "qb.queryOptions.minInterval": "Min interval",
  "qb.queryOptions.minIntervalPlaceholder": "No limit",
  "qb.queryOptions.interval": "Interval",
  "qb.queryOptions.intervalHint": "time range / max data points",
  "qb.queryOptions.relativeTime": "Relative time",
  "qb.queryOptions.timeShift": "Time shift",
  "config.scheme.classic": "Classic",
  "config.scheme.tableau10": "Tableau 10",
  "config.scheme.fixed": "Single Color",
  "config.scheme.thresholds": "From Thresholds",
  "config.trend.up": "Up ↑",
  "config.trend.down": "Down ↓",
  "config.trend.flat": "Flat",
  "config.field.pieType": "Pie Type",
  "config.field.pieSliceSorting": "Slice Sorting",
  "config.pieType.pie": "Pie",
  "config.pieType.donut": "Donut",
  "config.sort.desc": "Descending",
  "config.sort.asc": "Ascending",
  "config.sort.none": "None",
  "config.field.pieLabels": "Slice Labels",
  "config.pieLabel.name": "Name",
  "config.pieLabel.percent": "Percent",
  "config.pieLabel.value": "Value",
  "config.field.pieShow": "Show",
  "config.pieShow.calculate": "Calculate (Reducer)",
  "config.pieShow.all": "All Values",
  "config.field.legendMode": "Legend Mode",
  "config.legendMode.list": "List",
  "config.legendMode.table": "Table",
  "config.field.legendValues": "Legend Values",
  "config.legendValue.min": "Min",
  "config.legendValue.max": "Max",
  "config.legendValue.mean": "Mean",
  "config.legendValue.sum": "Sum",
  "config.legendValue.last": "Last",
  "config.legendValue.first": "First",
  "tooltip.pinned": "Pinned",
  "tooltip.datetimeFormat": "MMM DD HH:mm:ss",
  "config.reducer.lastNotNull": "Last *",
  "config.reducer.last": "Last",
  "config.reducer.firstNotNull": "First *",
  "config.reducer.first": "First",
  "config.reducer.min": "Min",
  "config.reducer.max": "Max",
  "config.reducer.mean": "Mean",
  "config.reducer.sum": "Total",
  "config.reducer.count": "Count",
  "config.reducer.range": "Range",
  "config.reducer.median": "Median",
  "config.reducer.stdDev": "Std Dev",
  "config.reducer.variance": "Variance",
  "config.reducer.delta": "Delta",
  "config.reducer.diff": "Difference",
  "config.reducer.diffperc": "Difference %",
  "config.reducer.step": "Step",
  "config.reducer.logmin": "Min (above zero)",
  "config.reducer.countAll": "Count all",
  "config.reducer.changeCount": "Change Count",
  "config.reducer.distinctCount": "Distinct Count",
  "config.reducer.allIsZero": "All Zeros",
  "config.reducer.allIsNull": "All Nulls",
  "config.drawStyle.lines": "Lines",
  "config.drawStyle.bars": "Bars",
  "config.drawStyle.points": "Points",
  "config.tooltip.single": "Single",
  "config.tooltip.multi": "All",
  "config.tooltip.none": "Hidden",
  "config.tooltip.sortNone": "None",
  "config.tooltip.sortAsc": "Ascending",
  "config.tooltip.sortDesc": "Descending",
  "config.axis.placement.left": "Left",
  "config.axis.placement.right": "Right",
  "config.axis.placement.hidden": "Hidden",
  "config.axis.grid.all": "All",
  "config.axis.grid.hidden": "Hidden",
  "config.axis.scale.linear": "Linear",
  "config.axis.scale.logarithmic": "Logarithmic",
  "config.gauge.fillWidth": "Active Arc Width",
  "config.gauge.trackWidth": "Track Width",
  "config.gauge.trackColor": "Track Color",
  "config.gauge.capRound": "Round Caps",
  "config.gauge.valueVisible": "Show Value",
  "config.gauge.thresholdDisplay": "Show Thresholds",
  "config.gauge.thresholdDisplayNone": "Off",
  "config.gauge.thresholdDisplayMarker": "Threshold Markers",
  "config.gauge.thresholdDisplayTrack": "Track Bands",
  "config.gauge.orientation": "Layout",
  "config.gauge.orientationAuto": "Auto Grid",
  "config.gauge.orientationHorizontal": "Horizontal",
  "config.gauge.orientationVertical": "Vertical",
  "config.gauge.valueOffsetY": "Value Y Offset",
  // Style section - gradient, nulls, points, stacking
  "config.field.gradientMode": "Gradient Mode",
  "config.gradient.none": "None",
  "config.gradient.opacity": "Opacity",
  "config.gradient.hue": "Hue",
  "config.gradient.scheme": "Scheme",
  "config.field.spanNulls": "Connect Null Values",
  "config.field.insertNulls": "Disconnect Values",
  "config.nulls.never": "Never",
  "config.nulls.always": "Always",
  "config.nulls.threshold": "Threshold",
  "config.points.auto": "Auto",
  "config.points.always": "Always",
  "config.points.never": "Never",
  "config.field.stackSeries": "Stack Series",
  "config.stack.none": "None",
  "config.stack.normal": "Normal",
  "config.stack.percent": "100%",
  // General section
  "config.field.colorSingle": "Fixed Color",
  "config.field.colorDistribution": "Color Distribution",
  "config.colorDist.sequential": "Sequential",
  "config.colorDist.distributed": "Distributed",
  "config.link.newTab": "Open in new tab",
  "config.link.add": "Add link",
  // Bar style
  "config.field.barShowValues": "Show Values",
  "config.showValues.auto": "Auto",
  "config.showValues.always": "Always",
  "config.showValues.never": "Never",
  "config.field.barGroupWidth": "Group Width",
  "config.field.barWidth": "Bar Width",
  "config.field.xTickRotation": "Rotate X Labels",
  // Stat style
  "config.field.orientation": "Orientation",
  "config.orientation.vertical": "Auto (Vertical)",
  "config.orientation.horizontal": "Horizontal",
  "config.field.textMode": "Text Mode",
  "config.textMode.valueAndName": "Value and name",
  "config.textMode.value": "Value only",
  "config.textMode.name": "Name only",
  "config.textMode.none": "None",
  "config.field.colorMode": "Color mode",
  "config.colorMode.value": "Value",
  "config.colorMode.backgroundSolid": "Background Solid",
  "config.colorMode.background": "Background Gradient",
  "config.field.percentChange": "Percent Change",
  "config.field.value": "Value",
  "config.field.unitLabel": "Unit Label",
  "config.field.trend": "Trend",
  // Histogram style
  "config.field.histBucketCount": "Bucket Count",
  "config.field.histBucketSize": "Bucket Size",
  "config.field.histBucketOffset": "Bucket Offset",
  "config.field.histCombineSeries": "Combine Series",
  "config.hist.bucketSizePlaceholder": "Auto",
  // Table style
  "config.field.tableFooterEnabled": "Footer Row",
  "config.field.tableFooterReducers": "Footer Calculation",
  "config.field.tableFooterFields": "Fields",
  "config.field.tableFooterFieldsPlaceholder": "All Numeric Fields",
  "config.section.tableColumnOverrides": "Column Overrides",
  // Axes section
  "config.field.axisName": "Name",
  "config.field.axisLabel": "Label",
  "config.field.axisWidth": "Width",
  "config.field.gridColor": "Grid Color",
  "config.field.axisLine": "Tick Labels",
  "config.field.axisLineColor": "Tick Label Color",
  "config.field.axisTickShow": "Tick Marks",
  "config.field.axisBorder": "Border",
  "config.field.axisBorderColor": "Border Color",
  "config.axis.label.placeholder": "Axis label",
  "config.axis.name.placeholder": "Axis name",
  "config.axis.grid.x": "X",
  "config.axis.grid.y": "Y",
  "config.axis.scale.symlog": "Symlog",
  // Tooltip section
  "config.field.tooltipSort": "Tooltip Sort",
  "config.field.tooltipMaxHeight": "List Max Height",
  "config.field.axisPointer": "Axis Pointer",
  // Unit options
  "config.unit.s": "Seconds (s)",
  "config.unit.bytes": "Bytes",
  "config.unit.percentunit": "Percent (0-1)",
  "config.unit.ops": "Ops/sec",
  "config.unit.bps": "Bits/sec",
  "config.unit.Bps": "Bytes/sec",
  // Gauge
  "config.gauge.arcSweep": "Arc Sweep",
  "config.gauge.paddingX": "Horizontal Padding",
  "config.gauge.paddingY": "Vertical Padding",
  "config.gauge.valueColor": "Value Color",
  "config.gauge.valueSize": "Value Size",
  "config.gauge.colorFromScheme": "Color from Scheme",
  "config.gauge.thresholdLabelDisplay": "Threshold Labels",
  "config.gauge.thresholdLabelNone": "Hidden",
  "config.gauge.thresholdLabelLabel": "Label",
  "config.gauge.thresholdLabelValue": "Value",
  "config.gauge.thresholdLabelBoth": "Label + Value",
  // Panel no data
  "panel.noData": "No data",
  // Override editor
  "config.override.addRule": "Add field override",
  "config.override.addProp": "Add override property",
  "config.override.matcher.byName": "Fields with name",
  "config.override.matcher.byType": "Fields with type",
  "config.override.matcher.byRegexp": "Fields matching regex",
  "config.override.matcher.byFrameRefID": "Fields returned by query",
  "config.override.prop.unit": "Unit",
  "config.override.prop.decimals": "Decimals",
  "config.override.prop.displayName": "Display name",
  "config.override.prop.min": "Min",
  "config.override.prop.max": "Max",
  "config.override.prop.noValue": "No value",
  "config.override.prop.filterable": "Filterable",
  "config.override.prop.thresholds": "Thresholds",
  "config.override.prop.displayMode": "Display mode",
  "config.override.prop.width": "Column width",
  "config.override.prop.align": "Alignment",
  "config.override.prop.hidden": "Hide column",
  "config.override.prop.wrapText": "Wrap text",
  "config.override.group.basic": "Standard options",
  "config.override.group.thresholds": "Thresholds",
  "config.override.group.table": "Table",
  "config.override.type.time": "Time",
  "config.override.type.number": "Number",
  "config.override.type.string": "String",
  "config.override.type.boolean": "Boolean",
  // Table column overrides
  "config.field.tableColHidden": "Hide",
  "config.field.tableColLabel": "Label",
  "config.field.tableColWidth": "Width",
  "config.field.tableColAlign": "Alignment",
  "config.field.tableColDisplayMode": "Display Mode",
  "config.field.tableColWrapText": "Wrap text",
  "config.field.tableColAddName": "Column name",
  "config.tableAlign.auto": "Auto",
  "config.tableAlign.left": "Left",
  "config.tableAlign.center": "Center",
  "config.tableAlign.right": "Right",
  "config.tableDisplayMode.auto": "Auto",
  "config.tableDisplayMode.colored-text": "Colored Text",
  "config.tableDisplayMode.colored-background": "Colored Background",
  "config.tableDisplayMode.gauge": "Gauge",
  "config.tableDisplayMode.data-links": "Data Links",
  "config.tableDisplayMode.json-view": "JSON View",
  "config.tableDisplayMode.pill": "Pill",
  // StatsPicker
  "config.reducer.group.standard": "Standard",
  "config.reducer.group.extended": "Extended",
  "config.reducer.group.boolean": "Boolean",
  "config.reducer.group.percentile": "Percentile",
  "config.reducer.choose": "Choose",
  // Pie limit
  "config.field.pieLimit": "Limit",
  // Variable datasource section
  "variable.ds.title": "Data source options",
  "variable.ds.type": "Data source type",
  "variable.ds.type.placeholder": "Select data source type",
  "variable.ds.filterRegex": "Instance filter regex",
  "variable.ds.multi": "Multi-value",
  "variable.ds.includeAll": "Include All option",
  // Editor - VizPicker
  "editor.vizPicker.title": "Visualization",
  // Editor - Overrides
  "editor.overrides.matcherValue": "Match value",
  "editor.overrides.propValue": "Property value",
  "editor.overrides.addProperty": "Add override property",
  "editor.overrides.addOverride": "Add field override",
  // Zabbix QueryEditor — query types
  "qb.queryType": "Query type",
  "qb.queryType.metrics": "Metrics",
  "qb.queryType.text": "Text",
  "qb.queryType.services": "IT Services",
  "qb.queryType.itemid": "Item ID",
  "qb.queryType.triggers": "Triggers",
  "qb.queryType.problems": "Problems",
  "qb.queryType.macros": "Macros",
  "qb.queryType.lld": "LLD",
  // Zabbix QueryEditor — host/group/item fields
  "panel.group": "Host group",
  "panel.group.placeholder": "Select host group",
  "panel.host": "Host",
  "panel.host.placeholder": "Select host",
  "panel.itemTag": "Item tag",
  "panel.itemTag.placeholder": "Filter by tag",
  "panel.items": "Items",
  "panel.items.placeholder": "Select item",
  // Zabbix QueryEditor — query fields
  "qb.textFilter": "Text filter",
  "qb.textFilter.placeholder": "Regex pattern",
  "qb.useCaptureGroups": "Use capture groups",
  "qb.itemIds": "Item IDs",
  "qb.itemIds.placeholder": "Comma-separated IDs",
  "qb.triggerFilter": "Trigger filter",
  "qb.triggerFilter.placeholder": "Trigger name",
  "qb.problemName": "Problem name",
  "qb.problemName.placeholder": "Filter by name",
  "qb.tags": "Tags",
  "qb.tags.placeholder": "tag:value",
  "qb.show": "Show",
  "qb.severity": "Severity",
  "qb.itService": "IT Service",
  "qb.itService.placeholder": "Select IT service",
  "qb.slaProperty": "SLA property",
  "qb.slaInterval": "SLA interval",
  "qb.macroFilter": "Macro filter",
  // Zabbix QueryEditor — LLD
  "qb.lld.rule": "Discovery rule",
  "qb.lld.rule.placeholder": "Select discovery rule",
  "qb.lld.itemKeys": "Item prototype keys",
  "qb.lld.itemKeys.placeholder": "Select prototype keys",
  // Zabbix QueryEditor — options
  "qb.ack.all": "All",
  "qb.ack.unack": "Unacknowledged",
  "qb.ack.ack": "Acknowledged",
  "qb.sort.default": "Default",
  "qb.sort.lastchange": "Last change",
  "qb.sort.severity": "Severity",
  "qb.trends.default": "Default",
  "qb.trends.true": "Use trends",
  "qb.trends.false": "No trends",
  "qb.options.trends": "Trends",
  "qb.options.showDisabled": "Show disabled",
  "qb.options.valueMapping": "Use value mapping",
  "qb.options.disableAlignment": "Disable alignment",
  "qb.options.acknowledged": "Acknowledged",
  "qb.options.sortBy": "Sort by",
  "qb.options.useTimeRange": "Use time range",
  "qb.options.hostsInMaintenance": "Hosts in maintenance",
  "qb.options.hostProxy": "Host proxy",
  "qb.options.limit": "Limit"
}, MA = {
  "panel.noData": "暂无数据",
  "common.auto": "自动",
  "common.all": "全部",
  "app.tab.dashboard": "仪表盘",
  "app.tab.scene": "场景视图",
  "app.tab.topology": "拓扑",
  "app.tab.logs": "日志",
  "app.tab.traces": "链路追踪",
  "app.tab.querybuilder": "查询构建器",
  "app.tab.grafana": "Grafana 数据",
  "app.tab.zabbix": "Zabbix",
  "app.theme.toDark": "切换深色",
  "app.theme.toLight": "切换浅色",
  "time.last1h": "最近 1 小时",
  "time.last3h": "最近 3 小时",
  "time.last6h": "最近 6 小时",
  "time.last24h": "最近 24 小时",
  "time.last7d": "最近 7 天",
  "time.last30d": "最近 30 天",
  "panel.menu.edit": "编辑",
  "panel.menu.clone": "克隆",
  "panel.menu.fullscreen": "全屏",
  "panel.menu.refresh": "刷新",
  "panel.menu.remove": "删除",
  "panel.remove.title": '删除 "{title}"？',
  "panel.remove.content": "此操作不可撤销。",
  "panel.remove.ok": "删除",
  "panel.remove.cancel": "取消",
  "dashboard.edit": "编辑",
  "dashboard.save": "保存",
  "dashboard.cancel": "取消",
  "dashboard.cancelConfirmTitle": "放弃未保存的更改？",
  "dashboard.cancelConfirmOk": "放弃更改",
  "dashboard.cancelConfirmCancel": "继续编辑",
  "dashboard.addPanel": "添加面板",
  "dashboard.clearPanels": "清空面板",
  "dashboard.clearConfirmTitle": "清空所有面板？",
  "dashboard.clearConfirmOk": "确认清空",
  "dashboard.export": "导出",
  "dashboard.import": "导入",
  "dashboard.exportSuccess": "仪表盘已导出",
  "dashboard.importSuccess": "仪表盘已导入",
  "dashboard.importError": "无效的仪表盘 JSON",
  "config.section.general": "基本信息",
  "config.section.value": "数据设置",
  "config.section.style": "图形样式",
  "config.section.tooltip": "悬浮提示窗",
  "config.section.format": "格式化",
  "config.section.thresholds": "阈值 ({n})",
  "config.section.axes": "坐标轴",
  "config.section.links": "链接 ({n})",
  "config.section.gaugeStyle": "图形样式",
  "config.section.pieStyle": "饼图样式",
  "config.section.histStyle": "直方图样式",
  "config.section.tableStyle": "表格样式",
  "config.section.overrides": "字段覆盖",
  "config.type.timeseries": "时序图",
  "config.type.bar": "柱状图",
  "config.type.histogram": "直方图",
  "config.type.stat": "统计值",
  "config.type.gauge": "仪表盘",
  "config.type.table": "表格",
  "config.type.pie": "饼图",
  "panel.type.desc.timeseries": "带时间轴的折线/面积图",
  "panel.type.desc.bar": "分组或堆叠柱状图",
  "panel.type.desc.histogram": "数值分布直方图",
  "panel.type.desc.stat": "单值统计 + 迷你图",
  "panel.type.desc.gauge": "圆弧仪表盘",
  "panel.type.desc.table": "可排序数据表格",
  "panel.type.desc.pie": "饼图 / 环形图",
  "config.field.title": "标题",
  "config.field.description": "描述",
  "config.field.panelType": "面板类型",
  "config.field.colorScheme": "配色方案",
  "config.field.lineWidth": "线宽",
  "config.field.fillOpacity": "填充透明度",
  "config.field.drawStyle": "图形样式",
  "config.field.interpolation": "插值方式",
  "config.field.lineStyle": "线条样式",
  "config.field.showPoints": "显示数据点",
  "config.field.legendPosition": "图例位置",
  "config.field.unit": "单位",
  "config.field.decimals": "小数位数",
  "config.field.min": "最小值",
  "config.field.max": "最大值",
  "config.field.reducer": "计算方式",
  "config.field.tooltipMode": "浮窗触发模式",
  "config.field.softMin": "软最小值",
  "config.field.softMax": "软最大值",
  "config.field.logScale": "对数刻度",
  "config.field.axisPlacement": "轴位置",
  "config.field.showGridLines": "网格线",
  "config.field.scaleDistribution": "刻度类型",
  "config.field.centeredZero": "零点居中",
  "config.field.stacked": "堆叠",
  "config.interp.linear": "线性",
  "config.interp.smooth": "平滑",
  "config.interp.step": "阶梯",
  "config.linestyle.solid": "实线",
  "config.linestyle.dashed": "虚线",
  "config.linestyle.dotted": "点线",
  "config.legend.bottom": "底部",
  "config.legend.right": "右侧",
  "config.legend.hidden": "隐藏",
  "config.unit.none": "无",
  "config.unit.ms": "毫秒 (ms)",
  "config.unit.percent": "百分比 (0-100)",
  "config.unit.reqps": "请求/秒",
  "config.threshold.label": "标签",
  "config.threshold.base": "基础色",
  "config.threshold.add": "添加阈值",
  "config.threshold.mode": "阈值模式",
  "config.threshold.modeAbsolute": "绝对值",
  "config.threshold.modePercentage": "百分比",
  "dashboard.refresh": "刷新",
  "dashboard.empty": "暂无面板",
  "dashboard.emptyHint": '点击"编辑"后选择"添加面板"开始',
  "variable.modal.placeholder": '点击左侧"新增变量"开始配置',
  "variable.custom.title": "自定义选项",
  "variable.custom.add": "添加选项",
  "variable.custom.allValue": "全部值",
  "variable.custom.allValue.placeholder": "自定义全选值",
  "variable.custom.col.text": "显示文本",
  "variable.custom.col.value": "值",
  "variable.custom.text.placeholder": "显示文本",
  "variable.custom.value.placeholder": "值",
  "variable.custom.addOption": "添加选项",
  "variable.custom.allowCustomValue": "允许输入自定义值",
  "variable.custom.allowClear": "允许清空",
  "variable.custom.multi": "多选",
  "variable.custom.includeAll": "包含全选项",
  "variable.general.label.placeholder": "显示标签",
  "variable.general.description": "描述",
  "variable.general.description.placeholder": "变量描述",
  "variable.general.name.required": "名称不能为空",
  "variable.general.type.required": "请选择类型",
  "variable.general.showOn": "显示方式",
  "variable.general.showOn.labelAndValue": "标签和值",
  "variable.general.showOn.value": "仅值",
  "variable.general.showOn.nothing": "不显示",
  "variable.textbox.title": "文本框选项",
  "variable.textbox.default": "默认值",
  "variable.textbox.default.placeholder": "默认值",
  "variable.textbox.width": "输入框宽度",
  "variable.constant.title": "常量选项",
  "variable.constant.value": "值",
  "variable.constant.value.required": "值不能为空",
  "variable.constant.value.notNumber": "请输入有效数字",
  "variable.constant.valueType": "值类型",
  "variable.constant.valueType.string": "字符串",
  "variable.constant.valueType.number": "数字",
  "variable.constant.hideFromList": "从变量列表隐藏",
  "variable.query.dsUid": "数据源 UID",
  "variable.query.dsUid.placeholder": "输入数据源 UID",
  "variable.query.queryType": "查询类型",
  "variable.query.queryType.placeholder": "选择查询类型",
  "variable.query.queryType.group": "主机组",
  "variable.query.queryType.host": "主机",
  "variable.query.queryType.item": "监控项",
  "variable.query.queryType.labelValues": "标签值",
  "variable.query.query": "查询语句",
  "variable.query.query.placeholder": "查询表达式",
  "variable.query.regex": "提取正则",
  "variable.query.regex.placeholder": "/regex/",
  "variable.query.sort": "排序",
  "variable.query.sort.disabled": "禁用",
  "variable.query.sort.alphabetical": "字母顺序",
  "variable.query.sort.numeric": "数字顺序",
  "variable.query.preview": "预览结果",
  "variable.query.preview.placeholder": "（保存后刷新预览）",
  "config.scheme.grafana-classic": "Grafana 经典",
  "config.scheme.green-yellow-red": "绿黄红",
  "config.scheme.red-yellow-green": "红黄绿",
  "config.scheme.blue-yellow-red": "蓝黄红",
  "config.scheme.blue-purple": "蓝紫",
  "config.scheme.yellow-blue": "黄蓝",
  "config.scheme.blues": "蓝色系",
  "config.scheme.reds": "红色系",
  "config.scheme.GrYlRd": "GrYlRd",
  "config.scheme.purple-orange": "紫橙",
  "variable.modal.title": "变量配置",
  "variable.modal.save": "保存",
  "variable.modal.cancel": "取消",
  "variable.modal.delete": "删除变量",
  "variable.modal.add": "新增变量",
  "variable.modal.empty": '点击左侧"新增变量"开始配置',
  "variable.nav.count": "变量 ({n})",
  "variable.nav.unnamed": "(未命名)",
  "variable.general.title": "基本信息",
  "variable.general.type": "类型",
  "variable.general.name": "名称",
  "variable.general.label": "标签",
  "variable.type.custom": "自定义",
  "variable.type.query": "查询",
  "variable.type.textbox": "文本框",
  "variable.type.datasource": "数据源",
  "variable.type.constant": "常量",
  "variable.query.title": "查询选项",
  "variable.query.multi": "多选",
  "variable.query.includeAll": "包含全选项",
  "variable.query.refresh": "刷新时机",
  "variable.query.refresh.onLoad": "仪表盘加载时",
  "variable.query.refresh.onTimeChange": "时间范围变化时",
  "qb.datasource": "数据源",
  "qb.addQuery": "添加查询",
  "qb.queryOptions": "查询选项",
  "qb.pattern": "数据模式",
  "qb.pattern.sine": "正弦波",
  "qb.pattern.spike": "尖峰",
  "qb.pattern.step": "阶梯",
  "qb.pattern.sawtooth": "锯齿波",
  "qb.pattern.noise": "随机噪声",
  "qb.pattern.trendUp": "上升趋势",
  "qb.pattern.trendDown": "下降趋势",
  "qb.pattern.plateau": "平台",
  "qb.pattern.randomWalk": "随机游走",
  "qb.pattern.live": "实时",
  "qb.seriesCount": "序列数量",
  "qb.liveAmplitude": "振幅",
  "qb.functions": "函数",
  "qb.functions.add": "添加",
  "qb.options": "选项",
  "qb.queryOptions.maxDataPoints": "最大数据点数",
  "qb.queryOptions.minInterval": "最小间隔",
  "qb.queryOptions.minIntervalPlaceholder": "不限制",
  "qb.queryOptions.interval": "间隔",
  "qb.queryOptions.intervalHint": "时间范围 / 最大数据点数",
  "qb.queryOptions.relativeTime": "相对时间",
  "qb.queryOptions.timeShift": "时间偏移",
  "config.scheme.classic": "经典配色",
  "config.scheme.tableau10": "Tableau配色",
  "config.scheme.fixed": "单色",
  "config.scheme.thresholds": "来自阈值",
  "config.trend.up": "上升 ↑",
  "config.trend.down": "下降 ↓",
  "config.trend.flat": "持平",
  "config.field.pieType": "饼图类型",
  "config.field.pieSliceSorting": "扇区排序",
  "config.pieType.pie": "实心饼",
  "config.pieType.donut": "环形图",
  "config.sort.desc": "降序",
  "config.sort.asc": "升序",
  "config.sort.none": "不排序",
  "config.field.pieLabels": "扇区标签",
  "config.pieLabel.name": "名称",
  "config.pieLabel.percent": "百分比",
  "config.pieLabel.value": "数值",
  "config.field.pieShow": "数据聚合",
  "config.pieShow.calculate": "聚合（Reducer）",
  "config.pieShow.all": "全部值",
  "config.field.legendMode": "图例模式",
  "config.legendMode.list": "列表",
  "config.legendMode.table": "表格",
  "config.field.legendValues": "图例统计值",
  "config.legendValue.min": "最小值",
  "config.legendValue.max": "最大值",
  "config.legendValue.mean": "平均值",
  "config.legendValue.sum": "求和",
  "config.legendValue.last": "最后值",
  "config.legendValue.first": "第一个值",
  "tooltip.pinned": "已固定",
  "tooltip.datetimeFormat": "YYYY-MM-DD HH:mm:ss",
  "config.reducer.lastNotNull": "最后非空值",
  "config.reducer.last": "最后值",
  "config.reducer.firstNotNull": "第一个非空值",
  "config.reducer.first": "第一个值",
  "config.reducer.min": "最小值",
  "config.reducer.max": "最大值",
  "config.reducer.mean": "平均值",
  "config.reducer.sum": "求和",
  "config.reducer.count": "计数",
  "config.reducer.range": "范围",
  "config.reducer.median": "中位数",
  "config.reducer.stdDev": "标准差",
  "config.reducer.variance": "方差",
  "config.reducer.delta": "增量",
  "config.reducer.diff": "差值",
  "config.reducer.diffperc": "差值 %",
  "config.reducer.step": "步长",
  "config.reducer.logmin": "最小正值",
  "config.reducer.countAll": "总计数",
  "config.reducer.changeCount": "变化次数",
  "config.reducer.distinctCount": "唯一值数",
  "config.reducer.allIsZero": "全为零",
  "config.reducer.allIsNull": "全为空",
  "config.drawStyle.lines": "折线",
  "config.drawStyle.bars": "柱状",
  "config.drawStyle.points": "散点",
  "config.tooltip.single": "单系列",
  "config.tooltip.multi": "全部",
  "config.tooltip.none": "隐藏",
  "config.tooltip.sortNone": "默认",
  "config.tooltip.sortAsc": "升序",
  "config.tooltip.sortDesc": "降序",
  "config.axis.placement.left": "左侧",
  "config.axis.placement.right": "右侧",
  "config.axis.placement.hidden": "隐藏",
  "config.axis.grid.all": "开启",
  "config.axis.grid.hidden": "隐藏",
  "config.axis.scale.linear": "线性",
  "config.axis.scale.logarithmic": "对数",
  "config.gauge.fillWidth": "激活弧宽度",
  "config.gauge.trackWidth": "轨道宽度",
  "config.gauge.trackColor": "轨道背景色",
  "config.gauge.capRound": "圆角",
  "config.gauge.valueVisible": "显示数值",
  "config.gauge.thresholdDisplay": "显示阈值方式",
  "config.gauge.thresholdDisplayNone": "不显示",
  "config.gauge.thresholdDisplayMarker": "阈值标记条",
  "config.gauge.thresholdDisplayTrack": "轨道阈值条",
  "config.gauge.orientation": "排列方式",
  "config.gauge.orientationAuto": "自动网格",
  "config.gauge.orientationHorizontal": "水平排列",
  "config.gauge.orientationVertical": "垂直排列",
  "config.gauge.valueOffsetY": "数值 Y 偏移",
  // Style section - gradient, nulls, points, stacking
  "config.field.gradientMode": "渐变模式",
  "config.gradient.none": "无",
  "config.gradient.opacity": "透明度",
  "config.gradient.hue": "色相",
  "config.gradient.scheme": "配色",
  "config.field.spanNulls": "连接空值",
  "config.field.insertNulls": "断开空值",
  "config.nulls.never": "从不",
  "config.nulls.always": "始终",
  "config.nulls.threshold": "阈值",
  "config.points.auto": "自动",
  "config.points.always": "始终",
  "config.points.never": "从不",
  "config.field.stackSeries": "堆叠序列",
  "config.stack.none": "无",
  "config.stack.normal": "普通",
  "config.stack.percent": "100%",
  // General section
  "config.field.colorSingle": "固定颜色",
  "config.field.colorDistribution": "颜色分布",
  "config.colorDist.sequential": "顺序",
  "config.colorDist.distributed": "分散",
  "config.link.newTab": "新标签页打开",
  "config.link.add": "添加链接",
  // Bar style
  "config.field.barShowValues": "显示数值",
  "config.showValues.auto": "自动",
  "config.showValues.always": "始终",
  "config.showValues.never": "从不",
  "config.field.barGroupWidth": "组宽度",
  "config.field.barWidth": "柱宽",
  "config.field.xTickRotation": "旋转 X 标签",
  // Stat style
  "config.field.orientation": "方向",
  "config.orientation.vertical": "自动（垂直）",
  "config.orientation.horizontal": "水平",
  "config.field.textMode": "文本模式",
  "config.textMode.valueAndName": "数值和名称",
  "config.textMode.value": "仅数值",
  "config.textMode.name": "仅名称",
  "config.textMode.none": "无",
  "config.field.colorMode": "颜色模式",
  "config.colorMode.value": "数值",
  "config.colorMode.backgroundSolid": "纯色背景",
  "config.colorMode.background": "渐变背景",
  "config.field.percentChange": "百分比变化",
  "config.field.value": "数值",
  "config.field.unitLabel": "单位标签",
  "config.field.trend": "趋势",
  // Histogram style
  "config.field.histBucketCount": "分桶数",
  "config.field.histBucketSize": "桶大小",
  "config.field.histBucketOffset": "桶偏移",
  "config.field.histCombineSeries": "合并序列",
  "config.hist.bucketSizePlaceholder": "自动",
  // Table style
  "config.field.tableFooterEnabled": "底栏行",
  "config.field.tableFooterReducers": "底栏计算",
  "config.field.tableFooterFields": "字段",
  "config.field.tableFooterFieldsPlaceholder": "所有数值字段",
  "config.section.tableColumnOverrides": "列覆盖",
  // Axes section
  "config.field.axisName": "名称",
  "config.field.axisLabel": "标签",
  "config.field.axisWidth": "宽度",
  "config.field.gridColor": "网格颜色",
  "config.field.axisLine": "刻度标签",
  "config.field.axisLineColor": "刻度标签颜色",
  "config.field.axisTickShow": "刻度线",
  "config.field.axisBorder": "边框",
  "config.field.axisBorderColor": "边框颜色",
  "config.axis.label.placeholder": "坐标轴标签",
  "config.axis.name.placeholder": "坐标轴名称",
  "config.axis.grid.x": "X",
  "config.axis.grid.y": "Y",
  "config.axis.scale.symlog": "对称对数",
  // Tooltip section
  "config.field.tooltipSort": "浮窗排序",
  "config.field.tooltipMaxHeight": "列表最大高度",
  "config.field.axisPointer": "坐标轴指针",
  // Unit options
  "config.unit.s": "秒 (s)",
  "config.unit.bytes": "字节",
  "config.unit.percentunit": "百分比 (0-1)",
  "config.unit.ops": "操作/秒",
  "config.unit.bps": "比特/秒",
  "config.unit.Bps": "字节/秒",
  // Gauge
  "config.gauge.arcSweep": "弧度",
  "config.gauge.paddingX": "水平内边距",
  "config.gauge.paddingY": "垂直内边距",
  "config.gauge.valueColor": "数值颜色",
  "config.gauge.valueSize": "数值大小",
  "config.gauge.colorFromScheme": "来自配色方案",
  "config.gauge.thresholdLabelDisplay": "阈值标签",
  "config.gauge.thresholdLabelNone": "隐藏",
  "config.gauge.thresholdLabelLabel": "标签",
  "config.gauge.thresholdLabelValue": "数值",
  "config.gauge.thresholdLabelBoth": "标签 + 数值",
  // Override editor
  "config.override.addRule": "添加字段覆盖",
  "config.override.addProp": "添加覆盖属性",
  "config.override.matcher.byName": "按名称匹配字段",
  "config.override.matcher.byType": "按类型匹配字段",
  "config.override.matcher.byRegexp": "按正则匹配字段",
  "config.override.matcher.byFrameRefID": "按查询返回匹配",
  "config.override.prop.unit": "单位",
  "config.override.prop.decimals": "小数位",
  "config.override.prop.displayName": "显示名称",
  "config.override.prop.min": "最小值",
  "config.override.prop.max": "最大值",
  "config.override.prop.noValue": "无数据文本",
  "config.override.prop.filterable": "可筛选",
  "config.override.prop.thresholds": "阈值",
  "config.override.prop.displayMode": "显示模式",
  "config.override.prop.width": "列宽",
  "config.override.prop.align": "对齐",
  "config.override.prop.hidden": "隐藏列",
  "config.override.prop.wrapText": "自动换行",
  "config.override.group.basic": "标准选项",
  "config.override.group.thresholds": "阈值",
  "config.override.group.table": "表格",
  "config.override.type.time": "时间",
  "config.override.type.number": "数值",
  "config.override.type.string": "字符串",
  "config.override.type.boolean": "布尔",
  // Table column overrides
  "config.field.tableColHidden": "隐藏",
  "config.field.tableColLabel": "标签",
  "config.field.tableColWidth": "宽度",
  "config.field.tableColAlign": "对齐",
  "config.field.tableColDisplayMode": "显示模式",
  "config.field.tableColWrapText": "自动换行",
  "config.field.tableColAddName": "列名",
  "config.tableAlign.auto": "自动",
  "config.tableAlign.left": "左对齐",
  "config.tableAlign.center": "居中",
  "config.tableAlign.right": "右对齐",
  "config.tableDisplayMode.auto": "自动",
  "config.tableDisplayMode.colored-text": "彩色文字",
  "config.tableDisplayMode.colored-background": "彩色背景",
  "config.tableDisplayMode.gauge": "仪表盘",
  "config.tableDisplayMode.data-links": "数据链接",
  "config.tableDisplayMode.json-view": "JSON 视图",
  "config.tableDisplayMode.pill": "标签",
  // StatsPicker
  "config.reducer.group.standard": "标准",
  "config.reducer.group.extended": "扩展",
  "config.reducer.group.boolean": "布尔",
  "config.reducer.group.percentile": "百分位",
  "config.reducer.choose": "选择",
  // Pie limit
  "config.field.pieLimit": "数量限制",
  // Variable datasource section
  "variable.ds.title": "数据源选项",
  "variable.ds.type": "数据源类型",
  "variable.ds.type.placeholder": "选择数据源类型",
  "variable.ds.filterRegex": "实例过滤正则",
  "variable.ds.multi": "多选",
  "variable.ds.includeAll": "包含全选项",
  // Editor - VizPicker
  "editor.vizPicker.title": "可视化类型",
  // Editor - Overrides
  "editor.overrides.matcherValue": "匹配值",
  "editor.overrides.propValue": "属性值",
  "editor.overrides.addProperty": "添加属性覆盖",
  "editor.overrides.addOverride": "添加字段覆盖",
  // Zabbix QueryEditor — query types
  "qb.queryType": "查询类型",
  "qb.queryType.metrics": "指标",
  "qb.queryType.text": "文本",
  "qb.queryType.services": "IT服务",
  "qb.queryType.itemid": "监控项ID",
  "qb.queryType.triggers": "触发器",
  "qb.queryType.problems": "告警",
  "qb.queryType.macros": "宏变量",
  "qb.queryType.lld": "自动发现",
  // Zabbix QueryEditor — host/group/item fields
  "panel.group": "主机组",
  "panel.group.placeholder": "选择主机组",
  "panel.host": "主机",
  "panel.host.placeholder": "选择主机",
  "panel.itemTag": "监控项标签",
  "panel.itemTag.placeholder": "按标签过滤",
  "panel.items": "监控项",
  "panel.items.placeholder": "选择监控项",
  // Zabbix QueryEditor — query fields
  "qb.textFilter": "文本过滤",
  "qb.textFilter.placeholder": "正则表达式",
  "qb.useCaptureGroups": "使用捕获分组",
  "qb.itemIds": "监控项 ID",
  "qb.itemIds.placeholder": "多个 ID 用逗号分隔",
  "qb.triggerFilter": "触发器过滤",
  "qb.triggerFilter.placeholder": "触发器名称",
  "qb.problemName": "告警名称",
  "qb.problemName.placeholder": "告警名称过滤",
  "qb.tags": "标签",
  "qb.tags.placeholder": "tag:value",
  "qb.show": "显示",
  "qb.severity": "严重程度",
  "qb.itService": "IT服务",
  "qb.itService.placeholder": "选择IT服务",
  "qb.slaProperty": "SLA属性",
  "qb.slaInterval": "SLA时间间隔",
  "qb.macroFilter": "宏过滤",
  // Zabbix QueryEditor — LLD
  "qb.lld.rule": "发现规则",
  "qb.lld.rule.placeholder": "选择发现规则",
  "qb.lld.itemKeys": "监控项原型键",
  "qb.lld.itemKeys.placeholder": "选择原型键",
  // Zabbix QueryEditor — options
  "qb.ack.all": "所有",
  "qb.ack.unack": "未确认",
  "qb.ack.ack": "已确认",
  "qb.sort.default": "默认",
  "qb.sort.lastchange": "最后变更",
  "qb.sort.severity": "严重程度",
  "qb.trends.default": "默认",
  "qb.trends.true": "使用趋势",
  "qb.trends.false": "不使用趋势",
  "qb.options.trends": "趋势数据",
  "qb.options.showDisabled": "显示禁用项",
  "qb.options.valueMapping": "使用 Zabbix 值映射",
  "qb.options.disableAlignment": "禁用数据对齐",
  "qb.options.acknowledged": "确认状态",
  "qb.options.sortBy": "排序",
  "qb.options.useTimeRange": "使用时间范围",
  "qb.options.hostsInMaintenance": "维护中主机",
  "qb.options.hostProxy": "Host Proxy",
  "qb.options.limit": "数量限制"
}, yB = { zh: MA, en: vB }, AA = Symbol("lang");
function bB(t) {
  Xt(AA, t);
}
function On() {
  const t = qt(AA, de("zh"));
  function e(n, i) {
    let r = yB[t.value][n] ?? MA[n] ?? n;
    if (i)
      for (const [a, l] of Object.entries(i))
        r = r.replace(`{${a}}`, String(l));
    return r;
  }
  return { t: e, lang: t };
}
const xB = {
  hideHeader: !1,
  canEdit: !0,
  theme: null,
  lang: null,
  isEditing: null,
  initialEditingPanelId: null,
  datasourceConfig: null
}, RA = Symbol("argusBoardConfig");
function DA(t) {
  return { config: X8(A(t)) };
}
function OB(t) {
  const e = DA(t);
  return Xt(RA, e), e;
}
function Uf() {
  const t = qt(RA);
  return t || DA(() => xB);
}
function $f(t) {
  return {
    "Content-Type": "application/json",
    ...t.token ? { Authorization: `Bearer ${t.token}` } : {}
  };
}
async function SB(t) {
  const e = await fetch(`${t.url}/v2/metrics`, {
    method: "GET",
    headers: $f(t)
  });
  if (!e.ok)
    throw new Error(`Argus API HTTP error: ${e.status}`);
  return (await e.json()).data?.metrics ?? [];
}
async function wB(t, e) {
  const n = new URLSearchParams({ limit: String(e.limit) });
  e.searchText && n.set("searchText", e.searchText), e.source && n.set("source", e.source);
  const i = await fetch(`${t.url}/v2/metrics?${n.toString()}`, {
    method: "GET",
    headers: $f(t)
  });
  if (!i.ok)
    throw new Error(`Argus API HTTP error: ${i.status}`);
  const o = await i.json();
  return ((o?.data ?? o)?.metrics ?? []).map((l) => ({
    metricName: l.metricName,
    type: l.type ?? "",
    unit: l.unit ?? "",
    description: l.description ?? ""
  }));
}
async function bw(t, e) {
  const n = new URLSearchParams({
    signal: e.signal,
    searchText: e.searchText ?? "",
    metricName: e.metricName ?? "",
    fieldContext: e.fieldContext ?? "",
    fieldDataType: e.fieldDataType ?? "",
    source: e.signalSource ?? ""
  });
  try {
    const i = await fetch(`${t.url}/v1/fields/keys?${n.toString()}`, {
      method: "GET",
      headers: $f(t)
    });
    if (!i.ok)
      throw new Error(`Argus API HTTP error: ${i.status}`);
    const o = await i.json(), a = (o?.data ?? o)?.keys ?? {};
    return Object.entries(a).flatMap(
      ([l, s]) => (Array.isArray(s) ? s : []).map((u) => ({
        name: u.name ?? u.key ?? String(u),
        type: l,
        fieldDataType: u.fieldDataType ?? u.dataType
      }))
    );
  } catch {
    const i = new URLSearchParams({
      searchText: e.searchText ?? "",
      dataSource: e.signal
    }), o = await fetch(`${t.url}/v3/autocomplete/attribute_keys?${i.toString()}`, {
      method: "GET",
      headers: $f(t)
    });
    if (!o.ok)
      throw new Error(`Argus API HTTP error: ${o.status}`);
    const r = await o.json();
    return ((r?.data ?? r)?.attributeKeys ?? []).map((l) => ({
      name: l.key ?? l.name ?? String(l),
      type: l.tagType ?? l.type,
      fieldDataType: l.dataType ?? l.fieldDataType
    }));
  }
}
async function CB(t, e) {
  const n = new URLSearchParams({
    signal: e.signal,
    name: e.key,
    searchText: e.searchText ?? "",
    metricName: e.metricName ?? "",
    source: e.signalSource ?? ""
  });
  e.tagType && n.set("tagType", e.tagType);
  try {
    const i = await fetch(`${t.url}/v1/fields/values?${n.toString()}`, {
      method: "GET",
      headers: $f(t)
    });
    if (!i.ok)
      throw new Error(`Argus API HTTP error: ${i.status}`);
    const o = await i.json(), r = o?.data ?? o;
    return {
      stringValues: r?.stringValues ?? r?.stringAttributeValues ?? [],
      numberValues: (r?.numberValues ?? r?.numberAttributeValues ?? []).map(Number)
    };
  } catch {
    const i = new URLSearchParams({
      aggregateOperator: "noop",
      dataSource: e.signal,
      aggregateAttribute: "",
      attributeKey: e.key,
      searchText: e.searchText ?? ""
    });
    e.tagType && i.set("tagType", e.tagType);
    const o = await fetch(`${t.url}/v3/autocomplete/attribute_values?${i.toString()}`, {
      method: "GET",
      headers: $f(t)
    });
    if (!o.ok)
      throw new Error(`Argus API HTTP error: ${o.status}`);
    const r = await o.json(), a = r?.data ?? r;
    return {
      stringValues: a?.stringAttributeValues ?? [],
      numberValues: (a?.numberAttributeValues ?? []).map(Number)
    };
  }
}
function $B(t, e) {
  if (t.type === "builder_formula") {
    const { name: r, expression: a, disabled: l, legend: s, limit: u, order: c } = t.spec;
    return {
      type: t.type,
      spec: {
        name: r,
        expression: a,
        disabled: l,
        ...s ? { legend: s } : {},
        ...u != null ? { limit: u } : {},
        ...c && c.length > 0 ? { order: c } : {}
      }
    };
  }
  if (t.queryType === "promql")
    return {
      type: "promql",
      spec: {
        name: t.spec.name,
        query: t.rawQuery ?? "",
        disabled: t.spec.disabled,
        ...t.rawLegend ? { legend: t.rawLegend } : {},
        stats: !1
      }
    };
  if (t.queryType === "clickhouse_sql")
    return {
      type: "clickhouse_sql",
      spec: {
        name: t.spec.name,
        query: t.rawQuery ?? "",
        disabled: t.spec.disabled,
        ...t.rawLegend ? { legend: t.rawLegend } : {}
      }
    };
  const n = t.spec, i = n.signal === "metrics", o = n.aggregations.map((r) => {
    if (i && "metricName" in r) {
      const a = e.get(r.metricName);
      return { ...Object.fromEntries(Object.entries(r).filter(([s]) => s !== "metricType")), temporality: a?.temporality ?? "" };
    }
    return r;
  });
  return {
    type: t.type,
    spec: {
      name: n.name,
      signal: n.signal,
      ...n.source !== null && n.source !== void 0 ? { source: n.source } : {},
      stepInterval: n.stepInterval,
      disabled: n.disabled,
      filter: n.filter,
      aggregations: o,
      ...n.groupBy && n.groupBy.length > 0 ? { groupBy: n.groupBy } : {},
      ...n.having?.expression ? { having: n.having } : {},
      ...n.order && n.order.length > 0 ? { order: n.order } : {},
      ...n.functions && n.functions.length > 0 ? { functions: n.functions } : {},
      ...n.limit !== null && n.limit !== void 0 ? { limit: n.limit } : {},
      ...n.legend ? { legend: n.legend } : {}
    }
  };
}
function kB(t) {
  return t.spec.disabled ? !1 : t.type !== "builder_query" || t.queryType && t.queryType !== "builder" || t.spec.signal !== "metrics" ? !0 : t.spec.aggregations.some(
    (e) => typeof e.metricName == "string" && e.metricName.trim()
  );
}
async function TB(t, e, n, i, o) {
  const r = t.filter(kB);
  if (r.length === 0)
    return { data: { results: [] } };
  const a = o ?? /* @__PURE__ */ new Map(), l = e * 1e3, s = n * 1e3, u = {
    schemaVersion: "v1",
    start: l,
    end: s,
    requestType: "time_series",
    compositeQuery: {
      queries: r.map((f) => $B(f, a))
    },
    formatOptions: { formatTableResultForUI: !1, fillGaps: !1 },
    variables: {
      SIGNOZ_START_TIME: { value: l },
      SIGNOZ_END_TIME: { value: s }
    }
  }, c = await fetch(`${i.url}/v5/query_range`, {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      ...i.token ? { Authorization: `Bearer ${i.token}` } : {}
    },
    body: JSON.stringify(u)
  });
  if (!c.ok)
    throw new Error(`Argus API HTTP error: ${c.status}`);
  const d = await c.json();
  if (d.error)
    throw new Error(`Argus API error: ${d.error}`);
  return d?.data;
}
//! moment.js
//! version : 2.30.1
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
//! license : MIT
//! momentjs.com
var NA;
function Ct() {
  return NA.apply(null, arguments);
}
function PB(t) {
  NA = t;
}
function Ha(t) {
  return t instanceof Array || Object.prototype.toString.call(t) === "[object Array]";
}
function Ic(t) {
  return t != null && Object.prototype.toString.call(t) === "[object Object]";
}
function qn(t, e) {
  return Object.prototype.hasOwnProperty.call(t, e);
}
function xw(t) {
  if (Object.getOwnPropertyNames)
    return Object.getOwnPropertyNames(t).length === 0;
  var e;
  for (e in t)
    if (qn(t, e))
      return !1;
  return !0;
}
function dr(t) {
  return t === void 0;
}
function $s(t) {
  return typeof t == "number" || Object.prototype.toString.call(t) === "[object Number]";
}
function og(t) {
  return t instanceof Date || Object.prototype.toString.call(t) === "[object Date]";
}
function LA(t, e) {
  var n = [], i, o = t.length;
  for (i = 0; i < o; ++i)
    n.push(e(t[i], i));
  return n;
}
function vu(t, e) {
  for (var n in e)
    qn(e, n) && (t[n] = e[n]);
  return qn(e, "toString") && (t.toString = e.toString), qn(e, "valueOf") && (t.valueOf = e.valueOf), t;
}
function Rl(t, e, n, i) {
  return aR(t, e, n, i, !0).utc();
}
function EB() {
  return {
    empty: !1,
    unusedTokens: [],
    unusedInput: [],
    overflow: -2,
    charsLeftOver: 0,
    nullInput: !1,
    invalidEra: null,
    invalidMonth: null,
    invalidFormat: !1,
    userInvalidated: !1,
    iso: !1,
    parsedDateParts: [],
    era: null,
    meridiem: null,
    rfc2822: !1,
    weekdayMismatch: !1
  };
}
function mn(t) {
  return t._pf == null && (t._pf = EB()), t._pf;
}
var Ox;
Array.prototype.some ? Ox = Array.prototype.some : Ox = function(t) {
  var e = Object(this), n = e.length >>> 0, i;
  for (i = 0; i < n; i++)
    if (i in e && t.call(this, e[i], i, e))
      return !0;
  return !1;
};
function Ow(t) {
  var e = null, n = !1, i = t._d && !isNaN(t._d.getTime());
  if (i && (e = mn(t), n = Ox.call(e.parsedDateParts, function(o) {
    return o != null;
  }), i = e.overflow < 0 && !e.empty && !e.invalidEra && !e.invalidMonth && !e.invalidWeekday && !e.weekdayMismatch && !e.nullInput && !e.invalidFormat && !e.userInvalidated && (!e.meridiem || e.meridiem && n), t._strict && (i = i && e.charsLeftOver === 0 && e.unusedTokens.length === 0 && e.bigHour === void 0)), Object.isFrozen == null || !Object.isFrozen(t))
    t._isValid = i;
  else
    return i;
  return t._isValid;
}
function N0(t) {
  var e = Rl(NaN);
  return t != null ? vu(mn(e), t) : mn(e).userInvalidated = !0, e;
}
var Gk = Ct.momentProperties = [], mb = !1;
function Sw(t, e) {
  var n, i, o, r = Gk.length;
  if (dr(e._isAMomentObject) || (t._isAMomentObject = e._isAMomentObject), dr(e._i) || (t._i = e._i), dr(e._f) || (t._f = e._f), dr(e._l) || (t._l = e._l), dr(e._strict) || (t._strict = e._strict), dr(e._tzm) || (t._tzm = e._tzm), dr(e._isUTC) || (t._isUTC = e._isUTC), dr(e._offset) || (t._offset = e._offset), dr(e._pf) || (t._pf = mn(e)), dr(e._locale) || (t._locale = e._locale), r > 0)
    for (n = 0; n < r; n++)
      i = Gk[n], o = e[i], dr(o) || (t[i] = o);
  return t;
}
function rg(t) {
  Sw(this, t), this._d = new Date(t._d != null ? t._d.getTime() : NaN), this.isValid() || (this._d = /* @__PURE__ */ new Date(NaN)), mb === !1 && (mb = !0, Ct.updateOffset(this), mb = !1);
}
function Wa(t) {
  return t instanceof rg || t != null && t._isAMomentObject != null;
}
function zA(t) {
  Ct.suppressDeprecationWarnings === !1 && typeof console < "u" && console.warn && console.warn("Deprecation warning: " + t);
}
function ma(t, e) {
  var n = !0;
  return vu(function() {
    if (Ct.deprecationHandler != null && Ct.deprecationHandler(null, t), n) {
      var i = [], o, r, a, l = arguments.length;
      for (r = 0; r < l; r++) {
        if (o = "", typeof arguments[r] == "object") {
          o += `
[` + r + "] ";
          for (a in arguments[0])
            qn(arguments[0], a) && (o += a + ": " + arguments[0][a] + ", ");
          o = o.slice(0, -2);
        } else
          o = arguments[r];
        i.push(o);
      }
      zA(
        t + `
Arguments: ` + Array.prototype.slice.call(i).join("") + `
` + new Error().stack
      ), n = !1;
    }
    return e.apply(this, arguments);
  }, e);
}
var Uk = {};
function BA(t, e) {
  Ct.deprecationHandler != null && Ct.deprecationHandler(t, e), Uk[t] || (zA(e), Uk[t] = !0);
}
Ct.suppressDeprecationWarnings = !1;
Ct.deprecationHandler = null;
function Dl(t) {
  return typeof Function < "u" && t instanceof Function || Object.prototype.toString.call(t) === "[object Function]";
}
function _B(t) {
  var e, n;
  for (n in t)
    qn(t, n) && (e = t[n], Dl(e) ? this[n] = e : this["_" + n] = e);
  this._config = t, this._dayOfMonthOrdinalParseLenient = new RegExp(
    (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + "|" + /\d{1,2}/.source
  );
}
function Sx(t, e) {
  var n = vu({}, t), i;
  for (i in e)
    qn(e, i) && (Ic(t[i]) && Ic(e[i]) ? (n[i] = {}, vu(n[i], t[i]), vu(n[i], e[i])) : e[i] != null ? n[i] = e[i] : delete n[i]);
  for (i in t)
    qn(t, i) && !qn(e, i) && Ic(t[i]) && (n[i] = vu({}, n[i]));
  return n;
}
function ww(t) {
  t != null && this.set(t);
}
var wx;
Object.keys ? wx = Object.keys : wx = function(t) {
  var e, n = [];
  for (e in t)
    qn(t, e) && n.push(e);
  return n;
};
var IB = {
  sameDay: "[Today at] LT",
  nextDay: "[Tomorrow at] LT",
  nextWeek: "dddd [at] LT",
  lastDay: "[Yesterday at] LT",
  lastWeek: "[Last] dddd [at] LT",
  sameElse: "L"
};
function MB(t, e, n) {
  var i = this._calendar[t] || this._calendar.sameElse;
  return Dl(i) ? i.call(e, n) : i;
}
function El(t, e, n) {
  var i = "" + Math.abs(t), o = e - i.length, r = t >= 0;
  return (r ? n ? "+" : "" : "-") + Math.pow(10, Math.max(0, o)).toString().substr(1) + i;
}
var Cw = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g, qg = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, vb = {}, tf = {};
function Zt(t, e, n, i) {
  var o = i;
  typeof i == "string" && (o = function() {
    return this[i]();
  }), t && (tf[t] = o), e && (tf[e[0]] = function() {
    return El(o.apply(this, arguments), e[1], e[2]);
  }), n && (tf[n] = function() {
    return this.localeData().ordinal(
      o.apply(this, arguments),
      t
    );
  });
}
function AB(t) {
  return t.match(/\[[\s\S]/) ? t.replace(/^\[|\]$/g, "") : t.replace(/\\/g, "");
}
function RB(t) {
  var e = t.match(Cw), n, i;
  for (n = 0, i = e.length; n < i; n++)
    tf[e[n]] ? e[n] = tf[e[n]] : e[n] = AB(e[n]);
  return function(o) {
    var r = "", a;
    for (a = 0; a < i; a++)
      r += Dl(e[a]) ? e[a].call(o, t) : e[a];
    return r;
  };
}
function Um(t, e) {
  return t.isValid() ? (e = FA(e, t.localeData()), vb[e] = vb[e] || RB(e), vb[e](t)) : t.localeData().invalidDate();
}
function FA(t, e) {
  var n = 5;
  function i(o) {
    return e.longDateFormat(o) || o;
  }
  for (qg.lastIndex = 0; n >= 0 && qg.test(t); )
    t = t.replace(
      qg,
      i
    ), qg.lastIndex = 0, n -= 1;
  return t;
}
var DB = {
  LTS: "h:mm:ss A",
  LT: "h:mm A",
  L: "MM/DD/YYYY",
  LL: "MMMM D, YYYY",
  LLL: "MMMM D, YYYY h:mm A",
  LLLL: "dddd, MMMM D, YYYY h:mm A"
};
function NB(t) {
  var e = this._longDateFormat[t], n = this._longDateFormat[t.toUpperCase()];
  return e || !n ? e : (this._longDateFormat[t] = n.match(Cw).map(function(i) {
    return i === "MMMM" || i === "MM" || i === "DD" || i === "dddd" ? i.slice(1) : i;
  }).join(""), this._longDateFormat[t]);
}
var LB = "Invalid date";
function zB() {
  return this._invalidDate;
}
var BB = "%d", FB = /\d{1,2}/;
function VB(t) {
  return this._ordinal.replace("%d", t);
}
var QB = {
  future: "in %s",
  past: "%s ago",
  s: "a few seconds",
  ss: "%d seconds",
  m: "a minute",
  mm: "%d minutes",
  h: "an hour",
  hh: "%d hours",
  d: "a day",
  dd: "%d days",
  w: "a week",
  ww: "%d weeks",
  M: "a month",
  MM: "%d months",
  y: "a year",
  yy: "%d years"
};
function HB(t, e, n, i) {
  var o = this._relativeTime[n];
  return Dl(o) ? o(t, e, n, i) : o.replace(/%d/i, t);
}
function WB(t, e) {
  var n = this._relativeTime[t > 0 ? "future" : "past"];
  return Dl(n) ? n(e) : n.replace(/%s/i, e);
}
var Jk = {
  D: "date",
  dates: "date",
  date: "date",
  d: "day",
  days: "day",
  day: "day",
  e: "weekday",
  weekdays: "weekday",
  weekday: "weekday",
  E: "isoWeekday",
  isoweekdays: "isoWeekday",
  isoweekday: "isoWeekday",
  DDD: "dayOfYear",
  dayofyears: "dayOfYear",
  dayofyear: "dayOfYear",
  h: "hour",
  hours: "hour",
  hour: "hour",
  ms: "millisecond",
  milliseconds: "millisecond",
  millisecond: "millisecond",
  m: "minute",
  minutes: "minute",
  minute: "minute",
  M: "month",
  months: "month",
  month: "month",
  Q: "quarter",
  quarters: "quarter",
  quarter: "quarter",
  s: "second",
  seconds: "second",
  second: "second",
  gg: "weekYear",
  weekyears: "weekYear",
  weekyear: "weekYear",
  GG: "isoWeekYear",
  isoweekyears: "isoWeekYear",
  isoweekyear: "isoWeekYear",
  w: "week",
  weeks: "week",
  week: "week",
  W: "isoWeek",
  isoweeks: "isoWeek",
  isoweek: "isoWeek",
  y: "year",
  years: "year",
  year: "year"
};
function va(t) {
  return typeof t == "string" ? Jk[t] || Jk[t.toLowerCase()] : void 0;
}
function $w(t) {
  var e = {}, n, i;
  for (i in t)
    qn(t, i) && (n = va(i), n && (e[n] = t[i]));
  return e;
}
var jB = {
  date: 9,
  day: 11,
  weekday: 11,
  isoWeekday: 11,
  dayOfYear: 4,
  hour: 13,
  millisecond: 16,
  minute: 14,
  month: 8,
  quarter: 7,
  second: 15,
  weekYear: 1,
  isoWeekYear: 1,
  week: 5,
  isoWeek: 5,
  year: 1
};
function qB(t) {
  var e = [], n;
  for (n in t)
    qn(t, n) && e.push({ unit: n, priority: jB[n] });
  return e.sort(function(i, o) {
    return i.priority - o.priority;
  }), e;
}
var VA = /\d/, Qr = /\d\d/, QA = /\d{3}/, kw = /\d{4}/, L0 = /[+-]?\d{6}/, Ti = /\d\d?/, HA = /\d\d\d\d?/, WA = /\d\d\d\d\d\d?/, z0 = /\d{1,3}/, Tw = /\d{1,4}/, B0 = /[+-]?\d{1,6}/, Jf = /\d+/, F0 = /[+-]?\d+/, YB = /Z|[+-]\d\d:?\d\d/gi, V0 = /Z|[+-]\d\d(?::?\d\d)?/gi, KB = /[+-]?\d+(\.\d{1,3})?/, ag = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i, eh = /^[1-9]\d?/, Pw = /^([1-9]\d|\d)/, Ev;
Ev = {};
function Mt(t, e, n) {
  Ev[t] = Dl(e) ? e : function(i, o) {
    return i && n ? n : e;
  };
}
function XB(t, e) {
  return qn(Ev, t) ? Ev[t](e._strict, e._locale) : new RegExp(ZB(t));
}
function ZB(t) {
  return gs(
    t.replace("\\", "").replace(
      /\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,
      function(e, n, i, o, r) {
        return n || i || o || r;
      }
    )
  );
}
function gs(t) {
  return t.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
}
function oa(t) {
  return t < 0 ? Math.ceil(t) || 0 : Math.floor(t);
}
function Mn(t) {
  var e = +t, n = 0;
  return e !== 0 && isFinite(e) && (n = oa(e)), n;
}
var Cx = {};
function ci(t, e) {
  var n, i = e, o;
  for (typeof t == "string" && (t = [t]), $s(e) && (i = function(r, a) {
    a[e] = Mn(r);
  }), o = t.length, n = 0; n < o; n++)
    Cx[t[n]] = i;
}
function lg(t, e) {
  ci(t, function(n, i, o, r) {
    o._w = o._w || {}, e(n, o._w, o, r);
  });
}
function GB(t, e, n) {
  e != null && qn(Cx, t) && Cx[t](e, n._a, n, t);
}
function Q0(t) {
  return t % 4 === 0 && t % 100 !== 0 || t % 400 === 0;
}
var Qo = 0, us = 1, yl = 2, co = 3, Da = 4, cs = 5, Cc = 6, UB = 7, JB = 8;
Zt("Y", 0, 0, function() {
  var t = this.year();
  return t <= 9999 ? El(t, 4) : "+" + t;
});
Zt(0, ["YY", 2], 0, function() {
  return this.year() % 100;
});
Zt(0, ["YYYY", 4], 0, "year");
Zt(0, ["YYYYY", 5], 0, "year");
Zt(0, ["YYYYYY", 6, !0], 0, "year");
Mt("Y", F0);
Mt("YY", Ti, Qr);
Mt("YYYY", Tw, kw);
Mt("YYYYY", B0, L0);
Mt("YYYYYY", B0, L0);
ci(["YYYYY", "YYYYYY"], Qo);
ci("YYYY", function(t, e) {
  e[Qo] = t.length === 2 ? Ct.parseTwoDigitYear(t) : Mn(t);
});
ci("YY", function(t, e) {
  e[Qo] = Ct.parseTwoDigitYear(t);
});
ci("Y", function(t, e) {
  e[Qo] = parseInt(t, 10);
});
function ep(t) {
  return Q0(t) ? 366 : 365;
}
Ct.parseTwoDigitYear = function(t) {
  return Mn(t) + (Mn(t) > 68 ? 1900 : 2e3);
};
var jA = th("FullYear", !0);
function eF() {
  return Q0(this.year());
}
function th(t, e) {
  return function(n) {
    return n != null ? (qA(this, t, n), Ct.updateOffset(this, e), this) : Pp(this, t);
  };
}
function Pp(t, e) {
  if (!t.isValid())
    return NaN;
  var n = t._d, i = t._isUTC;
  switch (e) {
    case "Milliseconds":
      return i ? n.getUTCMilliseconds() : n.getMilliseconds();
    case "Seconds":
      return i ? n.getUTCSeconds() : n.getSeconds();
    case "Minutes":
      return i ? n.getUTCMinutes() : n.getMinutes();
    case "Hours":
      return i ? n.getUTCHours() : n.getHours();
    case "Date":
      return i ? n.getUTCDate() : n.getDate();
    case "Day":
      return i ? n.getUTCDay() : n.getDay();
    case "Month":
      return i ? n.getUTCMonth() : n.getMonth();
    case "FullYear":
      return i ? n.getUTCFullYear() : n.getFullYear();
    default:
      return NaN;
  }
}
function qA(t, e, n) {
  var i, o, r, a, l;
  if (!(!t.isValid() || isNaN(n))) {
    switch (i = t._d, o = t._isUTC, e) {
      case "Milliseconds":
        return void (o ? i.setUTCMilliseconds(n) : i.setMilliseconds(n));
      case "Seconds":
        return void (o ? i.setUTCSeconds(n) : i.setSeconds(n));
      case "Minutes":
        return void (o ? i.setUTCMinutes(n) : i.setMinutes(n));
      case "Hours":
        return void (o ? i.setUTCHours(n) : i.setHours(n));
      case "Date":
        return void (o ? i.setUTCDate(n) : i.setDate(n));
      // case 'Day': // Not real
      //    return void (isUTC ? d.setUTCDay(value) : d.setDay(value));
      // case 'Month': // Not used because we need to pass two variables
      //     return void (isUTC ? d.setUTCMonth(value) : d.setMonth(value));
      case "FullYear":
        break;
      // See below ...
      default:
        return;
    }
    r = n, a = t.month(), l = t.date(), l = l === 29 && a === 1 && !Q0(r) ? 28 : l, o ? i.setUTCFullYear(r, a, l) : i.setFullYear(r, a, l);
  }
}
function tF(t) {
  return t = va(t), Dl(this[t]) ? this[t]() : this;
}
function nF(t, e) {
  if (typeof t == "object") {
    t = $w(t);
    var n = qB(t), i, o = n.length;
    for (i = 0; i < o; i++)
      this[n[i].unit](t[n[i].unit]);
  } else if (t = va(t), Dl(this[t]))
    return this[t](e);
  return this;
}
function iF(t, e) {
  return (t % e + e) % e;
}
var Ki;
Array.prototype.indexOf ? Ki = Array.prototype.indexOf : Ki = function(t) {
  var e;
  for (e = 0; e < this.length; ++e)
    if (this[e] === t)
      return e;
  return -1;
};
function Ew(t, e) {
  if (isNaN(t) || isNaN(e))
    return NaN;
  var n = iF(e, 12);
  return t += (e - n) / 12, n === 1 ? Q0(t) ? 29 : 28 : 31 - n % 7 % 2;
}
Zt("M", ["MM", 2], "Mo", function() {
  return this.month() + 1;
});
Zt("MMM", 0, 0, function(t) {
  return this.localeData().monthsShort(this, t);
});
Zt("MMMM", 0, 0, function(t) {
  return this.localeData().months(this, t);
});
Mt("M", Ti, eh);
Mt("MM", Ti, Qr);
Mt("MMM", function(t, e) {
  return e.monthsShortRegex(t);
});
Mt("MMMM", function(t, e) {
  return e.monthsRegex(t);
});
ci(["M", "MM"], function(t, e) {
  e[us] = Mn(t) - 1;
});
ci(["MMM", "MMMM"], function(t, e, n, i) {
  var o = n._locale.monthsParse(t, i, n._strict);
  o != null ? e[us] = o : mn(n).invalidMonth = t;
});
var oF = "January_February_March_April_May_June_July_August_September_October_November_December".split(
  "_"
), YA = "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), KA = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/, rF = ag, aF = ag;
function lF(t, e) {
  return t ? Ha(this._months) ? this._months[t.month()] : this._months[(this._months.isFormat || KA).test(e) ? "format" : "standalone"][t.month()] : Ha(this._months) ? this._months : this._months.standalone;
}
function sF(t, e) {
  return t ? Ha(this._monthsShort) ? this._monthsShort[t.month()] : this._monthsShort[KA.test(e) ? "format" : "standalone"][t.month()] : Ha(this._monthsShort) ? this._monthsShort : this._monthsShort.standalone;
}
function uF(t, e, n) {
  var i, o, r, a = t.toLocaleLowerCase();
  if (!this._monthsParse)
    for (this._monthsParse = [], this._longMonthsParse = [], this._shortMonthsParse = [], i = 0; i < 12; ++i)
      r = Rl([2e3, i]), this._shortMonthsParse[i] = this.monthsShort(
        r,
        ""
      ).toLocaleLowerCase(), this._longMonthsParse[i] = this.months(r, "").toLocaleLowerCase();
  return n ? e === "MMM" ? (o = Ki.call(this._shortMonthsParse, a), o !== -1 ? o : null) : (o = Ki.call(this._longMonthsParse, a), o !== -1 ? o : null) : e === "MMM" ? (o = Ki.call(this._shortMonthsParse, a), o !== -1 ? o : (o = Ki.call(this._longMonthsParse, a), o !== -1 ? o : null)) : (o = Ki.call(this._longMonthsParse, a), o !== -1 ? o : (o = Ki.call(this._shortMonthsParse, a), o !== -1 ? o : null));
}
function cF(t, e, n) {
  var i, o, r;
  if (this._monthsParseExact)
    return uF.call(this, t, e, n);
  for (this._monthsParse || (this._monthsParse = [], this._longMonthsParse = [], this._shortMonthsParse = []), i = 0; i < 12; i++) {
    if (o = Rl([2e3, i]), n && !this._longMonthsParse[i] && (this._longMonthsParse[i] = new RegExp(
      "^" + this.months(o, "").replace(".", "") + "$",
      "i"
    ), this._shortMonthsParse[i] = new RegExp(
      "^" + this.monthsShort(o, "").replace(".", "") + "$",
      "i"
    )), !n && !this._monthsParse[i] && (r = "^" + this.months(o, "") + "|^" + this.monthsShort(o, ""), this._monthsParse[i] = new RegExp(r.replace(".", ""), "i")), n && e === "MMMM" && this._longMonthsParse[i].test(t))
      return i;
    if (n && e === "MMM" && this._shortMonthsParse[i].test(t))
      return i;
    if (!n && this._monthsParse[i].test(t))
      return i;
  }
}
function XA(t, e) {
  if (!t.isValid())
    return t;
  if (typeof e == "string") {
    if (/^\d+$/.test(e))
      e = Mn(e);
    else if (e = t.localeData().monthsParse(e), !$s(e))
      return t;
  }
  var n = e, i = t.date();
  return i = i < 29 ? i : Math.min(i, Ew(t.year(), n)), t._isUTC ? t._d.setUTCMonth(n, i) : t._d.setMonth(n, i), t;
}
function ZA(t) {
  return t != null ? (XA(this, t), Ct.updateOffset(this, !0), this) : Pp(this, "Month");
}
function dF() {
  return Ew(this.year(), this.month());
}
function fF(t) {
  return this._monthsParseExact ? (qn(this, "_monthsRegex") || GA.call(this), t ? this._monthsShortStrictRegex : this._monthsShortRegex) : (qn(this, "_monthsShortRegex") || (this._monthsShortRegex = rF), this._monthsShortStrictRegex && t ? this._monthsShortStrictRegex : this._monthsShortRegex);
}
function hF(t) {
  return this._monthsParseExact ? (qn(this, "_monthsRegex") || GA.call(this), t ? this._monthsStrictRegex : this._monthsRegex) : (qn(this, "_monthsRegex") || (this._monthsRegex = aF), this._monthsStrictRegex && t ? this._monthsStrictRegex : this._monthsRegex);
}
function GA() {
  function t(s, u) {
    return u.length - s.length;
  }
  var e = [], n = [], i = [], o, r, a, l;
  for (o = 0; o < 12; o++)
    r = Rl([2e3, o]), a = gs(this.monthsShort(r, "")), l = gs(this.months(r, "")), e.push(a), n.push(l), i.push(l), i.push(a);
  e.sort(t), n.sort(t), i.sort(t), this._monthsRegex = new RegExp("^(" + i.join("|") + ")", "i"), this._monthsShortRegex = this._monthsRegex, this._monthsStrictRegex = new RegExp(
    "^(" + n.join("|") + ")",
    "i"
  ), this._monthsShortStrictRegex = new RegExp(
    "^(" + e.join("|") + ")",
    "i"
  );
}
function pF(t, e, n, i, o, r, a) {
  var l;
  return t < 100 && t >= 0 ? (l = new Date(t + 400, e, n, i, o, r, a), isFinite(l.getFullYear()) && l.setFullYear(t)) : l = new Date(t, e, n, i, o, r, a), l;
}
function Ep(t) {
  var e, n;
  return t < 100 && t >= 0 ? (n = Array.prototype.slice.call(arguments), n[0] = t + 400, e = new Date(Date.UTC.apply(null, n)), isFinite(e.getUTCFullYear()) && e.setUTCFullYear(t)) : e = new Date(Date.UTC.apply(null, arguments)), e;
}
function _v(t, e, n) {
  var i = 7 + e - n, o = (7 + Ep(t, 0, i).getUTCDay() - e) % 7;
  return -o + i - 1;
}
function UA(t, e, n, i, o) {
  var r = (7 + n - i) % 7, a = _v(t, i, o), l = 1 + 7 * (e - 1) + r + a, s, u;
  return l <= 0 ? (s = t - 1, u = ep(s) + l) : l > ep(t) ? (s = t + 1, u = l - ep(t)) : (s = t, u = l), {
    year: s,
    dayOfYear: u
  };
}
function _p(t, e, n) {
  var i = _v(t.year(), e, n), o = Math.floor((t.dayOfYear() - i - 1) / 7) + 1, r, a;
  return o < 1 ? (a = t.year() - 1, r = o + ms(a, e, n)) : o > ms(t.year(), e, n) ? (r = o - ms(t.year(), e, n), a = t.year() + 1) : (a = t.year(), r = o), {
    week: r,
    year: a
  };
}
function ms(t, e, n) {
  var i = _v(t, e, n), o = _v(t + 1, e, n);
  return (ep(t) - i + o) / 7;
}
Zt("w", ["ww", 2], "wo", "week");
Zt("W", ["WW", 2], "Wo", "isoWeek");
Mt("w", Ti, eh);
Mt("ww", Ti, Qr);
Mt("W", Ti, eh);
Mt("WW", Ti, Qr);
lg(
  ["w", "ww", "W", "WW"],
  function(t, e, n, i) {
    e[i.substr(0, 1)] = Mn(t);
  }
);
function gF(t) {
  return _p(t, this._week.dow, this._week.doy).week;
}
var mF = {
  dow: 0,
  // Sunday is the first day of the week.
  doy: 6
  // The week that contains Jan 6th is the first week of the year.
};
function vF() {
  return this._week.dow;
}
function yF() {
  return this._week.doy;
}
function bF(t) {
  var e = this.localeData().week(this);
  return t == null ? e : this.add((t - e) * 7, "d");
}
function xF(t) {
  var e = _p(this, 1, 4).week;
  return t == null ? e : this.add((t - e) * 7, "d");
}
Zt("d", 0, "do", "day");
Zt("dd", 0, 0, function(t) {
  return this.localeData().weekdaysMin(this, t);
});
Zt("ddd", 0, 0, function(t) {
  return this.localeData().weekdaysShort(this, t);
});
Zt("dddd", 0, 0, function(t) {
  return this.localeData().weekdays(this, t);
});
Zt("e", 0, 0, "weekday");
Zt("E", 0, 0, "isoWeekday");
Mt("d", Ti);
Mt("e", Ti);
Mt("E", Ti);
Mt("dd", function(t, e) {
  return e.weekdaysMinRegex(t);
});
Mt("ddd", function(t, e) {
  return e.weekdaysShortRegex(t);
});
Mt("dddd", function(t, e) {
  return e.weekdaysRegex(t);
});
lg(["dd", "ddd", "dddd"], function(t, e, n, i) {
  var o = n._locale.weekdaysParse(t, i, n._strict);
  o != null ? e.d = o : mn(n).invalidWeekday = t;
});
lg(["d", "e", "E"], function(t, e, n, i) {
  e[i] = Mn(t);
});
function OF(t, e) {
  return typeof t != "string" ? t : isNaN(t) ? (t = e.weekdaysParse(t), typeof t == "number" ? t : null) : parseInt(t, 10);
}
function SF(t, e) {
  return typeof t == "string" ? e.weekdaysParse(t) % 7 || 7 : isNaN(t) ? null : t;
}
function _w(t, e) {
  return t.slice(e, 7).concat(t.slice(0, e));
}
var wF = "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), JA = "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), CF = "Su_Mo_Tu_We_Th_Fr_Sa".split("_"), $F = ag, kF = ag, TF = ag;
function PF(t, e) {
  var n = Ha(this._weekdays) ? this._weekdays : this._weekdays[t && t !== !0 && this._weekdays.isFormat.test(e) ? "format" : "standalone"];
  return t === !0 ? _w(n, this._week.dow) : t ? n[t.day()] : n;
}
function EF(t) {
  return t === !0 ? _w(this._weekdaysShort, this._week.dow) : t ? this._weekdaysShort[t.day()] : this._weekdaysShort;
}
function _F(t) {
  return t === !0 ? _w(this._weekdaysMin, this._week.dow) : t ? this._weekdaysMin[t.day()] : this._weekdaysMin;
}
function IF(t, e, n) {
  var i, o, r, a = t.toLocaleLowerCase();
  if (!this._weekdaysParse)
    for (this._weekdaysParse = [], this._shortWeekdaysParse = [], this._minWeekdaysParse = [], i = 0; i < 7; ++i)
      r = Rl([2e3, 1]).day(i), this._minWeekdaysParse[i] = this.weekdaysMin(
        r,
        ""
      ).toLocaleLowerCase(), this._shortWeekdaysParse[i] = this.weekdaysShort(
        r,
        ""
      ).toLocaleLowerCase(), this._weekdaysParse[i] = this.weekdays(r, "").toLocaleLowerCase();
  return n ? e === "dddd" ? (o = Ki.call(this._weekdaysParse, a), o !== -1 ? o : null) : e === "ddd" ? (o = Ki.call(this._shortWeekdaysParse, a), o !== -1 ? o : null) : (o = Ki.call(this._minWeekdaysParse, a), o !== -1 ? o : null) : e === "dddd" ? (o = Ki.call(this._weekdaysParse, a), o !== -1 || (o = Ki.call(this._shortWeekdaysParse, a), o !== -1) ? o : (o = Ki.call(this._minWeekdaysParse, a), o !== -1 ? o : null)) : e === "ddd" ? (o = Ki.call(this._shortWeekdaysParse, a), o !== -1 || (o = Ki.call(this._weekdaysParse, a), o !== -1) ? o : (o = Ki.call(this._minWeekdaysParse, a), o !== -1 ? o : null)) : (o = Ki.call(this._minWeekdaysParse, a), o !== -1 || (o = Ki.call(this._weekdaysParse, a), o !== -1) ? o : (o = Ki.call(this._shortWeekdaysParse, a), o !== -1 ? o : null));
}
function MF(t, e, n) {
  var i, o, r;
  if (this._weekdaysParseExact)
    return IF.call(this, t, e, n);
  for (this._weekdaysParse || (this._weekdaysParse = [], this._minWeekdaysParse = [], this._shortWeekdaysParse = [], this._fullWeekdaysParse = []), i = 0; i < 7; i++) {
    if (o = Rl([2e3, 1]).day(i), n && !this._fullWeekdaysParse[i] && (this._fullWeekdaysParse[i] = new RegExp(
      "^" + this.weekdays(o, "").replace(".", "\\.?") + "$",
      "i"
    ), this._shortWeekdaysParse[i] = new RegExp(
      "^" + this.weekdaysShort(o, "").replace(".", "\\.?") + "$",
      "i"
    ), this._minWeekdaysParse[i] = new RegExp(
      "^" + this.weekdaysMin(o, "").replace(".", "\\.?") + "$",
      "i"
    )), this._weekdaysParse[i] || (r = "^" + this.weekdays(o, "") + "|^" + this.weekdaysShort(o, "") + "|^" + this.weekdaysMin(o, ""), this._weekdaysParse[i] = new RegExp(r.replace(".", ""), "i")), n && e === "dddd" && this._fullWeekdaysParse[i].test(t))
      return i;
    if (n && e === "ddd" && this._shortWeekdaysParse[i].test(t))
      return i;
    if (n && e === "dd" && this._minWeekdaysParse[i].test(t))
      return i;
    if (!n && this._weekdaysParse[i].test(t))
      return i;
  }
}
function AF(t) {
  if (!this.isValid())
    return t != null ? this : NaN;
  var e = Pp(this, "Day");
  return t != null ? (t = OF(t, this.localeData()), this.add(t - e, "d")) : e;
}
function RF(t) {
  if (!this.isValid())
    return t != null ? this : NaN;
  var e = (this.day() + 7 - this.localeData()._week.dow) % 7;
  return t == null ? e : this.add(t - e, "d");
}
function DF(t) {
  if (!this.isValid())
    return t != null ? this : NaN;
  if (t != null) {
    var e = SF(t, this.localeData());
    return this.day(this.day() % 7 ? e : e - 7);
  } else
    return this.day() || 7;
}
function NF(t) {
  return this._weekdaysParseExact ? (qn(this, "_weekdaysRegex") || Iw.call(this), t ? this._weekdaysStrictRegex : this._weekdaysRegex) : (qn(this, "_weekdaysRegex") || (this._weekdaysRegex = $F), this._weekdaysStrictRegex && t ? this._weekdaysStrictRegex : this._weekdaysRegex);
}
function LF(t) {
  return this._weekdaysParseExact ? (qn(this, "_weekdaysRegex") || Iw.call(this), t ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex) : (qn(this, "_weekdaysShortRegex") || (this._weekdaysShortRegex = kF), this._weekdaysShortStrictRegex && t ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex);
}
function zF(t) {
  return this._weekdaysParseExact ? (qn(this, "_weekdaysRegex") || Iw.call(this), t ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex) : (qn(this, "_weekdaysMinRegex") || (this._weekdaysMinRegex = TF), this._weekdaysMinStrictRegex && t ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex);
}
function Iw() {
  function t(c, d) {
    return d.length - c.length;
  }
  var e = [], n = [], i = [], o = [], r, a, l, s, u;
  for (r = 0; r < 7; r++)
    a = Rl([2e3, 1]).day(r), l = gs(this.weekdaysMin(a, "")), s = gs(this.weekdaysShort(a, "")), u = gs(this.weekdays(a, "")), e.push(l), n.push(s), i.push(u), o.push(l), o.push(s), o.push(u);
  e.sort(t), n.sort(t), i.sort(t), o.sort(t), this._weekdaysRegex = new RegExp("^(" + o.join("|") + ")", "i"), this._weekdaysShortRegex = this._weekdaysRegex, this._weekdaysMinRegex = this._weekdaysRegex, this._weekdaysStrictRegex = new RegExp(
    "^(" + i.join("|") + ")",
    "i"
  ), this._weekdaysShortStrictRegex = new RegExp(
    "^(" + n.join("|") + ")",
    "i"
  ), this._weekdaysMinStrictRegex = new RegExp(
    "^(" + e.join("|") + ")",
    "i"
  );
}
function Mw() {
  return this.hours() % 12 || 12;
}
function BF() {
  return this.hours() || 24;
}
Zt("H", ["HH", 2], 0, "hour");
Zt("h", ["hh", 2], 0, Mw);
Zt("k", ["kk", 2], 0, BF);
Zt("hmm", 0, 0, function() {
  return "" + Mw.apply(this) + El(this.minutes(), 2);
});
Zt("hmmss", 0, 0, function() {
  return "" + Mw.apply(this) + El(this.minutes(), 2) + El(this.seconds(), 2);
});
Zt("Hmm", 0, 0, function() {
  return "" + this.hours() + El(this.minutes(), 2);
});
Zt("Hmmss", 0, 0, function() {
  return "" + this.hours() + El(this.minutes(), 2) + El(this.seconds(), 2);
});
function eR(t, e) {
  Zt(t, 0, 0, function() {
    return this.localeData().meridiem(
      this.hours(),
      this.minutes(),
      e
    );
  });
}
eR("a", !0);
eR("A", !1);
function tR(t, e) {
  return e._meridiemParse;
}
Mt("a", tR);
Mt("A", tR);
Mt("H", Ti, Pw);
Mt("h", Ti, eh);
Mt("k", Ti, eh);
Mt("HH", Ti, Qr);
Mt("hh", Ti, Qr);
Mt("kk", Ti, Qr);
Mt("hmm", HA);
Mt("hmmss", WA);
Mt("Hmm", HA);
Mt("Hmmss", WA);
ci(["H", "HH"], co);
ci(["k", "kk"], function(t, e, n) {
  var i = Mn(t);
  e[co] = i === 24 ? 0 : i;
});
ci(["a", "A"], function(t, e, n) {
  n._isPm = n._locale.isPM(t), n._meridiem = t;
});
ci(["h", "hh"], function(t, e, n) {
  e[co] = Mn(t), mn(n).bigHour = !0;
});
ci("hmm", function(t, e, n) {
  var i = t.length - 2;
  e[co] = Mn(t.substr(0, i)), e[Da] = Mn(t.substr(i)), mn(n).bigHour = !0;
});
ci("hmmss", function(t, e, n) {
  var i = t.length - 4, o = t.length - 2;
  e[co] = Mn(t.substr(0, i)), e[Da] = Mn(t.substr(i, 2)), e[cs] = Mn(t.substr(o)), mn(n).bigHour = !0;
});
ci("Hmm", function(t, e, n) {
  var i = t.length - 2;
  e[co] = Mn(t.substr(0, i)), e[Da] = Mn(t.substr(i));
});
ci("Hmmss", function(t, e, n) {
  var i = t.length - 4, o = t.length - 2;
  e[co] = Mn(t.substr(0, i)), e[Da] = Mn(t.substr(i, 2)), e[cs] = Mn(t.substr(o));
});
function FF(t) {
  return (t + "").toLowerCase().charAt(0) === "p";
}
var VF = /[ap]\.?m?\.?/i, QF = th("Hours", !0);
function HF(t, e, n) {
  return t > 11 ? n ? "pm" : "PM" : n ? "am" : "AM";
}
var nR = {
  calendar: IB,
  longDateFormat: DB,
  invalidDate: LB,
  ordinal: BB,
  dayOfMonthOrdinalParse: FB,
  relativeTime: QB,
  months: oF,
  monthsShort: YA,
  week: mF,
  weekdays: wF,
  weekdaysMin: CF,
  weekdaysShort: JA,
  meridiemParse: VF
}, Ii = {}, Ch = {}, Ip;
function WF(t, e) {
  var n, i = Math.min(t.length, e.length);
  for (n = 0; n < i; n += 1)
    if (t[n] !== e[n])
      return n;
  return i;
}
function eT(t) {
  return t && t.toLowerCase().replace("_", "-");
}
function jF(t) {
  for (var e = 0, n, i, o, r; e < t.length; ) {
    for (r = eT(t[e]).split("-"), n = r.length, i = eT(t[e + 1]), i = i ? i.split("-") : null; n > 0; ) {
      if (o = H0(r.slice(0, n).join("-")), o)
        return o;
      if (i && i.length >= n && WF(r, i) >= n - 1)
        break;
      n--;
    }
    e++;
  }
  return Ip;
}
function qF(t) {
  return !!(t && t.match("^[^/\\\\]*$"));
}
function H0(t) {
  var e = null, n;
  if (Ii[t] === void 0 && typeof module < "u" && module && module.exports && qF(t))
    try {
      e = Ip._abbr, n = require, n("./locale/" + t), $u(e);
    } catch {
      Ii[t] = null;
    }
  return Ii[t];
}
function $u(t, e) {
  var n;
  return t && (dr(e) ? n = Ls(t) : n = Aw(t, e), n ? Ip = n : typeof console < "u" && console.warn && console.warn(
    "Locale " + t + " not found. Did you forget to load it?"
  )), Ip._abbr;
}
function Aw(t, e) {
  if (e !== null) {
    var n, i = nR;
    if (e.abbr = t, Ii[t] != null)
      BA(
        "defineLocaleOverride",
        "use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."
      ), i = Ii[t]._config;
    else if (e.parentLocale != null)
      if (Ii[e.parentLocale] != null)
        i = Ii[e.parentLocale]._config;
      else if (n = H0(e.parentLocale), n != null)
        i = n._config;
      else
        return Ch[e.parentLocale] || (Ch[e.parentLocale] = []), Ch[e.parentLocale].push({
          name: t,
          config: e
        }), null;
    return Ii[t] = new ww(Sx(i, e)), Ch[t] && Ch[t].forEach(function(o) {
      Aw(o.name, o.config);
    }), $u(t), Ii[t];
  } else
    return delete Ii[t], null;
}
function YF(t, e) {
  if (e != null) {
    var n, i, o = nR;
    Ii[t] != null && Ii[t].parentLocale != null ? Ii[t].set(Sx(Ii[t]._config, e)) : (i = H0(t), i != null && (o = i._config), e = Sx(o, e), i == null && (e.abbr = t), n = new ww(e), n.parentLocale = Ii[t], Ii[t] = n), $u(t);
  } else
    Ii[t] != null && (Ii[t].parentLocale != null ? (Ii[t] = Ii[t].parentLocale, t === $u() && $u(t)) : Ii[t] != null && delete Ii[t]);
  return Ii[t];
}
function Ls(t) {
  var e;
  if (t && t._locale && t._locale._abbr && (t = t._locale._abbr), !t)
    return Ip;
  if (!Ha(t)) {
    if (e = H0(t), e)
      return e;
    t = [t];
  }
  return jF(t);
}
function KF() {
  return wx(Ii);
}
function Rw(t) {
  var e, n = t._a;
  return n && mn(t).overflow === -2 && (e = n[us] < 0 || n[us] > 11 ? us : n[yl] < 1 || n[yl] > Ew(n[Qo], n[us]) ? yl : n[co] < 0 || n[co] > 24 || n[co] === 24 && (n[Da] !== 0 || n[cs] !== 0 || n[Cc] !== 0) ? co : n[Da] < 0 || n[Da] > 59 ? Da : n[cs] < 0 || n[cs] > 59 ? cs : n[Cc] < 0 || n[Cc] > 999 ? Cc : -1, mn(t)._overflowDayOfYear && (e < Qo || e > yl) && (e = yl), mn(t)._overflowWeeks && e === -1 && (e = UB), mn(t)._overflowWeekday && e === -1 && (e = JB), mn(t).overflow = e), t;
}
var XF = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, ZF = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, GF = /Z|[+-]\d\d(?::?\d\d)?/, Yg = [
  ["YYYYYY-MM-DD", /[+-]\d{6}-\d\d-\d\d/],
  ["YYYY-MM-DD", /\d{4}-\d\d-\d\d/],
  ["GGGG-[W]WW-E", /\d{4}-W\d\d-\d/],
  ["GGGG-[W]WW", /\d{4}-W\d\d/, !1],
  ["YYYY-DDD", /\d{4}-\d{3}/],
  ["YYYY-MM", /\d{4}-\d\d/, !1],
  ["YYYYYYMMDD", /[+-]\d{10}/],
  ["YYYYMMDD", /\d{8}/],
  ["GGGG[W]WWE", /\d{4}W\d{3}/],
  ["GGGG[W]WW", /\d{4}W\d{2}/, !1],
  ["YYYYDDD", /\d{7}/],
  ["YYYYMM", /\d{6}/, !1],
  ["YYYY", /\d{4}/, !1]
], yb = [
  ["HH:mm:ss.SSSS", /\d\d:\d\d:\d\d\.\d+/],
  ["HH:mm:ss,SSSS", /\d\d:\d\d:\d\d,\d+/],
  ["HH:mm:ss", /\d\d:\d\d:\d\d/],
  ["HH:mm", /\d\d:\d\d/],
  ["HHmmss.SSSS", /\d\d\d\d\d\d\.\d+/],
  ["HHmmss,SSSS", /\d\d\d\d\d\d,\d+/],
  ["HHmmss", /\d\d\d\d\d\d/],
  ["HHmm", /\d\d\d\d/],
  ["HH", /\d\d/]
], UF = /^\/?Date\((-?\d+)/i, JF = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/, eV = {
  UT: 0,
  GMT: 0,
  EDT: -240,
  EST: -300,
  CDT: -300,
  CST: -360,
  MDT: -360,
  MST: -420,
  PDT: -420,
  PST: -480
};
function iR(t) {
  var e, n, i = t._i, o = XF.exec(i) || ZF.exec(i), r, a, l, s, u = Yg.length, c = yb.length;
  if (o) {
    for (mn(t).iso = !0, e = 0, n = u; e < n; e++)
      if (Yg[e][1].exec(o[1])) {
        a = Yg[e][0], r = Yg[e][2] !== !1;
        break;
      }
    if (a == null) {
      t._isValid = !1;
      return;
    }
    if (o[3]) {
      for (e = 0, n = c; e < n; e++)
        if (yb[e][1].exec(o[3])) {
          l = (o[2] || " ") + yb[e][0];
          break;
        }
      if (l == null) {
        t._isValid = !1;
        return;
      }
    }
    if (!r && l != null) {
      t._isValid = !1;
      return;
    }
    if (o[4])
      if (GF.exec(o[4]))
        s = "Z";
      else {
        t._isValid = !1;
        return;
      }
    t._f = a + (l || "") + (s || ""), Nw(t);
  } else
    t._isValid = !1;
}
function tV(t, e, n, i, o, r) {
  var a = [
    nV(t),
    YA.indexOf(e),
    parseInt(n, 10),
    parseInt(i, 10),
    parseInt(o, 10)
  ];
  return r && a.push(parseInt(r, 10)), a;
}
function nV(t) {
  var e = parseInt(t, 10);
  return e <= 49 ? 2e3 + e : e <= 999 ? 1900 + e : e;
}
function iV(t) {
  return t.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").replace(/^\s\s*/, "").replace(/\s\s*$/, "");
}
function oV(t, e, n) {
  if (t) {
    var i = JA.indexOf(t), o = new Date(
      e[0],
      e[1],
      e[2]
    ).getDay();
    if (i !== o)
      return mn(n).weekdayMismatch = !0, n._isValid = !1, !1;
  }
  return !0;
}
function rV(t, e, n) {
  if (t)
    return eV[t];
  if (e)
    return 0;
  var i = parseInt(n, 10), o = i % 100, r = (i - o) / 100;
  return r * 60 + o;
}
function oR(t) {
  var e = JF.exec(iV(t._i)), n;
  if (e) {
    if (n = tV(
      e[4],
      e[3],
      e[2],
      e[5],
      e[6],
      e[7]
    ), !oV(e[1], n, t))
      return;
    t._a = n, t._tzm = rV(e[8], e[9], e[10]), t._d = Ep.apply(null, t._a), t._d.setUTCMinutes(t._d.getUTCMinutes() - t._tzm), mn(t).rfc2822 = !0;
  } else
    t._isValid = !1;
}
function aV(t) {
  var e = UF.exec(t._i);
  if (e !== null) {
    t._d = /* @__PURE__ */ new Date(+e[1]);
    return;
  }
  if (iR(t), t._isValid === !1)
    delete t._isValid;
  else
    return;
  if (oR(t), t._isValid === !1)
    delete t._isValid;
  else
    return;
  t._strict ? t._isValid = !1 : Ct.createFromInputFallback(t);
}
Ct.createFromInputFallback = ma(
  "value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",
  function(t) {
    t._d = /* @__PURE__ */ new Date(t._i + (t._useUTC ? " UTC" : ""));
  }
);
function Ld(t, e, n) {
  return t ?? e ?? n;
}
function lV(t) {
  var e = new Date(Ct.now());
  return t._useUTC ? [
    e.getUTCFullYear(),
    e.getUTCMonth(),
    e.getUTCDate()
  ] : [e.getFullYear(), e.getMonth(), e.getDate()];
}
function Dw(t) {
  var e, n, i = [], o, r, a;
  if (!t._d) {
    for (o = lV(t), t._w && t._a[yl] == null && t._a[us] == null && sV(t), t._dayOfYear != null && (a = Ld(t._a[Qo], o[Qo]), (t._dayOfYear > ep(a) || t._dayOfYear === 0) && (mn(t)._overflowDayOfYear = !0), n = Ep(a, 0, t._dayOfYear), t._a[us] = n.getUTCMonth(), t._a[yl] = n.getUTCDate()), e = 0; e < 3 && t._a[e] == null; ++e)
      t._a[e] = i[e] = o[e];
    for (; e < 7; e++)
      t._a[e] = i[e] = t._a[e] == null ? e === 2 ? 1 : 0 : t._a[e];
    t._a[co] === 24 && t._a[Da] === 0 && t._a[cs] === 0 && t._a[Cc] === 0 && (t._nextDay = !0, t._a[co] = 0), t._d = (t._useUTC ? Ep : pF).apply(
      null,
      i
    ), r = t._useUTC ? t._d.getUTCDay() : t._d.getDay(), t._tzm != null && t._d.setUTCMinutes(t._d.getUTCMinutes() - t._tzm), t._nextDay && (t._a[co] = 24), t._w && typeof t._w.d < "u" && t._w.d !== r && (mn(t).weekdayMismatch = !0);
  }
}
function sV(t) {
  var e, n, i, o, r, a, l, s, u;
  e = t._w, e.GG != null || e.W != null || e.E != null ? (r = 1, a = 4, n = Ld(
    e.GG,
    t._a[Qo],
    _p(ki(), 1, 4).year
  ), i = Ld(e.W, 1), o = Ld(e.E, 1), (o < 1 || o > 7) && (s = !0)) : (r = t._locale._week.dow, a = t._locale._week.doy, u = _p(ki(), r, a), n = Ld(e.gg, t._a[Qo], u.year), i = Ld(e.w, u.week), e.d != null ? (o = e.d, (o < 0 || o > 6) && (s = !0)) : e.e != null ? (o = e.e + r, (e.e < 0 || e.e > 6) && (s = !0)) : o = r), i < 1 || i > ms(n, r, a) ? mn(t)._overflowWeeks = !0 : s != null ? mn(t)._overflowWeekday = !0 : (l = UA(n, i, o, r, a), t._a[Qo] = l.year, t._dayOfYear = l.dayOfYear);
}
Ct.ISO_8601 = function() {
};
Ct.RFC_2822 = function() {
};
function Nw(t) {
  if (t._f === Ct.ISO_8601) {
    iR(t);
    return;
  }
  if (t._f === Ct.RFC_2822) {
    oR(t);
    return;
  }
  t._a = [], mn(t).empty = !0;
  var e = "" + t._i, n, i, o, r, a, l = e.length, s = 0, u, c;
  for (o = FA(t._f, t._locale).match(Cw) || [], c = o.length, n = 0; n < c; n++)
    r = o[n], i = (e.match(XB(r, t)) || [])[0], i && (a = e.substr(0, e.indexOf(i)), a.length > 0 && mn(t).unusedInput.push(a), e = e.slice(
      e.indexOf(i) + i.length
    ), s += i.length), tf[r] ? (i ? mn(t).empty = !1 : mn(t).unusedTokens.push(r), GB(r, i, t)) : t._strict && !i && mn(t).unusedTokens.push(r);
  mn(t).charsLeftOver = l - s, e.length > 0 && mn(t).unusedInput.push(e), t._a[co] <= 12 && mn(t).bigHour === !0 && t._a[co] > 0 && (mn(t).bigHour = void 0), mn(t).parsedDateParts = t._a.slice(0), mn(t).meridiem = t._meridiem, t._a[co] = uV(
    t._locale,
    t._a[co],
    t._meridiem
  ), u = mn(t).era, u !== null && (t._a[Qo] = t._locale.erasConvertYear(u, t._a[Qo])), Dw(t), Rw(t);
}
function uV(t, e, n) {
  var i;
  return n == null ? e : t.meridiemHour != null ? t.meridiemHour(e, n) : (t.isPM != null && (i = t.isPM(n), i && e < 12 && (e += 12), !i && e === 12 && (e = 0)), e);
}
function cV(t) {
  var e, n, i, o, r, a, l = !1, s = t._f.length;
  if (s === 0) {
    mn(t).invalidFormat = !0, t._d = /* @__PURE__ */ new Date(NaN);
    return;
  }
  for (o = 0; o < s; o++)
    r = 0, a = !1, e = Sw({}, t), t._useUTC != null && (e._useUTC = t._useUTC), e._f = t._f[o], Nw(e), Ow(e) && (a = !0), r += mn(e).charsLeftOver, r += mn(e).unusedTokens.length * 10, mn(e).score = r, l ? r < i && (i = r, n = e) : (i == null || r < i || a) && (i = r, n = e, a && (l = !0));
  vu(t, n || e);
}
function dV(t) {
  if (!t._d) {
    var e = $w(t._i), n = e.day === void 0 ? e.date : e.day;
    t._a = LA(
      [e.year, e.month, n, e.hour, e.minute, e.second, e.millisecond],
      function(i) {
        return i && parseInt(i, 10);
      }
    ), Dw(t);
  }
}
function fV(t) {
  var e = new rg(Rw(rR(t)));
  return e._nextDay && (e.add(1, "d"), e._nextDay = void 0), e;
}
function rR(t) {
  var e = t._i, n = t._f;
  return t._locale = t._locale || Ls(t._l), e === null || n === void 0 && e === "" ? N0({ nullInput: !0 }) : (typeof e == "string" && (t._i = e = t._locale.preparse(e)), Wa(e) ? new rg(Rw(e)) : (og(e) ? t._d = e : Ha(n) ? cV(t) : n ? Nw(t) : hV(t), Ow(t) || (t._d = null), t));
}
function hV(t) {
  var e = t._i;
  dr(e) ? t._d = new Date(Ct.now()) : og(e) ? t._d = new Date(e.valueOf()) : typeof e == "string" ? aV(t) : Ha(e) ? (t._a = LA(e.slice(0), function(n) {
    return parseInt(n, 10);
  }), Dw(t)) : Ic(e) ? dV(t) : $s(e) ? t._d = new Date(e) : Ct.createFromInputFallback(t);
}
function aR(t, e, n, i, o) {
  var r = {};
  return (e === !0 || e === !1) && (i = e, e = void 0), (n === !0 || n === !1) && (i = n, n = void 0), (Ic(t) && xw(t) || Ha(t) && t.length === 0) && (t = void 0), r._isAMomentObject = !0, r._useUTC = r._isUTC = o, r._l = n, r._i = t, r._f = e, r._strict = i, fV(r);
}
function ki(t, e, n, i) {
  return aR(t, e, n, i, !1);
}
var pV = ma(
  "moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",
  function() {
    var t = ki.apply(null, arguments);
    return this.isValid() && t.isValid() ? t < this ? this : t : N0();
  }
), gV = ma(
  "moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",
  function() {
    var t = ki.apply(null, arguments);
    return this.isValid() && t.isValid() ? t > this ? this : t : N0();
  }
);
function lR(t, e) {
  var n, i;
  if (e.length === 1 && Ha(e[0]) && (e = e[0]), !e.length)
    return ki();
  for (n = e[0], i = 1; i < e.length; ++i)
    (!e[i].isValid() || e[i][t](n)) && (n = e[i]);
  return n;
}
function mV() {
  var t = [].slice.call(arguments, 0);
  return lR("isBefore", t);
}
function vV() {
  var t = [].slice.call(arguments, 0);
  return lR("isAfter", t);
}
var yV = function() {
  return Date.now ? Date.now() : +/* @__PURE__ */ new Date();
}, $h = [
  "year",
  "quarter",
  "month",
  "week",
  "day",
  "hour",
  "minute",
  "second",
  "millisecond"
];
function bV(t) {
  var e, n = !1, i, o = $h.length;
  for (e in t)
    if (qn(t, e) && !(Ki.call($h, e) !== -1 && (t[e] == null || !isNaN(t[e]))))
      return !1;
  for (i = 0; i < o; ++i)
    if (t[$h[i]]) {
      if (n)
        return !1;
      parseFloat(t[$h[i]]) !== Mn(t[$h[i]]) && (n = !0);
    }
  return !0;
}
function xV() {
  return this._isValid;
}
function OV() {
  return Xa(NaN);
}
function W0(t) {
  var e = $w(t), n = e.year || 0, i = e.quarter || 0, o = e.month || 0, r = e.week || e.isoWeek || 0, a = e.day || 0, l = e.hour || 0, s = e.minute || 0, u = e.second || 0, c = e.millisecond || 0;
  this._isValid = bV(e), this._milliseconds = +c + u * 1e3 + // 1000
  s * 6e4 + // 1000 * 60
  l * 1e3 * 60 * 60, this._days = +a + r * 7, this._months = +o + i * 3 + n * 12, this._data = {}, this._locale = Ls(), this._bubble();
}
function Jm(t) {
  return t instanceof W0;
}
function $x(t) {
  return t < 0 ? Math.round(-1 * t) * -1 : Math.round(t);
}
function SV(t, e, n) {
  var i = Math.min(t.length, e.length), o = Math.abs(t.length - e.length), r = 0, a;
  for (a = 0; a < i; a++)
    Mn(t[a]) !== Mn(e[a]) && r++;
  return r + o;
}
function sR(t, e) {
  Zt(t, 0, 0, function() {
    var n = this.utcOffset(), i = "+";
    return n < 0 && (n = -n, i = "-"), i + El(~~(n / 60), 2) + e + El(~~n % 60, 2);
  });
}
sR("Z", ":");
sR("ZZ", "");
Mt("Z", V0);
Mt("ZZ", V0);
ci(["Z", "ZZ"], function(t, e, n) {
  n._useUTC = !0, n._tzm = Lw(V0, t);
});
var wV = /([\+\-]|\d\d)/gi;
function Lw(t, e) {
  var n = (e || "").match(t), i, o, r;
  return n === null ? null : (i = n[n.length - 1] || [], o = (i + "").match(wV) || ["-", 0, 0], r = +(o[1] * 60) + Mn(o[2]), r === 0 ? 0 : o[0] === "+" ? r : -r);
}
function zw(t, e) {
  var n, i;
  return e._isUTC ? (n = e.clone(), i = (Wa(t) || og(t) ? t.valueOf() : ki(t).valueOf()) - n.valueOf(), n._d.setTime(n._d.valueOf() + i), Ct.updateOffset(n, !1), n) : ki(t).local();
}
function kx(t) {
  return -Math.round(t._d.getTimezoneOffset());
}
Ct.updateOffset = function() {
};
function CV(t, e, n) {
  var i = this._offset || 0, o;
  if (!this.isValid())
    return t != null ? this : NaN;
  if (t != null) {
    if (typeof t == "string") {
      if (t = Lw(V0, t), t === null)
        return this;
    } else Math.abs(t) < 16 && !n && (t = t * 60);
    return !this._isUTC && e && (o = kx(this)), this._offset = t, this._isUTC = !0, o != null && this.add(o, "m"), i !== t && (!e || this._changeInProgress ? dR(
      this,
      Xa(t - i, "m"),
      1,
      !1
    ) : this._changeInProgress || (this._changeInProgress = !0, Ct.updateOffset(this, !0), this._changeInProgress = null)), this;
  } else
    return this._isUTC ? i : kx(this);
}
function $V(t, e) {
  return t != null ? (typeof t != "string" && (t = -t), this.utcOffset(t, e), this) : -this.utcOffset();
}
function kV(t) {
  return this.utcOffset(0, t);
}
function TV(t) {
  return this._isUTC && (this.utcOffset(0, t), this._isUTC = !1, t && this.subtract(kx(this), "m")), this;
}
function PV() {
  if (this._tzm != null)
    this.utcOffset(this._tzm, !1, !0);
  else if (typeof this._i == "string") {
    var t = Lw(YB, this._i);
    t != null ? this.utcOffset(t) : this.utcOffset(0, !0);
  }
  return this;
}
function EV(t) {
  return this.isValid() ? (t = t ? ki(t).utcOffset() : 0, (this.utcOffset() - t) % 60 === 0) : !1;
}
function _V() {
  return this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset();
}
function IV() {
  if (!dr(this._isDSTShifted))
    return this._isDSTShifted;
  var t = {}, e;
  return Sw(t, this), t = rR(t), t._a ? (e = t._isUTC ? Rl(t._a) : ki(t._a), this._isDSTShifted = this.isValid() && SV(t._a, e.toArray()) > 0) : this._isDSTShifted = !1, this._isDSTShifted;
}
function MV() {
  return this.isValid() ? !this._isUTC : !1;
}
function AV() {
  return this.isValid() ? this._isUTC : !1;
}
function uR() {
  return this.isValid() ? this._isUTC && this._offset === 0 : !1;
}
var RV = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/, DV = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
function Xa(t, e) {
  var n = t, i = null, o, r, a;
  return Jm(t) ? n = {
    ms: t._milliseconds,
    d: t._days,
    M: t._months
  } : $s(t) || !isNaN(+t) ? (n = {}, e ? n[e] = +t : n.milliseconds = +t) : (i = RV.exec(t)) ? (o = i[1] === "-" ? -1 : 1, n = {
    y: 0,
    d: Mn(i[yl]) * o,
    h: Mn(i[co]) * o,
    m: Mn(i[Da]) * o,
    s: Mn(i[cs]) * o,
    ms: Mn($x(i[Cc] * 1e3)) * o
    // the millisecond decimal point is included in the match
  }) : (i = DV.exec(t)) ? (o = i[1] === "-" ? -1 : 1, n = {
    y: Ju(i[2], o),
    M: Ju(i[3], o),
    w: Ju(i[4], o),
    d: Ju(i[5], o),
    h: Ju(i[6], o),
    m: Ju(i[7], o),
    s: Ju(i[8], o)
  }) : n == null ? n = {} : typeof n == "object" && ("from" in n || "to" in n) && (a = NV(
    ki(n.from),
    ki(n.to)
  ), n = {}, n.ms = a.milliseconds, n.M = a.months), r = new W0(n), Jm(t) && qn(t, "_locale") && (r._locale = t._locale), Jm(t) && qn(t, "_isValid") && (r._isValid = t._isValid), r;
}
Xa.fn = W0.prototype;
Xa.invalid = OV;
function Ju(t, e) {
  var n = t && parseFloat(t.replace(",", "."));
  return (isNaN(n) ? 0 : n) * e;
}
function tT(t, e) {
  var n = {};
  return n.months = e.month() - t.month() + (e.year() - t.year()) * 12, t.clone().add(n.months, "M").isAfter(e) && --n.months, n.milliseconds = +e - +t.clone().add(n.months, "M"), n;
}
function NV(t, e) {
  var n;
  return t.isValid() && e.isValid() ? (e = zw(e, t), t.isBefore(e) ? n = tT(t, e) : (n = tT(e, t), n.milliseconds = -n.milliseconds, n.months = -n.months), n) : { milliseconds: 0, months: 0 };
}
function cR(t, e) {
  return function(n, i) {
    var o, r;
    return i !== null && !isNaN(+i) && (BA(
      e,
      "moment()." + e + "(period, number) is deprecated. Please use moment()." + e + "(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."
    ), r = n, n = i, i = r), o = Xa(n, i), dR(this, o, t), this;
  };
}
function dR(t, e, n, i) {
  var o = e._milliseconds, r = $x(e._days), a = $x(e._months);
  t.isValid() && (i = i ?? !0, a && XA(t, Pp(t, "Month") + a * n), r && qA(t, "Date", Pp(t, "Date") + r * n), o && t._d.setTime(t._d.valueOf() + o * n), i && Ct.updateOffset(t, r || a));
}
var LV = cR(1, "add"), zV = cR(-1, "subtract");
function fR(t) {
  return typeof t == "string" || t instanceof String;
}
function BV(t) {
  return Wa(t) || og(t) || fR(t) || $s(t) || VV(t) || FV(t) || t === null || t === void 0;
}
function FV(t) {
  var e = Ic(t) && !xw(t), n = !1, i = [
    "years",
    "year",
    "y",
    "months",
    "month",
    "M",
    "days",
    "day",
    "d",
    "dates",
    "date",
    "D",
    "hours",
    "hour",
    "h",
    "minutes",
    "minute",
    "m",
    "seconds",
    "second",
    "s",
    "milliseconds",
    "millisecond",
    "ms"
  ], o, r, a = i.length;
  for (o = 0; o < a; o += 1)
    r = i[o], n = n || qn(t, r);
  return e && n;
}
function VV(t) {
  var e = Ha(t), n = !1;
  return e && (n = t.filter(function(i) {
    return !$s(i) && fR(t);
  }).length === 0), e && n;
}
function QV(t) {
  var e = Ic(t) && !xw(t), n = !1, i = [
    "sameDay",
    "nextDay",
    "lastDay",
    "nextWeek",
    "lastWeek",
    "sameElse"
  ], o, r;
  for (o = 0; o < i.length; o += 1)
    r = i[o], n = n || qn(t, r);
  return e && n;
}
function HV(t, e) {
  var n = t.diff(e, "days", !0);
  return n < -6 ? "sameElse" : n < -1 ? "lastWeek" : n < 0 ? "lastDay" : n < 1 ? "sameDay" : n < 2 ? "nextDay" : n < 7 ? "nextWeek" : "sameElse";
}
function WV(t, e) {
  arguments.length === 1 && (arguments[0] ? BV(arguments[0]) ? (t = arguments[0], e = void 0) : QV(arguments[0]) && (e = arguments[0], t = void 0) : (t = void 0, e = void 0));
  var n = t || ki(), i = zw(n, this).startOf("day"), o = Ct.calendarFormat(this, i) || "sameElse", r = e && (Dl(e[o]) ? e[o].call(this, n) : e[o]);
  return this.format(
    r || this.localeData().calendar(o, this, ki(n))
  );
}
function jV() {
  return new rg(this);
}
function qV(t, e) {
  var n = Wa(t) ? t : ki(t);
  return this.isValid() && n.isValid() ? (e = va(e) || "millisecond", e === "millisecond" ? this.valueOf() > n.valueOf() : n.valueOf() < this.clone().startOf(e).valueOf()) : !1;
}
function YV(t, e) {
  var n = Wa(t) ? t : ki(t);
  return this.isValid() && n.isValid() ? (e = va(e) || "millisecond", e === "millisecond" ? this.valueOf() < n.valueOf() : this.clone().endOf(e).valueOf() < n.valueOf()) : !1;
}
function KV(t, e, n, i) {
  var o = Wa(t) ? t : ki(t), r = Wa(e) ? e : ki(e);
  return this.isValid() && o.isValid() && r.isValid() ? (i = i || "()", (i[0] === "(" ? this.isAfter(o, n) : !this.isBefore(o, n)) && (i[1] === ")" ? this.isBefore(r, n) : !this.isAfter(r, n))) : !1;
}
function XV(t, e) {
  var n = Wa(t) ? t : ki(t), i;
  return this.isValid() && n.isValid() ? (e = va(e) || "millisecond", e === "millisecond" ? this.valueOf() === n.valueOf() : (i = n.valueOf(), this.clone().startOf(e).valueOf() <= i && i <= this.clone().endOf(e).valueOf())) : !1;
}
function ZV(t, e) {
  return this.isSame(t, e) || this.isAfter(t, e);
}
function GV(t, e) {
  return this.isSame(t, e) || this.isBefore(t, e);
}
function UV(t, e, n) {
  var i, o, r;
  if (!this.isValid())
    return NaN;
  if (i = zw(t, this), !i.isValid())
    return NaN;
  switch (o = (i.utcOffset() - this.utcOffset()) * 6e4, e = va(e), e) {
    case "year":
      r = ev(this, i) / 12;
      break;
    case "month":
      r = ev(this, i);
      break;
    case "quarter":
      r = ev(this, i) / 3;
      break;
    case "second":
      r = (this - i) / 1e3;
      break;
    // 1000
    case "minute":
      r = (this - i) / 6e4;
      break;
    // 1000 * 60
    case "hour":
      r = (this - i) / 36e5;
      break;
    // 1000 * 60 * 60
    case "day":
      r = (this - i - o) / 864e5;
      break;
    // 1000 * 60 * 60 * 24, negate dst
    case "week":
      r = (this - i - o) / 6048e5;
      break;
    // 1000 * 60 * 60 * 24 * 7, negate dst
    default:
      r = this - i;
  }
  return n ? r : oa(r);
}
function ev(t, e) {
  if (t.date() < e.date())
    return -ev(e, t);
  var n = (e.year() - t.year()) * 12 + (e.month() - t.month()), i = t.clone().add(n, "months"), o, r;
  return e - i < 0 ? (o = t.clone().add(n - 1, "months"), r = (e - i) / (i - o)) : (o = t.clone().add(n + 1, "months"), r = (e - i) / (o - i)), -(n + r) || 0;
}
Ct.defaultFormat = "YYYY-MM-DDTHH:mm:ssZ";
Ct.defaultFormatUtc = "YYYY-MM-DDTHH:mm:ss[Z]";
function JV() {
  return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ");
}
function e7(t) {
  if (!this.isValid())
    return null;
  var e = t !== !0, n = e ? this.clone().utc() : this;
  return n.year() < 0 || n.year() > 9999 ? Um(
    n,
    e ? "YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]" : "YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"
  ) : Dl(Date.prototype.toISOString) ? e ? this.toDate().toISOString() : new Date(this.valueOf() + this.utcOffset() * 60 * 1e3).toISOString().replace("Z", Um(n, "Z")) : Um(
    n,
    e ? "YYYY-MM-DD[T]HH:mm:ss.SSS[Z]" : "YYYY-MM-DD[T]HH:mm:ss.SSSZ"
  );
}
function t7() {
  if (!this.isValid())
    return "moment.invalid(/* " + this._i + " */)";
  var t = "moment", e = "", n, i, o, r;
  return this.isLocal() || (t = this.utcOffset() === 0 ? "moment.utc" : "moment.parseZone", e = "Z"), n = "[" + t + '("]', i = 0 <= this.year() && this.year() <= 9999 ? "YYYY" : "YYYYYY", o = "-MM-DD[T]HH:mm:ss.SSS", r = e + '[")]', this.format(n + i + o + r);
}
function n7(t) {
  t || (t = this.isUtc() ? Ct.defaultFormatUtc : Ct.defaultFormat);
  var e = Um(this, t);
  return this.localeData().postformat(e);
}
function i7(t, e) {
  return this.isValid() && (Wa(t) && t.isValid() || ki(t).isValid()) ? Xa({ to: this, from: t }).locale(this.locale()).humanize(!e) : this.localeData().invalidDate();
}
function o7(t) {
  return this.from(ki(), t);
}
function r7(t, e) {
  return this.isValid() && (Wa(t) && t.isValid() || ki(t).isValid()) ? Xa({ from: this, to: t }).locale(this.locale()).humanize(!e) : this.localeData().invalidDate();
}
function a7(t) {
  return this.to(ki(), t);
}
function hR(t) {
  var e;
  return t === void 0 ? this._locale._abbr : (e = Ls(t), e != null && (this._locale = e), this);
}
var pR = ma(
  "moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",
  function(t) {
    return t === void 0 ? this.localeData() : this.locale(t);
  }
);
function gR() {
  return this._locale;
}
var Iv = 1e3, nf = 60 * Iv, Mv = 60 * nf, mR = (365 * 400 + 97) * 24 * Mv;
function of(t, e) {
  return (t % e + e) % e;
}
function vR(t, e, n) {
  return t < 100 && t >= 0 ? new Date(t + 400, e, n) - mR : new Date(t, e, n).valueOf();
}
function yR(t, e, n) {
  return t < 100 && t >= 0 ? Date.UTC(t + 400, e, n) - mR : Date.UTC(t, e, n);
}
function l7(t) {
  var e, n;
  if (t = va(t), t === void 0 || t === "millisecond" || !this.isValid())
    return this;
  switch (n = this._isUTC ? yR : vR, t) {
    case "year":
      e = n(this.year(), 0, 1);
      break;
    case "quarter":
      e = n(
        this.year(),
        this.month() - this.month() % 3,
        1
      );
      break;
    case "month":
      e = n(this.year(), this.month(), 1);
      break;
    case "week":
      e = n(
        this.year(),
        this.month(),
        this.date() - this.weekday()
      );
      break;
    case "isoWeek":
      e = n(
        this.year(),
        this.month(),
        this.date() - (this.isoWeekday() - 1)
      );
      break;
    case "day":
    case "date":
      e = n(this.year(), this.month(), this.date());
      break;
    case "hour":
      e = this._d.valueOf(), e -= of(
        e + (this._isUTC ? 0 : this.utcOffset() * nf),
        Mv
      );
      break;
    case "minute":
      e = this._d.valueOf(), e -= of(e, nf);
      break;
    case "second":
      e = this._d.valueOf(), e -= of(e, Iv);
      break;
  }
  return this._d.setTime(e), Ct.updateOffset(this, !0), this;
}
function s7(t) {
  var e, n;
  if (t = va(t), t === void 0 || t === "millisecond" || !this.isValid())
    return this;
  switch (n = this._isUTC ? yR : vR, t) {
    case "year":
      e = n(this.year() + 1, 0, 1) - 1;
      break;
    case "quarter":
      e = n(
        this.year(),
        this.month() - this.month() % 3 + 3,
        1
      ) - 1;
      break;
    case "month":
      e = n(this.year(), this.month() + 1, 1) - 1;
      break;
    case "week":
      e = n(
        this.year(),
        this.month(),
        this.date() - this.weekday() + 7
      ) - 1;
      break;
    case "isoWeek":
      e = n(
        this.year(),
        this.month(),
        this.date() - (this.isoWeekday() - 1) + 7
      ) - 1;
      break;
    case "day":
    case "date":
      e = n(this.year(), this.month(), this.date() + 1) - 1;
      break;
    case "hour":
      e = this._d.valueOf(), e += Mv - of(
        e + (this._isUTC ? 0 : this.utcOffset() * nf),
        Mv
      ) - 1;
      break;
    case "minute":
      e = this._d.valueOf(), e += nf - of(e, nf) - 1;
      break;
    case "second":
      e = this._d.valueOf(), e += Iv - of(e, Iv) - 1;
      break;
  }
  return this._d.setTime(e), Ct.updateOffset(this, !0), this;
}
function u7() {
  return this._d.valueOf() - (this._offset || 0) * 6e4;
}
function c7() {
  return Math.floor(this.valueOf() / 1e3);
}
function d7() {
  return new Date(this.valueOf());
}
function f7() {
  var t = this;
  return [
    t.year(),
    t.month(),
    t.date(),
    t.hour(),
    t.minute(),
    t.second(),
    t.millisecond()
  ];
}
function h7() {
  var t = this;
  return {
    years: t.year(),
    months: t.month(),
    date: t.date(),
    hours: t.hours(),
    minutes: t.minutes(),
    seconds: t.seconds(),
    milliseconds: t.milliseconds()
  };
}
function p7() {
  return this.isValid() ? this.toISOString() : null;
}
function g7() {
  return Ow(this);
}
function m7() {
  return vu({}, mn(this));
}
function v7() {
  return mn(this).overflow;
}
function y7() {
  return {
    input: this._i,
    format: this._f,
    locale: this._locale,
    isUTC: this._isUTC,
    strict: this._strict
  };
}
Zt("N", 0, 0, "eraAbbr");
Zt("NN", 0, 0, "eraAbbr");
Zt("NNN", 0, 0, "eraAbbr");
Zt("NNNN", 0, 0, "eraName");
Zt("NNNNN", 0, 0, "eraNarrow");
Zt("y", ["y", 1], "yo", "eraYear");
Zt("y", ["yy", 2], 0, "eraYear");
Zt("y", ["yyy", 3], 0, "eraYear");
Zt("y", ["yyyy", 4], 0, "eraYear");
Mt("N", Bw);
Mt("NN", Bw);
Mt("NNN", Bw);
Mt("NNNN", E7);
Mt("NNNNN", _7);
ci(
  ["N", "NN", "NNN", "NNNN", "NNNNN"],
  function(t, e, n, i) {
    var o = n._locale.erasParse(t, i, n._strict);
    o ? mn(n).era = o : mn(n).invalidEra = t;
  }
);
Mt("y", Jf);
Mt("yy", Jf);
Mt("yyy", Jf);
Mt("yyyy", Jf);
Mt("yo", I7);
ci(["y", "yy", "yyy", "yyyy"], Qo);
ci(["yo"], function(t, e, n, i) {
  var o;
  n._locale._eraYearOrdinalRegex && (o = t.match(n._locale._eraYearOrdinalRegex)), n._locale.eraYearOrdinalParse ? e[Qo] = n._locale.eraYearOrdinalParse(t, o) : e[Qo] = parseInt(t, 10);
});
function b7(t, e) {
  var n, i, o, r = this._eras || Ls("en")._eras;
  for (n = 0, i = r.length; n < i; ++n) {
    switch (typeof r[n].since) {
      case "string":
        o = Ct(r[n].since).startOf("day"), r[n].since = o.valueOf();
        break;
    }
    switch (typeof r[n].until) {
      case "undefined":
        r[n].until = 1 / 0;
        break;
      case "string":
        o = Ct(r[n].until).startOf("day").valueOf(), r[n].until = o.valueOf();
        break;
    }
  }
  return r;
}
function x7(t, e, n) {
  var i, o, r = this.eras(), a, l, s;
  for (t = t.toUpperCase(), i = 0, o = r.length; i < o; ++i)
    if (a = r[i].name.toUpperCase(), l = r[i].abbr.toUpperCase(), s = r[i].narrow.toUpperCase(), n)
      switch (e) {
        case "N":
        case "NN":
        case "NNN":
          if (l === t)
            return r[i];
          break;
        case "NNNN":
          if (a === t)
            return r[i];
          break;
        case "NNNNN":
          if (s === t)
            return r[i];
          break;
      }
    else if ([a, l, s].indexOf(t) >= 0)
      return r[i];
}
function O7(t, e) {
  var n = t.since <= t.until ? 1 : -1;
  return e === void 0 ? Ct(t.since).year() : Ct(t.since).year() + (e - t.offset) * n;
}
function S7() {
  var t, e, n, i = this.localeData().eras();
  for (t = 0, e = i.length; t < e; ++t)
    if (n = this.clone().startOf("day").valueOf(), i[t].since <= n && n <= i[t].until || i[t].until <= n && n <= i[t].since)
      return i[t].name;
  return "";
}
function w7() {
  var t, e, n, i = this.localeData().eras();
  for (t = 0, e = i.length; t < e; ++t)
    if (n = this.clone().startOf("day").valueOf(), i[t].since <= n && n <= i[t].until || i[t].until <= n && n <= i[t].since)
      return i[t].narrow;
  return "";
}
function C7() {
  var t, e, n, i = this.localeData().eras();
  for (t = 0, e = i.length; t < e; ++t)
    if (n = this.clone().startOf("day").valueOf(), i[t].since <= n && n <= i[t].until || i[t].until <= n && n <= i[t].since)
      return i[t].abbr;
  return "";
}
function $7() {
  var t, e, n, i, o = this.localeData().eras();
  for (t = 0, e = o.length; t < e; ++t)
    if (n = o[t].since <= o[t].until ? 1 : -1, i = this.clone().startOf("day").valueOf(), o[t].since <= i && i <= o[t].until || o[t].until <= i && i <= o[t].since)
      return (this.year() - Ct(o[t].since).year()) * n + o[t].offset;
  return this.year();
}
function k7(t) {
  return qn(this, "_erasNameRegex") || Fw.call(this), t ? this._erasNameRegex : this._erasRegex;
}
function T7(t) {
  return qn(this, "_erasAbbrRegex") || Fw.call(this), t ? this._erasAbbrRegex : this._erasRegex;
}
function P7(t) {
  return qn(this, "_erasNarrowRegex") || Fw.call(this), t ? this._erasNarrowRegex : this._erasRegex;
}
function Bw(t, e) {
  return e.erasAbbrRegex(t);
}
function E7(t, e) {
  return e.erasNameRegex(t);
}
function _7(t, e) {
  return e.erasNarrowRegex(t);
}
function I7(t, e) {
  return e._eraYearOrdinalRegex || Jf;
}
function Fw() {
  var t = [], e = [], n = [], i = [], o, r, a, l, s, u = this.eras();
  for (o = 0, r = u.length; o < r; ++o)
    a = gs(u[o].name), l = gs(u[o].abbr), s = gs(u[o].narrow), e.push(a), t.push(l), n.push(s), i.push(a), i.push(l), i.push(s);
  this._erasRegex = new RegExp("^(" + i.join("|") + ")", "i"), this._erasNameRegex = new RegExp("^(" + e.join("|") + ")", "i"), this._erasAbbrRegex = new RegExp("^(" + t.join("|") + ")", "i"), this._erasNarrowRegex = new RegExp(
    "^(" + n.join("|") + ")",
    "i"
  );
}
Zt(0, ["gg", 2], 0, function() {
  return this.weekYear() % 100;
});
Zt(0, ["GG", 2], 0, function() {
  return this.isoWeekYear() % 100;
});
function j0(t, e) {
  Zt(0, [t, t.length], 0, e);
}
j0("gggg", "weekYear");
j0("ggggg", "weekYear");
j0("GGGG", "isoWeekYear");
j0("GGGGG", "isoWeekYear");
Mt("G", F0);
Mt("g", F0);
Mt("GG", Ti, Qr);
Mt("gg", Ti, Qr);
Mt("GGGG", Tw, kw);
Mt("gggg", Tw, kw);
Mt("GGGGG", B0, L0);
Mt("ggggg", B0, L0);
lg(
  ["gggg", "ggggg", "GGGG", "GGGGG"],
  function(t, e, n, i) {
    e[i.substr(0, 2)] = Mn(t);
  }
);
lg(["gg", "GG"], function(t, e, n, i) {
  e[i] = Ct.parseTwoDigitYear(t);
});
function M7(t) {
  return bR.call(
    this,
    t,
    this.week(),
    this.weekday() + this.localeData()._week.dow,
    this.localeData()._week.dow,
    this.localeData()._week.doy
  );
}
function A7(t) {
  return bR.call(
    this,
    t,
    this.isoWeek(),
    this.isoWeekday(),
    1,
    4
  );
}
function R7() {
  return ms(this.year(), 1, 4);
}
function D7() {
  return ms(this.isoWeekYear(), 1, 4);
}
function N7() {
  var t = this.localeData()._week;
  return ms(this.year(), t.dow, t.doy);
}
function L7() {
  var t = this.localeData()._week;
  return ms(this.weekYear(), t.dow, t.doy);
}
function bR(t, e, n, i, o) {
  var r;
  return t == null ? _p(this, i, o).year : (r = ms(t, i, o), e > r && (e = r), z7.call(this, t, e, n, i, o));
}
function z7(t, e, n, i, o) {
  var r = UA(t, e, n, i, o), a = Ep(r.year, 0, r.dayOfYear);
  return this.year(a.getUTCFullYear()), this.month(a.getUTCMonth()), this.date(a.getUTCDate()), this;
}
Zt("Q", 0, "Qo", "quarter");
Mt("Q", VA);
ci("Q", function(t, e) {
  e[us] = (Mn(t) - 1) * 3;
});
function B7(t) {
  return t == null ? Math.ceil((this.month() + 1) / 3) : this.month((t - 1) * 3 + this.month() % 3);
}
Zt("D", ["DD", 2], "Do", "date");
Mt("D", Ti, eh);
Mt("DD", Ti, Qr);
Mt("Do", function(t, e) {
  return t ? e._dayOfMonthOrdinalParse || e._ordinalParse : e._dayOfMonthOrdinalParseLenient;
});
ci(["D", "DD"], yl);
ci("Do", function(t, e) {
  e[yl] = Mn(t.match(Ti)[0]);
});
var xR = th("Date", !0);
Zt("DDD", ["DDDD", 3], "DDDo", "dayOfYear");
Mt("DDD", z0);
Mt("DDDD", QA);
ci(["DDD", "DDDD"], function(t, e, n) {
  n._dayOfYear = Mn(t);
});
function F7(t) {
  var e = Math.round(
    (this.clone().startOf("day") - this.clone().startOf("year")) / 864e5
  ) + 1;
  return t == null ? e : this.add(t - e, "d");
}
Zt("m", ["mm", 2], 0, "minute");
Mt("m", Ti, Pw);
Mt("mm", Ti, Qr);
ci(["m", "mm"], Da);
var V7 = th("Minutes", !1);
Zt("s", ["ss", 2], 0, "second");
Mt("s", Ti, Pw);
Mt("ss", Ti, Qr);
ci(["s", "ss"], cs);
var Q7 = th("Seconds", !1);
Zt("S", 0, 0, function() {
  return ~~(this.millisecond() / 100);
});
Zt(0, ["SS", 2], 0, function() {
  return ~~(this.millisecond() / 10);
});
Zt(0, ["SSS", 3], 0, "millisecond");
Zt(0, ["SSSS", 4], 0, function() {
  return this.millisecond() * 10;
});
Zt(0, ["SSSSS", 5], 0, function() {
  return this.millisecond() * 100;
});
Zt(0, ["SSSSSS", 6], 0, function() {
  return this.millisecond() * 1e3;
});
Zt(0, ["SSSSSSS", 7], 0, function() {
  return this.millisecond() * 1e4;
});
Zt(0, ["SSSSSSSS", 8], 0, function() {
  return this.millisecond() * 1e5;
});
Zt(0, ["SSSSSSSSS", 9], 0, function() {
  return this.millisecond() * 1e6;
});
Mt("S", z0, VA);
Mt("SS", z0, Qr);
Mt("SSS", z0, QA);
var yu, OR;
for (yu = "SSSS"; yu.length <= 9; yu += "S")
  Mt(yu, Jf);
function H7(t, e) {
  e[Cc] = Mn(("0." + t) * 1e3);
}
for (yu = "S"; yu.length <= 9; yu += "S")
  ci(yu, H7);
OR = th("Milliseconds", !1);
Zt("z", 0, 0, "zoneAbbr");
Zt("zz", 0, 0, "zoneName");
function W7() {
  return this._isUTC ? "UTC" : "";
}
function j7() {
  return this._isUTC ? "Coordinated Universal Time" : "";
}
var ht = rg.prototype;
ht.add = LV;
ht.calendar = WV;
ht.clone = jV;
ht.diff = UV;
ht.endOf = s7;
ht.format = n7;
ht.from = i7;
ht.fromNow = o7;
ht.to = r7;
ht.toNow = a7;
ht.get = tF;
ht.invalidAt = v7;
ht.isAfter = qV;
ht.isBefore = YV;
ht.isBetween = KV;
ht.isSame = XV;
ht.isSameOrAfter = ZV;
ht.isSameOrBefore = GV;
ht.isValid = g7;
ht.lang = pR;
ht.locale = hR;
ht.localeData = gR;
ht.max = gV;
ht.min = pV;
ht.parsingFlags = m7;
ht.set = nF;
ht.startOf = l7;
ht.subtract = zV;
ht.toArray = f7;
ht.toObject = h7;
ht.toDate = d7;
ht.toISOString = e7;
ht.inspect = t7;
typeof Symbol < "u" && Symbol.for != null && (ht[Symbol.for("nodejs.util.inspect.custom")] = function() {
  return "Moment<" + this.format() + ">";
});
ht.toJSON = p7;
ht.toString = JV;
ht.unix = c7;
ht.valueOf = u7;
ht.creationData = y7;
ht.eraName = S7;
ht.eraNarrow = w7;
ht.eraAbbr = C7;
ht.eraYear = $7;
ht.year = jA;
ht.isLeapYear = eF;
ht.weekYear = M7;
ht.isoWeekYear = A7;
ht.quarter = ht.quarters = B7;
ht.month = ZA;
ht.daysInMonth = dF;
ht.week = ht.weeks = bF;
ht.isoWeek = ht.isoWeeks = xF;
ht.weeksInYear = N7;
ht.weeksInWeekYear = L7;
ht.isoWeeksInYear = R7;
ht.isoWeeksInISOWeekYear = D7;
ht.date = xR;
ht.day = ht.days = AF;
ht.weekday = RF;
ht.isoWeekday = DF;
ht.dayOfYear = F7;
ht.hour = ht.hours = QF;
ht.minute = ht.minutes = V7;
ht.second = ht.seconds = Q7;
ht.millisecond = ht.milliseconds = OR;
ht.utcOffset = CV;
ht.utc = kV;
ht.local = TV;
ht.parseZone = PV;
ht.hasAlignedHourOffset = EV;
ht.isDST = _V;
ht.isLocal = MV;
ht.isUtcOffset = AV;
ht.isUtc = uR;
ht.isUTC = uR;
ht.zoneAbbr = W7;
ht.zoneName = j7;
ht.dates = ma(
  "dates accessor is deprecated. Use date instead.",
  xR
);
ht.months = ma(
  "months accessor is deprecated. Use month instead",
  ZA
);
ht.years = ma(
  "years accessor is deprecated. Use year instead",
  jA
);
ht.zone = ma(
  "moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",
  $V
);
ht.isDSTShifted = ma(
  "isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",
  IV
);
function q7(t) {
  return ki(t * 1e3);
}
function Y7() {
  return ki.apply(null, arguments).parseZone();
}
function SR(t) {
  return t;
}
var Yn = ww.prototype;
Yn.calendar = MB;
Yn.longDateFormat = NB;
Yn.invalidDate = zB;
Yn.ordinal = VB;
Yn.preparse = SR;
Yn.postformat = SR;
Yn.relativeTime = HB;
Yn.pastFuture = WB;
Yn.set = _B;
Yn.eras = b7;
Yn.erasParse = x7;
Yn.erasConvertYear = O7;
Yn.erasAbbrRegex = T7;
Yn.erasNameRegex = k7;
Yn.erasNarrowRegex = P7;
Yn.months = lF;
Yn.monthsShort = sF;
Yn.monthsParse = cF;
Yn.monthsRegex = hF;
Yn.monthsShortRegex = fF;
Yn.week = gF;
Yn.firstDayOfYear = yF;
Yn.firstDayOfWeek = vF;
Yn.weekdays = PF;
Yn.weekdaysMin = _F;
Yn.weekdaysShort = EF;
Yn.weekdaysParse = MF;
Yn.weekdaysRegex = NF;
Yn.weekdaysShortRegex = LF;
Yn.weekdaysMinRegex = zF;
Yn.isPM = FF;
Yn.meridiem = HF;
function Av(t, e, n, i) {
  var o = Ls(), r = Rl().set(i, e);
  return o[n](r, t);
}
function wR(t, e, n) {
  if ($s(t) && (e = t, t = void 0), t = t || "", e != null)
    return Av(t, e, n, "month");
  var i, o = [];
  for (i = 0; i < 12; i++)
    o[i] = Av(t, i, n, "month");
  return o;
}
function Vw(t, e, n, i) {
  typeof t == "boolean" ? ($s(e) && (n = e, e = void 0), e = e || "") : (e = t, n = e, t = !1, $s(e) && (n = e, e = void 0), e = e || "");
  var o = Ls(), r = t ? o._week.dow : 0, a, l = [];
  if (n != null)
    return Av(e, (n + r) % 7, i, "day");
  for (a = 0; a < 7; a++)
    l[a] = Av(e, (a + r) % 7, i, "day");
  return l;
}
function K7(t, e) {
  return wR(t, e, "months");
}
function X7(t, e) {
  return wR(t, e, "monthsShort");
}
function Z7(t, e, n) {
  return Vw(t, e, n, "weekdays");
}
function G7(t, e, n) {
  return Vw(t, e, n, "weekdaysShort");
}
function U7(t, e, n) {
  return Vw(t, e, n, "weekdaysMin");
}
$u("en", {
  eras: [
    {
      since: "0001-01-01",
      until: 1 / 0,
      offset: 1,
      name: "Anno Domini",
      narrow: "AD",
      abbr: "AD"
    },
    {
      since: "0000-12-31",
      until: -1 / 0,
      offset: 1,
      name: "Before Christ",
      narrow: "BC",
      abbr: "BC"
    }
  ],
  dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
  ordinal: function(t) {
    var e = t % 10, n = Mn(t % 100 / 10) === 1 ? "th" : e === 1 ? "st" : e === 2 ? "nd" : e === 3 ? "rd" : "th";
    return t + n;
  }
});
Ct.lang = ma(
  "moment.lang is deprecated. Use moment.locale instead.",
  $u
);
Ct.langData = ma(
  "moment.langData is deprecated. Use moment.localeData instead.",
  Ls
);
var Kl = Math.abs;
function J7() {
  var t = this._data;
  return this._milliseconds = Kl(this._milliseconds), this._days = Kl(this._days), this._months = Kl(this._months), t.milliseconds = Kl(t.milliseconds), t.seconds = Kl(t.seconds), t.minutes = Kl(t.minutes), t.hours = Kl(t.hours), t.months = Kl(t.months), t.years = Kl(t.years), this;
}
function CR(t, e, n, i) {
  var o = Xa(e, n);
  return t._milliseconds += i * o._milliseconds, t._days += i * o._days, t._months += i * o._months, t._bubble();
}
function eQ(t, e) {
  return CR(this, t, e, 1);
}
function tQ(t, e) {
  return CR(this, t, e, -1);
}
function nT(t) {
  return t < 0 ? Math.floor(t) : Math.ceil(t);
}
function nQ() {
  var t = this._milliseconds, e = this._days, n = this._months, i = this._data, o, r, a, l, s;
  return t >= 0 && e >= 0 && n >= 0 || t <= 0 && e <= 0 && n <= 0 || (t += nT(Tx(n) + e) * 864e5, e = 0, n = 0), i.milliseconds = t % 1e3, o = oa(t / 1e3), i.seconds = o % 60, r = oa(o / 60), i.minutes = r % 60, a = oa(r / 60), i.hours = a % 24, e += oa(a / 24), s = oa($R(e)), n += s, e -= nT(Tx(s)), l = oa(n / 12), n %= 12, i.days = e, i.months = n, i.years = l, this;
}
function $R(t) {
  return t * 4800 / 146097;
}
function Tx(t) {
  return t * 146097 / 4800;
}
function iQ(t) {
  if (!this.isValid())
    return NaN;
  var e, n, i = this._milliseconds;
  if (t = va(t), t === "month" || t === "quarter" || t === "year")
    switch (e = this._days + i / 864e5, n = this._months + $R(e), t) {
      case "month":
        return n;
      case "quarter":
        return n / 3;
      case "year":
        return n / 12;
    }
  else
    switch (e = this._days + Math.round(Tx(this._months)), t) {
      case "week":
        return e / 7 + i / 6048e5;
      case "day":
        return e + i / 864e5;
      case "hour":
        return e * 24 + i / 36e5;
      case "minute":
        return e * 1440 + i / 6e4;
      case "second":
        return e * 86400 + i / 1e3;
      // Math.floor prevents floating point math errors here
      case "millisecond":
        return Math.floor(e * 864e5) + i;
      default:
        throw new Error("Unknown unit " + t);
    }
}
function zs(t) {
  return function() {
    return this.as(t);
  };
}
var kR = zs("ms"), oQ = zs("s"), rQ = zs("m"), aQ = zs("h"), lQ = zs("d"), sQ = zs("w"), uQ = zs("M"), cQ = zs("Q"), dQ = zs("y"), fQ = kR;
function hQ() {
  return Xa(this);
}
function pQ(t) {
  return t = va(t), this.isValid() ? this[t + "s"]() : NaN;
}
function nd(t) {
  return function() {
    return this.isValid() ? this._data[t] : NaN;
  };
}
var gQ = nd("milliseconds"), mQ = nd("seconds"), vQ = nd("minutes"), yQ = nd("hours"), bQ = nd("days"), xQ = nd("months"), OQ = nd("years");
function SQ() {
  return oa(this.days() / 7);
}
var is = Math.round, qd = {
  ss: 44,
  // a few seconds to seconds
  s: 45,
  // seconds to minute
  m: 45,
  // minutes to hour
  h: 22,
  // hours to day
  d: 26,
  // days to month/week
  w: null,
  // weeks to month
  M: 11
  // months to year
};
function wQ(t, e, n, i, o) {
  return o.relativeTime(e || 1, !!n, t, i);
}
function CQ(t, e, n, i) {
  var o = Xa(t).abs(), r = is(o.as("s")), a = is(o.as("m")), l = is(o.as("h")), s = is(o.as("d")), u = is(o.as("M")), c = is(o.as("w")), d = is(o.as("y")), f = r <= n.ss && ["s", r] || r < n.s && ["ss", r] || a <= 1 && ["m"] || a < n.m && ["mm", a] || l <= 1 && ["h"] || l < n.h && ["hh", l] || s <= 1 && ["d"] || s < n.d && ["dd", s];
  return n.w != null && (f = f || c <= 1 && ["w"] || c < n.w && ["ww", c]), f = f || u <= 1 && ["M"] || u < n.M && ["MM", u] || d <= 1 && ["y"] || ["yy", d], f[2] = e, f[3] = +t > 0, f[4] = i, wQ.apply(null, f);
}
function $Q(t) {
  return t === void 0 ? is : typeof t == "function" ? (is = t, !0) : !1;
}
function kQ(t, e) {
  return qd[t] === void 0 ? !1 : e === void 0 ? qd[t] : (qd[t] = e, t === "s" && (qd.ss = e - 1), !0);
}
function TQ(t, e) {
  if (!this.isValid())
    return this.localeData().invalidDate();
  var n = !1, i = qd, o, r;
  return typeof t == "object" && (e = t, t = !1), typeof t == "boolean" && (n = t), typeof e == "object" && (i = Object.assign({}, qd, e), e.s != null && e.ss == null && (i.ss = e.s - 1)), o = this.localeData(), r = CQ(this, !n, i, o), n && (r = o.pastFuture(+this, r)), o.postformat(r);
}
var bb = Math.abs;
function Sd(t) {
  return (t > 0) - (t < 0) || +t;
}
function q0() {
  if (!this.isValid())
    return this.localeData().invalidDate();
  var t = bb(this._milliseconds) / 1e3, e = bb(this._days), n = bb(this._months), i, o, r, a, l = this.asSeconds(), s, u, c, d;
  return l ? (i = oa(t / 60), o = oa(i / 60), t %= 60, i %= 60, r = oa(n / 12), n %= 12, a = t ? t.toFixed(3).replace(/\.?0+$/, "") : "", s = l < 0 ? "-" : "", u = Sd(this._months) !== Sd(l) ? "-" : "", c = Sd(this._days) !== Sd(l) ? "-" : "", d = Sd(this._milliseconds) !== Sd(l) ? "-" : "", s + "P" + (r ? u + r + "Y" : "") + (n ? u + n + "M" : "") + (e ? c + e + "D" : "") + (o || i || t ? "T" : "") + (o ? d + o + "H" : "") + (i ? d + i + "M" : "") + (t ? d + a + "S" : "")) : "P0D";
}
var Fn = W0.prototype;
Fn.isValid = xV;
Fn.abs = J7;
Fn.add = eQ;
Fn.subtract = tQ;
Fn.as = iQ;
Fn.asMilliseconds = kR;
Fn.asSeconds = oQ;
Fn.asMinutes = rQ;
Fn.asHours = aQ;
Fn.asDays = lQ;
Fn.asWeeks = sQ;
Fn.asMonths = uQ;
Fn.asQuarters = cQ;
Fn.asYears = dQ;
Fn.valueOf = fQ;
Fn._bubble = nQ;
Fn.clone = hQ;
Fn.get = pQ;
Fn.milliseconds = gQ;
Fn.seconds = mQ;
Fn.minutes = vQ;
Fn.hours = yQ;
Fn.days = bQ;
Fn.weeks = SQ;
Fn.months = xQ;
Fn.years = OQ;
Fn.humanize = TQ;
Fn.toISOString = q0;
Fn.toString = q0;
Fn.toJSON = q0;
Fn.locale = hR;
Fn.localeData = gR;
Fn.toIsoString = ma(
  "toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",
  q0
);
Fn.lang = pR;
Zt("X", 0, 0, "unix");
Zt("x", 0, 0, "valueOf");
Mt("x", F0);
Mt("X", KB);
ci("X", function(t, e, n) {
  n._d = new Date(parseFloat(t) * 1e3);
});
ci("x", function(t, e, n) {
  n._d = new Date(Mn(t));
});
//! moment.js
Ct.version = "2.30.1";
PB(ki);
Ct.fn = ht;
Ct.min = mV;
Ct.max = vV;
Ct.now = yV;
Ct.utc = Rl;
Ct.unix = q7;
Ct.months = K7;
Ct.isDate = og;
Ct.locale = $u;
Ct.invalid = N0;
Ct.duration = Xa;
Ct.isMoment = Wa;
Ct.weekdays = Z7;
Ct.parseZone = Y7;
Ct.localeData = Ls;
Ct.isDuration = Jm;
Ct.monthsShort = X7;
Ct.weekdaysMin = U7;
Ct.defineLocale = Aw;
Ct.updateLocale = YF;
Ct.locales = KF;
Ct.weekdaysShort = G7;
Ct.normalizeUnits = va;
Ct.relativeTimeRounding = $Q;
Ct.relativeTimeThreshold = kQ;
Ct.calendarFormat = HV;
Ct.prototype = ht;
Ct.HTML5_FMT = {
  DATETIME_LOCAL: "YYYY-MM-DDTHH:mm",
  // <input type="datetime-local" />
  DATETIME_LOCAL_SECONDS: "YYYY-MM-DDTHH:mm:ss",
  // <input type="datetime-local" step="1" />
  DATETIME_LOCAL_MS: "YYYY-MM-DDTHH:mm:ss.SSS",
  // <input type="datetime-local" step="0.001" />
  DATE: "YYYY-MM-DD",
  // <input type="date" />
  TIME: "HH:mm",
  // <input type="time" />
  TIME_SECONDS: "HH:mm:ss",
  // <input type="time" step="1" />
  TIME_MS: "HH:mm:ss.SSS",
  // <input type="time" step="0.001" />
  WEEK: "GGGG-[W]WW",
  // <input type="week" />
  MONTH: "YYYY-MM"
  // <input type="month" />
};
Ct.ISO_8601;
const PQ = (t) => Ct.isMoment(t);
var Hi = /* @__PURE__ */ ((t) => (t.time = "time", t.number = "number", t.string = "string", t.boolean = "boolean", t.trace = "trace", t.geo = "geo", t.enum = "enum", t.other = "other", t.frame = "frame", t.nestedFrames = "nestedFrames", t))(Hi || {});
const EQ = /^\s*(-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?|NAN)\s*$/i;
function Yd(t) {
  return t instanceof Date || PQ(t) ? Hi.time : gB(t) ? Hi.number : xx(t) ? EQ.test(t) ? Hi.number : t === "true" || t === "TRUE" || t === "True" || t === "false" || t === "FALSE" || t === "False" ? Hi.boolean : Hi.string : mB(t) ? Hi.boolean : Hi.other;
}
function _Q(t) {
  if (t.name) {
    const e = t.name.toLowerCase();
    if (e === "date" || e === "time")
      return Hi.time;
  }
  for (let e = 0; e < t.values.length; e++) {
    const n = t.values[e];
    if (n != null)
      return Yd(n);
  }
}
function IQ(t) {
  return MQ(t);
}
function MQ(t, e) {
  return {
    fields: (e ? t.fields.filter(e) : t.fields).map((o) => {
      let r = o.values;
      return {
        name: o.name,
        type: o.type,
        config: o.config,
        values: r,
        labels: o.labels
      };
    }),
    refId: t.refId,
    meta: t.meta,
    name: t.name
  };
}
var iT, oT;
class AQ {
  constructor() {
    this[iT] = {};
  }
  // Implement "iterator protocol"
  *iterator() {
    for (let e = 0; e < this.length; e++)
      yield this.get(e);
  }
  set(e, n) {
    throw "unsupported operation";
  }
  add(e) {
    throw "unsupported operation";
  }
  push(...e) {
    for (const n of e)
      this.add(n);
    return this.length;
  }
  // Implement "iterable protocol"
  [(oT = Symbol.iterator, iT = Symbol.unscopables, oT)]() {
    return this.iterator();
  }
  forEach(e) {
    return Ob(this).forEach(e);
  }
  map(e) {
    return Ob(this).map(e);
  }
  filter(e) {
    return Ob(this).filter(e);
  }
  at(e) {
    return this.get(e);
  }
  toArray() {
    const e = new Array(this.length);
    for (let n = 0; n < this.length; n++)
      e[n] = this.get(n);
    return e;
  }
  join(e) {
    return this.toArray().join(e);
  }
  toJSON() {
    return this.toArray();
  }
  pop() {
    throw new Error("Method not implemented.");
  }
  concat(...e) {
    throw new Error("Method not implemented.");
  }
  reverse() {
    throw new Error("Method not implemented.");
  }
  shift() {
    throw new Error("Method not implemented.");
  }
  sort(e) {
    throw new Error("Method not implemented.");
  }
  splice(e, n, ...i) {
    throw new Error("Method not implemented.");
  }
  unshift(...e) {
    throw new Error("Method not implemented.");
  }
  fill(e, n, i) {
    throw new Error("Method not implemented.");
  }
  copyWithin(e, n, i) {
    throw new Error("Method not implemented.");
  }
  //--------------------------------------------------------------------------------
  // Delegated Array function -- these will not be efficient :grimmice:
  //--------------------------------------------------------------------------------
  slice(e, n) {
    return this.toArray().slice(e, n);
  }
  indexOf(e, n) {
    return this.toArray().indexOf(e, n);
  }
  lastIndexOf(e, n) {
    return this.toArray().lastIndexOf(e, n);
  }
  every(e, n) {
    return this.toArray().every(e, n);
  }
  some(e, n) {
    return this.toArray().some(e, n);
  }
  reduce(e, n) {
    throw new Error("Method not implemented.");
  }
  reduceRight(e, n) {
    throw new Error("Method not implemented.");
  }
  find(e, n) {
    return this.toArray().find(e, n);
  }
  findIndex(e, n) {
    return this.toArray().findIndex(e, n);
  }
  entries() {
    return this.toArray().entries();
  }
  keys() {
    return this.toArray().keys();
  }
  values() {
    return this.toArray().values();
  }
  includes(e, n) {
    return this.toArray().includes(e, n);
  }
  flatMap(e, n) {
    return this.toArray().flatMap(e, n);
  }
  flat(e) {
    throw new Error("Method not implemented.");
  }
}
const xb = [];
function Ob(t) {
  return {
    *[Symbol.iterator]() {
      for (let e = 0; e < t.length; e++)
        yield t.get(e);
    },
    forEach(e) {
      for (let n = 0; n < t.length; n++)
        e(t.get(n), n, xb);
    },
    map(e) {
      const n = [];
      for (let i = 0; i < t.length; i++)
        n.push(e(t.get(i), i, xb));
      return n;
    },
    /** Add a predicate where you return true if it should *keep* the value */
    filter(e) {
      const n = [];
      let i = 0;
      for (const o of this)
        e(o, i++, xb) && n.push(o);
      return n;
    }
  };
}
function RQ(t, e) {
  return e.type || (e.name === "time" || e.name === "Time" ? e.type = Hi.time : e.type = Yd(t)), e.type === Hi.number ? (n) => parseFloat(n) : e.type === Hi.boolean ? (n) => !(n[0] === "F" || n[0] === "f" || n[0] === "0") : (n) => n;
}
const Sb = void 0;
class DQ extends AQ {
  constructor(e, n) {
    if (super(), this.fields = [], this.first = [], this.parsers = void 0, this.creator = n || ((i) => i ?? []), e) {
      const { name: i, refId: o, meta: r, fields: a } = e;
      if (i && (this.name = i), o && (this.refId = o), r && (this.meta = r), a)
        for (const l of a)
          this.addField(l);
    }
    Object.defineProperty(this, "length", {
      enumerable: !0,
      get: () => this.first.length
    });
  }
  // Defined for Vector interface
  get length() {
    return this.first.length;
  }
  addFieldFor(e, n) {
    return this.addField({
      name: n || "",
      // Will be filled in
      type: Yd(e)
    });
  }
  addField(e, n) {
    let i;
    e.values && (i = e.values);
    let o = e.type;
    !o && (e.name === "time" || e.name === "Time") ? o = Hi.time : (!o && i && i.length && (o = Yd(i[0])), o || (o = Hi.other));
    let r = e.name;
    r || (r = `Field ${this.fields.length + 1}`);
    const a = {
      ...e,
      name: r,
      type: o,
      config: e.config || {},
      values: this.creator(i)
    };
    if (o === Hi.other && (o = _Q(a), o && (a.type = o)), this.fields.push(a), this.first = this.fields[0].values, n)
      for (; a.values.length < n; )
        a.values.push(Sb);
    else
      this.validate();
    return a;
  }
  validate() {
    const e = this.fields.reduce((n, i) => Math.max(n, i.values.length), 0);
    for (const n of this.fields)
      for (; n.values.length !== e; )
        n.values.push(Sb);
  }
  /**
   * @deprecated unclear if this is actually used
   */
  setParser(e, n) {
    return this.parsers || (this.parsers = /* @__PURE__ */ new Map()), this.parsers.set(e, n), n;
  }
  parseValue(e, n) {
    var i;
    let o = (i = this.parsers) == null ? void 0 : i.get(e);
    return o || (o = this.setParser(e, RQ(n, e))), o(n);
  }
  /**
   * This will add each value to the corresponding column
   */
  appendRow(e) {
    for (let n = this.fields.length; n < e.length; n++)
      this.addField({
        name: `Field ${n + 1}`,
        type: Yd(e[n])
      });
    if (this.length < 1)
      for (let n = 0; n < this.fields.length; n++) {
        const i = this.fields[n];
        (!i.type || i.type === Hi.other) && (i.type = Yd(e[n]));
      }
    for (let n = 0; n < this.fields.length; n++) {
      const i = this.fields[n];
      let o = e[n];
      i.type !== Hi.string && xx(o) && (o = this.parseValue(i, o)), i.values.push(o);
    }
  }
  /** support standard array push syntax */
  push(...e) {
    for (const n of e)
      this.add(n);
    return this.length;
  }
  reverse() {
    for (const e of this.fields)
      e.values.reverse();
    return this;
  }
  /**
   * Add values from an object to corresponding fields. Similar to appendRow but does not create new fields.
   */
  add(e) {
    const n = e;
    for (const i of this.fields) {
      let o = n[i.name];
      i.type !== Hi.string && xx(o) && (o = this.parseValue(i, o)), o === void 0 && (o = Sb), i.values.push(o);
    }
  }
  set(e, n) {
    if (e > this.length)
      throw new Error("Unable to set value beyond current length");
    const i = n || {};
    for (const o of this.fields)
      o.values[e] = i[o.name];
  }
  /**
   * Get an object with a property for each field in the DataFrame
   */
  get(e) {
    const n = {};
    for (const i of this.fields)
      n[i.name] = i.values[e];
    return n;
  }
  /**
   * The simplified JSON values used in JSON.stringify()
   */
  toJSON() {
    return IQ(this);
  }
}
function NQ(t) {
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
}
function Rv(t) {
  "@babel/helpers - typeof";
  return Rv = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
    return typeof e;
  } : function(e) {
    return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
  }, Rv(t);
}
var LQ = /^\s+/, zQ = /\s+$/;
function Qt(t, e) {
  if (t = t || "", e = e || {}, t instanceof Qt)
    return t;
  if (!(this instanceof Qt))
    return new Qt(t, e);
  var n = BQ(t);
  this._originalInput = t, this._r = n.r, this._g = n.g, this._b = n.b, this._a = n.a, this._roundA = Math.round(100 * this._a) / 100, this._format = e.format || n.format, this._gradientType = e.gradientType, this._r < 1 && (this._r = Math.round(this._r)), this._g < 1 && (this._g = Math.round(this._g)), this._b < 1 && (this._b = Math.round(this._b)), this._ok = n.ok;
}
Qt.prototype = {
  isDark: function() {
    return this.getBrightness() < 128;
  },
  isLight: function() {
    return !this.isDark();
  },
  isValid: function() {
    return this._ok;
  },
  getOriginalInput: function() {
    return this._originalInput;
  },
  getFormat: function() {
    return this._format;
  },
  getAlpha: function() {
    return this._a;
  },
  getBrightness: function() {
    var e = this.toRgb();
    return (e.r * 299 + e.g * 587 + e.b * 114) / 1e3;
  },
  getLuminance: function() {
    var e = this.toRgb(), n, i, o, r, a, l;
    return n = e.r / 255, i = e.g / 255, o = e.b / 255, n <= 0.03928 ? r = n / 12.92 : r = Math.pow((n + 0.055) / 1.055, 2.4), i <= 0.03928 ? a = i / 12.92 : a = Math.pow((i + 0.055) / 1.055, 2.4), o <= 0.03928 ? l = o / 12.92 : l = Math.pow((o + 0.055) / 1.055, 2.4), 0.2126 * r + 0.7152 * a + 0.0722 * l;
  },
  setAlpha: function(e) {
    return this._a = TR(e), this._roundA = Math.round(100 * this._a) / 100, this;
  },
  toHsv: function() {
    var e = aT(this._r, this._g, this._b);
    return {
      h: e.h * 360,
      s: e.s,
      v: e.v,
      a: this._a
    };
  },
  toHsvString: function() {
    var e = aT(this._r, this._g, this._b), n = Math.round(e.h * 360), i = Math.round(e.s * 100), o = Math.round(e.v * 100);
    return this._a == 1 ? "hsv(" + n + ", " + i + "%, " + o + "%)" : "hsva(" + n + ", " + i + "%, " + o + "%, " + this._roundA + ")";
  },
  toHsl: function() {
    var e = rT(this._r, this._g, this._b);
    return {
      h: e.h * 360,
      s: e.s,
      l: e.l,
      a: this._a
    };
  },
  toHslString: function() {
    var e = rT(this._r, this._g, this._b), n = Math.round(e.h * 360), i = Math.round(e.s * 100), o = Math.round(e.l * 100);
    return this._a == 1 ? "hsl(" + n + ", " + i + "%, " + o + "%)" : "hsla(" + n + ", " + i + "%, " + o + "%, " + this._roundA + ")";
  },
  toHex: function(e) {
    return lT(this._r, this._g, this._b, e);
  },
  toHexString: function(e) {
    return "#" + this.toHex(e);
  },
  toHex8: function(e) {
    return HQ(this._r, this._g, this._b, this._a, e);
  },
  toHex8String: function(e) {
    return "#" + this.toHex8(e);
  },
  toRgb: function() {
    return {
      r: Math.round(this._r),
      g: Math.round(this._g),
      b: Math.round(this._b),
      a: this._a
    };
  },
  toRgbString: function() {
    return this._a == 1 ? "rgb(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ")" : "rgba(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ", " + this._roundA + ")";
  },
  toPercentageRgb: function() {
    return {
      r: Math.round(Mi(this._r, 255) * 100) + "%",
      g: Math.round(Mi(this._g, 255) * 100) + "%",
      b: Math.round(Mi(this._b, 255) * 100) + "%",
      a: this._a
    };
  },
  toPercentageRgbString: function() {
    return this._a == 1 ? "rgb(" + Math.round(Mi(this._r, 255) * 100) + "%, " + Math.round(Mi(this._g, 255) * 100) + "%, " + Math.round(Mi(this._b, 255) * 100) + "%)" : "rgba(" + Math.round(Mi(this._r, 255) * 100) + "%, " + Math.round(Mi(this._g, 255) * 100) + "%, " + Math.round(Mi(this._b, 255) * 100) + "%, " + this._roundA + ")";
  },
  toName: function() {
    return this._a === 0 ? "transparent" : this._a < 1 ? !1 : tH[lT(this._r, this._g, this._b, !0)] || !1;
  },
  toFilter: function(e) {
    var n = "#" + sT(this._r, this._g, this._b, this._a), i = n, o = this._gradientType ? "GradientType = 1, " : "";
    if (e) {
      var r = Qt(e);
      i = "#" + sT(r._r, r._g, r._b, r._a);
    }
    return "progid:DXImageTransform.Microsoft.gradient(" + o + "startColorstr=" + n + ",endColorstr=" + i + ")";
  },
  toString: function(e) {
    var n = !!e;
    e = e || this._format;
    var i = !1, o = this._a < 1 && this._a >= 0, r = !n && o && (e === "hex" || e === "hex6" || e === "hex3" || e === "hex4" || e === "hex8" || e === "name");
    return r ? e === "name" && this._a === 0 ? this.toName() : this.toRgbString() : (e === "rgb" && (i = this.toRgbString()), e === "prgb" && (i = this.toPercentageRgbString()), (e === "hex" || e === "hex6") && (i = this.toHexString()), e === "hex3" && (i = this.toHexString(!0)), e === "hex4" && (i = this.toHex8String(!0)), e === "hex8" && (i = this.toHex8String()), e === "name" && (i = this.toName()), e === "hsl" && (i = this.toHslString()), e === "hsv" && (i = this.toHsvString()), i || this.toHexString());
  },
  clone: function() {
    return Qt(this.toString());
  },
  _applyModification: function(e, n) {
    var i = e.apply(null, [this].concat([].slice.call(n)));
    return this._r = i._r, this._g = i._g, this._b = i._b, this.setAlpha(i._a), this;
  },
  lighten: function() {
    return this._applyModification(YQ, arguments);
  },
  brighten: function() {
    return this._applyModification(KQ, arguments);
  },
  darken: function() {
    return this._applyModification(XQ, arguments);
  },
  desaturate: function() {
    return this._applyModification(WQ, arguments);
  },
  saturate: function() {
    return this._applyModification(jQ, arguments);
  },
  greyscale: function() {
    return this._applyModification(qQ, arguments);
  },
  spin: function() {
    return this._applyModification(ZQ, arguments);
  },
  _applyCombination: function(e, n) {
    return e.apply(null, [this].concat([].slice.call(n)));
  },
  analogous: function() {
    return this._applyCombination(JQ, arguments);
  },
  complement: function() {
    return this._applyCombination(GQ, arguments);
  },
  monochromatic: function() {
    return this._applyCombination(eH, arguments);
  },
  splitcomplement: function() {
    return this._applyCombination(UQ, arguments);
  },
  // Disabled until https://github.com/bgrins/TinyColor/issues/254
  // polyad: function (number) {
  //   return this._applyCombination(polyad, [number]);
  // },
  triad: function() {
    return this._applyCombination(uT, [3]);
  },
  tetrad: function() {
    return this._applyCombination(uT, [4]);
  }
};
Qt.fromRatio = function(t, e) {
  if (Rv(t) == "object") {
    var n = {};
    for (var i in t)
      t.hasOwnProperty(i) && (i === "a" ? n[i] = t[i] : n[i] = Vh(t[i]));
    t = n;
  }
  return Qt(t, e);
};
function BQ(t) {
  var e = {
    r: 0,
    g: 0,
    b: 0
  }, n = 1, i = null, o = null, r = null, a = !1, l = !1;
  return typeof t == "string" && (t = rH(t)), Rv(t) == "object" && (Xl(t.r) && Xl(t.g) && Xl(t.b) ? (e = FQ(t.r, t.g, t.b), a = !0, l = String(t.r).substr(-1) === "%" ? "prgb" : "rgb") : Xl(t.h) && Xl(t.s) && Xl(t.v) ? (i = Vh(t.s), o = Vh(t.v), e = QQ(t.h, i, o), a = !0, l = "hsv") : Xl(t.h) && Xl(t.s) && Xl(t.l) && (i = Vh(t.s), r = Vh(t.l), e = VQ(t.h, i, r), a = !0, l = "hsl"), t.hasOwnProperty("a") && (n = t.a)), n = TR(n), {
    ok: a,
    format: t.format || l,
    r: Math.min(255, Math.max(e.r, 0)),
    g: Math.min(255, Math.max(e.g, 0)),
    b: Math.min(255, Math.max(e.b, 0)),
    a: n
  };
}
function FQ(t, e, n) {
  return {
    r: Mi(t, 255) * 255,
    g: Mi(e, 255) * 255,
    b: Mi(n, 255) * 255
  };
}
function rT(t, e, n) {
  t = Mi(t, 255), e = Mi(e, 255), n = Mi(n, 255);
  var i = Math.max(t, e, n), o = Math.min(t, e, n), r, a, l = (i + o) / 2;
  if (i == o)
    r = a = 0;
  else {
    var s = i - o;
    switch (a = l > 0.5 ? s / (2 - i - o) : s / (i + o), i) {
      case t:
        r = (e - n) / s + (e < n ? 6 : 0);
        break;
      case e:
        r = (n - t) / s + 2;
        break;
      case n:
        r = (t - e) / s + 4;
        break;
    }
    r /= 6;
  }
  return {
    h: r,
    s: a,
    l
  };
}
function VQ(t, e, n) {
  var i, o, r;
  t = Mi(t, 360), e = Mi(e, 100), n = Mi(n, 100);
  function a(u, c, d) {
    return d < 0 && (d += 1), d > 1 && (d -= 1), d < 1 / 6 ? u + (c - u) * 6 * d : d < 1 / 2 ? c : d < 2 / 3 ? u + (c - u) * (2 / 3 - d) * 6 : u;
  }
  if (e === 0)
    i = o = r = n;
  else {
    var l = n < 0.5 ? n * (1 + e) : n + e - n * e, s = 2 * n - l;
    i = a(s, l, t + 1 / 3), o = a(s, l, t), r = a(s, l, t - 1 / 3);
  }
  return {
    r: i * 255,
    g: o * 255,
    b: r * 255
  };
}
function aT(t, e, n) {
  t = Mi(t, 255), e = Mi(e, 255), n = Mi(n, 255);
  var i = Math.max(t, e, n), o = Math.min(t, e, n), r, a, l = i, s = i - o;
  if (a = i === 0 ? 0 : s / i, i == o)
    r = 0;
  else {
    switch (i) {
      case t:
        r = (e - n) / s + (e < n ? 6 : 0);
        break;
      case e:
        r = (n - t) / s + 2;
        break;
      case n:
        r = (t - e) / s + 4;
        break;
    }
    r /= 6;
  }
  return {
    h: r,
    s: a,
    v: l
  };
}
function QQ(t, e, n) {
  t = Mi(t, 360) * 6, e = Mi(e, 100), n = Mi(n, 100);
  var i = Math.floor(t), o = t - i, r = n * (1 - e), a = n * (1 - o * e), l = n * (1 - (1 - o) * e), s = i % 6, u = [n, a, r, r, l, n][s], c = [l, n, n, a, r, r][s], d = [r, r, l, n, n, a][s];
  return {
    r: u * 255,
    g: c * 255,
    b: d * 255
  };
}
function lT(t, e, n, i) {
  var o = [Na(Math.round(t).toString(16)), Na(Math.round(e).toString(16)), Na(Math.round(n).toString(16))];
  return i && o[0].charAt(0) == o[0].charAt(1) && o[1].charAt(0) == o[1].charAt(1) && o[2].charAt(0) == o[2].charAt(1) ? o[0].charAt(0) + o[1].charAt(0) + o[2].charAt(0) : o.join("");
}
function HQ(t, e, n, i, o) {
  var r = [Na(Math.round(t).toString(16)), Na(Math.round(e).toString(16)), Na(Math.round(n).toString(16)), Na(PR(i))];
  return o && r[0].charAt(0) == r[0].charAt(1) && r[1].charAt(0) == r[1].charAt(1) && r[2].charAt(0) == r[2].charAt(1) && r[3].charAt(0) == r[3].charAt(1) ? r[0].charAt(0) + r[1].charAt(0) + r[2].charAt(0) + r[3].charAt(0) : r.join("");
}
function sT(t, e, n, i) {
  var o = [Na(PR(i)), Na(Math.round(t).toString(16)), Na(Math.round(e).toString(16)), Na(Math.round(n).toString(16))];
  return o.join("");
}
Qt.equals = function(t, e) {
  return !t || !e ? !1 : Qt(t).toRgbString() == Qt(e).toRgbString();
};
Qt.random = function() {
  return Qt.fromRatio({
    r: Math.random(),
    g: Math.random(),
    b: Math.random()
  });
};
function WQ(t, e) {
  e = e === 0 ? 0 : e || 10;
  var n = Qt(t).toHsl();
  return n.s -= e / 100, n.s = Y0(n.s), Qt(n);
}
function jQ(t, e) {
  e = e === 0 ? 0 : e || 10;
  var n = Qt(t).toHsl();
  return n.s += e / 100, n.s = Y0(n.s), Qt(n);
}
function qQ(t) {
  return Qt(t).desaturate(100);
}
function YQ(t, e) {
  e = e === 0 ? 0 : e || 10;
  var n = Qt(t).toHsl();
  return n.l += e / 100, n.l = Y0(n.l), Qt(n);
}
function KQ(t, e) {
  e = e === 0 ? 0 : e || 10;
  var n = Qt(t).toRgb();
  return n.r = Math.max(0, Math.min(255, n.r - Math.round(255 * -(e / 100)))), n.g = Math.max(0, Math.min(255, n.g - Math.round(255 * -(e / 100)))), n.b = Math.max(0, Math.min(255, n.b - Math.round(255 * -(e / 100)))), Qt(n);
}
function XQ(t, e) {
  e = e === 0 ? 0 : e || 10;
  var n = Qt(t).toHsl();
  return n.l -= e / 100, n.l = Y0(n.l), Qt(n);
}
function ZQ(t, e) {
  var n = Qt(t).toHsl(), i = (n.h + e) % 360;
  return n.h = i < 0 ? 360 + i : i, Qt(n);
}
function GQ(t) {
  var e = Qt(t).toHsl();
  return e.h = (e.h + 180) % 360, Qt(e);
}
function uT(t, e) {
  if (isNaN(e) || e <= 0)
    throw new Error("Argument to polyad must be a positive number");
  for (var n = Qt(t).toHsl(), i = [Qt(t)], o = 360 / e, r = 1; r < e; r++)
    i.push(Qt({
      h: (n.h + r * o) % 360,
      s: n.s,
      l: n.l
    }));
  return i;
}
function UQ(t) {
  var e = Qt(t).toHsl(), n = e.h;
  return [Qt(t), Qt({
    h: (n + 72) % 360,
    s: e.s,
    l: e.l
  }), Qt({
    h: (n + 216) % 360,
    s: e.s,
    l: e.l
  })];
}
function JQ(t, e, n) {
  e = e || 6, n = n || 30;
  var i = Qt(t).toHsl(), o = 360 / n, r = [Qt(t)];
  for (i.h = (i.h - (o * e >> 1) + 720) % 360; --e; )
    i.h = (i.h + o) % 360, r.push(Qt(i));
  return r;
}
function eH(t, e) {
  e = e || 6;
  for (var n = Qt(t).toHsv(), i = n.h, o = n.s, r = n.v, a = [], l = 1 / e; e--; )
    a.push(Qt({
      h: i,
      s: o,
      v: r
    })), r = (r + l) % 1;
  return a;
}
Qt.mix = function(t, e, n) {
  n = n === 0 ? 0 : n || 50;
  var i = Qt(t).toRgb(), o = Qt(e).toRgb(), r = n / 100, a = {
    r: (o.r - i.r) * r + i.r,
    g: (o.g - i.g) * r + i.g,
    b: (o.b - i.b) * r + i.b,
    a: (o.a - i.a) * r + i.a
  };
  return Qt(a);
};
Qt.readability = function(t, e) {
  var n = Qt(t), i = Qt(e);
  return (Math.max(n.getLuminance(), i.getLuminance()) + 0.05) / (Math.min(n.getLuminance(), i.getLuminance()) + 0.05);
};
Qt.isReadable = function(t, e, n) {
  var i = Qt.readability(t, e), o, r;
  switch (r = !1, o = aH(n), o.level + o.size) {
    case "AAsmall":
    case "AAAlarge":
      r = i >= 4.5;
      break;
    case "AAlarge":
      r = i >= 3;
      break;
    case "AAAsmall":
      r = i >= 7;
      break;
  }
  return r;
};
Qt.mostReadable = function(t, e, n) {
  var i = null, o = 0, r, a, l, s;
  n = n || {}, a = n.includeFallbackColors, l = n.level, s = n.size;
  for (var u = 0; u < e.length; u++)
    r = Qt.readability(t, e[u]), r > o && (o = r, i = Qt(e[u]));
  return Qt.isReadable(t, i, {
    level: l,
    size: s
  }) || !a ? i : (n.includeFallbackColors = !1, Qt.mostReadable(t, ["#fff", "#000"], n));
};
var Px = Qt.names = {
  aliceblue: "f0f8ff",
  antiquewhite: "faebd7",
  aqua: "0ff",
  aquamarine: "7fffd4",
  azure: "f0ffff",
  beige: "f5f5dc",
  bisque: "ffe4c4",
  black: "000",
  blanchedalmond: "ffebcd",
  blue: "00f",
  blueviolet: "8a2be2",
  brown: "a52a2a",
  burlywood: "deb887",
  burntsienna: "ea7e5d",
  cadetblue: "5f9ea0",
  chartreuse: "7fff00",
  chocolate: "d2691e",
  coral: "ff7f50",
  cornflowerblue: "6495ed",
  cornsilk: "fff8dc",
  crimson: "dc143c",
  cyan: "0ff",
  darkblue: "00008b",
  darkcyan: "008b8b",
  darkgoldenrod: "b8860b",
  darkgray: "a9a9a9",
  darkgreen: "006400",
  darkgrey: "a9a9a9",
  darkkhaki: "bdb76b",
  darkmagenta: "8b008b",
  darkolivegreen: "556b2f",
  darkorange: "ff8c00",
  darkorchid: "9932cc",
  darkred: "8b0000",
  darksalmon: "e9967a",
  darkseagreen: "8fbc8f",
  darkslateblue: "483d8b",
  darkslategray: "2f4f4f",
  darkslategrey: "2f4f4f",
  darkturquoise: "00ced1",
  darkviolet: "9400d3",
  deeppink: "ff1493",
  deepskyblue: "00bfff",
  dimgray: "696969",
  dimgrey: "696969",
  dodgerblue: "1e90ff",
  firebrick: "b22222",
  floralwhite: "fffaf0",
  forestgreen: "228b22",
  fuchsia: "f0f",
  gainsboro: "dcdcdc",
  ghostwhite: "f8f8ff",
  gold: "ffd700",
  goldenrod: "daa520",
  gray: "808080",
  green: "008000",
  greenyellow: "adff2f",
  grey: "808080",
  honeydew: "f0fff0",
  hotpink: "ff69b4",
  indianred: "cd5c5c",
  indigo: "4b0082",
  ivory: "fffff0",
  khaki: "f0e68c",
  lavender: "e6e6fa",
  lavenderblush: "fff0f5",
  lawngreen: "7cfc00",
  lemonchiffon: "fffacd",
  lightblue: "add8e6",
  lightcoral: "f08080",
  lightcyan: "e0ffff",
  lightgoldenrodyellow: "fafad2",
  lightgray: "d3d3d3",
  lightgreen: "90ee90",
  lightgrey: "d3d3d3",
  lightpink: "ffb6c1",
  lightsalmon: "ffa07a",
  lightseagreen: "20b2aa",
  lightskyblue: "87cefa",
  lightslategray: "789",
  lightslategrey: "789",
  lightsteelblue: "b0c4de",
  lightyellow: "ffffe0",
  lime: "0f0",
  limegreen: "32cd32",
  linen: "faf0e6",
  magenta: "f0f",
  maroon: "800000",
  mediumaquamarine: "66cdaa",
  mediumblue: "0000cd",
  mediumorchid: "ba55d3",
  mediumpurple: "9370db",
  mediumseagreen: "3cb371",
  mediumslateblue: "7b68ee",
  mediumspringgreen: "00fa9a",
  mediumturquoise: "48d1cc",
  mediumvioletred: "c71585",
  midnightblue: "191970",
  mintcream: "f5fffa",
  mistyrose: "ffe4e1",
  moccasin: "ffe4b5",
  navajowhite: "ffdead",
  navy: "000080",
  oldlace: "fdf5e6",
  olive: "808000",
  olivedrab: "6b8e23",
  orange: "ffa500",
  orangered: "ff4500",
  orchid: "da70d6",
  palegoldenrod: "eee8aa",
  palegreen: "98fb98",
  paleturquoise: "afeeee",
  palevioletred: "db7093",
  papayawhip: "ffefd5",
  peachpuff: "ffdab9",
  peru: "cd853f",
  pink: "ffc0cb",
  plum: "dda0dd",
  powderblue: "b0e0e6",
  purple: "800080",
  rebeccapurple: "663399",
  red: "f00",
  rosybrown: "bc8f8f",
  royalblue: "4169e1",
  saddlebrown: "8b4513",
  salmon: "fa8072",
  sandybrown: "f4a460",
  seagreen: "2e8b57",
  seashell: "fff5ee",
  sienna: "a0522d",
  silver: "c0c0c0",
  skyblue: "87ceeb",
  slateblue: "6a5acd",
  slategray: "708090",
  slategrey: "708090",
  snow: "fffafa",
  springgreen: "00ff7f",
  steelblue: "4682b4",
  tan: "d2b48c",
  teal: "008080",
  thistle: "d8bfd8",
  tomato: "ff6347",
  turquoise: "40e0d0",
  violet: "ee82ee",
  wheat: "f5deb3",
  white: "fff",
  whitesmoke: "f5f5f5",
  yellow: "ff0",
  yellowgreen: "9acd32"
}, tH = Qt.hexNames = nH(Px);
function nH(t) {
  var e = {};
  for (var n in t)
    t.hasOwnProperty(n) && (e[t[n]] = n);
  return e;
}
function TR(t) {
  return t = parseFloat(t), (isNaN(t) || t < 0 || t > 1) && (t = 1), t;
}
function Mi(t, e) {
  iH(t) && (t = "100%");
  var n = oH(t);
  return t = Math.min(e, Math.max(0, parseFloat(t))), n && (t = parseInt(t * e, 10) / 100), Math.abs(t - e) < 1e-6 ? 1 : t % e / parseFloat(e);
}
function Y0(t) {
  return Math.min(1, Math.max(0, t));
}
function Tr(t) {
  return parseInt(t, 16);
}
function iH(t) {
  return typeof t == "string" && t.indexOf(".") != -1 && parseFloat(t) === 1;
}
function oH(t) {
  return typeof t == "string" && t.indexOf("%") != -1;
}
function Na(t) {
  return t.length == 1 ? "0" + t : "" + t;
}
function Vh(t) {
  return t <= 1 && (t = t * 100 + "%"), t;
}
function PR(t) {
  return Math.round(parseFloat(t) * 255).toString(16);
}
function cT(t) {
  return Tr(t) / 255;
}
var $a = (function() {
  var t = "[-\\+]?\\d+%?", e = "[-\\+]?\\d*\\.\\d+%?", n = "(?:" + e + ")|(?:" + t + ")", i = "[\\s|\\(]+(" + n + ")[,|\\s]+(" + n + ")[,|\\s]+(" + n + ")\\s*\\)?", o = "[\\s|\\(]+(" + n + ")[,|\\s]+(" + n + ")[,|\\s]+(" + n + ")[,|\\s]+(" + n + ")\\s*\\)?";
  return {
    CSS_UNIT: new RegExp(n),
    rgb: new RegExp("rgb" + i),
    rgba: new RegExp("rgba" + o),
    hsl: new RegExp("hsl" + i),
    hsla: new RegExp("hsla" + o),
    hsv: new RegExp("hsv" + i),
    hsva: new RegExp("hsva" + o),
    hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
    hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
    hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
    hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
  };
})();
function Xl(t) {
  return !!$a.CSS_UNIT.exec(t);
}
function rH(t) {
  t = t.replace(LQ, "").replace(zQ, "").toLowerCase();
  var e = !1;
  if (Px[t])
    t = Px[t], e = !0;
  else if (t == "transparent")
    return {
      r: 0,
      g: 0,
      b: 0,
      a: 0,
      format: "name"
    };
  var n;
  return (n = $a.rgb.exec(t)) ? {
    r: n[1],
    g: n[2],
    b: n[3]
  } : (n = $a.rgba.exec(t)) ? {
    r: n[1],
    g: n[2],
    b: n[3],
    a: n[4]
  } : (n = $a.hsl.exec(t)) ? {
    h: n[1],
    s: n[2],
    l: n[3]
  } : (n = $a.hsla.exec(t)) ? {
    h: n[1],
    s: n[2],
    l: n[3],
    a: n[4]
  } : (n = $a.hsv.exec(t)) ? {
    h: n[1],
    s: n[2],
    v: n[3]
  } : (n = $a.hsva.exec(t)) ? {
    h: n[1],
    s: n[2],
    v: n[3],
    a: n[4]
  } : (n = $a.hex8.exec(t)) ? {
    r: Tr(n[1]),
    g: Tr(n[2]),
    b: Tr(n[3]),
    a: cT(n[4]),
    format: e ? "name" : "hex8"
  } : (n = $a.hex6.exec(t)) ? {
    r: Tr(n[1]),
    g: Tr(n[2]),
    b: Tr(n[3]),
    format: e ? "name" : "hex"
  } : (n = $a.hex4.exec(t)) ? {
    r: Tr(n[1] + "" + n[1]),
    g: Tr(n[2] + "" + n[2]),
    b: Tr(n[3] + "" + n[3]),
    a: cT(n[4] + "" + n[4]),
    format: e ? "name" : "hex8"
  } : (n = $a.hex3.exec(t)) ? {
    r: Tr(n[1] + "" + n[1]),
    g: Tr(n[2] + "" + n[2]),
    b: Tr(n[3] + "" + n[3]),
    format: e ? "name" : "hex"
  } : !1;
}
function aH(t) {
  var e, n;
  return t = t || {
    level: "AA",
    size: "small"
  }, e = (t.level || "AA").toUpperCase(), n = (t.size || "small").toLowerCase(), e !== "AA" && e !== "AAA" && (e = "AA"), n !== "small" && n !== "large" && (n = "small"), {
    level: e,
    size: n
  };
}
function ER(t) {
  return {
    name: t.name ?? "",
    refId: t.refId ?? "",
    fields: t.fields.map((e) => ({
      name: e.name,
      type: e.type,
      values: { toArray: () => e.values },
      config: e.config ?? {},
      state: {}
    }))
  };
}
const _R = /* @__PURE__ */ new Map();
function wb(t) {
  _R.set(t.type, t);
}
function Dv(t) {
  return _R.get(t);
}
const dT = [
  "api-gateway",
  "auth-service",
  "payment-service",
  "user-service",
  "notification-service",
  "order-service",
  "inventory-service",
  "search-service"
];
function Cb(t) {
  let e = t;
  return () => (e = (e * 16807 + 0) % 2147483647, e / 2147483647);
}
function lH(t, e, n, i, o) {
  const r = n ^ Math.floor(Date.now() / 5e3) * 2654435761, a = Cb(n), l = Cb(r);
  if (t === "random-walk") {
    const s = Cb((n + Date.now()) % 2147483647), u = o + i * 0.5, c = o * 0.1, d = o + i * 1.8, f = [u];
    for (let h = 1; h < e; h++) {
      const p = f[h - 1], g = (u - p) * 0.05, m = (s() - 0.5) * i * 0.08 + g;
      f.push(Math.max(c, Math.min(d, p + m)));
    }
    return f;
  }
  return Array.from({ length: e }, (s, u) => {
    const c = u / e;
    let d;
    switch (t) {
      case "sine":
        d = o + Math.sin(c * Math.PI * 4 + n) * i + (a() - 0.5) * i * 0.2;
        break;
      case "spike": {
        const h = [0.2, 0.5, 0.8].reduce(
          (p, g) => p + Math.exp(-((c - g) ** 2) / 1e-3) * i * 2,
          0
        );
        d = o + h + (a() - 0.5) * i * 0.15;
        break;
      }
      case "step":
        d = o + Math.floor(c * 5) % 3 * i * 0.5 + (a() - 0.5) * i * 0.1;
        break;
      case "sawtooth":
        d = o + c * 3 % 1 * i + (a() - 0.5) * i * 0.15;
        break;
      case "noise":
        d = o + a() * i;
        break;
      case "trend-up":
        d = o + c * i * 1.5 + Math.sin(c * 10) * i * 0.2 + (a() - 0.5) * i * 0.1;
        break;
      case "trend-down":
        d = o + (1 - c) * i * 1.5 + Math.sin(c * 8) * i * 0.15 + (a() - 0.5) * i * 0.1;
        break;
      case "plateau": {
        const p = c < 0.3 ? c / 0.3 : c > 0.7 ? (1 - c) / 0.30000000000000004 : 1;
        d = o + p * i + (a() - 0.5) * i * 0.1;
        break;
      }
      case "live": {
        if (c < 0.9)
          d = o + Math.sin(c * Math.PI * 4 + n) * i * 0.6 + (a() - 0.5) * i * 0.1;
        else {
          const h = (c - 0.9) / 0.09999999999999998;
          d = o + Math.sin(0.9 * Math.PI * 4 + n) * i * 0.6 + (l() - 0.5) * i * 0.4 * h * 2;
        }
        break;
      }
      default:
        d = o;
    }
    return Math.max(0, d);
  });
}
function IR(t, e = 15, n = 3, i = "sine", o) {
  const r = [];
  for (let l = t.from; l <= t.to; l += e)
    r.push(l);
  const a = Array.from({ length: n }, (l, s) => {
    const u = 20 + (s * 37 + 13) % 60, c = 10 + (s * 53 + 7) % 40, d = lH(i, r.length, s * 1e3 + 42, u, c);
    return {
      label: o?.[s] ?? dT[s % dT.length],
      values: d
    };
  });
  return { timestamps: r, series: a };
}
function sH(t, e, n, i) {
  const r = ((n + i) / 2 - t) * 0.05, a = (Math.random() - 0.5) * e * 0.08 + r;
  return Math.max(n, Math.min(i, t + a));
}
class uH {
  type = "mock";
  meta = {
    type: "mock",
    displayName: "Mock",
    icon: "🎲"
  };
  defaultQuery = () => ({
    type: "mock",
    metric: "",
    pattern: "sine",
    seriesCount: 3,
    liveAmplitude: 1
  });
  query(e) {
    const { range: n, targets: i, intervalMs: o, maxDataPoints: r } = e, a = n.to - n.from, l = Math.max(o, Math.ceil(a / (r || 1e3))), s = Math.max(Math.round(l / 1e3), 1), u = i.filter((c) => c).map((c) => {
      const { timestamps: d, series: f } = IR(
        { from: n.from / 1e3, to: n.to / 1e3 },
        s,
        c.seriesCount,
        c.pattern,
        c.labels
      ), h = d.map((g) => g * 1e3), p = [
        { name: "Time", type: Hi.time, values: h, config: {} },
        ...f.map((g) => ({
          name: g.label,
          type: Hi.number,
          values: g.values,
          config: { displayNameFromDS: g.label }
        }))
      ];
      return ER({ name: c.metric, refId: "A", fields: p });
    });
    return Promise.resolve({ data: u, state: "Done" });
  }
}
const ku = [
  "#4096ff",
  "#52c41a",
  "#faad14",
  "#ff4d4f",
  "#722ed1",
  "#13c2c2",
  "#eb2f96",
  "#fa8c16",
  "#a0d911",
  "#1677ff",
  "#2f54eb",
  "#f5222d",
  "#fadb14",
  "#7cb305",
  "#08979c",
  "#531dab",
  "#c41d7f",
  "#d4380d",
  "#d48806",
  "#389e0d"
];
function Zl(t, e) {
  if (t.length < 2 || e < 2)
    return [...t];
  const n = (r) => [
    Number.parseInt(r.slice(1, 3), 16),
    Number.parseInt(r.slice(3, 5), 16),
    Number.parseInt(r.slice(5, 7), 16)
  ], i = (r) => Math.round(Math.max(0, Math.min(255, r))).toString(16).padStart(2, "0"), o = t.length - 1;
  return Array.from({ length: e }, (r, a) => {
    const l = a / (e - 1) * o, s = Math.min(Math.floor(l), o - 1), u = l - s, [c, d, f] = n(t[s]), [h, p, g] = n(t[s + 1]);
    return `#${i(c + (h - c) * u)}${i(d + (p - d) * u)}${i(f + (g - f) * u)}`;
  });
}
const Jr = {
  classic: ku,
  tableau10: [
    "#4e79a7",
    "#f28e2b",
    "#e15759",
    "#76b7b2",
    "#59a14f",
    "#edc948",
    "#b07aa1",
    "#ff9da7",
    "#9c755f",
    "#bab0ac"
  ],
  "grafana-classic": [
    "#7EB26D",
    "#EAB839",
    "#6ED0E0",
    "#EF843C",
    "#E24D42",
    "#1F78C1",
    "#BA43A9",
    "#705DA0",
    "#508642",
    "#CCA300",
    "#447EBC",
    "#C15C17",
    "#890F02",
    "#0A437C",
    "#6D1F62",
    "#584477",
    "#B7DBAB",
    "#F4D598",
    "#70DBED",
    "#F9BA8F"
  ],
  blues: Zl(["#cfe2f3", "#9fc5e8", "#3d85c8", "#0b5394", "#041d3a"], 16),
  reds: Zl(["#fce5cd", "#f6b26b", "#e06666", "#cc0000", "#660000"], 16),
  GrYlRd: Zl(
    ["#37872d", "#96d98d", "#fee520", "#ff780a", "#f2495c", "#8f3bb8"],
    16
  ),
  "purple-orange": Zl(
    ["#7b2d8b", "#d45087", "#ff7c43", "#ffa600", "#f0e442", "#b3de69"],
    16
  ),
  "green-yellow-red": Zl(
    ["#1a9850", "#a6d96a", "#fee08b", "#fdae61", "#d73027"],
    16
  ),
  "red-yellow-green": Zl(
    ["#d73027", "#fdae61", "#fee08b", "#a6d96a", "#1a9850"],
    16
  ),
  "blue-yellow-red": Zl(
    ["#2166ac", "#92c5de", "#d1e5f0", "#fddbc7", "#f4a582", "#b2182b"],
    16
  ),
  "blue-purple": Zl(
    ["#045a8d", "#74a9cf", "#ccebc5", "#9ebcda", "#8856a7", "#810f7c"],
    16
  ),
  "yellow-blue": Zl(["#ffffd9", "#c7e9b4", "#41b6c4", "#225ea8", "#0c2c84"], 16)
};
function cH(t) {
  return !t || t === "classic" ? ku : Jr[t] ?? ku;
}
function MR(t, e, n = "sequential", i) {
  if (e === 0)
    return [];
  if (t === "fixed") {
    const r = i ?? ku[0];
    return Array.from({ length: e }, () => r);
  }
  if (t === "thresholds")
    return [];
  const o = cH(t);
  return n === "distributed" && e > 1 ? Array.from({ length: e }, (r, a) => {
    const l = Math.round(a * (o.length - 1) / (e - 1));
    return o[l];
  }) : Array.from({ length: e }, (r, a) => o[a % o.length]);
}
const pi = {
  min: 0,
  max: 100,
  capRound: !0,
  trackWidth: 28,
  fillWidth: 30,
  trackColor: "#F4F5F5",
  sweepAngle: 270,
  valueColor: "#e6e6e6",
  valueSize: 28,
  valueVisible: !0,
  paddingX: 12,
  paddingY: 12,
  thresholdDisplay: "track",
  thresholdLabelDisplay: "none",
  orientation: "auto",
  colorFromScheme: !1,
  valueOffsetY: 18
};
let dH = 0;
function Ex() {
  return `panel-${Date.now()}-${++dH}`;
}
function na(t) {
  return [{ id: "A", enabled: !0, dataSource: t }];
}
const fH = {
  timeseries: {
    queries: na({
      type: "mock",
      metric: "http_request_duration_seconds",
      pattern: "sine",
      seriesCount: 3
    }),
    lineWidth: 1.5,
    fillOpacity: 1,
    lineInterpolation: "linear",
    lineStyle: "solid",
    showPoints: !1,
    legendPosition: "bottom",
    tooltipMode: "multi",
    tooltipSort: "none",
    showAxisPointer: !0,
    unit: "",
    decimals: 1
  },
  bar: {
    queries: na({
      type: "mock",
      metric: "http_request_duration_seconds",
      pattern: "sine",
      seriesCount: 3,
      labels: ["p50", "p90", "p99"]
    }),
    lineWidth: 1,
    fillOpacity: 80,
    lineInterpolation: "linear",
    lineStyle: "solid",
    showPoints: !1,
    legendPosition: "bottom",
    unit: "ms",
    decimals: 0,
    stacked: !1
  },
  histogram: {
    queries: na({ type: "mock", metric: "request_duration_ms", pattern: "sine", seriesCount: 1 }),
    lineWidth: 1,
    fillOpacity: 60,
    lineInterpolation: "linear",
    lineStyle: "solid",
    showPoints: !1,
    legendPosition: "hidden",
    unit: "ms",
    decimals: 0
  },
  stat: {
    queries: na({
      type: "mock",
      metric: "http_requests_total",
      pattern: "trend-up",
      seriesCount: 1
    }),
    lineWidth: 1,
    fillOpacity: 0,
    lineInterpolation: "linear",
    lineStyle: "solid",
    showPoints: !1,
    legendPosition: "hidden",
    unit: "",
    decimals: 1,
    statValue: 0,
    statUnit: "",
    statTrend: "flat"
  },
  gauge: {
    queries: na({ type: "mock", metric: "system_cpu_usage", pattern: "sine", seriesCount: 1 }),
    lineWidth: 1,
    fillOpacity: 0,
    lineInterpolation: "linear",
    lineStyle: "solid",
    showPoints: !1,
    legendPosition: "hidden",
    unit: "%",
    decimals: 1,
    min: 0,
    max: 100
  },
  table: {
    queries: na({ type: "mock", metric: "http_requests", pattern: "noise", seriesCount: 1 }),
    lineWidth: 1,
    fillOpacity: 0,
    lineInterpolation: "linear",
    lineStyle: "solid",
    showPoints: !1,
    legendPosition: "hidden",
    unit: "",
    decimals: 0
  },
  pie: {
    queries: na({
      type: "mock",
      metric: "http_requests_by_service",
      pattern: "noise",
      seriesCount: 5
    }),
    lineWidth: 1,
    fillOpacity: 80,
    lineInterpolation: "linear",
    lineStyle: "solid",
    showPoints: !1,
    legendPosition: "bottom",
    unit: "",
    decimals: 1,
    pieType: "pie",
    pieSliceSorting: "desc",
    pieLabels: ["name", "percent"],
    pieShow: "calculate",
    pieCalculation: "lastNotNull"
  }
};
function AR(t, e) {
  const n = e?.id ?? Ex();
  return { ...{
    id: n,
    type: t,
    title: `New ${t} panel`,
    description: "",
    queries: [
      {
        id: "A",
        enabled: !0,
        dataSource: { type: "mock", metric: "", pattern: "sine", seriesCount: 3 }
      }
    ],
    drawStyle: "lines",
    lineWidth: 1.5,
    fillOpacity: 1,
    gradientMode: "none",
    lineInterpolation: "linear",
    lineStyle: "solid",
    spanNulls: !1,
    insertNulls: !1,
    showPoints: !1,
    showPointsMode: "auto",
    stackingMode: "none",
    legendPosition: "bottom",
    unit: "",
    decimals: 1,
    thresholds: [],
    thresholdBaseColor: "#73bf69",
    softMin: null,
    softMax: null,
    logScale: !1,
    stacked: !1,
    min: 0,
    max: 100,
    links: [],
    axisPlacement: "left",
    showGridLines: "all",
    gridColor: "#E8E9EA",
    axisLabel: "all",
    axisLabelColor: "#666666",
    axisTick: "hidden",
    axisBorder: "hidden",
    scaleDistribution: "linear",
    centeredZero: !1
  }, ...fH[t], ...e, id: n };
}
function RR() {
  const t = {}, e = [], n = [
    {
      id: "s1",
      type: "stat",
      title: "Requests/sec",
      x: 0,
      y: 0,
      w: 2,
      h: 4,
      extra: { statValue: 1247, statUnit: "req/s", statTrend: "up", unit: "reqps" }
    },
    {
      id: "s2",
      type: "stat",
      title: "Error Rate",
      x: 2,
      y: 0,
      w: 2,
      h: 4,
      extra: {
        statValue: 0.32,
        statUnit: "%",
        statTrend: "down",
        thresholds: [
          { value: 0, color: "#52c41a", label: "OK" },
          { value: 1, color: "#faad14", label: "Warn" },
          { value: 5, color: "#ff4d4f", label: "Crit" }
        ]
      }
    },
    {
      id: "s3",
      type: "stat",
      title: "P99 Latency",
      x: 4,
      y: 0,
      w: 2,
      h: 4,
      extra: {
        statValue: 342,
        statUnit: "ms",
        statTrend: "up",
        thresholds: [
          { value: 0, color: "#52c41a", label: "OK" },
          { value: 200, color: "#faad14", label: "Warn" },
          { value: 500, color: "#ff4d4f", label: "Crit" }
        ]
      }
    },
    {
      id: "s4",
      type: "stat",
      title: "Uptime",
      x: 6,
      y: 0,
      w: 2,
      h: 4,
      extra: { statValue: 99.97, statUnit: "%", statTrend: "flat" }
    },
    { id: "g1", type: "gauge", title: "CPU", x: 8, y: 0, w: 2, h: 4, extra: { statValue: 67.3 } },
    {
      id: "g2",
      type: "gauge",
      title: "Memory",
      x: 10,
      y: 0,
      w: 2,
      h: 4,
      extra: {
        statValue: 82.1,
        thresholds: [
          { value: 0, color: "#52c41a", label: "OK" },
          { value: 70, color: "#faad14", label: "Warn" },
          { value: 90, color: "#ff4d4f", label: "Crit" }
        ]
      }
    },
    {
      id: "ts1",
      type: "timeseries",
      title: "CPU Usage",
      x: 0,
      y: 4,
      w: 6,
      h: 8,
      extra: {
        description: "by service",
        queries: na({
          type: "mock",
          metric: "system_cpu_usage",
          pattern: "sine",
          seriesCount: 4,
          labels: ["api-gateway", "auth-service", "payment-service", "user-service"]
        }),
        unit: "percent"
      }
    },
    {
      id: "ts2",
      type: "timeseries",
      title: "Request Latency",
      x: 6,
      y: 4,
      w: 6,
      h: 8,
      extra: {
        description: "percentiles",
        queries: na({
          type: "mock",
          metric: "http_request_duration_seconds",
          pattern: "spike",
          seriesCount: 3,
          labels: ["p50", "p90", "p99"]
        }),
        unit: "ms",
        thresholds: [
          { value: 100, color: "#faad14", label: "Warning 100ms" },
          { value: 300, color: "#ff4d4f", label: "Critical 300ms" }
        ]
      }
    },
    {
      id: "ts3",
      type: "timeseries",
      title: "Throughput",
      x: 0,
      y: 12,
      w: 4,
      h: 8,
      extra: {
        description: "req/s",
        queries: na({
          type: "mock",
          metric: "http_requests_total",
          pattern: "trend-up",
          seriesCount: 3,
          labels: ["api-gateway", "auth-service", "payment-service"]
        })
      }
    },
    {
      id: "b1",
      type: "bar",
      title: "Latency Percentiles",
      x: 4,
      y: 12,
      w: 4,
      h: 8,
      extra: { description: "by bucket" }
    },
    { id: "h1", type: "histogram", title: "Duration Distribution", x: 8, y: 12, w: 4, h: 8 },
    {
      id: "ts4",
      type: "timeseries",
      title: "Error Rate",
      x: 0,
      y: 20,
      w: 6,
      h: 8,
      extra: {
        description: "5xx vs 4xx",
        queries: na({
          type: "mock",
          metric: "http_errors",
          pattern: "noise",
          seriesCount: 2,
          labels: ["5xx", "4xx"]
        }),
        fillOpacity: 3
      }
    },
    {
      id: "ts5",
      type: "timeseries",
      title: "Network I/O",
      x: 6,
      y: 20,
      w: 6,
      h: 8,
      extra: {
        description: "KB/s",
        queries: na({
          type: "mock",
          metric: "network_io",
          pattern: "sawtooth",
          seriesCount: 4,
          labels: ["eth0-rx", "eth0-tx", "eth1-rx", "eth1-tx"]
        }),
        unit: "bytes"
      }
    },
    {
      id: "t1",
      type: "table",
      title: "Recent Requests",
      x: 0,
      y: 28,
      w: 12,
      h: 10,
      extra: { description: "last 80 requests" }
    }
  ];
  for (const i of n) {
    const o = AR(i.type, { id: i.id, title: i.title, ...i.extra });
    t[i.id] = o, e.push({
      i: i.id,
      x: i.x,
      y: i.y,
      w: i.w,
      h: i.h,
      minH: i.type === "stat" || i.type === "gauge" ? 3 : 6
    });
  }
  return { panels: t, layouts: e };
}
function hH() {
  return JSON.stringify(RR(), null, 2);
}
const DR = /* @__PURE__ */ new Map();
function ec(t) {
  DR.set(t.meta.type, t);
}
function pH(t) {
  return DR.get(t);
}
const gH = {
  meta: { type: "bar", displayNameKey: "config.type.bar", icon: "📊" },
  optionCategories: [
    { key: "general", labelKey: "config.section.general", Component: null },
    { key: "bar-style", labelKey: "config.section.style", Component: null },
    { key: "axes", labelKey: "config.section.axes", Component: null },
    { key: "tooltip", labelKey: "config.section.tooltip", Component: null }
  ]
}, mH = {
  meta: { type: "gauge", displayNameKey: "config.type.gauge", icon: "🎯" },
  optionCategories: [
    { key: "general", labelKey: "config.section.general", Component: null },
    { key: "value", labelKey: "config.section.value", Component: null },
    { key: "gauge-style", labelKey: "config.section.gaugeStyle", Component: null }
  ]
}, vH = {
  meta: {
    type: "histogram",
    displayNameKey: "config.type.histogram",
    icon: "📉"
  },
  optionCategories: [
    { key: "general", labelKey: "config.section.general", Component: null },
    { key: "histogram-style", labelKey: "config.section.histStyle", Component: null },
    { key: "tooltip", labelKey: "config.section.tooltip", Component: null }
  ]
}, yH = {
  meta: { type: "pie", displayNameKey: "config.type.pie", icon: "🥧" },
  optionCategories: [
    { key: "general", labelKey: "config.section.general", Component: null },
    { key: "value", labelKey: "config.section.value", Component: null },
    { key: "pie-style", labelKey: "config.section.pieStyle", Component: null },
    { key: "tooltip", labelKey: "config.section.tooltip", Component: null }
  ]
}, bH = {
  meta: { type: "stat", displayNameKey: "config.type.stat", icon: "#" },
  optionCategories: [
    { key: "general", labelKey: "config.section.general", Component: null },
    { key: "value", labelKey: "config.section.value", Component: null },
    { key: "stat-style", labelKey: "config.section.gaugeStyle", Component: null }
  ]
}, xH = {
  meta: { type: "table", displayNameKey: "config.type.table", icon: "📋" },
  optionCategories: [
    { key: "general", labelKey: "config.section.general", Component: null },
    { key: "table-style", labelKey: "config.section.tableStyle", Component: null }
  ]
}, OH = {
  meta: { type: "timeseries", displayNameKey: "config.type.timeseries", icon: "📈" },
  optionCategories: [
    { key: "general", labelKey: "config.section.general", Component: null },
    { key: "value", labelKey: "config.section.value", Component: null },
    { key: "style", labelKey: "config.section.style", Component: null },
    { key: "axes", labelKey: "config.section.axes", Component: null },
    { key: "tooltip", labelKey: "config.section.tooltip", Component: null }
  ]
};
function SH() {
  ec(OH), ec(gH), ec(vH), ec(bH), ec(mH), ec(xH), ec(yH);
}
function Qh(t, e = "lastNotNull", n) {
  const i = t.filter((o) => o !== null);
  switch (e) {
    case "lastNotNull":
      return i.length > 0 ? i[i.length - 1] ?? 0 : 0;
    case "last":
      return t.length > 0 ? t[t.length - 1] ?? 0 : 0;
    case "firstNotNull":
      return i.length > 0 ? i[0] ?? 0 : 0;
    case "first":
      return t.length > 0 ? t[0] ?? 0 : 0;
    case "mean":
      return i.length > 0 ? i.reduce((o, r) => o + r, 0) / i.length : 0;
    case "min":
      return i.length > 0 ? Math.min(...i) : 0;
    case "max":
      return i.length > 0 ? Math.max(...i) : 0;
    case "sum":
      return i.reduce((o, r) => o + r, 0);
    case "count":
      return i.length;
    default:
      return i.length > 0 ? i[i.length - 1] ?? 0 : 0;
  }
}
function Kg(t, e) {
  const n = t.filter((o) => o !== null);
  if (n.length < 2)
    return null;
  const i = n[0];
  return i === 0 ? null : (n[n.length - 1] - i) / i;
}
class K0 {
  constructor(e) {
    this.props = e;
  }
}
var _x = /* @__PURE__ */ ((t) => (t.LOCAL_STORAGE = "LOCAL_STORAGE", t.IN_MEMORY = "IN_MEMORY", t))(_x || {}), Mc = /* @__PURE__ */ ((t) => (t.Linear = "linear", t.Logarithmic = "logarithmic", t.Symlog = "symlog", t))(Mc || {}), bl = /* @__PURE__ */ ((t) => (t.Lines = "lines", t.Bars = "bars", t.Points = "points", t.Histogram = "histogram", t))(bl || {}), tv = /* @__PURE__ */ ((t) => (t.Linear = "linear", t.Smooth = "smooth", t.StepBefore = "stepBefore", t.StepAfter = "stepAfter", t))(tv || {}), Ix = /* @__PURE__ */ ((t) => (t.Solid = "solid", t.Dashed = "dashed", t.Dotted = "dotted", t))(Ix || {}), tp = /* @__PURE__ */ ((t) => (t.None = "none", t.Solid = "solid", t.Gradient = "gradient", t))(tp || {}), NR = /* @__PURE__ */ ((t) => (t[t.Before = -1] = "Before", t[t.Center = 0] = "Center", t[t.After = 1] = "After", t))(NR || {});
function wH(t, e, n) {
  if (!n || n.length === 0)
    return 0;
  const i = n.reduce((o, r) => r.length > o.length ? r : o, "");
  return i === "" || !e.font?.[0] ? 0 : (t.ctx.font = e.font[0], t.ctx.measureText(i).width / devicePixelRatio);
}
function CH(t) {
  return (e, n, i, o) => {
    const r = e.axes[i];
    if (o > 1) {
      const l = r._size;
      if (l !== void 0)
        return l;
    }
    let a = (r.ticks?.size ?? 0) + t;
    return a += wH(e, r, n), Math.ceil(a);
  };
}
class $H extends K0 {
  buildGridConfig() {
    const { grid: e, isDarkMode: n, isLogScale: i } = this.props, o = n ? "#444" : "#E8E9EA", r = i ? 0.1 : 0.2;
    return e ? {
      stroke: e.stroke ?? o,
      width: e.width ?? r,
      show: e.show ?? !0
    } : { stroke: o, width: r, show: !0 };
  }
  buildTicksConfig() {
    const { ticks: e } = this.props;
    return e || { width: 0.3, show: !0 };
  }
  buildXAxisValuesFormatter() {
    if (this.props.isTimeAxis !== !1)
      return (e, n) => n.map((i) => {
        if (i == null || Number.isNaN(i))
          return "";
        const o = new Date(i * 1e3);
        return `${o.getHours().toString().padStart(2, "0")}:${o.getMinutes().toString().padStart(2, "0")}`;
      });
  }
  buildYAxisValuesFormatter() {
    const { yAxisUnit: e, decimalPrecision: n } = this.props;
    return (i, o) => o.map((r) => {
      if (r == null || Number.isNaN(r))
        return "";
      const a = r.toFixed(n ?? 1);
      return e ? `${a} ${e}` : a;
    });
  }
  buildValuesFormatter() {
    const { values: e, scaleKey: n } = this.props;
    if (e)
      return e;
    if (n === "x")
      return this.buildXAxisValuesFormatter();
    if (n === "y")
      return this.buildYAxisValuesFormatter();
  }
  buildSizeCalculator() {
    const { size: e, scaleKey: n } = this.props;
    if (e)
      return e;
    if (n === "y")
      return CH(this.props.gap ?? 5);
  }
  buildStrokeColor() {
    const { stroke: e, isDarkMode: n } = this.props;
    if (e !== void 0)
      return e;
    if (n !== void 0)
      return n ? "white" : "black";
  }
  getConfig() {
    const {
      scaleKey: e,
      label: n,
      show: i = !0,
      side: o = 2,
      space: r,
      gap: a = 5
    } = this.props, l = this.buildGridConfig(), s = this.buildTicksConfig(), u = this.buildValuesFormatter(), c = this.buildSizeCalculator(), d = this.buildStrokeColor(), f = { scale: e, show: i, side: o };
    n && (f.label = n), d && (f.stroke = d), l && (f.grid = l), s && (f.ticks = s), u && (f.values = u), a !== void 0 && (f.gap = a), r !== void 0 && (f.space = r), c && (f.size = c);
    const { border: h } = this.props;
    return h?.show && (f.border = {
      stroke: h.stroke ?? d ?? "#666666",
      width: h.width ?? 1,
      show: !0
    }), f;
  }
  merge(e) {
    this.props = { ...this.props, ...e };
  }
}
const kH = "#FFFFFF", LR = 30, TH = 1e6, PH = 3, EH = {
  focus: { alpha: 0.3 },
  legend: { show: !1 },
  padding: [16, 16, 8, 8],
  series: [],
  hooks: {}
}, $b = {
  drag: { setScale: !0 },
  points: {
    one: !0,
    size: (t, e) => (t.series[e]?.points?.size ?? 0) * 3,
    width: (t, e, n) => n / 4,
    stroke: (t, e) => {
      const n = t.series[e]?.points, i = typeof n?.stroke == "function" ? n.stroke : void 0;
      return `${i !== void 0 ? i(t, e) : typeof n?.stroke == "string" ? n.stroke : ""}90`;
    },
    fill: () => kH
  },
  focus: { prox: TH },
  hover: { prox: LR, bias: 0 }
};
function _H(t, e, n) {
  return t;
}
function IH(t) {
  const e = [10, 5];
  function n(r, a, l) {
    const s = r.ctx;
    s.save(), s.lineWidth = 2, s.setLineDash(e);
    const u = s.canvas.height * 0.9;
    for (const c of l) {
      const d = c.thresholdColor ?? "red", f = _H(
        c.thresholdValue,
        c.thresholdUnit,
        t.yAxisUnit
      ), h = r.valToPos(Number(f), a, !0), p = Math.round(r.bbox.left), g = Math.round(h), m = Math.round(r.bbox.left + r.bbox.width);
      if (s.strokeStyle = d, s.beginPath(), s.moveTo(p, g), s.lineTo(m, g), s.stroke(), c.thresholdLabel) {
        const y = s.measureText(c.thresholdLabel).width, b = m - y - 20, $ = s.canvas.height - g > u ? g + 15 : g - 15;
        s.fillStyle = d, s.fillText(c.thresholdLabel, b, $);
      }
    }
  }
  const { scaleKey: i, thresholds: o } = t;
  return (r) => {
    const a = r.ctx;
    n(r, i, o), a.restore();
  };
}
function fT({
  seriesShow: t,
  seriesLabel: e,
  visibleStoredLabels: n,
  hiddenStoredLabels: i,
  hasActivePreference: o
}) {
  const r = !!n?.has(e), a = !!i?.has(e);
  return r ? !0 : a || o ? !1 : t ?? !0;
}
const zR = "series_visibility_";
function MH(t) {
  try {
    const e = localStorage.getItem(zR + t);
    return e ? JSON.parse(e) : null;
  } catch {
    return null;
  }
}
function AH(t, e) {
  try {
    localStorage.setItem(zR + t, JSON.stringify(e));
  } catch {
  }
}
function BR({
  uPlotInstance: t,
  stepInterval: e
}) {
  const n = t.scales.x;
  if (n && typeof n.min == "number") {
    const i = n.min, o = i + e, r = t.valToPos(i, "x"), a = t.valToPos(o, "x");
    return Math.abs(a - r);
  }
  return 0;
}
const RH = !0, mo = "u-", DH = "uplot", NH = mo + "hz", LH = mo + "vt", zH = mo + "title", BH = mo + "wrap", FH = mo + "under", VH = mo + "over", QH = mo + "axis", vc = mo + "off", HH = mo + "select", WH = mo + "cursor-x", jH = mo + "cursor-y", qH = mo + "cursor-pt", YH = mo + "legend", KH = mo + "live", XH = mo + "inline", ZH = mo + "series", GH = mo + "marker", hT = mo + "label", UH = mo + "value", Hh = "width", Wh = "height", kh = "top", pT = "bottom", wd = "left", kb = "right", Qw = "#000", gT = Qw + "0", mT = "mousemove", vT = "mousedown", Tb = "mouseup", yT = "mouseenter", bT = "mouseleave", xT = "dblclick", JH = "resize", e9 = "scroll", OT = "change", Nv = "dppxchange", Hw = "--", nh = typeof window < "u", Mx = nh ? document : null, rf = nh ? window : null, t9 = nh ? navigator : null;
let Jn, Xg;
function Ax() {
  let t = devicePixelRatio;
  Jn != t && (Jn = t, Xg && Dx(OT, Xg, Ax), Xg = matchMedia(`(min-resolution: ${Jn - 1e-3}dppx) and (max-resolution: ${Jn + 1e-3}dppx)`), Ac(OT, Xg, Ax), rf.dispatchEvent(new CustomEvent(Nv)));
}
function Er(t, e) {
  if (e != null) {
    let n = t.classList;
    !n.contains(e) && n.add(e);
  }
}
function Rx(t, e) {
  let n = t.classList;
  n.contains(e) && n.remove(e);
}
function Ci(t, e, n) {
  t.style[e] = n + "px";
}
function ka(t, e, n, i) {
  let o = Mx.createElement(t);
  return e != null && Er(o, e), n?.insertBefore(o, i), o;
}
function ea(t, e) {
  return ka("div", t, e);
}
const ST = /* @__PURE__ */ new WeakMap();
function rl(t, e, n, i, o) {
  let r = "translate(" + e + "px," + n + "px)", a = ST.get(t);
  r != a && (t.style.transform = r, ST.set(t, r), e < 0 || n < 0 || e > i || n > o ? Er(t, vc) : Rx(t, vc));
}
const wT = /* @__PURE__ */ new WeakMap();
function CT(t, e, n) {
  let i = e + n, o = wT.get(t);
  i != o && (wT.set(t, i), t.style.background = e, t.style.borderColor = n);
}
const $T = /* @__PURE__ */ new WeakMap();
function kT(t, e, n, i) {
  let o = e + "" + n, r = $T.get(t);
  o != r && ($T.set(t, o), t.style.height = n + "px", t.style.width = e + "px", t.style.marginLeft = i ? -e / 2 + "px" : 0, t.style.marginTop = i ? -n / 2 + "px" : 0);
}
const Ww = { passive: !0 }, n9 = { ...Ww, capture: !0 };
function Ac(t, e, n, i) {
  e.addEventListener(t, n, i ? n9 : Ww);
}
function Dx(t, e, n, i) {
  e.removeEventListener(t, n, Ww);
}
nh && Ax();
function Ia(t, e, n, i) {
  let o;
  n = n || 0, i = i || e.length - 1;
  let r = i <= 2147483647;
  for (; i - n > 1; )
    o = r ? n + i >> 1 : Dr((n + i) / 2), e[o] < t ? n = o : i = o;
  return t - e[n] <= e[i] - t ? n : i;
}
function kf(t, e, n, i) {
  for (let o = i == 1 ? e : n; o >= e && o <= n; o += i)
    if (t[o] != null)
      return o;
  return -1;
}
function i9(t, e, n, i) {
  let o = In, r = -In;
  if (i == 1)
    o = t[e], r = t[n];
  else if (i == -1)
    o = t[n], r = t[e];
  else
    for (let a = e; a <= n; a++) {
      let l = t[a];
      l != null && (l < o && (o = l), l > r && (r = l));
    }
  return [o, r];
}
function o9(t, e, n) {
  let i = In, o = -In;
  for (let r = e; r <= n; r++) {
    let a = t[r];
    a != null && a > 0 && (a < i && (i = a), a > o && (o = a));
  }
  return [i, o];
}
function X0(t, e, n, i) {
  let o = ET(t), r = ET(e);
  t == e && (o == -1 ? (t *= n, e /= n) : (t /= n, e *= n));
  let a = n == 10 ? vs : FR, l = o == 1 ? Dr : ia, s = r == 1 ? ia : Dr, u = l(a(so(t))), c = s(a(so(e))), d = Tf(n, u), f = Tf(n, c);
  return n == 10 && (u < 0 && (d = mi(d, -u)), c < 0 && (f = mi(f, -c))), i || n == 2 ? (t = d * o, e = f * r) : (t = HR(t, d), e = Z0(e, f)), [t, e];
}
function jw(t, e, n, i) {
  let o = X0(t, e, n, i);
  return t == 0 && (o[0] = 0), e == 0 && (o[1] = 0), o;
}
const qw = 0.1, TT = {
  mode: 3,
  pad: qw
}, np = {
  pad: 0,
  soft: null,
  mode: 0
}, r9 = {
  min: np,
  max: np
};
function Lv(t, e, n, i) {
  return G0(n) ? PT(t, e, n) : (np.pad = n, np.soft = i ? 0 : null, np.mode = i ? 3 : 0, PT(t, e, r9));
}
function Qn(t, e) {
  return t ?? e;
}
function a9(t, e, n) {
  for (e = Qn(e, 0), n = Qn(n, t.length - 1); e <= n; ) {
    if (t[e] != null)
      return !0;
    e++;
  }
  return !1;
}
function PT(t, e, n) {
  let i = n.min, o = n.max, r = Qn(i.pad, 0), a = Qn(o.pad, 0), l = Qn(i.hard, -In), s = Qn(o.hard, In), u = Qn(i.soft, In), c = Qn(o.soft, -In), d = Qn(i.mode, 0), f = Qn(o.mode, 0), h = e - t, p = vs(h), g = Vo(so(t), so(e)), m = vs(g), y = so(m - p);
  (h < 1e-24 || y > 10) && (h = 0, (t == 0 || e == 0) && (h = 1e-24, d == 2 && u != In && (r = 0), f == 2 && c != -In && (a = 0)));
  let b = h || g || 1e3, w = vs(b), $ = Tf(10, Dr(w)), C = b * (h == 0 ? t == 0 ? 0.1 : 1 : r), P = mi(HR(t - C, $ / 10), 24), O = t >= u && (d == 1 || d == 3 && P <= u || d == 2 && P >= u) ? u : In, E = Vo(l, P < O && t >= O ? O : aa(O, P)), _ = b * (h == 0 ? e == 0 ? 0.1 : 1 : a), D = mi(Z0(e + _, $ / 10), 24), M = e <= c && (f == 1 || f == 3 && D >= c || f == 2 && D <= c) ? c : -In, N = aa(s, D > M && e <= M ? M : Vo(M, D));
  return E == N && E == 0 && (N = 100), [E, N];
}
const l9 = new Intl.NumberFormat(nh ? t9.language : "en-US"), Yw = (t) => l9.format(t), Hr = Math, nv = Hr.PI, so = Hr.abs, Dr = Hr.floor, ao = Hr.round, ia = Hr.ceil, aa = Hr.min, Vo = Hr.max, Tf = Hr.pow, ET = Hr.sign, vs = Hr.log10, FR = Hr.log2, s9 = (t, e = 1) => Hr.sinh(t) * e, Pb = (t, e = 1) => Hr.asinh(t / e), In = 1 / 0;
function _T(t) {
  return (vs((t ^ t >> 31) - (t >> 31)) | 0) + 1;
}
function Nx(t, e, n) {
  return aa(Vo(t, e), n);
}
function _n(t) {
  return typeof t == "function" ? t : () => t;
}
const u9 = () => {
}, VR = (t) => t, QR = (t, e) => e, c9 = (t) => null, IT = (t) => !0, MT = (t, e) => t == e, d9 = /\.\d*?(?=9{6,}|0{6,})/gm, Qc = (t) => {
  if (jR(t) || Iu.has(t))
    return t;
  const e = `${t}`, n = e.match(d9);
  if (n == null)
    return t;
  let i = n[0].length - 1;
  if (e.indexOf("e-") != -1) {
    let [o, r] = e.split("e");
    return +`${Qc(o)}e${r}`;
  }
  return mi(t, i);
};
function uc(t, e) {
  return Qc(mi(Qc(t / e)) * e);
}
function Z0(t, e) {
  return Qc(ia(Qc(t / e)) * e);
}
function HR(t, e) {
  return Qc(Dr(Qc(t / e)) * e);
}
function mi(t, e = 0) {
  if (jR(t))
    return t;
  let n = 10 ** e, i = t * n * (1 + Number.EPSILON);
  return ao(i) / n;
}
const Iu = /* @__PURE__ */ new Map();
function WR(t) {
  return (("" + t).split(".")[1] || "").length;
}
function Mp(t, e, n, i) {
  let o = [], r = i.map(WR);
  for (let a = e; a < n; a++) {
    let l = so(a), s = mi(Tf(t, a), l);
    for (let u = 0; u < i.length; u++) {
      let c = t == 10 ? +`${i[u]}e${a}` : i[u] * s, d = (a >= 0 ? 0 : l) + (a >= r[u] ? 0 : r[u]), f = t == 10 ? c : mi(c, d);
      o.push(f), Iu.set(f, d);
    }
  }
  return o;
}
const ip = {}, Kw = [], Pf = [null, null], uu = Array.isArray, jR = Number.isInteger, f9 = (t) => t === void 0;
function AT(t) {
  return typeof t == "string";
}
function G0(t) {
  let e = !1;
  if (t != null) {
    let n = t.constructor;
    e = n == null || n == Object;
  }
  return e;
}
function h9(t) {
  return t != null && typeof t == "object";
}
const p9 = Object.getPrototypeOf(Uint8Array), qR = "__proto__";
function Ef(t, e = G0) {
  let n;
  if (uu(t)) {
    let i = t.find((o) => o != null);
    if (uu(i) || e(i)) {
      n = Array(t.length);
      for (let o = 0; o < t.length; o++)
        n[o] = Ef(t[o], e);
    } else
      n = t.slice();
  } else if (t instanceof p9)
    n = t.slice();
  else if (e(t)) {
    n = {};
    for (let i in t)
      i != qR && (n[i] = Ef(t[i], e));
  } else
    n = t;
  return n;
}
function to(t) {
  let e = arguments;
  for (let n = 1; n < e.length; n++) {
    let i = e[n];
    for (let o in i)
      o != qR && (G0(t[o]) ? to(t[o], Ef(i[o])) : t[o] = Ef(i[o]));
  }
  return t;
}
const g9 = 0, m9 = 1, v9 = 2;
function y9(t, e, n) {
  for (let i = 0, o, r = -1; i < e.length; i++) {
    let a = e[i];
    if (a > r) {
      for (o = a - 1; o >= 0 && t[o] == null; )
        t[o--] = null;
      for (o = a + 1; o < n && t[o] == null; )
        t[r = o++] = null;
    }
  }
}
function b9(t, e) {
  if (S9(t)) {
    let a = t[0].slice();
    for (let l = 1; l < t.length; l++)
      a.push(...t[l].slice(1));
    return w9(a[0]) || (a = O9(a)), a;
  }
  let n = /* @__PURE__ */ new Set();
  for (let a = 0; a < t.length; a++) {
    let s = t[a][0], u = s.length;
    for (let c = 0; c < u; c++)
      n.add(s[c]);
  }
  let i = [Array.from(n).sort((a, l) => a - l)], o = i[0].length, r = /* @__PURE__ */ new Map();
  for (let a = 0; a < o; a++)
    r.set(i[0][a], a);
  for (let a = 0; a < t.length; a++) {
    let l = t[a], s = l[0];
    for (let u = 1; u < l.length; u++) {
      let c = l[u], d = Array(o).fill(void 0), f = e ? e[a][u] : m9, h = [];
      for (let p = 0; p < c.length; p++) {
        let g = c[p], m = r.get(s[p]);
        g === null ? f != g9 && (d[m] = g, f == v9 && h.push(m)) : d[m] = g;
      }
      y9(d, h, o), i.push(d);
    }
  }
  return i;
}
const x9 = typeof queueMicrotask > "u" ? (t) => Promise.resolve().then(t) : queueMicrotask;
function O9(t) {
  let e = t[0], n = e.length, i = Array(n);
  for (let r = 0; r < i.length; r++)
    i[r] = r;
  i.sort((r, a) => e[r] - e[a]);
  let o = [];
  for (let r = 0; r < t.length; r++) {
    let a = t[r], l = Array(n);
    for (let s = 0; s < n; s++)
      l[s] = a[i[s]];
    o.push(l);
  }
  return o;
}
function S9(t) {
  let e = t[0][0], n = e.length;
  for (let i = 1; i < t.length; i++) {
    let o = t[i][0];
    if (o.length != n)
      return !1;
    if (o != e) {
      for (let r = 0; r < n; r++)
        if (o[r] != e[r])
          return !1;
    }
  }
  return !0;
}
function w9(t, e = 100) {
  const n = t.length;
  if (n <= 1)
    return !0;
  let i = 0, o = n - 1;
  for (; i <= o && t[i] == null; )
    i++;
  for (; o >= i && t[o] == null; )
    o--;
  if (o <= i)
    return !0;
  const r = Vo(1, Dr((o - i + 1) / e));
  for (let a = t[i], l = i + r; l <= o; l += r) {
    const s = t[l];
    if (s != null) {
      if (s <= a)
        return !1;
      a = s;
    }
  }
  return !0;
}
const YR = [
  "January",
  "February",
  "March",
  "April",
  "May",
  "June",
  "July",
  "August",
  "September",
  "October",
  "November",
  "December"
], KR = [
  "Sunday",
  "Monday",
  "Tuesday",
  "Wednesday",
  "Thursday",
  "Friday",
  "Saturday"
];
function XR(t) {
  return t.slice(0, 3);
}
const C9 = KR.map(XR), $9 = YR.map(XR), k9 = {
  MMMM: YR,
  MMM: $9,
  WWWW: KR,
  WWW: C9
};
function Th(t) {
  return (t < 10 ? "0" : "") + t;
}
function T9(t) {
  return (t < 10 ? "00" : t < 100 ? "0" : "") + t;
}
const P9 = {
  // 2019
  YYYY: (t) => t.getFullYear(),
  // 19
  YY: (t) => (t.getFullYear() + "").slice(2),
  // July
  MMMM: (t, e) => e.MMMM[t.getMonth()],
  // Jul
  MMM: (t, e) => e.MMM[t.getMonth()],
  // 07
  MM: (t) => Th(t.getMonth() + 1),
  // 7
  M: (t) => t.getMonth() + 1,
  // 09
  DD: (t) => Th(t.getDate()),
  // 9
  D: (t) => t.getDate(),
  // Monday
  WWWW: (t, e) => e.WWWW[t.getDay()],
  // Mon
  WWW: (t, e) => e.WWW[t.getDay()],
  // 03
  HH: (t) => Th(t.getHours()),
  // 3
  H: (t) => t.getHours(),
  // 9 (12hr, unpadded)
  h: (t) => {
    let e = t.getHours();
    return e == 0 ? 12 : e > 12 ? e - 12 : e;
  },
  // AM
  AA: (t) => t.getHours() >= 12 ? "PM" : "AM",
  // am
  aa: (t) => t.getHours() >= 12 ? "pm" : "am",
  // a
  a: (t) => t.getHours() >= 12 ? "p" : "a",
  // 09
  mm: (t) => Th(t.getMinutes()),
  // 9
  m: (t) => t.getMinutes(),
  // 09
  ss: (t) => Th(t.getSeconds()),
  // 9
  s: (t) => t.getSeconds(),
  // 374
  fff: (t) => T9(t.getMilliseconds())
};
function Xw(t, e) {
  e = e || k9;
  let n = [], i = /\{([a-z]+)\}|[^{]+/gi, o;
  for (; o = i.exec(t); )
    n.push(o[0][0] == "{" ? P9[o[1]] : o[0]);
  return (r) => {
    let a = "";
    for (let l = 0; l < n.length; l++)
      a += typeof n[l] == "string" ? n[l] : n[l](r, e);
    return a;
  };
}
const E9 = new Intl.DateTimeFormat().resolvedOptions().timeZone;
function _9(t, e) {
  let n;
  return e == "UTC" || e == "Etc/UTC" ? n = new Date(+t + t.getTimezoneOffset() * 6e4) : e == E9 ? n = t : (n = new Date(t.toLocaleString("en-US", { timeZone: e })), n.setMilliseconds(t.getMilliseconds())), n;
}
const ZR = (t) => t % 1 == 0, zv = [1, 2, 2.5, 5], I9 = Mp(10, -32, 0, zv), GR = Mp(10, 0, 32, zv), M9 = GR.filter(ZR), cc = I9.concat(GR), Zw = `
`, UR = "{YYYY}", RT = Zw + UR, JR = "{M}/{D}", jh = Zw + JR, Zg = jh + "/{YY}", eD = "{aa}", A9 = "{h}:{mm}", zd = A9 + eD, DT = Zw + zd, NT = ":{ss}", ti = null;
function tD(t) {
  let e = t * 1e3, n = e * 60, i = n * 60, o = i * 24, r = o * 30, a = o * 365, s = (t == 1 ? Mp(10, 0, 3, zv).filter(ZR) : Mp(10, -3, 0, zv)).concat([
    // minute divisors (# of secs)
    e,
    e * 5,
    e * 10,
    e * 15,
    e * 30,
    // hour divisors (# of mins)
    n,
    n * 5,
    n * 10,
    n * 15,
    n * 30,
    // day divisors (# of hrs)
    i,
    i * 2,
    i * 3,
    i * 4,
    i * 6,
    i * 8,
    i * 12,
    // month divisors TODO: need more?
    o,
    o * 2,
    o * 3,
    o * 4,
    o * 5,
    o * 6,
    o * 7,
    o * 8,
    o * 9,
    o * 10,
    o * 15,
    // year divisors (# months, approx)
    r,
    r * 2,
    r * 3,
    r * 4,
    r * 6,
    // century divisors
    a,
    a * 2,
    a * 5,
    a * 10,
    a * 25,
    a * 50,
    a * 100
  ]);
  const u = [
    //   tick incr    default          year                    month   day                   hour    min       sec   mode
    [a, UR, ti, ti, ti, ti, ti, ti, 1],
    [o * 28, "{MMM}", RT, ti, ti, ti, ti, ti, 1],
    [o, JR, RT, ti, ti, ti, ti, ti, 1],
    [i, "{h}" + eD, Zg, ti, jh, ti, ti, ti, 1],
    [n, zd, Zg, ti, jh, ti, ti, ti, 1],
    [e, NT, Zg + " " + zd, ti, jh + " " + zd, ti, DT, ti, 1],
    [t, NT + ".{fff}", Zg + " " + zd, ti, jh + " " + zd, ti, DT, ti, 1]
  ];
  function c(d) {
    return (f, h, p, g, m, y) => {
      let b = [], w = m >= a, $ = m >= r && m < a, C = d(p), P = mi(C * t, 3), O = Eb(C.getFullYear(), w ? 0 : C.getMonth(), $ || w ? 1 : C.getDate()), E = mi(O * t, 3);
      if ($ || w) {
        let _ = $ ? m / r : 0, D = w ? m / a : 0, M = P == E ? P : mi(Eb(O.getFullYear() + D, O.getMonth() + _, 1) * t, 3), N = new Date(ao(M / t)), L = N.getFullYear(), j = N.getMonth();
        for (let B = 0; M <= g; B++) {
          let Y = Eb(L + D * B, j + _ * B, 1), Q = Y - d(mi(Y * t, 3));
          M = mi((+Y + Q) * t, 3), M <= g && b.push(M);
        }
      } else {
        let _ = m >= o ? o : m, D = Dr(p) - Dr(P), M = E + D + Z0(P - E, _);
        b.push(M);
        let N = d(M), L = N.getHours() + N.getMinutes() / n + N.getSeconds() / i, j = m / i, B = f.axes[h]._space, Y = y / B;
        for (; M = mi(M + m, t == 1 ? 0 : 3), !(M > g); )
          if (j > 1) {
            let Q = Dr(mi(L + j, 6)) % 24, H = d(M).getHours() - Q;
            H > 1 && (H = -1), M -= H * i, L = (L + j) % 24;
            let q = b[b.length - 1];
            mi((M - q) / m, 3) * Y >= 0.7 && b.push(M);
          } else
            b.push(M);
      }
      return b;
    };
  }
  return [
    s,
    u,
    c
  ];
}
const [R9, D9, N9] = tD(1), [L9, z9, B9] = tD(1e-3);
Mp(2, -53, 53, [1]);
function LT(t, e) {
  return t.map((n) => n.map(
    (i, o) => o == 0 || o == 8 || i == null ? i : e(o == 1 || n[8] == 0 ? i : n[1] + i)
  ));
}
function zT(t, e) {
  return (n, i, o, r, a) => {
    let l = e.find((p) => a >= p[0]) || e[e.length - 1], s, u, c, d, f, h;
    return i.map((p) => {
      let g = t(p), m = g.getFullYear(), y = g.getMonth(), b = g.getDate(), w = g.getHours(), $ = g.getMinutes(), C = g.getSeconds(), P = m != s && l[2] || y != u && l[3] || b != c && l[4] || w != d && l[5] || $ != f && l[6] || C != h && l[7] || l[1];
      return s = m, u = y, c = b, d = w, f = $, h = C, P(g);
    });
  };
}
function F9(t, e) {
  let n = Xw(e);
  return (i, o, r, a, l) => o.map((s) => n(t(s)));
}
function Eb(t, e, n) {
  return new Date(t, e, n);
}
function BT(t, e) {
  return e(t);
}
const V9 = "{YYYY}-{MM}-{DD} {h}:{mm}{aa}";
function FT(t, e) {
  return (n, i, o, r) => r == null ? Hw : e(t(i));
}
function Q9(t, e) {
  let n = t.series[e];
  return n.width ? n.stroke(t, e) : n.points.width ? n.points.stroke(t, e) : null;
}
function H9(t, e) {
  return t.series[e].fill(t, e);
}
const W9 = {
  show: !0,
  live: !0,
  isolate: !1,
  mount: u9,
  markers: {
    show: !0,
    width: 2,
    stroke: Q9,
    fill: H9,
    dash: "solid"
  },
  idx: null,
  idxs: null,
  values: []
};
function j9(t, e) {
  let n = t.cursor.points, i = ea(), o = n.size(t, e);
  Ci(i, Hh, o), Ci(i, Wh, o);
  let r = o / -2;
  Ci(i, "marginLeft", r), Ci(i, "marginTop", r);
  let a = n.width(t, e, o);
  return a && Ci(i, "borderWidth", a), i;
}
function q9(t, e) {
  let n = t.series[e].points;
  return n._fill || n._stroke;
}
function Y9(t, e) {
  let n = t.series[e].points;
  return n._stroke || n._fill;
}
function K9(t, e) {
  return t.series[e].points.size;
}
const _b = [0, 0];
function X9(t, e, n) {
  return _b[0] = e, _b[1] = n, _b;
}
function Gg(t, e, n, i = !0) {
  return (o) => {
    o.button == 0 && (!i || o.target == e) && n(o);
  };
}
function Ib(t, e, n, i = !0) {
  return (o) => {
    (!i || o.target == e) && n(o);
  };
}
const Z9 = {
  show: !0,
  x: !0,
  y: !0,
  lock: !1,
  move: X9,
  points: {
    one: !1,
    show: j9,
    size: K9,
    width: 0,
    stroke: Y9,
    fill: q9
  },
  bind: {
    mousedown: Gg,
    mouseup: Gg,
    click: Gg,
    // legend clicks, not .u-over clicks
    dblclick: Gg,
    mousemove: Ib,
    mouseleave: Ib,
    mouseenter: Ib
  },
  drag: {
    setScale: !0,
    x: !0,
    y: !1,
    dist: 0,
    uni: null,
    click: (t, e) => {
      e.stopPropagation(), e.stopImmediatePropagation();
    },
    _x: !1,
    _y: !1
  },
  focus: {
    dist: (t, e, n, i, o) => i - o,
    prox: -1,
    bias: 0
  },
  hover: {
    skip: [void 0],
    prox: null,
    bias: 0
  },
  left: -10,
  top: -10,
  idx: null,
  dataIdx: null,
  idxs: null,
  event: null
}, nD = {
  show: !0,
  stroke: "rgba(0,0,0,0.07)",
  width: 2
  //	dash: [],
}, Gw = to({}, nD, {
  filter: QR
}), iD = to({}, Gw, {
  size: 10
}), oD = to({}, nD, {
  show: !1
}), Uw = '12px system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"', rD = "bold " + Uw, aD = 1.5, VT = {
  show: !0,
  scale: "x",
  stroke: Qw,
  space: 50,
  gap: 5,
  size: 50,
  labelGap: 0,
  labelSize: 30,
  labelFont: rD,
  side: 2,
  //	class: "x-vals",
  //	incrs: timeIncrs,
  //	values: timeVals,
  //	filter: retArg1,
  grid: Gw,
  ticks: iD,
  border: oD,
  font: Uw,
  lineGap: aD,
  rotate: 0
}, G9 = "Value", U9 = "Time", QT = {
  show: !0,
  scale: "x",
  auto: !1,
  sorted: 1,
  //	label: "Time",
  //	value: v => stamp(new Date(v * 1e3)),
  // internal caches
  min: In,
  max: -In,
  idxs: []
};
function J9(t, e, n, i, o) {
  return e.map((r) => r == null ? "" : Yw(r));
}
function eW(t, e, n, i, o, r, a) {
  let l = [], s = Iu.get(o) || 0;
  n = a ? n : mi(Z0(n, o), s);
  for (let u = n; u <= i; u = mi(u + o, s))
    l.push(Object.is(u, -0) ? 0 : u);
  return l;
}
function Lx(t, e, n, i, o, r, a) {
  const l = [], s = t.scales[t.axes[e].scale].log, u = s == 10 ? vs : FR, c = Dr(u(n));
  o = Tf(s, c), s == 10 && (o = cc[Ia(o, cc)]);
  let d = n, f = o * s;
  s == 10 && (f = cc[Ia(f, cc)]);
  do
    l.push(d), d = d + o, s == 10 && !Iu.has(d) && (d = mi(d, Iu.get(o))), d >= f && (o = d, f = o * s, s == 10 && (f = cc[Ia(f, cc)]));
  while (d <= i);
  return l;
}
function tW(t, e, n, i, o, r, a) {
  let s = t.scales[t.axes[e].scale].asinh, u = i > s ? Lx(t, e, Vo(s, n), i, o) : [s], c = i >= 0 && n <= 0 ? [0] : [];
  return (n < -s ? Lx(t, e, Vo(s, -i), -n, o) : [s]).reverse().map((f) => -f).concat(c, u);
}
const lD = /./, nW = /[12357]/, iW = /[125]/, HT = /1/, zx = (t, e, n, i) => t.map((o, r) => e == 4 && o == 0 || r % i == 0 && n.test(o.toExponential()[o < 0 ? 1 : 0]) ? o : null);
function oW(t, e, n, i, o) {
  let r = t.axes[n], a = r.scale, l = t.scales[a], s = t.valToPos, u = r._space, c = s(10, a), d = s(9, a) - c >= u ? lD : s(7, a) - c >= u ? nW : s(5, a) - c >= u ? iW : HT;
  if (d == HT) {
    let f = so(s(1, a) - c);
    if (f < u)
      return zx(e.slice().reverse(), l.distr, d, ia(u / f)).reverse();
  }
  return zx(e, l.distr, d, 1);
}
function rW(t, e, n, i, o) {
  let r = t.axes[n], a = r.scale, l = r._space, s = t.valToPos, u = so(s(1, a) - s(2, a));
  return u < l ? zx(e.slice().reverse(), 3, lD, ia(l / u)).reverse() : e;
}
function aW(t, e, n, i) {
  return i == null ? Hw : e == null ? "" : Yw(e);
}
const WT = {
  show: !0,
  scale: "y",
  stroke: Qw,
  space: 30,
  gap: 5,
  size: 50,
  labelGap: 0,
  labelSize: 30,
  labelFont: rD,
  side: 3,
  //	class: "y-vals",
  //	incrs: numIncrs,
  //	values: (vals, space) => vals,
  //	filter: retArg1,
  grid: Gw,
  ticks: iD,
  border: oD,
  font: Uw,
  lineGap: aD,
  rotate: 0
};
function lW(t, e) {
  let n = 3 + (t || 1) * 2;
  return mi(n * e, 3);
}
function sW(t, e) {
  let { scale: n, idxs: i } = t.series[0], o = t._data[0], r = t.valToPos(o[i[0]], n, !0), a = t.valToPos(o[i[1]], n, !0), l = so(a - r), s = t.series[e], u = l / (s.points.space * Jn);
  return i[1] - i[0] <= u;
}
const jT = {
  scale: null,
  auto: !0,
  sorted: 0,
  // internal caches
  min: In,
  max: -In
}, sD = (t, e, n, i, o) => o, qT = {
  show: !0,
  auto: !0,
  sorted: 0,
  gaps: sD,
  alpha: 1,
  facets: [
    to({}, jT, { scale: "x" }),
    to({}, jT, { scale: "y" })
  ]
}, YT = {
  scale: "y",
  auto: !0,
  sorted: 0,
  show: !0,
  spanGaps: !1,
  gaps: sD,
  alpha: 1,
  points: {
    show: sW,
    filter: null
    //  paths:
    //	stroke: "#000",
    //	fill: "#fff",
    //	width: 1,
    //	size: 10,
  },
  //	label: "Value",
  //	value: v => v,
  values: null,
  // internal caches
  min: In,
  max: -In,
  idxs: [],
  path: null,
  clip: null
};
function uW(t, e, n, i, o) {
  return n / 10;
}
const uD = {
  time: RH,
  auto: !0,
  distr: 1,
  log: 10,
  asinh: 1,
  min: null,
  max: null,
  dir: 1,
  ori: 0
}, cW = to({}, uD, {
  time: !1,
  ori: 1
}), KT = {};
function cD(t, e) {
  let n = KT[t];
  return n || (n = {
    key: t,
    plots: [],
    sub(i) {
      n.plots.push(i);
    },
    unsub(i) {
      n.plots = n.plots.filter((o) => o != i);
    },
    pub(i, o, r, a, l, s, u) {
      for (let c = 0; c < n.plots.length; c++)
        n.plots[c] != o && n.plots[c].pub(i, o, r, a, l, s, u);
    }
  }, t != null && (KT[t] = n)), n;
}
const _f = 1, Bx = 2;
function id(t, e, n) {
  const i = t.mode, o = t.series[e], r = i == 2 ? t._data[e] : t._data, a = t.scales, l = t.bbox;
  let s = r[0], u = i == 2 ? r[1] : r[e], c = i == 2 ? a[o.facets[0].scale] : a[t.series[0].scale], d = i == 2 ? a[o.facets[1].scale] : a[o.scale], f = l.left, h = l.top, p = l.width, g = l.height, m = t.valToPosH, y = t.valToPosV;
  return c.ori == 0 ? n(
    o,
    s,
    u,
    c,
    d,
    m,
    y,
    f,
    h,
    p,
    g,
    J0,
    ih,
    ty,
    fD,
    pD
  ) : n(
    o,
    s,
    u,
    c,
    d,
    y,
    m,
    h,
    f,
    g,
    p,
    ey,
    oh,
    tC,
    hD,
    gD
  );
}
function Jw(t, e) {
  let n = 0, i = 0, o = Qn(t.bands, Kw);
  for (let r = 0; r < o.length; r++) {
    let a = o[r];
    a.series[0] == e ? n = a.dir : a.series[1] == e && (a.dir == 1 ? i |= 1 : i |= 2);
  }
  return [
    n,
    i == 1 ? -1 : (
      // neg only
      i == 2 ? 1 : (
        // pos only
        i == 3 ? 2 : (
          // both
          0
        )
      )
    )
  ];
}
function dW(t, e, n, i, o) {
  let r = t.mode, a = t.series[e], l = r == 2 ? a.facets[1].scale : a.scale, s = t.scales[l];
  return o == -1 ? s.min : o == 1 ? s.max : s.distr == 3 ? s.dir == 1 ? s.min : s.max : 0;
}
function ys(t, e, n, i, o, r) {
  return id(t, e, (a, l, s, u, c, d, f, h, p, g, m) => {
    let y = a.pxRound;
    const b = u.dir * (u.ori == 0 ? 1 : -1), w = u.ori == 0 ? ih : oh;
    let $, C;
    b == 1 ? ($ = n, C = i) : ($ = i, C = n);
    let P = y(d(l[$], u, g, h)), O = y(f(s[$], c, m, p)), E = y(d(l[C], u, g, h)), _ = y(f(r == 1 ? c.max : c.min, c, m, p)), D = new Path2D(o);
    return w(D, E, _), w(D, P, _), w(D, P, O), D;
  });
}
function U0(t, e, n, i, o, r) {
  let a = null;
  if (t.length > 0) {
    a = new Path2D();
    const l = e == 0 ? ty : tC;
    let s = n;
    for (let d = 0; d < t.length; d++) {
      let f = t[d];
      if (f[1] > f[0]) {
        let h = f[0] - s;
        h > 0 && l(a, s, i, h, i + r), s = f[1];
      }
    }
    let u = n + o - s, c = 10;
    u > 0 && l(a, s, i - c / 2, u, i + r + c);
  }
  return a;
}
function fW(t, e, n) {
  let i = t[t.length - 1];
  i && i[0] == e ? i[1] = n : t.push([e, n]);
}
function eC(t, e, n, i, o, r, a) {
  let l = [], s = t.length;
  for (let u = o == 1 ? n : i; u >= n && u <= i; u += o)
    if (e[u] === null) {
      let d = u, f = u;
      if (o == 1)
        for (; ++u <= i && e[u] === null; )
          f = u;
      else
        for (; --u >= n && e[u] === null; )
          f = u;
      let h = r(t[d]), p = f == d ? h : r(t[f]), g = d - o;
      h = a <= 0 && g >= 0 && g < s ? r(t[g]) : h;
      let y = f + o;
      p = a >= 0 && y >= 0 && y < s ? r(t[y]) : p, p >= h && l.push([h, p]);
    }
  return l;
}
function XT(t) {
  return t == 0 ? VR : t == 1 ? ao : (e) => uc(e, t);
}
function dD(t) {
  let e = t == 0 ? J0 : ey, n = t == 0 ? (o, r, a, l, s, u) => {
    o.arcTo(r, a, l, s, u);
  } : (o, r, a, l, s, u) => {
    o.arcTo(a, r, s, l, u);
  }, i = t == 0 ? (o, r, a, l, s) => {
    o.rect(r, a, l, s);
  } : (o, r, a, l, s) => {
    o.rect(a, r, s, l);
  };
  return (o, r, a, l, s, u = 0, c = 0) => {
    u == 0 && c == 0 ? i(o, r, a, l, s) : (u = aa(u, l / 2, s / 2), c = aa(c, l / 2, s / 2), e(o, r + u, a), n(o, r + l, a, r + l, a + s, u), n(o, r + l, a + s, r, a + s, c), n(o, r, a + s, r, a, c), n(o, r, a, r + l, a, u), o.closePath());
  };
}
const J0 = (t, e, n) => {
  t.moveTo(e, n);
}, ey = (t, e, n) => {
  t.moveTo(n, e);
}, ih = (t, e, n) => {
  t.lineTo(e, n);
}, oh = (t, e, n) => {
  t.lineTo(n, e);
}, ty = dD(0), tC = dD(1), fD = (t, e, n, i, o, r) => {
  t.arc(e, n, i, o, r);
}, hD = (t, e, n, i, o, r) => {
  t.arc(n, e, i, o, r);
}, pD = (t, e, n, i, o, r, a) => {
  t.bezierCurveTo(e, n, i, o, r, a);
}, gD = (t, e, n, i, o, r, a) => {
  t.bezierCurveTo(n, e, o, i, a, r);
};
function mD(t) {
  return (e, n, i, o, r) => id(e, n, (a, l, s, u, c, d, f, h, p, g, m) => {
    let { pxRound: y, points: b } = a, w, $;
    u.ori == 0 ? (w = J0, $ = fD) : (w = ey, $ = hD);
    const C = mi(b.width * Jn, 3);
    let P = (b.size - b.width) / 2 * Jn, O = mi(P * 2, 3), E = new Path2D(), _ = new Path2D(), { left: D, top: M, width: N, height: L } = e.bbox;
    ty(
      _,
      D - O,
      M - O,
      N + O * 2,
      L + O * 2
    );
    const j = (B) => {
      if (s[B] != null) {
        let Y = y(d(l[B], u, g, h)), Q = y(f(s[B], c, m, p));
        w(E, Y + P, Q), $(E, Y, Q, P, 0, nv * 2);
      }
    };
    if (r)
      r.forEach(j);
    else
      for (let B = i; B <= o; B++)
        j(B);
    return {
      stroke: C > 0 ? E : null,
      fill: E,
      clip: _,
      flags: _f | Bx
    };
  });
}
function vD(t) {
  return (e, n, i, o, r, a) => {
    i != o && (r != i && a != i && t(e, n, i), r != o && a != o && t(e, n, o), t(e, n, a));
  };
}
const hW = vD(ih), pW = vD(oh);
function yD(t) {
  const e = Qn(t?.alignGaps, 0);
  return (n, i, o, r) => id(n, i, (a, l, s, u, c, d, f, h, p, g, m) => {
    let y = a.pxRound, b = (K) => y(d(K, u, g, h)), w = (K) => y(f(K, c, m, p)), $, C;
    u.ori == 0 ? ($ = ih, C = hW) : ($ = oh, C = pW);
    const P = u.dir * (u.ori == 0 ? 1 : -1), O = { stroke: new Path2D(), fill: null, clip: null, band: null, gaps: null, flags: _f }, E = O.stroke;
    let _ = In, D = -In, M, N, L, j = b(l[P == 1 ? o : r]), B = kf(s, o, r, 1 * P), Y = kf(s, o, r, -1 * P), Q = b(l[B]), G = b(l[Y]), V = !1;
    for (let K = P == 1 ? o : r; K >= o && K <= r; K += P) {
      let ee = b(l[K]), ie = s[K];
      ee == j ? ie != null ? (N = w(ie), _ == In && ($(E, ee, N), M = N), _ = aa(N, _), D = Vo(N, D)) : ie === null && (V = !0) : (_ != In && (C(E, j, _, D, M, N), L = j), ie != null ? (N = w(ie), $(E, ee, N), _ = D = M = N) : (_ = In, D = -In, ie === null && (V = !0)), j = ee);
    }
    _ != In && _ != D && L != j && C(E, j, _, D, M, N);
    let [H, q] = Jw(n, i);
    if (a.fill != null || H != 0) {
      let K = O.fill = new Path2D(E), ee = a.fillTo(n, i, a.min, a.max, H), ie = w(ee);
      $(K, G, ie), $(K, Q, ie);
    }
    if (!a.spanGaps) {
      let K = [];
      V && K.push(...eC(l, s, o, r, P, b, e)), O.gaps = K = a.gaps(n, i, o, r, K), O.clip = U0(K, u.ori, h, p, g, m);
    }
    return q != 0 && (O.band = q == 2 ? [
      ys(n, i, o, r, E, -1),
      ys(n, i, o, r, E, 1)
    ] : ys(n, i, o, r, E, q)), O;
  });
}
function gW(t) {
  const e = Qn(t.align, 1), n = Qn(t.ascDesc, !1), i = Qn(t.alignGaps, 0), o = Qn(t.extend, !1);
  return (r, a, l, s) => id(r, a, (u, c, d, f, h, p, g, m, y, b, w) => {
    let $ = u.pxRound, { left: C, width: P } = r.bbox, O = (H) => $(p(H, f, b, m)), E = (H) => $(g(H, h, w, y)), _ = f.ori == 0 ? ih : oh;
    const D = { stroke: new Path2D(), fill: null, clip: null, band: null, gaps: null, flags: _f }, M = D.stroke, N = f.dir * (f.ori == 0 ? 1 : -1);
    l = kf(d, l, s, 1), s = kf(d, l, s, -1);
    let L = E(d[N == 1 ? l : s]), j = O(c[N == 1 ? l : s]), B = j, Y = j;
    o && e == -1 && (Y = C, _(M, Y, L)), _(M, j, L);
    for (let H = N == 1 ? l : s; H >= l && H <= s; H += N) {
      let q = d[H];
      if (q == null)
        continue;
      let K = O(c[H]), ee = E(q);
      e == 1 ? _(M, K, L) : _(M, B, ee), _(M, K, ee), L = ee, B = K;
    }
    let Q = B;
    o && e == 1 && (Q = C + P, _(M, Q, L));
    let [G, V] = Jw(r, a);
    if (u.fill != null || G != 0) {
      let H = D.fill = new Path2D(M), q = u.fillTo(r, a, u.min, u.max, G), K = E(q);
      _(H, Q, K), _(H, Y, K);
    }
    if (!u.spanGaps) {
      let H = [];
      H.push(...eC(c, d, l, s, N, O, i));
      let q = u.width * Jn / 2, K = n || e == 1 ? q : -q, ee = n || e == -1 ? -q : q;
      H.forEach((ie) => {
        ie[0] += K, ie[1] += ee;
      }), D.gaps = H = u.gaps(r, a, l, s, H), D.clip = U0(H, f.ori, m, y, b, w);
    }
    return V != 0 && (D.band = V == 2 ? [
      ys(r, a, l, s, M, -1),
      ys(r, a, l, s, M, 1)
    ] : ys(r, a, l, s, M, V)), D;
  });
}
function ZT(t, e, n, i, o, r, a = In) {
  if (t.length > 1) {
    let l = null;
    for (let s = 0, u = 1 / 0; s < t.length; s++)
      if (e[s] !== void 0) {
        if (l != null) {
          let c = so(t[s] - t[l]);
          c < u && (u = c, a = so(n(t[s], i, o, r) - n(t[l], i, o, r)));
        }
        l = s;
      }
  }
  return a;
}
function mW(t) {
  t = t || ip;
  const e = Qn(t.size, [0.6, In, 1]), n = t.align || 0, i = t.gap || 0;
  let o = t.radius;
  o = // [valueRadius, baselineRadius]
  o == null ? [0, 0] : typeof o == "number" ? [o, 0] : o;
  const r = _n(o), a = 1 - e[0], l = Qn(e[1], In), s = Qn(e[2], 1), u = Qn(t.disp, ip), c = Qn(t.each, (h) => {
  }), { fill: d, stroke: f } = u;
  return (h, p, g, m) => id(h, p, (y, b, w, $, C, P, O, E, _, D, M) => {
    let N = y.pxRound, L = n, j = i * Jn, B = l * Jn, Y = s * Jn, Q, G;
    $.ori == 0 ? [Q, G] = r(h, p) : [G, Q] = r(h, p);
    const V = $.dir * ($.ori == 0 ? 1 : -1);
    let H = $.ori == 0 ? ty : tC, q = $.ori == 0 ? c : (Ce, $e, Le, Ke, qe, rt, De) => {
      c(Ce, $e, Le, qe, Ke, De, rt);
    }, K = Qn(h.bands, Kw).find((Ce) => Ce.series[0] == p), ee = K != null ? K.dir : 0, ie = y.fillTo(h, p, y.min, y.max, ee), ae = N(O(ie, C, M, _)), te, U, me, ce = D, ue = N(y.width * Jn), fe = !1, he = null, le = null, ke = null, ze = null;
    d != null && (ue == 0 || f != null) && (fe = !0, he = d.values(h, p, g, m), le = /* @__PURE__ */ new Map(), new Set(he).forEach((Ce) => {
      Ce != null && le.set(Ce, new Path2D());
    }), ue > 0 && (ke = f.values(h, p, g, m), ze = /* @__PURE__ */ new Map(), new Set(ke).forEach((Ce) => {
      Ce != null && ze.set(Ce, new Path2D());
    })));
    let { x0: Re, size: Ye } = u;
    if (Re != null && Ye != null) {
      L = 1, b = Re.values(h, p, g, m), Re.unit == 2 && (b = b.map((Le) => h.posToVal(E + Le * D, $.key, !0)));
      let Ce = Ye.values(h, p, g, m);
      Ye.unit == 2 ? U = Ce[0] * D : U = P(Ce[0], $, D, E) - P(0, $, D, E), ce = ZT(b, w, P, $, D, E, ce), me = ce - U + j;
    } else
      ce = ZT(b, w, P, $, D, E, ce), me = ce * a + j, U = ce - me;
    me < 1 && (me = 0), ue >= U / 2 && (ue = 0), me < 5 && (N = VR);
    let Ne = me > 0, Fe = ce - me - (Ne ? ue : 0);
    U = N(Nx(Fe, Y, B)), te = (L == 0 ? U / 2 : L == V ? 0 : U) - L * V * ((L == 0 ? j / 2 : 0) + (Ne ? ue / 2 : 0));
    const We = { stroke: null, fill: null, clip: null, band: null, gaps: null, flags: 0 }, nt = fe ? null : new Path2D();
    let Qe = null;
    if (K != null)
      Qe = h.data[K.series[1]];
    else {
      let { y0: Ce, y1: $e } = u;
      Ce != null && $e != null && (w = $e.values(h, p, g, m), Qe = Ce.values(h, p, g, m));
    }
    let Pe = Q * U, Ze = G * U;
    for (let Ce = V == 1 ? g : m; Ce >= g && Ce <= m; Ce += V) {
      let $e = w[Ce];
      if ($e == null)
        continue;
      if (Qe != null) {
        let at = Qe[Ce] ?? 0;
        if ($e - at == 0)
          continue;
        ae = O(at, C, M, _);
      }
      let Le = $.distr != 2 || u != null ? b[Ce] : Ce, Ke = P(Le, $, D, E), qe = O(Qn($e, ie), C, M, _), rt = N(Ke - te), De = N(Vo(qe, ae)), Be = N(aa(qe, ae)), je = De - Be;
      if ($e != null) {
        let at = $e < 0 ? Ze : Pe, mt = $e < 0 ? Pe : Ze;
        fe ? (ue > 0 && ke[Ce] != null && H(ze.get(ke[Ce]), rt, Be + Dr(ue / 2), U, Vo(0, je - ue), at, mt), he[Ce] != null && H(le.get(he[Ce]), rt, Be + Dr(ue / 2), U, Vo(0, je - ue), at, mt)) : H(nt, rt, Be + Dr(ue / 2), U, Vo(0, je - ue), at, mt), q(
          h,
          p,
          Ce,
          rt - ue / 2,
          Be,
          U + ue,
          je
        );
      }
    }
    return ue > 0 ? We.stroke = fe ? ze : nt : fe || (We._fill = y.width == 0 ? y._fill : y._stroke ?? y._fill, We.width = 0), We.fill = fe ? le : nt, We;
  });
}
function vW(t, e) {
  const n = Qn(e?.alignGaps, 0);
  return (i, o, r, a) => id(i, o, (l, s, u, c, d, f, h, p, g, m, y) => {
    let b = l.pxRound, w = (Q) => b(f(Q, c, m, p)), $ = (Q) => b(h(Q, d, y, g)), C, P, O;
    c.ori == 0 ? (C = J0, O = ih, P = pD) : (C = ey, O = oh, P = gD);
    const E = c.dir * (c.ori == 0 ? 1 : -1);
    r = kf(u, r, a, 1), a = kf(u, r, a, -1);
    let _ = w(s[E == 1 ? r : a]), D = _, M = [], N = [];
    for (let Q = E == 1 ? r : a; Q >= r && Q <= a; Q += E)
      if (u[Q] != null) {
        let V = s[Q], H = w(V);
        M.push(D = H), N.push($(u[Q]));
      }
    const L = { stroke: t(M, N, C, O, P, b), fill: null, clip: null, band: null, gaps: null, flags: _f }, j = L.stroke;
    let [B, Y] = Jw(i, o);
    if (l.fill != null || B != 0) {
      let Q = L.fill = new Path2D(j), G = l.fillTo(i, o, l.min, l.max, B), V = $(G);
      O(Q, D, V), O(Q, _, V);
    }
    if (!l.spanGaps) {
      let Q = [];
      Q.push(...eC(s, u, r, a, E, w, n)), L.gaps = Q = l.gaps(i, o, r, a, Q), L.clip = U0(Q, c.ori, p, g, m, y);
    }
    return Y != 0 && (L.band = Y == 2 ? [
      ys(i, o, r, a, j, -1),
      ys(i, o, r, a, j, 1)
    ] : ys(i, o, r, a, j, Y)), L;
  });
}
function yW(t) {
  return vW(bW, t);
}
function bW(t, e, n, i, o, r) {
  const a = t.length;
  if (a < 2)
    return null;
  const l = new Path2D();
  if (n(l, t[0], e[0]), a == 2)
    i(l, t[1], e[1]);
  else {
    let s = Array(a), u = Array(a - 1), c = Array(a - 1), d = Array(a - 1);
    for (let f = 0; f < a - 1; f++)
      c[f] = e[f + 1] - e[f], d[f] = t[f + 1] - t[f], u[f] = c[f] / d[f];
    s[0] = u[0];
    for (let f = 1; f < a - 1; f++)
      u[f] === 0 || u[f - 1] === 0 || u[f - 1] > 0 != u[f] > 0 ? s[f] = 0 : (s[f] = 3 * (d[f - 1] + d[f]) / ((2 * d[f] + d[f - 1]) / u[f - 1] + (d[f] + 2 * d[f - 1]) / u[f]), isFinite(s[f]) || (s[f] = 0));
    s[a - 1] = u[a - 2];
    for (let f = 0; f < a - 1; f++)
      o(
        l,
        t[f] + d[f] / 3,
        e[f] + s[f] * d[f] / 3,
        t[f + 1] - d[f] / 3,
        e[f + 1] - s[f + 1] * d[f] / 3,
        t[f + 1],
        e[f + 1]
      );
  }
  return l;
}
const Fx = /* @__PURE__ */ new Set();
function GT() {
  for (let t of Fx)
    t.syncRect(!0);
}
nh && (Ac(JH, rf, GT), Ac(e9, rf, GT, !0), Ac(Nv, rf, () => {
  Ji.pxRatio = Jn;
}));
const xW = yD(), OW = mD();
function UT(t, e, n, i) {
  return (i ? [t[0], t[1]].concat(t.slice(2)) : [t[0]].concat(t.slice(1))).map((r, a) => Vx(r, a, e, n));
}
function SW(t, e) {
  return t.map((n, i) => i == 0 ? {} : to({}, e, n));
}
function Vx(t, e, n, i) {
  return to({}, e == 0 ? n : i, t);
}
function bD(t, e, n) {
  return e == null ? Pf : [e, n];
}
const wW = bD;
function CW(t, e, n) {
  return e == null ? Pf : Lv(e, n, qw, !0);
}
function xD(t, e, n, i) {
  return e == null ? Pf : X0(e, n, t.scales[i].log, !1);
}
const $W = xD;
function OD(t, e, n, i) {
  return e == null ? Pf : jw(e, n, t.scales[i].log, !1);
}
const kW = OD;
function TW(t, e, n, i, o) {
  let r = Vo(_T(t), _T(e)), a = e - t, l = Ia(o / i * a, n);
  do {
    let s = n[l], u = i * s / a;
    if (u >= o && r + (s < 5 ? Iu.get(s) : 0) <= 17)
      return [s, u];
  } while (++l < n.length);
  return [0, 0];
}
function JT(t) {
  let e, n;
  return t = t.replace(/(\d+)px/, (i, o) => (e = ao((n = +o) * Jn)) + "px"), [t, e, n];
}
function PW(t) {
  t.show && [t.font, t.labelFont].forEach((e) => {
    let n = mi(e[2] * Jn, 1);
    e[0] = e[0].replace(/[0-9.]+px/, n + "px"), e[1] = n;
  });
}
function Ji(t, e, n) {
  const i = {
    mode: Qn(t.mode, 1)
  }, o = i.mode;
  function r(X, oe) {
    return ((oe.distr == 3 ? vs(X > 0 ? X : oe.clamp(i, X, oe.min, oe.max, oe.key)) : oe.distr == 4 ? Pb(X, oe.asinh) : oe.distr == 100 ? oe.fwd(X) : X) - oe._min) / (oe._max - oe._min);
  }
  function a(X, oe, xe, Se) {
    let Ie = r(X, oe);
    return Se + xe * (oe.dir == -1 ? 1 - Ie : Ie);
  }
  function l(X, oe, xe, Se) {
    let Ie = r(X, oe);
    return Se + xe * (oe.dir == -1 ? Ie : 1 - Ie);
  }
  function s(X, oe, xe, Se) {
    return oe.ori == 0 ? a(X, oe, xe, Se) : l(X, oe, xe, Se);
  }
  i.valToPosH = a, i.valToPosV = l;
  let u = !1;
  i.status = 0;
  const c = i.root = ea(DH);
  if (t.id != null && (c.id = t.id), Er(c, t.class), t.title) {
    let X = ea(zH, c);
    X.textContent = t.title;
  }
  const d = ka("canvas"), f = i.ctx = d.getContext("2d"), h = ea(BH, c);
  Ac("click", h, (X) => {
    X.target === g && (fi != jl || li != eu) && oo.click(i, X);
  }, !0);
  const p = i.under = ea(FH, h);
  h.appendChild(d);
  const g = i.over = ea(VH, h);
  t = Ef(t);
  const m = +Qn(t.pxAlign, 1), y = XT(m);
  (t.plugins || []).forEach((X) => {
    X.opts && (t = X.opts(i, t) || t);
  });
  const b = t.ms || 1e-3, w = i.series = o == 1 ? UT(t.series || [], QT, YT, !1) : SW(t.series || [null], qT), $ = i.axes = UT(t.axes || [], VT, WT, !0), C = i.scales = {}, P = i.bands = t.bands || [];
  P.forEach((X) => {
    X.fill = _n(X.fill || null), X.dir = Qn(X.dir, -1);
  });
  const O = o == 2 ? w[1].facets[0].scale : w[0].scale, E = {
    axes: Dg,
    series: Ys
  }, _ = (t.drawOrder || ["axes", "series"]).map((X) => E[X]);
  function D(X) {
    let oe = C[X];
    if (oe == null) {
      let xe = (t.scales || ip)[X] || ip;
      if (xe.from != null)
        D(xe.from), C[X] = to({}, C[xe.from], xe, { key: X });
      else {
        oe = C[X] = to({}, X == O ? uD : cW, xe), oe.key = X;
        let Se = oe.time, Ie = oe.range, x = uu(Ie);
        if ((X != O || o == 2 && !Se) && (x && (Ie[0] == null || Ie[1] == null) && (Ie = {
          min: Ie[0] == null ? TT : {
            mode: 1,
            hard: Ie[0],
            soft: Ie[0]
          },
          max: Ie[1] == null ? TT : {
            mode: 1,
            hard: Ie[1],
            soft: Ie[1]
          }
        }, x = !1), !x && G0(Ie))) {
          let S = Ie;
          Ie = (T, R, z) => R == null ? Pf : Lv(R, z, S);
        }
        oe.range = _n(Ie || (Se ? wW : X == O ? oe.distr == 3 ? $W : oe.distr == 4 ? kW : bD : oe.distr == 3 ? xD : oe.distr == 4 ? OD : CW)), oe.auto = _n(x ? !1 : oe.auto), oe.clamp = _n(oe.clamp || uW), oe._min = oe._max = null;
      }
    }
  }
  D("x"), D("y"), o == 1 && w.forEach((X) => {
    D(X.scale);
  }), $.forEach((X) => {
    D(X.scale);
  });
  for (let X in t.scales)
    D(X);
  const M = C[O], N = M.distr;
  let L, j;
  M.ori == 0 ? (Er(c, NH), L = a, j = l) : (Er(c, LH), L = l, j = a);
  const B = {};
  for (let X in C) {
    let oe = C[X];
    (oe.min != null || oe.max != null) && (B[X] = { min: oe.min, max: oe.max }, oe.min = oe.max = null);
  }
  const Y = t.tzDate || ((X) => new Date(ao(X / b))), Q = t.fmtDate || Xw, G = b == 1 ? N9(Y) : B9(Y), V = zT(Y, LT(b == 1 ? D9 : z9, Q)), H = FT(Y, BT(V9, Q)), q = [], K = i.legend = to({}, W9, t.legend), ee = K.show, ie = K.markers;
  K.idxs = q, ie.width = _n(ie.width), ie.dash = _n(ie.dash), ie.stroke = _n(ie.stroke), ie.fill = _n(ie.fill);
  let ae, te, U, me = [], ce = [], ue, fe = !1, he = {};
  if (K.live) {
    const X = w[1] ? w[1].values : null;
    fe = X != null, ue = fe ? X(i, 1, 0) : { _: 0 };
    for (let oe in ue)
      he[oe] = Hw;
  }
  if (ee)
    if (ae = ka("table", YH, c), U = ka("tbody", null, ae), K.mount(i, ae), fe) {
      te = ka("thead", null, ae, U);
      let X = ka("tr", null, te);
      ka("th", null, X);
      for (var le in ue)
        ka("th", hT, X).textContent = le;
    } else
      Er(ae, XH), K.live && Er(ae, KH);
  const ke = { show: !0 }, ze = { show: !1 };
  function Re(X, oe) {
    if (oe == 0 && (fe || !K.live || o == 2))
      return Pf;
    let xe = [], Se = ka("tr", ZH, U, U.childNodes[oe]);
    Er(Se, X.class), X.show || Er(Se, vc);
    let Ie = ka("th", null, Se);
    if (ie.show) {
      let T = ea(GH, Ie);
      if (oe > 0) {
        let R = ie.width(i, oe);
        R && (T.style.border = R + "px " + ie.dash(i, oe) + " " + ie.stroke(i, oe)), T.style.background = ie.fill(i, oe);
      }
    }
    let x = ea(hT, Ie);
    x.textContent = X.label, oe > 0 && (ie.show || (x.style.color = X.width > 0 ? ie.stroke(i, oe) : ie.fill(i, oe)), Ne("click", Ie, (T) => {
      if (bt._lock)
        return;
      Xn(T);
      let R = w.indexOf(X);
      if ((T.ctrlKey || T.metaKey) != K.isolate) {
        let z = w.some((W, Z) => Z > 0 && Z != R && W.show);
        w.forEach((W, Z) => {
          Z > 0 && qr(Z, z ? Z == R ? ke : ze : ke, !0, Di.setSeries);
        });
      } else
        qr(R, { show: !X.show }, !0, Di.setSeries);
    }, !1), Ri && Ne(yT, Ie, (T) => {
      bt._lock || (Xn(T), qr(w.indexOf(X), nu, !0, Di.setSeries));
    }, !1));
    for (var S in ue) {
      let T = ka("td", UH, Se);
      T.textContent = "--", xe.push(T);
    }
    return [Se, xe];
  }
  const Ye = /* @__PURE__ */ new Map();
  function Ne(X, oe, xe, Se = !0) {
    const Ie = Ye.get(oe) || {}, x = bt.bind[X](i, oe, xe, Se);
    x && (Ac(X, oe, Ie[X] = x), Ye.set(oe, Ie));
  }
  function Fe(X, oe, xe) {
    const Se = Ye.get(oe) || {};
    for (let Ie in Se)
      (X == null || Ie == X) && (Dx(Ie, oe, Se[Ie]), delete Se[Ie]);
    X == null && Ye.delete(oe);
  }
  let We = 0, nt = 0, Qe = 0, Pe = 0, Ze = 0, Ce = 0, $e = Ze, Le = Ce, Ke = Qe, qe = Pe, rt = 0, De = 0, Be = 0, je = 0;
  i.bbox = {};
  let at = !1, mt = !1, st = !1, gt = !1, Et = !1, It = !1;
  function _t(X, oe, xe) {
    (xe || X != i.width || oe != i.height) && wt(X, oe), Gs(!1), st = !0, mt = !0, el();
  }
  function wt(X, oe) {
    i.width = We = Qe = X, i.height = nt = Pe = oe, Ze = Ce = 0, xn(), Pn();
    let xe = i.bbox;
    rt = xe.left = uc(Ze * Jn, 0.5), De = xe.top = uc(Ce * Jn, 0.5), Be = xe.width = uc(Qe * Jn, 0.5), je = xe.height = uc(Pe * Jn, 0.5);
  }
  const Nt = 3;
  function nn() {
    let X = !1, oe = 0;
    for (; !X; ) {
      oe++;
      let xe = pd(oe), Se = Ku(oe);
      X = oe == Nt || xe && Se, X || (wt(i.width, i.height), mt = !0);
    }
  }
  function sn({ width: X, height: oe }) {
    _t(X, oe);
  }
  i.setSize = sn;
  function xn() {
    let X = !1, oe = !1, xe = !1, Se = !1;
    $.forEach((Ie, x) => {
      if (Ie.show && Ie._show) {
        let { side: S, _size: T } = Ie, R = S % 2, z = Ie.label != null ? Ie.labelSize : 0, W = T + z;
        W > 0 && (R ? (Qe -= W, S == 3 ? (Ze += W, Se = !0) : xe = !0) : (Pe -= W, S == 0 ? (Ce += W, X = !0) : oe = !0));
      }
    }), Ln[0] = X, Ln[1] = xe, Ln[2] = oe, Ln[3] = Se, Qe -= Sn[1] + Sn[3], Ze += Sn[3], Pe -= Sn[2] + Sn[0], Ce += Sn[0];
  }
  function Pn() {
    let X = Ze + Qe, oe = Ce + Pe, xe = Ze, Se = Ce;
    function Ie(x, S) {
      switch (x) {
        case 1:
          return X += S, X - S;
        case 2:
          return oe += S, oe - S;
        case 3:
          return xe -= S, xe + S;
        case 0:
          return Se -= S, Se + S;
      }
    }
    $.forEach((x, S) => {
      if (x.show && x._show) {
        let T = x.side;
        x._pos = Ie(T, x._size), x.label != null && (x._lpos = Ie(T, x.labelSize));
      }
    });
  }
  const bt = i.cursor = to({}, Z9, { drag: { y: o == 2 } }, t.cursor);
  if (bt.dataIdx == null) {
    let X = bt.hover, oe = X.skip = new Set(X.skip ?? []);
    oe.add(void 0);
    let xe = X.prox = _n(X.prox), Se = X.bias ??= 0;
    bt.dataIdx = (Ie, x, S, T) => {
      if (x == 0)
        return S;
      let R = S, z = xe(Ie, x, S, T) ?? In, W = z >= 0 && z < In, Z = M.ori == 0 ? Qe : Pe, ne = bt.left, pe = e[0], we = e[x];
      if (oe.has(we[S])) {
        R = null;
        let ge = null, Ee = null, Me;
        if (Se == 0 || Se == -1)
          for (Me = S; ge == null && Me-- > 0; )
            oe.has(we[Me]) || (ge = Me);
        if (Se == 0 || Se == 1)
          for (Me = S; Ee == null && Me++ < we.length; )
            oe.has(we[Me]) || (Ee = Me);
        if (ge != null || Ee != null)
          if (W) {
            let Xe = ge == null ? -1 / 0 : L(pe[ge], M, Z, 0), Je = Ee == null ? 1 / 0 : L(pe[Ee], M, Z, 0), it = ne - Xe, ct = Je - ne;
            it <= ct ? it <= z && (R = ge) : ct <= z && (R = Ee);
          } else
            R = Ee == null ? ge : ge == null ? Ee : S - ge <= Ee - S ? ge : Ee;
      } else W && so(ne - L(pe[S], M, Z, 0)) > z && (R = null);
      return R;
    };
  }
  const Xn = (X) => {
    bt.event = X;
  };
  bt.idxs = q, bt._lock = !1;
  let En = bt.points;
  En.show = _n(En.show), En.size = _n(En.size), En.stroke = _n(En.stroke), En.width = _n(En.width), En.fill = _n(En.fill);
  const di = i.focus = to({}, t.focus || { alpha: 0.3 }, bt.focus), Ri = di.prox >= 0, zo = Ri && En.one;
  let Ue = [], yt = [], xt = [];
  function fn(X, oe) {
    let xe = En.show(i, oe);
    if (xe)
      return Er(xe, qH), Er(xe, X.class), rl(xe, -10, -10, Qe, Pe), g.insertBefore(xe, Ue[oe]), xe;
  }
  function Oi(X, oe) {
    if (o == 1 || oe > 0) {
      let xe = o == 1 && C[X.scale].time, Se = X.value;
      X.value = xe ? AT(Se) ? FT(Y, BT(Se, Q)) : Se || H : Se || aW, X.label = X.label || (xe ? U9 : G9);
    }
    if (zo || oe > 0) {
      X.width = X.width == null ? 1 : X.width, X.paths = X.paths || xW || c9, X.fillTo = _n(X.fillTo || dW), X.pxAlign = +Qn(X.pxAlign, m), X.pxRound = XT(X.pxAlign), X.stroke = _n(X.stroke || null), X.fill = _n(X.fill || null), X._stroke = X._fill = X._paths = X._focus = null;
      let xe = lW(Vo(1, X.width), 1), Se = X.points = to({}, {
        size: xe,
        width: Vo(1, xe * 0.2),
        stroke: X.stroke,
        space: xe * 2,
        paths: OW,
        _stroke: null,
        _fill: null
      }, X.points);
      Se.show = _n(Se.show), Se.filter = _n(Se.filter), Se.fill = _n(Se.fill), Se.stroke = _n(Se.stroke), Se.paths = _n(Se.paths), Se.pxAlign = X.pxAlign;
    }
    if (ee) {
      let xe = Re(X, oe);
      me.splice(oe, 0, xe[0]), ce.splice(oe, 0, xe[1]), K.values.push(null);
    }
    if (bt.show) {
      q.splice(oe, 0, null);
      let xe = null;
      zo ? oe == 0 && (xe = fn(X, oe)) : oe > 0 && (xe = fn(X, oe)), Ue.splice(oe, 0, xe), yt.splice(oe, 0, 0), xt.splice(oe, 0, 0);
    }
    Ei("addSeries", oe);
  }
  function yi(X, oe) {
    oe = oe ?? w.length, X = o == 1 ? Vx(X, oe, QT, YT) : Vx(X, oe, {}, qT), w.splice(oe, 0, X), Oi(w[oe], oe);
  }
  i.addSeries = yi;
  function io(X) {
    if (w.splice(X, 1), ee) {
      K.values.splice(X, 1), ce.splice(X, 1);
      let oe = me.splice(X, 1)[0];
      Fe(null, oe.firstChild), oe.remove();
    }
    bt.show && (q.splice(X, 1), Ue.splice(X, 1)[0].remove(), yt.splice(X, 1), xt.splice(X, 1)), Ei("delSeries", X);
  }
  i.delSeries = io;
  const Ln = [!1, !1, !1, !1];
  function Bt(X, oe) {
    if (X._show = X.show, X.show) {
      let xe = X.side % 2, Se = C[X.scale];
      Se == null && (X.scale = xe ? w[1].scale : O, Se = C[X.scale]);
      let Ie = Se.time;
      X.size = _n(X.size), X.space = _n(X.space), X.rotate = _n(X.rotate), uu(X.incrs) && X.incrs.forEach((S) => {
        !Iu.has(S) && Iu.set(S, WR(S));
      }), X.incrs = _n(X.incrs || (Se.distr == 2 ? M9 : Ie ? b == 1 ? R9 : L9 : cc)), X.splits = _n(X.splits || (Ie && Se.distr == 1 ? G : Se.distr == 3 ? Lx : Se.distr == 4 ? tW : eW)), X.stroke = _n(X.stroke), X.grid.stroke = _n(X.grid.stroke), X.ticks.stroke = _n(X.ticks.stroke), X.border.stroke = _n(X.border.stroke);
      let x = X.values;
      X.values = // static array of tick values
      uu(x) && !uu(x[0]) ? _n(x) : (
        // temporal
        Ie ? (
          // config array of fmtDate string tpls
          uu(x) ? zT(Y, LT(x, Q)) : (
            // fmtDate string tpl
            AT(x) ? F9(Y, x) : x || V
          )
        ) : x || J9
      ), X.filter = _n(X.filter || (Se.distr >= 3 && Se.log == 10 ? oW : Se.distr == 3 && Se.log == 2 ? rW : QR)), X.font = JT(X.font), X.labelFont = JT(X.labelFont), X._size = X.size(i, null, oe, 0), X._space = X._rotate = X._incrs = X._found = // foundIncrSpace
      X._splits = X._values = null, X._size > 0 && (Ln[oe] = !0, X._el = ea(QH, h));
    }
  }
  function Fi(X, oe, xe, Se) {
    let [Ie, x, S, T] = xe, R = oe % 2, z = 0;
    return R == 0 && (T || x) && (z = oe == 0 && !Ie || oe == 2 && !S ? ao(VT.size / 3) : 0), R == 1 && (Ie || S) && (z = oe == 1 && !x || oe == 3 && !T ? ao(WT.size / 2) : 0), z;
  }
  const vo = i.padding = (t.padding || [Fi, Fi, Fi, Fi]).map((X) => _n(Qn(X, Fi))), Sn = i._padding = vo.map((X, oe) => X(i, oe, Ln, 0));
  let Zn, wn = null, Gn = null;
  const Ho = o == 1 ? w[0].idxs : null;
  let Si = null, ur = !1;
  function $o(X, oe) {
    if (e = X ?? [], i.data = i._data = e, o == 2) {
      Zn = 0;
      for (let xe = 1; xe < w.length; xe++)
        Zn += e[xe][0].length;
    } else {
      e.length == 0 && (i.data = i._data = e = [[]]), Si = e[0], Zn = Si.length;
      let xe = e;
      if (N == 2) {
        xe = e.slice();
        let Se = xe[0] = Array(Zn);
        for (let Ie = 0; Ie < Zn; Ie++)
          Se[Ie] = Ie;
      }
      i._data = e = xe;
    }
    if (Gs(!0), Ei("setData"), N == 2 && (st = !0), oe !== !1) {
      let xe = M;
      xe.auto(i, ur) ? Fl() : ko(O, xe.min, xe.max), gt = gt || bt.left >= 0, It = !0, el();
    }
  }
  i.setData = $o;
  function Fl() {
    ur = !0;
    let X, oe;
    o == 1 && (Zn > 0 ? (wn = Ho[0] = 0, Gn = Ho[1] = Zn - 1, X = e[0][wn], oe = e[0][Gn], N == 2 ? (X = wn, oe = Gn) : X == oe && (N == 3 ? [X, oe] = X0(X, X, M.log, !1) : N == 4 ? [X, oe] = jw(X, X, M.log, !1) : M.time ? oe = X + ao(86400 / b) : [X, oe] = Lv(X, oe, qw, !0))) : (wn = Ho[0] = X = null, Gn = Ho[1] = oe = null)), ko(O, X, oe);
  }
  let Vl, ba, Za, Hs, Ga, Ws, xa, Ua, Wu, Wo;
  function hd(X, oe, xe, Se, Ie, x) {
    X ??= gT, xe ??= Kw, Se ??= "butt", Ie ??= gT, x ??= "round", X != Vl && (f.strokeStyle = Vl = X), Ie != ba && (f.fillStyle = ba = Ie), oe != Za && (f.lineWidth = Za = oe), x != Ga && (f.lineJoin = Ga = x), Se != Ws && (f.lineCap = Ws = Se), xe != Hs && f.setLineDash(Hs = xe);
  }
  function ju(X, oe, xe, Se) {
    oe != ba && (f.fillStyle = ba = oe), X != xa && (f.font = xa = X), xe != Ua && (f.textAlign = Ua = xe), Se != Wu && (f.textBaseline = Wu = Se);
  }
  function js(X, oe, xe, Se, Ie = 0) {
    if (Se.length > 0 && X.auto(i, ur) && (oe == null || oe.min == null)) {
      let x = Qn(wn, 0), S = Qn(Gn, Se.length - 1), T = xe.min == null ? X.distr == 3 ? o9(Se, x, S) : i9(Se, x, S, Ie) : [xe.min, xe.max];
      X.min = aa(X.min, xe.min = T[0]), X.max = Vo(X.max, xe.max = T[1]);
    }
  }
  const qu = { min: null, max: null };
  function Yu() {
    for (let Se in C) {
      let Ie = C[Se];
      B[Se] == null && // scales that have never been set (on init)
      (Ie.min == null || // or auto scales when the x scale was explicitly set
      B[O] != null && Ie.auto(i, ur)) && (B[Se] = qu);
    }
    for (let Se in C) {
      let Ie = C[Se];
      B[Se] == null && Ie.from != null && B[Ie.from] != null && (B[Se] = qu);
    }
    B[O] != null && Gs(!0);
    let X = {};
    for (let Se in B) {
      let Ie = B[Se];
      if (Ie != null) {
        let x = X[Se] = Ef(C[Se], h9);
        if (Ie.min != null)
          to(x, Ie);
        else if (Se != O || o == 2)
          if (Zn == 0 && x.from == null) {
            let S = x.range(i, null, null, Se);
            x.min = S[0], x.max = S[1];
          } else
            x.min = In, x.max = -In;
      }
    }
    if (Zn > 0) {
      w.forEach((Se, Ie) => {
        if (o == 1) {
          let x = Se.scale, S = B[x];
          if (S == null)
            return;
          let T = X[x];
          if (Ie == 0) {
            let R = T.range(i, T.min, T.max, x);
            T.min = R[0], T.max = R[1], wn = Ia(T.min, e[0]), Gn = Ia(T.max, e[0]), Gn - wn > 1 && (e[0][wn] < T.min && wn++, e[0][Gn] > T.max && Gn--), Se.min = Si[wn], Se.max = Si[Gn];
          } else Se.show && Se.auto && js(T, S, Se, e[Ie], Se.sorted);
          Se.idxs[0] = wn, Se.idxs[1] = Gn;
        } else if (Ie > 0 && Se.show && Se.auto) {
          let [x, S] = Se.facets, T = x.scale, R = S.scale, [z, W] = e[Ie], Z = X[T], ne = X[R];
          Z != null && js(Z, B[T], x, z, x.sorted), ne != null && js(ne, B[R], S, W, S.sorted), Se.min = S.min, Se.max = S.max;
        }
      });
      for (let Se in X) {
        let Ie = X[Se], x = B[Se];
        if (Ie.from == null && (x == null || x.min == null)) {
          let S = Ie.range(
            i,
            Ie.min == In ? null : Ie.min,
            Ie.max == -In ? null : Ie.max,
            Se
          );
          Ie.min = S[0], Ie.max = S[1];
        }
      }
    }
    for (let Se in X) {
      let Ie = X[Se];
      if (Ie.from != null) {
        let x = X[Ie.from];
        if (x.min == null)
          Ie.min = Ie.max = null;
        else {
          let S = Ie.range(i, x.min, x.max, Se);
          Ie.min = S[0], Ie.max = S[1];
        }
      }
    }
    let oe = {}, xe = !1;
    for (let Se in X) {
      let Ie = X[Se], x = C[Se];
      if (x.min != Ie.min || x.max != Ie.max) {
        x.min = Ie.min, x.max = Ie.max;
        let S = x.distr;
        x._min = S == 3 ? vs(x.min) : S == 4 ? Pb(x.min, x.asinh) : S == 100 ? x.fwd(x.min) : x.min, x._max = S == 3 ? vs(x.max) : S == 4 ? Pb(x.max, x.asinh) : S == 100 ? x.fwd(x.max) : x.max, oe[Se] = xe = !0;
      }
    }
    if (xe) {
      w.forEach((Se, Ie) => {
        o == 2 ? Ie > 0 && oe.y && (Se._paths = null) : oe[Se.scale] && (Se._paths = null);
      });
      for (let Se in oe)
        st = !0, Ei("setScale", Se);
      bt.show && bt.left >= 0 && (gt = It = !0);
    }
    for (let Se in B)
      B[Se] = null;
  }
  function qs(X) {
    let oe = Nx(wn - 1, 0, Zn - 1), xe = Nx(Gn + 1, 0, Zn - 1);
    for (; X[oe] == null && oe > 0; )
      oe--;
    for (; X[xe] == null && xe < Zn - 1; )
      xe++;
    return [oe, xe];
  }
  function Ys() {
    Zn > 0 && (w.forEach((X, oe) => {
      if (oe > 0 && X.show && (Pi(oe, !1), Pi(oe, !0), X._paths == null)) {
        Wo != X.alpha && (f.globalAlpha = Wo = X.alpha);
        let xe = o == 2 ? [0, e[oe][0].length - 1] : qs(e[oe]);
        X._paths = X.paths(i, oe, xe[0], xe[1]), Wo != 1 && (f.globalAlpha = Wo = 1);
      }
    }), w.forEach((X, oe) => {
      if (oe > 0 && X.show) {
        Wo != X.alpha && (f.globalAlpha = Wo = X.alpha), X._paths != null && jo(oe, !1);
        {
          let xe = X._paths != null ? X._paths.gaps : null, Se = X.points.show(i, oe, wn, Gn, xe), Ie = X.points.filter(i, oe, Se, xe);
          (Se || Ie) && (X.points._paths = X.points.paths(i, oe, wn, Gn, Ie), jo(oe, !0));
        }
        Wo != 1 && (f.globalAlpha = Wo = 1), Ei("drawSeries", oe);
      }
    }));
  }
  function Pi(X, oe) {
    let xe = oe ? w[X].points : w[X];
    xe._stroke = xe.stroke(i, X), xe._fill = xe.fill(i, X);
  }
  function jo(X, oe) {
    let xe = oe ? w[X].points : w[X], {
      stroke: Se,
      fill: Ie,
      clip: x,
      flags: S,
      _stroke: T = xe._stroke,
      _fill: R = xe._fill,
      _width: z = xe.width
    } = xe._paths;
    z = mi(z * Jn, 3);
    let W = null, Z = z % 2 / 2;
    oe && R == null && (R = z > 0 ? "#fff" : T);
    let ne = xe.pxAlign == 1 && Z > 0;
    if (ne && f.translate(Z, Z), !oe) {
      let pe = rt - z / 2, we = De - z / 2, ge = Be + z, Ee = je + z;
      W = new Path2D(), W.rect(pe, we, ge, Ee);
    }
    oe ? yo(T, z, xe.dash, xe.cap, R, Se, Ie, S, x) : Ql(X, T, z, xe.dash, xe.cap, R, Se, Ie, S, W, x), ne && f.translate(-Z, -Z);
  }
  function Ql(X, oe, xe, Se, Ie, x, S, T, R, z, W) {
    let Z = !1;
    R != 0 && P.forEach((ne, pe) => {
      if (ne.series[0] == X) {
        let we = w[ne.series[1]], ge = e[ne.series[1]], Ee = (we._paths || ip).band;
        uu(Ee) && (Ee = ne.dir == 1 ? Ee[0] : Ee[1]);
        let Me, Xe = null;
        we.show && Ee && a9(ge, wn, Gn) ? (Xe = ne.fill(i, pe) || x, Me = we._paths.clip) : Ee = null, yo(oe, xe, Se, Ie, Xe, S, T, R, z, W, Me, Ee), Z = !0;
      }
    }), Z || yo(oe, xe, Se, Ie, x, S, T, R, z, W);
  }
  const qo = _f | Bx;
  function yo(X, oe, xe, Se, Ie, x, S, T, R, z, W, Z) {
    hd(X, oe, xe, Se, Ie), (R || z || Z) && (f.save(), R && f.clip(R), z && f.clip(z)), Z ? (T & qo) == qo ? (f.clip(Z), W && f.clip(W), Xs(Ie, S), Ks(X, x, oe)) : T & Bx ? (Xs(Ie, S), f.clip(Z), Ks(X, x, oe)) : T & _f && (f.save(), f.clip(Z), W && f.clip(W), Xs(Ie, S), f.restore(), Ks(X, x, oe)) : (Xs(Ie, S), Ks(X, x, oe)), (R || z || Z) && f.restore();
  }
  function Ks(X, oe, xe) {
    xe > 0 && (oe instanceof Map ? oe.forEach((Se, Ie) => {
      f.strokeStyle = Vl = Ie, f.stroke(Se);
    }) : oe != null && X && f.stroke(oe));
  }
  function Xs(X, oe) {
    oe instanceof Map ? oe.forEach((xe, Se) => {
      f.fillStyle = ba = Se, f.fill(xe);
    }) : oe != null && X && f.fill(oe);
  }
  function Zs(X, oe, xe, Se) {
    let Ie = $[X], x;
    if (Se <= 0)
      x = [0, 0];
    else {
      let S = Ie._space = Ie.space(i, X, oe, xe, Se), T = Ie._incrs = Ie.incrs(i, X, oe, xe, Se, S);
      x = TW(oe, xe, T, Se, S);
    }
    return Ie._found = x;
  }
  function Ja(X, oe, xe, Se, Ie, x, S, T, R, z) {
    let W = S % 2 / 2;
    m == 1 && f.translate(W, W), hd(T, S, R, z, T), f.beginPath();
    let Z, ne, pe, we, ge = Ie + (Se == 0 || Se == 3 ? -x : x);
    xe == 0 ? (ne = Ie, we = ge) : (Z = Ie, pe = ge);
    for (let Ee = 0; Ee < X.length; Ee++)
      oe[Ee] != null && (xe == 0 ? Z = pe = X[Ee] : ne = we = X[Ee], f.moveTo(Z, ne), f.lineTo(pe, we));
    f.stroke(), m == 1 && f.translate(-W, -W);
  }
  function pd(X) {
    let oe = !0;
    return $.forEach((xe, Se) => {
      if (!xe.show)
        return;
      let Ie = C[xe.scale];
      if (Ie.min == null) {
        xe._show && (oe = !1, xe._show = !1, Gs(!1));
        return;
      } else
        xe._show || (oe = !1, xe._show = !0, Gs(!1));
      let x = xe.side, S = x % 2, { min: T, max: R } = Ie, [z, W] = Zs(Se, T, R, S == 0 ? Qe : Pe);
      if (W == 0)
        return;
      let Z = Ie.distr == 2, ne = xe._splits = xe.splits(i, Se, T, R, z, W, Z), pe = Ie.distr == 2 ? ne.map((Me) => Si[Me]) : ne, we = Ie.distr == 2 ? Si[ne[1]] - Si[ne[0]] : z, ge = xe._values = xe.values(i, xe.filter(i, pe, Se, W, we), Se, W, we);
      xe._rotate = x == 2 ? xe.rotate(i, ge, Se, W) : 0;
      let Ee = xe._size;
      xe._size = ia(xe.size(i, ge, Se, X)), Ee != null && xe._size != Ee && (oe = !1);
    }), oe;
  }
  function Ku(X) {
    let oe = !0;
    return vo.forEach((xe, Se) => {
      let Ie = xe(i, Se, Ln, X);
      Ie != Sn[Se] && (oe = !1), Sn[Se] = Ie;
    }), oe;
  }
  function Dg() {
    for (let X = 0; X < $.length; X++) {
      let oe = $[X];
      if (!oe.show || !oe._show)
        continue;
      let xe = oe.side, Se = xe % 2, Ie, x, S = oe.stroke(i, X), T = xe == 0 || xe == 3 ? -1 : 1;
      if (oe.label) {
        let hi = oe.labelGap * T, Ni = ao((oe._lpos + hi) * Jn);
        ju(oe.labelFont[0], S, "center", xe == 2 ? kh : pT), f.save(), Se == 1 ? (Ie = x = 0, f.translate(
          Ni,
          ao(De + je / 2)
        ), f.rotate((xe == 3 ? -nv : nv) / 2)) : (Ie = ao(rt + Be / 2), x = Ni), f.fillText(oe.label, Ie, x), f.restore();
      }
      let [R, z] = oe._found;
      if (z == 0)
        continue;
      let W = C[oe.scale], Z = Se == 0 ? Be : je, ne = Se == 0 ? rt : De, pe = ao(oe.gap * Jn), we = oe._splits, ge = W.distr == 2 ? we.map((hi) => Si[hi]) : we, Ee = W.distr == 2 ? Si[we[1]] - Si[we[0]] : R, Me = oe.ticks, Xe = oe.border, Je = Me.show ? ao(Me.size * Jn) : 0, it = oe._rotate * -nv / 180, ct = y(oe._pos * Jn), ft = (Je + pe) * T, $t = ct + ft;
      x = Se == 0 ? $t : 0, Ie = Se == 1 ? $t : 0;
      let Wt = oe.font[0], ln = oe.align == 1 ? wd : oe.align == 2 ? kb : it > 0 ? wd : it < 0 ? kb : Se == 0 ? "center" : xe == 3 ? kb : wd, Ft = it || Se == 1 ? "middle" : xe == 2 ? kh : pT;
      ju(Wt, S, ln, Ft);
      let Ut = oe.font[1] * oe.lineGap, Un = we.map((hi) => y(s(hi, W, Z, ne))), Dn = oe._values;
      for (let hi = 0; hi < Dn.length; hi++) {
        let Ni = Dn[hi];
        if (Ni != null) {
          Se == 0 ? Ie = Un[hi] : x = Un[hi], Ni = "" + Ni;
          let Ca = Ni.indexOf(`
`) == -1 ? [Ni] : Ni.split(/\n/gm);
          for (let cr = 0; cr < Ca.length; cr++) {
            let Kr = Ca[cr];
            it ? (f.save(), f.translate(Ie, x + cr * Ut), f.rotate(it), f.fillText(Kr, 0, 0), f.restore()) : f.fillText(Kr, Ie, x + cr * Ut);
          }
        }
      }
      Me.show && Ja(
        Un,
        Me.filter(i, ge, X, z, Ee),
        Se,
        xe,
        ct,
        Je,
        mi(Me.width * Jn, 3),
        Me.stroke(i, X),
        Me.dash,
        Me.cap
      );
      let oi = oe.grid;
      oi.show && Ja(
        Un,
        oi.filter(i, ge, X, z, Ee),
        Se,
        Se == 0 ? 2 : 1,
        Se == 0 ? De : rt,
        Se == 0 ? je : Be,
        mi(oi.width * Jn, 3),
        oi.stroke(i, X),
        oi.dash,
        oi.cap
      ), Xe.show && Ja(
        [ct],
        [1],
        Se == 0 ? 1 : 0,
        Se == 0 ? 1 : 2,
        Se == 1 ? De : rt,
        Se == 1 ? je : Be,
        mi(Xe.width * Jn, 3),
        Xe.stroke(i, X),
        Xe.dash,
        Xe.cap
      );
    }
    Ei("drawAxes");
  }
  function Gs(X) {
    w.forEach((oe, xe) => {
      xe > 0 && (oe._paths = null, X && (o == 1 ? (oe.min = null, oe.max = null) : oe.facets.forEach((Se) => {
        Se.min = null, Se.max = null;
      })));
    });
  }
  let gd = !1, md = !1, Us = [];
  function ob() {
    md = !1;
    for (let X = 0; X < Us.length; X++)
      Ei(...Us[X]);
    Us.length = 0;
  }
  function el() {
    gd || (x9(mh), gd = !0);
  }
  function rb(X, oe = !1) {
    gd = !0, md = oe, X(i), mh(), oe && Us.length > 0 && queueMicrotask(ob);
  }
  i.batch = rb;
  function mh() {
    if (at && (Yu(), at = !1), st && (nn(), st = !1), mt) {
      if (Ci(p, wd, Ze), Ci(p, kh, Ce), Ci(p, Hh, Qe), Ci(p, Wh, Pe), Ci(g, wd, Ze), Ci(g, kh, Ce), Ci(g, Hh, Qe), Ci(g, Wh, Pe), Ci(h, Hh, We), Ci(h, Wh, nt), d.width = ao(We * Jn), d.height = ao(nt * Jn), $.forEach(({ _el: X, _show: oe, _size: xe, _pos: Se, side: Ie }) => {
        if (X != null)
          if (oe) {
            let x = Ie === 3 || Ie === 0 ? xe : 0, S = Ie % 2 == 1;
            Ci(X, S ? "left" : "top", Se - x), Ci(X, S ? "width" : "height", xe), Ci(X, S ? "top" : "left", S ? Ce : Ze), Ci(X, S ? "height" : "width", S ? Pe : Qe), Rx(X, vc);
          } else
            Er(X, vc);
      }), Vl = ba = Za = Ga = Ws = xa = Ua = Wu = Hs = null, Wo = 1, ru(!0), Ze != $e || Ce != Le || Qe != Ke || Pe != qe) {
        Gs(!1);
        let X = Qe / Ke, oe = Pe / qe;
        if (bt.show && !gt && bt.left >= 0) {
          bt.left *= X, bt.top *= oe, Hl && rl(Hl, ao(bt.left), 0, Qe, Pe), Wl && rl(Wl, 0, ao(bt.top), Qe, Pe);
          for (let xe = 0; xe < Ue.length; xe++) {
            let Se = Ue[xe];
            Se != null && (yt[xe] *= X, xt[xe] *= oe, rl(Se, ia(yt[xe]), ia(xt[xe]), Qe, Pe));
          }
        }
        if (si.show && !Et && si.left >= 0 && si.width > 0) {
          si.left *= X, si.width *= X, si.top *= oe, si.height *= oe;
          for (let xe in Oh)
            Ci(tl, xe, si[xe]);
        }
        $e = Ze, Le = Ce, Ke = Qe, qe = Pe;
      }
      Ei("setSize"), mt = !1;
    }
    We > 0 && nt > 0 && (f.clearRect(0, 0, d.width, d.height), Ei("drawClear"), _.forEach((X) => X()), Ei("draw")), si.show && Et && (vd(si), Et = !1), bt.show && gt && (ol(null, !0, !1), gt = !1), K.show && K.live && It && (ou(), It = !1), u || (u = !0, i.status = 1, Ei("ready")), ur = !1, gd = !1;
  }
  i.redraw = (X, oe) => {
    st = oe || !1, X !== !1 ? ko(O, M.min, M.max) : el();
  };
  function vh(X, oe) {
    let xe = C[X];
    if (xe.from == null) {
      if (Zn == 0) {
        let Se = xe.range(i, oe.min, oe.max, X);
        oe.min = Se[0], oe.max = Se[1];
      }
      if (oe.min > oe.max) {
        let Se = oe.min;
        oe.min = oe.max, oe.max = Se;
      }
      if (Zn > 1 && oe.min != null && oe.max != null && oe.max - oe.min < 1e-16)
        return;
      X == O && xe.distr == 2 && Zn > 0 && (oe.min = Ia(oe.min, e[0]), oe.max = Ia(oe.max, e[0]), oe.min == oe.max && oe.max++), B[X] = oe, at = !0, el();
    }
  }
  i.setScale = vh;
  let Js, yh, Hl, Wl, Ng, bh, jl, eu, tu, Xu, fi, li, Oa = !1;
  const oo = bt.drag;
  let Vi = oo.x, Yi = oo.y;
  bt.show && (bt.x && (Js = ea(WH, g)), bt.y && (yh = ea(jH, g)), M.ori == 0 ? (Hl = Js, Wl = yh) : (Hl = yh, Wl = Js), fi = bt.left, li = bt.top);
  const si = i.select = to({
    show: !0,
    over: !0,
    left: 0,
    width: 0,
    top: 0,
    height: 0
  }, t.select), tl = si.show ? ea(HH, si.over ? g : p) : null;
  function vd(X, oe) {
    if (si.show) {
      for (let xe in X)
        si[xe] = X[xe], xe in Oh && Ci(tl, xe, X[xe]);
      oe !== !1 && Ei("setSelect");
    }
  }
  i.setSelect = vd;
  function ab(X, oe) {
    let xe = w[X], Se = ee ? me[X] : null;
    if (xe.show)
      Se && Rx(Se, vc);
    else {
      Se && Er(Se, vc);
      let Ie = zo ? Ue[0] : Ue[X];
      rl(Ie, -10, -10, Qe, Pe);
    }
  }
  function ko(X, oe, xe) {
    vh(X, { min: oe, max: xe });
  }
  function qr(X, oe, xe, Se) {
    oe.focus != null && ub(X), oe.show != null && w.forEach((Ie, x) => {
      x > 0 && (X == x || X == null) && (Ie.show = oe.show, ab(x, oe.show), o == 2 ? (ko(Ie.facets[0].scale, null, null), ko(Ie.facets[1].scale, null, null)) : ko(Ie.scale, null, null), el());
    }), xe !== !1 && Ei("setSeries", X, oe), Se && Uu("setSeries", i, X, oe);
  }
  i.setSeries = qr;
  function lb(X, oe) {
    to(P[X], oe);
  }
  function sb(X, oe) {
    X.fill = _n(X.fill || null), X.dir = Qn(X.dir, -1), oe = oe ?? P.length, P.splice(oe, 0, X);
  }
  function Lg(X) {
    X == null ? P.length = 0 : P.splice(X, 1);
  }
  i.addBand = sb, i.setBand = lb, i.delBand = Lg;
  function zg(X, oe) {
    w[X].alpha = oe, bt.show && Ue[X] && (Ue[X].style.opacity = oe), ee && me[X] && (me[X].style.opacity = oe);
  }
  let wi, nl, ql;
  const nu = { focus: !0 };
  function ub(X) {
    if (X != ql) {
      let oe = X == null, xe = di.alpha != 1;
      w.forEach((Se, Ie) => {
        if (o == 1 || Ie > 0) {
          let x = oe || Ie == 0 || Ie == X;
          Se._focus = oe ? null : x, xe && zg(Ie, x ? 1 : di.alpha);
        }
      }), ql = X, xe && el();
    }
  }
  ee && Ri && Ne(bT, ae, (X) => {
    bt._lock || (Xn(X), ql != null && qr(null, nu, !0, Di.setSeries));
  });
  function Yr(X, oe, xe) {
    let Se = C[oe];
    xe && (X = X / Jn - (Se.ori == 1 ? Ce : Ze));
    let Ie = Qe;
    Se.ori == 1 && (Ie = Pe, X = Ie - X), Se.dir == -1 && (X = Ie - X);
    let x = Se._min, S = Se._max, T = X / Ie, R = x + (S - x) * T, z = Se.distr;
    return z == 3 ? Tf(10, R) : z == 4 ? s9(R, Se.asinh) : z == 100 ? Se.bwd(R) : R;
  }
  function cb(X, oe) {
    let xe = Yr(X, O, oe);
    return Ia(xe, e[0], wn, Gn);
  }
  i.valToIdx = (X) => Ia(X, e[0]), i.posToIdx = cb, i.posToVal = Yr, i.valToPos = (X, oe, xe) => C[oe].ori == 0 ? a(
    X,
    C[oe],
    xe ? Be : Qe,
    xe ? rt : 0
  ) : l(
    X,
    C[oe],
    xe ? je : Pe,
    xe ? De : 0
  ), i.setCursor = (X, oe, xe) => {
    fi = X.left, li = X.top, ol(null, oe, xe);
  };
  function Bg(X, oe) {
    Ci(tl, wd, si.left = X), Ci(tl, Hh, si.width = oe);
  }
  function Fg(X, oe) {
    Ci(tl, kh, si.top = X), Ci(tl, Wh, si.height = oe);
  }
  let iu = M.ori == 0 ? Bg : Fg, il = M.ori == 1 ? Bg : Fg;
  function Yl() {
    if (ee && K.live)
      for (let X = o == 2 ? 1 : 0; X < w.length; X++) {
        if (X == 0 && fe)
          continue;
        let oe = K.values[X], xe = 0;
        for (let Se in oe)
          ce[X][xe++].firstChild.nodeValue = oe[Se];
      }
  }
  function ou(X, oe) {
    if (X != null && (X.idxs ? X.idxs.forEach((xe, Se) => {
      q[Se] = xe;
    }) : f9(X.idx) || q.fill(X.idx), K.idx = q[0]), ee && K.live) {
      for (let xe = 0; xe < w.length; xe++)
        (xe > 0 || o == 1 && !fe) && db(xe, q[xe]);
      Yl();
    }
    It = !1, oe !== !1 && Ei("setLegend");
  }
  i.setLegend = ou;
  function db(X, oe) {
    let xe = w[X], Se = X == 0 && N == 2 ? Si : e[X], Ie;
    fe ? Ie = xe.values(i, X, oe) ?? he : (Ie = xe.value(i, oe == null ? null : Se[oe], X, oe), Ie = Ie == null ? he : { _: Ie }), K.values[X] = Ie;
  }
  function ol(X, oe, xe) {
    tu = fi, Xu = li, [fi, li] = bt.move(i, fi, li), bt.left = fi, bt.top = li, bt.show && (Hl && rl(Hl, ao(fi), 0, Qe, Pe), Wl && rl(Wl, 0, ao(li), Qe, Pe));
    let Se, Ie = wn > Gn;
    wi = In, nl = null;
    let x = M.ori == 0 ? Qe : Pe, S = M.ori == 1 ? Qe : Pe;
    if (fi < 0 || Zn == 0 || Ie) {
      Se = bt.idx = null;
      for (let T = 0; T < w.length; T++) {
        let R = Ue[T];
        R != null && rl(R, -10, -10, Qe, Pe);
      }
      Ri && qr(null, nu, !0, X == null && Di.setSeries), K.live && (q.fill(Se), It = !0);
    } else {
      let T, R, z;
      o == 1 && (T = M.ori == 0 ? fi : li, R = Yr(T, O), Se = bt.idx = Ia(R, e[0], wn, Gn), z = L(e[0][Se], M, x, 0));
      let W = -10, Z = -10, ne = 0, pe = 0, we = !0, ge = "", Ee = "";
      for (let Me = o == 2 ? 1 : 0; Me < w.length; Me++) {
        let Xe = w[Me], Je = q[Me], it = Je == null ? null : o == 1 ? e[Me][Je] : e[Me][1][Je], ct = bt.dataIdx(i, Me, Se, R), ft = ct == null ? null : o == 1 ? e[Me][ct] : e[Me][1][ct];
        It = It || ft != it || ct != Je, q[Me] = ct;
        let $t = ct == Se ? z : L(o == 1 ? e[0][ct] : e[Me][0][ct], M, x, 0);
        if (Me > 0 && Xe.show) {
          let Wt = ft == null ? -10 : j(ft, o == 1 ? C[Xe.scale] : C[Xe.facets[1].scale], S, 0);
          if (Ri && ft != null) {
            let ln = M.ori == 1 ? fi : li, Ft = so(di.dist(i, Me, ct, Wt, ln));
            if (Ft < wi) {
              let Ut = di.bias;
              if (Ut != 0) {
                let Un = Yr(ln, Xe.scale), Dn = ft >= 0 ? 1 : -1, oi = Un >= 0 ? 1 : -1;
                oi == Dn && (oi == 1 ? Ut == 1 ? ft >= Un : ft <= Un : (
                  // >= 0
                  Ut == 1 ? ft <= Un : ft >= Un
                )) && (wi = Ft, nl = Me);
              } else
                wi = Ft, nl = Me;
            }
          }
          if (It || zo) {
            let ln, Ft;
            M.ori == 0 ? (ln = $t, Ft = Wt) : (ln = Wt, Ft = $t);
            let Ut, Un, Dn, oi, hi, Ni, Ca = !0, cr = En.bbox;
            if (cr != null) {
              Ca = !1;
              let Kr = cr(i, Me);
              Dn = Kr.left, oi = Kr.top, Ut = Kr.width, Un = Kr.height;
            } else
              Dn = ln, oi = Ft, Ut = Un = En.size(i, Me);
            if (Ni = En.fill(i, Me), hi = En.stroke(i, Me), zo)
              Me == nl && wi <= di.prox && (W = Dn, Z = oi, ne = Ut, pe = Un, we = Ca, ge = Ni, Ee = hi);
            else {
              let Kr = Ue[Me];
              Kr != null && (yt[Me] = Dn, xt[Me] = oi, kT(Kr, Ut, Un, Ca), CT(Kr, Ni, hi), rl(Kr, ia(Dn), ia(oi), Qe, Pe));
            }
          }
        }
      }
      if (zo) {
        let Me = di.prox, Xe = ql == null ? wi <= Me : wi > Me || nl != ql;
        if (It || Xe) {
          let Je = Ue[0];
          yt[0] = W, xt[0] = Z, kT(Je, ne, pe, we), CT(Je, ge, Ee), rl(Je, ia(W), ia(Z), Qe, Pe);
        }
      }
    }
    if (si.show && Oa)
      if (X != null) {
        let [T, R] = Di.scales, [z, W] = Di.match, [Z, ne] = X.cursor.sync.scales, pe = X.cursor.drag;
        if (Vi = pe._x, Yi = pe._y, Vi || Yi) {
          let { left: we, top: ge, width: Ee, height: Me } = X.select, Xe = X.scales[Z].ori, Je = X.posToVal, it, ct, ft, $t, Wt, ln = T != null && z(T, Z), Ft = R != null && W(R, ne);
          ln && Vi ? (Xe == 0 ? (it = we, ct = Ee) : (it = ge, ct = Me), ft = C[T], $t = L(Je(it, Z), ft, x, 0), Wt = L(Je(it + ct, Z), ft, x, 0), iu(aa($t, Wt), so(Wt - $t))) : iu(0, x), Ft && Yi ? (Xe == 1 ? (it = we, ct = Ee) : (it = ge, ct = Me), ft = C[R], $t = j(Je(it, ne), ft, S, 0), Wt = j(Je(it + ct, ne), ft, S, 0), il(aa($t, Wt), so(Wt - $t))) : il(0, S);
        } else
          yd();
      } else {
        let T = so(tu - Ng), R = so(Xu - bh);
        if (M.ori == 1) {
          let ne = T;
          T = R, R = ne;
        }
        Vi = oo.x && T >= oo.dist, Yi = oo.y && R >= oo.dist;
        let z = oo.uni;
        z != null ? Vi && Yi && (Vi = T >= z, Yi = R >= z, !Vi && !Yi && (R > T ? Yi = !0 : Vi = !0)) : oo.x && oo.y && (Vi || Yi) && (Vi = Yi = !0);
        let W, Z;
        Vi && (M.ori == 0 ? (W = jl, Z = fi) : (W = eu, Z = li), iu(aa(W, Z), so(Z - W)), Yi || il(0, S)), Yi && (M.ori == 1 ? (W = jl, Z = fi) : (W = eu, Z = li), il(aa(W, Z), so(Z - W)), Vi || iu(0, x)), !Vi && !Yi && (iu(0, 0), il(0, 0));
      }
    if (oo._x = Vi, oo._y = Yi, X == null) {
      if (xe) {
        if (Od != null) {
          let [T, R] = Di.scales;
          Di.values[0] = T != null ? Yr(M.ori == 0 ? fi : li, T) : null, Di.values[1] = R != null ? Yr(M.ori == 1 ? fi : li, R) : null;
        }
        Uu(mT, i, fi, li, Qe, Pe, Se);
      }
      if (Ri) {
        let T = xe && Di.setSeries, R = di.prox;
        ql == null ? wi <= R && qr(nl, nu, !0, T) : wi > R ? qr(null, nu, !0, T) : nl != ql && qr(nl, nu, !0, T);
      }
    }
    It && (K.idx = Se, ou()), oe !== !1 && Ei("setCursor");
  }
  let Sa = null;
  Object.defineProperty(i, "rect", {
    get() {
      return Sa == null && ru(!1), Sa;
    }
  });
  function ru(X = !1) {
    X ? Sa = null : (Sa = g.getBoundingClientRect(), Ei("syncRect", Sa));
  }
  function au(X, oe, xe, Se, Ie, x, S) {
    bt._lock || Oa && X != null && X.movementX == 0 && X.movementY == 0 || (xh(X, oe, xe, Se, Ie, x, S, !1, X != null), X != null ? ol(null, !0, !0) : ol(oe, !0, !1));
  }
  function xh(X, oe, xe, Se, Ie, x, S, T, R) {
    if (Sa == null && ru(!1), Xn(X), X != null)
      xe = X.clientX - Sa.left, Se = X.clientY - Sa.top;
    else {
      if (xe < 0 || Se < 0) {
        fi = -10, li = -10;
        return;
      }
      let [z, W] = Di.scales, Z = oe.cursor.sync, [ne, pe] = Z.values, [we, ge] = Z.scales, [Ee, Me] = Di.match, Xe = oe.axes[0].side % 2 == 1, Je = M.ori == 0 ? Qe : Pe, it = M.ori == 1 ? Qe : Pe, ct = Xe ? x : Ie, ft = Xe ? Ie : x, $t = Xe ? Se : xe, Wt = Xe ? xe : Se;
      if (we != null ? xe = Ee(z, we) ? s(ne, C[z], Je, 0) : -10 : xe = Je * ($t / ct), ge != null ? Se = Me(W, ge) ? s(pe, C[W], it, 0) : -10 : Se = it * (Wt / ft), M.ori == 1) {
        let ln = xe;
        xe = Se, Se = ln;
      }
    }
    R && ((xe <= 1 || xe >= Qe - 1) && (xe = uc(xe, Qe)), (Se <= 1 || Se >= Pe - 1) && (Se = uc(Se, Pe))), T ? (Ng = xe, bh = Se, [jl, eu] = bt.move(i, xe, Se)) : (fi = xe, li = Se);
  }
  const Oh = {
    width: 0,
    height: 0,
    left: 0,
    top: 0
  };
  function yd() {
    vd(Oh, !1);
  }
  let Vg, Qg, Hg, bd;
  function Wg(X, oe, xe, Se, Ie, x, S) {
    Oa = !0, Vi = Yi = oo._x = oo._y = !1, xh(X, oe, xe, Se, Ie, x, S, !0, !1), X != null && (Ne(Tb, Mx, Zu, !1), Uu(vT, i, jl, eu, Qe, Pe, null));
    let { left: T, top: R, width: z, height: W } = si;
    Vg = T, Qg = R, Hg = z, bd = W, yd();
  }
  function Zu(X, oe, xe, Se, Ie, x, S) {
    Oa = oo._x = oo._y = !1, xh(X, oe, xe, Se, Ie, x, S, !1, !0);
    let { left: T, top: R, width: z, height: W } = si, Z = z > 0 || W > 0, ne = Vg != T || Qg != R || Hg != z || bd != W;
    if (Z && ne && vd(si), oo.setScale && Z && ne) {
      let pe = T, we = z, ge = R, Ee = W;
      if (M.ori == 1 && (pe = R, we = W, ge = T, Ee = z), Vi && ko(
        O,
        Yr(pe, O),
        Yr(pe + we, O)
      ), Yi)
        for (let Me in C) {
          let Xe = C[Me];
          Me != O && Xe.from == null && Xe.min != In && ko(
            Me,
            Yr(ge + Ee, Me),
            Yr(ge, Me)
          );
        }
      yd();
    } else bt.lock && (bt._lock = !bt._lock, ol(null, !0, !1));
    X != null && (Fe(Tb, Mx), Uu(Tb, i, fi, li, Qe, Pe, null));
  }
  function fb(X, oe, xe, Se, Ie, x, S) {
    if (bt._lock)
      return;
    Xn(X);
    let T = Oa;
    if (Oa) {
      let R = !0, z = !0, W = 10, Z, ne;
      M.ori == 0 ? (Z = Vi, ne = Yi) : (Z = Yi, ne = Vi), Z && ne && (R = fi <= W || fi >= Qe - W, z = li <= W || li >= Pe - W), Z && R && (fi = fi < jl ? 0 : Qe), ne && z && (li = li < eu ? 0 : Pe), ol(null, !0, !0), Oa = !1;
    }
    fi = -10, li = -10, ol(null, !0, !0), T && (Oa = T);
  }
  function xd(X, oe, xe, Se, Ie, x, S) {
    bt._lock || (Xn(X), Fl(), yd(), X != null && Uu(xT, i, fi, li, Qe, Pe, null));
  }
  function jg() {
    $.forEach(PW), _t(i.width, i.height, !0);
  }
  Ac(Nv, rf, jg);
  const lu = {};
  lu.mousedown = Wg, lu.mousemove = au, lu.mouseup = Zu, lu.dblclick = xd, lu.setSeries = (X, oe, xe, Se) => {
    let Ie = Di.match[2];
    xe = Ie(i, oe, xe), xe != -1 && qr(xe, Se, !0, !1);
  }, bt.show && (Ne(vT, g, Wg), Ne(mT, g, au), Ne(yT, g, (X) => {
    Xn(X), ru(!1);
  }), Ne(bT, g, fb), Ne(xT, g, xd), Fx.add(i), i.syncRect = ru);
  const Gu = i.hooks = t.hooks || {};
  function Ei(X, oe, xe) {
    md ? Us.push([X, oe, xe]) : X in Gu && Gu[X].forEach((Se) => {
      Se.call(null, i, oe, xe);
    });
  }
  (t.plugins || []).forEach((X) => {
    for (let oe in X.hooks)
      Gu[oe] = (Gu[oe] || []).concat(X.hooks[oe]);
  });
  const wa = (X, oe, xe) => xe, Di = to({
    key: null,
    setSeries: !1,
    filters: {
      pub: IT,
      sub: IT
    },
    scales: [O, w[1] ? w[1].scale : null],
    match: [MT, MT, wa],
    values: [null, null]
  }, bt.sync);
  Di.match.length == 2 && Di.match.push(wa), bt.sync = Di;
  const Od = Di.key, Sh = cD(Od);
  function Uu(X, oe, xe, Se, Ie, x, S) {
    Di.filters.pub(X, oe, xe, Se, Ie, x, S) && Sh.pub(X, oe, xe, Se, Ie, x, S);
  }
  Sh.sub(i);
  function hb(X, oe, xe, Se, Ie, x, S) {
    Di.filters.sub(X, oe, xe, Se, Ie, x, S) && lu[X](null, oe, xe, Se, Ie, x, S);
  }
  i.pub = hb;
  function pb() {
    Sh.unsub(i), Fx.delete(i), Ye.clear(), Dx(Nv, rf, jg), c.remove(), ae?.remove(), Ei("destroy");
  }
  i.destroy = pb;
  function wh() {
    Ei("init", t, e), $o(e || t.data, !1), B[O] ? vh(O, B[O]) : Fl(), Et = si.show && (si.width > 0 || si.height > 0), gt = It = !0, _t(t.width, t.height);
  }
  return w.forEach(Oi), $.forEach(Bt), n ? n instanceof HTMLElement ? (n.appendChild(c), wh()) : n(i, wh) : wh(), i;
}
Ji.assign = to;
Ji.fmtNum = Yw;
Ji.rangeNum = Lv;
Ji.rangeLog = X0;
Ji.rangeAsinh = jw;
Ji.orient = id;
Ji.pxRatio = Jn;
Ji.join = b9;
Ji.fmtDate = Xw, Ji.tzDate = _9;
Ji.sync = cD;
{
  Ji.addGap = fW, Ji.clipGaps = U0;
  let t = Ji.paths = {
    points: mD
  };
  t.linear = yD, t.stepped = gW, t.bars = mW, t.spline = yW;
}
function EW(t, e) {
  if (!t || t.length === 0)
    return [null, null];
  let n = null, i = null;
  for (const { thresholdValue: o } of t)
    o !== void 0 && ((n === null || o < n) && (n = o), (i === null || o > i) && (i = o));
  return [n, i];
}
function _W({
  distr: t,
  logBase: e,
  limits: n
}) {
  if (t !== Mc.Logarithmic)
    return n;
  const i = e === 2 ? Math.log2 : Math.log10;
  return {
    min: Ug(n.min, e, i, Math.floor),
    max: Ug(n.max, e, i, Math.ceil),
    softMin: Ug(n.softMin, e, i, Math.floor),
    softMax: Ug(n.softMax, e, i, Math.ceil)
  };
}
function Ug(t, e, n, i) {
  return t == null || t <= 0 ? t : e ** i(n(t));
}
function IW({
  time: t,
  distr: e,
  logBase: n
}) {
  if (t)
    return {};
  const i = (n ?? 10) === 2 ? 2 : 10;
  return {
    distr: e === Mc.Logarithmic ? 3 : e === Mc.Symlog ? 2 : 1,
    log: i
  };
}
function MW(t, e, n, i, o, r) {
  const a = n == null ? 3 : 1, l = i == null ? 3 : 1, s = {
    min: {
      pad: o,
      hard: t ?? -1 / 0,
      soft: n !== null ? n : void 0,
      mode: a
    },
    max: {
      pad: r,
      hard: e ?? 1 / 0,
      soft: i !== null ? i : void 0,
      mode: l
    }
  }, u = n == null && t != null, c = i == null && e != null;
  return { rangeConfig: s, hardMinOnly: u, hardMaxOnly: c, hasFixedRange: u && c };
}
function AW(t, e, n) {
  return !n && t == null && e == null ? null : [t, e];
}
function RW(t, e, n, i) {
  const { rangeConfig: o, hardMinOnly: r, hardMaxOnly: a, min: l, max: s } = e, u = r ? l : n, c = a ? s : i;
  return u == null || c == null ? t : Ji.rangeNum(u, c, o);
}
function DW(t, e, n, i, o) {
  const r = e.min ?? n, a = e.max ?? i;
  return r == null || a == null ? t : Ji.rangeLog(r, a, o ?? 10, !0);
}
function NW(t, e, n) {
  let [i, o] = t;
  return i != null && (i = e ** Math.floor(n(i))), o != null && (o = e ** Math.ceil(n(o)), i === o && (o *= e)), [i, o];
}
function LW(t, e, n) {
  if (n !== 1)
    return t;
  let [i, o] = t;
  return e.hardMinOnly && e.min != null && (i = e.min), e.hardMaxOnly && e.max != null && (o = e.max), [i, o];
}
function zW(t, e) {
  const [n, i] = t;
  return n != null && i != null && n >= i ? [e === 3 ? 1 : 0, 100] : t;
}
function BW(t) {
  return (e, n, i, o) => {
    const r = e.scales[o], a = AW(n, i, t.hasFixedRange);
    if (!a)
      return [n, i];
    let l = a;
    const s = r.log;
    if (r.distr === 1)
      l = RW(l, t, n, i);
    else if (r.distr === 3) {
      l = DW(l, t, n, i, s);
      const u = r.log === 2 ? Math.log2 : Math.log10;
      l = NW(l, s ?? 10, u);
    }
    return l = LW(l, t, r.distr ?? 1), zW(l, r.distr ?? 1);
  };
}
function FW(t, e, n, i) {
  if (!n || n.length === 0)
    return { softMin: t, softMax: e };
  const [o, r] = EW(n);
  if (o === null && r === null)
    return { softMin: t, softMax: e };
  const a = o !== null ? t !== null ? Math.min(t, o) : o : t, l = r !== null ? e !== null ? Math.max(e, r) : r : e;
  return { softMin: a, softMax: l };
}
class VW extends K0 {
  softMin;
  softMax;
  min;
  max;
  constructor(e) {
    super(e);
    const n = e.softMin === 0 && e.softMax === 0;
    this.softMin = n ? null : e.softMin ?? null, this.softMax = n ? null : e.softMax ?? null, this.min = e.min ?? null, this.max = e.max ?? null;
  }
  getConfig() {
    const {
      scaleKey: e,
      time: n,
      range: i,
      thresholds: o,
      logBase: r = 10,
      padMinBy: a = 0,
      padMaxBy: l = 0.05
    } = this.props;
    if (n) {
      if (this.min != null && this.max != null) {
        const E = this.min;
        let _ = this.max;
        const D = new Date(_ * 1e3);
        return D.setSeconds(0), D.setMilliseconds(0), _ = Math.floor(D.getTime() / 1e3) + 60, { [e]: { time: !0, auto: !1, range: [E, _] } };
      }
      return { [e]: { time: !0, auto: !0 } };
    }
    const s = this.props.distribution, u = o?.thresholds, { softMin: c, softMax: d } = FW(
      this.softMin,
      this.softMax,
      u,
      o?.yAxisUnit
    ), { min: f, max: h, softMin: p, softMax: g } = _W({
      distr: s,
      logBase: r,
      limits: {
        min: this.min,
        max: this.max,
        softMin: c,
        softMax: d
      }
    }), m = IW({ time: n, distr: s, logBase: r }), { rangeConfig: y, hardMinOnly: b, hardMaxOnly: w, hasFixedRange: $ } = MW(
      f,
      h,
      p,
      g,
      a,
      l
    ), C = BW({
      rangeConfig: y,
      hardMinOnly: b,
      hardMaxOnly: w,
      hasFixedRange: $,
      min: f,
      max: h
    });
    let P = this.props.auto;
    return P ??= !n && !$, {
      [e]: {
        time: n,
        auto: P,
        range: i ?? C,
        ...m
      }
    };
  }
  merge(e) {
    this.props = { ...this.props, ...e }, e.softMin !== void 0 && (this.softMin = e.softMin ?? null), e.softMax !== void 0 && (this.softMax = e.softMax ?? null), e.min !== void 0 && (this.min = e.min ?? null), e.max !== void 0 && (this.max = e.max ?? null);
  }
}
const Mb = {};
let eP = 0;
const tP = [
  "#4096ff",
  "#52c41a",
  "#faad14",
  "#ff4d4f",
  "#722ed1",
  "#13c2c2",
  "#eb2f96",
  "#fa8c16",
  "#a0d911",
  "#1677ff"
];
function QW(t) {
  if (Mb[t])
    return Mb[t];
  const e = tP[eP % tP.length];
  return eP++, Mb[t] = e, e;
}
const nP = {
  white: "#ffffff",
  black: "#000000"
};
function HW(t, e, n, i = 100) {
  const o = t.ctx.createLinearGradient(0, 0, 0, t.bbox.height), r = Math.round(i / 100 * 112).toString(16).padStart(2, "0"), a = Math.round(i / 100 * 64).toString(16).padStart(2, "0");
  return o.addColorStop(0, `${e}${r}`), o.addColorStop(0.6, `${e}${a}`), o.addColorStop(1, n), o;
}
function WW(t, e) {
  for (let n = 1; n < 100; n++) {
    if (t[e + n] != null)
      return e + n;
    if (t[e - n] != null)
      return e - n;
  }
  return e;
}
function jW(t, e, n) {
  const i = [];
  for (let o = 0; o < t.length; o++) {
    const r = t[o + 1];
    if (r && t[o][1] === r[0]) {
      const a = n.posToIdx(t[o][1], !0);
      i.push(e[a] == null ? WW(e, a) : a);
    }
  }
  return i;
}
function qW(t, e, n, i) {
  if (n || !i || i.length === 0)
    return null;
  const o = t.series[e].idxs;
  if (!o)
    return null;
  const [r, a] = o, l = t.data[0], s = t.data[e], u = Math.round(t.valToPos(l[r], "x", !0)), c = Math.round(t.valToPos(l[a], "x", !0)), d = [];
  return i[0][0] === u && d.push(r), d.push(...jW(i, s, t)), i[i.length - 1][1] === c && d.push(a), d.length ? d : null;
}
const iP = 2, YW = 2.5;
let Xo = null;
class KW extends K0 {
  constructor(e) {
    if (super(e), !Xo) {
      const n = Ji.paths, i = n.linear, o = n.spline, r = n.stepped;
      if (!i || !o || !r)
        throw new Error("Required uPlot path builders are not available");
      Xo = {
        linear: i(),
        spline: o(),
        stepBefore: r({ align: -1 }),
        stepAfter: r({ align: 1 })
      };
    }
  }
  getLineColor() {
    const { colorMapping: e, lineColor: n, label: i, isDarkMode: o } = this.props;
    return i ? n ?? e?.[i] ?? QW(i) : n ?? (o ? nP.white : nP.black);
  }
  buildLineConfig({ resolvedLineColor: e }) {
    const { lineWidth: n, lineStyle: i, lineCap: o, fillColor: r, fillMode: a, fillOpacity: l } = this.props, s = {
      stroke: e,
      width: n ?? iP
    }, u = l != null && l > 0 ? Math.round(Math.min(l, 100) / 100 * 255).toString(16).padStart(2, "0") : null;
    i === Ix.Dashed && (s.dash = [10, 10]), i === Ix.Dotted && (s.dash = [2, 6]), o && (s.cap = o);
    const c = r ?? e;
    return this.props.drawStyle === bl.Bars ? s.fill = u ? `${c}${u}` : c : this.props.drawStyle === bl.Histogram ? s.fill = `${c}${u ?? "40"}` : a && a !== tp.None ? a === tp.Solid ? s.fill = u ? `${c}${u}` : c : a === tp.Gradient && (s.fill = (d) => HW(d, c, "rgba(0, 0, 0, 0)", l ?? 100)) : u && (s.fill = `${c}${u}`), s;
  }
  buildPathConfig() {
    const {
      pathBuilder: e,
      drawStyle: n,
      lineInterpolation: i,
      barAlignment: o,
      barMaxWidth: r,
      barWidthFactor: a,
      stepInterval: l
    } = this.props;
    return e ? { paths: e } : n === bl.Points ? { paths: () => null } : n != null ? {
      paths: (s, u, c, d) => XW({
        drawStyle: n,
        lineInterpolation: i,
        barAlignment: o,
        barMaxWidth: r,
        barWidthFactor: a,
        stepInterval: l
      })(s, u, c, d)
    } : {};
  }
  resolvePointsShow() {
    const { pointsBuilder: e, drawStyle: n, showPoints: i } = this.props;
    return e || (n === bl.Points ? !0 : !!i);
  }
  shouldApplyIsolatedPointFilter(e) {
    const { drawStyle: n, pointsFilter: i } = this.props;
    return n === bl.Lines && !i && !e;
  }
  buildPointsConfig({ resolvedLineColor: e }) {
    const { lineWidth: n, pointSize: i, pointsFilter: o } = this.props, r = i ?? (n ?? iP) * YW, a = {
      stroke: e,
      fill: e,
      size: r,
      filter: o || void 0,
      show: this.resolvePointsShow()
    };
    return this.shouldApplyIsolatedPointFilter(a.show) && (a.filter = qW), a;
  }
  getConfig() {
    const { scaleKey: e, label: n, spanGaps: i, show: o = !0, metric: r } = this.props, a = this.getLineColor(), l = this.buildLineConfig({ resolvedLineColor: a }), s = this.buildPathConfig(), u = this.buildPointsConfig({ resolvedLineColor: a });
    return {
      scale: e,
      label: n,
      spanGaps: typeof i == "number" ? !1 : i ?? !0,
      value: () => "",
      pxAlign: !0,
      show: o,
      metric: r,
      ...l,
      ...s,
      points: Object.keys(u).length > 0 ? u : void 0
    };
  }
  merge(e) {
    this.props = { ...this.props, ...e };
  }
}
function XW({
  drawStyle: t,
  lineInterpolation: e,
  barAlignment: n = NR.Center,
  barWidthFactor: i = 0.6,
  barMaxWidth: o = 200,
  stepInterval: r
}) {
  if (!Xo)
    throw new Error("Required uPlot path builders are not available");
  if (t === bl.Bars || t === bl.Histogram) {
    const a = Ji.paths;
    return ZW({ pathBuilders: a, barAlignment: n, barWidthFactor: i, barMaxWidth: o, stepInterval: r });
  }
  if (t === bl.Lines) {
    if (e === tv.StepBefore)
      return Xo.stepBefore;
    if (e === tv.StepAfter)
      return Xo.stepAfter;
    if (e === tv.Linear)
      return Xo.linear;
  }
  return Xo.spline;
}
function ZW({
  pathBuilders: t,
  barAlignment: e,
  barWidthFactor: n,
  barMaxWidth: i,
  stepInterval: o
}) {
  if (!Xo)
    throw new Error("Required uPlot path builders are not available");
  const r = t.bars;
  if (typeof o == "number" && o > 0 && r)
    return (l, s, u, c) => {
      let d = i;
      const f = BR({
        uPlotInstance: l,
        stepInterval: o
      });
      f > 0 && (d = Math.min(d, f));
      const h = `bars|${e}|${n}|${d}`;
      return Xo && !Xo[h] && (Xo[h] = r({
        size: [n, d],
        align: e
      })), Xo?.[h]?.(l, s, u, c) ?? null;
    };
  const a = `bars|${e}|${n}|${i}`;
  return !Xo[a] && r && (Xo[a] = r({
    size: [n, i],
    align: e
  })), Xo[a];
}
class SD extends K0 {
  series = [];
  selectionPreferencesSource = _x.IN_MEMORY;
  shouldSaveSelectionPreference = !1;
  axes = {};
  stepInterval;
  scales = [];
  bands = [];
  cursor;
  hooks = {};
  plugins = [];
  padding;
  legend;
  focus;
  select;
  thresholds = {};
  tzDate;
  id;
  onDragSelect;
  constructor(e) {
    super(e);
    const {
      id: n,
      onDragSelect: i,
      tzDate: o,
      selectionPreferencesSource: r,
      shouldSaveSelectionPreference: a,
      stepInterval: l
    } = e ?? {};
    this.id = n, o && (this.tzDate = o), r && (this.selectionPreferencesSource = r), a && (this.shouldSaveSelectionPreference = a), l && (this.stepInterval = l), this.onDragSelect = () => {
    }, i && (this.onDragSelect = i, this.addHook("setSelect", (s) => {
      const u = s.select;
      if (u && u.width > 0) {
        const c = s.posToVal(u.left, "x"), d = s.posToVal(u.left + u.width, "x");
        this.onDragSelect(c * 1e3, d * 1e3);
      }
    }));
  }
  getShouldSaveSelectionPreference() {
    return this.shouldSaveSelectionPreference;
  }
  getId() {
    return this.id;
  }
  addAxis(e) {
    const { scaleKey: n } = e;
    if (this.axes[n]) {
      this.axes[n].merge?.(e);
      return;
    }
    this.axes[n] = new $H(e);
  }
  addScale(e) {
    const n = this.scales.find((i) => i.props.scaleKey === e.scaleKey);
    if (n) {
      n.merge?.(e);
      return;
    }
    this.scales.push(new VW(e));
  }
  addSeries(e) {
    this.series.push(new KW(e));
  }
  getSeriesSpanGapsOptions() {
    return this.series.map((e) => {
      const { spanGaps: n } = e.props;
      return { spanGaps: n };
    });
  }
  addHook(e, n) {
    return this.hooks[e] || (this.hooks[e] = []), this.hooks[e].push(n), () => {
      const i = this.hooks[e].indexOf(n);
      i !== -1 && this.hooks[e].splice(i, 1);
    };
  }
  addPlugin(e) {
    this.plugins.push(e);
  }
  addThresholds(e) {
    this.thresholds[e.scaleKey] || (this.thresholds[e.scaleKey] = e, this.addHook("draw", IH(e)));
  }
  setBands(e) {
    this.bands = e;
  }
  setCursor(e) {
    this.cursor = Zk({}, this.cursor, e);
  }
  setPadding(e) {
    this.padding = e;
  }
  setLegend(e) {
    this.legend = e;
  }
  setFocus(e) {
    this.focus = e;
  }
  setSelect(e) {
    this.select = e;
  }
  setTzDate(e) {
    this.tzDate = e;
  }
  getCursorConfig() {
    const e = {
      ...$b,
      hover: {
        ...$b.hover,
        prox: this.stepInterval ? (n) => BR({
          uPlotInstance: n,
          stepInterval: this.stepInterval ?? 0
        }) * PH : LR
      }
    };
    return Zk({}, $b, e, this.cursor);
  }
  getStoredVisibility() {
    return this.id && this.selectionPreferencesSource === _x.LOCAL_STORAGE ? MH(this.id) : null;
  }
  getVisibilityResolutionState() {
    const e = this.getStoredVisibility();
    if (!e || e.length === 0)
      return {
        visibleStoredLabels: /* @__PURE__ */ new Set(),
        hiddenStoredLabels: /* @__PURE__ */ new Set(),
        hasActivePreference: !1
      };
    const n = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
    let o = !1, r = !1;
    for (const { label: d, show: f } of e)
      f ? (o = !0, n.add(d), i.has(d) && i.delete(d)) : (r = !0, n.has(d) || i.add(d));
    const a = o && r, l = this.series.map(
      (d) => d.getConfig().label ?? ""
    ), s = n.size > 0 && l.some((d) => n.has(d)), u = a && s;
    return !a || u ? { visibleStoredLabels: n, hiddenStoredLabels: i, hasActivePreference: u } : {
      visibleStoredLabels: /* @__PURE__ */ new Set(),
      hiddenStoredLabels: /* @__PURE__ */ new Set(),
      hasActivePreference: u
    };
  }
  getLegendItems() {
    const { visibleStoredLabels: e, hiddenStoredLabels: n, hasActivePreference: i } = this.getVisibilityResolutionState();
    return this.series.reduce(
      (o, r, a) => {
        const l = r.getConfig(), s = l.label ?? "", u = a + 1, c = fT({
          seriesShow: l.show,
          seriesLabel: s,
          visibleStoredLabels: e,
          hiddenStoredLabels: n,
          hasActivePreference: i
        });
        return o[u] = {
          seriesIndex: u,
          color: l.stroke ?? "#ccc",
          label: s,
          show: c,
          yAxis: 1
        }, o;
      },
      {}
    );
  }
  getConfig() {
    const e = { ...EH }, { visibleStoredLabels: n, hiddenStoredLabels: i, hasActivePreference: o } = this.getVisibilityResolutionState();
    return e.series = [
      { value: () => "", label: "Timestamp" },
      ...this.series.map((r) => {
        const a = r.getConfig(), l = fT({
          seriesShow: a.show,
          seriesLabel: a.label ?? "",
          visibleStoredLabels: n,
          hiddenStoredLabels: i,
          hasActivePreference: o
        });
        return { ...a, show: l };
      })
    ], e.axes = Object.values(this.axes).map((r) => r.getConfig()), e.scales = this.scales.reduce(
      (r, a) => ({ ...r, ...a.getConfig() }),
      {}
    ), e.hooks = this.hooks, e.select = this.select, e.cursor = this.getCursorConfig(), e.tzDate = this.tzDate, e.plugins = this.plugins.length > 0 ? this.plugins : void 0, e.bands = this.bands.length > 0 ? this.bands : void 0, Array.isArray(this.padding) && (e.padding = this.padding), this.legend && (e.legend = this.legend), this.focus && (e.focus = this.focus), e;
  }
}
function oP(t, e) {
  return e.some(
    ({ spanGaps: n }) => typeof n == "number" && n > 0 && t > n
  );
}
function GW(t, e) {
  const n = JSON.parse(JSON.stringify(t)), [i, ...o] = n;
  if (!Array.isArray(i) || i.length < 2 || o.length === 0)
    return n;
  const r = i, a = r.length;
  let l = 0;
  for (let f = 0; f < a - 1; f += 1)
    oP(r[f + 1] - r[f], e) && (l += 1);
  if (l === 0)
    return t;
  const s = a + l, u = Array.from({ length: s }), c = o.map(
    () => Array.from({ length: s })
  );
  let d = 0;
  for (let f = 0; f < a; f += 1) {
    u[d] = r[f];
    for (const [h, p] of o.entries())
      c[h][d] = p[f];
    if (d += 1, f < a - 1 && oP(r[f + 1] - r[f], e)) {
      u[d] = r[f] + Math.max(1, Math.floor((r[f + 1] - r[f]) / 2));
      for (let h = 0; h < o.length; h += 1)
        c[h][d] = null;
      d += 1;
    }
  }
  return [u, ...c];
}
function UW(t, e) {
  const n = JSON.parse(JSON.stringify(t)), [i, ...o] = n;
  if (!Array.isArray(i) || o.length === 0)
    return n;
  const a = e.some(({ spanGaps: d }) => typeof d == "number") ? GW(n, e) : n;
  if (!e.some(({ spanGaps: d }) => d === !0))
    return a;
  const [s, ...u] = a, c = u.map((d, f) => {
    const { spanGaps: h } = e[f] ?? {};
    return h !== !0 ? d : d.map(
      (p) => p === null ? void 0 : p
    );
  });
  return [s, ...c];
}
const wD = /\{\{(\w+)(?::(\w+))?\}\}/g;
function JW(t, e) {
  if (typeof t == "number")
    return String(t);
  const n = Array.isArray(t) ? t : [t];
  switch (e) {
    case "csv":
      return n.join(",");
    case "sql":
      return n.map((i) => `'${i.replaceAll("'", "''")}'`).join(",");
    case "pipe":
      return n.join("|");
    case "single":
    default:
      return n[0] ?? "";
  }
}
function Cd(t, e) {
  return t.replaceAll(wD, (n, i, o) => {
    const r = e[i];
    return r == null ? n : JW(r, o || "single");
  });
}
function ej(t) {
  const e = /* @__PURE__ */ new Set();
  let n;
  const i = new RegExp(wD.source, "g");
  for (; (n = i.exec(t)) !== null; )
    e.add(n[1]);
  return Array.from(e);
}
class tj {
  nodes = /* @__PURE__ */ new Map();
  ensureNode(e) {
    return this.nodes.has(e) || this.nodes.set(e, { name: e, dependsOn: [], dependents: [] }), this.nodes.get(e);
  }
  addVariable(e) {
    const n = e.name, i = this.ensureNode(n);
    for (const o of i.dependsOn) {
      const r = this.nodes.get(o);
      r && (r.dependents = r.dependents.filter((a) => a !== n));
    }
    i.dependsOn = [], e.query && (i.dependsOn = ej(e.query));
    for (const o of i.dependsOn)
      this.ensureNode(o).dependents.push(n);
  }
  removeVariable(e) {
    const n = this.nodes.get(e);
    if (n) {
      for (const i of n.dependsOn) {
        const o = this.nodes.get(i);
        o && (o.dependents = o.dependents.filter((r) => r !== e));
      }
      for (const i of n.dependents) {
        const o = this.nodes.get(i);
        o && (o.dependsOn = o.dependsOn.filter((r) => r !== e));
      }
      this.nodes.delete(e);
    }
  }
  getDependents(e) {
    return this.nodes.get(e)?.dependents ?? [];
  }
  getAllDependents(e) {
    const n = /* @__PURE__ */ new Set(), i = [], o = (r) => {
      if (n.has(r))
        return;
      n.add(r);
      const a = this.getDependents(r);
      for (const l of a)
        i.push(l), o(l);
    };
    return o(e), i;
  }
  detectCycle() {
    const o = /* @__PURE__ */ new Map(), r = [];
    for (const l of this.nodes.keys())
      o.set(l, 0);
    const a = (l) => {
      o.set(l, 1);
      const s = this.nodes.get(l);
      if (s)
        for (const u of s.dependsOn) {
          const c = o.get(u);
          if (c === 1)
            return r.push(u, l), !0;
          if (c === 0 && a(u))
            return r.push(l), !0;
        }
      return o.set(l, 2), !1;
    };
    for (const l of this.nodes.keys())
      if (o.get(l) === 0 && a(l))
        return r.reverse();
    return null;
  }
  topologicalSort() {
    const e = /* @__PURE__ */ new Set(), n = [], i = (o) => {
      if (e.has(o))
        return;
      e.add(o);
      const r = this.nodes.get(o);
      if (r)
        for (const a of r.dependsOn)
          i(a);
      n.push(o);
    };
    for (const o of this.nodes.keys())
      i(o);
    return n;
  }
  clear() {
    this.nodes.clear();
  }
}
function nj(t, e, n, i) {
  const o = /* @__PURE__ */ new Map();
  for (const l of t) {
    const s = Number(l.clock), u = Math.round(s / i) * i, c = Number.parseFloat(l.value);
    o.set(u, Number.isNaN(c) ? null : c);
  }
  const r = [], a = Math.ceil(e / i) * i;
  for (let l = a; l <= n; l += i)
    r.push({ ts: l * 1e3, value: o.get(l) ?? null });
  return r;
}
function ij(t, e) {
  return t.map((n) => n === null ? null : n * e);
}
function oj(t, e) {
  return t.map((n) => n === null ? null : n + e);
}
function rj(t) {
  return t.map((e, n) => {
    if (n === 0)
      return 0;
    const i = t[n - 1];
    return e === null || i === null ? null : e - i;
  });
}
function aj(t, e) {
  return t.map((n, i) => {
    if (i === 0)
      return 0;
    const o = t[i - 1];
    if (n === null || o === null)
      return null;
    const r = e[i] - e[i - 1];
    return r > 0 ? (n - o) / r : 0;
  });
}
function lj(t, e) {
  return t.map((n, i) => {
    const o = Math.max(0, i - e + 1), r = t.slice(o, i + 1).filter((a) => a !== null);
    return r.length === 0 ? null : r.reduce((a, l) => a + l, 0) / r.length;
  });
}
function sj(t, e) {
  const n = [];
  let i = null;
  for (const o of t)
    if (o === null)
      n.push(null);
    else if (i === null)
      n.push(o), i = o;
    else {
      const r = e * o + (1 - e) * i;
      n.push(r), i = r;
    }
  return n;
}
function uj(t, e) {
  return t.map((n) => n !== null && n > e ? Number.NaN : n);
}
function cj(t, e) {
  return t.map((n) => n !== null && n < e ? Number.NaN : n);
}
function dj(t, e) {
  return t.map((n) => n === null || Number.isNaN(n) ? e : n);
}
function fj(t) {
  if (t.length === 0)
    return t;
  const e = t[0].values.length;
  return [{ label: "sumSeries", values: Array.from({ length: e }, (i, o) => t.every((a) => a.values[o] === null) ? null : t.reduce((a, l) => a + (l.values[o] ?? 0), 0)) }];
}
function hj(t, e, n) {
  return t.map((o) => {
    const r = o.values.filter((l) => l !== null && !Number.isNaN(l));
    let a = 0;
    return n === "max" ? a = r.reduce((l, s) => Math.max(l, s), -1 / 0) : n === "min" ? a = r.reduce((l, s) => Math.min(l, s), 1 / 0) : a = r.reduce((l, s) => l + s, 0) / (r.length || 1), { s: o, score: a };
  }).sort((o, r) => r.score - o.score).slice(0, e).map((o) => o.s);
}
function pj(t, e, n) {
  return t.map((o) => {
    const r = o.values.filter((l) => l !== null && !Number.isNaN(l));
    let a = 0;
    return n === "max" ? a = r.reduce((l, s) => Math.max(l, s), -1 / 0) : n === "min" ? a = r.reduce((l, s) => Math.min(l, s), 1 / 0) : a = r.reduce((l, s) => l + s, 0) / (r.length || 1), { s: o, score: a };
  }).sort((o, r) => o.score - r.score).slice(0, e).map((o) => o.s);
}
function gj(t, e) {
  if (!e || e.length === 0)
    return t;
  const { timestamps: n, series: i } = t;
  let o = i;
  for (const r of e) {
    const a = r.def.name, l = r.params;
    switch (a) {
      case "scale":
        o = o.map((s) => ({ ...s, values: ij(s.values, Number(l[0])) }));
        break;
      case "offset":
        o = o.map((s) => ({ ...s, values: oj(s.values, Number(l[0])) }));
        break;
      case "delta":
        o = o.map((s) => ({ ...s, values: rj(s.values) }));
        break;
      case "rate":
        o = o.map((s) => ({ ...s, values: aj(s.values, n) }));
        break;
      case "movingAverage":
        o = o.map((s) => ({ ...s, values: lj(s.values, Number(l[0])) }));
        break;
      case "exponentialMovingAverage":
        o = o.map((s) => ({ ...s, values: sj(s.values, Number(l[0])) }));
        break;
      case "removeAboveValue":
        o = o.map((s) => ({ ...s, values: uj(s.values, Number(l[0])) }));
        break;
      case "removeBelowValue":
        o = o.map((s) => ({ ...s, values: cj(s.values, Number(l[0])) }));
        break;
      case "transformNull":
        o = o.map((s) => ({ ...s, values: dj(s.values, Number(l[0])) }));
        break;
      case "sumSeries":
        o = fj(o);
        break;
      case "top":
        o = hj(o, Number(l[0]), String(l[1] ?? "avg"));
        break;
      case "bottom":
        o = pj(o, Number(l[0]), String(l[1] ?? "avg"));
        break;
      case "setAlias":
        o = o.map((s) => ({ ...s, label: String(l[0] ?? "") }));
        break;
      case "replaceAlias":
        o = o.map((s) => ({ ...s, label: s.label.replace(new RegExp(String(l[0] ?? "")), String(l[1] ?? "")) }));
        break;
    }
  }
  return { timestamps: n, series: o };
}
function mj(t, e, n, i) {
  const o = e[0], r = (t.get(o?.itemid ?? "") ?? []).map((l) => l.ts), a = new DQ({ name: "zabbix", refId: i, fields: [] });
  a.addField({ name: "Time", type: Hi.time, values: r });
  for (const l of e) {
    const u = (t.get(l.itemid) ?? []).map((d) => d.value), c = l.valuemapid ? n.get(l.valuemapid) : void 0;
    a.addField({
      name: l.name.replace(/^[\s:]+/, "").trim(),
      type: Hi.number,
      values: u,
      labels: { host: l.hostid, item_key: l.key_ },
      config: {
        unit: l.units || void 0,
        displayNameFromDS: l.name.replace(/^[\s:]+/, "").trim(),
        ...c ? {
          mappings: [{
            type: 1,
            // MappingType.ValueToText
            options: Object.fromEntries(
              Object.entries(c).map(([d, f], h) => [d, { text: f, index: h }])
            )
          }]
        } : {}
      }
    });
  }
  return a;
}
let vj = 1;
async function ha(t, e, n) {
  const { url: i, token: o } = n, r = {
    jsonrpc: "2.0",
    method: t,
    params: e,
    auth: o,
    id: vj++
  }, a = await fetch(`${i}?_m=${t}`, {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify(r)
  });
  if (!a.ok)
    throw new Error(`Zabbix API HTTP error: ${a.status}`);
  const l = await a.json();
  if (l.error)
    throw new Error(`Zabbix API error [${l.error.code}]: ${l.error.data}`);
  return l.result;
}
function yj(t) {
  return ha(
    "hostgroup.get",
    {
      output: ["groupid", "name"],
      sortfield: "name",
      limit: 200
    },
    t
  );
}
function bj(t, e, n) {
  return ha(
    "host.get",
    {
      output: ["hostid", "host", "name"],
      ...t?.length ? { groupids: t } : {},
      sortfield: "name",
      limit: 200
    },
    n
  );
}
function CD(t, e, n, i, o) {
  const r = o ? Oj(o) : void 0;
  return ha(
    "item.get",
    {
      output: ["itemid", "hostid", "name", "key_", "value_type", "units", "valuemapid"],
      selectTags: "extend",
      hostids: t,
      filter: { value_type: ["0", "3"] },
      ...r ? { tags: [r], evaltype: 0 } : {},
      sortfield: "name",
      limit: 500
    },
    i
  );
}
function xj(t, e) {
  return ha(
    "item.get",
    {
      output: ["itemid", "hostid", "name", "key_", "value_type", "units", "valuemapid"],
      itemids: t,
      sortfield: "name"
    },
    e
  );
}
function Oj(t) {
  const e = t.indexOf(":");
  return e > 0 ? { tag: t.slice(0, e).trim(), value: t.slice(e + 1).trim(), operator: 0 } : { tag: t.trim(), value: "", operator: 2 };
}
function Sj(t) {
  return t.value ? `${t.tag}: ${t.value}` : t.tag;
}
function wj(t, e, n) {
  return ha(
    "item.get",
    {
      output: ["itemid", "hostid", "name", "key_", "value_type", "units", "valuemapid"],
      hostids: t,
      filter: { value_type: ["1", "2", "4"] },
      sortfield: "name",
      limit: 500
    },
    n
  );
}
function Cj(t, e) {
  return ha(
    "usermacro.get",
    {
      output: ["hostmacroid", "macro", "value"],
      ...t?.length ? { hostids: t } : {},
      sortfield: "macro",
      limit: 200
    },
    e
  );
}
function $j(t) {
  return ha(
    "service.get",
    {
      output: ["serviceid", "name"],
      sortfield: "name",
      limit: 200
    },
    t
  );
}
async function kj(t, e, n, i) {
  return (n - e) / 86400 <= 7 ? ha(
    "history.get",
    {
      output: "extend",
      itemids: t,
      history: 0,
      time_from: e,
      time_till: n,
      sortfield: "clock",
      sortorder: "ASC",
      limit: 1e4
    },
    i
  ) : (await ha(
    "trend.get",
    {
      output: "extend",
      itemids: t,
      time_from: e,
      time_till: n,
      sortfield: "clock",
      sortorder: "ASC",
      limit: 1e4
    },
    i
  )).map((a) => ({
    itemid: a.itemid,
    clock: a.clock,
    value: a.value_avg,
    ns: "0"
  }));
}
function Tj(t) {
  return ha(
    "valuemap.get",
    {
      output: "extend",
      selectMappings: "extend"
    },
    t
  );
}
function Pj(t, e) {
  return ha(
    "discoveryrule.get",
    {
      output: ["itemid", "hostid", "name", "key_"],
      hostids: t,
      sortfield: "name",
      limit: 200
    },
    e
  );
}
function Ej(t, e) {
  return ha(
    "itemprototype.get",
    {
      output: ["itemid", "name", "key_"],
      discoveryids: [t],
      sortfield: "name"
    },
    e
  );
}
function _j(t, e) {
  const n = new Map(e.map((i) => [i, []]));
  for (const i of t)
    n.get(i.itemid)?.push(i);
  return n;
}
function Ij(t, e) {
  if (t.length === 0)
    return 0;
  switch (e) {
    case "avg":
      return t.reduce((n, i) => n + i, 0) / t.length;
    case "sum":
      return t.reduce((n, i) => n + i, 0);
    case "min":
      return t.reduce((n, i) => Math.min(n, i), 1 / 0);
    case "max":
      return t.reduce((n, i) => Math.max(n, i), -1 / 0);
    case "count":
      return t.length;
    case "median": {
      const n = [...t].sort((i, o) => i - o);
      return n[Math.floor(n.length / 2)];
    }
  }
}
function Mj(t, e, n = "avg") {
  if (t.length === 0)
    return [];
  const i = e / 1e3, o = /* @__PURE__ */ new Map();
  for (const a of t) {
    const l = Math.floor(Number(a.clock) / i) * i, s = o.get(l);
    s ? s.push(Number(a.value)) : o.set(l, [Number(a.value)]);
  }
  const r = t[0].itemid;
  return Array.from(o.entries()).sort(([a], [l]) => a - l).map(([a, l]) => ({
    itemid: r,
    clock: String(a),
    value: String(Ij(l, n)),
    ns: "0"
  }));
}
const Aj = [
  "Transform",
  "Aggregate",
  "Filter",
  "Trends",
  "Time",
  "Alias",
  "Special"
], rP = [
  // Transform
  { name: "groupBy", category: "Transform", params: [{ name: "interval", type: "string" }, { name: "function", type: "string", options: ["avg", "min", "max", "sum", "count", "median", "first", "last"] }], defaultParams: ["1m", "avg"] },
  { name: "scale", category: "Transform", params: [{ name: "factor", type: "float", options: [100, 0.01, 10, -1] }], defaultParams: [100] },
  { name: "offset", category: "Transform", params: [{ name: "delta", type: "float", options: [-100, 100] }], defaultParams: [100] },
  { name: "delta", category: "Transform", params: [], defaultParams: [] },
  { name: "rate", category: "Transform", params: [], defaultParams: [] },
  { name: "movingAverage", category: "Transform", params: [{ name: "factor", type: "int", options: [6, 10, 60, 100, 600] }], defaultParams: [10] },
  { name: "exponentialMovingAverage", category: "Transform", params: [{ name: "smoothing", type: "float", options: [6, 10, 60, 100, 600] }], defaultParams: [0.2] },
  { name: "percentile", category: "Transform", params: [{ name: "interval", type: "string" }, { name: "percent", type: "float", options: [25, 50, 75, 90, 95, 99, 99.9] }], defaultParams: ["1m", 95] },
  { name: "removeAboveValue", category: "Transform", params: [{ name: "number", type: "float" }], defaultParams: [0] },
  { name: "removeBelowValue", category: "Transform", params: [{ name: "number", type: "float" }], defaultParams: [0] },
  { name: "transformNull", category: "Transform", params: [{ name: "number", type: "float" }], defaultParams: [0] },
  // Aggregate
  { name: "aggregateBy", category: "Aggregate", params: [{ name: "interval", type: "string" }, { name: "function", type: "string", options: ["avg", "min", "max", "sum", "count", "median", "first", "last"] }], defaultParams: ["1m", "avg"] },
  { name: "sumSeries", category: "Aggregate", params: [], defaultParams: [] },
  { name: "percentileAgg", category: "Aggregate", params: [{ name: "interval", type: "string" }, { name: "percent", type: "float", options: [25, 50, 75, 90, 95, 99, 99.9] }], defaultParams: ["1m", 95] },
  // Filter
  { name: "top", category: "Filter", params: [{ name: "number", type: "int" }, { name: "value", type: "string", options: ["avg", "min", "max", "sum", "count", "median", "first", "last"] }], defaultParams: [5, "avg"] },
  { name: "bottom", category: "Filter", params: [{ name: "number", type: "int" }, { name: "value", type: "string", options: ["avg", "min", "max", "sum", "count", "median", "first", "last"] }], defaultParams: [5, "avg"] },
  { name: "sortSeries", category: "Filter", params: [{ name: "direction", type: "string", options: ["asc", "desc"] }], defaultParams: ["asc"] },
  // Trends
  { name: "trendValue", category: "Trends", params: [{ name: "type", type: "string", options: ["avg", "min", "max", "sum", "count"] }], defaultParams: ["avg"] },
  // Time
  { name: "timeShift", category: "Time", params: [{ name: "interval", type: "string", options: ["24h", "7d", "1M", "+24h", "-24h"] }], defaultParams: ["24h"] },
  // Alias
  { name: "setAlias", category: "Alias", params: [{ name: "alias", type: "string" }], defaultParams: [] },
  { name: "setAliasByRegex", category: "Alias", params: [{ name: "aliasByRegex", type: "string" }], defaultParams: [] },
  { name: "replaceAlias", category: "Alias", params: [{ name: "regexp", type: "string" }, { name: "newAlias", type: "string" }], defaultParams: ["/(.*)/", "$1"] },
  // Special
  { name: "consolidateBy", category: "Special", params: [{ name: "type", type: "string", options: ["avg", "min", "max", "sum", "count"] }], defaultParams: ["avg"] }
], Rj = /^\$(\w+)$/;
function Ab(t, e, n) {
  if (!t)
    return [];
  const i = Rj.exec(t);
  if (!i)
    return [t];
  const o = i[1], r = e[o];
  if (r == null)
    return [t];
  const a = (Array.isArray(r) ? r : [r]).map(String);
  return a.includes("$__all") ? n[o] ?? [] : a.filter(Boolean);
}
function Dj(t, e, n) {
  const i = {};
  for (const o of Object.values(n))
    i[o.config.name] = o.options.map((r) => r.value).filter((r) => r !== "$__all");
  return {
    ...t,
    hostIds: Ab(t.hostId, e, i),
    groupIds: Ab(t.groupId, e, i),
    lldRuleIds: Ab(t.lldRuleId, e, i),
    itemTagsFilter: Cd(t.itemTagsFilter ?? "", e),
    triggerFilter: Cd(t.triggerFilter ?? "", e),
    tagsFilter: Cd(t.tagsFilter ?? "", e),
    itemids: Cd(t.itemids ?? "", e),
    itServiceFilter: Cd(t.itServiceFilter ?? "", e),
    macroFilter: Cd(t.macroFilter ?? "", e)
  };
}
const $d = new tj();
function Nj(t) {
  return t.split(",").map((e) => e.trim()).filter(Boolean).map((e) => ({ value: e, label: e }));
}
function Lj(t) {
  return t.map((e) => ({ value: e.value, label: e.text || e.value }));
}
function zj(t, e, n) {
  if (e) {
    const i = t ?? n[0]?.value ?? "";
    return i ? [i] : [];
  }
  return t ?? n[0]?.value ?? "";
}
function Bj(t, e) {
  return [{ value: e || "$__all", label: "$__all" }, ...t];
}
function Fj(t, e, n) {
  switch (t.type) {
    case "custom": {
      if (t.customOptions && t.customOptions.length > 0)
        return Promise.resolve(Lj(t.customOptions));
      const i = t.customValues ?? "";
      return Promise.resolve(Nj(i));
    }
    case "query": {
      if (!e || !t.query)
        return Promise.resolve([]);
      const i = Vj(t.query, n);
      return e(i);
    }
    case "textbox": {
      const i = t.defaultValue ?? "";
      return Promise.resolve(i ? [{ value: i, label: i }] : []);
    }
    case "constant": {
      const i = t.constantValue ?? "";
      return Promise.resolve(i ? [{ value: i, label: i }] : []);
    }
    default:
      return Promise.resolve([]);
  }
}
function Vj(t, e) {
  return t.replace(/\{\{(\w+)(?::(\w+))?\}\}/g, (n, i) => {
    const o = e[i];
    return o == null ? n : Array.isArray(o) ? o.join(",") : String(o);
  });
}
const Hc = vw("variable", () => {
  const t = de({}), e = de(null);
  function n(h) {
    e.value = h;
  }
  function i(h) {
    t.value[h.id] || ($d.addVariable(h), t.value[h.id] = Bn({
      config: h,
      options: [],
      current: "",
      loading: !1,
      error: null
    }), l(h.id));
  }
  function o(h) {
    const p = t.value[h];
    p && ($d.removeVariable(p.config.name), delete t.value[h]);
  }
  function r(h, p) {
    const g = t.value[h];
    g && (g.config = { ...g.config, ...p }, ("name" in p || "query" in p) && $d.addVariable(g.config), l(h));
  }
  function a(h, p) {
    const g = t.value[h];
    g && (g.current = p);
  }
  async function l(h) {
    const p = t.value[h];
    if (p) {
      p.loading = !0, p.error = null;
      try {
        const g = u(), m = await Fj(p.config, e.value, g);
        p.options = p.config.includeAll ? Bj(m, p.config.allValue) : m;
        const y = Array.isArray(p.current) ? p.current[0] : p.current;
        (!y || !p.options.some((b) => b.value === y)) && (p.current = zj(p.config.defaultValue, p.config.multi, p.options));
      } catch (g) {
        p.error = g?.message ?? String(g);
      } finally {
        p.loading = !1;
      }
    }
  }
  async function s() {
    const h = $d.topologicalSort();
    for (const p of h) {
      const g = Object.values(t.value).find((m) => m.config.name === p);
      g && await l(g.config.id);
    }
  }
  function u() {
    const h = {};
    for (const p of Object.values(t.value)) {
      const { name: g } = p.config;
      Array.isArray(p.current) ? h[g] = p.current.length === 1 ? p.current[0] : p.current : h[g] = p.current;
    }
    return h;
  }
  function c(h) {
    return Object.values(t.value).find((p) => p.config.name === h);
  }
  function d(h) {
    return $d.getAllDependents(h);
  }
  function f() {
    return $d.detectCycle();
  }
  return {
    variables: t,
    optionsResolver: e,
    setOptionsResolver: n,
    addVariable: i,
    removeVariable: o,
    updateVariable: r,
    setValue: a,
    refreshVariable: l,
    refreshAll: s,
    resolveAll: u,
    getVariable: c,
    getDependents: d,
    detectCycle: f
  };
});
function Qj() {
  const t = Date.now();
  return { from: t - 3600 * 1e3, to: t };
}
const Nl = vw("dashboard", () => {
  const t = RR();
  console.warn("Loaded initial dashboard");
  const e = de(""), n = de(t.panels), i = de(t.layouts), o = de(!1), r = de(null), a = de(!1), l = de(Qj()), s = de(0), u = de(null), c = de(!1), d = de({});
  function f(j) {
    const B = Ex(), Y = AR(j, { id: B }), Q = i.value.reduce((V, H) => Math.max(V, H.y + H.h), 0), G = {
      i: B,
      x: 0,
      y: Q,
      w: j === "stat" || j === "gauge" ? 3 : j === "table" ? 12 : 6,
      h: j === "stat" || j === "gauge" ? 4 : j === "table" ? 10 : 8,
      minH: j === "stat" || j === "gauge" ? 3 : 6
    };
    n.value[B] = Y, i.value = [...i.value, G], r.value = B, a.value = !1, c.value = !0;
  }
  function h(j) {
    const { [j]: B, ...Y } = n.value;
    n.value = Y, i.value = i.value.filter((Q) => Q.i !== j), r.value === j && (r.value = null), c.value = !0;
  }
  function p(j) {
    const B = n.value[j];
    if (!B)
      return;
    const Y = Ex(), Q = { ...B, id: Y, title: `${B.title} (copy)` }, G = i.value.find((H) => H.i === j), V = i.value.reduce((H, q) => Math.max(H, q.y + q.h), 0);
    n.value[Y] = Q, i.value = [
      ...i.value,
      {
        i: Y,
        x: G?.x ?? 0,
        y: V,
        w: G?.w ?? 6,
        h: G?.h ?? 8,
        minH: G?.minH
      }
    ], c.value = !0;
  }
  function g(j, B) {
    const Y = n.value[j];
    Y && (n.value[j] = { ...Y, ...B }, c.value = !0);
  }
  function m() {
    n.value = {}, i.value = [], r.value = null, c.value = !0;
  }
  function y(j) {
    i.value = j;
  }
  function b() {
    u.value = {
      title: e.value,
      panels: { ...n.value },
      layouts: [...i.value]
    }, o.value = !0, c.value = !1;
  }
  function w(j) {
    j && j(N()), o.value = !1, u.value = null, c.value = !1;
  }
  function $() {
    const j = u.value;
    j && (e.value = j.title, n.value = j.panels, i.value = j.layouts), o.value = !1, u.value = null, c.value = !1;
  }
  function C() {
    o.value ? $() : b();
  }
  function P(j) {
    o.value = j;
  }
  function O(j) {
    r.value = j;
  }
  function E(j) {
    l.value = j;
  }
  function _(j) {
    s.value = j;
  }
  function D() {
    for (const j of Object.keys(n.value))
      d.value[j] = (d.value[j] ?? 0) + 1;
  }
  function M(j) {
    d.value[j] = (d.value[j] ?? 0) + 1;
  }
  function N() {
    const j = Hc(), B = Object.values(j.variables).map((Q) => Q.config), Y = {
      title: e.value,
      panels: n.value,
      layouts: i.value,
      variables: B
    };
    return JSON.stringify(Y, null, 2);
  }
  function L(j) {
    try {
      const B = JSON.parse(j);
      if (B.panels && B.layouts && (e.value = B.title ?? "", n.value = B.panels, i.value = B.layouts, c.value = !0), B.variables && B.variables.length > 0) {
        const Y = Hc();
        for (const Q of Object.keys(Y.variables))
          Y.removeVariable(Q);
        for (const Q of B.variables) {
          const G = {
            ...Q,
            hide: Q.showOnDashboard === "nothing" || !!Q.hideFromVariableList
          };
          Y.addVariable(G);
        }
      }
      return !!(B.panels && B.layouts);
    } catch {
      return !1;
    }
  }
  return {
    title: e,
    panels: n,
    layouts: i,
    isEditing: o,
    editingPanelId: r,
    addPanelModalOpen: a,
    timeRange: l,
    autoRefresh: s,
    _editSnapshot: u,
    isDirty: c,
    panelRefreshKeys: d,
    addPanel: f,
    removePanel: h,
    clonePanel: p,
    updatePanel: g,
    clearPanels: m,
    setLayouts: y,
    startEditing: b,
    confirmSave: w,
    discardChanges: $,
    setEditingPanel: O,
    toggleEditing: C,
    setEditing: P,
    setTimeRange: E,
    setAutoRefresh: _,
    refresh: D,
    refreshPanel: M,
    exportJSON: N,
    importJSON: L
  };
}), _l = vw("theme", () => {
  const t = de(
    (typeof localStorage < "u" ? localStorage.getItem("argus-theme") : null) || "dark"
  ), e = A(() => t.value === "dark");
  function n() {
    t.value = t.value === "dark" ? "light" : "dark", typeof document < "u" && (document.documentElement.dataset.theme = t.value), typeof localStorage < "u" && localStorage.setItem("argus-theme", t.value);
  }
  function i(o) {
    t.value = o, typeof document < "u" && (document.documentElement.dataset.theme = o), typeof localStorage < "u" && localStorage.setItem("argus-theme", o);
  }
  return { theme: t, isDark: e, toggle: n, setTheme: i };
});
function Ap(t) {
  "@babel/helpers - typeof";
  return Ap = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
    return typeof e;
  } : function(e) {
    return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
  }, Ap(t);
}
function Hj(t, e) {
  if (Ap(t) != "object" || !t) return t;
  var n = t[Symbol.toPrimitive];
  if (n !== void 0) {
    var i = n.call(t, e);
    if (Ap(i) != "object") return i;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (e === "string" ? String : Number)(t);
}
function Wj(t) {
  var e = Hj(t, "string");
  return Ap(e) == "symbol" ? e : e + "";
}
function jj(t, e, n) {
  return (e = Wj(e)) in t ? Object.defineProperty(t, e, {
    value: n,
    enumerable: !0,
    configurable: !0,
    writable: !0
  }) : t[e] = n, t;
}
function aP(t, e) {
  var n = Object.keys(t);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(t);
    e && (i = i.filter(function(o) {
      return Object.getOwnPropertyDescriptor(t, o).enumerable;
    })), n.push.apply(n, i);
  }
  return n;
}
function J(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e] != null ? arguments[e] : {};
    e % 2 ? aP(Object(n), !0).forEach(function(i) {
      jj(t, i, n[i]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : aP(Object(n)).forEach(function(i) {
      Object.defineProperty(t, i, Object.getOwnPropertyDescriptor(n, i));
    });
  }
  return t;
}
function k() {
  return k = Object.assign ? Object.assign.bind() : function(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e];
      for (var i in n) ({}).hasOwnProperty.call(n, i) && (t[i] = n[i]);
    }
    return t;
  }, k.apply(null, arguments);
}
const qj = (t) => typeof t == "function", Yj = Array.isArray, Kj = (t) => typeof t == "string", Xj = (t) => t !== null && typeof t == "object", Zj = /^on[^a-z]/, Gj = (t) => Zj.test(t), nC = (t) => {
  const e = /* @__PURE__ */ Object.create(null);
  return (n) => e[n] || (e[n] = t(n));
}, Uj = /-(\w)/g, sg = nC((t) => t.replace(Uj, (e, n) => n ? n.toUpperCase() : "")), Jj = /\B([A-Z])/g, eq = nC((t) => t.replace(Jj, "-$1").toLowerCase()), tq = nC((t) => t.charAt(0).toUpperCase() + t.slice(1)), nq = Object.prototype.hasOwnProperty, lP = (t, e) => nq.call(t, e);
function iq(t, e, n, i) {
  const o = t[n];
  if (o != null) {
    const r = lP(o, "default");
    if (r && i === void 0) {
      const a = o.default;
      i = o.type !== Function && qj(a) ? a() : a;
    }
    o.type === Boolean && (!lP(e, n) && !r ? i = !1 : i === "" && (i = !0));
  }
  return i;
}
function oq(t) {
  return Object.keys(t).reduce((e, n) => ((n.startsWith("data-") || n.startsWith("aria-")) && (e[n] = t[n]), e), {});
}
function yc(t) {
  return typeof t == "number" ? `${t}px` : t;
}
function Kd(t) {
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = arguments.length > 2 ? arguments[2] : void 0;
  return typeof t == "function" ? t(e) : t ?? n;
}
function rq(t) {
  let e;
  const n = new Promise((o) => {
    e = t(() => {
      o(!0);
    });
  }), i = () => {
    e?.();
  };
  return i.then = (o, r) => n.then(o, r), i.promise = n, i;
}
function Ae() {
  const t = [];
  for (let e = 0; e < arguments.length; e++) {
    const n = e < 0 || arguments.length <= e ? void 0 : arguments[e];
    if (n) {
      if (Kj(n))
        t.push(n);
      else if (Yj(n))
        for (let i = 0; i < n.length; i++) {
          const o = Ae(n[i]);
          o && t.push(o);
        }
      else if (Xj(n))
        for (const i in n)
          n[i] && t.push(i);
    }
  }
  return t.join(" ");
}
var $D = (function() {
  if (typeof Map < "u")
    return Map;
  function t(e, n) {
    var i = -1;
    return e.some(function(o, r) {
      return o[0] === n ? (i = r, !0) : !1;
    }), i;
  }
  return (
    /** @class */
    (function() {
      function e() {
        this.__entries__ = [];
      }
      return Object.defineProperty(e.prototype, "size", {
        /**
         * @returns {boolean}
         */
        get: function() {
          return this.__entries__.length;
        },
        enumerable: !0,
        configurable: !0
      }), e.prototype.get = function(n) {
        var i = t(this.__entries__, n), o = this.__entries__[i];
        return o && o[1];
      }, e.prototype.set = function(n, i) {
        var o = t(this.__entries__, n);
        ~o ? this.__entries__[o][1] = i : this.__entries__.push([n, i]);
      }, e.prototype.delete = function(n) {
        var i = this.__entries__, o = t(i, n);
        ~o && i.splice(o, 1);
      }, e.prototype.has = function(n) {
        return !!~t(this.__entries__, n);
      }, e.prototype.clear = function() {
        this.__entries__.splice(0);
      }, e.prototype.forEach = function(n, i) {
        i === void 0 && (i = null);
        for (var o = 0, r = this.__entries__; o < r.length; o++) {
          var a = r[o];
          n.call(i, a[1], a[0]);
        }
      }, e;
    })()
  );
})(), Qx = typeof window < "u" && typeof document < "u" && window.document === document, Bv = (function() {
  return typeof global < "u" && global.Math === Math ? global : typeof self < "u" && self.Math === Math ? self : typeof window < "u" && window.Math === Math ? window : Function("return this")();
})(), aq = (function() {
  return typeof requestAnimationFrame == "function" ? requestAnimationFrame.bind(Bv) : function(t) {
    return setTimeout(function() {
      return t(Date.now());
    }, 1e3 / 60);
  };
})(), lq = 2;
function sq(t, e) {
  var n = !1, i = !1, o = 0;
  function r() {
    n && (n = !1, t()), i && l();
  }
  function a() {
    aq(r);
  }
  function l() {
    var s = Date.now();
    if (n) {
      if (s - o < lq)
        return;
      i = !0;
    } else
      n = !0, i = !1, setTimeout(a, e);
    o = s;
  }
  return l;
}
var uq = 20, cq = ["top", "right", "bottom", "left", "width", "height", "size", "weight"], dq = typeof MutationObserver < "u", fq = (
  /** @class */
  (function() {
    function t() {
      this.connected_ = !1, this.mutationEventsAdded_ = !1, this.mutationsObserver_ = null, this.observers_ = [], this.onTransitionEnd_ = this.onTransitionEnd_.bind(this), this.refresh = sq(this.refresh.bind(this), uq);
    }
    return t.prototype.addObserver = function(e) {
      ~this.observers_.indexOf(e) || this.observers_.push(e), this.connected_ || this.connect_();
    }, t.prototype.removeObserver = function(e) {
      var n = this.observers_, i = n.indexOf(e);
      ~i && n.splice(i, 1), !n.length && this.connected_ && this.disconnect_();
    }, t.prototype.refresh = function() {
      var e = this.updateObservers_();
      e && this.refresh();
    }, t.prototype.updateObservers_ = function() {
      var e = this.observers_.filter(function(n) {
        return n.gatherActive(), n.hasActive();
      });
      return e.forEach(function(n) {
        return n.broadcastActive();
      }), e.length > 0;
    }, t.prototype.connect_ = function() {
      !Qx || this.connected_ || (document.addEventListener("transitionend", this.onTransitionEnd_), window.addEventListener("resize", this.refresh), dq ? (this.mutationsObserver_ = new MutationObserver(this.refresh), this.mutationsObserver_.observe(document, {
        attributes: !0,
        childList: !0,
        characterData: !0,
        subtree: !0
      })) : (document.addEventListener("DOMSubtreeModified", this.refresh), this.mutationEventsAdded_ = !0), this.connected_ = !0);
    }, t.prototype.disconnect_ = function() {
      !Qx || !this.connected_ || (document.removeEventListener("transitionend", this.onTransitionEnd_), window.removeEventListener("resize", this.refresh), this.mutationsObserver_ && this.mutationsObserver_.disconnect(), this.mutationEventsAdded_ && document.removeEventListener("DOMSubtreeModified", this.refresh), this.mutationsObserver_ = null, this.mutationEventsAdded_ = !1, this.connected_ = !1);
    }, t.prototype.onTransitionEnd_ = function(e) {
      var n = e.propertyName, i = n === void 0 ? "" : n, o = cq.some(function(r) {
        return !!~i.indexOf(r);
      });
      o && this.refresh();
    }, t.getInstance = function() {
      return this.instance_ || (this.instance_ = new t()), this.instance_;
    }, t.instance_ = null, t;
  })()
), kD = (function(t, e) {
  for (var n = 0, i = Object.keys(e); n < i.length; n++) {
    var o = i[n];
    Object.defineProperty(t, o, {
      value: e[o],
      enumerable: !1,
      writable: !1,
      configurable: !0
    });
  }
  return t;
}), If = (function(t) {
  var e = t && t.ownerDocument && t.ownerDocument.defaultView;
  return e || Bv;
}), TD = ny(0, 0, 0, 0);
function Fv(t) {
  return parseFloat(t) || 0;
}
function sP(t) {
  for (var e = [], n = 1; n < arguments.length; n++)
    e[n - 1] = arguments[n];
  return e.reduce(function(i, o) {
    var r = t["border-" + o + "-width"];
    return i + Fv(r);
  }, 0);
}
function hq(t) {
  for (var e = ["top", "right", "bottom", "left"], n = {}, i = 0, o = e; i < o.length; i++) {
    var r = o[i], a = t["padding-" + r];
    n[r] = Fv(a);
  }
  return n;
}
function pq(t) {
  var e = t.getBBox();
  return ny(0, 0, e.width, e.height);
}
function gq(t) {
  var e = t.clientWidth, n = t.clientHeight;
  if (!e && !n)
    return TD;
  var i = If(t).getComputedStyle(t), o = hq(i), r = o.left + o.right, a = o.top + o.bottom, l = Fv(i.width), s = Fv(i.height);
  if (i.boxSizing === "border-box" && (Math.round(l + r) !== e && (l -= sP(i, "left", "right") + r), Math.round(s + a) !== n && (s -= sP(i, "top", "bottom") + a)), !vq(t)) {
    var u = Math.round(l + r) - e, c = Math.round(s + a) - n;
    Math.abs(u) !== 1 && (l -= u), Math.abs(c) !== 1 && (s -= c);
  }
  return ny(o.left, o.top, l, s);
}
var mq = /* @__PURE__ */ (function() {
  return typeof SVGGraphicsElement < "u" ? function(t) {
    return t instanceof If(t).SVGGraphicsElement;
  } : function(t) {
    return t instanceof If(t).SVGElement && typeof t.getBBox == "function";
  };
})();
function vq(t) {
  return t === If(t).document.documentElement;
}
function yq(t) {
  return Qx ? mq(t) ? pq(t) : gq(t) : TD;
}
function bq(t) {
  var e = t.x, n = t.y, i = t.width, o = t.height, r = typeof DOMRectReadOnly < "u" ? DOMRectReadOnly : Object, a = Object.create(r.prototype);
  return kD(a, {
    x: e,
    y: n,
    width: i,
    height: o,
    top: n,
    right: e + i,
    bottom: o + n,
    left: e
  }), a;
}
function ny(t, e, n, i) {
  return { x: t, y: e, width: n, height: i };
}
var xq = (
  /** @class */
  (function() {
    function t(e) {
      this.broadcastWidth = 0, this.broadcastHeight = 0, this.contentRect_ = ny(0, 0, 0, 0), this.target = e;
    }
    return t.prototype.isActive = function() {
      var e = yq(this.target);
      return this.contentRect_ = e, e.width !== this.broadcastWidth || e.height !== this.broadcastHeight;
    }, t.prototype.broadcastRect = function() {
      var e = this.contentRect_;
      return this.broadcastWidth = e.width, this.broadcastHeight = e.height, e;
    }, t;
  })()
), Oq = (
  /** @class */
  /* @__PURE__ */ (function() {
    function t(e, n) {
      var i = bq(n);
      kD(this, { target: e, contentRect: i });
    }
    return t;
  })()
), Sq = (
  /** @class */
  (function() {
    function t(e, n, i) {
      if (this.activeObservations_ = [], this.observations_ = new $D(), typeof e != "function")
        throw new TypeError("The callback provided as parameter 1 is not a function.");
      this.callback_ = e, this.controller_ = n, this.callbackCtx_ = i;
    }
    return t.prototype.observe = function(e) {
      if (!arguments.length)
        throw new TypeError("1 argument required, but only 0 present.");
      if (!(typeof Element > "u" || !(Element instanceof Object))) {
        if (!(e instanceof If(e).Element))
          throw new TypeError('parameter 1 is not of type "Element".');
        var n = this.observations_;
        n.has(e) || (n.set(e, new xq(e)), this.controller_.addObserver(this), this.controller_.refresh());
      }
    }, t.prototype.unobserve = function(e) {
      if (!arguments.length)
        throw new TypeError("1 argument required, but only 0 present.");
      if (!(typeof Element > "u" || !(Element instanceof Object))) {
        if (!(e instanceof If(e).Element))
          throw new TypeError('parameter 1 is not of type "Element".');
        var n = this.observations_;
        n.has(e) && (n.delete(e), n.size || this.controller_.removeObserver(this));
      }
    }, t.prototype.disconnect = function() {
      this.clearActive(), this.observations_.clear(), this.controller_.removeObserver(this);
    }, t.prototype.gatherActive = function() {
      var e = this;
      this.clearActive(), this.observations_.forEach(function(n) {
        n.isActive() && e.activeObservations_.push(n);
      });
    }, t.prototype.broadcastActive = function() {
      if (this.hasActive()) {
        var e = this.callbackCtx_, n = this.activeObservations_.map(function(i) {
          return new Oq(i.target, i.broadcastRect());
        });
        this.callback_.call(e, n, e), this.clearActive();
      }
    }, t.prototype.clearActive = function() {
      this.activeObservations_.splice(0);
    }, t.prototype.hasActive = function() {
      return this.activeObservations_.length > 0;
    }, t;
  })()
), PD = typeof WeakMap < "u" ? /* @__PURE__ */ new WeakMap() : new $D(), ED = (
  /** @class */
  /* @__PURE__ */ (function() {
    function t(e) {
      if (!(this instanceof t))
        throw new TypeError("Cannot call a class as a function.");
      if (!arguments.length)
        throw new TypeError("1 argument required, but only 0 present.");
      var n = fq.getInstance(), i = new Sq(e, n, this);
      PD.set(this, i);
    }
    return t;
  })()
);
[
  "observe",
  "unobserve",
  "disconnect"
].forEach(function(t) {
  ED.prototype[t] = function() {
    var e;
    return (e = PD.get(this))[t].apply(e, arguments);
  };
});
var _D = (function() {
  return typeof Bv.ResizeObserver < "u" ? Bv.ResizeObserver : ED;
})();
const Hx = (t) => t != null && t !== "", Kn = (t, e) => {
  const n = k({}, t);
  return Object.keys(e).forEach((i) => {
    const o = n[i];
    if (o)
      o.type || o.default ? o.default = e[i] : o.def ? o.def(e[i]) : n[i] = {
        type: o,
        default: e[i]
      };
    else
      throw new Error(`not have ${i} prop`);
  }), n;
}, ID = (t) => {
  const e = Object.keys(t), n = {}, i = {}, o = {};
  for (let r = 0, a = e.length; r < a; r++) {
    const l = e[r];
    Gj(l) ? (n[l[2].toLowerCase() + l.slice(3)] = t[l], i[l] = t[l]) : o[l] = t[l];
  }
  return {
    onEvents: i,
    events: n,
    extraAttrs: o
  };
}, wq = function() {
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
  const n = {}, i = /;(?![^(]*\))/g, o = /:(.+)/;
  return typeof t == "object" ? t : (t.split(i).forEach(function(r) {
    if (r) {
      const a = r.split(o);
      if (a.length > 1) {
        const l = e ? sg(a[0].trim()) : a[0].trim();
        n[l] = a[1].trim();
      }
    }
  }), n);
}, ls = (t, e) => t[e] !== void 0, MD = Symbol("skipFlatten"), Wi = function() {
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
  const n = Array.isArray(t) ? t : [t], i = [];
  return n.forEach((o) => {
    Array.isArray(o) ? i.push(...Wi(o, e)) : o && o.type === tt ? o.key === MD ? i.push(o) : i.push(...Wi(o.children, e)) : o && or(o) ? e && !iy(o) ? i.push(o) : e || i.push(o) : Hx(o) && i.push(o);
  }), i;
}, AD = function(t) {
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "default", n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
  if (or(t))
    return t.type === tt ? e === "default" ? Wi(t.children) : [] : t.children && t.children[e] ? Wi(t.children[e](n)) : [];
  {
    const i = t.$slots[e] && t.$slots[e](n);
    return Wi(i);
  }
}, wl = (t) => {
  var e;
  let n = ((e = t?.vnode) === null || e === void 0 ? void 0 : e.el) || t && (t.$el || t);
  for (; n && !n.tagName; )
    n = n.nextSibling;
  return n;
}, Cq = (t) => {
  const e = {};
  if (t.$ && t.$.vnode) {
    const n = t.$.vnode.props || {};
    Object.keys(t.$props).forEach((i) => {
      const o = t.$props[i], r = eq(i);
      (o !== void 0 || r in n) && (e[i] = o);
    });
  } else if (or(t) && typeof t.type == "object") {
    const n = t.props || {}, i = {};
    Object.keys(n).forEach((r) => {
      i[sg(r)] = n[r];
    });
    const o = t.type.props || {};
    Object.keys(o).forEach((r) => {
      const a = iq(o, i, r, i[r]);
      (a !== void 0 || r in i) && (e[r] = a);
    });
  }
  return e;
}, RD = function(t) {
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "default", n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : t, i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !0, o;
  if (t.$) {
    const r = t[e];
    if (r !== void 0)
      return typeof r == "function" && i ? r(n) : r;
    o = t.$slots[e], o = i && o ? o(n) : o;
  } else if (or(t)) {
    const r = t.props && t.props[e];
    if (r !== void 0 && t.props !== null)
      return typeof r == "function" && i ? r(n) : r;
    t.type === tt ? o = t.children : t.children && t.children[e] && (o = t.children[e], o = i && o ? o(n) : o);
  }
  return Array.isArray(o) && (o = Wi(o), o = o.length === 1 ? o[0] : o, o = o.length === 0 ? void 0 : o), o;
};
function uP() {
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, n = {};
  return t.$ ? n = k(k({}, n), t.$attrs) : n = k(k({}, n), t.props), ID(n)[e ? "onEvents" : "events"];
}
function $q(t, e) {
  let i = ((or(t) ? t.props : t.$attrs) || {}).style || {};
  return typeof i == "string" && (i = wq(i, e)), i;
}
function kq(t) {
  return t.length === 1 && t[0].type === tt;
}
function iy(t) {
  return t && (t.type === SA || t.type === tt && t.children.length === 0 || t.type === pw && t.children.trim() === "");
}
function ho() {
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
  const e = [];
  return t.forEach((n) => {
    Array.isArray(n) ? e.push(...n) : n?.type === tt ? e.push(...ho(n.children)) : e.push(n);
  }), e.filter((n) => !iy(n));
}
function Ph(t) {
  if (t) {
    const e = ho(t);
    return e.length ? e : void 0;
  } else
    return t;
}
function po(t) {
  return Array.isArray(t) && t.length === 1 && (t = t[0]), t && t.__v_isVNode && typeof t.type != "symbol";
}
function ca(t, e) {
  let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "default";
  var i, o;
  return (i = e[n]) !== null && i !== void 0 ? i : (o = t[n]) === null || o === void 0 ? void 0 : o.call(t);
}
const Mu = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ResizeObserver",
  props: {
    disabled: Boolean,
    onResize: Function
  },
  emits: ["resize"],
  setup(t, e) {
    let {
      slots: n
    } = e;
    const i = Bn({
      width: 0,
      height: 0,
      offsetHeight: 0,
      offsetWidth: 0
    });
    let o = null, r = null;
    const a = () => {
      r && (r.disconnect(), r = null);
    }, l = (c) => {
      const {
        onResize: d
      } = t, f = c[0].target, {
        width: h,
        height: p
      } = f.getBoundingClientRect(), {
        offsetWidth: g,
        offsetHeight: m
      } = f, y = Math.floor(h), b = Math.floor(p);
      if (i.width !== y || i.height !== b || i.offsetWidth !== g || i.offsetHeight !== m) {
        const w = {
          width: y,
          height: b,
          offsetWidth: g,
          offsetHeight: m
        };
        k(i, w), d && Promise.resolve().then(() => {
          d(k(k({}, w), {
            offsetWidth: g,
            offsetHeight: m
          }), f);
        });
      }
    }, s = sr(), u = () => {
      const {
        disabled: c
      } = t;
      if (c) {
        a();
        return;
      }
      const d = wl(s);
      d !== o && (a(), o = d), !r && d && (r = new _D(l), r.observe(d));
    };
    return Lt(() => {
      u();
    }), Ns(() => {
      u();
    }), wo(() => {
      a();
    }), _e(() => t.disabled, () => {
      u();
    }, {
      flush: "post"
    }), () => {
      var c;
      return (c = n.default) === null || c === void 0 ? void 0 : c.call(n)[0];
    };
  }
});
let DD = (t) => setTimeout(t, 16), ND = (t) => clearTimeout(t);
typeof window < "u" && "requestAnimationFrame" in window && (DD = (t) => window.requestAnimationFrame(t), ND = (t) => window.cancelAnimationFrame(t));
let cP = 0;
const iC = /* @__PURE__ */ new Map();
function LD(t) {
  iC.delete(t);
}
function Gt(t) {
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1;
  cP += 1;
  const n = cP;
  function i(o) {
    if (o === 0)
      LD(n), t();
    else {
      const r = DD(() => {
        i(o - 1);
      });
      iC.set(n, r);
    }
  }
  return i(e), n;
}
Gt.cancel = (t) => {
  const e = iC.get(t);
  return LD(e), ND(e);
};
const ja = function() {
  for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++)
    e[n] = arguments[n];
  return e;
}, ya = (t) => {
  const e = t;
  return e.install = function(n) {
    n.component(e.displayName || e.name, t);
  }, t;
};
function Mf() {
  return {
    type: [Function, Array]
  };
}
function Vt(t) {
  return {
    type: Object,
    default: t
  };
}
function pt(t) {
  return {
    type: Boolean,
    default: t
  };
}
function ot(t) {
  return {
    type: Function,
    default: t
  };
}
function Mr(t, e) {
  return {
    validator: () => !0,
    default: t
  };
}
function Rb() {
  return {
    validator: () => !0
  };
}
function ui(t) {
  return {
    type: Array,
    default: t
  };
}
function yn(t) {
  return {
    type: String,
    default: t
  };
}
function pn(t, e) {
  return t ? {
    type: t,
    default: e
  } : Mr(e);
}
let xo = !1;
try {
  const t = Object.defineProperty({}, "passive", {
    get() {
      xo = !0;
    }
  });
  window.addEventListener("testPassive", null, t), window.removeEventListener("testPassive", null, t);
} catch {
}
function So(t, e, n, i) {
  if (t && t.addEventListener) {
    let o = i;
    o === void 0 && xo && (e === "touchstart" || e === "touchmove" || e === "wheel") && (o = {
      passive: !1
    }), t.addEventListener(e, n, o);
  }
  return {
    remove: () => {
      t && t.removeEventListener && t.removeEventListener(e, n);
    }
  };
}
const oC = "anticon", zD = Symbol("GlobalFormContextKey"), Tq = (t) => {
  Xt(zD, t);
}, Pq = () => qt(zD, {
  validateMessages: A(() => {
  })
}), Eq = () => ({
  iconPrefixCls: String,
  getTargetContainer: {
    type: Function
  },
  getPopupContainer: {
    type: Function
  },
  prefixCls: String,
  getPrefixCls: {
    type: Function
  },
  renderEmpty: {
    type: Function
  },
  transformCellText: {
    type: Function
  },
  csp: Vt(),
  input: Vt(),
  autoInsertSpaceInButton: {
    type: Boolean,
    default: void 0
  },
  locale: Vt(),
  pageHeader: Vt(),
  componentSize: {
    type: String
  },
  componentDisabled: {
    type: Boolean,
    default: void 0
  },
  direction: {
    type: String,
    default: "ltr"
  },
  space: Vt(),
  virtual: {
    type: Boolean,
    default: void 0
  },
  dropdownMatchSelectWidth: {
    type: [Number, Boolean],
    default: !0
  },
  form: Vt(),
  pagination: Vt(),
  theme: Vt(),
  select: Vt(),
  wave: Vt()
}), rC = Symbol("configProvider"), BD = {
  getPrefixCls: (t, e) => e || (t ? `ant-${t}` : "ant"),
  iconPrefixCls: A(() => oC),
  getPopupContainer: A(() => () => document.body),
  direction: A(() => "ltr")
}, oy = () => qt(rC, BD), _q = (t) => Xt(rC, t), FD = Symbol("DisabledContextKey"), qa = () => qt(FD, de(void 0)), VD = (t) => {
  const e = qa();
  return Xt(FD, A(() => {
    var n;
    return (n = t.value) !== null && n !== void 0 ? n : e.value;
  })), t;
}, QD = {
  // Options.jsx
  items_per_page: "/ page",
  jump_to: "Go to",
  jump_to_confirm: "confirm",
  page: "",
  // Pagination.jsx
  prev_page: "Previous Page",
  next_page: "Next Page",
  prev_5: "Previous 5 Pages",
  next_5: "Next 5 Pages",
  prev_3: "Previous 3 Pages",
  next_3: "Next 3 Pages"
}, Iq = {
  locale: "en_US",
  today: "Today",
  now: "Now",
  backToToday: "Back to today",
  ok: "Ok",
  clear: "Clear",
  month: "Month",
  year: "Year",
  timeSelect: "select time",
  dateSelect: "select date",
  weekSelect: "Choose a week",
  monthSelect: "Choose a month",
  yearSelect: "Choose a year",
  decadeSelect: "Choose a decade",
  yearFormat: "YYYY",
  dateFormat: "M/D/YYYY",
  dayFormat: "D",
  dateTimeFormat: "M/D/YYYY HH:mm:ss",
  monthBeforeYear: !0,
  previousMonth: "Previous month (PageUp)",
  nextMonth: "Next month (PageDown)",
  previousYear: "Last year (Control + left)",
  nextYear: "Next year (Control + right)",
  previousDecade: "Last decade",
  nextDecade: "Next decade",
  previousCentury: "Last century",
  nextCentury: "Next century"
}, HD = {
  placeholder: "Select time",
  rangePlaceholder: ["Start time", "End time"]
}, Vv = {
  lang: k({
    placeholder: "Select date",
    yearPlaceholder: "Select year",
    quarterPlaceholder: "Select quarter",
    monthPlaceholder: "Select month",
    weekPlaceholder: "Select week",
    rangePlaceholder: ["Start date", "End date"],
    rangeYearPlaceholder: ["Start year", "End year"],
    rangeQuarterPlaceholder: ["Start quarter", "End quarter"],
    rangeMonthPlaceholder: ["Start month", "End month"],
    rangeWeekPlaceholder: ["Start week", "End week"]
  }, Iq),
  timePickerLocale: k({}, HD)
}, Cr = "${label} is not a valid ${type}", ks = {
  locale: "en",
  Pagination: QD,
  DatePicker: Vv,
  TimePicker: HD,
  Calendar: Vv,
  global: {
    placeholder: "Please select"
  },
  Table: {
    filterTitle: "Filter menu",
    filterConfirm: "OK",
    filterReset: "Reset",
    filterEmptyText: "No filters",
    filterCheckall: "Select all items",
    filterSearchPlaceholder: "Search in filters",
    emptyText: "No data",
    selectAll: "Select current page",
    selectInvert: "Invert current page",
    selectNone: "Clear all data",
    selectionAll: "Select all data",
    sortTitle: "Sort",
    expand: "Expand row",
    collapse: "Collapse row",
    triggerDesc: "Click to sort descending",
    triggerAsc: "Click to sort ascending",
    cancelSort: "Click to cancel sorting"
  },
  Tour: {
    Next: "Next",
    Previous: "Previous",
    Finish: "Finish"
  },
  Modal: {
    okText: "OK",
    cancelText: "Cancel",
    justOkText: "OK"
  },
  Popconfirm: {
    okText: "OK",
    cancelText: "Cancel"
  },
  Transfer: {
    titles: ["", ""],
    searchPlaceholder: "Search here",
    itemUnit: "item",
    itemsUnit: "items",
    remove: "Remove",
    selectCurrent: "Select current page",
    removeCurrent: "Remove current page",
    selectAll: "Select all data",
    removeAll: "Remove all data",
    selectInvert: "Invert current page"
  },
  Upload: {
    uploading: "Uploading...",
    removeFile: "Remove file",
    uploadError: "Upload error",
    previewFile: "Preview file",
    downloadFile: "Download file"
  },
  Empty: {
    description: "No data"
  },
  Icon: {
    icon: "icon"
  },
  Text: {
    edit: "Edit",
    copy: "Copy",
    copied: "Copied",
    expand: "Expand"
  },
  PageHeader: {
    back: "Back"
  },
  Form: {
    optional: "(optional)",
    defaultValidateMessages: {
      default: "Field validation error for ${label}",
      required: "Please enter ${label}",
      enum: "${label} must be one of [${enum}]",
      whitespace: "${label} cannot be a blank character",
      date: {
        format: "${label} date format is invalid",
        parse: "${label} cannot be converted to a date",
        invalid: "${label} is an invalid date"
      },
      types: {
        string: Cr,
        method: Cr,
        array: Cr,
        object: Cr,
        number: Cr,
        date: Cr,
        boolean: Cr,
        integer: Cr,
        float: Cr,
        regexp: Cr,
        email: Cr,
        url: Cr,
        hex: Cr
      },
      string: {
        len: "${label} must be ${len} characters",
        min: "${label} must be at least ${min} characters",
        max: "${label} must be up to ${max} characters",
        range: "${label} must be between ${min}-${max} characters"
      },
      number: {
        len: "${label} must be equal to ${len}",
        min: "${label} must be minimum ${min}",
        max: "${label} must be maximum ${max}",
        range: "${label} must be between ${min}-${max}"
      },
      array: {
        len: "Must be ${len} ${label}",
        min: "At least ${min} ${label}",
        max: "At most ${max} ${label}",
        range: "The amount of ${label} must be between ${min}-${max}"
      },
      pattern: {
        mismatch: "${label} does not match the pattern ${pattern}"
      }
    }
  },
  Image: {
    preview: "Preview"
  },
  QRCode: {
    expired: "QR code expired",
    refresh: "Refresh",
    scanned: "Scanned"
  }
}, WD = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "LocaleReceiver",
  props: {
    componentName: String,
    defaultLocale: {
      type: [Object, Function]
    },
    children: {
      type: Function
    }
  },
  setup(t, e) {
    let {
      slots: n
    } = e;
    const i = qt("localeData", {}), o = A(() => {
      const {
        componentName: a = "global",
        defaultLocale: l
      } = t, s = l || ks[a || "global"], {
        antLocale: u
      } = i, c = a && u ? u[a] : {};
      return k(k({}, typeof s == "function" ? s() : s), c || {});
    }), r = A(() => {
      const {
        antLocale: a
      } = i, l = a && a.locale;
      return a && a.exist && !l ? ks.locale : l;
    });
    return () => {
      const a = t.children || n.default, {
        antLocale: l
      } = i;
      return a?.(o.value, r.value, l);
    };
  }
});
function Bu(t, e, n) {
  const i = qt("localeData", {});
  return [A(() => {
    const {
      antLocale: r
    } = i, a = I(e) || ks[t || "global"], l = t && r ? r[t] : {};
    return k(k(k({}, typeof a == "function" ? a() : a), l || {}), I(n) || {});
  })];
}
function aC(t) {
  for (var e = 0, n, i = 0, o = t.length; o >= 4; ++i, o -= 4)
    n = t.charCodeAt(i) & 255 | (t.charCodeAt(++i) & 255) << 8 | (t.charCodeAt(++i) & 255) << 16 | (t.charCodeAt(++i) & 255) << 24, n = /* Math.imul(k, m): */
    (n & 65535) * 1540483477 + ((n >>> 16) * 59797 << 16), n ^= /* k >>> r: */
    n >>> 24, e = /* Math.imul(k, m): */
    (n & 65535) * 1540483477 + ((n >>> 16) * 59797 << 16) ^ /* Math.imul(h, m): */
    (e & 65535) * 1540483477 + ((e >>> 16) * 59797 << 16);
  switch (o) {
    case 3:
      e ^= (t.charCodeAt(i + 2) & 255) << 16;
    case 2:
      e ^= (t.charCodeAt(i + 1) & 255) << 8;
    case 1:
      e ^= t.charCodeAt(i) & 255, e = /* Math.imul(h, m): */
      (e & 65535) * 1540483477 + ((e >>> 16) * 59797 << 16);
  }
  return e ^= e >>> 13, e = /* Math.imul(h, m): */
  (e & 65535) * 1540483477 + ((e >>> 16) * 59797 << 16), ((e ^ e >>> 15) >>> 0).toString(36);
}
const dP = "%";
class Mq {
  constructor(e) {
    this.cache = /* @__PURE__ */ new Map(), this.instanceId = e;
  }
  get(e) {
    return this.cache.get(Array.isArray(e) ? e.join(dP) : e) || null;
  }
  update(e, n) {
    const i = Array.isArray(e) ? e.join(dP) : e, o = this.cache.get(i), r = n(o);
    r === null ? this.cache.delete(i) : this.cache.set(i, r);
  }
}
const jD = "data-token-hash", Rc = "data-css-hash", Aq = "data-cache-path", Xd = "__cssinjs_instance__";
function Rp() {
  const t = Math.random().toString(12).slice(2);
  if (typeof document < "u" && document.head && document.body) {
    const e = document.body.querySelectorAll(`style[${Rc}]`) || [], {
      firstChild: n
    } = document.head;
    Array.from(e).forEach((o) => {
      o[Xd] = o[Xd] || t, o[Xd] === t && document.head.insertBefore(o, n);
    });
    const i = {};
    Array.from(document.querySelectorAll(`style[${Rc}]`)).forEach((o) => {
      var r;
      const a = o.getAttribute(Rc);
      i[a] ? o[Xd] === t && ((r = o.parentNode) === null || r === void 0 || r.removeChild(o)) : i[a] = !0;
    });
  }
  return new Mq(t);
}
const qD = Symbol("StyleContextKey"), Rq = () => {
  var t, e, n;
  const i = sr();
  let o;
  if (i && i.appContext) {
    const r = (n = (e = (t = i.appContext) === null || t === void 0 ? void 0 : t.config) === null || e === void 0 ? void 0 : e.globalProperties) === null || n === void 0 ? void 0 : n.__ANTDV_CSSINJS_CACHE__;
    r ? o = r : (o = Rp(), i.appContext.config.globalProperties && (i.appContext.config.globalProperties.__ANTDV_CSSINJS_CACHE__ = o));
  } else
    o = Rp();
  return o;
}, YD = {
  cache: Rp(),
  defaultCache: !0,
  hashPriority: "low"
}, ry = () => {
  const t = Rq();
  return qt(qD, Te(k(k({}, YD), {
    cache: t
  })));
}, Dq = (t) => {
  const e = ry(), n = Te(k(k({}, YD), {
    cache: Rp()
  }));
  return _e([() => I(t), e], () => {
    const i = k({}, e.value), o = I(t);
    Object.keys(o).forEach((a) => {
      const l = o[a];
      o[a] !== void 0 && (i[a] = l);
    });
    const {
      cache: r
    } = o;
    i.cache = i.cache || Rp(), i.defaultCache = !r && e.value.defaultCache, n.value = i;
  }, {
    immediate: !0
  }), Xt(qD, n), n;
}, Nq = () => ({
  autoClear: pt(),
  /** @private Test only. Not work in production. */
  mock: yn(),
  /**
   * Only set when you need ssr to extract style on you own.
   * If not provided, it will auto create <style /> on the end of Provider in server side.
   */
  cache: Vt(),
  /** Tell children that this context is default generated context */
  defaultCache: pt(),
  /** Use `:where` selector to reduce hashId css selector priority */
  hashPriority: yn(),
  /** Tell cssinjs where to inject style in */
  container: pn(),
  /** Component wil render inline  `<style />` for fallback in SSR. Not recommend. */
  ssrInline: pt(),
  /** Transform css before inject in document. Please note that `transformers` do not support dynamic update */
  transformers: ui(),
  /**
   * Linters to lint css before inject in document.
   * Styles will be linted after transforming.
   * Please note that `linters` do not support dynamic update.
   */
  linters: ui()
});
ya(Oe({
  name: "AStyleProvider",
  inheritAttrs: !1,
  props: Nq(),
  setup(t, e) {
    let {
      slots: n
    } = e;
    return Dq(t), () => {
      var i;
      return (i = n.default) === null || i === void 0 ? void 0 : i.call(n);
    };
  }
}));
function Lq() {
  return !1;
}
let Wx = !1;
function zq() {
  return Wx;
}
const Bq = process.env.NODE_ENV === "production" ? Lq : zq;
if (process.env.NODE_ENV !== "production" && typeof module < "u" && module && module.hot && typeof window < "u") {
  const t = window;
  if (typeof t.webpackHotUpdate == "function") {
    const e = t.webpackHotUpdate;
    t.webpackHotUpdate = function() {
      return Wx = !0, setTimeout(() => {
        Wx = !1;
      }, 0), e(...arguments);
    };
  }
}
function KD(t, e, n, i) {
  const o = ry(), r = Te(""), a = Te();
  zt(() => {
    r.value = [t, ...e.value].join("%");
  });
  const l = Bq(), s = (u) => {
    o.value.cache.update(u, (c) => {
      const [d = 0, f] = c || [];
      return d - 1 === 0 ? (i?.(f, !1), null) : [d - 1, f];
    });
  };
  return _e(r, (u, c) => {
    c && s(c), o.value.cache.update(u, (d) => {
      const [f = 0, h] = d || [];
      let p = h;
      process.env.NODE_ENV !== "production" && h && l && (i?.(p, l), p = null);
      const g = p || n();
      return [f + 1, g];
    }), a.value = o.value.cache.get(r.value)[1];
  }, {
    immediate: !0
  }), tn(() => {
    s(r.value);
  }), a;
}
function Or() {
  return !!(typeof window < "u" && window.document && window.document.createElement);
}
function fu(t, e) {
  return t && t.contains ? t.contains(e) : !1;
}
const fP = "data-vc-order", Fq = "vc-util-key", jx = /* @__PURE__ */ new Map();
function XD() {
  let {
    mark: t
  } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
  return t ? t.startsWith("data-") ? t : `data-${t}` : Fq;
}
function ay(t) {
  return t.attachTo ? t.attachTo : document.querySelector("head") || document.body;
}
function Vq(t) {
  return t === "queue" ? "prependQueue" : t ? "prepend" : "append";
}
function ZD(t) {
  return Array.from((jx.get(t) || t).children).filter((e) => e.tagName === "STYLE");
}
function GD(t) {
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
  if (!Or())
    return null;
  const {
    csp: n,
    prepend: i
  } = e, o = document.createElement("style");
  o.setAttribute(fP, Vq(i)), n?.nonce && (o.nonce = n?.nonce), o.innerHTML = t;
  const r = ay(e), {
    firstChild: a
  } = r;
  if (i) {
    if (i === "queue") {
      const l = ZD(r).filter((s) => ["prepend", "prependQueue"].includes(s.getAttribute(fP)));
      if (l.length)
        return r.insertBefore(o, l[l.length - 1].nextSibling), o;
    }
    r.insertBefore(o, a);
  } else
    r.appendChild(o);
  return o;
}
function UD(t) {
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
  const n = ay(e);
  return ZD(n).find((i) => i.getAttribute(XD(e)) === t);
}
function Qv(t) {
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
  const n = UD(t, e);
  n && ay(e).removeChild(n);
}
function Qq(t, e) {
  const n = jx.get(t);
  if (!n || !fu(document, n)) {
    const i = GD("", e), {
      parentNode: o
    } = i;
    jx.set(t, o), t.removeChild(i);
  }
}
function Dp(t, e) {
  let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
  var i, o, r;
  const a = ay(n);
  Qq(a, n);
  const l = UD(e, n);
  if (l)
    return !((i = n.csp) === null || i === void 0) && i.nonce && l.nonce !== ((o = n.csp) === null || o === void 0 ? void 0 : o.nonce) && (l.nonce = (r = n.csp) === null || r === void 0 ? void 0 : r.nonce), l.innerHTML !== t && (l.innerHTML = t), l;
  const s = GD(t, n);
  return s.setAttribute(XD(n), e), s;
}
function Hq(t, e) {
  if (t.length !== e.length)
    return !1;
  for (let n = 0; n < t.length; n++)
    if (t[n] !== e[n])
      return !1;
  return !0;
}
class Af {
  constructor() {
    this.cache = /* @__PURE__ */ new Map(), this.keys = [], this.cacheCallTimes = 0;
  }
  size() {
    return this.keys.length;
  }
  internalGet(e) {
    let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, i = {
      map: this.cache
    };
    return e.forEach((o) => {
      var r;
      i ? i = (r = i?.map) === null || r === void 0 ? void 0 : r.get(o) : i = void 0;
    }), i?.value && n && (i.value[1] = this.cacheCallTimes++), i?.value;
  }
  get(e) {
    var n;
    return (n = this.internalGet(e, !0)) === null || n === void 0 ? void 0 : n[0];
  }
  has(e) {
    return !!this.internalGet(e);
  }
  set(e, n) {
    if (!this.has(e)) {
      if (this.size() + 1 > Af.MAX_CACHE_SIZE + Af.MAX_CACHE_OFFSET) {
        const [o] = this.keys.reduce((r, a) => {
          const [, l] = r;
          return this.internalGet(a)[1] < l ? [a, this.internalGet(a)[1]] : r;
        }, [this.keys[0], this.cacheCallTimes]);
        this.delete(o);
      }
      this.keys.push(e);
    }
    let i = this.cache;
    e.forEach((o, r) => {
      if (r === e.length - 1)
        i.set(o, {
          value: [n, this.cacheCallTimes++]
        });
      else {
        const a = i.get(o);
        a ? a.map || (a.map = /* @__PURE__ */ new Map()) : i.set(o, {
          map: /* @__PURE__ */ new Map()
        }), i = i.get(o).map;
      }
    });
  }
  deleteByPath(e, n) {
    var i;
    const o = e.get(n[0]);
    if (n.length === 1)
      return o.map ? e.set(n[0], {
        map: o.map
      }) : e.delete(n[0]), (i = o.value) === null || i === void 0 ? void 0 : i[0];
    const r = this.deleteByPath(o.map, n.slice(1));
    return (!o.map || o.map.size === 0) && !o.value && e.delete(n[0]), r;
  }
  delete(e) {
    if (this.has(e))
      return this.keys = this.keys.filter((n) => !Hq(n, e)), this.deleteByPath(this.cache, e);
  }
}
Af.MAX_CACHE_SIZE = 20;
Af.MAX_CACHE_OFFSET = 5;
let qx = {};
function Nn(t, e) {
  process.env.NODE_ENV !== "production" && !t && console !== void 0 && console.error(`Warning: ${e}`);
}
function JD(t, e) {
  process.env.NODE_ENV !== "production" && !t && console !== void 0 && console.warn(`Note: ${e}`);
}
function Wq() {
  qx = {};
}
function eN(t, e, n) {
  !e && !qx[n] && (t(!1, n), qx[n] = !0);
}
function pr(t, e) {
  eN(Nn, t, e);
}
function Yx(t, e) {
  eN(JD, t, e);
}
function jq() {
}
let eo = jq;
process.env.NODE_ENV !== "production" && (eo = (t, e, n) => {
  pr(t, `[ant-design-vue: ${e}] ${n}`), process.env.NODE_ENV === "test" && Wq();
});
let hP = 0;
class tN {
  constructor(e) {
    this.derivatives = Array.isArray(e) ? e : [e], this.id = hP, e.length === 0 && eo(e.length > 0, "[Ant Design Vue CSS-in-JS] Theme should have at least one derivative function."), hP += 1;
  }
  getDerivativeToken(e) {
    return this.derivatives.reduce((n, i) => i(e, n), void 0);
  }
}
const Db = new Af();
function nN(t) {
  const e = Array.isArray(t) ? t : [t];
  return Db.has(e) || Db.set(e, new tN(e)), Db.get(e);
}
const pP = /* @__PURE__ */ new WeakMap();
function Hv(t) {
  let e = pP.get(t) || "";
  return e || (Object.keys(t).forEach((n) => {
    const i = t[n];
    e += n, i instanceof tN ? e += i.id : i && typeof i == "object" ? e += Hv(i) : e += i;
  }), pP.set(t, e)), e;
}
function qq(t, e) {
  return aC(`${e}_${Hv(t)}`);
}
const op = `random-${Date.now()}-${Math.random()}`.replace(/\./g, ""), iN = "_bAmBoO_";
function Yq(t, e, n) {
  var i, o;
  if (Or()) {
    Dp(t, op);
    const r = document.createElement("div");
    r.style.position = "fixed", r.style.left = "0", r.style.top = "0", e?.(r), document.body.appendChild(r), process.env.NODE_ENV !== "production" && (r.innerHTML = "Test", r.style.zIndex = "9999999");
    const a = n ? n(r) : (i = getComputedStyle(r).content) === null || i === void 0 ? void 0 : i.includes(iN);
    return (o = r.parentNode) === null || o === void 0 || o.removeChild(r), Qv(op), a;
  }
  return !1;
}
let Nb;
function Kq() {
  return Nb === void 0 && (Nb = Yq(`@layer ${op} { .${op} { content: "${iN}"!important; } }`, (t) => {
    t.className = op;
  })), Nb;
}
const gP = {}, Xq = process.env.NODE_ENV === "production", Zq = process.env.NODE_ENV === "prerender", Gq = !Xq && !Zq ? "css-dev-only-do-not-override" : "css", bc = /* @__PURE__ */ new Map();
function Uq(t) {
  bc.set(t, (bc.get(t) || 0) + 1);
}
function Jq(t, e) {
  typeof document < "u" && document.querySelectorAll(`style[${jD}="${t}"]`).forEach((i) => {
    var o;
    i[Xd] === e && ((o = i.parentNode) === null || o === void 0 || o.removeChild(i));
  });
}
const eY = 0;
function tY(t, e) {
  bc.set(t, (bc.get(t) || 0) - 1);
  const n = Array.from(bc.keys()), i = n.filter((o) => (bc.get(o) || 0) <= 0);
  n.length - i.length > eY && i.forEach((o) => {
    Jq(o, e), bc.delete(o);
  });
}
const nY = (t, e, n, i) => {
  const o = n.getDerivativeToken(t);
  let r = k(k({}, o), e);
  return i && (r = i(r)), r;
};
function iY(t, e) {
  let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : de({});
  const i = ry(), o = A(() => k({}, ...e.value)), r = A(() => Hv(o.value)), a = A(() => Hv(n.value.override || gP));
  return KD("token", A(() => [n.value.salt || "", t.value.id, r.value, a.value]), () => {
    const {
      salt: s = "",
      override: u = gP,
      formatToken: c,
      getComputedToken: d
    } = n.value, f = d ? d(o.value, u, t.value) : nY(o.value, u, t.value, c), h = qq(f, s);
    f._tokenKey = h, Uq(h);
    const p = `${Gq}-${aC(h)}`;
    return f._hashId = p, [f, p];
  }, (s) => {
    var u;
    tY(s[0]._tokenKey, (u = i.value) === null || u === void 0 ? void 0 : u.cache.instanceId);
  });
}
var oY = {
  animationIterationCount: 1,
  aspectRatio: 1,
  borderImageOutset: 1,
  borderImageSlice: 1,
  borderImageWidth: 1,
  boxFlex: 1,
  boxFlexGroup: 1,
  boxOrdinalGroup: 1,
  columnCount: 1,
  columns: 1,
  flex: 1,
  flexGrow: 1,
  flexPositive: 1,
  flexShrink: 1,
  flexNegative: 1,
  flexOrder: 1,
  gridRow: 1,
  gridRowEnd: 1,
  gridRowSpan: 1,
  gridRowStart: 1,
  gridColumn: 1,
  gridColumnEnd: 1,
  gridColumnSpan: 1,
  gridColumnStart: 1,
  msGridRow: 1,
  msGridRowSpan: 1,
  msGridColumn: 1,
  msGridColumnSpan: 1,
  fontWeight: 1,
  lineHeight: 1,
  opacity: 1,
  order: 1,
  orphans: 1,
  tabSize: 1,
  widows: 1,
  zIndex: 1,
  zoom: 1,
  WebkitLineClamp: 1,
  // SVG-related properties
  fillOpacity: 1,
  floodOpacity: 1,
  stopOpacity: 1,
  strokeDasharray: 1,
  strokeDashoffset: 1,
  strokeMiterlimit: 1,
  strokeOpacity: 1,
  strokeWidth: 1
}, oN = "comm", rN = "rule", aN = "decl", rY = "@import", aY = "@namespace", lY = "@keyframes", sY = "@layer", uY = Math.abs, rp = String.fromCharCode;
function lN(t) {
  return t.trim();
}
function Kx(t, e, n) {
  return t.replace(e, n);
}
function af(t, e) {
  return t.charCodeAt(e) | 0;
}
function Rf(t, e, n) {
  return t.slice(e, n);
}
function ml(t) {
  return t.length;
}
function cY(t) {
  return t.length;
}
function Jg(t, e) {
  return e.push(t), t;
}
var ly = 1, Df = 1, sN = 0, pa = 0, no = 0, rh = "";
function lC(t, e, n, i, o, r, a, l) {
  return { value: t, root: e, parent: n, type: i, props: o, children: r, line: ly, column: Df, length: a, return: "", siblings: l };
}
function dY() {
  return no;
}
function fY() {
  return no = pa > 0 ? af(rh, --pa) : 0, Df--, no === 10 && (Df = 1, ly--), no;
}
function Ba() {
  return no = pa < sN ? af(rh, pa++) : 0, Df++, no === 10 && (Df = 1, ly++), no;
}
function bu() {
  return af(rh, pa);
}
function iv() {
  return pa;
}
function sy(t, e) {
  return Rf(rh, t, e);
}
function Np(t) {
  switch (t) {
    // \0 \t \n \r \s whitespace token
    case 0:
    case 9:
    case 10:
    case 13:
    case 32:
      return 5;
    // ! + , / > @ ~ isolate token
    case 33:
    case 43:
    case 44:
    case 47:
    case 62:
    case 64:
    case 126:
    // ; { } breakpoint token
    case 59:
    case 123:
    case 125:
      return 4;
    // : accompanied token
    case 58:
      return 3;
    // " ' ( [ opening delimit token
    case 34:
    case 39:
    case 40:
    case 91:
      return 2;
    // ) ] closing delimit token
    case 41:
    case 93:
      return 1;
  }
  return 0;
}
function hY(t) {
  return ly = Df = 1, sN = ml(rh = t), pa = 0, [];
}
function pY(t) {
  return rh = "", t;
}
function Lb(t) {
  return lN(sy(pa - 1, Xx(t === 91 ? t + 2 : t === 40 ? t + 1 : t)));
}
function gY(t) {
  for (; (no = bu()) && no < 33; )
    Ba();
  return Np(t) > 2 || Np(no) > 3 ? "" : " ";
}
function mY(t, e) {
  for (; --e && Ba() && !(no < 48 || no > 102 || no > 57 && no < 65 || no > 70 && no < 97); )
    ;
  return sy(t, iv() + (e < 6 && bu() == 32 && Ba() == 32));
}
function Xx(t) {
  for (; Ba(); )
    switch (no) {
      // ] ) " '
      case t:
        return pa;
      // " '
      case 34:
      case 39:
        t !== 34 && t !== 39 && Xx(no);
        break;
      // (
      case 40:
        t === 41 && Xx(t);
        break;
      // \
      case 92:
        Ba();
        break;
    }
  return pa;
}
function vY(t, e) {
  for (; Ba() && t + no !== 57; )
    if (t + no === 84 && bu() === 47)
      break;
  return "/*" + sy(e, pa - 1) + "*" + rp(t === 47 ? t : Ba());
}
function yY(t) {
  for (; !Np(bu()); )
    Ba();
  return sy(t, pa);
}
function bY(t) {
  return pY(ov("", null, null, null, [""], t = hY(t), 0, [0], t));
}
function ov(t, e, n, i, o, r, a, l, s) {
  for (var u = 0, c = 0, d = a, f = 0, h = 0, p = 0, g = 1, m = 1, y = 1, b = 0, w = 0, $ = "", C = o, P = r, O = i, E = $; m; )
    switch (p = w, w = Ba()) {
      // (
      case 40:
        p != 108 && af(E, d - 1) == 58 ? (b++, E += "(") : E += Lb(w);
        break;
      // )
      case 41:
        b--, E += ")";
        break;
      // " ' [
      case 34:
      case 39:
      case 91:
        E += Lb(w);
        break;
      // \t \n \r \s
      case 9:
      case 10:
      case 13:
      case 32:
        if (b > 0) {
          E += rp(w);
          break;
        }
        E += gY(p);
        break;
      // \
      case 92:
        E += mY(iv() - 1, 7);
        continue;
      // /
      case 47:
        switch (bu()) {
          case 42:
          case 47:
            Jg(xY(vY(Ba(), iv()), e, n, s), s), (Np(p || 1) == 5 || Np(bu() || 1) == 5) && ml(E) && Rf(E, -1, void 0) !== " " && (E += " ");
            break;
          default:
            E += "/";
        }
        break;
      // {
      case 123 * g:
        l[u++] = ml(E) * y;
      // } ; \0
      case 125 * g:
      case 59:
      case 0:
        if (b > 0 && w) {
          E += rp(w);
          break;
        }
        switch (w) {
          // \0 }
          case 0:
          case 125:
            m = 0;
          // ;
          case 59 + c:
            y == -1 && (E = Kx(E, /\f/g, "")), h > 0 && (ml(E) - d || g === 0) && Jg(h > 32 ? vP(E + ";", i, n, d - 1, s) : vP(Kx(E, " ", "") + ";", i, n, d - 2, s), s);
            break;
          // @ ;
          case 59:
            E += ";";
          // { rule/at-rule
          default:
            if (Jg(O = mP(E, e, n, u, c, o, l, $, C = [], P = [], d, r), r), w === 123)
              if (c === 0)
                ov(E, e, O, O, C, r, d, l, P);
              else {
                switch (f) {
                  // c(ontainer)
                  case 99:
                    if (af(E, 3) === 110) break;
                  // l(ayer)
                  case 108:
                    if (af(E, 2) === 97) break;
                  default:
                    c = 0;
                  // d(ocument) m(edia) s(upports)
                  case 100:
                  case 109:
                  case 115:
                }
                c ? ov(t, O, O, i && Jg(mP(t, O, O, 0, 0, o, l, $, o, C = [], d, P), P), o, P, d, l, i ? C : P) : ov(E, O, O, O, [""], P, 0, l, P);
              }
        }
        u = c = h = 0, g = y = 1, $ = E = "", d = a;
        break;
      // :
      case 58:
        d = 1 + ml(E), h = p;
      default:
        if (g < 1) {
          if (w == 123)
            --g;
          else if (w == 125 && g++ == 0 && fY() == 125)
            continue;
        }
        switch (E += rp(w), w * g) {
          // &
          case 38:
            y = c > 0 ? 1 : (E += "\f", -1);
            break;
          // ,
          case 44:
            if (b > 0) break;
            l[u++] = (ml(E) - 1) * y, y = 1;
            break;
          // @
          case 64:
            bu() === 45 && (E += Lb(Ba())), f = bu(), c = d = ml($ = E += yY(iv())), w++;
            break;
          // -
          case 45:
            p === 45 && ml(E) == 2 && (g = 0);
        }
    }
  return r;
}
function mP(t, e, n, i, o, r, a, l, s, u, c, d) {
  for (var f = o - 1, h = o === 0 ? r : [""], p = cY(h), g = 0, m = 0, y = 0; g < i; ++g)
    for (var b = 0, w = Rf(t, f + 1, f = uY(m = a[g])), $ = t; b < p; ++b)
      ($ = lN(m > 0 ? h[b] + " " + w : Kx(w, /&\f/g, h[b]))) && (s[y++] = $);
  return lC(t, e, n, o === 0 ? rN : l, s, u, c, d);
}
function xY(t, e, n, i) {
  return lC(t, e, n, oN, rp(dY()), Rf(t, 2, -2), 0, i);
}
function vP(t, e, n, i, o) {
  return lC(t, e, n, aN, Rf(t, 0, i), Rf(t, i + 1, -1), i, o);
}
function Zx(t, e) {
  for (var n = "", i = 0; i < t.length; i++)
    n += e(t[i], i, t, e) || "";
  return n;
}
function OY(t, e, n, i) {
  switch (t.type) {
    case sY:
      if (t.children.length) break;
    case rY:
    case aY:
    case aN:
      return t.return = t.return || t.value;
    case oN:
      return "";
    case lY:
      return t.return = t.value + "{" + Zx(t.children, i) + "}";
    case rN:
      if (!ml(t.value = t.props.join(","))) return "";
  }
  return ml(n = Zx(t.children, i)) ? t.return = t.value + "{" + n + "}" : "";
}
function uN(t, e) {
  const {
    path: n,
    parentSelectors: i
  } = e;
  pr(!1, `[Ant Design Vue CSS-in-JS] ${n ? `Error in '${n}': ` : ""}${t}${i.length ? ` Selector info: ${i.join(" -> ")}` : ""}`);
}
const SY = (t, e, n) => {
  if (t === "content") {
    const i = /(attr|counters?|url|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/;
    (typeof e != "string" || ["normal", "none", "initial", "inherit", "unset"].indexOf(e) === -1 && !i.test(e) && (e.charAt(0) !== e.charAt(e.length - 1) || e.charAt(0) !== '"' && e.charAt(0) !== "'")) && uN(`You seem to be using a value for 'content' without quotes, try replacing it with \`content: '"${e}"'\`.`, n);
  }
}, wY = (t, e, n) => {
  t === "animation" && n.hashId && e !== "none" && uN(`You seem to be using hashed animation '${e}', in which case 'animationName' with Keyframe as value is recommended.`, n);
}, yP = "data-ant-cssinjs-cache-path", CY = "_FILE_STYLE__";
let Dc, cN = !0;
function $Y() {
  var t;
  if (!Dc && (Dc = {}, Or())) {
    const e = document.createElement("div");
    e.className = yP, e.style.position = "fixed", e.style.visibility = "hidden", e.style.top = "-9999px", document.body.appendChild(e);
    let n = getComputedStyle(e).content || "";
    n = n.replace(/^"/, "").replace(/"$/, ""), n.split(";").forEach((o) => {
      const [r, a] = o.split(":");
      Dc[r] = a;
    });
    const i = document.querySelector(`style[${yP}]`);
    i && (cN = !1, (t = i.parentNode) === null || t === void 0 || t.removeChild(i)), document.body.removeChild(e);
  }
}
function kY(t) {
  return $Y(), !!Dc[t];
}
function TY(t) {
  const e = Dc[t];
  let n = null;
  if (e && Or())
    if (cN)
      n = CY;
    else {
      const i = document.querySelector(`style[${Rc}="${Dc[t]}"]`);
      i ? n = i.innerHTML : delete Dc[t];
    }
  return [n, e];
}
const bP = Or(), dN = "_skip_check_", fN = "_multi_value_";
function xP(t) {
  return Zx(bY(t), OY).replace(/\{%%%\:[^;];}/g, ";");
}
function PY(t) {
  return typeof t == "object" && t && (dN in t || fN in t);
}
function EY(t, e, n) {
  if (!e)
    return t;
  const i = `.${e}`, o = n === "low" ? `:where(${i})` : i;
  return t.split(",").map((a) => {
    var l;
    const s = a.trim().split(/\s+/);
    let u = s[0] || "";
    const c = ((l = u.match(/^\w+/)) === null || l === void 0 ? void 0 : l[0]) || "";
    return u = `${c}${o}${u.slice(c.length)}`, [u, ...s.slice(1)].join(" ");
  }).join(",");
}
const Gx = /* @__PURE__ */ new Set();
process.env.NODE_ENV;
const Ux = function(t) {
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, {
    root: n,
    injectHash: i,
    parentSelectors: o
  } = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
    root: !0,
    parentSelectors: []
  };
  const {
    hashId: r,
    layer: a,
    path: l,
    hashPriority: s,
    transformers: u = [],
    linters: c = []
  } = e;
  let d = "", f = {};
  function h(m) {
    const y = m.getName(r);
    if (!f[y]) {
      const [b] = Ux(m.style, e, {
        root: !1,
        parentSelectors: o
      });
      f[y] = `@keyframes ${m.getName(r)}${b}`;
    }
  }
  function p(m) {
    let y = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
    return m.forEach((b) => {
      Array.isArray(b) ? p(b, y) : b && y.push(b);
    }), y;
  }
  if (p(Array.isArray(t) ? t : [t]).forEach((m) => {
    const y = typeof m == "string" && !n ? {} : m;
    if (typeof y == "string")
      d += `${y}
`;
    else if (y._keyframe)
      h(y);
    else {
      const b = u.reduce((w, $) => {
        var C;
        return ((C = $?.visit) === null || C === void 0 ? void 0 : C.call($, w)) || w;
      }, y);
      Object.keys(b).forEach((w) => {
        var $;
        const C = b[w];
        if (typeof C == "object" && C && (w !== "animationName" || !C._keyframe) && !PY(C)) {
          let P = !1, O = w.trim(), E = !1;
          (n || i) && r ? O.startsWith("@") ? P = !0 : O = EY(w, r, s) : n && !r && (O === "&" || O === "") && (O = "", E = !0);
          const [_, D] = Ux(C, e, {
            root: E,
            injectHash: P,
            parentSelectors: [...o, O]
          });
          f = k(k({}, f), D), d += `${O}${_}`;
        } else {
          let P = function(E, _) {
            process.env.NODE_ENV !== "production" && (typeof C != "object" || !C?.[dN]) && [SY, wY, ...c].forEach((N) => N(E, _, {
              path: l,
              hashId: r,
              parentSelectors: o
            }));
            const D = E.replace(/[A-Z]/g, (N) => `-${N.toLowerCase()}`);
            let M = _;
            !oY[E] && typeof M == "number" && M !== 0 && (M = `${M}px`), E === "animationName" && _?._keyframe && (h(_), M = _.getName(r)), d += `${D}:${M};`;
          };
          const O = ($ = C?.value) !== null && $ !== void 0 ? $ : C;
          typeof C == "object" && C?.[fN] && Array.isArray(O) ? O.forEach((E) => {
            P(w, E);
          }) : P(w, O);
        }
      });
    }
  }), !n)
    d = `{${d}}`;
  else if (a && Kq()) {
    const m = a.split(",");
    d = `@layer ${m[m.length - 1].trim()} {${d}}`, m.length > 1 && (d = `@layer ${a}{%%%:%}${d}`);
  }
  return [d, f];
};
function _Y(t, e) {
  return aC(`${t.join("%")}${e}`);
}
function Jx(t, e) {
  const n = ry(), i = A(() => t.value.token._tokenKey), o = A(() => [i.value, ...t.value.path]);
  let r = bP;
  return process.env.NODE_ENV !== "production" && n.value.mock !== void 0 && (r = n.value.mock === "client"), KD(
    "style",
    o,
    // Create cache if needed
    () => {
      const {
        path: a,
        hashId: l,
        layer: s,
        nonce: u,
        clientOnly: c,
        order: d = 0
      } = t.value, f = o.value.join("|");
      if (kY(f)) {
        const [O, E] = TY(f);
        if (O)
          return [O, i.value, E, {}, c, d];
      }
      const h = e(), {
        hashPriority: p,
        container: g,
        transformers: m,
        linters: y,
        cache: b
      } = n.value, [w, $] = Ux(h, {
        hashId: l,
        hashPriority: p,
        layer: s,
        path: a.join("-"),
        transformers: m,
        linters: y
      }), C = xP(w), P = _Y(o.value, C);
      if (r) {
        const O = {
          mark: Rc,
          prepend: "queue",
          attachTo: g,
          priority: d
        }, E = typeof u == "function" ? u() : u;
        E && (O.csp = {
          nonce: E
        });
        const _ = Dp(C, P, O);
        _[Xd] = b.instanceId, _.setAttribute(jD, i.value), process.env.NODE_ENV !== "production" && _.setAttribute(Aq, o.value.join("|")), Object.keys($).forEach((D) => {
          Gx.has(D) || (Gx.add(D), Dp(xP($[D]), `_effect-${D}`, {
            mark: Rc,
            prepend: "queue",
            attachTo: g
          }));
        });
      }
      return [C, i.value, P, $, c, d];
    },
    // Remove cache if no need
    (a, l) => {
      let [, , s] = a;
      (l || n.value.autoClear) && bP && Qv(s, {
        mark: Rc
      });
    }
  ), (a) => a;
}
class gn {
  constructor(e, n) {
    this._keyframe = !0, this.name = e, this.style = n;
  }
  getName() {
    let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
    return e ? `${e}-${this.name}` : this.name;
  }
}
function kd(t) {
  return t.notSplit = !0, t;
}
kd(["borderTop", "borderBottom"]), kd(["borderTop"]), kd(["borderBottom"]), kd(["borderLeft", "borderRight"]), kd(["borderLeft"]), kd(["borderRight"]);
const IY = "4.2.6", Lp = ["blue", "purple", "cyan", "green", "magenta", "pink", "red", "orange", "yellow", "volcano", "geekblue", "lime", "gold"];
function Ro(t, e) {
  MY(t) && (t = "100%");
  var n = AY(t);
  return t = e === 360 ? t : Math.min(e, Math.max(0, parseFloat(t))), n && (t = parseInt(String(t * e), 10) / 100), Math.abs(t - e) < 1e-6 ? 1 : (e === 360 ? t = (t < 0 ? t % e + e : t % e) / parseFloat(String(e)) : t = t % e / parseFloat(String(e)), t);
}
function em(t) {
  return Math.min(1, Math.max(0, t));
}
function MY(t) {
  return typeof t == "string" && t.indexOf(".") !== -1 && parseFloat(t) === 1;
}
function AY(t) {
  return typeof t == "string" && t.indexOf("%") !== -1;
}
function hN(t) {
  return t = parseFloat(t), (isNaN(t) || t < 0 || t > 1) && (t = 1), t;
}
function tm(t) {
  return t <= 1 ? "".concat(Number(t) * 100, "%") : t;
}
function $c(t) {
  return t.length === 1 ? "0" + t : String(t);
}
function RY(t, e, n) {
  return {
    r: Ro(t, 255) * 255,
    g: Ro(e, 255) * 255,
    b: Ro(n, 255) * 255
  };
}
function OP(t, e, n) {
  t = Ro(t, 255), e = Ro(e, 255), n = Ro(n, 255);
  var i = Math.max(t, e, n), o = Math.min(t, e, n), r = 0, a = 0, l = (i + o) / 2;
  if (i === o)
    a = 0, r = 0;
  else {
    var s = i - o;
    switch (a = l > 0.5 ? s / (2 - i - o) : s / (i + o), i) {
      case t:
        r = (e - n) / s + (e < n ? 6 : 0);
        break;
      case e:
        r = (n - t) / s + 2;
        break;
      case n:
        r = (t - e) / s + 4;
        break;
    }
    r /= 6;
  }
  return { h: r, s: a, l };
}
function zb(t, e, n) {
  return n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? t + (e - t) * (6 * n) : n < 1 / 2 ? e : n < 2 / 3 ? t + (e - t) * (2 / 3 - n) * 6 : t;
}
function DY(t, e, n) {
  var i, o, r;
  if (t = Ro(t, 360), e = Ro(e, 100), n = Ro(n, 100), e === 0)
    o = n, r = n, i = n;
  else {
    var a = n < 0.5 ? n * (1 + e) : n + e - n * e, l = 2 * n - a;
    i = zb(l, a, t + 1 / 3), o = zb(l, a, t), r = zb(l, a, t - 1 / 3);
  }
  return { r: i * 255, g: o * 255, b: r * 255 };
}
function eO(t, e, n) {
  t = Ro(t, 255), e = Ro(e, 255), n = Ro(n, 255);
  var i = Math.max(t, e, n), o = Math.min(t, e, n), r = 0, a = i, l = i - o, s = i === 0 ? 0 : l / i;
  if (i === o)
    r = 0;
  else {
    switch (i) {
      case t:
        r = (e - n) / l + (e < n ? 6 : 0);
        break;
      case e:
        r = (n - t) / l + 2;
        break;
      case n:
        r = (t - e) / l + 4;
        break;
    }
    r /= 6;
  }
  return { h: r, s, v: a };
}
function NY(t, e, n) {
  t = Ro(t, 360) * 6, e = Ro(e, 100), n = Ro(n, 100);
  var i = Math.floor(t), o = t - i, r = n * (1 - e), a = n * (1 - o * e), l = n * (1 - (1 - o) * e), s = i % 6, u = [n, a, r, r, l, n][s], c = [l, n, n, a, r, r][s], d = [r, r, l, n, n, a][s];
  return { r: u * 255, g: c * 255, b: d * 255 };
}
function tO(t, e, n, i) {
  var o = [
    $c(Math.round(t).toString(16)),
    $c(Math.round(e).toString(16)),
    $c(Math.round(n).toString(16))
  ];
  return i && o[0].startsWith(o[0].charAt(1)) && o[1].startsWith(o[1].charAt(1)) && o[2].startsWith(o[2].charAt(1)) ? o[0].charAt(0) + o[1].charAt(0) + o[2].charAt(0) : o.join("");
}
function LY(t, e, n, i, o) {
  var r = [
    $c(Math.round(t).toString(16)),
    $c(Math.round(e).toString(16)),
    $c(Math.round(n).toString(16)),
    $c(zY(i))
  ];
  return o && r[0].startsWith(r[0].charAt(1)) && r[1].startsWith(r[1].charAt(1)) && r[2].startsWith(r[2].charAt(1)) && r[3].startsWith(r[3].charAt(1)) ? r[0].charAt(0) + r[1].charAt(0) + r[2].charAt(0) + r[3].charAt(0) : r.join("");
}
function zY(t) {
  return Math.round(parseFloat(t) * 255).toString(16);
}
function SP(t) {
  return Pr(t) / 255;
}
function Pr(t) {
  return parseInt(t, 16);
}
function BY(t) {
  return {
    r: t >> 16,
    g: (t & 65280) >> 8,
    b: t & 255
  };
}
var nO = {
  aliceblue: "#f0f8ff",
  antiquewhite: "#faebd7",
  aqua: "#00ffff",
  aquamarine: "#7fffd4",
  azure: "#f0ffff",
  beige: "#f5f5dc",
  bisque: "#ffe4c4",
  black: "#000000",
  blanchedalmond: "#ffebcd",
  blue: "#0000ff",
  blueviolet: "#8a2be2",
  brown: "#a52a2a",
  burlywood: "#deb887",
  cadetblue: "#5f9ea0",
  chartreuse: "#7fff00",
  chocolate: "#d2691e",
  coral: "#ff7f50",
  cornflowerblue: "#6495ed",
  cornsilk: "#fff8dc",
  crimson: "#dc143c",
  cyan: "#00ffff",
  darkblue: "#00008b",
  darkcyan: "#008b8b",
  darkgoldenrod: "#b8860b",
  darkgray: "#a9a9a9",
  darkgreen: "#006400",
  darkgrey: "#a9a9a9",
  darkkhaki: "#bdb76b",
  darkmagenta: "#8b008b",
  darkolivegreen: "#556b2f",
  darkorange: "#ff8c00",
  darkorchid: "#9932cc",
  darkred: "#8b0000",
  darksalmon: "#e9967a",
  darkseagreen: "#8fbc8f",
  darkslateblue: "#483d8b",
  darkslategray: "#2f4f4f",
  darkslategrey: "#2f4f4f",
  darkturquoise: "#00ced1",
  darkviolet: "#9400d3",
  deeppink: "#ff1493",
  deepskyblue: "#00bfff",
  dimgray: "#696969",
  dimgrey: "#696969",
  dodgerblue: "#1e90ff",
  firebrick: "#b22222",
  floralwhite: "#fffaf0",
  forestgreen: "#228b22",
  fuchsia: "#ff00ff",
  gainsboro: "#dcdcdc",
  ghostwhite: "#f8f8ff",
  goldenrod: "#daa520",
  gold: "#ffd700",
  gray: "#808080",
  green: "#008000",
  greenyellow: "#adff2f",
  grey: "#808080",
  honeydew: "#f0fff0",
  hotpink: "#ff69b4",
  indianred: "#cd5c5c",
  indigo: "#4b0082",
  ivory: "#fffff0",
  khaki: "#f0e68c",
  lavenderblush: "#fff0f5",
  lavender: "#e6e6fa",
  lawngreen: "#7cfc00",
  lemonchiffon: "#fffacd",
  lightblue: "#add8e6",
  lightcoral: "#f08080",
  lightcyan: "#e0ffff",
  lightgoldenrodyellow: "#fafad2",
  lightgray: "#d3d3d3",
  lightgreen: "#90ee90",
  lightgrey: "#d3d3d3",
  lightpink: "#ffb6c1",
  lightsalmon: "#ffa07a",
  lightseagreen: "#20b2aa",
  lightskyblue: "#87cefa",
  lightslategray: "#778899",
  lightslategrey: "#778899",
  lightsteelblue: "#b0c4de",
  lightyellow: "#ffffe0",
  lime: "#00ff00",
  limegreen: "#32cd32",
  linen: "#faf0e6",
  magenta: "#ff00ff",
  maroon: "#800000",
  mediumaquamarine: "#66cdaa",
  mediumblue: "#0000cd",
  mediumorchid: "#ba55d3",
  mediumpurple: "#9370db",
  mediumseagreen: "#3cb371",
  mediumslateblue: "#7b68ee",
  mediumspringgreen: "#00fa9a",
  mediumturquoise: "#48d1cc",
  mediumvioletred: "#c71585",
  midnightblue: "#191970",
  mintcream: "#f5fffa",
  mistyrose: "#ffe4e1",
  moccasin: "#ffe4b5",
  navajowhite: "#ffdead",
  navy: "#000080",
  oldlace: "#fdf5e6",
  olive: "#808000",
  olivedrab: "#6b8e23",
  orange: "#ffa500",
  orangered: "#ff4500",
  orchid: "#da70d6",
  palegoldenrod: "#eee8aa",
  palegreen: "#98fb98",
  paleturquoise: "#afeeee",
  palevioletred: "#db7093",
  papayawhip: "#ffefd5",
  peachpuff: "#ffdab9",
  peru: "#cd853f",
  pink: "#ffc0cb",
  plum: "#dda0dd",
  powderblue: "#b0e0e6",
  purple: "#800080",
  rebeccapurple: "#663399",
  red: "#ff0000",
  rosybrown: "#bc8f8f",
  royalblue: "#4169e1",
  saddlebrown: "#8b4513",
  salmon: "#fa8072",
  sandybrown: "#f4a460",
  seagreen: "#2e8b57",
  seashell: "#fff5ee",
  sienna: "#a0522d",
  silver: "#c0c0c0",
  skyblue: "#87ceeb",
  slateblue: "#6a5acd",
  slategray: "#708090",
  slategrey: "#708090",
  snow: "#fffafa",
  springgreen: "#00ff7f",
  steelblue: "#4682b4",
  tan: "#d2b48c",
  teal: "#008080",
  thistle: "#d8bfd8",
  tomato: "#ff6347",
  turquoise: "#40e0d0",
  violet: "#ee82ee",
  wheat: "#f5deb3",
  white: "#ffffff",
  whitesmoke: "#f5f5f5",
  yellow: "#ffff00",
  yellowgreen: "#9acd32"
};
function Bd(t) {
  var e = { r: 0, g: 0, b: 0 }, n = 1, i = null, o = null, r = null, a = !1, l = !1;
  return typeof t == "string" && (t = QY(t)), typeof t == "object" && (Gl(t.r) && Gl(t.g) && Gl(t.b) ? (e = RY(t.r, t.g, t.b), a = !0, l = String(t.r).substr(-1) === "%" ? "prgb" : "rgb") : Gl(t.h) && Gl(t.s) && Gl(t.v) ? (i = tm(t.s), o = tm(t.v), e = NY(t.h, i, o), a = !0, l = "hsv") : Gl(t.h) && Gl(t.s) && Gl(t.l) && (i = tm(t.s), r = tm(t.l), e = DY(t.h, i, r), a = !0, l = "hsl"), Object.prototype.hasOwnProperty.call(t, "a") && (n = t.a)), n = hN(n), {
    ok: a,
    format: t.format || l,
    r: Math.min(255, Math.max(e.r, 0)),
    g: Math.min(255, Math.max(e.g, 0)),
    b: Math.min(255, Math.max(e.b, 0)),
    a: n
  };
}
var FY = "[-\\+]?\\d+%?", VY = "[-\\+]?\\d*\\.\\d+%?", xu = "(?:".concat(VY, ")|(?:").concat(FY, ")"), Bb = "[\\s|\\(]+(".concat(xu, ")[,|\\s]+(").concat(xu, ")[,|\\s]+(").concat(xu, ")\\s*\\)?"), Fb = "[\\s|\\(]+(".concat(xu, ")[,|\\s]+(").concat(xu, ")[,|\\s]+(").concat(xu, ")[,|\\s]+(").concat(xu, ")\\s*\\)?"), Ta = {
  CSS_UNIT: new RegExp(xu),
  rgb: new RegExp("rgb" + Bb),
  rgba: new RegExp("rgba" + Fb),
  hsl: new RegExp("hsl" + Bb),
  hsla: new RegExp("hsla" + Fb),
  hsv: new RegExp("hsv" + Bb),
  hsva: new RegExp("hsva" + Fb),
  hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
  hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
  hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
  hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
};
function QY(t) {
  if (t = t.trim().toLowerCase(), t.length === 0)
    return !1;
  var e = !1;
  if (nO[t])
    t = nO[t], e = !0;
  else if (t === "transparent")
    return { r: 0, g: 0, b: 0, a: 0, format: "name" };
  var n = Ta.rgb.exec(t);
  return n ? { r: n[1], g: n[2], b: n[3] } : (n = Ta.rgba.exec(t), n ? { r: n[1], g: n[2], b: n[3], a: n[4] } : (n = Ta.hsl.exec(t), n ? { h: n[1], s: n[2], l: n[3] } : (n = Ta.hsla.exec(t), n ? { h: n[1], s: n[2], l: n[3], a: n[4] } : (n = Ta.hsv.exec(t), n ? { h: n[1], s: n[2], v: n[3] } : (n = Ta.hsva.exec(t), n ? { h: n[1], s: n[2], v: n[3], a: n[4] } : (n = Ta.hex8.exec(t), n ? {
    r: Pr(n[1]),
    g: Pr(n[2]),
    b: Pr(n[3]),
    a: SP(n[4]),
    format: e ? "name" : "hex8"
  } : (n = Ta.hex6.exec(t), n ? {
    r: Pr(n[1]),
    g: Pr(n[2]),
    b: Pr(n[3]),
    format: e ? "name" : "hex"
  } : (n = Ta.hex4.exec(t), n ? {
    r: Pr(n[1] + n[1]),
    g: Pr(n[2] + n[2]),
    b: Pr(n[3] + n[3]),
    a: SP(n[4] + n[4]),
    format: e ? "name" : "hex8"
  } : (n = Ta.hex3.exec(t), n ? {
    r: Pr(n[1] + n[1]),
    g: Pr(n[2] + n[2]),
    b: Pr(n[3] + n[3]),
    format: e ? "name" : "hex"
  } : !1)))))))));
}
function Gl(t) {
  return !!Ta.CSS_UNIT.exec(String(t));
}
var jn = (
  /** @class */
  (function() {
    function t(e, n) {
      e === void 0 && (e = ""), n === void 0 && (n = {});
      var i;
      if (e instanceof t)
        return e;
      typeof e == "number" && (e = BY(e)), this.originalInput = e;
      var o = Bd(e);
      this.originalInput = e, this.r = o.r, this.g = o.g, this.b = o.b, this.a = o.a, this.roundA = Math.round(100 * this.a) / 100, this.format = (i = n.format) !== null && i !== void 0 ? i : o.format, this.gradientType = n.gradientType, this.r < 1 && (this.r = Math.round(this.r)), this.g < 1 && (this.g = Math.round(this.g)), this.b < 1 && (this.b = Math.round(this.b)), this.isValid = o.ok;
    }
    return t.prototype.isDark = function() {
      return this.getBrightness() < 128;
    }, t.prototype.isLight = function() {
      return !this.isDark();
    }, t.prototype.getBrightness = function() {
      var e = this.toRgb();
      return (e.r * 299 + e.g * 587 + e.b * 114) / 1e3;
    }, t.prototype.getLuminance = function() {
      var e = this.toRgb(), n, i, o, r = e.r / 255, a = e.g / 255, l = e.b / 255;
      return r <= 0.03928 ? n = r / 12.92 : n = Math.pow((r + 0.055) / 1.055, 2.4), a <= 0.03928 ? i = a / 12.92 : i = Math.pow((a + 0.055) / 1.055, 2.4), l <= 0.03928 ? o = l / 12.92 : o = Math.pow((l + 0.055) / 1.055, 2.4), 0.2126 * n + 0.7152 * i + 0.0722 * o;
    }, t.prototype.getAlpha = function() {
      return this.a;
    }, t.prototype.setAlpha = function(e) {
      return this.a = hN(e), this.roundA = Math.round(100 * this.a) / 100, this;
    }, t.prototype.isMonochrome = function() {
      var e = this.toHsl().s;
      return e === 0;
    }, t.prototype.toHsv = function() {
      var e = eO(this.r, this.g, this.b);
      return { h: e.h * 360, s: e.s, v: e.v, a: this.a };
    }, t.prototype.toHsvString = function() {
      var e = eO(this.r, this.g, this.b), n = Math.round(e.h * 360), i = Math.round(e.s * 100), o = Math.round(e.v * 100);
      return this.a === 1 ? "hsv(".concat(n, ", ").concat(i, "%, ").concat(o, "%)") : "hsva(".concat(n, ", ").concat(i, "%, ").concat(o, "%, ").concat(this.roundA, ")");
    }, t.prototype.toHsl = function() {
      var e = OP(this.r, this.g, this.b);
      return { h: e.h * 360, s: e.s, l: e.l, a: this.a };
    }, t.prototype.toHslString = function() {
      var e = OP(this.r, this.g, this.b), n = Math.round(e.h * 360), i = Math.round(e.s * 100), o = Math.round(e.l * 100);
      return this.a === 1 ? "hsl(".concat(n, ", ").concat(i, "%, ").concat(o, "%)") : "hsla(".concat(n, ", ").concat(i, "%, ").concat(o, "%, ").concat(this.roundA, ")");
    }, t.prototype.toHex = function(e) {
      return e === void 0 && (e = !1), tO(this.r, this.g, this.b, e);
    }, t.prototype.toHexString = function(e) {
      return e === void 0 && (e = !1), "#" + this.toHex(e);
    }, t.prototype.toHex8 = function(e) {
      return e === void 0 && (e = !1), LY(this.r, this.g, this.b, this.a, e);
    }, t.prototype.toHex8String = function(e) {
      return e === void 0 && (e = !1), "#" + this.toHex8(e);
    }, t.prototype.toHexShortString = function(e) {
      return e === void 0 && (e = !1), this.a === 1 ? this.toHexString(e) : this.toHex8String(e);
    }, t.prototype.toRgb = function() {
      return {
        r: Math.round(this.r),
        g: Math.round(this.g),
        b: Math.round(this.b),
        a: this.a
      };
    }, t.prototype.toRgbString = function() {
      var e = Math.round(this.r), n = Math.round(this.g), i = Math.round(this.b);
      return this.a === 1 ? "rgb(".concat(e, ", ").concat(n, ", ").concat(i, ")") : "rgba(".concat(e, ", ").concat(n, ", ").concat(i, ", ").concat(this.roundA, ")");
    }, t.prototype.toPercentageRgb = function() {
      var e = function(n) {
        return "".concat(Math.round(Ro(n, 255) * 100), "%");
      };
      return {
        r: e(this.r),
        g: e(this.g),
        b: e(this.b),
        a: this.a
      };
    }, t.prototype.toPercentageRgbString = function() {
      var e = function(n) {
        return Math.round(Ro(n, 255) * 100);
      };
      return this.a === 1 ? "rgb(".concat(e(this.r), "%, ").concat(e(this.g), "%, ").concat(e(this.b), "%)") : "rgba(".concat(e(this.r), "%, ").concat(e(this.g), "%, ").concat(e(this.b), "%, ").concat(this.roundA, ")");
    }, t.prototype.toName = function() {
      if (this.a === 0)
        return "transparent";
      if (this.a < 1)
        return !1;
      for (var e = "#" + tO(this.r, this.g, this.b, !1), n = 0, i = Object.entries(nO); n < i.length; n++) {
        var o = i[n], r = o[0], a = o[1];
        if (e === a)
          return r;
      }
      return !1;
    }, t.prototype.toString = function(e) {
      var n = !!e;
      e = e ?? this.format;
      var i = !1, o = this.a < 1 && this.a >= 0, r = !n && o && (e.startsWith("hex") || e === "name");
      return r ? e === "name" && this.a === 0 ? this.toName() : this.toRgbString() : (e === "rgb" && (i = this.toRgbString()), e === "prgb" && (i = this.toPercentageRgbString()), (e === "hex" || e === "hex6") && (i = this.toHexString()), e === "hex3" && (i = this.toHexString(!0)), e === "hex4" && (i = this.toHex8String(!0)), e === "hex8" && (i = this.toHex8String()), e === "name" && (i = this.toName()), e === "hsl" && (i = this.toHslString()), e === "hsv" && (i = this.toHsvString()), i || this.toHexString());
    }, t.prototype.toNumber = function() {
      return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);
    }, t.prototype.clone = function() {
      return new t(this.toString());
    }, t.prototype.lighten = function(e) {
      e === void 0 && (e = 10);
      var n = this.toHsl();
      return n.l += e / 100, n.l = em(n.l), new t(n);
    }, t.prototype.brighten = function(e) {
      e === void 0 && (e = 10);
      var n = this.toRgb();
      return n.r = Math.max(0, Math.min(255, n.r - Math.round(255 * -(e / 100)))), n.g = Math.max(0, Math.min(255, n.g - Math.round(255 * -(e / 100)))), n.b = Math.max(0, Math.min(255, n.b - Math.round(255 * -(e / 100)))), new t(n);
    }, t.prototype.darken = function(e) {
      e === void 0 && (e = 10);
      var n = this.toHsl();
      return n.l -= e / 100, n.l = em(n.l), new t(n);
    }, t.prototype.tint = function(e) {
      return e === void 0 && (e = 10), this.mix("white", e);
    }, t.prototype.shade = function(e) {
      return e === void 0 && (e = 10), this.mix("black", e);
    }, t.prototype.desaturate = function(e) {
      e === void 0 && (e = 10);
      var n = this.toHsl();
      return n.s -= e / 100, n.s = em(n.s), new t(n);
    }, t.prototype.saturate = function(e) {
      e === void 0 && (e = 10);
      var n = this.toHsl();
      return n.s += e / 100, n.s = em(n.s), new t(n);
    }, t.prototype.greyscale = function() {
      return this.desaturate(100);
    }, t.prototype.spin = function(e) {
      var n = this.toHsl(), i = (n.h + e) % 360;
      return n.h = i < 0 ? 360 + i : i, new t(n);
    }, t.prototype.mix = function(e, n) {
      n === void 0 && (n = 50);
      var i = this.toRgb(), o = new t(e).toRgb(), r = n / 100, a = {
        r: (o.r - i.r) * r + i.r,
        g: (o.g - i.g) * r + i.g,
        b: (o.b - i.b) * r + i.b,
        a: (o.a - i.a) * r + i.a
      };
      return new t(a);
    }, t.prototype.analogous = function(e, n) {
      e === void 0 && (e = 6), n === void 0 && (n = 30);
      var i = this.toHsl(), o = 360 / n, r = [this];
      for (i.h = (i.h - (o * e >> 1) + 720) % 360; --e; )
        i.h = (i.h + o) % 360, r.push(new t(i));
      return r;
    }, t.prototype.complement = function() {
      var e = this.toHsl();
      return e.h = (e.h + 180) % 360, new t(e);
    }, t.prototype.monochromatic = function(e) {
      e === void 0 && (e = 6);
      for (var n = this.toHsv(), i = n.h, o = n.s, r = n.v, a = [], l = 1 / e; e--; )
        a.push(new t({ h: i, s: o, v: r })), r = (r + l) % 1;
      return a;
    }, t.prototype.splitcomplement = function() {
      var e = this.toHsl(), n = e.h;
      return [
        this,
        new t({ h: (n + 72) % 360, s: e.s, l: e.l }),
        new t({ h: (n + 216) % 360, s: e.s, l: e.l })
      ];
    }, t.prototype.onBackground = function(e) {
      var n = this.toRgb(), i = new t(e).toRgb(), o = n.a + i.a * (1 - n.a);
      return new t({
        r: (n.r * n.a + i.r * i.a * (1 - n.a)) / o,
        g: (n.g * n.a + i.g * i.a * (1 - n.a)) / o,
        b: (n.b * n.a + i.b * i.a * (1 - n.a)) / o,
        a: o
      });
    }, t.prototype.triad = function() {
      return this.polyad(3);
    }, t.prototype.tetrad = function() {
      return this.polyad(4);
    }, t.prototype.polyad = function(e) {
      for (var n = this.toHsl(), i = n.h, o = [this], r = 360 / e, a = 1; a < e; a++)
        o.push(new t({ h: (i + a * r) % 360, s: n.s, l: n.l }));
      return o;
    }, t.prototype.equals = function(e) {
      return this.toRgbString() === new t(e).toRgbString();
    }, t;
  })()
), nm = 2, wP = 0.16, HY = 0.05, WY = 0.05, jY = 0.15, pN = 5, gN = 4, qY = [{
  index: 7,
  opacity: 0.15
}, {
  index: 6,
  opacity: 0.25
}, {
  index: 5,
  opacity: 0.3
}, {
  index: 5,
  opacity: 0.45
}, {
  index: 5,
  opacity: 0.65
}, {
  index: 5,
  opacity: 0.85
}, {
  index: 4,
  opacity: 0.9
}, {
  index: 3,
  opacity: 0.95
}, {
  index: 2,
  opacity: 0.97
}, {
  index: 1,
  opacity: 0.98
}];
function CP(t) {
  var e = t.r, n = t.g, i = t.b, o = eO(e, n, i);
  return {
    h: o.h * 360,
    s: o.s,
    v: o.v
  };
}
function im(t) {
  var e = t.r, n = t.g, i = t.b;
  return "#".concat(tO(e, n, i, !1));
}
function YY(t, e, n) {
  var i = n / 100, o = {
    r: (e.r - t.r) * i + t.r,
    g: (e.g - t.g) * i + t.g,
    b: (e.b - t.b) * i + t.b
  };
  return o;
}
function $P(t, e, n) {
  var i;
  return Math.round(t.h) >= 60 && Math.round(t.h) <= 240 ? i = n ? Math.round(t.h) - nm * e : Math.round(t.h) + nm * e : i = n ? Math.round(t.h) + nm * e : Math.round(t.h) - nm * e, i < 0 ? i += 360 : i >= 360 && (i -= 360), i;
}
function kP(t, e, n) {
  if (t.h === 0 && t.s === 0)
    return t.s;
  var i;
  return n ? i = t.s - wP * e : e === gN ? i = t.s + wP : i = t.s + HY * e, i > 1 && (i = 1), n && e === pN && i > 0.1 && (i = 0.1), i < 0.06 && (i = 0.06), Number(i.toFixed(2));
}
function TP(t, e, n) {
  var i;
  return n ? i = t.v + WY * e : i = t.v - jY * e, i > 1 && (i = 1), Number(i.toFixed(2));
}
function Ts(t) {
  for (var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = [], i = Bd(t), o = pN; o > 0; o -= 1) {
    var r = CP(i), a = im(Bd({
      h: $P(r, o, !0),
      s: kP(r, o, !0),
      v: TP(r, o, !0)
    }));
    n.push(a);
  }
  n.push(im(i));
  for (var l = 1; l <= gN; l += 1) {
    var s = CP(i), u = im(Bd({
      h: $P(s, l),
      s: kP(s, l),
      v: TP(s, l)
    }));
    n.push(u);
  }
  return e.theme === "dark" ? qY.map(function(c) {
    var d = c.index, f = c.opacity, h = im(YY(Bd(e.backgroundColor || "#141414"), Bd(n[d]), f * 100));
    return h;
  }) : n;
}
var Vb = {
  red: "#F5222D",
  volcano: "#FA541C",
  orange: "#FA8C16",
  gold: "#FAAD14",
  yellow: "#FADB14",
  lime: "#A0D911",
  green: "#52C41A",
  cyan: "#13C2C2",
  blue: "#1890FF",
  geekblue: "#2F54EB",
  purple: "#722ED1",
  magenta: "#EB2F96",
  grey: "#666666"
}, rv = {}, Qb = {};
Object.keys(Vb).forEach(function(t) {
  rv[t] = Ts(Vb[t]), rv[t].primary = rv[t][5], Qb[t] = Ts(Vb[t], {
    theme: "dark",
    backgroundColor: "#141414"
  }), Qb[t].primary = Qb[t][5];
});
var KY = rv.blue;
const XY = (t) => {
  const {
    controlHeight: e
  } = t;
  return {
    controlHeightSM: e * 0.75,
    controlHeightXS: e * 0.5,
    controlHeightLG: e * 1.25
  };
};
function ZY(t) {
  const {
    sizeUnit: e,
    sizeStep: n
  } = t;
  return {
    sizeXXL: e * (n + 8),
    sizeXL: e * (n + 4),
    sizeLG: e * (n + 2),
    sizeMD: e * (n + 1),
    sizeMS: e * n,
    size: e * n,
    sizeSM: e * (n - 1),
    sizeXS: e * (n - 2),
    sizeXXS: e * (n - 3)
    // 4
  };
}
const sC = {
  blue: "#1677ff",
  purple: "#722ED1",
  cyan: "#13C2C2",
  green: "#52C41A",
  magenta: "#EB2F96",
  pink: "#eb2f96",
  red: "#F5222D",
  orange: "#FA8C16",
  yellow: "#FADB14",
  volcano: "#FA541C",
  geekblue: "#2F54EB",
  gold: "#FAAD14",
  lime: "#A0D911"
}, uy = k(k({}, sC), {
  // Color
  colorPrimary: "#1677ff",
  colorSuccess: "#52c41a",
  colorWarning: "#faad14",
  colorError: "#ff4d4f",
  colorInfo: "#1677ff",
  colorTextBase: "",
  colorBgBase: "",
  // Font
  fontFamily: `-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
'Noto Color Emoji'`,
  fontSize: 14,
  // Line
  lineWidth: 1,
  lineType: "solid",
  // Motion
  motionUnit: 0.1,
  motionBase: 0,
  motionEaseOutCirc: "cubic-bezier(0.08, 0.82, 0.17, 1)",
  motionEaseInOutCirc: "cubic-bezier(0.78, 0.14, 0.15, 0.86)",
  motionEaseOut: "cubic-bezier(0.215, 0.61, 0.355, 1)",
  motionEaseInOut: "cubic-bezier(0.645, 0.045, 0.355, 1)",
  motionEaseOutBack: "cubic-bezier(0.12, 0.4, 0.29, 1.46)",
  motionEaseInBack: "cubic-bezier(0.71, -0.46, 0.88, 0.6)",
  motionEaseInQuint: "cubic-bezier(0.755, 0.05, 0.855, 0.06)",
  motionEaseOutQuint: "cubic-bezier(0.23, 1, 0.32, 1)",
  // Radius
  borderRadius: 6,
  // Size
  sizeUnit: 4,
  sizeStep: 4,
  sizePopupArrow: 16,
  // Control Base
  controlHeight: 32,
  // zIndex
  zIndexBase: 0,
  zIndexPopupBase: 1e3,
  // Image
  opacityImage: 1,
  // Wireframe
  wireframe: !1
});
function mN(t, e) {
  let {
    generateColorPalettes: n,
    generateNeutralColorPalettes: i
  } = e;
  const {
    colorSuccess: o,
    colorWarning: r,
    colorError: a,
    colorInfo: l,
    colorPrimary: s,
    colorBgBase: u,
    colorTextBase: c
  } = t, d = n(s), f = n(o), h = n(r), p = n(a), g = n(l), m = i(u, c);
  return k(k({}, m), {
    colorPrimaryBg: d[1],
    colorPrimaryBgHover: d[2],
    colorPrimaryBorder: d[3],
    colorPrimaryBorderHover: d[4],
    colorPrimaryHover: d[5],
    colorPrimary: d[6],
    colorPrimaryActive: d[7],
    colorPrimaryTextHover: d[8],
    colorPrimaryText: d[9],
    colorPrimaryTextActive: d[10],
    colorSuccessBg: f[1],
    colorSuccessBgHover: f[2],
    colorSuccessBorder: f[3],
    colorSuccessBorderHover: f[4],
    colorSuccessHover: f[4],
    colorSuccess: f[6],
    colorSuccessActive: f[7],
    colorSuccessTextHover: f[8],
    colorSuccessText: f[9],
    colorSuccessTextActive: f[10],
    colorErrorBg: p[1],
    colorErrorBgHover: p[2],
    colorErrorBorder: p[3],
    colorErrorBorderHover: p[4],
    colorErrorHover: p[5],
    colorError: p[6],
    colorErrorActive: p[7],
    colorErrorTextHover: p[8],
    colorErrorText: p[9],
    colorErrorTextActive: p[10],
    colorWarningBg: h[1],
    colorWarningBgHover: h[2],
    colorWarningBorder: h[3],
    colorWarningBorderHover: h[4],
    colorWarningHover: h[4],
    colorWarning: h[6],
    colorWarningActive: h[7],
    colorWarningTextHover: h[8],
    colorWarningText: h[9],
    colorWarningTextActive: h[10],
    colorInfoBg: g[1],
    colorInfoBgHover: g[2],
    colorInfoBorder: g[3],
    colorInfoBorderHover: g[4],
    colorInfoHover: g[4],
    colorInfo: g[6],
    colorInfoActive: g[7],
    colorInfoTextHover: g[8],
    colorInfoText: g[9],
    colorInfoTextActive: g[10],
    colorBgMask: new jn("#000").setAlpha(0.45).toRgbString(),
    colorWhite: "#fff"
  });
}
const GY = (t) => {
  let e = t, n = t, i = t, o = t;
  return t < 6 && t >= 5 ? e = t + 1 : t < 16 && t >= 6 ? e = t + 2 : t >= 16 && (e = 16), t < 7 && t >= 5 ? n = 4 : t < 8 && t >= 7 ? n = 5 : t < 14 && t >= 8 ? n = 6 : t < 16 && t >= 14 ? n = 7 : t >= 16 && (n = 8), t < 6 && t >= 2 ? i = 1 : t >= 6 && (i = 2), t > 4 && t < 8 ? o = 4 : t >= 8 && (o = 6), {
    borderRadius: t > 16 ? 16 : t,
    borderRadiusXS: i,
    borderRadiusSM: n,
    borderRadiusLG: e,
    borderRadiusOuter: o
  };
};
function UY(t) {
  const {
    motionUnit: e,
    motionBase: n,
    borderRadius: i,
    lineWidth: o
  } = t;
  return k({
    // motion
    motionDurationFast: `${(n + e).toFixed(1)}s`,
    motionDurationMid: `${(n + e * 2).toFixed(1)}s`,
    motionDurationSlow: `${(n + e * 3).toFixed(1)}s`,
    // line
    lineWidthBold: o + 1
  }, GY(i));
}
const Ul = (t, e) => new jn(t).setAlpha(e).toRgbString(), Eh = (t, e) => new jn(t).darken(e).toHexString(), JY = (t) => {
  const e = Ts(t);
  return {
    1: e[0],
    2: e[1],
    3: e[2],
    4: e[3],
    5: e[4],
    6: e[5],
    7: e[6],
    8: e[4],
    9: e[5],
    10: e[6]
    // 8: colors[7],
    // 9: colors[8],
    // 10: colors[9],
  };
}, eK = (t, e) => {
  const n = t || "#fff", i = e || "#000";
  return {
    colorBgBase: n,
    colorTextBase: i,
    colorText: Ul(i, 0.88),
    colorTextSecondary: Ul(i, 0.65),
    colorTextTertiary: Ul(i, 0.45),
    colorTextQuaternary: Ul(i, 0.25),
    colorFill: Ul(i, 0.15),
    colorFillSecondary: Ul(i, 0.06),
    colorFillTertiary: Ul(i, 0.04),
    colorFillQuaternary: Ul(i, 0.02),
    colorBgLayout: Eh(n, 4),
    colorBgContainer: Eh(n, 0),
    colorBgElevated: Eh(n, 0),
    colorBgSpotlight: Ul(i, 0.85),
    colorBorder: Eh(n, 15),
    colorBorderSecondary: Eh(n, 6)
  };
};
function tK(t) {
  const e = new Array(10).fill(null).map((n, i) => {
    const o = i - 1, r = t * Math.pow(2.71828, o / 5), a = i > 1 ? Math.floor(r) : Math.ceil(r);
    return Math.floor(a / 2) * 2;
  });
  return e[1] = t, e.map((n) => {
    const i = n + 8;
    return {
      size: n,
      lineHeight: i / n
    };
  });
}
const nK = (t) => {
  const e = tK(t), n = e.map((o) => o.size), i = e.map((o) => o.lineHeight);
  return {
    fontSizeSM: n[0],
    fontSize: n[1],
    fontSizeLG: n[2],
    fontSizeXL: n[3],
    fontSizeHeading1: n[6],
    fontSizeHeading2: n[5],
    fontSizeHeading3: n[4],
    fontSizeHeading4: n[3],
    fontSizeHeading5: n[2],
    lineHeight: i[1],
    lineHeightLG: i[2],
    lineHeightSM: i[0],
    lineHeightHeading1: i[6],
    lineHeightHeading2: i[5],
    lineHeightHeading3: i[4],
    lineHeightHeading4: i[3],
    lineHeightHeading5: i[2]
  };
};
function uC(t) {
  const e = Object.keys(sC).map((n) => {
    const i = Ts(t[n]);
    return new Array(10).fill(1).reduce((o, r, a) => (o[`${n}-${a + 1}`] = i[a], o), {});
  }).reduce((n, i) => (n = k(k({}, n), i), n), {});
  return k(k(k(k(k(k(k({}, t), e), mN(t, {
    generateColorPalettes: JY,
    generateNeutralColorPalettes: eK
  })), nK(t.fontSize)), ZY(t)), XY(t)), UY(t));
}
function Hb(t) {
  return t >= 0 && t <= 255;
}
function om(t, e) {
  const {
    r: n,
    g: i,
    b: o,
    a: r
  } = new jn(t).toRgb();
  if (r < 1)
    return t;
  const {
    r: a,
    g: l,
    b: s
  } = new jn(e).toRgb();
  for (let u = 0.01; u <= 1; u += 0.01) {
    const c = Math.round((n - a * (1 - u)) / u), d = Math.round((i - l * (1 - u)) / u), f = Math.round((o - s * (1 - u)) / u);
    if (Hb(c) && Hb(d) && Hb(f))
      return new jn({
        r: c,
        g: d,
        b: f,
        a: Math.round(u * 100) / 100
      }).toRgbString();
  }
  return new jn({
    r: n,
    g: i,
    b: o,
    a: 1
  }).toRgbString();
}
var iK = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
function oK(t) {
  const {
    override: e
  } = t, n = iK(t, ["override"]), i = k({}, e);
  Object.keys(uy).forEach((h) => {
    delete i[h];
  });
  const o = k(k({}, n), i), r = 480, a = 576, l = 768, s = 992, u = 1200, c = 1600, d = 2e3;
  return k(k(k({}, o), {
    colorLink: o.colorInfoText,
    colorLinkHover: o.colorInfoHover,
    colorLinkActive: o.colorInfoActive,
    // ============== Background ============== //
    colorFillContent: o.colorFillSecondary,
    colorFillContentHover: o.colorFill,
    colorFillAlter: o.colorFillQuaternary,
    colorBgContainerDisabled: o.colorFillTertiary,
    // ============== Split ============== //
    colorBorderBg: o.colorBgContainer,
    colorSplit: om(o.colorBorderSecondary, o.colorBgContainer),
    // ============== Text ============== //
    colorTextPlaceholder: o.colorTextQuaternary,
    colorTextDisabled: o.colorTextQuaternary,
    colorTextHeading: o.colorText,
    colorTextLabel: o.colorTextSecondary,
    colorTextDescription: o.colorTextTertiary,
    colorTextLightSolid: o.colorWhite,
    colorHighlight: o.colorError,
    colorBgTextHover: o.colorFillSecondary,
    colorBgTextActive: o.colorFill,
    colorIcon: o.colorTextTertiary,
    colorIconHover: o.colorText,
    colorErrorOutline: om(o.colorErrorBg, o.colorBgContainer),
    colorWarningOutline: om(o.colorWarningBg, o.colorBgContainer),
    // Font
    fontSizeIcon: o.fontSizeSM,
    // Control
    lineWidth: o.lineWidth,
    controlOutlineWidth: o.lineWidth * 2,
    // Checkbox size and expand icon size
    controlInteractiveSize: o.controlHeight / 2,
    controlItemBgHover: o.colorFillTertiary,
    controlItemBgActive: o.colorPrimaryBg,
    controlItemBgActiveHover: o.colorPrimaryBgHover,
    controlItemBgActiveDisabled: o.colorFill,
    controlTmpOutline: o.colorFillQuaternary,
    controlOutline: om(o.colorPrimaryBg, o.colorBgContainer),
    lineType: o.lineType,
    borderRadius: o.borderRadius,
    borderRadiusXS: o.borderRadiusXS,
    borderRadiusSM: o.borderRadiusSM,
    borderRadiusLG: o.borderRadiusLG,
    fontWeightStrong: 600,
    opacityLoading: 0.65,
    linkDecoration: "none",
    linkHoverDecoration: "none",
    linkFocusDecoration: "none",
    controlPaddingHorizontal: 12,
    controlPaddingHorizontalSM: 8,
    paddingXXS: o.sizeXXS,
    paddingXS: o.sizeXS,
    paddingSM: o.sizeSM,
    padding: o.size,
    paddingMD: o.sizeMD,
    paddingLG: o.sizeLG,
    paddingXL: o.sizeXL,
    paddingContentHorizontalLG: o.sizeLG,
    paddingContentVerticalLG: o.sizeMS,
    paddingContentHorizontal: o.sizeMS,
    paddingContentVertical: o.sizeSM,
    paddingContentHorizontalSM: o.size,
    paddingContentVerticalSM: o.sizeXS,
    marginXXS: o.sizeXXS,
    marginXS: o.sizeXS,
    marginSM: o.sizeSM,
    margin: o.size,
    marginMD: o.sizeMD,
    marginLG: o.sizeLG,
    marginXL: o.sizeXL,
    marginXXL: o.sizeXXL,
    boxShadow: `
      0 1px 2px 0 rgba(0, 0, 0, 0.03),
      0 1px 6px -1px rgba(0, 0, 0, 0.02),
      0 2px 4px 0 rgba(0, 0, 0, 0.02)
    `,
    boxShadowSecondary: `
      0 6px 16px 0 rgba(0, 0, 0, 0.08),
      0 3px 6px -4px rgba(0, 0, 0, 0.12),
      0 9px 28px 8px rgba(0, 0, 0, 0.05)
    `,
    boxShadowTertiary: `
      0 1px 2px 0 rgba(0, 0, 0, 0.03),
      0 1px 6px -1px rgba(0, 0, 0, 0.02),
      0 2px 4px 0 rgba(0, 0, 0, 0.02)
    `,
    screenXS: r,
    screenXSMin: r,
    screenXSMax: a - 1,
    screenSM: a,
    screenSMMin: a,
    screenSMMax: l - 1,
    screenMD: l,
    screenMDMin: l,
    screenMDMax: s - 1,
    screenLG: s,
    screenLGMin: s,
    screenLGMax: u - 1,
    screenXL: u,
    screenXLMin: u,
    screenXLMax: c - 1,
    screenXXL: c,
    screenXXLMin: c,
    screenXXLMax: d - 1,
    screenXXXL: d,
    screenXXXLMin: d,
    // FIXME: component box-shadow, should be removed
    boxShadowPopoverArrow: "3px 3px 7px rgba(0, 0, 0, 0.1)",
    boxShadowCard: `
      0 1px 2px -2px ${new jn("rgba(0, 0, 0, 0.16)").toRgbString()},
      0 3px 6px 0 ${new jn("rgba(0, 0, 0, 0.12)").toRgbString()},
      0 5px 12px 4px ${new jn("rgba(0, 0, 0, 0.09)").toRgbString()}
    `,
    boxShadowDrawerRight: `
      -6px 0 16px 0 rgba(0, 0, 0, 0.08),
      -3px 0 6px -4px rgba(0, 0, 0, 0.12),
      -9px 0 28px 8px rgba(0, 0, 0, 0.05)
    `,
    boxShadowDrawerLeft: `
      6px 0 16px 0 rgba(0, 0, 0, 0.08),
      3px 0 6px -4px rgba(0, 0, 0, 0.12),
      9px 0 28px 8px rgba(0, 0, 0, 0.05)
    `,
    boxShadowDrawerUp: `
      0 6px 16px 0 rgba(0, 0, 0, 0.08),
      0 3px 6px -4px rgba(0, 0, 0, 0.12),
      0 9px 28px 8px rgba(0, 0, 0, 0.05)
    `,
    boxShadowDrawerDown: `
      0 -6px 16px 0 rgba(0, 0, 0, 0.08),
      0 -3px 6px -4px rgba(0, 0, 0, 0.12),
      0 -9px 28px 8px rgba(0, 0, 0, 0.05)
    `,
    boxShadowTabsOverflowLeft: "inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)",
    boxShadowTabsOverflowRight: "inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)",
    boxShadowTabsOverflowTop: "inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)",
    boxShadowTabsOverflowBottom: "inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)"
  }), i);
}
const rK = (t) => ({
  // FIXME: This use link but is a operation unit. Seems should be a colorPrimary.
  // And Typography use this to generate link style which should not do this.
  color: t.colorLink,
  textDecoration: "none",
  outline: "none",
  cursor: "pointer",
  transition: `color ${t.motionDurationSlow}`,
  "&:focus, &:hover": {
    color: t.colorLinkHover
  },
  "&:active": {
    color: t.colorLinkActive
  }
}), cC = (t, e, n, i, o) => {
  const r = t / 2, a = 0, l = r, s = n * 1 / Math.sqrt(2), u = r - n * (1 - 1 / Math.sqrt(2)), c = r - e * (1 / Math.sqrt(2)), d = n * (Math.sqrt(2) - 1) + e * (1 / Math.sqrt(2)), f = 2 * r - c, h = d, p = 2 * r - s, g = u, m = 2 * r - a, y = l, b = r * Math.sqrt(2) + n * (Math.sqrt(2) - 2), w = n * (Math.sqrt(2) - 1);
  return {
    pointerEvents: "none",
    width: t,
    height: t,
    overflow: "hidden",
    "&::after": {
      content: '""',
      position: "absolute",
      width: b,
      height: b,
      bottom: 0,
      insetInline: 0,
      margin: "auto",
      borderRadius: {
        _skip_check_: !0,
        value: `0 0 ${e}px 0`
      },
      transform: "translateY(50%) rotate(-135deg)",
      boxShadow: o,
      zIndex: 0,
      background: "transparent"
    },
    "&::before": {
      position: "absolute",
      bottom: 0,
      insetInlineStart: 0,
      width: t,
      height: t / 2,
      background: i,
      clipPath: {
        _multi_value_: !0,
        value: [`polygon(${w}px 100%, 50% ${w}px, ${2 * r - w}px 100%, ${w}px 100%)`, `path('M ${a} ${l} A ${n} ${n} 0 0 0 ${s} ${u} L ${c} ${d} A ${e} ${e} 0 0 1 ${f} ${h} L ${p} ${g} A ${n} ${n} 0 0 0 ${m} ${y} Z')`]
      },
      content: '""'
    }
  };
};
function vN(t, e) {
  return Lp.reduce((n, i) => {
    const o = t[`${i}-1`], r = t[`${i}-3`], a = t[`${i}-6`], l = t[`${i}-7`];
    return k(k({}, n), e(i, {
      lightColor: o,
      lightBorderColor: r,
      darkColor: a,
      textColor: l
    }));
  }, {});
}
const Ps = {
  overflow: "hidden",
  whiteSpace: "nowrap",
  textOverflow: "ellipsis"
}, kn = (t) => ({
  boxSizing: "border-box",
  margin: 0,
  padding: 0,
  color: t.colorText,
  fontSize: t.fontSize,
  // font-variant: @font-variant-base;
  lineHeight: t.lineHeight,
  listStyle: "none",
  // font-feature-settings: @font-feature-settings-base;
  fontFamily: t.fontFamily
}), ah = () => ({
  display: "inline-flex",
  alignItems: "center",
  color: "inherit",
  fontStyle: "normal",
  lineHeight: 0,
  textAlign: "center",
  textTransform: "none",
  // for SVG icon, see https://blog.prototypr.io/align-svg-icons-to-text-and-say-goodbye-to-font-icons-d44b3d7b26b4
  verticalAlign: "-0.125em",
  textRendering: "optimizeLegibility",
  "-webkit-font-smoothing": "antialiased",
  "-moz-osx-font-smoothing": "grayscale",
  "> *": {
    lineHeight: 1
  },
  svg: {
    display: "inline-block"
  }
}), Es = () => ({
  // https://github.com/ant-design/ant-design/issues/21301#issuecomment-583955229
  "&::before": {
    display: "table",
    content: '""'
  },
  "&::after": {
    // https://github.com/ant-design/ant-design/issues/21864
    display: "table",
    clear: "both",
    content: '""'
  }
}), aK = (t) => ({
  a: {
    color: t.colorLink,
    textDecoration: t.linkDecoration,
    backgroundColor: "transparent",
    outline: "none",
    cursor: "pointer",
    transition: `color ${t.motionDurationSlow}`,
    "-webkit-text-decoration-skip": "objects",
    "&:hover": {
      color: t.colorLinkHover
    },
    "&:active": {
      color: t.colorLinkActive
    },
    "&:active,\n  &:hover": {
      textDecoration: t.linkHoverDecoration,
      outline: 0
    },
    // https://github.com/ant-design/ant-design/issues/22503
    "&:focus": {
      textDecoration: t.linkFocusDecoration,
      outline: 0
    },
    "&[disabled]": {
      color: t.colorTextDisabled,
      cursor: "not-allowed"
    }
  }
}), lK = (t, e) => {
  const {
    fontFamily: n,
    fontSize: i
  } = t, o = `[class^="${e}"], [class*=" ${e}"]`;
  return {
    [o]: {
      fontFamily: n,
      fontSize: i,
      boxSizing: "border-box",
      "&::before, &::after": {
        boxSizing: "border-box"
      },
      [o]: {
        boxSizing: "border-box",
        "&::before, &::after": {
          boxSizing: "border-box"
        }
      }
    }
  };
}, _s = (t) => ({
  outline: `${t.lineWidthBold}px solid ${t.colorPrimaryBorder}`,
  outlineOffset: 1,
  transition: "outline-offset 0s, outline 0s"
}), Au = (t) => ({
  "&:focus-visible": k({}, _s(t))
});
function Vn(t, e, n) {
  return (i) => {
    const o = A(() => i?.value), [r, a, l] = lh(), {
      getPrefixCls: s,
      iconPrefixCls: u
    } = oy(), c = A(() => s()), d = A(() => ({
      theme: r.value,
      token: a.value,
      hashId: l.value,
      path: ["Shared", c.value]
    }));
    Jx(d, () => [{
      // Link
      "&": aK(a.value)
    }]);
    const f = A(() => ({
      theme: r.value,
      token: a.value,
      hashId: l.value,
      path: [t, o.value, u.value]
    }));
    return [Jx(f, () => {
      const {
        token: h,
        flush: p
      } = uK(a.value), g = typeof n == "function" ? n(h) : n, m = k(k({}, g), a.value[t]), y = `.${o.value}`, b = dn(h, {
        componentCls: y,
        prefixCls: o.value,
        iconCls: `.${u.value}`,
        antCls: `.${c.value}`
      }, m), w = e(b, {
        hashId: l.value,
        prefixCls: o.value,
        rootPrefixCls: c.value,
        iconPrefixCls: u.value,
        overrideComponentToken: a.value[t]
      });
      return p(t, m), [lK(a.value, o.value), w];
    }), l];
  };
}
const yN = process.env.NODE_ENV !== "production" || typeof CSSINJS_STATISTIC < "u";
let iO = !0;
function dn() {
  for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++)
    e[n] = arguments[n];
  if (!yN)
    return k({}, ...e);
  iO = !1;
  const i = {};
  return e.forEach((o) => {
    Object.keys(o).forEach((a) => {
      Object.defineProperty(i, a, {
        configurable: !0,
        enumerable: !0,
        get: () => o[a]
      });
    });
  }), iO = !0, i;
}
function sK() {
}
function uK(t) {
  let e, n = t, i = sK;
  return yN && (e = /* @__PURE__ */ new Set(), n = new Proxy(t, {
    get(o, r) {
      return iO && e.add(r), o[r];
    }
  }), i = (o, r) => {
    Array.from(e);
  }), {
    token: n,
    keys: e,
    flush: i
  };
}
const cK = nN(uC), dC = {
  token: uy,
  hashed: !0
}, bN = Symbol("DesignTokenContext"), oO = Te(), dK = (t) => {
  Xt(bN, t), _e(t, () => {
    oO.value = I(t), Z8(oO);
  }, {
    immediate: !0,
    deep: !0
  });
}, fK = Oe({
  props: {
    value: Vt()
  },
  setup(t, e) {
    let {
      slots: n
    } = e;
    return dK(A(() => t.value)), () => {
      var i;
      return (i = n.default) === null || i === void 0 ? void 0 : i.call(n);
    };
  }
});
function lh() {
  const t = qt(bN, A(() => oO.value || dC)), e = A(() => `${IY}-${t.value.hashed || ""}`), n = A(() => t.value.theme || cK), i = iY(n, A(() => [uy, t.value.token]), A(() => ({
    salt: e.value,
    override: k({
      override: t.value.token
    }, t.value.components),
    formatToken: oK
  })));
  return [n, A(() => i.value[0]), A(() => t.value.hashed ? i.value[1] : "")];
}
const fC = Oe({
  compatConfig: {
    MODE: 3
  },
  setup() {
    const [, t] = lh(), e = A(() => new jn(t.value.colorBgBase).toHsl().l < 0.5 ? {
      opacity: 0.65
    } : {});
    return () => v("svg", {
      style: e.value,
      width: "184",
      height: "152",
      viewBox: "0 0 184 152",
      xmlns: "http://www.w3.org/2000/svg"
    }, [v("g", {
      fill: "none",
      "fill-rule": "evenodd"
    }, [v("g", {
      transform: "translate(24 31.67)"
    }, [v("ellipse", {
      "fill-opacity": ".8",
      fill: "#F5F5F7",
      cx: "67.797",
      cy: "106.89",
      rx: "67.797",
      ry: "12.668"
    }, null), v("path", {
      d: "M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",
      fill: "#AEB8C2"
    }, null), v("path", {
      d: "M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",
      fill: "url(#linearGradient-1)",
      transform: "translate(13.56)"
    }, null), v("path", {
      d: "M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",
      fill: "#F5F5F7"
    }, null), v("path", {
      d: "M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",
      fill: "#DCE0E6"
    }, null)]), v("path", {
      d: "M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",
      fill: "#DCE0E6"
    }, null), v("g", {
      transform: "translate(149.65 15.383)",
      fill: "#FFF"
    }, [v("ellipse", {
      cx: "20.654",
      cy: "3.167",
      rx: "2.849",
      ry: "2.815"
    }, null), v("path", {
      d: "M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"
    }, null)])])]);
  }
});
fC.PRESENTED_IMAGE_DEFAULT = !0;
const xN = Oe({
  compatConfig: {
    MODE: 3
  },
  setup() {
    const [, t] = lh(), e = A(() => {
      const {
        colorFill: n,
        colorFillTertiary: i,
        colorFillQuaternary: o,
        colorBgContainer: r
      } = t.value;
      return {
        borderColor: new jn(n).onBackground(r).toHexString(),
        shadowColor: new jn(i).onBackground(r).toHexString(),
        contentColor: new jn(o).onBackground(r).toHexString()
      };
    });
    return () => v("svg", {
      width: "64",
      height: "41",
      viewBox: "0 0 64 41",
      xmlns: "http://www.w3.org/2000/svg"
    }, [v("g", {
      transform: "translate(0 1)",
      fill: "none",
      "fill-rule": "evenodd"
    }, [v("ellipse", {
      fill: e.value.shadowColor,
      cx: "32",
      cy: "33",
      rx: "32",
      ry: "7"
    }, null), v("g", {
      "fill-rule": "nonzero",
      stroke: e.value.borderColor
    }, [v("path", {
      d: "M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"
    }, null), v("path", {
      d: "M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",
      fill: e.value.contentColor
    }, null)])])]);
  }
});
xN.PRESENTED_IMAGE_SIMPLE = !0;
const hK = (t) => {
  const {
    componentCls: e,
    margin: n,
    marginXS: i,
    marginXL: o,
    fontSize: r,
    lineHeight: a
  } = t;
  return {
    [e]: {
      marginInline: i,
      fontSize: r,
      lineHeight: a,
      textAlign: "center",
      // 原来 &-image 没有父子结构，现在为了外层承担我们的hashId，改成父子结果
      [`${e}-image`]: {
        height: t.emptyImgHeight,
        marginBottom: i,
        opacity: t.opacityImage,
        img: {
          height: "100%"
        },
        svg: {
          height: "100%",
          margin: "auto"
        }
      },
      // 原来 &-footer 没有父子结构，现在为了外层承担我们的hashId，改成父子结果
      [`${e}-footer`]: {
        marginTop: n
      },
      "&-normal": {
        marginBlock: o,
        color: t.colorTextDisabled,
        [`${e}-image`]: {
          height: t.emptyImgHeightMD
        }
      },
      "&-small": {
        marginBlock: i,
        color: t.colorTextDisabled,
        [`${e}-image`]: {
          height: t.emptyImgHeightSM
        }
      }
    }
  };
}, pK = Vn("Empty", (t) => {
  const {
    componentCls: e,
    controlHeightLG: n
  } = t, i = dn(t, {
    emptyImgCls: `${e}-img`,
    emptyImgHeight: n * 2.5,
    emptyImgHeightMD: n,
    emptyImgHeightSM: n * 0.875
  });
  return [hK(i)];
});
var gK = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
const mK = () => ({
  prefixCls: String,
  imageStyle: Vt(),
  image: Mr(),
  description: Mr()
}), hC = Oe({
  name: "AEmpty",
  compatConfig: {
    MODE: 3
  },
  inheritAttrs: !1,
  props: mK(),
  setup(t, e) {
    let {
      slots: n = {},
      attrs: i
    } = e;
    const {
      direction: o,
      prefixCls: r
    } = Ht("empty", t), [a, l] = pK(r);
    return () => {
      var s, u;
      const c = r.value, d = k(k({}, t), i), {
        image: f = ((s = n.image) === null || s === void 0 ? void 0 : s.call(n)) || lo(fC),
        description: h = ((u = n.description) === null || u === void 0 ? void 0 : u.call(n)) || void 0,
        imageStyle: p,
        class: g = ""
      } = d, m = gK(d, ["image", "description", "imageStyle", "class"]), y = typeof f == "function" ? f() : f, b = typeof y == "object" && "type" in y && y.type.PRESENTED_IMAGE_SIMPLE;
      return a(v(WD, {
        componentName: "Empty",
        children: (w) => {
          const $ = typeof h < "u" ? h : w.description, C = typeof $ == "string" ? $ : "empty";
          let P = null;
          return typeof y == "string" ? P = v("img", {
            alt: C,
            src: y
          }, null) : P = y, v("div", J({
            class: Ae(c, g, l.value, {
              [`${c}-normal`]: b,
              [`${c}-rtl`]: o.value === "rtl"
            })
          }, m), [v("div", {
            class: `${c}-image`,
            style: p
          }, [P]), $ && v("p", {
            class: `${c}-description`
          }, [$]), n.default && v("div", {
            class: `${c}-footer`
          }, [ho(n.default())])]);
        }
      }, null));
    };
  }
});
hC.PRESENTED_IMAGE_DEFAULT = () => lo(fC);
hC.PRESENTED_IMAGE_SIMPLE = () => lo(xN);
const xc = ya(hC), pC = (t) => {
  const {
    prefixCls: e
  } = Ht("empty", t);
  return ((i) => {
    switch (i) {
      case "Table":
      case "List":
        return v(xc, {
          image: xc.PRESENTED_IMAGE_SIMPLE
        }, null);
      case "Select":
      case "TreeSelect":
      case "Cascader":
      case "Transfer":
      case "Mentions":
        return v(xc, {
          image: xc.PRESENTED_IMAGE_SIMPLE,
          class: `${e.value}-small`
        }, null);
      default:
        return v(xc, null, null);
    }
  })(t.componentName);
};
function vK(t) {
  return v(pC, {
    componentName: t
  }, null);
}
const ON = Symbol("SizeContextKey"), SN = () => qt(ON, de(void 0)), wN = (t) => {
  const e = SN();
  return Xt(ON, A(() => t.value || e.value)), t;
}, Ht = ((t, e) => {
  const n = SN(), i = qa(), o = qt(rC, k(k({}, BD), {
    renderEmpty: (O) => lo(pC, {
      componentName: O
    })
  })), r = A(() => o.getPrefixCls(t, e.prefixCls)), a = A(() => {
    var O, E;
    return (O = e.direction) !== null && O !== void 0 ? O : (E = o.direction) === null || E === void 0 ? void 0 : E.value;
  }), l = A(() => {
    var O;
    return (O = e.iconPrefixCls) !== null && O !== void 0 ? O : o.iconPrefixCls.value;
  }), s = A(() => o.getPrefixCls()), u = A(() => {
    var O;
    return (O = o.autoInsertSpaceInButton) === null || O === void 0 ? void 0 : O.value;
  }), c = o.renderEmpty, d = o.space, f = o.pageHeader, h = o.form, p = A(() => {
    var O, E;
    return (O = e.getTargetContainer) !== null && O !== void 0 ? O : (E = o.getTargetContainer) === null || E === void 0 ? void 0 : E.value;
  }), g = A(() => {
    var O, E, _;
    return (E = (O = e.getContainer) !== null && O !== void 0 ? O : e.getPopupContainer) !== null && E !== void 0 ? E : (_ = o.getPopupContainer) === null || _ === void 0 ? void 0 : _.value;
  }), m = A(() => {
    var O, E;
    return (O = e.dropdownMatchSelectWidth) !== null && O !== void 0 ? O : (E = o.dropdownMatchSelectWidth) === null || E === void 0 ? void 0 : E.value;
  }), y = A(() => {
    var O;
    return (e.virtual === void 0 ? ((O = o.virtual) === null || O === void 0 ? void 0 : O.value) !== !1 : e.virtual !== !1) && m.value !== !1;
  }), b = A(() => e.size || n.value), w = A(() => {
    var O, E, _;
    return (O = e.autocomplete) !== null && O !== void 0 ? O : (_ = (E = o.input) === null || E === void 0 ? void 0 : E.value) === null || _ === void 0 ? void 0 : _.autocomplete;
  }), $ = A(() => {
    var O;
    return (O = e.disabled) !== null && O !== void 0 ? O : i.value;
  }), C = A(() => {
    var O;
    return (O = e.csp) !== null && O !== void 0 ? O : o.csp;
  }), P = A(() => {
    var O, E;
    return (O = e.wave) !== null && O !== void 0 ? O : (E = o.wave) === null || E === void 0 ? void 0 : E.value;
  });
  return {
    configProvider: o,
    prefixCls: r,
    direction: a,
    size: b,
    getTargetContainer: p,
    getPopupContainer: g,
    space: d,
    pageHeader: f,
    form: h,
    autoInsertSpaceInButton: u,
    renderEmpty: c,
    virtual: y,
    dropdownMatchSelectWidth: m,
    rootPrefixCls: s,
    getPrefixCls: o.getPrefixCls,
    autocomplete: w,
    csp: C,
    iconPrefixCls: l,
    disabled: $,
    select: o.select,
    wave: P
  };
});
function ii(t, e) {
  const n = k({}, t);
  for (let i = 0; i < e.length; i += 1) {
    const o = e[i];
    delete n[o];
  }
  return n;
}
function PP(t) {
  return typeof t == "object" && t != null && t.nodeType === 1;
}
function EP(t, e) {
  return (!e || t !== "hidden") && t !== "visible" && t !== "clip";
}
function Wb(t, e) {
  if (t.clientHeight < t.scrollHeight || t.clientWidth < t.scrollWidth) {
    var n = getComputedStyle(t, null);
    return EP(n.overflowY, e) || EP(n.overflowX, e) || (function(i) {
      var o = (function(r) {
        if (!r.ownerDocument || !r.ownerDocument.defaultView) return null;
        try {
          return r.ownerDocument.defaultView.frameElement;
        } catch {
          return null;
        }
      })(i);
      return !!o && (o.clientHeight < i.scrollHeight || o.clientWidth < i.scrollWidth);
    })(t);
  }
  return !1;
}
function rm(t, e, n, i, o, r, a, l) {
  return r < t && a > e || r > t && a < e ? 0 : r <= t && l <= n || a >= e && l >= n ? r - t - i : a > e && l < n || r < t && l > n ? a - e + o : 0;
}
var _P = function(t, e) {
  var n = window, i = e.scrollMode, o = e.block, r = e.inline, a = e.boundary, l = e.skipOverflowHiddenElements, s = typeof a == "function" ? a : function(ke) {
    return ke !== a;
  };
  if (!PP(t)) throw new TypeError("Invalid target");
  for (var u, c, d = document.scrollingElement || document.documentElement, f = [], h = t; PP(h) && s(h); ) {
    if ((h = (c = (u = h).parentElement) == null ? u.getRootNode().host || null : c) === d) {
      f.push(h);
      break;
    }
    h != null && h === document.body && Wb(h) && !Wb(document.documentElement) || h != null && Wb(h, l) && f.push(h);
  }
  for (var p = n.visualViewport ? n.visualViewport.width : innerWidth, g = n.visualViewport ? n.visualViewport.height : innerHeight, m = window.scrollX || pageXOffset, y = window.scrollY || pageYOffset, b = t.getBoundingClientRect(), w = b.height, $ = b.width, C = b.top, P = b.right, O = b.bottom, E = b.left, _ = o === "start" || o === "nearest" ? C : o === "end" ? O : C + w / 2, D = r === "center" ? E + $ / 2 : r === "end" ? P : E, M = [], N = 0; N < f.length; N++) {
    var L = f[N], j = L.getBoundingClientRect(), B = j.height, Y = j.width, Q = j.top, G = j.right, V = j.bottom, H = j.left;
    if (i === "if-needed" && C >= 0 && E >= 0 && O <= g && P <= p && C >= Q && O <= V && E >= H && P <= G) return M;
    var q = getComputedStyle(L), K = parseInt(q.borderLeftWidth, 10), ee = parseInt(q.borderTopWidth, 10), ie = parseInt(q.borderRightWidth, 10), ae = parseInt(q.borderBottomWidth, 10), te = 0, U = 0, me = "offsetWidth" in L ? L.offsetWidth - L.clientWidth - K - ie : 0, ce = "offsetHeight" in L ? L.offsetHeight - L.clientHeight - ee - ae : 0, ue = "offsetWidth" in L ? L.offsetWidth === 0 ? 0 : Y / L.offsetWidth : 0, fe = "offsetHeight" in L ? L.offsetHeight === 0 ? 0 : B / L.offsetHeight : 0;
    if (d === L) te = o === "start" ? _ : o === "end" ? _ - g : o === "nearest" ? rm(y, y + g, g, ee, ae, y + _, y + _ + w, w) : _ - g / 2, U = r === "start" ? D : r === "center" ? D - p / 2 : r === "end" ? D - p : rm(m, m + p, p, K, ie, m + D, m + D + $, $), te = Math.max(0, te + y), U = Math.max(0, U + m);
    else {
      te = o === "start" ? _ - Q - ee : o === "end" ? _ - V + ae + ce : o === "nearest" ? rm(Q, V, B, ee, ae + ce, _, _ + w, w) : _ - (Q + B / 2) + ce / 2, U = r === "start" ? D - H - K : r === "center" ? D - (H + Y / 2) + me / 2 : r === "end" ? D - G + ie + me : rm(H, G, Y, K, ie + me, D, D + $, $);
      var he = L.scrollLeft, le = L.scrollTop;
      _ += le - (te = Math.max(0, Math.min(le + te / fe, L.scrollHeight - B / fe + ce))), D += he - (U = Math.max(0, Math.min(he + U / ue, L.scrollWidth - Y / ue + me)));
    }
    M.push({ el: L, top: te, left: U });
  }
  return M;
};
function CN(t) {
  return t === Object(t) && Object.keys(t).length !== 0;
}
function yK(t, e) {
  e === void 0 && (e = "auto");
  var n = "scrollBehavior" in document.body.style;
  t.forEach(function(i) {
    var o = i.el, r = i.top, a = i.left;
    o.scroll && n ? o.scroll({
      top: r,
      left: a,
      behavior: e
    }) : (o.scrollTop = r, o.scrollLeft = a);
  });
}
function bK(t) {
  return t === !1 ? {
    block: "end",
    inline: "nearest"
  } : CN(t) ? t : {
    block: "start",
    inline: "nearest"
  };
}
function xK(t, e) {
  var n = t.isConnected || t.ownerDocument.documentElement.contains(t);
  if (CN(e) && typeof e.behavior == "function")
    return e.behavior(n ? _P(t, e) : []);
  if (n) {
    var i = bK(e);
    return yK(_P(t, i), i.behavior);
  }
}
function OK(t, e, n, i) {
  const o = n - e;
  return t /= i / 2, t < 1 ? o / 2 * t * t * t + e : o / 2 * ((t -= 2) * t * t + 2) + e;
}
function rO(t) {
  return t != null && t === t.window;
}
function SK(t, e) {
  var n, i;
  if (typeof window > "u")
    return 0;
  const o = "scrollTop";
  let r = 0;
  return rO(t) ? r = t.scrollY : t instanceof Document ? r = t.documentElement[o] : (t instanceof HTMLElement || t) && (r = t[o]), t && !rO(t) && typeof r != "number" && (r = (i = ((n = t.ownerDocument) !== null && n !== void 0 ? n : t).documentElement) === null || i === void 0 ? void 0 : i[o]), r;
}
function wK(t) {
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
  const {
    getContainer: n = () => window,
    callback: i,
    duration: o = 450
  } = e, r = n(), a = SK(r), l = Date.now(), s = () => {
    const c = Date.now() - l, d = OK(c > o ? o : c, a, t, o);
    rO(r) ? r.scrollTo(window.scrollX, d) : r instanceof Document ? r.documentElement.scrollTop = d : r.scrollTop = d, c < o ? Gt(s) : typeof i == "function" && i();
  };
  Gt(s);
}
function CK(t, e) {
  for (var n = 0; n < e.length; n++) {
    var i = e[n];
    i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(t, i.key, i);
  }
}
function $N(t, e, n) {
  return n && CK(t, n), t;
}
function av() {
  return (av = Object.assign || function(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e];
      for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (t[i] = n[i]);
    }
    return t;
  }).apply(this, arguments);
}
function kN(t, e) {
  t.prototype = Object.create(e.prototype), t.prototype.constructor = t, t.__proto__ = e;
}
function TN(t, e) {
  if (t == null) return {};
  var n, i, o = {}, r = Object.keys(t);
  for (i = 0; i < r.length; i++) e.indexOf(n = r[i]) >= 0 || (o[n] = t[n]);
  return o;
}
function IP(t) {
  return ((e = t) != null && typeof e == "object" && Array.isArray(e) === !1) == 1 && Object.prototype.toString.call(t) === "[object Object]";
  var e;
}
var PN = Object.prototype, EN = PN.toString, $K = PN.hasOwnProperty, _N = /^\s*function (\w+)/;
function MP(t) {
  var e, n = (e = t?.type) !== null && e !== void 0 ? e : t;
  if (n) {
    var i = n.toString().match(_N);
    return i ? i[1] : "";
  }
  return "";
}
var Wc = function(t) {
  var e, n;
  return IP(t) !== !1 && typeof (e = t.constructor) == "function" && IP(n = e.prototype) !== !1 && n.hasOwnProperty("isPrototypeOf") !== !1;
}, IN = function(t) {
  return t;
}, br = IN;
if (process.env.NODE_ENV !== "production") {
  var kK = typeof console < "u";
  br = kK ? function(t) {
    console.warn("[VueTypes warn]: " + t);
  } : IN;
}
var zp = function(t, e) {
  return $K.call(t, e);
}, TK = Number.isInteger || function(t) {
  return typeof t == "number" && isFinite(t) && Math.floor(t) === t;
}, Nf = Array.isArray || function(t) {
  return EN.call(t) === "[object Array]";
}, Lf = function(t) {
  return EN.call(t) === "[object Function]";
}, Wv = function(t) {
  return Wc(t) && zp(t, "_vueTypes_name");
}, MN = function(t) {
  return Wc(t) && (zp(t, "type") || ["_vueTypes_name", "validator", "default", "required"].some(function(e) {
    return zp(t, e);
  }));
};
function gC(t, e) {
  return Object.defineProperty(t.bind(e), "__original", { value: t });
}
function od(t, e, n) {
  var i, o = !0, r = "";
  i = Wc(t) ? t : { type: t };
  var a = Wv(i) ? i._vueTypes_name + " - " : "";
  if (MN(i) && i.type !== null) {
    if (i.type === void 0 || i.type === !0 || !i.required && e === void 0) return o;
    Nf(i.type) ? (o = i.type.some(function(d) {
      return od(d, e) === !0;
    }), r = i.type.map(function(d) {
      return MP(d);
    }).join(" or ")) : o = (r = MP(i)) === "Array" ? Nf(e) : r === "Object" ? Wc(e) : r === "String" || r === "Number" || r === "Boolean" || r === "Function" ? (function(d) {
      if (d == null) return "";
      var f = d.constructor.toString().match(_N);
      return f ? f[1] : "";
    })(e) === r : e instanceof i.type;
  }
  if (!o) {
    var l = a + 'value "' + e + '" should be of type "' + r + '"';
    return l;
  }
  if (zp(i, "validator") && Lf(i.validator)) {
    var s = br, u = [];
    if (br = function(d) {
      u.push(d);
    }, o = i.validator(e), br = s, !o) {
      var c = (u.length > 1 ? "* " : "") + u.join(`
* `);
      return u.length = 0, c;
    }
  }
  return o;
}
function Br(t, e) {
  var n = Object.defineProperties(e, { _vueTypes_name: { value: t, writable: !0 }, isRequired: { get: function() {
    return this.required = !0, this;
  } }, def: { value: function(o) {
    return o !== void 0 || this.default ? Lf(o) || od(this, o) === !0 ? (this.default = Nf(o) ? function() {
      return [].concat(o);
    } : Wc(o) ? function() {
      return Object.assign({}, o);
    } : o, this) : (br(this._vueTypes_name + ' - invalid default value: "' + o + '"'), this) : this;
  } } }), i = n.validator;
  return Lf(i) && (n.validator = gC(i, n)), n;
}
function Il(t, e) {
  var n = Br(t, e);
  return Object.defineProperty(n, "validate", { value: function(i) {
    return Lf(this.validator) && br(this._vueTypes_name + ` - calling .validate() will overwrite the current custom validator function. Validator info:
` + JSON.stringify(this)), this.validator = gC(i, this), this;
  } });
}
function AP(t, e, n) {
  var i, o, r = (i = e, o = {}, Object.getOwnPropertyNames(i).forEach(function(d) {
    o[d] = Object.getOwnPropertyDescriptor(i, d);
  }), Object.defineProperties({}, o));
  if (r._vueTypes_name = t, !Wc(n)) return r;
  var a, l, s = n.validator, u = TN(n, ["validator"]);
  if (Lf(s)) {
    var c = r.validator;
    c && (c = (l = (a = c).__original) !== null && l !== void 0 ? l : a), r.validator = gC(c ? function(d) {
      return c.call(this, d) && s.call(this, d);
    } : s, r);
  }
  return Object.assign(r, u);
}
function cy(t) {
  return t.replace(/^(?!\s*$)/gm, "  ");
}
var PK = function() {
  return Il("any", {});
}, EK = function() {
  return Il("function", { type: Function });
}, _K = function() {
  return Il("boolean", { type: Boolean });
}, IK = function() {
  return Il("string", { type: String });
}, MK = function() {
  return Il("number", { type: Number });
}, AK = function() {
  return Il("array", { type: Array });
}, RK = function() {
  return Il("object", { type: Object });
}, DK = function() {
  return Br("integer", { type: Number, validator: function(t) {
    return TK(t);
  } });
}, NK = function() {
  return Br("symbol", { validator: function(t) {
    return typeof t == "symbol";
  } });
};
function LK(t, e) {
  if (e === void 0 && (e = "custom validation failed"), typeof t != "function") throw new TypeError("[VueTypes error]: You must provide a function as argument");
  return Br(t.name || "<<anonymous function>>", { validator: function(n) {
    var i = t(n);
    return i || br(this._vueTypes_name + " - " + e), i;
  } });
}
function zK(t) {
  if (!Nf(t)) throw new TypeError("[VueTypes error]: You must provide an array as argument.");
  var e = 'oneOf - value should be one of "' + t.join('", "') + '".', n = t.reduce(function(i, o) {
    if (o != null) {
      var r = o.constructor;
      i.indexOf(r) === -1 && i.push(r);
    }
    return i;
  }, []);
  return Br("oneOf", { type: n.length > 0 ? n : void 0, validator: function(i) {
    var o = t.indexOf(i) !== -1;
    return o || br(e), o;
  } });
}
function BK(t) {
  if (!Nf(t)) throw new TypeError("[VueTypes error]: You must provide an array as argument");
  for (var e = !1, n = [], i = 0; i < t.length; i += 1) {
    var o = t[i];
    if (MN(o)) {
      if (Wv(o) && o._vueTypes_name === "oneOf") {
        n = n.concat(o.type);
        continue;
      }
      if (Lf(o.validator) && (e = !0), o.type !== !0 && o.type) {
        n = n.concat(o.type);
        continue;
      }
    }
    n.push(o);
  }
  return n = n.filter(function(r, a) {
    return n.indexOf(r) === a;
  }), Br("oneOfType", e ? { type: n, validator: function(r) {
    var a = [], l = t.some(function(s) {
      var u = od(Wv(s) && s._vueTypes_name === "oneOf" ? s.type || null : s, r);
      return typeof u == "string" && a.push(u), u === !0;
    });
    return l || br("oneOfType - provided value does not match any of the " + a.length + ` passed-in validators:
` + cy(a.join(`
`))), l;
  } } : { type: n });
}
function FK(t) {
  return Br("arrayOf", { type: Array, validator: function(e) {
    var n, i = e.every(function(o) {
      return (n = od(t, o)) === !0;
    });
    return i || br(`arrayOf - value validation error:
` + cy(n)), i;
  } });
}
function VK(t) {
  return Br("instanceOf", { type: t });
}
function QK(t) {
  return Br("objectOf", { type: Object, validator: function(e) {
    var n, i = Object.keys(e).every(function(o) {
      return (n = od(t, e[o])) === !0;
    });
    return i || br(`objectOf - value validation error:
` + cy(n)), i;
  } });
}
function HK(t) {
  var e = Object.keys(t), n = e.filter(function(o) {
    var r;
    return !!(!((r = t[o]) === null || r === void 0) && r.required);
  }), i = Br("shape", { type: Object, validator: function(o) {
    var r = this;
    if (!Wc(o)) return !1;
    var a = Object.keys(o);
    if (n.length > 0 && n.some(function(s) {
      return a.indexOf(s) === -1;
    })) {
      var l = n.filter(function(s) {
        return a.indexOf(s) === -1;
      });
      return br(l.length === 1 ? 'shape - required property "' + l[0] + '" is not defined.' : 'shape - required properties "' + l.join('", "') + '" are not defined.'), !1;
    }
    return a.every(function(s) {
      if (e.indexOf(s) === -1) return r._vueTypes_isLoose === !0 || (br('shape - shape definition does not include a "' + s + '" property. Allowed keys: "' + e.join('", "') + '".'), !1);
      var u = od(t[s], o[s]);
      return typeof u == "string" && br('shape - "' + s + `" property validation error:
 ` + cy(u)), u === !0;
    });
  } });
  return Object.defineProperty(i, "_vueTypes_isLoose", { writable: !0, value: !1 }), Object.defineProperty(i, "loose", { get: function() {
    return this._vueTypes_isLoose = !0, this;
  } }), i;
}
var cl = (function() {
  function t() {
  }
  return t.extend = function(e) {
    var n = this;
    if (Nf(e)) return e.forEach(function(d) {
      return n.extend(d);
    }), this;
    var i = e.name, o = e.validate, r = o !== void 0 && o, a = e.getter, l = a !== void 0 && a, s = TN(e, ["name", "validate", "getter"]);
    if (zp(this, i)) throw new TypeError('[VueTypes error]: Type "' + i + '" already defined');
    var u, c = s.type;
    return Wv(c) ? (delete s.type, Object.defineProperty(this, i, l ? { get: function() {
      return AP(i, c, s);
    } } : { value: function() {
      var d, f = AP(i, c, s);
      return f.validator && (f.validator = (d = f.validator).bind.apply(d, [f].concat([].slice.call(arguments)))), f;
    } })) : (u = l ? { get: function() {
      var d = Object.assign({}, s);
      return r ? Il(i, d) : Br(i, d);
    }, enumerable: !0 } : { value: function() {
      var d, f, h = Object.assign({}, s);
      return d = r ? Il(i, h) : Br(i, h), h.validator && (d.validator = (f = h.validator).bind.apply(f, [d].concat([].slice.call(arguments)))), d;
    }, enumerable: !0 }, Object.defineProperty(this, i, u));
  }, $N(t, null, [{ key: "any", get: function() {
    return PK();
  } }, { key: "func", get: function() {
    return EK().def(this.defaults.func);
  } }, { key: "bool", get: function() {
    return _K().def(this.defaults.bool);
  } }, { key: "string", get: function() {
    return IK().def(this.defaults.string);
  } }, { key: "number", get: function() {
    return MK().def(this.defaults.number);
  } }, { key: "array", get: function() {
    return AK().def(this.defaults.array);
  } }, { key: "object", get: function() {
    return RK().def(this.defaults.object);
  } }, { key: "integer", get: function() {
    return DK().def(this.defaults.integer);
  } }, { key: "symbol", get: function() {
    return NK();
  } }]), t;
})();
function AN(t) {
  var e;
  return t === void 0 && (t = { func: function() {
  }, bool: !0, string: "", number: 0, array: function() {
    return [];
  }, object: function() {
    return {};
  }, integer: 0 }), (e = (function(n) {
    function i() {
      return n.apply(this, arguments) || this;
    }
    return kN(i, n), $N(i, null, [{ key: "sensibleDefaults", get: function() {
      return av({}, this.defaults);
    }, set: function(o) {
      this.defaults = o !== !1 ? av({}, o !== !0 ? o : t) : {};
    } }]), i;
  })(cl)).defaults = av({}, t), e;
}
cl.defaults = {}, cl.custom = LK, cl.oneOf = zK, cl.instanceOf = VK, cl.oneOfType = BK, cl.arrayOf = FK, cl.objectOf = QK, cl.shape = HK, cl.utils = { validate: function(t, e) {
  return od(e, t) === !0;
}, toType: function(t, e, n) {
  return n === void 0 && (n = !1), n ? Il(t, e) : Br(t, e);
} };
(function(t) {
  function e() {
    return t.apply(this, arguments) || this;
  }
  return kN(e, t), e;
})(AN());
const ve = AN({
  func: void 0,
  bool: void 0,
  string: void 0,
  number: void 0,
  array: void 0,
  object: void 0,
  integer: void 0
});
ve.extend([{
  name: "looseBool",
  getter: !0,
  type: Boolean,
  default: void 0
}, {
  name: "style",
  getter: !0,
  type: [String, Object],
  default: void 0
}, {
  name: "VueNode",
  getter: !0,
  type: null
}]);
function WK(t) {
  return t.default = void 0, t;
}
const $n = ((t, e, n) => {
  pr(t, `[ant-design-vue: ${e}] ${n}`);
});
function RP(t, e) {
  const {
    key: n
  } = t;
  let i;
  return "value" in t && ({
    value: i
  } = t), n ?? (i !== void 0 ? i : `rc-index-key-${e}`);
}
function RN(t, e) {
  const {
    label: n,
    value: i,
    options: o
  } = t || {};
  return {
    label: n || (e ? "children" : "label"),
    value: i || "value",
    options: o || "options"
  };
}
function jK(t) {
  let {
    fieldNames: e,
    childrenAsData: n
  } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
  const i = [], {
    label: o,
    value: r,
    options: a
  } = RN(e, !1);
  function l(s, u) {
    s.forEach((c) => {
      const d = c[o];
      if (u || !(a in c)) {
        const f = c[r];
        i.push({
          key: RP(c, i.length),
          groupOption: u,
          data: c,
          label: d,
          value: f
        });
      } else {
        let f = d;
        f === void 0 && n && (f = c.label), i.push({
          key: RP(c, i.length),
          group: !0,
          data: c,
          label: f
        }), l(c[a], !0);
      }
    });
  }
  return l(t, !1), i;
}
function aO(t) {
  const e = k({}, t);
  return "props" in e || Object.defineProperty(e, "props", {
    get() {
      return Nn(!1, "Return type is option instead of Option instance. Please read value directly instead of reading from `props`."), e;
    }
  }), e;
}
function qK(t, e) {
  if (!e || !e.length)
    return null;
  let n = !1;
  function i(r, a) {
    let [l, ...s] = a;
    if (!l)
      return [r];
    const u = r.split(l);
    return n = n || u.length > 1, u.reduce((c, d) => [...c, ...i(d, s)], []).filter((c) => c);
  }
  const o = i(t, e);
  return n ? o : null;
}
function YK() {
  return "";
}
function KK(t) {
  return t ? t.ownerDocument : window.document;
}
function DN() {
}
const XK = () => ({
  action: ve.oneOfType([ve.string, ve.arrayOf(ve.string)]).def([]),
  showAction: ve.any.def([]),
  hideAction: ve.any.def([]),
  getPopupClassNameFromAlign: ve.any.def(YK),
  onPopupVisibleChange: Function,
  afterPopupVisibleChange: ve.func.def(DN),
  popup: ve.any,
  arrow: ve.bool.def(!0),
  popupStyle: {
    type: Object,
    default: void 0
  },
  prefixCls: ve.string.def("rc-trigger-popup"),
  popupClassName: ve.string.def(""),
  popupPlacement: String,
  builtinPlacements: ve.object,
  popupTransitionName: String,
  popupAnimation: ve.any,
  mouseEnterDelay: ve.number.def(0),
  mouseLeaveDelay: ve.number.def(0.1),
  zIndex: Number,
  focusDelay: ve.number.def(0),
  blurDelay: ve.number.def(0.15),
  getPopupContainer: Function,
  getDocument: ve.func.def(KK),
  forceRender: {
    type: Boolean,
    default: void 0
  },
  destroyPopupOnHide: {
    type: Boolean,
    default: !1
  },
  mask: {
    type: Boolean,
    default: !1
  },
  maskClosable: {
    type: Boolean,
    default: !0
  },
  // onPopupAlign: PropTypes.func.def(noop),
  popupAlign: ve.object.def(() => ({})),
  popupVisible: {
    type: Boolean,
    default: void 0
  },
  defaultPopupVisible: {
    type: Boolean,
    default: !1
  },
  maskTransitionName: String,
  maskAnimation: String,
  stretch: String,
  alignPoint: {
    type: Boolean,
    default: void 0
  },
  autoDestroy: {
    type: Boolean,
    default: !1
  },
  mobile: Object,
  getTriggerDOMNode: Function
}), mC = {
  visible: Boolean,
  prefixCls: String,
  zIndex: Number,
  destroyPopupOnHide: Boolean,
  forceRender: Boolean,
  arrow: {
    type: Boolean,
    default: !0
  },
  // Legacy Motion
  animation: [String, Object],
  transitionName: String,
  // Measure
  stretch: {
    type: String
  },
  // Align
  align: {
    type: Object
  },
  point: {
    type: Object
  },
  getRootDomNode: {
    type: Function
  },
  getClassNameFromAlign: {
    type: Function
  },
  onAlign: {
    type: Function
  },
  onMouseenter: {
    type: Function
  },
  onMouseleave: {
    type: Function
  },
  onMousedown: {
    type: Function
  },
  onTouchstart: {
    type: Function
  }
}, ZK = k(k({}, mC), {
  mobile: {
    type: Object
  }
}), GK = k(k({}, mC), {
  mask: Boolean,
  mobile: {
    type: Object
  },
  maskAnimation: String,
  maskTransitionName: String
});
function vC(t) {
  let {
    prefixCls: e,
    animation: n,
    transitionName: i
  } = t;
  return n ? {
    name: `${e}-${n}`
  } : i ? {
    name: i
  } : {};
}
function NN(t) {
  const {
    prefixCls: e,
    visible: n,
    zIndex: i,
    mask: o,
    maskAnimation: r,
    maskTransitionName: a
  } = t;
  if (!o)
    return null;
  let l = {};
  return (a || r) && (l = vC({
    prefixCls: e,
    transitionName: a,
    animation: r
  })), v(zr, J({
    appear: !0
  }, l), {
    default: () => [fa(v("div", {
      style: {
        zIndex: i
      },
      class: `${e}-mask`
    }, null), [[G8("if"), n]])]
  });
}
NN.displayName = "Mask";
const UK = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "MobilePopupInner",
  inheritAttrs: !1,
  props: ZK,
  emits: ["mouseenter", "mouseleave", "mousedown", "touchstart", "align"],
  setup(t, e) {
    let {
      expose: n,
      slots: i
    } = e;
    const o = de();
    return n({
      forceAlign: () => {
      },
      getElement: () => o.value
    }), () => {
      var r;
      const {
        zIndex: a,
        visible: l,
        prefixCls: s,
        mobile: {
          popupClassName: u,
          popupStyle: c,
          popupMotion: d = {},
          popupRender: f
        } = {}
      } = t, h = k({
        zIndex: a
      }, c);
      let p = Wi((r = i.default) === null || r === void 0 ? void 0 : r.call(i));
      p.length > 1 && (p = v("div", {
        class: `${s}-content`
      }, [p])), f && (p = f(p));
      const g = Ae(s, u);
      return v(zr, J({
        ref: o
      }, d), {
        default: () => [l ? v("div", {
          class: g,
          style: h
        }, [p]) : null]
      });
    };
  }
});
var JK = function(t, e, n, i) {
  function o(r) {
    return r instanceof n ? r : new n(function(a) {
      a(r);
    });
  }
  return new (n || (n = Promise))(function(r, a) {
    function l(c) {
      try {
        u(i.next(c));
      } catch (d) {
        a(d);
      }
    }
    function s(c) {
      try {
        u(i.throw(c));
      } catch (d) {
        a(d);
      }
    }
    function u(c) {
      c.done ? r(c.value) : o(c.value).then(l, s);
    }
    u((i = i.apply(t, e || [])).next());
  });
};
const DP = ["measure", "align", null, "motion"], eX = ((t, e) => {
  const n = Te(null), i = Te(), o = Te(!1);
  function r(s) {
    o.value || (n.value = s);
  }
  function a() {
    Gt.cancel(i.value);
  }
  function l(s) {
    a(), i.value = Gt(() => {
      let u = n.value;
      switch (n.value) {
        case "align":
          u = "motion";
          break;
        case "motion":
          u = "stable";
          break;
      }
      r(u), s?.();
    });
  }
  return _e(t, () => {
    r("measure");
  }, {
    immediate: !0,
    flush: "post"
  }), Lt(() => {
    _e(n, () => {
      switch (n.value) {
        case "measure":
          e();
          break;
      }
      n.value && (i.value = Gt(() => JK(void 0, void 0, void 0, function* () {
        const s = DP.indexOf(n.value), u = DP[s + 1];
        u && s !== -1 && r(u);
      })));
    }, {
      immediate: !0,
      flush: "post"
    });
  }), tn(() => {
    o.value = !0, a();
  }), [n, l];
}), tX = ((t) => {
  const e = Te({
    width: 0,
    height: 0
  });
  function n(o) {
    e.value = {
      width: o.offsetWidth,
      height: o.offsetHeight
    };
  }
  return [A(() => {
    const o = {};
    if (t.value) {
      const {
        width: r,
        height: a
      } = e.value;
      t.value.indexOf("height") !== -1 && a ? o.height = `${a}px` : t.value.indexOf("minHeight") !== -1 && a && (o.minHeight = `${a}px`), t.value.indexOf("width") !== -1 && r ? o.width = `${r}px` : t.value.indexOf("minWidth") !== -1 && r && (o.minWidth = `${r}px`);
    }
    return o;
  }), n];
});
function NP(t, e) {
  var n = Object.keys(t);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(t);
    e && (i = i.filter(function(o) {
      return Object.getOwnPropertyDescriptor(t, o).enumerable;
    })), n.push.apply(n, i);
  }
  return n;
}
function LP(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e] != null ? arguments[e] : {};
    e % 2 ? NP(Object(n), !0).forEach(function(i) {
      nX(t, i, n[i]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : NP(Object(n)).forEach(function(i) {
      Object.defineProperty(t, i, Object.getOwnPropertyDescriptor(n, i));
    });
  }
  return t;
}
function lO(t) {
  "@babel/helpers - typeof";
  return lO = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
    return typeof e;
  } : function(e) {
    return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
  }, lO(t);
}
function nX(t, e, n) {
  return e in t ? Object.defineProperty(t, e, {
    value: n,
    enumerable: !0,
    configurable: !0,
    writable: !0
  }) : t[e] = n, t;
}
var _h, iX = {
  Webkit: "-webkit-",
  Moz: "-moz-",
  // IE did it wrong again ...
  ms: "-ms-",
  O: "-o-"
};
function jv() {
  if (_h !== void 0)
    return _h;
  _h = "";
  var t = document.createElement("p").style, e = "Transform";
  for (var n in iX)
    n + e in t && (_h = n);
  return _h;
}
function LN() {
  return jv() ? "".concat(jv(), "TransitionProperty") : "transitionProperty";
}
function dy() {
  return jv() ? "".concat(jv(), "Transform") : "transform";
}
function zP(t, e) {
  var n = LN();
  n && (t.style[n] = e, n !== "transitionProperty" && (t.style.transitionProperty = e));
}
function jb(t, e) {
  var n = dy();
  n && (t.style[n] = e, n !== "transform" && (t.style.transform = e));
}
function oX(t) {
  return t.style.transitionProperty || t.style[LN()];
}
function rX(t) {
  var e = window.getComputedStyle(t, null), n = e.getPropertyValue("transform") || e.getPropertyValue(dy());
  if (n && n !== "none") {
    var i = n.replace(/[^0-9\-.,]/g, "").split(",");
    return {
      x: parseFloat(i[12] || i[4], 0),
      y: parseFloat(i[13] || i[5], 0)
    };
  }
  return {
    x: 0,
    y: 0
  };
}
var aX = /matrix\((.*)\)/, lX = /matrix3d\((.*)\)/;
function sX(t, e) {
  var n = window.getComputedStyle(t, null), i = n.getPropertyValue("transform") || n.getPropertyValue(dy());
  if (i && i !== "none") {
    var o, r = i.match(aX);
    if (r)
      r = r[1], o = r.split(",").map(function(l) {
        return parseFloat(l, 10);
      }), o[4] = e.x, o[5] = e.y, jb(t, "matrix(".concat(o.join(","), ")"));
    else {
      var a = i.match(lX)[1];
      o = a.split(",").map(function(l) {
        return parseFloat(l, 10);
      }), o[12] = e.x, o[13] = e.y, jb(t, "matrix3d(".concat(o.join(","), ")"));
    }
  } else
    jb(t, "translateX(".concat(e.x, "px) translateY(").concat(e.y, "px) translateZ(0)"));
}
var uX = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source, ug;
function BP(t) {
  var e = t.style.display;
  t.style.display = "none", t.offsetHeight, t.style.display = e;
}
function lf(t, e, n) {
  var i = n;
  if (lO(e) === "object") {
    for (var o in e)
      e.hasOwnProperty(o) && lf(t, o, e[o]);
    return;
  }
  if (typeof i < "u") {
    typeof i == "number" && (i = "".concat(i, "px")), t.style[e] = i;
    return;
  }
  return ug(t, e);
}
function cX(t) {
  var e, n, i, o = t.ownerDocument, r = o.body, a = o && o.documentElement;
  return e = t.getBoundingClientRect(), n = Math.floor(e.left), i = Math.floor(e.top), n -= a.clientLeft || r.clientLeft || 0, i -= a.clientTop || r.clientTop || 0, {
    left: n,
    top: i
  };
}
function zN(t, e) {
  var n = t["page".concat(e ? "Y" : "X", "Offset")], i = "scroll".concat(e ? "Top" : "Left");
  if (typeof n != "number") {
    var o = t.document;
    n = o.documentElement[i], typeof n != "number" && (n = o.body[i]);
  }
  return n;
}
function BN(t) {
  return zN(t);
}
function FN(t) {
  return zN(t, !0);
}
function Bp(t) {
  var e = cX(t), n = t.ownerDocument, i = n.defaultView || n.parentWindow;
  return e.left += BN(i), e.top += FN(i), e;
}
function yC(t) {
  return t != null && t == t.window;
}
function VN(t) {
  return yC(t) ? t.document : t.nodeType === 9 ? t : t.ownerDocument;
}
function dX(t, e, n) {
  var i = n, o = "", r = VN(t);
  return i = i || r.defaultView.getComputedStyle(t, null), i && (o = i.getPropertyValue(e) || i[e]), o;
}
var fX = new RegExp("^(".concat(uX, ")(?!px)[a-z%]+$"), "i"), hX = /^(top|right|bottom|left)$/, qb = "currentStyle", Yb = "runtimeStyle", tc = "left", pX = "px";
function gX(t, e) {
  var n = t[qb] && t[qb][e];
  if (fX.test(n) && !hX.test(e)) {
    var i = t.style, o = i[tc], r = t[Yb][tc];
    t[Yb][tc] = t[qb][tc], i[tc] = e === "fontSize" ? "1em" : n || 0, n = i.pixelLeft + pX, i[tc] = o, t[Yb][tc] = r;
  }
  return n === "" ? "auto" : n;
}
typeof window < "u" && (ug = window.getComputedStyle ? dX : gX);
function am(t, e) {
  return t === "left" ? e.useCssRight ? "right" : t : e.useCssBottom ? "bottom" : t;
}
function FP(t) {
  if (t === "left")
    return "right";
  if (t === "right")
    return "left";
  if (t === "top")
    return "bottom";
  if (t === "bottom")
    return "top";
}
function VP(t, e, n) {
  lf(t, "position") === "static" && (t.style.position = "relative");
  var i = -999, o = -999, r = am("left", n), a = am("top", n), l = FP(r), s = FP(a);
  r !== "left" && (i = 999), a !== "top" && (o = 999);
  var u = "", c = Bp(t);
  ("left" in e || "top" in e) && (u = oX(t) || "", zP(t, "none")), "left" in e && (t.style[l] = "", t.style[r] = "".concat(i, "px")), "top" in e && (t.style[s] = "", t.style[a] = "".concat(o, "px")), BP(t);
  var d = Bp(t), f = {};
  for (var h in e)
    if (e.hasOwnProperty(h)) {
      var p = am(h, n), g = h === "left" ? i : o, m = c[h] - d[h];
      p === h ? f[p] = g + m : f[p] = g - m;
    }
  lf(t, f), BP(t), ("left" in e || "top" in e) && zP(t, u);
  var y = {};
  for (var b in e)
    if (e.hasOwnProperty(b)) {
      var w = am(b, n), $ = e[b] - c[b];
      b === w ? y[w] = f[w] + $ : y[w] = f[w] - $;
    }
  lf(t, y);
}
function mX(t, e) {
  var n = Bp(t), i = rX(t), o = {
    x: i.x,
    y: i.y
  };
  "left" in e && (o.x = i.x + e.left - n.left), "top" in e && (o.y = i.y + e.top - n.top), sX(t, o);
}
function vX(t, e, n) {
  if (n.ignoreShake) {
    var i = Bp(t), o = i.left.toFixed(0), r = i.top.toFixed(0), a = e.left.toFixed(0), l = e.top.toFixed(0);
    if (o === a && r === l)
      return;
  }
  n.useCssRight || n.useCssBottom ? VP(t, e, n) : n.useCssTransform && dy() in document.body.style ? mX(t, e) : VP(t, e, n);
}
function bC(t, e) {
  for (var n = 0; n < t.length; n++)
    e(t[n]);
}
function QN(t) {
  return ug(t, "boxSizing") === "border-box";
}
var yX = ["margin", "border", "padding"], sO = -1, bX = 2, uO = 1, xX = 0;
function OX(t, e, n) {
  var i = {}, o = t.style, r;
  for (r in e)
    e.hasOwnProperty(r) && (i[r] = o[r], o[r] = e[r]);
  n.call(t);
  for (r in e)
    e.hasOwnProperty(r) && (o[r] = i[r]);
}
function qh(t, e, n) {
  var i = 0, o, r, a;
  for (r = 0; r < e.length; r++)
    if (o = e[r], o)
      for (a = 0; a < n.length; a++) {
        var l = void 0;
        o === "border" ? l = "".concat(o).concat(n[a], "Width") : l = o + n[a], i += parseFloat(ug(t, l)) || 0;
      }
  return i;
}
var Cl = {
  getParent: function(e) {
    var n = e;
    do
      n.nodeType === 11 && n.host ? n = n.host : n = n.parentNode;
    while (n && n.nodeType !== 1 && n.nodeType !== 9);
    return n;
  }
};
bC(["Width", "Height"], function(t) {
  Cl["doc".concat(t)] = function(e) {
    var n = e.document;
    return Math.max(
      // firefox chrome documentElement.scrollHeight< body.scrollHeight
      // ie standard mode : documentElement.scrollHeight> body.scrollHeight
      n.documentElement["scroll".concat(t)],
      // quirks : documentElement.scrollHeight 最大等于可视窗口多一点？
      n.body["scroll".concat(t)],
      Cl["viewport".concat(t)](n)
    );
  }, Cl["viewport".concat(t)] = function(e) {
    var n = "client".concat(t), i = e.document, o = i.body, r = i.documentElement, a = r[n];
    return i.compatMode === "CSS1Compat" && a || o && o[n] || a;
  };
});
function QP(t, e, n) {
  var i = n;
  if (yC(t))
    return e === "width" ? Cl.viewportWidth(t) : Cl.viewportHeight(t);
  if (t.nodeType === 9)
    return e === "width" ? Cl.docWidth(t) : Cl.docHeight(t);
  var o = e === "width" ? ["Left", "Right"] : ["Top", "Bottom"], r = Math.floor(e === "width" ? t.getBoundingClientRect().width : t.getBoundingClientRect().height), a = QN(t), l = 0;
  (r == null || r <= 0) && (r = void 0, l = ug(t, e), (l == null || Number(l) < 0) && (l = t.style[e] || 0), l = Math.floor(parseFloat(l)) || 0), i === void 0 && (i = a ? uO : sO);
  var s = r !== void 0 || a, u = r || l;
  return i === sO ? s ? u - qh(t, ["border", "padding"], o) : l : s ? i === uO ? u : u + (i === bX ? -qh(t, ["border"], o) : qh(t, ["margin"], o)) : l + qh(t, yX.slice(i), o);
}
var SX = {
  position: "absolute",
  visibility: "hidden",
  display: "block"
};
function HP() {
  for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++)
    e[n] = arguments[n];
  var i, o = e[0];
  return o.offsetWidth !== 0 ? i = QP.apply(void 0, e) : OX(o, SX, function() {
    i = QP.apply(void 0, e);
  }), i;
}
bC(["width", "height"], function(t) {
  var e = t.charAt(0).toUpperCase() + t.slice(1);
  Cl["outer".concat(e)] = function(i, o) {
    return i && HP(i, t, o ? xX : uO);
  };
  var n = t === "width" ? ["Left", "Right"] : ["Top", "Bottom"];
  Cl[t] = function(i, o) {
    var r = o;
    if (r !== void 0) {
      if (i) {
        var a = QN(i);
        return a && (r += qh(i, ["padding", "border"], n)), lf(i, t, r);
      }
      return;
    }
    return i && HP(i, t, sO);
  };
});
function HN(t, e) {
  for (var n in e)
    e.hasOwnProperty(n) && (t[n] = e[n]);
  return t;
}
var hn = {
  getWindow: function(e) {
    if (e && e.document && e.setTimeout)
      return e;
    var n = e.ownerDocument || e;
    return n.defaultView || n.parentWindow;
  },
  getDocument: VN,
  offset: function(e, n, i) {
    if (typeof n < "u")
      vX(e, n, i || {});
    else
      return Bp(e);
  },
  isWindow: yC,
  each: bC,
  css: lf,
  clone: function(e) {
    var n, i = {};
    for (n in e)
      e.hasOwnProperty(n) && (i[n] = e[n]);
    var o = e.overflow;
    if (o)
      for (n in e)
        e.hasOwnProperty(n) && (i.overflow[n] = e.overflow[n]);
    return i;
  },
  mix: HN,
  getWindowScrollLeft: function(e) {
    return BN(e);
  },
  getWindowScrollTop: function(e) {
    return FN(e);
  },
  merge: function() {
    for (var e = {}, n = 0; n < arguments.length; n++)
      hn.mix(e, n < 0 || arguments.length <= n ? void 0 : arguments[n]);
    return e;
  },
  viewportWidth: 0,
  viewportHeight: 0
};
HN(hn, Cl);
var Kb = hn.getParent;
function cO(t) {
  if (hn.isWindow(t) || t.nodeType === 9)
    return null;
  var e = hn.getDocument(t), n = e.body, i, o = hn.css(t, "position"), r = o === "fixed" || o === "absolute";
  if (!r)
    return t.nodeName.toLowerCase() === "html" ? null : Kb(t);
  for (i = Kb(t); i && i !== n && i.nodeType !== 9; i = Kb(i))
    if (o = hn.css(i, "position"), o !== "static")
      return i;
  return null;
}
var WP = hn.getParent;
function wX(t) {
  if (hn.isWindow(t) || t.nodeType === 9)
    return !1;
  var e = hn.getDocument(t), n = e.body, i = null;
  for (
    i = WP(t);
    // 修复元素位于 document.documentElement 下导致崩溃问题
    i && i !== n && i !== e;
    i = WP(i)
  ) {
    var o = hn.css(i, "position");
    if (o === "fixed")
      return !0;
  }
  return !1;
}
function xC(t, e) {
  for (var n = {
    left: 0,
    right: 1 / 0,
    top: 0,
    bottom: 1 / 0
  }, i = cO(t), o = hn.getDocument(t), r = o.defaultView || o.parentWindow, a = o.body, l = o.documentElement; i; ) {
    if ((navigator.userAgent.indexOf("MSIE") === -1 || i.clientWidth !== 0) && // body may have overflow set on it, yet we still get the entire
    // viewport. In some browsers, el.offsetParent may be
    // document.documentElement, so check for that too.
    i !== a && i !== l && hn.css(i, "overflow") !== "visible") {
      var s = hn.offset(i);
      s.left += i.clientLeft, s.top += i.clientTop, n.top = Math.max(n.top, s.top), n.right = Math.min(
        n.right,
        // consider area without scrollBar
        s.left + i.clientWidth
      ), n.bottom = Math.min(n.bottom, s.top + i.clientHeight), n.left = Math.max(n.left, s.left);
    } else if (i === a || i === l)
      break;
    i = cO(i);
  }
  var u = null;
  if (!hn.isWindow(t) && t.nodeType !== 9) {
    u = t.style.position;
    var c = hn.css(t, "position");
    c === "absolute" && (t.style.position = "fixed");
  }
  var d = hn.getWindowScrollLeft(r), f = hn.getWindowScrollTop(r), h = hn.viewportWidth(r), p = hn.viewportHeight(r), g = l.scrollWidth, m = l.scrollHeight, y = window.getComputedStyle(a);
  if (y.overflowX === "hidden" && (g = r.innerWidth), y.overflowY === "hidden" && (m = r.innerHeight), t.style && (t.style.position = u), e || wX(t))
    n.left = Math.max(n.left, d), n.top = Math.max(n.top, f), n.right = Math.min(n.right, d + h), n.bottom = Math.min(n.bottom, f + p);
  else {
    var b = Math.max(g, d + h);
    n.right = Math.min(n.right, b);
    var w = Math.max(m, f + p);
    n.bottom = Math.min(n.bottom, w);
  }
  return n.top >= 0 && n.left >= 0 && n.bottom > n.top && n.right > n.left ? n : null;
}
function CX(t, e, n, i) {
  var o = hn.clone(t), r = {
    width: e.width,
    height: e.height
  };
  return i.adjustX && o.left < n.left && (o.left = n.left), i.resizeWidth && o.left >= n.left && o.left + r.width > n.right && (r.width -= o.left + r.width - n.right), i.adjustX && o.left + r.width > n.right && (o.left = Math.max(n.right - r.width, n.left)), i.adjustY && o.top < n.top && (o.top = n.top), i.resizeHeight && o.top >= n.top && o.top + r.height > n.bottom && (r.height -= o.top + r.height - n.bottom), i.adjustY && o.top + r.height > n.bottom && (o.top = Math.max(n.bottom - r.height, n.top)), hn.mix(o, r);
}
function OC(t) {
  var e, n, i;
  if (!hn.isWindow(t) && t.nodeType !== 9)
    e = hn.offset(t), n = hn.outerWidth(t), i = hn.outerHeight(t);
  else {
    var o = hn.getWindow(t);
    e = {
      left: hn.getWindowScrollLeft(o),
      top: hn.getWindowScrollTop(o)
    }, n = hn.viewportWidth(o), i = hn.viewportHeight(o);
  }
  return e.width = n, e.height = i, e;
}
function jP(t, e) {
  var n = e.charAt(0), i = e.charAt(1), o = t.width, r = t.height, a = t.left, l = t.top;
  return n === "c" ? l += r / 2 : n === "b" && (l += r), i === "c" ? a += o / 2 : i === "r" && (a += o), {
    left: a,
    top: l
  };
}
function lm(t, e, n, i, o) {
  var r = jP(e, n[1]), a = jP(t, n[0]), l = [a.left - r.left, a.top - r.top];
  return {
    left: Math.round(t.left - l[0] + i[0] - o[0]),
    top: Math.round(t.top - l[1] + i[1] - o[1])
  };
}
function qP(t, e, n) {
  return t.left < n.left || t.left + e.width > n.right;
}
function YP(t, e, n) {
  return t.top < n.top || t.top + e.height > n.bottom;
}
function $X(t, e, n) {
  return t.left > n.right || t.left + e.width < n.left;
}
function kX(t, e, n) {
  return t.top > n.bottom || t.top + e.height < n.top;
}
function sm(t, e, n) {
  var i = [];
  return hn.each(t, function(o) {
    i.push(o.replace(e, function(r) {
      return n[r];
    }));
  }), i;
}
function um(t, e) {
  return t[e] = -t[e], t;
}
function KP(t, e) {
  var n;
  return /%$/.test(t) ? n = parseInt(t.substring(0, t.length - 1), 10) / 100 * e : n = parseInt(t, 10), n || 0;
}
function XP(t, e) {
  t[0] = KP(t[0], e.width), t[1] = KP(t[1], e.height);
}
function WN(t, e, n, i) {
  var o = n.points, r = n.offset || [0, 0], a = n.targetOffset || [0, 0], l = n.overflow, s = n.source || t;
  r = [].concat(r), a = [].concat(a), l = l || {};
  var u = {}, c = 0, d = !!(l && l.alwaysByViewport), f = xC(s, d), h = OC(s);
  XP(r, h), XP(a, e);
  var p = lm(h, e, o, r, a), g = hn.merge(h, p);
  if (f && (l.adjustX || l.adjustY) && i) {
    if (l.adjustX && qP(p, h, f)) {
      var m = sm(o, /[lr]/gi, {
        l: "r",
        r: "l"
      }), y = um(r, 0), b = um(a, 0), w = lm(h, e, m, y, b);
      $X(w, h, f) || (c = 1, o = m, r = y, a = b);
    }
    if (l.adjustY && YP(p, h, f)) {
      var $ = sm(o, /[tb]/gi, {
        t: "b",
        b: "t"
      }), C = um(r, 1), P = um(a, 1), O = lm(h, e, $, C, P);
      kX(O, h, f) || (c = 1, o = $, r = C, a = P);
    }
    c && (p = lm(h, e, o, r, a), hn.mix(g, p));
    var E = qP(p, h, f), _ = YP(p, h, f);
    if (E || _) {
      var D = o;
      E && (D = sm(o, /[lr]/gi, {
        l: "r",
        r: "l"
      })), _ && (D = sm(o, /[tb]/gi, {
        t: "b",
        b: "t"
      })), o = D, r = n.offset || [0, 0], a = n.targetOffset || [0, 0];
    }
    u.adjustX = l.adjustX && E, u.adjustY = l.adjustY && _, (u.adjustX || u.adjustY) && (g = CX(p, h, f, u));
  }
  return g.width !== h.width && hn.css(s, "width", hn.width(s) + g.width - h.width), g.height !== h.height && hn.css(s, "height", hn.height(s) + g.height - h.height), hn.offset(s, {
    left: g.left,
    top: g.top
  }, {
    useCssRight: n.useCssRight,
    useCssBottom: n.useCssBottom,
    useCssTransform: n.useCssTransform,
    ignoreShake: n.ignoreShake
  }), {
    points: o,
    offset: r,
    targetOffset: a,
    overflow: u
  };
}
function TX(t, e) {
  var n = xC(t, e), i = OC(t);
  return !n || i.left + i.width <= n.left || i.top + i.height <= n.top || i.left >= n.right || i.top >= n.bottom;
}
function SC(t, e, n) {
  var i = n.target || e, o = OC(i), r = !TX(i, n.overflow && n.overflow.alwaysByViewport);
  return WN(t, o, n, r);
}
SC.__getOffsetParent = cO;
SC.__getVisibleRectForElement = xC;
function PX(t, e, n) {
  var i, o, r = hn.getDocument(t), a = r.defaultView || r.parentWindow, l = hn.getWindowScrollLeft(a), s = hn.getWindowScrollTop(a), u = hn.viewportWidth(a), c = hn.viewportHeight(a);
  "pageX" in e ? i = e.pageX : i = l + e.clientX, "pageY" in e ? o = e.pageY : o = s + e.clientY;
  var d = {
    left: i,
    top: o,
    width: 0,
    height: 0
  }, f = i >= 0 && i <= l + u && o >= 0 && o <= s + c, h = [n.points[0], "cc"];
  return WN(t, d, LP(LP({}, n), {}, {
    points: h
  }), f);
}
function vi(t) {
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0, i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1, o = t;
  if (Array.isArray(t) && (o = ho(t)[0]), !o)
    return null;
  const r = Eu(o, e, i);
  return r.props = n ? k(k({}, r.props), e) : r.props, eo(typeof r.props.class != "object", "class must be string"), r;
}
function EX(t, e, n) {
  _u(Eu(t, k({}, e)), n);
}
const jN = (t) => (t || []).some((e) => or(e) ? !(e.type === SA || e.type === tt && !jN(e.children)) : !0) ? t : null;
function fy(t, e, n, i) {
  var o;
  const r = (o = t[e]) === null || o === void 0 ? void 0 : o.call(t, n);
  return jN(r) ? r : i?.();
}
const hy = ((t) => {
  if (!t)
    return !1;
  if (t.offsetParent)
    return !0;
  if (t.getBBox) {
    const e = t.getBBox();
    if (e.width || e.height)
      return !0;
  }
  if (t.getBoundingClientRect) {
    const e = t.getBoundingClientRect();
    if (e.width || e.height)
      return !0;
  }
  return !1;
});
function _X(t, e) {
  return t === e ? !0 : !t || !e ? !1 : "pageX" in e && "pageY" in e ? t.pageX === e.pageX && t.pageY === e.pageY : "clientX" in e && "clientY" in e ? t.clientX === e.clientX && t.clientY === e.clientY : !1;
}
function IX(t, e) {
  t !== document.activeElement && fu(e, t) && typeof t.focus == "function" && t.focus();
}
function ZP(t, e) {
  let n = null, i = null;
  function o(a) {
    let [{
      target: l
    }] = a;
    if (!document.documentElement.contains(l)) return;
    const {
      width: s,
      height: u
    } = l.getBoundingClientRect(), c = Math.floor(s), d = Math.floor(u);
    (n !== c || i !== d) && Promise.resolve().then(() => {
      e({
        width: c,
        height: d
      });
    }), n = c, i = d;
  }
  const r = new _D(o);
  return t && r.observe(t), () => {
    r.disconnect();
  };
}
const MX = ((t, e) => {
  let n = !1, i = null;
  function o() {
    clearTimeout(i);
  }
  function r(a) {
    if (!n || a === !0) {
      if (t() === !1)
        return;
      n = !0, o(), i = setTimeout(() => {
        n = !1;
      }, e.value);
    } else
      o(), i = setTimeout(() => {
        n = !1, r();
      }, e.value);
  }
  return [r, () => {
    n = !1, o();
  }];
}), AX = {
  align: Object,
  target: [Object, Function],
  onAlign: Function,
  monitorBufferTime: Number,
  monitorWindowResize: Boolean,
  disabled: Boolean
};
function GP(t) {
  return typeof t != "function" ? null : t();
}
function UP(t) {
  return typeof t != "object" || !t ? null : t;
}
const RX = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "Align",
  props: AX,
  emits: ["align"],
  setup(t, e) {
    let {
      expose: n,
      slots: i
    } = e;
    const o = de({}), r = de(), [a, l] = MX(() => {
      const {
        disabled: f,
        target: h,
        align: p,
        onAlign: g
      } = t;
      if (!f && h && r.value) {
        const m = r.value;
        let y;
        const b = GP(h), w = UP(h);
        o.value.element = b, o.value.point = w, o.value.align = p;
        const {
          activeElement: $
        } = document;
        return b && hy(b) ? y = SC(m, b, p) : w && (y = PX(m, w, p)), IX($, m), g && y && g(m, y), !0;
      }
      return !1;
    }, A(() => t.monitorBufferTime)), s = de({
      cancel: () => {
      }
    }), u = de({
      cancel: () => {
      }
    }), c = () => {
      const f = t.target, h = GP(f), p = UP(f);
      r.value !== u.value.element && (u.value.cancel(), u.value.element = r.value, u.value.cancel = ZP(r.value, a)), (o.value.element !== h || !_X(o.value.point, p) || !yw(o.value.align, t.align)) && (a(), s.value.element !== h && (s.value.cancel(), s.value.element = h, s.value.cancel = ZP(h, a)));
    };
    Lt(() => {
      rn(() => {
        c();
      });
    }), Ns(() => {
      rn(() => {
        c();
      });
    }), _e(() => t.disabled, (f) => {
      f ? l() : a();
    }, {
      immediate: !0,
      flush: "post"
    });
    const d = de(null);
    return _e(() => t.monitorWindowResize, (f) => {
      f ? d.value || (d.value = So(window, "resize", a)) : d.value && (d.value.remove(), d.value = null);
    }, {
      flush: "post"
    }), wo(() => {
      s.value.cancel(), u.value.cancel(), d.value && d.value.remove(), l();
    }), n({
      forceAlign: () => a(!0)
    }), () => {
      const f = i?.default();
      return f ? vi(f[0], {
        ref: r
      }, !0, !0) : null;
    };
  }
});
ja("bottomLeft", "bottomRight", "topLeft", "topRight");
const DX = (t) => t !== void 0 && (t === "topLeft" || t === "topRight") ? "slide-down" : "slide-up", jc = function(t) {
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
  return k(t ? {
    name: t,
    appear: !0,
    // type: 'animation',
    // appearFromClass: `${transitionName}-appear ${transitionName}-appear-prepare`,
    // appearActiveClass: `antdv-base-transtion`,
    // appearToClass: `${transitionName}-appear ${transitionName}-appear-active`,
    enterFromClass: `${t}-enter ${t}-enter-prepare ${t}-enter-start`,
    enterActiveClass: `${t}-enter ${t}-enter-prepare`,
    enterToClass: `${t}-enter ${t}-enter-active`,
    leaveFromClass: ` ${t}-leave`,
    leaveActiveClass: `${t}-leave ${t}-leave-active`,
    leaveToClass: `${t}-leave ${t}-leave-active`
  } : {
    css: !1
  }, e);
}, wC = function(t) {
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
  return k(t ? {
    name: t,
    appear: !0,
    // appearFromClass: `${transitionName}-appear ${transitionName}-appear-prepare`,
    appearActiveClass: `${t}`,
    appearToClass: `${t}-appear ${t}-appear-active`,
    enterFromClass: `${t}-appear ${t}-enter ${t}-appear-prepare ${t}-enter-prepare`,
    enterActiveClass: `${t}`,
    enterToClass: `${t}-enter ${t}-appear ${t}-appear-active ${t}-enter-active`,
    leaveActiveClass: `${t} ${t}-leave`,
    leaveToClass: `${t}-leave-active`
  } : {
    css: !1
  }, e);
}, Is = (t, e, n) => n !== void 0 ? n : `${t}-${e}`, NX = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "PopupInner",
  inheritAttrs: !1,
  props: mC,
  emits: ["mouseenter", "mouseleave", "mousedown", "touchstart", "align"],
  setup(t, e) {
    let {
      expose: n,
      attrs: i,
      slots: o
    } = e;
    const r = Te(), a = Te(), l = Te(), [s, u] = tX(on(t, "stretch")), c = () => {
      t.stretch && u(t.getRootDomNode());
    }, d = Te(!1);
    let f;
    _e(() => t.visible, (P) => {
      clearTimeout(f), P ? f = setTimeout(() => {
        d.value = t.visible;
      }) : d.value = !1;
    }, {
      immediate: !0
    });
    const [h, p] = eX(d, c), g = Te(), m = () => t.point ? t.point : t.getRootDomNode, y = () => {
      var P;
      (P = r.value) === null || P === void 0 || P.forceAlign();
    }, b = (P, O) => {
      var E;
      const _ = t.getClassNameFromAlign(O), D = l.value;
      l.value !== _ && (l.value = _), h.value === "align" && (D !== _ ? Promise.resolve().then(() => {
        y();
      }) : p(() => {
        var M;
        (M = g.value) === null || M === void 0 || M.call(g);
      }), (E = t.onAlign) === null || E === void 0 || E.call(t, P, O));
    }, w = A(() => {
      const P = typeof t.animation == "object" ? t.animation : vC(t);
      return ["onAfterEnter", "onAfterLeave"].forEach((O) => {
        const E = P[O];
        P[O] = (_) => {
          p(), h.value = "stable", E?.(_);
        };
      }), P;
    }), $ = () => new Promise((P) => {
      g.value = P;
    });
    _e([w, h], () => {
      !w.value && h.value === "motion" && p();
    }, {
      immediate: !0
    }), n({
      forceAlign: y,
      getElement: () => a.value.$el || a.value
    });
    const C = A(() => {
      var P;
      return !(!((P = t.align) === null || P === void 0) && P.points && (h.value === "align" || h.value === "stable"));
    });
    return () => {
      var P;
      const {
        zIndex: O,
        align: E,
        prefixCls: _,
        destroyPopupOnHide: D,
        onMouseenter: M,
        onMouseleave: N,
        onTouchstart: L = () => {
        },
        onMousedown: j
      } = t, B = h.value, Y = [k(k({}, s.value), {
        zIndex: O,
        opacity: B === "motion" || B === "stable" || !d.value ? null : 0,
        // pointerEvents: statusValue === 'stable' ? null : 'none',
        pointerEvents: !d.value && B !== "stable" ? "none" : null
      }), i.style];
      let Q = Wi((P = o.default) === null || P === void 0 ? void 0 : P.call(o, {
        visible: t.visible
      }));
      Q.length > 1 && (Q = v("div", {
        class: `${_}-content`
      }, [Q]));
      const G = Ae(_, i.class, l.value, !t.arrow && `${_}-arrow-hidden`), H = d.value || !t.visible ? jc(w.value.name, w.value) : {};
      return v(zr, J(J({
        ref: a
      }, H), {}, {
        onBeforeEnter: $
      }), {
        default: () => !D || t.visible ? fa(v(RX, {
          target: m(),
          key: "popup",
          ref: r,
          monitorWindowResize: !0,
          disabled: C.value,
          align: E,
          onAlign: b
        }, {
          default: () => v("div", {
            class: G,
            onMouseenter: M,
            onMouseleave: N,
            onMousedown: la(j, ["capture"]),
            [xo ? "onTouchstartPassive" : "onTouchstart"]: la(L, ["capture"]),
            style: Y
          }, [Q])
        }), [[Qa, d.value]]) : null
      });
    };
  }
}), LX = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "Popup",
  inheritAttrs: !1,
  props: GK,
  setup(t, e) {
    let {
      attrs: n,
      slots: i,
      expose: o
    } = e;
    const r = Te(!1), a = Te(!1), l = Te(), s = Te();
    return _e([() => t.visible, () => t.mobile], () => {
      r.value = t.visible, t.visible && t.mobile && (a.value = !0);
    }, {
      immediate: !0,
      flush: "post"
    }), o({
      forceAlign: () => {
        var u;
        (u = l.value) === null || u === void 0 || u.forceAlign();
      },
      getElement: () => {
        var u;
        return (u = l.value) === null || u === void 0 ? void 0 : u.getElement();
      }
    }), () => {
      const u = k(k(k({}, t), n), {
        visible: r.value
      }), c = a.value ? v(UK, J(J({}, u), {}, {
        mobile: t.mobile,
        ref: l
      }), {
        default: i.default
      }) : v(NX, J(J({}, u), {}, {
        ref: l
      }), {
        default: i.default
      });
      return v("div", {
        ref: s
      }, [v(NN, u, null), c]);
    };
  }
});
function zX(t, e, n) {
  return n ? t[0] === e[0] : t[0] === e[0] && t[1] === e[1];
}
function JP(t, e, n) {
  const i = t[e] || {};
  return k(k({}, i), n);
}
function BX(t, e, n, i) {
  const {
    points: o
  } = n, r = Object.keys(t);
  for (let a = 0; a < r.length; a += 1) {
    const l = r[a];
    if (zX(t[l].points, o, i))
      return `${e}-placement-${l}`;
  }
  return "";
}
const cg = {
  methods: {
    setState() {
      let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = arguments.length > 1 ? arguments[1] : void 0, n = typeof t == "function" ? t(this.$data, this.$props) : t;
      if (this.getDerivedStateFromProps) {
        const i = this.getDerivedStateFromProps(Cq(this), k(k({}, this.$data), n));
        if (i === null)
          return;
        n = k(k({}, n), i || {});
      }
      k(this.$data, n), this._.isMounted && this.$forceUpdate(), rn(() => {
        e && e();
      });
    },
    __emit() {
      const t = [].slice.call(arguments, 0);
      let e = t[0];
      e = `on${e[0].toUpperCase()}${e.substring(1)}`;
      const n = this.$props[e] || this.$attrs[e];
      if (t.length && n)
        if (Array.isArray(n))
          for (let i = 0, o = n.length; i < o; i++)
            n[i](...t.slice(1));
        else
          n(...t.slice(1));
    }
  }
}, qN = Symbol("PortalContextKey"), CC = function(t) {
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
    inTriggerContext: !0
  };
  Xt(qN, {
    inTriggerContext: e.inTriggerContext,
    shouldRender: A(() => {
      const {
        sPopupVisible: n,
        popupRef: i,
        forceRender: o,
        autoDestroy: r
      } = t || {};
      let a = !1;
      return (n || i || o) && (a = !0), !n && r && (a = !1), a;
    })
  });
}, FX = () => {
  CC({}, {
    inTriggerContext: !1
  });
  const t = qt(qN, {
    shouldRender: A(() => !1),
    inTriggerContext: !1
  });
  return {
    shouldRender: A(() => t.shouldRender.value || t.inTriggerContext === !1)
  };
}, YN = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "Portal",
  inheritAttrs: !1,
  props: {
    getContainer: ve.func.isRequired,
    didUpdate: Function
  },
  setup(t, e) {
    let {
      slots: n
    } = e, i = !0, o;
    const {
      shouldRender: r
    } = FX();
    function a() {
      r.value && (o = t.getContainer());
    }
    R0(() => {
      i = !1, a();
    }), Lt(() => {
      o || a();
    });
    const l = _e(r, () => {
      r.value && !o && (o = t.getContainer()), o && l();
    });
    return Ns(() => {
      rn(() => {
        var s;
        r.value && ((s = t.didUpdate) === null || s === void 0 || s.call(t, t));
      });
    }), () => {
      var s;
      return r.value ? i ? (s = n.default) === null || s === void 0 ? void 0 : s.call(n) : o ? v(D0, {
        to: o
      }, n) : null : null;
    };
  }
});
let Xb;
function qv(t) {
  if (typeof document > "u")
    return 0;
  if (Xb === void 0) {
    const e = document.createElement("div");
    e.style.width = "100%", e.style.height = "200px";
    const n = document.createElement("div"), i = n.style;
    i.position = "absolute", i.top = "0", i.left = "0", i.pointerEvents = "none", i.visibility = "hidden", i.width = "200px", i.height = "150px", i.overflow = "hidden", n.appendChild(e), document.body.appendChild(n);
    const o = e.offsetWidth;
    n.style.overflow = "scroll";
    let r = e.offsetWidth;
    o === r && (r = n.clientWidth), document.body.removeChild(n), Xb = o - r;
  }
  return Xb;
}
function e2(t) {
  const e = t.match(/^(.*)px$/), n = Number(e?.[1]);
  return Number.isNaN(n) ? qv() : n;
}
function VX(t) {
  if (typeof document > "u" || !t || !(t instanceof Element))
    return {
      width: 0,
      height: 0
    };
  const {
    width: e,
    height: n
  } = getComputedStyle(t, "::-webkit-scrollbar");
  return {
    width: e2(e),
    height: e2(n)
  };
}
const QX = `vc-util-locker-${Date.now()}`;
let t2 = 0;
function HX() {
  return document.body.scrollHeight > (window.innerHeight || document.documentElement.clientHeight) && window.innerWidth > document.body.offsetWidth;
}
function WX(t) {
  const e = A(() => !!t && !!t.value);
  t2 += 1;
  const n = `${QX}_${t2}`;
  zt((i) => {
    if (Or()) {
      if (e.value) {
        const o = qv(), r = HX();
        Dp(`
html body {
  overflow-y: hidden;
  ${r ? `width: calc(100% - ${o}px);` : ""}
}`, n);
      } else
        Qv(n);
      i(() => {
        Qv(n);
      });
    }
  }, {
    flush: "post"
  });
}
let nc = 0;
const lv = Or(), n2 = (t) => {
  if (!lv)
    return null;
  if (t) {
    if (typeof t == "string")
      return document.querySelectorAll(t)[0];
    if (typeof t == "function")
      return t();
    if (typeof t == "object" && t instanceof window.HTMLElement)
      return t;
  }
  return document.body;
}, $C = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "PortalWrapper",
  inheritAttrs: !1,
  props: {
    wrapperClassName: String,
    forceRender: {
      type: Boolean,
      default: void 0
    },
    getContainer: ve.any,
    visible: {
      type: Boolean,
      default: void 0
    },
    autoLock: pt(),
    didUpdate: Function
  },
  setup(t, e) {
    let {
      slots: n
    } = e;
    const i = Te(), o = Te(), r = Te(), a = Te(1), l = Or() && document.createElement("div"), s = () => {
      var h, p;
      i.value === l && ((p = (h = i.value) === null || h === void 0 ? void 0 : h.parentNode) === null || p === void 0 || p.removeChild(i.value)), i.value = null;
    };
    let u = null;
    const c = function() {
      return (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1) || i.value && !i.value.parentNode ? (u = n2(t.getContainer), u ? (u.appendChild(i.value), !0) : !1) : !0;
    }, d = () => lv ? (i.value || (i.value = l, c(!0)), f(), i.value) : null, f = () => {
      const {
        wrapperClassName: h
      } = t;
      i.value && h && h !== i.value.className && (i.value.className = h);
    };
    return Ns(() => {
      f(), c();
    }), WX(A(() => t.autoLock && t.visible && Or() && (i.value === document.body || i.value === l))), Lt(() => {
      let h = !1;
      _e([() => t.visible, () => t.getContainer], (p, g) => {
        let [m, y] = p, [b, w] = g;
        lv && (u = n2(t.getContainer), u === document.body && (m && !b ? nc += 1 : h && (nc -= 1))), h && (typeof y == "function" && typeof w == "function" ? y.toString() !== w.toString() : y !== w) && s(), h = !0;
      }, {
        immediate: !0,
        flush: "post"
      }), rn(() => {
        c() || (r.value = Gt(() => {
          a.value += 1;
        }));
      });
    }), tn(() => {
      const {
        visible: h
      } = t;
      lv && u === document.body && (nc = h && nc ? nc - 1 : nc), s(), Gt.cancel(r.value);
    }), () => {
      const {
        forceRender: h,
        visible: p
      } = t;
      let g = null;
      const m = {
        getOpenCount: () => nc,
        getContainer: d
      };
      return a.value && (h || p || o.value) && (g = v(YN, {
        getContainer: d,
        ref: o,
        didUpdate: t.didUpdate
      }, {
        default: () => {
          var y;
          return (y = n.default) === null || y === void 0 ? void 0 : y.call(n, m);
        }
      })), g;
    };
  }
}), jX = ["onClick", "onMousedown", "onTouchstart", "onMouseenter", "onMouseleave", "onFocus", "onBlur", "onContextmenu"], dg = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "Trigger",
  mixins: [cg],
  inheritAttrs: !1,
  props: XK(),
  setup(t) {
    const e = A(() => {
      const {
        popupPlacement: o,
        popupAlign: r,
        builtinPlacements: a
      } = t;
      return o && a ? JP(a, o, r) : r;
    }), n = Te(null), i = (o) => {
      n.value = o;
    };
    return {
      vcTriggerContext: qt("vcTriggerContext", {}),
      popupRef: n,
      setPopupRef: i,
      triggerRef: Te(null),
      align: e,
      focusTime: null,
      clickOutsideHandler: null,
      contextmenuOutsideHandler1: null,
      contextmenuOutsideHandler2: null,
      touchOutsideHandler: null,
      attachId: null,
      delayTimer: null,
      hasPopupMouseDown: !1,
      preClickTime: null,
      preTouchTime: null,
      mouseDownTimeout: null,
      childOriginEvents: {}
    };
  },
  data() {
    const t = this.$props;
    let e;
    return this.popupVisible !== void 0 ? e = !!t.popupVisible : e = !!t.defaultPopupVisible, jX.forEach((n) => {
      this[`fire${n}`] = (i) => {
        this.fireEvents(n, i);
      };
    }), {
      prevPopupVisible: e,
      sPopupVisible: e,
      point: null
    };
  },
  watch: {
    popupVisible(t) {
      t !== void 0 && (this.prevPopupVisible = this.sPopupVisible, this.sPopupVisible = t);
    }
  },
  created() {
    Xt("vcTriggerContext", {
      onPopupMouseDown: this.onPopupMouseDown,
      onPopupMouseenter: this.onPopupMouseenter,
      onPopupMouseleave: this.onPopupMouseleave
    }), CC(this);
  },
  deactivated() {
    this.setPopupVisible(!1);
  },
  mounted() {
    this.$nextTick(() => {
      this.updatedCal();
    });
  },
  updated() {
    this.$nextTick(() => {
      this.updatedCal();
    });
  },
  beforeUnmount() {
    this.clearDelayTimer(), this.clearOutsideHandler(), clearTimeout(this.mouseDownTimeout), Gt.cancel(this.attachId);
  },
  methods: {
    updatedCal() {
      const t = this.$props;
      if (this.$data.sPopupVisible) {
        let n;
        !this.clickOutsideHandler && (this.isClickToHide() || this.isContextmenuToShow()) && (n = t.getDocument(this.getRootDomNode()), this.clickOutsideHandler = So(n, "mousedown", this.onDocumentClick)), this.touchOutsideHandler || (n = n || t.getDocument(this.getRootDomNode()), this.touchOutsideHandler = So(n, "touchstart", this.onDocumentClick, xo ? {
          passive: !1
        } : !1)), !this.contextmenuOutsideHandler1 && this.isContextmenuToShow() && (n = n || t.getDocument(this.getRootDomNode()), this.contextmenuOutsideHandler1 = So(n, "scroll", this.onContextmenuClose)), !this.contextmenuOutsideHandler2 && this.isContextmenuToShow() && (this.contextmenuOutsideHandler2 = So(window, "blur", this.onContextmenuClose));
      } else
        this.clearOutsideHandler();
    },
    onMouseenter(t) {
      const {
        mouseEnterDelay: e
      } = this.$props;
      this.fireEvents("onMouseenter", t), this.delaySetPopupVisible(!0, e, e ? null : t);
    },
    onMouseMove(t) {
      this.fireEvents("onMousemove", t), this.setPoint(t);
    },
    onMouseleave(t) {
      this.fireEvents("onMouseleave", t), this.delaySetPopupVisible(!1, this.$props.mouseLeaveDelay);
    },
    onPopupMouseenter() {
      const {
        vcTriggerContext: t = {}
      } = this;
      t.onPopupMouseenter && t.onPopupMouseenter(), this.clearDelayTimer();
    },
    onPopupMouseleave(t) {
      var e;
      if (t && t.relatedTarget && !t.relatedTarget.setTimeout && fu((e = this.popupRef) === null || e === void 0 ? void 0 : e.getElement(), t.relatedTarget))
        return;
      this.isMouseLeaveToHide() && this.delaySetPopupVisible(!1, this.$props.mouseLeaveDelay);
      const {
        vcTriggerContext: n = {}
      } = this;
      n.onPopupMouseleave && n.onPopupMouseleave(t);
    },
    onFocus(t) {
      this.fireEvents("onFocus", t), this.clearDelayTimer(), this.isFocusToShow() && (this.focusTime = Date.now(), this.delaySetPopupVisible(!0, this.$props.focusDelay));
    },
    onMousedown(t) {
      this.fireEvents("onMousedown", t), this.preClickTime = Date.now();
    },
    onTouchstart(t) {
      this.fireEvents("onTouchstart", t), this.preTouchTime = Date.now();
    },
    onBlur(t) {
      fu(t.target, t.relatedTarget || document.activeElement) || (this.fireEvents("onBlur", t), this.clearDelayTimer(), this.isBlurToHide() && this.delaySetPopupVisible(!1, this.$props.blurDelay));
    },
    onContextmenu(t) {
      t.preventDefault(), this.fireEvents("onContextmenu", t), this.setPopupVisible(!0, t);
    },
    onContextmenuClose() {
      this.isContextmenuToShow() && this.close();
    },
    onClick(t) {
      if (this.fireEvents("onClick", t), this.focusTime) {
        let n;
        if (this.preClickTime && this.preTouchTime ? n = Math.min(this.preClickTime, this.preTouchTime) : this.preClickTime ? n = this.preClickTime : this.preTouchTime && (n = this.preTouchTime), Math.abs(n - this.focusTime) < 20)
          return;
        this.focusTime = 0;
      }
      this.preClickTime = 0, this.preTouchTime = 0, this.isClickToShow() && (this.isClickToHide() || this.isBlurToHide()) && t && t.preventDefault && t.preventDefault(), t && t.domEvent && t.domEvent.preventDefault();
      const e = !this.$data.sPopupVisible;
      (this.isClickToHide() && !e || e && this.isClickToShow()) && this.setPopupVisible(!this.$data.sPopupVisible, t);
    },
    onPopupMouseDown() {
      const {
        vcTriggerContext: t = {}
      } = this;
      this.hasPopupMouseDown = !0, clearTimeout(this.mouseDownTimeout), this.mouseDownTimeout = setTimeout(() => {
        this.hasPopupMouseDown = !1;
      }, 0), t.onPopupMouseDown && t.onPopupMouseDown(...arguments);
    },
    onDocumentClick(t) {
      if (this.$props.mask && !this.$props.maskClosable)
        return;
      const e = t.target, n = this.getRootDomNode(), i = this.getPopupDomNode();
      // mousedown on the target should also close popup when action is contextMenu.
      // https://github.com/ant-design/ant-design/issues/29853
      (!fu(n, e) || this.isContextMenuOnly()) && !fu(i, e) && !this.hasPopupMouseDown && this.delaySetPopupVisible(!1, 0.1);
    },
    getPopupDomNode() {
      var t;
      return ((t = this.popupRef) === null || t === void 0 ? void 0 : t.getElement()) || null;
    },
    getRootDomNode() {
      var t, e, n, i;
      const {
        getTriggerDOMNode: o
      } = this.$props;
      if (o) {
        const r = ((e = (t = this.triggerRef) === null || t === void 0 ? void 0 : t.$el) === null || e === void 0 ? void 0 : e.nodeName) === "#comment" ? null : wl(this.triggerRef);
        return wl(o(r));
      }
      try {
        const r = ((i = (n = this.triggerRef) === null || n === void 0 ? void 0 : n.$el) === null || i === void 0 ? void 0 : i.nodeName) === "#comment" ? null : wl(this.triggerRef);
        if (r)
          return r;
      } catch {
      }
      return wl(this);
    },
    handleGetPopupClassFromAlign(t) {
      const e = [], n = this.$props, {
        popupPlacement: i,
        builtinPlacements: o,
        prefixCls: r,
        alignPoint: a,
        getPopupClassNameFromAlign: l
      } = n;
      return i && o && e.push(BX(o, r, t, a)), l && e.push(l(t)), e.join(" ");
    },
    getPopupAlign() {
      const t = this.$props, {
        popupPlacement: e,
        popupAlign: n,
        builtinPlacements: i
      } = t;
      return e && i ? JP(i, e, n) : n;
    },
    getComponent() {
      const t = {};
      this.isMouseEnterToShow() && (t.onMouseenter = this.onPopupMouseenter), this.isMouseLeaveToHide() && (t.onMouseleave = this.onPopupMouseleave), t.onMousedown = this.onPopupMouseDown, t[xo ? "onTouchstartPassive" : "onTouchstart"] = this.onPopupMouseDown;
      const {
        handleGetPopupClassFromAlign: e,
        getRootDomNode: n,
        $attrs: i
      } = this, {
        prefixCls: o,
        destroyPopupOnHide: r,
        popupClassName: a,
        popupAnimation: l,
        popupTransitionName: s,
        popupStyle: u,
        mask: c,
        maskAnimation: d,
        maskTransitionName: f,
        zIndex: h,
        stretch: p,
        alignPoint: g,
        mobile: m,
        arrow: y,
        forceRender: b
      } = this.$props, {
        sPopupVisible: w,
        point: $
      } = this.$data, C = k(k({
        prefixCls: o,
        arrow: y,
        destroyPopupOnHide: r,
        visible: w,
        point: g ? $ : null,
        align: this.align,
        animation: l,
        getClassNameFromAlign: e,
        stretch: p,
        getRootDomNode: n,
        mask: c,
        zIndex: h,
        transitionName: s,
        maskAnimation: d,
        maskTransitionName: f,
        class: a,
        style: u,
        onAlign: i.onPopupAlign || DN
      }, t), {
        ref: this.setPopupRef,
        mobile: m,
        forceRender: b
      });
      return v(LX, C, {
        default: this.$slots.popup || (() => RD(this, "popup"))
      });
    },
    attachParent(t) {
      Gt.cancel(this.attachId);
      const {
        getPopupContainer: e,
        getDocument: n
      } = this.$props, i = this.getRootDomNode();
      let o;
      e ? (i || e.length === 0) && (o = e(i)) : o = n(this.getRootDomNode()).body, o ? o.appendChild(t) : this.attachId = Gt(() => {
        this.attachParent(t);
      });
    },
    getContainer() {
      const {
        $props: t
      } = this, {
        getDocument: e
      } = t, n = e(this.getRootDomNode()).createElement("div");
      return n.style.position = "absolute", n.style.top = "0", n.style.left = "0", n.style.width = "100%", this.attachParent(n), n;
    },
    setPopupVisible(t, e) {
      const {
        alignPoint: n,
        sPopupVisible: i,
        onPopupVisibleChange: o
      } = this;
      this.clearDelayTimer(), i !== t && (ls(this, "popupVisible") || this.setState({
        sPopupVisible: t,
        prevPopupVisible: i
      }), o && o(t)), n && e && t && this.setPoint(e);
    },
    setPoint(t) {
      const {
        alignPoint: e
      } = this.$props;
      !e || !t || this.setState({
        point: {
          pageX: t.pageX,
          pageY: t.pageY
        }
      });
    },
    handlePortalUpdate() {
      this.prevPopupVisible !== this.sPopupVisible && this.afterPopupVisibleChange(this.sPopupVisible);
    },
    delaySetPopupVisible(t, e, n) {
      const i = e * 1e3;
      if (this.clearDelayTimer(), i) {
        const o = n ? {
          pageX: n.pageX,
          pageY: n.pageY
        } : null;
        this.delayTimer = setTimeout(() => {
          this.setPopupVisible(t, o), this.clearDelayTimer();
        }, i);
      } else
        this.setPopupVisible(t, n);
    },
    clearDelayTimer() {
      this.delayTimer && (clearTimeout(this.delayTimer), this.delayTimer = null);
    },
    clearOutsideHandler() {
      this.clickOutsideHandler && (this.clickOutsideHandler.remove(), this.clickOutsideHandler = null), this.contextmenuOutsideHandler1 && (this.contextmenuOutsideHandler1.remove(), this.contextmenuOutsideHandler1 = null), this.contextmenuOutsideHandler2 && (this.contextmenuOutsideHandler2.remove(), this.contextmenuOutsideHandler2 = null), this.touchOutsideHandler && (this.touchOutsideHandler.remove(), this.touchOutsideHandler = null);
    },
    createTwoChains(t) {
      let e = () => {
      };
      const n = uP(this);
      return this.childOriginEvents[t] && n[t] ? this[`fire${t}`] : (e = this.childOriginEvents[t] || n[t] || e, e);
    },
    isClickToShow() {
      const {
        action: t,
        showAction: e
      } = this.$props;
      return t.indexOf("click") !== -1 || e.indexOf("click") !== -1;
    },
    isContextMenuOnly() {
      const {
        action: t
      } = this.$props;
      return t === "contextmenu" || t.length === 1 && t[0] === "contextmenu";
    },
    isContextmenuToShow() {
      const {
        action: t,
        showAction: e
      } = this.$props;
      return t.indexOf("contextmenu") !== -1 || e.indexOf("contextmenu") !== -1;
    },
    isClickToHide() {
      const {
        action: t,
        hideAction: e
      } = this.$props;
      return t.indexOf("click") !== -1 || e.indexOf("click") !== -1;
    },
    isMouseEnterToShow() {
      const {
        action: t,
        showAction: e
      } = this.$props;
      return t.indexOf("hover") !== -1 || e.indexOf("mouseenter") !== -1;
    },
    isMouseLeaveToHide() {
      const {
        action: t,
        hideAction: e
      } = this.$props;
      return t.indexOf("hover") !== -1 || e.indexOf("mouseleave") !== -1;
    },
    isFocusToShow() {
      const {
        action: t,
        showAction: e
      } = this.$props;
      return t.indexOf("focus") !== -1 || e.indexOf("focus") !== -1;
    },
    isBlurToHide() {
      const {
        action: t,
        hideAction: e
      } = this.$props;
      return t.indexOf("focus") !== -1 || e.indexOf("blur") !== -1;
    },
    forcePopupAlign() {
      var t;
      this.$data.sPopupVisible && ((t = this.popupRef) === null || t === void 0 || t.forceAlign());
    },
    fireEvents(t, e) {
      this.childOriginEvents[t] && this.childOriginEvents[t](e);
      const n = this.$props[t] || this.$attrs[t];
      n && n(e);
    },
    close() {
      this.setPopupVisible(!1);
    }
  },
  render() {
    const {
      $attrs: t
    } = this, e = ho(AD(this)), {
      alignPoint: n,
      getPopupContainer: i
    } = this.$props, o = e[0];
    this.childOriginEvents = uP(o);
    const r = {
      key: "trigger"
    };
    this.isContextmenuToShow() ? r.onContextmenu = this.onContextmenu : r.onContextmenu = this.createTwoChains("onContextmenu"), this.isClickToHide() || this.isClickToShow() ? (r.onClick = this.onClick, r.onMousedown = this.onMousedown, r[xo ? "onTouchstartPassive" : "onTouchstart"] = this.onTouchstart) : (r.onClick = this.createTwoChains("onClick"), r.onMousedown = this.createTwoChains("onMousedown"), r[xo ? "onTouchstartPassive" : "onTouchstart"] = this.createTwoChains("onTouchstart")), this.isMouseEnterToShow() ? (r.onMouseenter = this.onMouseenter, n && (r.onMousemove = this.onMouseMove)) : r.onMouseenter = this.createTwoChains("onMouseenter"), this.isMouseLeaveToHide() ? r.onMouseleave = this.onMouseleave : r.onMouseleave = this.createTwoChains("onMouseleave"), this.isFocusToShow() || this.isBlurToHide() ? (r.onFocus = this.onFocus, r.onBlur = this.onBlur) : (r.onFocus = this.createTwoChains("onFocus"), r.onBlur = (u) => {
      u && (!u.relatedTarget || !fu(u.target, u.relatedTarget)) && this.createTwoChains("onBlur")(u);
    });
    const a = Ae(o && o.props && o.props.class, t.class);
    a && (r.class = a);
    const l = vi(o, k(k({}, r), {
      ref: "triggerRef"
    }), !0, !0), s = v($C, {
      key: "portal",
      getContainer: i && (() => i(this.getRootDomNode())),
      didUpdate: this.handlePortalUpdate,
      visible: this.$data.sPopupVisible
    }, {
      default: this.getComponent
    });
    return v(tt, null, [l, s]);
  }
});
var qX = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
const YX = (t) => {
  const e = t === !0 ? 0 : 1;
  return {
    bottomLeft: {
      points: ["tl", "bl"],
      offset: [0, 4],
      overflow: {
        adjustX: e,
        adjustY: 1
      }
    },
    bottomRight: {
      points: ["tr", "br"],
      offset: [0, 4],
      overflow: {
        adjustX: e,
        adjustY: 1
      }
    },
    topLeft: {
      points: ["bl", "tl"],
      offset: [0, -4],
      overflow: {
        adjustX: e,
        adjustY: 1
      }
    },
    topRight: {
      points: ["br", "tr"],
      offset: [0, -4],
      overflow: {
        adjustX: e,
        adjustY: 1
      }
    }
  };
}, KX = Oe({
  name: "SelectTrigger",
  inheritAttrs: !1,
  props: {
    dropdownAlign: Object,
    visible: {
      type: Boolean,
      default: void 0
    },
    disabled: {
      type: Boolean,
      default: void 0
    },
    dropdownClassName: String,
    dropdownStyle: ve.object,
    placement: String,
    empty: {
      type: Boolean,
      default: void 0
    },
    prefixCls: String,
    popupClassName: String,
    animation: String,
    transitionName: String,
    getPopupContainer: Function,
    dropdownRender: Function,
    containerWidth: Number,
    dropdownMatchSelectWidth: ve.oneOfType([Number, Boolean]).def(!0),
    popupElement: ve.any,
    direction: String,
    getTriggerDOMNode: Function,
    onPopupVisibleChange: Function,
    onPopupMouseEnter: Function,
    onPopupFocusin: Function,
    onPopupFocusout: Function
  },
  setup(t, e) {
    let {
      slots: n,
      attrs: i,
      expose: o
    } = e;
    const r = A(() => {
      const {
        dropdownMatchSelectWidth: l
      } = t;
      return YX(l);
    }), a = de();
    return o({
      getPopupElement: () => a.value
    }), () => {
      const l = k(k({}, t), i), {
        empty: s = !1
      } = l, u = qX(l, ["empty"]), {
        visible: c,
        dropdownAlign: d,
        prefixCls: f,
        popupElement: h,
        dropdownClassName: p,
        dropdownStyle: g,
        direction: m = "ltr",
        placement: y,
        dropdownMatchSelectWidth: b,
        containerWidth: w,
        dropdownRender: $,
        animation: C,
        transitionName: P,
        getPopupContainer: O,
        getTriggerDOMNode: E,
        onPopupVisibleChange: _,
        onPopupMouseEnter: D,
        onPopupFocusin: M,
        onPopupFocusout: N
      } = u, L = `${f}-dropdown`;
      let j = h;
      $ && (j = $({
        menuNode: h,
        props: t
      }));
      const B = C ? `${L}-${C}` : P, Y = k({
        minWidth: `${w}px`
      }, g);
      return typeof b == "number" ? Y.width = `${b}px` : b && (Y.width = `${w}px`), v(dg, J(J({}, t), {}, {
        showAction: _ ? ["click"] : [],
        hideAction: _ ? ["click"] : [],
        popupPlacement: y || (m === "rtl" ? "bottomRight" : "bottomLeft"),
        builtinPlacements: r.value,
        prefixCls: L,
        popupTransitionName: B,
        popupAlign: d,
        popupVisible: c,
        getPopupContainer: O,
        popupClassName: Ae(p, {
          [`${L}-empty`]: s
        }),
        popupStyle: Y,
        getTriggerDOMNode: E,
        onPopupVisibleChange: _
      }), {
        default: n.default,
        popup: () => v("div", {
          ref: a,
          onMouseenter: D,
          onFocusin: M,
          onFocusout: N
        }, [j])
      });
    };
  }
}), lt = {
  /**
   * BACKSPACE
   */
  BACKSPACE: 8,
  /**
   * TAB
   */
  TAB: 9,
  /**
   * ENTER
   */
  ENTER: 13,
  /**
   * SHIFT
   */
  SHIFT: 16,
  /**
   * CTRL
   */
  CTRL: 17,
  /**
   * ALT
   */
  ALT: 18,
  /**
   * CAPS_LOCK
   */
  CAPS_LOCK: 20,
  /**
   * ESC
   */
  ESC: 27,
  /**
   * SPACE
   */
  SPACE: 32,
  /**
   * PAGE_UP
   */
  PAGE_UP: 33,
  /**
   * PAGE_DOWN
   */
  PAGE_DOWN: 34,
  /**
   * END
   */
  END: 35,
  /**
   * HOME
   */
  HOME: 36,
  /**
   * LEFT
   */
  LEFT: 37,
  /**
   * UP
   */
  UP: 38,
  /**
   * RIGHT
   */
  RIGHT: 39,
  /**
   * DOWN
   */
  DOWN: 40,
  /**
   * N
   */
  N: 78,
  /**
   * P
   */
  P: 80,
  /**
   * META
   */
  META: 91,
  /**
   * WIN_KEY_RIGHT
   */
  WIN_KEY_RIGHT: 92,
  /**
   * CONTEXT_MENU
   */
  CONTEXT_MENU: 93,
  /**
   * F1
   */
  F1: 112,
  /**
   * F2
   */
  F2: 113,
  /**
   * F3
   */
  F3: 114,
  /**
   * F4
   */
  F4: 115,
  /**
   * F5
   */
  F5: 116,
  /**
   * F6
   */
  F6: 117,
  /**
   * F7
   */
  F7: 118,
  /**
   * F8
   */
  F8: 119,
  /**
   * F9
   */
  F9: 120,
  /**
   * F10
   */
  F10: 121,
  /**
   * F11
   */
  F11: 122,
  /**
   * F12
   */
  F12: 123,
  /**
   * SEMICOLON
   */
  SEMICOLON: 186,
  /**
   * EQUALS
   */
  EQUALS: 187,
  /**
   * WIN_KEY
   */
  WIN_KEY: 224
}, qc = (t, e) => {
  let {
    slots: n
  } = e;
  var i;
  const {
    class: o,
    customizeIcon: r,
    customizeIconProps: a,
    onMousedown: l,
    onClick: s
  } = t;
  let u;
  return typeof r == "function" ? u = r(a) : u = or(r) ? Eu(r) : r, v("span", {
    class: o,
    onMousedown: (c) => {
      c.preventDefault(), l && l(c);
    },
    style: {
      userSelect: "none",
      WebkitUserSelect: "none"
    },
    unselectable: "on",
    onClick: s,
    "aria-hidden": !0
  }, [u !== void 0 ? u : v("span", {
    class: o.split(/\s+/).map((c) => `${c}-icon`)
  }, [(i = n.default) === null || i === void 0 ? void 0 : i.call(n)])]);
};
qc.inheritAttrs = !1;
qc.displayName = "TransBtn";
qc.props = {
  class: String,
  customizeIcon: ve.any,
  customizeIconProps: ve.any,
  onMousedown: Function,
  onClick: Function
};
var XX = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
const ZX = Oe({
  compatConfig: {
    MODE: 3
  },
  // inheritAttrs: false,
  props: {
    disabled: ve.looseBool,
    type: ve.string,
    value: ve.any,
    tag: {
      type: String,
      default: "input"
    },
    size: ve.string,
    onChange: Function,
    onInput: Function,
    onBlur: Function,
    onFocus: Function,
    onKeydown: Function,
    onCompositionstart: Function,
    onCompositionend: Function,
    onKeyup: Function,
    onPaste: Function,
    onMousedown: Function
  },
  emits: ["change", "input", "blur", "keydown", "focus", "compositionstart", "compositionend", "keyup", "paste", "mousedown"],
  setup(t, e) {
    let {
      expose: n
    } = e;
    const i = Te(null);
    return n({
      focus: () => {
        i.value && i.value.focus();
      },
      blur: () => {
        i.value && i.value.blur();
      },
      input: i,
      setSelectionRange: (s, u, c) => {
        var d;
        (d = i.value) === null || d === void 0 || d.setSelectionRange(s, u, c);
      },
      select: () => {
        var s;
        (s = i.value) === null || s === void 0 || s.select();
      },
      getSelectionStart: () => {
        var s;
        return (s = i.value) === null || s === void 0 ? void 0 : s.selectionStart;
      },
      getSelectionEnd: () => {
        var s;
        return (s = i.value) === null || s === void 0 ? void 0 : s.selectionEnd;
      },
      getScrollTop: () => {
        var s;
        return (s = i.value) === null || s === void 0 ? void 0 : s.scrollTop;
      }
    }), () => {
      const {
        tag: s,
        value: u
      } = t, c = XX(t, ["tag", "value"]);
      return v(s, J(J({}, c), {}, {
        ref: i,
        value: u
      }), null);
    };
  }
});
function i2(t) {
  const e = t.getBoundingClientRect(), n = document.documentElement;
  return {
    left: e.left + (window.scrollX || n.scrollLeft) - (n.clientLeft || document.body.clientLeft || 0),
    top: e.top + (window.scrollY || n.scrollTop) - (n.clientTop || document.body.clientTop || 0)
  };
}
function GX(t) {
  return Object.keys(t).reduce((e, n) => {
    const i = t[n];
    return typeof i > "u" || i === null || (e += `${n}: ${t[n]};`), e;
  }, "");
}
var UX = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
const fg = Oe({
  compatConfig: {
    MODE: 3
  },
  inheritAttrs: !1,
  props: {
    disabled: ve.looseBool,
    type: ve.string,
    value: ve.any,
    lazy: ve.bool.def(!0),
    tag: {
      type: String,
      default: "input"
    },
    size: ve.string,
    style: ve.oneOfType([String, Object]),
    class: ve.string
  },
  emits: ["change", "input", "blur", "keydown", "focus", "compositionstart", "compositionend", "keyup", "paste", "mousedown"],
  setup(t, e) {
    let {
      emit: n,
      attrs: i,
      expose: o
    } = e;
    const r = Te(null), a = de(), l = de(!1);
    _e([() => t.value, l], () => {
      l.value || (a.value = t.value);
    }, {
      immediate: !0
    });
    const s = (O) => {
      n("change", O);
    }, u = (O) => {
      l.value = !0, O.target.composing = !0, n("compositionstart", O);
    }, c = (O) => {
      l.value = !1, O.target.composing = !1, n("compositionend", O);
      const E = document.createEvent("HTMLEvents");
      E.initEvent("input", !0, !0), O.target.dispatchEvent(E), s(O);
    }, d = (O) => {
      if (l.value && t.lazy) {
        a.value = O.target.value;
        return;
      }
      n("input", O);
    }, f = (O) => {
      n("blur", O);
    }, h = (O) => {
      n("focus", O);
    }, p = () => {
      r.value && r.value.focus();
    }, g = () => {
      r.value && r.value.blur();
    }, m = (O) => {
      n("keydown", O);
    }, y = (O) => {
      n("keyup", O);
    }, b = (O, E, _) => {
      var D;
      (D = r.value) === null || D === void 0 || D.setSelectionRange(O, E, _);
    }, w = () => {
      var O;
      (O = r.value) === null || O === void 0 || O.select();
    };
    o({
      focus: p,
      blur: g,
      input: A(() => {
        var O;
        return (O = r.value) === null || O === void 0 ? void 0 : O.input;
      }),
      setSelectionRange: b,
      select: w,
      getSelectionStart: () => {
        var O;
        return (O = r.value) === null || O === void 0 ? void 0 : O.getSelectionStart();
      },
      getSelectionEnd: () => {
        var O;
        return (O = r.value) === null || O === void 0 ? void 0 : O.getSelectionEnd();
      },
      getScrollTop: () => {
        var O;
        return (O = r.value) === null || O === void 0 ? void 0 : O.getScrollTop();
      }
    });
    const $ = (O) => {
      n("mousedown", O);
    }, C = (O) => {
      n("paste", O);
    }, P = A(() => t.style && typeof t.style != "string" ? GX(t.style) : t.style);
    return () => {
      const {
        style: O,
        lazy: E
      } = t, _ = UX(t, ["style", "lazy"]);
      return v(ZX, J(J(J({}, _), i), {}, {
        style: P.value,
        onInput: d,
        onChange: s,
        onBlur: f,
        onFocus: h,
        ref: r,
        value: a.value,
        onCompositionstart: u,
        onCompositionend: c,
        onKeyup: y,
        onKeydown: m,
        onPaste: C,
        onMousedown: $
      }), null);
    };
  }
}), JX = {
  inputRef: ve.any,
  prefixCls: String,
  id: String,
  inputElement: ve.VueNode,
  disabled: {
    type: Boolean,
    default: void 0
  },
  autofocus: {
    type: Boolean,
    default: void 0
  },
  autocomplete: String,
  editable: {
    type: Boolean,
    default: void 0
  },
  activeDescendantId: String,
  value: String,
  open: {
    type: Boolean,
    default: void 0
  },
  tabindex: ve.oneOfType([ve.number, ve.string]),
  /** Pass accessibility props to input */
  attrs: ve.object,
  onKeydown: {
    type: Function
  },
  onMousedown: {
    type: Function
  },
  onChange: {
    type: Function
  },
  onPaste: {
    type: Function
  },
  onCompositionstart: {
    type: Function
  },
  onCompositionend: {
    type: Function
  },
  onFocus: {
    type: Function
  },
  onBlur: {
    type: Function
  }
}, KN = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "SelectInput",
  inheritAttrs: !1,
  props: JX,
  setup(t) {
    let e = null;
    const n = qt("VCSelectContainerEvent");
    return () => {
      var i;
      const {
        prefixCls: o,
        id: r,
        inputElement: a,
        disabled: l,
        tabindex: s,
        autofocus: u,
        autocomplete: c,
        editable: d,
        activeDescendantId: f,
        value: h,
        onKeydown: p,
        onMousedown: g,
        onChange: m,
        onPaste: y,
        onCompositionstart: b,
        onCompositionend: w,
        onFocus: $,
        onBlur: C,
        open: P,
        inputRef: O,
        attrs: E
      } = t;
      let _ = a || v(fg, null, null);
      const D = _.props || {}, {
        onKeydown: M,
        onInput: N,
        onFocus: L,
        onBlur: j,
        onMousedown: B,
        onCompositionstart: Y,
        onCompositionend: Q,
        style: G
      } = D;
      return _ = vi(_, k(k(k(k(k({
        type: "search"
      }, D), {
        id: r,
        ref: O,
        disabled: l,
        tabindex: s,
        lazy: !1,
        autocomplete: c || "off",
        autofocus: u,
        class: Ae(`${o}-selection-search-input`, (i = _?.props) === null || i === void 0 ? void 0 : i.class),
        role: "combobox",
        "aria-expanded": P,
        "aria-haspopup": "listbox",
        "aria-owns": `${r}_list`,
        "aria-autocomplete": "list",
        "aria-controls": `${r}_list`,
        "aria-activedescendant": f
      }), E), {
        value: d ? h : "",
        readonly: !d,
        unselectable: d ? null : "on",
        style: k(k({}, G), {
          opacity: d ? null : 0
        }),
        onKeydown: (V) => {
          p(V), M && M(V);
        },
        onMousedown: (V) => {
          g(V), B && B(V);
        },
        onInput: (V) => {
          m(V), N && N(V);
        },
        onCompositionstart(V) {
          b(V), Y && Y(V);
        },
        onCompositionend(V) {
          w(V), Q && Q(V);
        },
        onPaste: y,
        onFocus: function() {
          clearTimeout(e), L && L(arguments.length <= 0 ? void 0 : arguments[0]), $ && $(arguments.length <= 0 ? void 0 : arguments[0]), n?.focus(arguments.length <= 0 ? void 0 : arguments[0]);
        },
        onBlur: function() {
          for (var V = arguments.length, H = new Array(V), q = 0; q < V; q++)
            H[q] = arguments[q];
          e = setTimeout(() => {
            j && j(H[0]), C && C(H[0]), n?.blur(H[0]);
          }, 100);
        }
      }), _.type === "textarea" ? {} : {
        type: "search"
      }), !0, !0), _;
    };
  }
}), eZ = `accept acceptcharset accesskey action allowfullscreen allowtransparency
alt async autocomplete autofocus autoplay capture cellpadding cellspacing challenge
charset checked classid classname colspan cols content contenteditable contextmenu
controls coords crossorigin data datetime default defer dir disabled download draggable
enctype form formaction formenctype formmethod formnovalidate formtarget frameborder
headers height hidden high href hreflang htmlfor for httpequiv icon id inputmode integrity
is keyparams keytype kind label lang list loop low manifest marginheight marginwidth max maxlength media
mediagroup method min minlength multiple muted name novalidate nonce open
optimum pattern placeholder poster preload radiogroup readonly rel required
reversed role rowspan rows sandbox scope scoped scrolling seamless selected
shape size sizes span spellcheck src srcdoc srclang srcset start step style
summary tabindex target title type usemap value width wmode wrap`, tZ = `onCopy onCut onPaste onCompositionend onCompositionstart onCompositionupdate onKeydown
    onKeypress onKeyup onFocus onBlur onChange onInput onSubmit onClick onContextmenu onDoubleclick onDblclick
    onDrag onDragend onDragenter onDragexit onDragleave onDragover onDragstart onDrop onMousedown
    onMouseenter onMouseleave onMousemove onMouseout onMouseover onMouseup onSelect onTouchcancel
    onTouchend onTouchmove onTouchstart onTouchstartPassive onTouchmovePassive onScroll onWheel onAbort onCanplay onCanplaythrough
    onDurationchange onEmptied onEncrypted onEnded onError onLoadeddata onLoadedmetadata
    onLoadstart onPause onPlay onPlaying onProgress onRatechange onSeeked onSeeking onStalled onSuspend onTimeupdate onVolumechange onWaiting onLoad onError`, o2 = `${eZ} ${tZ}`.split(/[\s\n]+/), nZ = "aria-", iZ = "data-";
function r2(t, e) {
  return t.indexOf(e) === 0;
}
function rd(t) {
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, n;
  e === !1 ? n = {
    aria: !0,
    data: !0,
    attr: !0
  } : e === !0 ? n = {
    aria: !0
  } : n = k({}, e);
  const i = {};
  return Object.keys(t).forEach((o) => {
    // Aria
    (n.aria && (o === "role" || r2(o, nZ)) || // Data
    n.data && r2(o, iZ) || // Attr
    n.attr && (o2.includes(o) || o2.includes(o.toLowerCase()))) && (i[o] = t[o]);
  }), i;
}
const XN = Symbol("OverflowContextProviderKey"), dO = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "OverflowContextProvider",
  inheritAttrs: !1,
  props: {
    value: {
      type: Object
    }
  },
  setup(t, e) {
    let {
      slots: n
    } = e;
    return Xt(XN, A(() => t.value)), () => {
      var i;
      return (i = n.default) === null || i === void 0 ? void 0 : i.call(n);
    };
  }
}), oZ = () => qt(XN, A(() => null));
var rZ = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
const Td = void 0, sv = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "Item",
  props: {
    prefixCls: String,
    item: ve.any,
    renderItem: Function,
    responsive: Boolean,
    itemKey: {
      type: [String, Number]
    },
    registerSize: Function,
    display: Boolean,
    order: Number,
    component: ve.any,
    invalidate: Boolean
  },
  setup(t, e) {
    let {
      slots: n,
      expose: i
    } = e;
    const o = A(() => t.responsive && !t.display), r = de();
    i({
      itemNodeRef: r
    });
    function a(l) {
      t.registerSize(t.itemKey, l);
    }
    return wo(() => {
      a(null);
    }), () => {
      var l;
      const {
        prefixCls: s,
        invalidate: u,
        item: c,
        renderItem: d,
        responsive: f,
        registerSize: h,
        itemKey: p,
        display: g,
        order: m,
        component: y = "div"
      } = t, b = rZ(t, ["prefixCls", "invalidate", "item", "renderItem", "responsive", "registerSize", "itemKey", "display", "order", "component"]), w = (l = n.default) === null || l === void 0 ? void 0 : l.call(n), $ = d && c !== Td ? d(c) : w;
      let C;
      u || (C = {
        opacity: o.value ? 0 : 1,
        height: o.value ? 0 : Td,
        overflowY: o.value ? "hidden" : Td,
        order: f ? m : Td,
        pointerEvents: o.value ? "none" : Td,
        position: o.value ? "absolute" : Td
      });
      const P = {};
      return o.value && (P["aria-hidden"] = !0), v(Mu, {
        disabled: !f,
        onResize: (O) => {
          let {
            offsetWidth: E
          } = O;
          a(E);
        }
      }, {
        default: () => v(y, J(J(J({
          class: Ae(!u && s),
          style: C
        }, P), b), {}, {
          ref: r
        }), {
          default: () => [$]
        })
      });
    };
  }
});
var Zb = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
const aZ = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "RawItem",
  inheritAttrs: !1,
  props: {
    component: ve.any,
    title: ve.any,
    id: String,
    onMouseenter: {
      type: Function
    },
    onMouseleave: {
      type: Function
    },
    onClick: {
      type: Function
    },
    onKeydown: {
      type: Function
    },
    onFocus: {
      type: Function
    },
    role: String,
    tabindex: Number
  },
  setup(t, e) {
    let {
      slots: n,
      attrs: i
    } = e;
    const o = oZ();
    return () => {
      var r;
      if (!o.value) {
        const {
          component: d = "div"
        } = t, f = Zb(t, ["component"]);
        return v(d, J(J({}, f), i), {
          default: () => [(r = n.default) === null || r === void 0 ? void 0 : r.call(n)]
        });
      }
      const a = o.value, {
        className: l
      } = a, s = Zb(a, ["className"]), {
        class: u
      } = i, c = Zb(i, ["class"]);
      return v(dO, {
        value: null
      }, {
        default: () => [v(sv, J(J(J({
          class: Ae(l, u)
        }, s), c), t), n)]
      });
    };
  }
});
var lZ = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
const ZN = "responsive", GN = "invalidate";
function sZ(t) {
  return `+ ${t.length} ...`;
}
const uZ = () => ({
  id: String,
  prefixCls: String,
  data: Array,
  itemKey: [String, Number, Function],
  /** Used for `responsive`. It will limit render node to avoid perf issue */
  itemWidth: {
    type: Number,
    default: 10
  },
  renderItem: Function,
  /** @private Do not use in your production. Render raw node that need wrap Item by developer self */
  renderRawItem: Function,
  maxCount: [Number, String],
  renderRest: Function,
  /** @private Do not use in your production. Render raw node that need wrap Item by developer self */
  renderRawRest: Function,
  suffix: ve.any,
  component: String,
  itemComponent: ve.any,
  /** @private This API may be refactor since not well design */
  onVisibleChange: Function,
  /** When set to `full`, ssr will render full items by default and remove at client side */
  ssr: String,
  onMousedown: Function,
  role: String
}), bs = Oe({
  name: "Overflow",
  inheritAttrs: !1,
  props: uZ(),
  emits: ["visibleChange"],
  setup(t, e) {
    let {
      attrs: n,
      emit: i,
      slots: o
    } = e;
    const r = A(() => t.ssr === "full"), a = Te(null), l = A(() => a.value || 0), s = Te(/* @__PURE__ */ new Map()), u = Te(0), c = Te(0), d = Te(0), f = Te(null), h = Te(null), p = A(() => h.value === null && r.value ? Number.MAX_SAFE_INTEGER : h.value || 0), g = Te(!1), m = A(() => `${t.prefixCls}-item`), y = A(() => Math.max(u.value, c.value)), b = A(() => !!(t.data.length && t.maxCount === ZN)), w = A(() => t.maxCount === GN), $ = A(() => b.value || typeof t.maxCount == "number" && t.data.length > t.maxCount), C = A(() => {
      let B = t.data;
      return b.value ? a.value === null && r.value ? B = t.data : B = t.data.slice(0, Math.min(t.data.length, l.value / t.itemWidth)) : typeof t.maxCount == "number" && (B = t.data.slice(0, t.maxCount)), B;
    }), P = A(() => b.value ? t.data.slice(p.value + 1) : t.data.slice(C.value.length)), O = (B, Y) => {
      var Q;
      return typeof t.itemKey == "function" ? t.itemKey(B) : (Q = t.itemKey && B?.[t.itemKey]) !== null && Q !== void 0 ? Q : Y;
    }, E = A(() => t.renderItem || ((B) => B)), _ = (B, Y) => {
      h.value = B, Y || (g.value = B < t.data.length - 1, i("visibleChange", B));
    }, D = (B, Y) => {
      a.value = Y.clientWidth;
    }, M = (B, Y) => {
      const Q = new Map(s.value);
      Y === null ? Q.delete(B) : Q.set(B, Y), s.value = Q;
    }, N = (B, Y) => {
      u.value = c.value, c.value = Y;
    }, L = (B, Y) => {
      d.value = Y;
    }, j = (B) => s.value.get(O(C.value[B], B));
    return _e([l, s, c, d, () => t.itemKey, C], () => {
      if (l.value && y.value && C.value) {
        let B = d.value;
        const Y = C.value.length, Q = Y - 1;
        if (!Y) {
          _(0), f.value = null;
          return;
        }
        for (let G = 0; G < Y; G += 1) {
          const V = j(G);
          if (V === void 0) {
            _(G - 1, !0);
            break;
          }
          if (B += V, // Only one means `totalWidth` is the final width
          Q === 0 && B <= l.value || // Last two width will be the final width
          G === Q - 1 && B + j(Q) <= l.value) {
            _(Q), f.value = null;
            break;
          } else if (B + y.value > l.value) {
            _(G - 1), f.value = B - V - d.value + c.value;
            break;
          }
        }
        t.suffix && j(0) + d.value > l.value && (f.value = null);
      }
    }), () => {
      const B = g.value && !!P.value.length, {
        itemComponent: Y,
        renderRawItem: Q,
        renderRawRest: G,
        renderRest: V,
        prefixCls: H = "rc-overflow",
        suffix: q,
        component: K = "div",
        id: ee,
        onMousedown: ie
      } = t, {
        class: ae,
        style: te
      } = n, U = lZ(n, ["class", "style"]);
      let me = {};
      f.value !== null && b.value && (me = {
        position: "absolute",
        left: `${f.value}px`,
        top: 0
      });
      const ce = {
        prefixCls: m.value,
        responsive: b.value,
        component: Y,
        invalidate: w.value
      }, ue = Q ? (ke, ze) => {
        const Re = O(ke, ze);
        return v(dO, {
          key: Re,
          value: k(k({}, ce), {
            order: ze,
            item: ke,
            itemKey: Re,
            registerSize: M,
            display: ze <= p.value
          })
        }, {
          default: () => [Q(ke, ze)]
        });
      } : (ke, ze) => {
        const Re = O(ke, ze);
        return v(sv, J(J({}, ce), {}, {
          order: ze,
          key: Re,
          item: ke,
          renderItem: E.value,
          itemKey: Re,
          registerSize: M,
          display: ze <= p.value
        }), null);
      };
      let fe = () => null;
      const he = {
        order: B ? p.value : Number.MAX_SAFE_INTEGER,
        className: `${m.value} ${m.value}-rest`,
        registerSize: N,
        display: B
      };
      if (G)
        G && (fe = () => v(dO, {
          value: k(k({}, ce), he)
        }, {
          default: () => [G(P.value)]
        }));
      else {
        const ke = V || sZ;
        fe = () => v(sv, J(J({}, ce), he), {
          default: () => typeof ke == "function" ? ke(P.value) : ke
        });
      }
      const le = () => {
        var ke;
        return v(K, J({
          id: ee,
          class: Ae(!w.value && H, ae),
          style: te,
          onMousedown: ie,
          role: t.role
        }, U), {
          default: () => [C.value.map(ue), $.value ? fe() : null, q && v(sv, J(J({}, ce), {}, {
            order: p.value,
            class: `${m.value}-suffix`,
            registerSize: L,
            display: !0,
            style: me
          }), {
            default: () => q
          }), (ke = o.default) === null || ke === void 0 ? void 0 : ke.call(o)]
        });
      };
      return v(Mu, {
        disabled: !b.value,
        onResize: D
      }, {
        default: le
      });
    };
  }
});
bs.Item = aZ;
bs.RESPONSIVE = ZN;
bs.INVALIDATE = GN;
const cZ = Symbol("TreeSelectLegacyContextPropsKey");
function kC() {
  return qt(cZ, {});
}
const dZ = {
  id: String,
  prefixCls: String,
  values: ve.array,
  open: {
    type: Boolean,
    default: void 0
  },
  searchValue: String,
  inputRef: ve.any,
  placeholder: ve.any,
  disabled: {
    type: Boolean,
    default: void 0
  },
  mode: String,
  showSearch: {
    type: Boolean,
    default: void 0
  },
  autofocus: {
    type: Boolean,
    default: void 0
  },
  autocomplete: String,
  activeDescendantId: String,
  tabindex: ve.oneOfType([ve.number, ve.string]),
  compositionStatus: Boolean,
  removeIcon: ve.any,
  choiceTransitionName: String,
  maxTagCount: ve.oneOfType([ve.number, ve.string]),
  maxTagTextLength: Number,
  maxTagPlaceholder: ve.any.def(() => (t) => `+ ${t.length} ...`),
  tagRender: Function,
  onToggleOpen: {
    type: Function
  },
  onRemove: Function,
  onInputChange: Function,
  onInputPaste: Function,
  onInputKeyDown: Function,
  onInputMouseDown: Function,
  onInputCompositionStart: Function,
  onInputCompositionEnd: Function
}, a2 = (t) => {
  t.preventDefault(), t.stopPropagation();
}, fZ = Oe({
  name: "MultipleSelectSelector",
  inheritAttrs: !1,
  props: dZ,
  setup(t) {
    const e = Te(), n = Te(0), i = Te(!1), o = kC(), r = A(() => `${t.prefixCls}-selection`), a = A(() => t.open || t.mode === "tags" ? t.searchValue : ""), l = A(() => t.mode === "tags" || t.showSearch && (t.open || i.value)), s = de("");
    zt(() => {
      s.value = a.value;
    }), Lt(() => {
      _e(s, () => {
        n.value = e.value.scrollWidth;
      }, {
        flush: "post",
        immediate: !0
      });
    });
    function u(p, g, m, y, b) {
      return v("span", {
        class: Ae(`${r.value}-item`, {
          [`${r.value}-item-disabled`]: m
        }),
        title: typeof p == "string" || typeof p == "number" ? p.toString() : void 0
      }, [v("span", {
        class: `${r.value}-item-content`
      }, [g]), y && v(qc, {
        class: `${r.value}-item-remove`,
        onMousedown: a2,
        onClick: b,
        customizeIcon: t.removeIcon
      }, {
        default: () => [Ve("×")]
      })]);
    }
    function c(p, g, m, y, b, w) {
      var $;
      const C = (O) => {
        a2(O), t.onToggleOpen(!open);
      };
      let P = w;
      return o.keyEntities && (P = (($ = o.keyEntities[p]) === null || $ === void 0 ? void 0 : $.node) || {}), v("span", {
        key: p,
        onMousedown: C
      }, [t.tagRender({
        label: g,
        value: p,
        disabled: m,
        closable: y,
        onClose: b,
        option: P
      })]);
    }
    function d(p) {
      const {
        disabled: g,
        label: m,
        value: y,
        option: b
      } = p, w = !t.disabled && !g;
      let $ = m;
      if (typeof t.maxTagTextLength == "number" && (typeof m == "string" || typeof m == "number")) {
        const P = String($);
        P.length > t.maxTagTextLength && ($ = `${P.slice(0, t.maxTagTextLength)}...`);
      }
      const C = (P) => {
        var O;
        P && P.stopPropagation(), (O = t.onRemove) === null || O === void 0 || O.call(t, p);
      };
      return typeof t.tagRender == "function" ? c(y, $, g, w, C, b) : u(m, $, g, w, C);
    }
    function f(p) {
      const {
        maxTagPlaceholder: g = (y) => `+ ${y.length} ...`
      } = t, m = typeof g == "function" ? g(p) : g;
      return u(m, m, !1);
    }
    const h = (p) => {
      const g = p.target.composing;
      s.value = p.target.value, g || t.onInputChange(p);
    };
    return () => {
      const {
        id: p,
        prefixCls: g,
        values: m,
        open: y,
        inputRef: b,
        placeholder: w,
        disabled: $,
        autofocus: C,
        autocomplete: P,
        activeDescendantId: O,
        tabindex: E,
        compositionStatus: _,
        onInputPaste: D,
        onInputKeyDown: M,
        onInputMouseDown: N,
        onInputCompositionStart: L,
        onInputCompositionEnd: j
      } = t, B = v("div", {
        class: `${r.value}-search`,
        style: {
          width: n.value + "px"
        },
        key: "input"
      }, [v(KN, {
        inputRef: b,
        open: y,
        prefixCls: g,
        id: p,
        inputElement: null,
        disabled: $,
        autofocus: C,
        autocomplete: P,
        editable: l.value,
        activeDescendantId: O,
        value: s.value,
        onKeydown: M,
        onMousedown: N,
        onChange: h,
        onPaste: D,
        onCompositionstart: L,
        onCompositionend: j,
        tabindex: E,
        attrs: rd(t, !0),
        onFocus: () => i.value = !0,
        onBlur: () => i.value = !1
      }, null), v("span", {
        ref: e,
        class: `${r.value}-search-mirror`,
        "aria-hidden": !0
      }, [s.value, Ve(" ")])]), Y = v(bs, {
        prefixCls: `${r.value}-overflow`,
        data: m,
        renderItem: d,
        renderRest: f,
        suffix: B,
        itemKey: "key",
        maxCount: t.maxTagCount,
        key: "overflow"
      }, null);
      return v(tt, null, [Y, !m.length && !a.value && !_ && v("span", {
        class: `${r.value}-placeholder`
      }, [w])]);
    };
  }
}), hZ = {
  inputElement: ve.any,
  id: String,
  prefixCls: String,
  values: ve.array,
  open: {
    type: Boolean,
    default: void 0
  },
  searchValue: String,
  inputRef: ve.any,
  placeholder: ve.any,
  compositionStatus: {
    type: Boolean,
    default: void 0
  },
  disabled: {
    type: Boolean,
    default: void 0
  },
  mode: String,
  showSearch: {
    type: Boolean,
    default: void 0
  },
  autofocus: {
    type: Boolean,
    default: void 0
  },
  autocomplete: String,
  activeDescendantId: String,
  tabindex: ve.oneOfType([ve.number, ve.string]),
  activeValue: String,
  backfill: {
    type: Boolean,
    default: void 0
  },
  optionLabelRender: Function,
  onInputChange: Function,
  onInputPaste: Function,
  onInputKeyDown: Function,
  onInputMouseDown: Function,
  onInputCompositionStart: Function,
  onInputCompositionEnd: Function
}, TC = Oe({
  name: "SingleSelector",
  setup(t) {
    const e = Te(!1), n = A(() => t.mode === "combobox"), i = A(() => n.value || t.showSearch), o = A(() => {
      let c = t.searchValue || "";
      return n.value && t.activeValue && !e.value && (c = t.activeValue), c;
    }), r = kC();
    _e([n, () => t.activeValue], () => {
      n.value && (e.value = !1);
    }, {
      immediate: !0
    });
    const a = A(() => t.mode !== "combobox" && !t.open && !t.showSearch ? !1 : !!o.value || t.compositionStatus), l = A(() => {
      const c = t.values[0];
      return c && (typeof c.label == "string" || typeof c.label == "number") ? c.label.toString() : void 0;
    }), s = () => {
      if (t.values[0])
        return null;
      const c = a.value ? {
        visibility: "hidden"
      } : void 0;
      return v("span", {
        class: `${t.prefixCls}-selection-placeholder`,
        style: c
      }, [t.placeholder]);
    }, u = (c) => {
      c.target.composing || (e.value = !0, t.onInputChange(c));
    };
    return () => {
      var c, d, f, h;
      const {
        inputElement: p,
        prefixCls: g,
        id: m,
        values: y,
        inputRef: b,
        disabled: w,
        autofocus: $,
        autocomplete: C,
        activeDescendantId: P,
        open: O,
        tabindex: E,
        optionLabelRender: _,
        onInputKeyDown: D,
        onInputMouseDown: M,
        onInputPaste: N,
        onInputCompositionStart: L,
        onInputCompositionEnd: j
      } = t, B = y[0];
      let Y = null;
      if (B && r.customSlots) {
        const Q = (c = B.key) !== null && c !== void 0 ? c : B.value, G = ((d = r.keyEntities[Q]) === null || d === void 0 ? void 0 : d.node) || {};
        Y = r.customSlots[(f = G.slots) === null || f === void 0 ? void 0 : f.title] || r.customSlots.title || B.label, typeof Y == "function" && (Y = Y(G));
      } else
        Y = _ && B ? _(B.option) : B?.label;
      return v(tt, null, [v("span", {
        class: `${g}-selection-search`
      }, [v(KN, {
        inputRef: b,
        prefixCls: g,
        id: m,
        open: O,
        inputElement: p,
        disabled: w,
        autofocus: $,
        autocomplete: C,
        editable: i.value,
        activeDescendantId: P,
        value: o.value,
        onKeydown: D,
        onMousedown: M,
        onChange: u,
        onPaste: N,
        onCompositionstart: L,
        onCompositionend: j,
        tabindex: E,
        attrs: rd(t, !0)
      }, null)]), !n.value && B && !a.value && v("span", {
        class: `${g}-selection-item`,
        title: l.value
      }, [v(tt, {
        key: (h = B.key) !== null && h !== void 0 ? h : B.value
      }, [Y])]), s()]);
    };
  }
});
TC.props = hZ;
TC.inheritAttrs = !1;
function pZ(t) {
  return ![
    // System function button
    lt.ESC,
    lt.SHIFT,
    lt.BACKSPACE,
    lt.TAB,
    lt.WIN_KEY,
    lt.ALT,
    lt.META,
    lt.WIN_KEY_RIGHT,
    lt.CTRL,
    lt.SEMICOLON,
    lt.EQUALS,
    lt.CAPS_LOCK,
    lt.CONTEXT_MENU,
    // F1-F12
    lt.F1,
    lt.F2,
    lt.F3,
    lt.F4,
    lt.F5,
    lt.F6,
    lt.F7,
    lt.F8,
    lt.F9,
    lt.F10,
    lt.F11,
    lt.F12
  ].includes(t);
}
function UN() {
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 250, e = null, n;
  tn(() => {
    clearTimeout(n);
  });
  function i(o) {
    (o || e === null) && (e = o), clearTimeout(n), n = setTimeout(() => {
      e = null;
    }, t);
  }
  return [() => e, i];
}
function Fp() {
  const t = (e) => {
    t.current = e;
  };
  return t;
}
const gZ = Oe({
  name: "Selector",
  inheritAttrs: !1,
  props: {
    id: String,
    prefixCls: String,
    showSearch: {
      type: Boolean,
      default: void 0
    },
    open: {
      type: Boolean,
      default: void 0
    },
    /** Display in the Selector value, it's not same as `value` prop */
    values: ve.array,
    multiple: {
      type: Boolean,
      default: void 0
    },
    mode: String,
    searchValue: String,
    activeValue: String,
    inputElement: ve.any,
    autofocus: {
      type: Boolean,
      default: void 0
    },
    activeDescendantId: String,
    tabindex: ve.oneOfType([ve.number, ve.string]),
    disabled: {
      type: Boolean,
      default: void 0
    },
    placeholder: ve.any,
    removeIcon: ve.any,
    // Tags
    maxTagCount: ve.oneOfType([ve.number, ve.string]),
    maxTagTextLength: Number,
    maxTagPlaceholder: ve.any,
    tagRender: Function,
    optionLabelRender: Function,
    /** Check if `tokenSeparators` contains `\n` or `\r\n` */
    tokenWithEnter: {
      type: Boolean,
      default: void 0
    },
    // Motion
    choiceTransitionName: String,
    onToggleOpen: {
      type: Function
    },
    /** `onSearch` returns go next step boolean to check if need do toggle open */
    onSearch: Function,
    onSearchSubmit: Function,
    onRemove: Function,
    onInputKeyDown: {
      type: Function
    },
    /**
     * @private get real dom for trigger align.
     * This may be removed after React provides replacement of `findDOMNode`
     */
    domRef: Function
  },
  setup(t, e) {
    let {
      expose: n
    } = e;
    const i = Fp(), o = de(!1), [r, a] = UN(0), l = (y) => {
      const {
        which: b
      } = y;
      (b === lt.UP || b === lt.DOWN) && y.preventDefault(), t.onInputKeyDown && t.onInputKeyDown(y), b === lt.ENTER && t.mode === "tags" && !o.value && !t.open && t.onSearchSubmit(y.target.value), pZ(b) && t.onToggleOpen(!0);
    }, s = () => {
      a(!0);
    };
    let u = null;
    const c = (y) => {
      t.onSearch(y, !0, o.value) !== !1 && t.onToggleOpen(!0);
    }, d = () => {
      o.value = !0;
    }, f = (y) => {
      o.value = !1, t.mode !== "combobox" && c(y.target.value);
    }, h = (y) => {
      let {
        target: {
          value: b
        }
      } = y;
      if (t.tokenWithEnter && u && /[\r\n]/.test(u)) {
        const w = u.replace(/[\r\n]+$/, "").replace(/\r\n/g, " ").replace(/[\r\n]/g, " ");
        b = b.replace(w, u);
      }
      u = null, c(b);
    }, p = (y) => {
      const {
        clipboardData: b
      } = y;
      u = b.getData("text");
    }, g = (y) => {
      let {
        target: b
      } = y;
      b !== i.current && (document.body.style.msTouchAction !== void 0 ? setTimeout(() => {
        i.current.focus();
      }) : i.current.focus());
    }, m = (y) => {
      const b = r();
      y.target !== i.current && !b && y.preventDefault(), (t.mode !== "combobox" && (!t.showSearch || !b) || !t.open) && (t.open && t.onSearch("", !0, !1), t.onToggleOpen());
    };
    return n({
      focus: () => {
        i.current.focus();
      },
      blur: () => {
        i.current.blur();
      }
    }), () => {
      const {
        prefixCls: y,
        domRef: b,
        mode: w
      } = t, $ = {
        inputRef: i,
        onInputKeyDown: l,
        onInputMouseDown: s,
        onInputChange: h,
        onInputPaste: p,
        compositionStatus: o.value,
        onInputCompositionStart: d,
        onInputCompositionEnd: f
      }, C = w === "multiple" || w === "tags" ? v(fZ, J(J({}, t), $), null) : v(TC, J(J({}, t), $), null);
      return v("div", {
        ref: b,
        class: `${y}-selector`,
        onClick: g,
        onMousedown: m
      }, [C]);
    };
  }
});
function mZ(t, e, n) {
  function i(o) {
    var r, a, l;
    let s = o.target;
    s.shadowRoot && o.composed && (s = o.composedPath()[0] || s);
    const u = [(r = t[0]) === null || r === void 0 ? void 0 : r.value, (l = (a = t[1]) === null || a === void 0 ? void 0 : a.value) === null || l === void 0 ? void 0 : l.getPopupElement()];
    e.value && u.every((c) => c && !c.contains(s) && c !== s) && n(!1);
  }
  Lt(() => {
    window.addEventListener("mousedown", i);
  }), tn(() => {
    window.removeEventListener("mousedown", i);
  });
}
function vZ() {
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 10;
  const e = Te(!1);
  let n;
  const i = () => {
    clearTimeout(n);
  };
  return Lt(() => {
    i();
  }), [e, (r, a) => {
    i(), n = setTimeout(() => {
      e.value = r, a && a();
    }, t);
  }, i];
}
const JN = Symbol("BaseSelectContextKey");
function yZ(t) {
  return Xt(JN, t);
}
function bZ() {
  return qt(JN, {});
}
const PC = (() => {
  if (typeof navigator > "u" || typeof window > "u")
    return !1;
  const t = navigator.userAgent || navigator.vendor || window.opera;
  return /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(t?.substring(0, 4));
});
function e3(t) {
  if (!wA(t)) return Bn(t);
  const e = new Proxy({}, {
    get(n, i, o) {
      return Reflect.get(t.value, i, o);
    },
    set(n, i, o) {
      return t.value[i] = o, !0;
    },
    deleteProperty(n, i) {
      return Reflect.deleteProperty(t.value, i);
    },
    has(n, i) {
      return Reflect.has(t.value, i);
    },
    ownKeys() {
      return Object.keys(t.value);
    },
    getOwnPropertyDescriptor() {
      return {
        enumerable: !0,
        configurable: !0
      };
    }
  });
  return Bn(e);
}
var xZ = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
const OZ = ["value", "onChange", "removeIcon", "placeholder", "autofocus", "maxTagCount", "maxTagTextLength", "maxTagPlaceholder", "choiceTransitionName", "onInputKeyDown", "onPopupScroll", "tabindex", "OptionList", "notFoundContent"], SZ = () => ({
  prefixCls: String,
  id: String,
  omitDomProps: Array,
  // >>> Value
  displayValues: Array,
  onDisplayValuesChange: Function,
  // >>> Active
  /** Current dropdown list active item string value */
  activeValue: String,
  /** Link search input with target element */
  activeDescendantId: String,
  onActiveValueChange: Function,
  // >>> Search
  searchValue: String,
  /** Trigger onSearch, return false to prevent trigger open event */
  onSearch: Function,
  /** Trigger when search text match the `tokenSeparators`. Will provide split content */
  onSearchSplit: Function,
  maxLength: Number,
  OptionList: ve.any,
  /** Tell if provided `options` is empty */
  emptyOptions: Boolean
}), t3 = () => ({
  showSearch: {
    type: Boolean,
    default: void 0
  },
  tagRender: {
    type: Function
  },
  optionLabelRender: {
    type: Function
  },
  direction: {
    type: String
  },
  // MISC
  tabindex: Number,
  autofocus: Boolean,
  notFoundContent: ve.any,
  placeholder: ve.any,
  onClear: Function,
  choiceTransitionName: String,
  // >>> Mode
  mode: String,
  // >>> Status
  disabled: {
    type: Boolean,
    default: void 0
  },
  loading: {
    type: Boolean,
    default: void 0
  },
  // >>> Open
  open: {
    type: Boolean,
    default: void 0
  },
  defaultOpen: {
    type: Boolean,
    default: void 0
  },
  onDropdownVisibleChange: {
    type: Function
  },
  // >>> Customize Input
  /** @private Internal usage. Do not use in your production. */
  getInputElement: {
    type: Function
  },
  /** @private Internal usage. Do not use in your production. */
  getRawInputElement: {
    type: Function
  },
  // >>> Selector
  maxTagTextLength: Number,
  maxTagCount: {
    type: [String, Number]
  },
  maxTagPlaceholder: ve.any,
  // >>> Search
  tokenSeparators: {
    type: Array
  },
  // >>> Icons
  allowClear: {
    type: Boolean,
    default: void 0
  },
  showArrow: {
    type: Boolean,
    default: void 0
  },
  inputIcon: ve.any,
  /** Clear all icon */
  clearIcon: ve.any,
  /** Selector remove icon */
  removeIcon: ve.any,
  // >>> Dropdown
  animation: String,
  transitionName: String,
  dropdownStyle: {
    type: Object
  },
  dropdownClassName: String,
  dropdownMatchSelectWidth: {
    type: [Boolean, Number],
    default: void 0
  },
  dropdownRender: {
    type: Function
  },
  dropdownAlign: Object,
  placement: {
    type: String
  },
  getPopupContainer: {
    type: Function
  },
  // >>> Focus
  showAction: {
    type: Array
  },
  onBlur: {
    type: Function
  },
  onFocus: {
    type: Function
  },
  // >>> Rest Events
  onKeyup: Function,
  onKeydown: Function,
  onMousedown: Function,
  onPopupScroll: Function,
  onInputKeyDown: Function,
  onMouseenter: Function,
  onMouseleave: Function,
  onClick: Function
}), wZ = () => k(k({}, SZ()), t3());
function EC(t) {
  return t === "tags" || t === "multiple";
}
const CZ = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "BaseSelect",
  inheritAttrs: !1,
  props: Kn(wZ(), {
    showAction: [],
    notFoundContent: "Not Found"
  }),
  setup(t, e) {
    let {
      attrs: n,
      expose: i,
      slots: o
    } = e;
    const r = A(() => EC(t.mode)), a = A(() => t.showSearch !== void 0 ? t.showSearch : r.value || t.mode === "combobox"), l = Te(!1);
    Lt(() => {
      l.value = PC();
    });
    const s = kC(), u = Te(null), c = Fp(), d = Te(null), f = Te(null), h = Te(null), p = de(!1), [g, m, y] = vZ();
    i({
      focus: () => {
        var ue;
        (ue = f.value) === null || ue === void 0 || ue.focus();
      },
      blur: () => {
        var ue;
        (ue = f.value) === null || ue === void 0 || ue.blur();
      },
      scrollTo: (ue) => {
        var fe;
        return (fe = h.value) === null || fe === void 0 ? void 0 : fe.scrollTo(ue);
      }
    });
    const $ = A(() => {
      var ue;
      if (t.mode !== "combobox")
        return t.searchValue;
      const fe = (ue = t.displayValues[0]) === null || ue === void 0 ? void 0 : ue.value;
      return typeof fe == "string" || typeof fe == "number" ? String(fe) : "";
    }), C = t.open !== void 0 ? t.open : t.defaultOpen, P = Te(C), O = Te(C), E = (ue) => {
      P.value = t.open !== void 0 ? t.open : ue, O.value = P.value;
    };
    _e(() => t.open, () => {
      E(t.open);
    });
    const _ = A(() => !t.notFoundContent && t.emptyOptions);
    zt(() => {
      O.value = P.value, (t.disabled || _.value && O.value && t.mode === "combobox") && (O.value = !1);
    });
    const D = A(() => _.value ? !1 : O.value), M = (ue) => {
      const fe = ue !== void 0 ? ue : !O.value;
      O.value !== fe && !t.disabled && (E(fe), t.onDropdownVisibleChange && t.onDropdownVisibleChange(fe), !fe && K.value && (K.value = !1, m(!1, () => {
        H.value = !1, p.value = !1;
      })));
    }, N = A(() => (t.tokenSeparators || []).some((ue) => [`
`, `\r
`].includes(ue))), L = (ue, fe, he) => {
      var le, ke;
      let ze = !0, Re = ue;
      (le = t.onActiveValueChange) === null || le === void 0 || le.call(t, null);
      const Ye = he ? null : qK(ue, t.tokenSeparators);
      return t.mode !== "combobox" && Ye && (Re = "", (ke = t.onSearchSplit) === null || ke === void 0 || ke.call(t, Ye), M(!1), ze = !1), t.onSearch && $.value !== Re && t.onSearch(Re, {
        source: fe ? "typing" : "effect"
      }), ze;
    }, j = (ue) => {
      var fe;
      !ue || !ue.trim() || (fe = t.onSearch) === null || fe === void 0 || fe.call(t, ue, {
        source: "submit"
      });
    };
    _e(O, () => {
      !O.value && !r.value && t.mode !== "combobox" && L("", !1, !1);
    }, {
      immediate: !0,
      flush: "post"
    }), _e(() => t.disabled, () => {
      P.value && t.disabled && E(!1), t.disabled && !p.value && m(!1);
    }, {
      immediate: !0
    });
    const [B, Y] = UN(), Q = function(ue) {
      var fe;
      const he = B(), {
        which: le
      } = ue;
      if (le === lt.ENTER && (t.mode !== "combobox" && ue.preventDefault(), O.value || M(!0)), Y(!!$.value), le === lt.BACKSPACE && !he && r.value && !$.value && t.displayValues.length) {
        const Ye = [...t.displayValues];
        let Ne = null;
        for (let Fe = Ye.length - 1; Fe >= 0; Fe -= 1) {
          const We = Ye[Fe];
          if (!We.disabled) {
            Ye.splice(Fe, 1), Ne = We;
            break;
          }
        }
        Ne && t.onDisplayValuesChange(Ye, {
          type: "remove",
          values: [Ne]
        });
      }
      for (var ke = arguments.length, ze = new Array(ke > 1 ? ke - 1 : 0), Re = 1; Re < ke; Re++)
        ze[Re - 1] = arguments[Re];
      O.value && h.value && h.value.onKeydown(ue, ...ze), (fe = t.onKeydown) === null || fe === void 0 || fe.call(t, ue, ...ze);
    }, G = function(ue) {
      for (var fe = arguments.length, he = new Array(fe > 1 ? fe - 1 : 0), le = 1; le < fe; le++)
        he[le - 1] = arguments[le];
      O.value && h.value && h.value.onKeyup(ue, ...he), t.onKeyup && t.onKeyup(ue, ...he);
    }, V = (ue) => {
      const fe = t.displayValues.filter((he) => he !== ue);
      t.onDisplayValuesChange(fe, {
        type: "remove",
        values: [ue]
      });
    }, H = Te(!1), q = function() {
      m(!0), t.disabled || (t.onFocus && !H.value && t.onFocus(...arguments), t.showAction && t.showAction.includes("focus") && M(!0)), H.value = !0;
    }, K = de(!1), ee = function() {
      if (K.value || (p.value = !0, m(!1, () => {
        H.value = !1, p.value = !1, M(!1);
      }), t.disabled))
        return;
      const ue = $.value;
      ue && (t.mode === "tags" ? t.onSearch(ue, {
        source: "submit"
      }) : t.mode === "multiple" && t.onSearch("", {
        source: "blur"
      })), t.onBlur && t.onBlur(...arguments);
    }, ie = () => {
      K.value = !0;
    }, ae = () => {
      K.value = !1;
    };
    Xt("VCSelectContainerEvent", {
      focus: q,
      blur: ee
    });
    const te = [];
    Lt(() => {
      te.forEach((ue) => clearTimeout(ue)), te.splice(0, te.length);
    }), tn(() => {
      te.forEach((ue) => clearTimeout(ue)), te.splice(0, te.length);
    });
    const U = function(ue) {
      var fe, he;
      const {
        target: le
      } = ue, ke = (fe = d.value) === null || fe === void 0 ? void 0 : fe.getPopupElement();
      if (ke && ke.contains(le)) {
        const Ne = setTimeout(() => {
          var Fe;
          const We = te.indexOf(Ne);
          We !== -1 && te.splice(We, 1), y(), !l.value && !ke.contains(document.activeElement) && ((Fe = f.value) === null || Fe === void 0 || Fe.focus());
        });
        te.push(Ne);
      }
      for (var ze = arguments.length, Re = new Array(ze > 1 ? ze - 1 : 0), Ye = 1; Ye < ze; Ye++)
        Re[Ye - 1] = arguments[Ye];
      (he = t.onMousedown) === null || he === void 0 || he.call(t, ue, ...Re);
    }, me = Te(null), ce = () => {
    };
    return Lt(() => {
      _e(D, () => {
        var ue;
        if (D.value) {
          const fe = Math.ceil((ue = u.value) === null || ue === void 0 ? void 0 : ue.offsetWidth);
          me.value !== fe && !Number.isNaN(fe) && (me.value = fe);
        }
      }, {
        immediate: !0,
        flush: "post"
      });
    }), mZ([u, d], D, M), yZ(e3(k(k({}, _c(t)), {
      open: O,
      triggerOpen: D,
      showSearch: a,
      multiple: r,
      toggleOpen: M
    }))), () => {
      const ue = k(k({}, t), n), {
        prefixCls: fe,
        id: he,
        open: le,
        defaultOpen: ke,
        mode: ze,
        // Search related
        showSearch: Re,
        searchValue: Ye,
        onSearch: Ne,
        // Icons
        allowClear: Fe,
        clearIcon: We,
        showArrow: nt,
        inputIcon: Qe,
        // Others
        disabled: Pe,
        loading: Ze,
        getInputElement: Ce,
        getPopupContainer: $e,
        placement: Le,
        // Dropdown
        animation: Ke,
        transitionName: qe,
        dropdownStyle: rt,
        dropdownClassName: De,
        dropdownMatchSelectWidth: Be,
        dropdownRender: je,
        dropdownAlign: at,
        showAction: mt,
        direction: st,
        // Tags
        tokenSeparators: gt,
        tagRender: Et,
        optionLabelRender: It,
        // Events
        onPopupScroll: _t,
        onDropdownVisibleChange: wt,
        onFocus: Nt,
        onBlur: nn,
        onKeyup: sn,
        onKeydown: xn,
        onMousedown: Pn,
        onClear: bt,
        omitDomProps: Xn,
        getRawInputElement: En,
        displayValues: di,
        onDisplayValuesChange: Ri,
        emptyOptions: zo,
        activeDescendantId: Ue,
        activeValue: yt,
        OptionList: xt
      } = ue, fn = xZ(ue, ["prefixCls", "id", "open", "defaultOpen", "mode", "showSearch", "searchValue", "onSearch", "allowClear", "clearIcon", "showArrow", "inputIcon", "disabled", "loading", "getInputElement", "getPopupContainer", "placement", "animation", "transitionName", "dropdownStyle", "dropdownClassName", "dropdownMatchSelectWidth", "dropdownRender", "dropdownAlign", "showAction", "direction", "tokenSeparators", "tagRender", "optionLabelRender", "onPopupScroll", "onDropdownVisibleChange", "onFocus", "onBlur", "onKeyup", "onKeydown", "onMousedown", "onClear", "omitDomProps", "getRawInputElement", "displayValues", "onDisplayValuesChange", "emptyOptions", "activeDescendantId", "activeValue", "OptionList"]), Oi = ze === "combobox" && Ce && Ce() || null, yi = typeof En == "function" && En(), io = k({}, fn);
      let Ln;
      yi && (Ln = (Si) => {
        M(Si);
      }), OZ.forEach((Si) => {
        delete io[Si];
      }), Xn?.forEach((Si) => {
        delete io[Si];
      });
      const Bt = nt !== void 0 ? nt : Ze || !r.value && ze !== "combobox";
      let Fi;
      Bt && (Fi = v(qc, {
        class: Ae(`${fe}-arrow`, {
          [`${fe}-arrow-loading`]: Ze
        }),
        customizeIcon: Qe,
        customizeIconProps: {
          loading: Ze,
          searchValue: $.value,
          open: O.value,
          focused: g.value,
          showSearch: a.value
        }
      }, null));
      let vo;
      const Sn = () => {
        bt?.(), Ri([], {
          type: "clear",
          values: di
        }), L("", !1, !1);
      };
      !Pe && Fe && (di.length || $.value) && (vo = v(qc, {
        class: `${fe}-clear`,
        onMousedown: Sn,
        customizeIcon: We
      }, {
        default: () => [Ve("×")]
      }));
      const Zn = v(xt, {
        ref: h
      }, k(k({}, s.customSlots), {
        option: o.option
      })), wn = Ae(fe, n.class, {
        [`${fe}-focused`]: g.value,
        [`${fe}-multiple`]: r.value,
        [`${fe}-single`]: !r.value,
        [`${fe}-allow-clear`]: Fe,
        [`${fe}-show-arrow`]: Bt,
        [`${fe}-disabled`]: Pe,
        [`${fe}-loading`]: Ze,
        [`${fe}-open`]: O.value,
        [`${fe}-customize-input`]: Oi,
        [`${fe}-show-search`]: a.value
      }), Gn = v(KX, {
        ref: d,
        disabled: Pe,
        prefixCls: fe,
        visible: D.value,
        popupElement: Zn,
        containerWidth: me.value,
        animation: Ke,
        transitionName: qe,
        dropdownStyle: rt,
        dropdownClassName: De,
        direction: st,
        dropdownMatchSelectWidth: Be,
        dropdownRender: je,
        dropdownAlign: at,
        placement: Le,
        getPopupContainer: $e,
        empty: zo,
        getTriggerDOMNode: () => c.current,
        onPopupVisibleChange: Ln,
        onPopupMouseEnter: ce,
        onPopupFocusin: ie,
        onPopupFocusout: ae
      }, {
        default: () => yi ? po(yi) && vi(yi, {
          ref: c
        }, !1, !0) : v(gZ, J(J({}, t), {}, {
          domRef: c,
          prefixCls: fe,
          inputElement: Oi,
          ref: f,
          id: he,
          showSearch: a.value,
          mode: ze,
          activeDescendantId: Ue,
          tagRender: Et,
          optionLabelRender: It,
          values: di,
          open: O.value,
          onToggleOpen: M,
          activeValue: yt,
          searchValue: $.value,
          onSearch: L,
          onSearchSubmit: j,
          onRemove: V,
          tokenWithEnter: N.value
        }), null)
      });
      let Ho;
      return yi ? Ho = Gn : Ho = v("div", J(J({}, io), {}, {
        class: wn,
        ref: u,
        onMousedown: U,
        onKeydown: Q,
        onKeyup: G
      }), [g.value && !O.value && v("span", {
        style: {
          width: 0,
          height: 0,
          position: "absolute",
          overflow: "hidden",
          opacity: 0
        },
        "aria-live": "polite"
      }, [`${di.map((Si) => {
        let {
          label: ur,
          value: $o
        } = Si;
        return ["number", "string"].includes(typeof ur) ? ur : $o;
      }).join(", ")}`]), Gn, Fi, vo]), Ho;
    };
  }
}), py = (t, e) => {
  let {
    height: n,
    offset: i,
    prefixCls: o,
    onInnerResize: r
  } = t, {
    slots: a
  } = e;
  var l;
  let s = {}, u = {
    display: "flex",
    flexDirection: "column"
  };
  return i !== void 0 && (s = {
    height: `${n}px`,
    position: "relative",
    overflow: "hidden"
  }, u = k(k({}, u), {
    transform: `translateY(${i}px)`,
    position: "absolute",
    left: 0,
    right: 0,
    top: 0
  })), v("div", {
    style: s
  }, [v(Mu, {
    onResize: (c) => {
      let {
        offsetHeight: d
      } = c;
      d && r && r();
    }
  }, {
    default: () => [v("div", {
      style: u,
      class: Ae({
        [`${o}-holder-inner`]: o
      })
    }, [(l = a.default) === null || l === void 0 ? void 0 : l.call(a)])]
  })]);
};
py.displayName = "Filter";
py.inheritAttrs = !1;
py.props = {
  prefixCls: String,
  /** Virtual filler height. Should be `count * itemMinHeight` */
  height: Number,
  /** Set offset of visible items. Should be the top of start item position */
  offset: Number,
  onInnerResize: Function
};
const n3 = (t, e) => {
  let {
    setRef: n
  } = t, {
    slots: i
  } = e;
  var o;
  const r = Wi((o = i.default) === null || o === void 0 ? void 0 : o.call(i));
  return r && r.length ? Eu(r[0], {
    ref: n
  }) : r;
};
n3.props = {
  setRef: {
    type: Function,
    default: () => {
    }
  }
};
const $Z = 20;
function l2(t) {
  return "touches" in t ? t.touches[0].pageY : t.pageY;
}
const kZ = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ScrollBar",
  inheritAttrs: !1,
  props: {
    prefixCls: String,
    scrollTop: Number,
    scrollHeight: Number,
    height: Number,
    count: Number,
    onScroll: {
      type: Function
    },
    onStartMove: {
      type: Function
    },
    onStopMove: {
      type: Function
    }
  },
  setup() {
    return {
      moveRaf: null,
      scrollbarRef: Fp(),
      thumbRef: Fp(),
      visibleTimeout: null,
      state: Bn({
        dragging: !1,
        pageY: null,
        startTop: null,
        visible: !1
      })
    };
  },
  watch: {
    scrollTop: {
      handler() {
        this.delayHidden();
      },
      flush: "post"
    }
  },
  mounted() {
    var t, e;
    (t = this.scrollbarRef.current) === null || t === void 0 || t.addEventListener("touchstart", this.onScrollbarTouchStart, xo ? {
      passive: !1
    } : !1), (e = this.thumbRef.current) === null || e === void 0 || e.addEventListener("touchstart", this.onMouseDown, xo ? {
      passive: !1
    } : !1);
  },
  beforeUnmount() {
    this.removeEvents(), clearTimeout(this.visibleTimeout);
  },
  methods: {
    delayHidden() {
      clearTimeout(this.visibleTimeout), this.state.visible = !0, this.visibleTimeout = setTimeout(() => {
        this.state.visible = !1;
      }, 2e3);
    },
    onScrollbarTouchStart(t) {
      t.preventDefault();
    },
    onContainerMouseDown(t) {
      t.stopPropagation(), t.preventDefault();
    },
    // ======================= Clean =======================
    patchEvents() {
      window.addEventListener("mousemove", this.onMouseMove), window.addEventListener("mouseup", this.onMouseUp), this.thumbRef.current.addEventListener("touchmove", this.onMouseMove, xo ? {
        passive: !1
      } : !1), this.thumbRef.current.addEventListener("touchend", this.onMouseUp);
    },
    removeEvents() {
      window.removeEventListener("mousemove", this.onMouseMove), window.removeEventListener("mouseup", this.onMouseUp), this.scrollbarRef.current.removeEventListener("touchstart", this.onScrollbarTouchStart, xo ? {
        passive: !1
      } : !1), this.thumbRef.current && (this.thumbRef.current.removeEventListener("touchstart", this.onMouseDown, xo ? {
        passive: !1
      } : !1), this.thumbRef.current.removeEventListener("touchmove", this.onMouseMove, xo ? {
        passive: !1
      } : !1), this.thumbRef.current.removeEventListener("touchend", this.onMouseUp)), Gt.cancel(this.moveRaf);
    },
    // ======================= Thumb =======================
    onMouseDown(t) {
      const {
        onStartMove: e
      } = this.$props;
      k(this.state, {
        dragging: !0,
        pageY: l2(t),
        startTop: this.getTop()
      }), e(), this.patchEvents(), t.stopPropagation(), t.preventDefault();
    },
    onMouseMove(t) {
      const {
        dragging: e,
        pageY: n,
        startTop: i
      } = this.state, {
        onScroll: o
      } = this.$props;
      if (Gt.cancel(this.moveRaf), e) {
        const r = l2(t) - n, a = i + r, l = this.getEnableScrollRange(), s = this.getEnableHeightRange(), u = s ? a / s : 0, c = Math.ceil(u * l);
        this.moveRaf = Gt(() => {
          o(c);
        });
      }
    },
    onMouseUp() {
      const {
        onStopMove: t
      } = this.$props;
      this.state.dragging = !1, t(), this.removeEvents();
    },
    // ===================== Calculate =====================
    getSpinHeight() {
      const {
        height: t,
        scrollHeight: e
      } = this.$props;
      let n = t / e * 100;
      return n = Math.max(n, $Z), n = Math.min(n, t / 2), Math.floor(n);
    },
    getEnableScrollRange() {
      const {
        scrollHeight: t,
        height: e
      } = this.$props;
      return t - e || 0;
    },
    getEnableHeightRange() {
      const {
        height: t
      } = this.$props, e = this.getSpinHeight();
      return t - e || 0;
    },
    getTop() {
      const {
        scrollTop: t
      } = this.$props, e = this.getEnableScrollRange(), n = this.getEnableHeightRange();
      return t === 0 || e === 0 ? 0 : t / e * n;
    },
    // Not show scrollbar when height is large than scrollHeight
    showScroll() {
      const {
        height: t,
        scrollHeight: e
      } = this.$props;
      return e > t;
    }
  },
  render() {
    const {
      dragging: t,
      visible: e
    } = this.state, {
      prefixCls: n
    } = this.$props, i = this.getSpinHeight() + "px", o = this.getTop() + "px", r = this.showScroll(), a = r && e;
    return v("div", {
      ref: this.scrollbarRef,
      class: Ae(`${n}-scrollbar`, {
        [`${n}-scrollbar-show`]: r
      }),
      style: {
        width: "8px",
        top: 0,
        bottom: 0,
        right: 0,
        position: "absolute",
        display: a ? void 0 : "none"
      },
      onMousedown: this.onContainerMouseDown,
      onMousemove: this.delayHidden
    }, [v("div", {
      ref: this.thumbRef,
      class: Ae(`${n}-scrollbar-thumb`, {
        [`${n}-scrollbar-thumb-moving`]: t
      }),
      style: {
        width: "100%",
        height: i,
        top: o,
        left: 0,
        position: "absolute",
        background: "rgba(0, 0, 0, 0.5)",
        borderRadius: "99px",
        cursor: "pointer",
        userSelect: "none"
      },
      onMousedown: this.onMouseDown
    }, null)]);
  }
});
function TZ(t, e, n, i) {
  const o = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), a = de(Symbol("update"));
  _e(t, () => {
    a.value = Symbol("update");
  });
  let l;
  function s() {
    Gt.cancel(l);
  }
  function u() {
    s(), l = Gt(() => {
      o.forEach((d, f) => {
        if (d && d.offsetParent) {
          const {
            offsetHeight: h
          } = d;
          r.get(f) !== h && (a.value = Symbol("update"), r.set(f, d.offsetHeight));
        }
      });
    });
  }
  function c(d, f) {
    const h = e(d);
    o.get(h), f ? (o.set(h, f.$el || f), u()) : o.delete(h);
  }
  return wo(() => {
    s();
  }), [c, u, r, a];
}
function PZ(t, e, n, i, o, r, a, l) {
  let s;
  return (u) => {
    if (u == null) {
      l();
      return;
    }
    Gt.cancel(s);
    const c = e.value, d = i.itemHeight;
    if (typeof u == "number")
      a(u);
    else if (u && typeof u == "object") {
      let f;
      const {
        align: h
      } = u;
      "index" in u ? {
        index: f
      } = u : f = c.findIndex((m) => o(m) === u.key);
      const {
        offset: p = 0
      } = u, g = (m, y) => {
        if (m < 0 || !t.value) return;
        const b = t.value.clientHeight;
        let w = !1, $ = y;
        if (b) {
          const C = y || h;
          let P = 0, O = 0, E = 0;
          const _ = Math.min(c.length, f);
          for (let N = 0; N <= _; N += 1) {
            const L = o(c[N]);
            O = P;
            const j = n.get(L);
            E = O + (j === void 0 ? d : j), P = E, N === f && j === void 0 && (w = !0);
          }
          const D = t.value.scrollTop;
          let M = null;
          switch (C) {
            case "top":
              M = O - p;
              break;
            case "bottom":
              M = E - b + p;
              break;
            default: {
              const N = D + b;
              O < D ? $ = "top" : E > N && ($ = "bottom");
            }
          }
          M !== null && M !== D && a(M);
        }
        s = Gt(() => {
          w && r(), g(m - 1, $);
        }, 2);
      };
      g(5);
    }
  };
}
const EZ = typeof navigator == "object" && /Firefox/i.test(navigator.userAgent), i3 = ((t, e) => {
  let n = !1, i = null;
  function o() {
    clearTimeout(i), n = !0, i = setTimeout(() => {
      n = !1;
    }, 50);
  }
  return function(r) {
    let a = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
    const l = (
      // Pass origin wheel when on the top
      r < 0 && t.value || // Pass origin wheel when on the bottom
      r > 0 && e.value
    );
    return a && l ? (clearTimeout(i), n = !1) : (!l || n) && o(), !n && l;
  };
});
function _Z(t, e, n, i) {
  let o = 0, r = null, a = null, l = !1;
  const s = i3(e, n);
  function u(d) {
    if (!t.value) return;
    Gt.cancel(r);
    const {
      deltaY: f
    } = d;
    o += f, a = f, !s(f) && (EZ || d.preventDefault(), r = Gt(() => {
      i(o * (l ? 10 : 1)), o = 0;
    }));
  }
  function c(d) {
    t.value && (l = d.detail === a);
  }
  return [u, c];
}
const IZ = 14 / 15;
function MZ(t, e, n) {
  let i = !1, o = 0, r = null, a = null;
  const l = () => {
    r && (r.removeEventListener("touchmove", s), r.removeEventListener("touchend", u));
  }, s = (f) => {
    if (i) {
      const h = Math.ceil(f.touches[0].pageY);
      let p = o - h;
      o = h, n(p) && f.preventDefault(), clearInterval(a), a = setInterval(() => {
        p *= IZ, (!n(p, !0) || Math.abs(p) <= 0.1) && clearInterval(a);
      }, 16);
    }
  }, u = () => {
    i = !1, l();
  }, c = (f) => {
    l(), f.touches.length === 1 && !i && (i = !0, o = Math.ceil(f.touches[0].pageY), r = f.target, r.addEventListener("touchmove", s, {
      passive: !1
    }), r.addEventListener("touchend", u));
  }, d = () => {
  };
  Lt(() => {
    document.addEventListener("touchmove", d, {
      passive: !1
    }), _e(t, (f) => {
      e.value.removeEventListener("touchstart", c), l(), clearInterval(a), f && e.value.addEventListener("touchstart", c, {
        passive: !1
      });
    }, {
      immediate: !0
    });
  }), tn(() => {
    document.removeEventListener("touchmove", d);
  });
}
var AZ = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
const RZ = [], DZ = {
  overflowY: "auto",
  overflowAnchor: "none"
};
function NZ(t, e, n, i, o, r) {
  let {
    getKey: a
  } = r;
  return t.slice(e, n + 1).map((l, s) => {
    const u = e + s, c = o(l, u, {
      // style: status === 'MEASURE_START' ? { visibility: 'hidden' } : {},
    }), d = a(l);
    return v(n3, {
      key: d,
      setRef: (f) => i(l, f)
    }, {
      default: () => [c]
    });
  });
}
const o3 = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "List",
  inheritAttrs: !1,
  props: {
    prefixCls: String,
    data: ve.array,
    height: Number,
    itemHeight: Number,
    /** If not match virtual scroll condition, Set List still use height of container. */
    fullHeight: {
      type: Boolean,
      default: void 0
    },
    itemKey: {
      type: [String, Number, Function],
      required: !0
    },
    component: {
      type: [String, Object]
    },
    /** Set `false` will always use real scroll instead of virtual one */
    virtual: {
      type: Boolean,
      default: void 0
    },
    children: Function,
    onScroll: Function,
    onMousedown: Function,
    onMouseenter: Function,
    onVisibleChange: Function
  },
  setup(t, e) {
    let {
      expose: n
    } = e;
    const i = A(() => {
      const {
        height: V,
        itemHeight: H,
        virtual: q
      } = t;
      return !!(q !== !1 && V && H);
    }), o = A(() => {
      const {
        height: V,
        itemHeight: H,
        data: q
      } = t;
      return i.value && q && H * q.length > V;
    }), r = Bn({
      scrollTop: 0,
      scrollMoving: !1
    }), a = A(() => t.data || RZ), l = Te([]);
    _e(a, () => {
      l.value = rr(a.value).slice();
    }, {
      immediate: !0
    });
    const s = Te((V) => {
    });
    _e(() => t.itemKey, (V) => {
      typeof V == "function" ? s.value = V : s.value = (H) => H?.[V];
    }, {
      immediate: !0
    });
    const u = Te(), c = Te(), d = Te(), f = (V) => s.value(V), h = {
      getKey: f
    };
    function p(V) {
      let H;
      typeof V == "function" ? H = V(r.scrollTop) : H = V;
      const q = P(H);
      u.value && (u.value.scrollTop = q), r.scrollTop = q;
    }
    const [g, m, y, b] = TZ(l, f), w = Bn({
      scrollHeight: void 0,
      start: 0,
      end: 0,
      offset: void 0
    }), $ = Te(0);
    Lt(() => {
      rn(() => {
        var V;
        $.value = ((V = c.value) === null || V === void 0 ? void 0 : V.offsetHeight) || 0;
      });
    }), Ns(() => {
      rn(() => {
        var V;
        $.value = ((V = c.value) === null || V === void 0 ? void 0 : V.offsetHeight) || 0;
      });
    }), _e([i, l], () => {
      i.value || k(w, {
        scrollHeight: void 0,
        start: 0,
        end: l.value.length - 1,
        offset: void 0
      });
    }, {
      immediate: !0
    }), _e([i, l, $, o], () => {
      i.value && !o.value && k(w, {
        scrollHeight: $.value,
        start: 0,
        end: l.value.length - 1,
        offset: void 0
      }), u.value && (r.scrollTop = u.value.scrollTop);
    }, {
      immediate: !0
    }), _e([o, i, () => r.scrollTop, l, b, () => t.height, $], () => {
      if (!i.value || !o.value)
        return;
      let V = 0, H, q, K;
      const ee = l.value.length, ie = l.value, ae = r.scrollTop, {
        itemHeight: te,
        height: U
      } = t, me = ae + U;
      for (let ce = 0; ce < ee; ce += 1) {
        const ue = ie[ce], fe = f(ue);
        let he = y.get(fe);
        he === void 0 && (he = te);
        const le = V + he;
        H === void 0 && le >= ae && (H = ce, q = V), K === void 0 && le > me && (K = ce), V = le;
      }
      H === void 0 && (H = 0, q = 0, K = Math.ceil(U / te)), K === void 0 && (K = ee - 1), K = Math.min(K + 1, ee), k(w, {
        scrollHeight: V,
        start: H,
        end: K,
        offset: q
      });
    }, {
      immediate: !0
    });
    const C = A(() => w.scrollHeight - t.height);
    function P(V) {
      let H = V;
      return Number.isNaN(C.value) || (H = Math.min(H, C.value)), H = Math.max(H, 0), H;
    }
    const O = A(() => r.scrollTop <= 0), E = A(() => r.scrollTop >= C.value), _ = i3(O, E);
    function D(V) {
      p(V);
    }
    function M(V) {
      var H;
      const {
        scrollTop: q
      } = V.currentTarget;
      q !== r.scrollTop && p(q), (H = t.onScroll) === null || H === void 0 || H.call(t, V);
    }
    const [N, L] = _Z(i, O, E, (V) => {
      p((H) => H + V);
    });
    MZ(i, u, (V, H) => _(V, H) ? !1 : (N({
      preventDefault() {
      },
      deltaY: V
    }), !0));
    function j(V) {
      i.value && V.preventDefault();
    }
    const B = () => {
      u.value && (u.value.removeEventListener("wheel", N, xo ? {
        passive: !1
      } : !1), u.value.removeEventListener("DOMMouseScroll", L), u.value.removeEventListener("MozMousePixelScroll", j));
    };
    zt(() => {
      rn(() => {
        u.value && (B(), u.value.addEventListener("wheel", N, xo ? {
          passive: !1
        } : !1), u.value.addEventListener("DOMMouseScroll", L), u.value.addEventListener("MozMousePixelScroll", j));
      });
    }), tn(() => {
      B();
    });
    const Y = PZ(u, l, y, t, f, m, p, () => {
      var V;
      (V = d.value) === null || V === void 0 || V.delayHidden();
    });
    n({
      scrollTo: Y
    });
    const Q = A(() => {
      let V = null;
      return t.height && (V = k({
        [t.fullHeight ? "height" : "maxHeight"]: t.height + "px"
      }, DZ), i.value && (V.overflowY = "hidden", r.scrollMoving && (V.pointerEvents = "none"))), V;
    });
    return _e([() => w.start, () => w.end, l], () => {
      if (t.onVisibleChange) {
        const V = l.value.slice(w.start, w.end + 1);
        t.onVisibleChange(V, l.value);
      }
    }, {
      flush: "post"
    }), {
      state: r,
      mergedData: l,
      componentStyle: Q,
      onFallbackScroll: M,
      onScrollBar: D,
      componentRef: u,
      useVirtual: i,
      calRes: w,
      collectHeight: m,
      setInstance: g,
      sharedConfig: h,
      scrollBarRef: d,
      fillerInnerRef: c,
      delayHideScrollBar: () => {
        var V;
        (V = d.value) === null || V === void 0 || V.delayHidden();
      }
    };
  },
  render() {
    const t = k(k({}, this.$props), this.$attrs), {
      prefixCls: e = "rc-virtual-list",
      height: n,
      itemHeight: i,
      // eslint-disable-next-line no-unused-vars
      fullHeight: o,
      data: r,
      itemKey: a,
      virtual: l,
      component: s = "div",
      onScroll: u,
      children: c = this.$slots.default,
      style: d,
      class: f
    } = t, h = AZ(t, ["prefixCls", "height", "itemHeight", "fullHeight", "data", "itemKey", "virtual", "component", "onScroll", "children", "style", "class"]), p = Ae(e, f), {
      scrollTop: g
    } = this.state, {
      scrollHeight: m,
      offset: y,
      start: b,
      end: w
    } = this.calRes, {
      componentStyle: $,
      onFallbackScroll: C,
      onScrollBar: P,
      useVirtual: O,
      collectHeight: E,
      sharedConfig: _,
      setInstance: D,
      mergedData: M,
      delayHideScrollBar: N
    } = this;
    return v("div", J({
      style: k(k({}, d), {
        position: "relative"
      }),
      class: p
    }, h), [v(s, {
      class: `${e}-holder`,
      style: $,
      ref: "componentRef",
      onScroll: C,
      onMouseenter: N
    }, {
      default: () => [v(py, {
        prefixCls: e,
        height: m,
        offset: y,
        onInnerResize: E,
        ref: "fillerInnerRef"
      }, {
        default: () => NZ(M, b, w, D, c, _)
      })]
    }), O && v(kZ, {
      ref: "scrollBarRef",
      prefixCls: e,
      scrollTop: g,
      height: n,
      scrollHeight: m,
      count: M.length,
      onScroll: P,
      onStartMove: () => {
        this.state.scrollMoving = !0;
      },
      onStopMove: () => {
        this.state.scrollMoving = !1;
      }
    }, null)]);
  }
});
function r3(t, e, n) {
  const i = de(t());
  return _e(e, (o, r) => {
    n ? n(o, r) && (i.value = t()) : i.value = t();
  }), i;
}
function LZ() {
  return /(mac\sos|macintosh)/i.test(navigator.appVersion);
}
const a3 = Symbol("SelectContextKey");
function zZ(t) {
  return Xt(a3, t);
}
function BZ() {
  return qt(a3, {});
}
var FZ = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
function s2(t) {
  return typeof t == "string" || typeof t == "number";
}
const VZ = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "OptionList",
  inheritAttrs: !1,
  setup(t, e) {
    let {
      expose: n,
      slots: i
    } = e;
    const o = bZ(), r = BZ(), a = A(() => `${o.prefixCls}-item`), l = r3(() => r.flattenOptions, [() => o.open, () => r.flattenOptions], (C) => C[0]), s = Fp(), u = (C) => {
      C.preventDefault();
    }, c = (C) => {
      s.current && s.current.scrollTo(typeof C == "number" ? {
        index: C
      } : C);
    }, d = function(C) {
      let P = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1;
      const O = l.value.length;
      for (let E = 0; E < O; E += 1) {
        const _ = (C + E * P + O) % O, {
          group: D,
          data: M
        } = l.value[_];
        if (!D && !M.disabled)
          return _;
      }
      return -1;
    }, f = Bn({
      activeIndex: d(0)
    }), h = function(C) {
      let P = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
      f.activeIndex = C;
      const O = {
        source: P ? "keyboard" : "mouse"
      }, E = l.value[C];
      if (!E) {
        r.onActiveValue(null, -1, O);
        return;
      }
      r.onActiveValue(E.value, C, O);
    };
    _e([() => l.value.length, () => o.searchValue], () => {
      h(r.defaultActiveFirstOption !== !1 ? d(0) : -1);
    }, {
      immediate: !0
    });
    const p = (C) => r.rawValues.has(C) && o.mode !== "combobox";
    _e([() => o.open, () => o.searchValue], () => {
      if (!o.multiple && o.open && r.rawValues.size === 1) {
        const C = Array.from(r.rawValues)[0], P = rr(l.value).findIndex((O) => {
          let {
            data: E
          } = O;
          return E[r.fieldNames.value] === C;
        });
        P !== -1 && (h(P), rn(() => {
          c(P);
        }));
      }
      o.open && rn(() => {
        var C;
        (C = s.current) === null || C === void 0 || C.scrollTo(void 0);
      });
    }, {
      immediate: !0,
      flush: "post"
    });
    const g = (C) => {
      C !== void 0 && r.onSelect(C, {
        selected: !r.rawValues.has(C)
      }), o.multiple || o.toggleOpen(!1);
    }, m = (C) => typeof C.label == "function" ? C.label() : C.label;
    function y(C) {
      const P = l.value[C];
      if (!P) return null;
      const O = P.data || {}, {
        value: E
      } = O, {
        group: _
      } = P, D = rd(O, !0), M = m(P);
      return P ? v("div", J(J({
        "aria-label": typeof M == "string" && !_ ? M : null
      }, D), {}, {
        key: C,
        role: _ ? "presentation" : "option",
        id: `${o.id}_list_${C}`,
        "aria-selected": p(E)
      }), [E]) : null;
    }
    return n({
      onKeydown: (C) => {
        const {
          which: P,
          ctrlKey: O
        } = C;
        switch (P) {
          // >>> Arrow keys & ctrl + n/p on Mac
          case lt.N:
          case lt.P:
          case lt.UP:
          case lt.DOWN: {
            let E = 0;
            if (P === lt.UP ? E = -1 : P === lt.DOWN ? E = 1 : LZ() && O && (P === lt.N ? E = 1 : P === lt.P && (E = -1)), E !== 0) {
              const _ = d(f.activeIndex + E, E);
              c(_), h(_, !0);
            }
            break;
          }
          // >>> Select
          case lt.ENTER: {
            const E = l.value[f.activeIndex];
            E && !E.data.disabled ? g(E.value) : g(void 0), o.open && C.preventDefault();
            break;
          }
          // >>> Close
          case lt.ESC:
            o.toggleOpen(!1), o.open && C.stopPropagation();
        }
      },
      onKeyup: () => {
      },
      scrollTo: (C) => {
        c(C);
      }
    }), () => {
      const {
        id: C,
        notFoundContent: P,
        onPopupScroll: O
      } = o, {
        menuItemSelectedIcon: E,
        fieldNames: _,
        virtual: D,
        listHeight: M,
        listItemHeight: N
      } = r, L = i.option, {
        activeIndex: j
      } = f, B = Object.keys(_).map((Y) => _[Y]);
      return l.value.length === 0 ? v("div", {
        role: "listbox",
        id: `${C}_list`,
        class: `${a.value}-empty`,
        onMousedown: u
      }, [P]) : v(tt, null, [v("div", {
        role: "listbox",
        id: `${C}_list`,
        style: {
          height: 0,
          width: 0,
          overflow: "hidden"
        }
      }, [y(j - 1), y(j), y(j + 1)]), v(o3, {
        itemKey: "key",
        ref: s,
        data: l.value,
        height: M,
        itemHeight: N,
        fullHeight: !1,
        onMousedown: u,
        onScroll: O,
        virtual: D
      }, {
        default: (Y, Q) => {
          var G;
          const {
            group: V,
            groupOption: H,
            data: q,
            value: K
          } = Y, {
            key: ee
          } = q, ie = typeof Y.label == "function" ? Y.label() : Y.label;
          if (V) {
            const We = (G = q.title) !== null && G !== void 0 ? G : s2(ie) && ie;
            return v("div", {
              class: Ae(a.value, `${a.value}-group`),
              title: We
            }, [L ? L(q) : ie !== void 0 ? ie : ee]);
          }
          const {
            disabled: ae,
            title: te,
            children: U,
            style: me,
            class: ce,
            className: ue
          } = q, fe = FZ(q, ["disabled", "title", "children", "style", "class", "className"]), he = ii(fe, B), le = p(K), ke = `${a.value}-option`, ze = Ae(a.value, ke, ce, ue, {
            [`${ke}-grouped`]: H,
            [`${ke}-active`]: j === Q && !ae,
            [`${ke}-disabled`]: ae,
            [`${ke}-selected`]: le
          }), Re = m(Y), Ye = !E || typeof E == "function" || le, Ne = typeof Re == "number" ? Re : Re || K;
          let Fe = s2(Ne) ? Ne.toString() : void 0;
          return te !== void 0 && (Fe = te), v("div", J(J({}, he), {}, {
            "aria-selected": le,
            class: ze,
            title: Fe,
            onMousemove: (We) => {
              fe.onMousemove && fe.onMousemove(We), !(j === Q || ae) && h(Q);
            },
            onClick: (We) => {
              ae || g(K), fe.onClick && fe.onClick(We);
            },
            style: me
          }), [v("div", {
            class: `${ke}-content`
          }, [L ? L(q) : Ne]), po(E) || le, Ye && v(qc, {
            class: `${a.value}-option-state`,
            customizeIcon: E,
            customizeIconProps: {
              isSelected: le
            }
          }, {
            default: () => [le ? "✓" : null]
          })]);
        }
      })]);
    };
  }
});
var QZ = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
function HZ(t) {
  const e = t, {
    key: n,
    children: i
  } = e, o = e.props, {
    value: r,
    disabled: a
  } = o, l = QZ(o, ["value", "disabled"]), s = i?.default;
  return k({
    key: n,
    value: r !== void 0 ? r : n,
    children: s,
    disabled: a || a === ""
  }, l);
}
function _C(t) {
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
  return Wi(t).map((i, o) => {
    var r;
    if (!po(i) || !i.type)
      return null;
    const {
      type: {
        isSelectOptGroup: a
      },
      key: l,
      children: s,
      props: u
    } = i;
    if (e || !a)
      return HZ(i);
    const c = s && s.default ? s.default() : void 0, d = u?.label || ((r = s.label) === null || r === void 0 ? void 0 : r.call(s)) || l;
    return k(k({
      key: `__RC_SELECT_GRP__${l === null ? o : String(l)}__`
    }, u), {
      label: d,
      options: _C(c || [])
    });
  }).filter((i) => i);
}
function WZ(t, e, n) {
  const i = Te(), o = Te(), r = Te(), a = Te([]);
  return _e([t, e], () => {
    t.value ? a.value = rr(t.value).slice() : a.value = _C(e.value);
  }, {
    immediate: !0,
    deep: !0
  }), zt(() => {
    const l = a.value, s = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), c = n.value;
    function d(f) {
      let h = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
      for (let p = 0; p < f.length; p += 1) {
        const g = f[p];
        !g[c.options] || h ? (s.set(g[c.value], g), u.set(g[c.label], g)) : d(g[c.options], !0);
      }
    }
    d(l), i.value = l, o.value = s, r.value = u;
  }), {
    options: i,
    valueOptions: o,
    labelOptions: r
  };
}
let u2 = 0;
const jZ = process.env.NODE_ENV !== "test" && Or();
function qZ() {
  let t;
  return jZ ? (t = u2, u2 += 1) : t = "TEST_OR_SSR", t;
}
function YZ() {
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : de("");
  const e = `rc_select_${qZ()}`;
  return t.value || e;
}
function IC(t) {
  return Array.isArray(t) ? t : t !== void 0 ? [t] : [];
}
const KZ = typeof window < "u" && window.document && window.document.documentElement;
process.env.NODE_ENV;
function XZ(t) {
  const {
    mode: e,
    options: n,
    children: i,
    backfill: o,
    allowClear: r,
    placeholder: a,
    getInputElement: l,
    showSearch: s,
    onSearch: u,
    defaultOpen: c,
    autofocus: d,
    labelInValue: f,
    value: h,
    inputValue: p,
    optionLabelProp: g
  } = t, m = EC(e), y = s !== void 0 ? s : m || e === "combobox", b = n || _C(i);
  if (pr(e !== "tags" || b.every((w) => !w.disabled), "Please avoid setting option to disabled in tags mode since user can always type text as tag."), pr(e !== "combobox" || !g, "`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."), pr(e === "combobox" || !o, "`backfill` only works with `combobox` mode."), pr(e === "combobox" || !l, "`getInputElement` only work with `combobox` mode."), Yx(e !== "combobox" || !l || !r || !a, "Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."), u && !y && e !== "combobox" && e !== "tags" && pr(!1, "`onSearch` should work with `showSearch` instead of use alone."), Yx(!c || d, "`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autofocus` if needed."), h != null) {
    const w = IC(h);
    pr(!f || w.every(($) => typeof $ == "object" && ("key" in $ || "value" in $)), "`value` should in shape of `{ value: string | number, label?: any }` when you set `labelInValue` to `true`"), pr(!m || Array.isArray(h), "`value` should be array when `mode` is `multiple` or `tags`");
  }
  if (i) {
    let w = null;
    i.some(($) => {
      var C;
      if (!po($) || !$.type)
        return !1;
      const {
        type: P
      } = $;
      return P.isSelectOption ? !1 : P.isSelectOptGroup ? !(((C = $.children) === null || C === void 0 ? void 0 : C.default()) || []).every((_) => !po(_) || !$.type || _.type.isSelectOption ? !0 : (w = _.type, !1)) : (w = P, !0);
    }), w && pr(!1, `\`children\` should be \`Select.Option\` or \`Select.OptGroup\` instead of \`${w.displayName || w.name || w}\`.`), pr(p === void 0, "`inputValue` is deprecated, please use `searchValue` instead.");
  }
}
function Gb(t, e) {
  return IC(t).join("").toUpperCase().includes(e);
}
const ZZ = ((t, e, n, i, o) => A(() => {
  const r = n.value, a = o?.value, l = i?.value;
  if (!r || l === !1)
    return t.value;
  const {
    options: s,
    label: u,
    value: c
  } = e.value, d = [], f = typeof l == "function", h = r.toUpperCase(), p = f ? l : (m, y) => a ? Gb(y[a], h) : y[s] ? Gb(y[u !== "children" ? u : "label"], h) : Gb(y[c], h), g = f ? (m) => aO(m) : (m) => m;
  return t.value.forEach((m) => {
    if (m[s]) {
      if (p(r, g(m)))
        d.push(m);
      else {
        const b = m[s].filter((w) => p(r, g(w)));
        b.length && d.push(k(k({}, m), {
          [s]: b
        }));
      }
      return;
    }
    p(r, g(m)) && d.push(m);
  }), d;
})), GZ = ((t, e) => {
  const n = Te({
    values: /* @__PURE__ */ new Map(),
    options: /* @__PURE__ */ new Map()
  });
  return [A(() => {
    const {
      values: r,
      options: a
    } = n.value, l = t.value.map((c) => {
      var d;
      return c.label === void 0 ? k(k({}, c), {
        label: (d = r.get(c.value)) === null || d === void 0 ? void 0 : d.label
      }) : c;
    }), s = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map();
    return l.forEach((c) => {
      s.set(c.value, c), u.set(c.value, e.value.get(c.value) || a.get(c.value));
    }), n.value.values = s, n.value.options = u, l;
  }), (r) => e.value.get(r) || n.value.options.get(r)];
});
function er(t, e) {
  const {
    defaultValue: n,
    value: i = de()
  } = e || {};
  let o = typeof t == "function" ? t() : t;
  i.value !== void 0 && (o = I(i)), n !== void 0 && (o = typeof n == "function" ? n() : n);
  const r = de(o), a = de(o);
  zt(() => {
    let s = i.value !== void 0 ? i.value : r.value;
    e.postState && (s = e.postState(s)), a.value = s;
  });
  function l(s) {
    const u = a.value;
    r.value = s, rr(a.value) !== s && e.onChange && e.onChange(s, u);
  }
  return _e(i, () => {
    r.value = i.value;
  }), [a, l];
}
function zn(t) {
  const e = typeof t == "function" ? t() : t, n = de(e);
  function i(o) {
    n.value = o;
  }
  return [n, i];
}
const UZ = ["inputValue"];
function l3() {
  return k(k({}, t3()), {
    prefixCls: String,
    id: String,
    backfill: {
      type: Boolean,
      default: void 0
    },
    // >>> Field Names
    fieldNames: Object,
    // >>> Search
    /** @deprecated Use `searchValue` instead */
    inputValue: String,
    searchValue: String,
    onSearch: Function,
    autoClearSearchValue: {
      type: Boolean,
      default: void 0
    },
    // >>> Select
    onSelect: Function,
    onDeselect: Function,
    // >>> Options
    /**
     * In Select, `false` means do nothing.
     * In TreeSelect, `false` will highlight match item.
     * It's by design.
     */
    filterOption: {
      type: [Boolean, Function],
      default: void 0
    },
    filterSort: Function,
    optionFilterProp: String,
    optionLabelProp: String,
    options: Array,
    defaultActiveFirstOption: {
      type: Boolean,
      default: void 0
    },
    virtual: {
      type: Boolean,
      default: void 0
    },
    listHeight: Number,
    listItemHeight: Number,
    // >>> Icon
    menuItemSelectedIcon: ve.any,
    mode: String,
    labelInValue: {
      type: Boolean,
      default: void 0
    },
    value: ve.any,
    defaultValue: ve.any,
    onChange: Function,
    children: Array
  });
}
function JZ(t) {
  return !t || typeof t != "object";
}
const eG = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "VcSelect",
  inheritAttrs: !1,
  props: Kn(l3(), {
    prefixCls: "vc-select",
    autoClearSearchValue: !0,
    listHeight: 200,
    listItemHeight: 20,
    dropdownMatchSelectWidth: !0
  }),
  setup(t, e) {
    let {
      expose: n,
      attrs: i,
      slots: o
    } = e;
    const r = YZ(on(t, "id")), a = A(() => EC(t.mode)), l = A(() => !!(!t.options && t.children)), s = A(() => t.filterOption === void 0 && t.mode === "combobox" ? !1 : t.filterOption), u = A(() => RN(t.fieldNames, l.value)), [c, d] = er("", {
      value: A(() => t.searchValue !== void 0 ? t.searchValue : t.inputValue),
      postState: (ce) => ce || ""
    }), f = WZ(on(t, "options"), on(t, "children"), u), {
      valueOptions: h,
      labelOptions: p,
      options: g
    } = f, m = (ce) => IC(ce).map((fe) => {
      var he, le;
      let ke, ze, Re, Ye;
      JZ(fe) ? ke = fe : (Re = fe.key, ze = fe.label, ke = (he = fe.value) !== null && he !== void 0 ? he : Re);
      const Ne = h.value.get(ke);
      return Ne && (ze === void 0 && (ze = Ne?.[t.optionLabelProp || u.value.label]), Re === void 0 && (Re = (le = Ne?.key) !== null && le !== void 0 ? le : ke), Ye = Ne?.disabled), {
        label: ze,
        value: ke,
        key: Re,
        disabled: Ye,
        option: Ne
      };
    }), [y, b] = er(t.defaultValue, {
      value: on(t, "value")
    }), w = A(() => {
      var ce;
      const ue = m(y.value);
      return t.mode === "combobox" && !(!((ce = ue[0]) === null || ce === void 0) && ce.value) ? [] : ue;
    }), [$, C] = GZ(w, h), P = A(() => {
      if (!t.mode && $.value.length === 1) {
        const ce = $.value[0];
        if (ce.value === null && (ce.label === null || ce.label === void 0))
          return [];
      }
      return $.value.map((ce) => {
        var ue;
        return k(k({}, ce), {
          label: (ue = typeof ce.label == "function" ? ce.label() : ce.label) !== null && ue !== void 0 ? ue : ce.value
        });
      });
    }), O = A(() => new Set($.value.map((ce) => ce.value)));
    zt(() => {
      var ce;
      if (t.mode === "combobox") {
        const ue = (ce = $.value[0]) === null || ce === void 0 ? void 0 : ce.value;
        ue != null && d(String(ue));
      }
    }, {
      flush: "post"
    });
    const E = (ce, ue) => {
      const fe = ue ?? ce;
      return {
        [u.value.value]: ce,
        [u.value.label]: fe
      };
    }, _ = Te();
    zt(() => {
      if (t.mode !== "tags") {
        _.value = g.value;
        return;
      }
      const ce = g.value.slice(), ue = (fe) => h.value.has(fe);
      [...$.value].sort((fe, he) => fe.value < he.value ? -1 : 1).forEach((fe) => {
        const he = fe.value;
        ue(he) || ce.push(E(he, fe.label));
      }), _.value = ce;
    });
    const D = ZZ(_, u, c, s, on(t, "optionFilterProp")), M = A(() => t.mode !== "tags" || !c.value || D.value.some((ce) => ce[t.optionFilterProp || "value"] === c.value) ? D.value : [E(c.value), ...D.value]), N = A(() => t.filterSort ? [...M.value].sort((ce, ue) => t.filterSort(ce, ue)) : M.value), L = A(() => jK(N.value, {
      fieldNames: u.value,
      childrenAsData: l.value
    })), j = (ce) => {
      const ue = m(ce);
      if (b(ue), t.onChange && // Trigger event only when value changed
      (ue.length !== $.value.length || ue.some((fe, he) => {
        var le;
        return ((le = $.value[he]) === null || le === void 0 ? void 0 : le.value) !== fe?.value;
      }))) {
        const fe = t.labelInValue ? ue.map((le) => k(k({}, le), {
          originLabel: le.label,
          label: typeof le.label == "function" ? le.label() : le.label
        })) : ue.map((le) => le.value), he = ue.map((le) => aO(C(le.value)));
        t.onChange(
          // Value
          a.value ? fe : fe[0],
          // Option
          a.value ? he : he[0]
        );
      }
    }, [B, Y] = zn(null), [Q, G] = zn(0), V = A(() => t.defaultActiveFirstOption !== void 0 ? t.defaultActiveFirstOption : t.mode !== "combobox"), H = function(ce, ue) {
      let {
        source: fe = "keyboard"
      } = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
      G(ue), t.backfill && t.mode === "combobox" && ce !== null && fe === "keyboard" && Y(String(ce));
    }, q = (ce, ue) => {
      const fe = () => {
        var he;
        const le = C(ce), ke = le?.[u.value.label];
        return [t.labelInValue ? {
          label: typeof ke == "function" ? ke() : ke,
          originLabel: ke,
          value: ce,
          key: (he = le?.key) !== null && he !== void 0 ? he : ce
        } : ce, aO(le)];
      };
      if (ue && t.onSelect) {
        const [he, le] = fe();
        t.onSelect(he, le);
      } else if (!ue && t.onDeselect) {
        const [he, le] = fe();
        t.onDeselect(he, le);
      }
    }, K = (ce, ue) => {
      let fe;
      const he = a.value ? ue.selected : !0;
      he ? fe = a.value ? [...$.value, ce] : [ce] : fe = $.value.filter((le) => le.value !== ce), j(fe), q(ce, he), t.mode === "combobox" ? Y("") : (!a.value || t.autoClearSearchValue) && (d(""), Y(""));
    }, ee = (ce, ue) => {
      j(ce), (ue.type === "remove" || ue.type === "clear") && ue.values.forEach((fe) => {
        q(fe.value, !1);
      });
    }, ie = (ce, ue) => {
      var fe;
      if (d(ce), Y(null), ue.source === "submit") {
        const he = (ce || "").trim();
        if (he) {
          const le = Array.from(/* @__PURE__ */ new Set([...O.value, he]));
          j(le), q(he, !0), d("");
        }
        return;
      }
      ue.source !== "blur" && (t.mode === "combobox" && j(ce), (fe = t.onSearch) === null || fe === void 0 || fe.call(t, ce));
    }, ae = (ce) => {
      let ue = ce;
      t.mode !== "tags" && (ue = ce.map((he) => {
        const le = p.value.get(he);
        return le?.value;
      }).filter((he) => he !== void 0));
      const fe = Array.from(/* @__PURE__ */ new Set([...O.value, ...ue]));
      j(fe), fe.forEach((he) => {
        q(he, !0);
      });
    }, te = A(() => t.virtual !== !1 && t.dropdownMatchSelectWidth !== !1);
    zZ(e3(k(k({}, f), {
      flattenOptions: L,
      onActiveValue: H,
      defaultActiveFirstOption: V,
      onSelect: K,
      menuItemSelectedIcon: on(t, "menuItemSelectedIcon"),
      rawValues: O,
      fieldNames: u,
      virtual: te,
      listHeight: on(t, "listHeight"),
      listItemHeight: on(t, "listItemHeight"),
      childrenAsData: l
    }))), process.env.NODE_ENV !== "production" && zt(() => {
      XZ(t);
    }, {
      flush: "post"
    });
    const U = de();
    n({
      focus() {
        var ce;
        (ce = U.value) === null || ce === void 0 || ce.focus();
      },
      blur() {
        var ce;
        (ce = U.value) === null || ce === void 0 || ce.blur();
      },
      scrollTo(ce) {
        var ue;
        (ue = U.value) === null || ue === void 0 || ue.scrollTo(ce);
      }
    });
    const me = A(() => ii(t, [
      "id",
      "mode",
      "prefixCls",
      "backfill",
      "fieldNames",
      // Search
      "inputValue",
      "searchValue",
      "onSearch",
      "autoClearSearchValue",
      // Select
      "onSelect",
      "onDeselect",
      "dropdownMatchSelectWidth",
      // Options
      "filterOption",
      "filterSort",
      "optionFilterProp",
      "optionLabelProp",
      "options",
      "children",
      "defaultActiveFirstOption",
      "menuItemSelectedIcon",
      "virtual",
      "listHeight",
      "listItemHeight",
      // Value
      "value",
      "defaultValue",
      "labelInValue",
      "onChange"
    ]));
    return () => v(CZ, J(J(J({}, me.value), i), {}, {
      id: r,
      prefixCls: t.prefixCls,
      ref: U,
      omitDomProps: UZ,
      mode: t.mode,
      displayValues: P.value,
      onDisplayValuesChange: ee,
      searchValue: c.value,
      onSearch: ie,
      onSearchSplit: ae,
      dropdownMatchSelectWidth: t.dropdownMatchSelectWidth,
      OptionList: VZ,
      emptyOptions: !L.value.length,
      activeValue: B.value,
      activeDescendantId: `${r}_list_${Q.value}`
    }), o);
  }
}), MC = () => null;
MC.isSelectOption = !0;
MC.displayName = "ASelectOption";
const AC = () => null;
AC.isSelectOptGroup = !0;
AC.displayName = "ASelectOptGroup";
var tG = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z" } }] }, name: "down", theme: "outlined" }, nG = Symbol("iconContext"), s3 = function() {
  return qt(nG, {
    prefixCls: de("anticon"),
    rootClassName: de(""),
    csp: de()
  });
};
function RC() {
  return !!(typeof window < "u" && window.document && window.document.createElement);
}
function iG(t, e) {
  return t && t.contains ? t.contains(e) : !1;
}
var c2 = "data-vc-order", oG = "vc-icon-key", fO = /* @__PURE__ */ new Map();
function u3() {
  var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = t.mark;
  return e ? e.startsWith("data-") ? e : "data-".concat(e) : oG;
}
function DC(t) {
  if (t.attachTo)
    return t.attachTo;
  var e = document.querySelector("head");
  return e || document.body;
}
function rG(t) {
  return t === "queue" ? "prependQueue" : t ? "prepend" : "append";
}
function c3(t) {
  return Array.from((fO.get(t) || t).children).filter(function(e) {
    return e.tagName === "STYLE";
  });
}
function d3(t) {
  var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
  if (!RC())
    return null;
  var n = e.csp, i = e.prepend, o = document.createElement("style");
  o.setAttribute(c2, rG(i)), n && n.nonce && (o.nonce = n.nonce), o.innerHTML = t;
  var r = DC(e), a = r.firstChild;
  if (i) {
    if (i === "queue") {
      var l = c3(r).filter(function(s) {
        return ["prepend", "prependQueue"].includes(s.getAttribute(c2));
      });
      if (l.length)
        return r.insertBefore(o, l[l.length - 1].nextSibling), o;
    }
    r.insertBefore(o, a);
  } else
    r.appendChild(o);
  return o;
}
function aG(t) {
  var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = DC(e);
  return c3(n).find(function(i) {
    return i.getAttribute(u3(e)) === t;
  });
}
function lG(t, e) {
  var n = fO.get(t);
  if (!n || !iG(document, n)) {
    var i = d3("", e), o = i.parentNode;
    fO.set(t, o), t.removeChild(i);
  }
}
function sG(t, e) {
  var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i = DC(n);
  lG(i, n);
  var o = aG(e, n);
  if (o)
    return n.csp && n.csp.nonce && o.nonce !== n.csp.nonce && (o.nonce = n.csp.nonce), o.innerHTML !== t && (o.innerHTML = t), o;
  var r = d3(t, n);
  return r.setAttribute(u3(n), e), r;
}
function d2(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(n);
    typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(n).filter(function(o) {
      return Object.getOwnPropertyDescriptor(n, o).enumerable;
    }))), i.forEach(function(o) {
      uG(t, o, n[o]);
    });
  }
  return t;
}
function uG(t, e, n) {
  return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
function cG(t, e) {
  process.env.NODE_ENV !== "production" && !t && console !== void 0 && console.error("Warning: ".concat(e));
}
function dG(t, e) {
  cG(t, "[@ant-design/icons-vue] ".concat(e));
}
function f2(t) {
  return typeof t == "object" && typeof t.name == "string" && typeof t.theme == "string" && (typeof t.icon == "object" || typeof t.icon == "function");
}
function hO(t, e, n) {
  return n ? lo(t.tag, d2({
    key: e
  }, n, t.attrs), (t.children || []).map(function(i, o) {
    return hO(i, "".concat(e, "-").concat(t.tag, "-").concat(o));
  })) : lo(t.tag, d2({
    key: e
  }, t.attrs), (t.children || []).map(function(i, o) {
    return hO(i, "".concat(e, "-").concat(t.tag, "-").concat(o));
  }));
}
function f3(t) {
  return Ts(t)[0];
}
function h3(t) {
  return t ? Array.isArray(t) ? t : [t] : [];
}
var fG = `
.anticon {
  display: inline-block;
  color: inherit;
  font-style: normal;
  line-height: 0;
  text-align: center;
  text-transform: none;
  vertical-align: -0.125em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.anticon > * {
  line-height: 1;
}

.anticon svg {
  display: inline-block;
}

.anticon::before {
  display: none;
}

.anticon .anticon-icon {
  display: block;
}

.anticon[tabindex] {
  cursor: pointer;
}

.anticon-spin::before,
.anticon-spin {
  display: inline-block;
  -webkit-animation: loadingCircle 1s infinite linear;
  animation: loadingCircle 1s infinite linear;
}

@-webkit-keyframes loadingCircle {
  100% {
    -webkit-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}

@keyframes loadingCircle {
  100% {
    -webkit-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}
`;
function p3(t) {
  return t && t.getRootNode && t.getRootNode();
}
function hG(t) {
  return RC() ? p3(t) instanceof ShadowRoot : !1;
}
function pG(t) {
  return hG(t) ? p3(t) : null;
}
var gG = function() {
  var e = s3(), n = e.prefixCls, i = e.csp, o = sr(), r = fG;
  n && (r = r.replace(/anticon/g, n.value)), rn(function() {
    if (RC()) {
      var a = o.vnode.el, l = pG(a);
      sG(r, "@ant-design-vue-icons", {
        prepend: !0,
        csp: i.value,
        attachTo: l
      });
    }
  });
}, mG = ["icon", "primaryColor", "secondaryColor"];
function vG(t, e) {
  if (t == null) return {};
  var n = yG(t, e), i, o;
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(t);
    for (o = 0; o < r.length; o++)
      i = r[o], !(e.indexOf(i) >= 0) && Object.prototype.propertyIsEnumerable.call(t, i) && (n[i] = t[i]);
  }
  return n;
}
function yG(t, e) {
  if (t == null) return {};
  var n = {}, i = Object.keys(t), o, r;
  for (r = 0; r < i.length; r++)
    o = i[r], !(e.indexOf(o) >= 0) && (n[o] = t[o]);
  return n;
}
function uv(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(n);
    typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(n).filter(function(o) {
      return Object.getOwnPropertyDescriptor(n, o).enumerable;
    }))), i.forEach(function(o) {
      bG(t, o, n[o]);
    });
  }
  return t;
}
function bG(t, e, n) {
  return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
var ap = Bn({
  primaryColor: "#333",
  secondaryColor: "#E6E6E6",
  calculated: !1
});
function xG(t) {
  var e = t.primaryColor, n = t.secondaryColor;
  ap.primaryColor = e, ap.secondaryColor = n || f3(e), ap.calculated = !!n;
}
function OG() {
  return uv({}, ap);
}
var Fu = function(e, n) {
  var i = uv({}, e, n.attrs), o = i.icon, r = i.primaryColor, a = i.secondaryColor, l = vG(i, mG), s = ap;
  if (r && (s = {
    primaryColor: r,
    secondaryColor: a || f3(r)
  }), dG(f2(o), "icon should be icon definiton, but got ".concat(o)), !f2(o))
    return null;
  var u = o;
  return u && typeof u.icon == "function" && (u = uv({}, u, {
    icon: u.icon(s.primaryColor, s.secondaryColor)
  })), hO(u.icon, "svg-".concat(u.name), uv({}, l, {
    "data-icon": u.name,
    width: "1em",
    height: "1em",
    fill: "currentColor",
    "aria-hidden": "true"
  }));
};
Fu.props = {
  icon: Object,
  primaryColor: String,
  secondaryColor: String,
  focusable: String
};
Fu.inheritAttrs = !1;
Fu.displayName = "IconBase";
Fu.getTwoToneColors = OG;
Fu.setTwoToneColors = xG;
function SG(t, e) {
  return kG(t) || $G(t, e) || CG(t, e) || wG();
}
function wG() {
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function CG(t, e) {
  if (t) {
    if (typeof t == "string") return h2(t, e);
    var n = Object.prototype.toString.call(t).slice(8, -1);
    if (n === "Object" && t.constructor && (n = t.constructor.name), n === "Map" || n === "Set") return Array.from(t);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return h2(t, e);
  }
}
function h2(t, e) {
  (e == null || e > t.length) && (e = t.length);
  for (var n = 0, i = new Array(e); n < e; n++)
    i[n] = t[n];
  return i;
}
function $G(t, e) {
  var n = t == null ? null : typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
  if (n != null) {
    var i = [], o = !0, r = !1, a, l;
    try {
      for (n = n.call(t); !(o = (a = n.next()).done) && (i.push(a.value), !(e && i.length === e)); o = !0)
        ;
    } catch (s) {
      r = !0, l = s;
    } finally {
      try {
        !o && n.return != null && n.return();
      } finally {
        if (r) throw l;
      }
    }
    return i;
  }
}
function kG(t) {
  if (Array.isArray(t)) return t;
}
function g3(t) {
  var e = h3(t), n = SG(e, 2), i = n[0], o = n[1];
  return Fu.setTwoToneColors({
    primaryColor: i,
    secondaryColor: o
  });
}
function TG() {
  var t = Fu.getTwoToneColors();
  return t.calculated ? [t.primaryColor, t.secondaryColor] : t.primaryColor;
}
var PG = Oe({
  name: "InsertStyles",
  setup: function() {
    return gG(), function() {
      return null;
    };
  }
}), EG = ["class", "icon", "spin", "rotate", "tabindex", "twoToneColor", "onClick"];
function _G(t, e) {
  return RG(t) || AG(t, e) || MG(t, e) || IG();
}
function IG() {
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function MG(t, e) {
  if (t) {
    if (typeof t == "string") return p2(t, e);
    var n = Object.prototype.toString.call(t).slice(8, -1);
    if (n === "Object" && t.constructor && (n = t.constructor.name), n === "Map" || n === "Set") return Array.from(t);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return p2(t, e);
  }
}
function p2(t, e) {
  (e == null || e > t.length) && (e = t.length);
  for (var n = 0, i = new Array(e); n < e; n++)
    i[n] = t[n];
  return i;
}
function AG(t, e) {
  var n = t == null ? null : typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
  if (n != null) {
    var i = [], o = !0, r = !1, a, l;
    try {
      for (n = n.call(t); !(o = (a = n.next()).done) && (i.push(a.value), !(e && i.length === e)); o = !0)
        ;
    } catch (s) {
      r = !0, l = s;
    } finally {
      try {
        !o && n.return != null && n.return();
      } finally {
        if (r) throw l;
      }
    }
    return i;
  }
}
function RG(t) {
  if (Array.isArray(t)) return t;
}
function g2(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(n);
    typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(n).filter(function(o) {
      return Object.getOwnPropertyDescriptor(n, o).enumerable;
    }))), i.forEach(function(o) {
      Yh(t, o, n[o]);
    });
  }
  return t;
}
function Yh(t, e, n) {
  return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
function DG(t, e) {
  if (t == null) return {};
  var n = NG(t, e), i, o;
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(t);
    for (o = 0; o < r.length; o++)
      i = r[o], !(e.indexOf(i) >= 0) && Object.prototype.propertyIsEnumerable.call(t, i) && (n[i] = t[i]);
  }
  return n;
}
function NG(t, e) {
  if (t == null) return {};
  var n = {}, i = Object.keys(t), o, r;
  for (r = 0; r < i.length; r++)
    o = i[r], !(e.indexOf(o) >= 0) && (n[o] = t[o]);
  return n;
}
g3(KY.primary);
var bn = function(e, n) {
  var i, o = g2({}, e, n.attrs), r = o.class, a = o.icon, l = o.spin, s = o.rotate, u = o.tabindex, c = o.twoToneColor, d = o.onClick, f = DG(o, EG), h = s3(), p = h.prefixCls, g = h.rootClassName, m = (i = {}, Yh(i, g.value, !!g.value), Yh(i, p.value, !0), Yh(i, "".concat(p.value, "-").concat(a.name), !!a.name), Yh(i, "".concat(p.value, "-spin"), !!l || a.name === "loading"), i), y = u;
  y === void 0 && d && (y = -1);
  var b = s ? {
    msTransform: "rotate(".concat(s, "deg)"),
    transform: "rotate(".concat(s, "deg)")
  } : void 0, w = h3(c), $ = _G(w, 2), C = $[0], P = $[1];
  return v("span", g2({
    role: "img",
    "aria-label": a.name
  }, f, {
    onClick: d,
    class: [m, r],
    tabindex: y
  }), [v(Fu, {
    icon: a,
    primaryColor: C,
    secondaryColor: P,
    style: b
  }, null), v(PG, null, null)]);
};
bn.props = {
  spin: Boolean,
  rotate: Number,
  icon: Object,
  twoToneColor: [String, Array]
};
bn.displayName = "AntdIcon";
bn.inheritAttrs = !1;
bn.getTwoToneColor = TG;
bn.setTwoToneColor = g3;
function m2(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(n);
    typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(n).filter(function(o) {
      return Object.getOwnPropertyDescriptor(n, o).enumerable;
    }))), i.forEach(function(o) {
      LG(t, o, n[o]);
    });
  }
  return t;
}
function LG(t, e, n) {
  return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
var hg = function(e, n) {
  var i = m2({}, e, n.attrs);
  return v(bn, m2({}, i, {
    icon: tG
  }), null);
};
hg.displayName = "DownOutlined";
hg.inheritAttrs = !1;
var zG = { icon: { tag: "svg", attrs: { viewBox: "0 0 1024 1024", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z" } }] }, name: "loading", theme: "outlined" };
function v2(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(n);
    typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(n).filter(function(o) {
      return Object.getOwnPropertyDescriptor(n, o).enumerable;
    }))), i.forEach(function(o) {
      BG(t, o, n[o]);
    });
  }
  return t;
}
function BG(t, e, n) {
  return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
var Ya = function(e, n) {
  var i = v2({}, e, n.attrs);
  return v(bn, v2({}, i, {
    icon: zG
  }), null);
};
Ya.displayName = "LoadingOutlined";
Ya.inheritAttrs = !1;
var FG = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z" } }] }, name: "check", theme: "outlined" };
function y2(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(n);
    typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(n).filter(function(o) {
      return Object.getOwnPropertyDescriptor(n, o).enumerable;
    }))), i.forEach(function(o) {
      VG(t, o, n[o]);
    });
  }
  return t;
}
function VG(t, e, n) {
  return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
var NC = function(e, n) {
  var i = y2({}, e, n.attrs);
  return v(bn, y2({}, i, {
    icon: FG
  }), null);
};
NC.displayName = "CheckOutlined";
NC.inheritAttrs = !1;
var QG = { icon: { tag: "svg", attrs: { "fill-rule": "evenodd", viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z" } }] }, name: "close", theme: "outlined" };
function b2(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(n);
    typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(n).filter(function(o) {
      return Object.getOwnPropertyDescriptor(n, o).enumerable;
    }))), i.forEach(function(o) {
      HG(t, o, n[o]);
    });
  }
  return t;
}
function HG(t, e, n) {
  return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
var Ll = function(e, n) {
  var i = b2({}, e, n.attrs);
  return v(bn, b2({}, i, {
    icon: QG
  }), null);
};
Ll.displayName = "CloseOutlined";
Ll.inheritAttrs = !1;
var WG = { icon: { tag: "svg", attrs: { "fill-rule": "evenodd", viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z" } }] }, name: "close-circle", theme: "filled" };
function x2(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(n);
    typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(n).filter(function(o) {
      return Object.getOwnPropertyDescriptor(n, o).enumerable;
    }))), i.forEach(function(o) {
      jG(t, o, n[o]);
    });
  }
  return t;
}
function jG(t, e, n) {
  return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
var Wr = function(e, n) {
  var i = x2({}, e, n.attrs);
  return v(bn, x2({}, i, {
    icon: WG
  }), null);
};
Wr.displayName = "CloseCircleFilled";
Wr.inheritAttrs = !1;
var qG = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z" } }] }, name: "search", theme: "outlined" };
function O2(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(n);
    typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(n).filter(function(o) {
      return Object.getOwnPropertyDescriptor(n, o).enumerable;
    }))), i.forEach(function(o) {
      YG(t, o, n[o]);
    });
  }
  return t;
}
function YG(t, e, n) {
  return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
var pg = function(e, n) {
  var i = O2({}, e, n.attrs);
  return v(bn, O2({}, i, {
    icon: qG
  }), null);
};
pg.displayName = "SearchOutlined";
pg.inheritAttrs = !1;
function KG(t) {
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
  const {
    loading: n,
    multiple: i,
    prefixCls: o,
    hasFeedback: r,
    feedbackIcon: a,
    showArrow: l
  } = t, s = t.suffixIcon || e.suffixIcon && e.suffixIcon(), u = t.clearIcon || e.clearIcon && e.clearIcon(), c = t.menuItemSelectedIcon || e.menuItemSelectedIcon && e.menuItemSelectedIcon(), d = t.removeIcon || e.removeIcon && e.removeIcon(), f = u ?? v(Wr, null, null), h = (y) => v(tt, null, [l !== !1 && y, r && a]);
  let p = null;
  if (s !== void 0)
    p = h(s);
  else if (n)
    p = h(v(Ya, {
      spin: !0
    }, null));
  else {
    const y = `${o}-suffix`;
    p = (b) => {
      let {
        open: w,
        showSearch: $
      } = b;
      return h(w && $ ? v(pg, {
        class: y
      }, null) : v(hg, {
        class: y
      }, null));
    };
  }
  let g = null;
  c !== void 0 ? g = c : i ? g = v(NC, null, null) : g = null;
  let m = null;
  return d !== void 0 ? m = d : m = v(Ll, null, null), {
    clearIcon: f,
    suffixIcon: p,
    itemIcon: g,
    removeIcon: m
  };
}
function LC(t) {
  const e = Symbol("contextKey");
  return {
    useProvide: (o, r) => {
      const a = Bn({});
      return Xt(e, a), zt(() => {
        k(a, o, r || {});
      }), a;
    },
    useInject: () => qt(e, t) || {}
  };
}
const Yv = Symbol("ContextProps"), Kv = Symbol("InternalContextProps"), XG = function(t) {
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : A(() => !0);
  const n = de(/* @__PURE__ */ new Map()), i = (a, l) => {
    n.value.set(a, l), n.value = new Map(n.value);
  }, o = (a) => {
    n.value.delete(a), n.value = new Map(n.value);
  }, r = sr();
  _e([e, n], () => {
    if (process.env.NODE_ENV !== "production" && e.value && n.value.size > 1) {
      $n(!1, "Form.Item", `FormItem can only collect one field item, you haved set ${[...n.value.values()].map((l) => `\`${l.name}\``).join(", ")} ${n.value.size} field items.
        You can set not need to be collected fields into \`a-form-item-rest\``);
      let a = r;
      for (; a.parent; )
        console.warn("at", a.type), a = a.parent;
    }
  }), Xt(Yv, t), Xt(Kv, {
    addFormItemField: i,
    removeFormItemField: o
  });
}, pO = {
  id: A(() => {
  }),
  onFieldBlur: () => {
  },
  onFieldChange: () => {
  },
  clearValidate: () => {
  }
}, gO = {
  addFormItemField: () => {
  },
  removeFormItemField: () => {
  }
}, jr = () => {
  const t = qt(Kv, gO), e = Symbol("FormItemFieldKey"), n = sr();
  return t.addFormItemField(e, n.type), tn(() => {
    t.removeFormItemField(e);
  }), Xt(Kv, gO), Xt(Yv, pO), qt(Yv, pO);
}, mO = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "AFormItemRest",
  setup(t, e) {
    let {
      slots: n
    } = e;
    return Xt(Kv, gO), Xt(Yv, pO), () => {
      var i;
      return (i = n.default) === null || i === void 0 ? void 0 : i.call(n);
    };
  }
}), Fr = LC({}), Xv = Oe({
  name: "NoFormStatus",
  setup(t, e) {
    let {
      slots: n
    } = e;
    return Fr.useProvide({}), () => {
      var i;
      return (i = n.default) === null || i === void 0 ? void 0 : i.call(n);
    };
  }
});
function Fa(t, e, n) {
  return Ae({
    [`${t}-status-success`]: e === "success",
    [`${t}-status-warning`]: e === "warning",
    [`${t}-status-error`]: e === "error",
    [`${t}-status-validating`]: e === "validating",
    [`${t}-has-feedback`]: n
  });
}
const ad = (t, e) => e || t, ZG = (t) => {
  const {
    componentCls: e
  } = t;
  return {
    [e]: {
      display: "inline-flex",
      "&-block": {
        display: "flex",
        width: "100%"
      },
      "&-vertical": {
        flexDirection: "column"
      }
    }
  };
}, GG = (t) => {
  const {
    componentCls: e
  } = t;
  return {
    [e]: {
      display: "inline-flex",
      "&-rtl": {
        direction: "rtl"
      },
      "&-vertical": {
        flexDirection: "column"
      },
      "&-align": {
        flexDirection: "column",
        "&-center": {
          alignItems: "center"
        },
        "&-start": {
          alignItems: "flex-start"
        },
        "&-end": {
          alignItems: "flex-end"
        },
        "&-baseline": {
          alignItems: "baseline"
        }
      },
      [`${e}-item`]: {
        "&:empty": {
          display: "none"
        }
      }
    }
  };
}, m3 = Vn("Space", (t) => [GG(t), ZG(t)]), UG = () => ({
  compactSize: String,
  compactDirection: ve.oneOf(ja("horizontal", "vertical")).def("horizontal"),
  isFirstItem: pt(),
  isLastItem: pt()
}), gy = LC(null), sh = (t, e) => {
  const n = gy.useInject(), i = A(() => {
    if (!n || PA(n)) return "";
    const {
      compactDirection: o,
      isFirstItem: r,
      isLastItem: a
    } = n, l = o === "vertical" ? "-vertical-" : "-";
    return Ae({
      [`${t.value}-compact${l}item`]: !0,
      [`${t.value}-compact${l}first-item`]: r,
      [`${t.value}-compact${l}last-item`]: a,
      [`${t.value}-compact${l}item-rtl`]: e.value === "rtl"
    });
  });
  return {
    compactSize: A(() => n?.compactSize),
    compactDirection: A(() => n?.compactDirection),
    compactItemClassnames: i
  };
}, Vp = Oe({
  name: "NoCompactStyle",
  setup(t, e) {
    let {
      slots: n
    } = e;
    return gy.useProvide(null), () => {
      var i;
      return (i = n.default) === null || i === void 0 ? void 0 : i.call(n);
    };
  }
}), JG = () => ({
  prefixCls: String,
  size: {
    type: String
  },
  direction: ve.oneOf(ja("horizontal", "vertical")).def("horizontal"),
  align: ve.oneOf(ja("start", "end", "center", "baseline")),
  block: {
    type: Boolean,
    default: void 0
  }
}), eU = Oe({
  name: "CompactItem",
  props: UG(),
  setup(t, e) {
    let {
      slots: n
    } = e;
    return gy.useProvide(t), () => {
      var i;
      return (i = n.default) === null || i === void 0 ? void 0 : i.call(n);
    };
  }
}), vO = Oe({
  name: "ASpaceCompact",
  inheritAttrs: !1,
  props: JG(),
  setup(t, e) {
    let {
      attrs: n,
      slots: i
    } = e;
    const {
      prefixCls: o,
      direction: r
    } = Ht("space-compact", t), a = gy.useInject(), [l, s] = m3(o), u = A(() => Ae(o.value, s.value, {
      [`${o.value}-rtl`]: r.value === "rtl",
      [`${o.value}-block`]: t.block,
      [`${o.value}-vertical`]: t.direction === "vertical"
    }));
    return () => {
      var c;
      const d = Wi(((c = i.default) === null || c === void 0 ? void 0 : c.call(i)) || []);
      return d.length === 0 ? null : l(v("div", J(J({}, n), {}, {
        class: [u.value, n.class]
      }), [d.map((f, h) => {
        var p;
        const g = f && f.key || `${o.value}-item-${h}`, m = !a || PA(a);
        return v(eU, {
          key: g,
          compactSize: (p = t.size) !== null && p !== void 0 ? p : "middle",
          compactDirection: t.direction,
          isFirstItem: h === 0 && (m || a?.isFirstItem),
          isLastItem: h === d.length - 1 && (m || a?.isLastItem)
        }, {
          default: () => [f]
        });
      })]));
    };
  }
}), tU = (t) => ({
  animationDuration: t,
  animationFillMode: "both"
}), nU = (t) => ({
  animationDuration: t,
  animationFillMode: "both"
}), my = function(t, e, n, i) {
  const r = (arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !1) ? "&" : "";
  return {
    [`
      ${r}${t}-enter,
      ${r}${t}-appear
    `]: k(k({}, tU(i)), {
      animationPlayState: "paused"
    }),
    [`${r}${t}-leave`]: k(k({}, nU(i)), {
      animationPlayState: "paused"
    }),
    [`
      ${r}${t}-enter${t}-enter-active,
      ${r}${t}-appear${t}-appear-active
    `]: {
      animationName: e,
      animationPlayState: "running"
    },
    [`${r}${t}-leave${t}-leave-active`]: {
      animationName: n,
      animationPlayState: "running",
      pointerEvents: "none"
    }
  };
}, iU = new gn("antFadeIn", {
  "0%": {
    opacity: 0
  },
  "100%": {
    opacity: 1
  }
}), oU = new gn("antFadeOut", {
  "0%": {
    opacity: 1
  },
  "100%": {
    opacity: 0
  }
}), rU = function(t) {
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
  const {
    antCls: n
  } = t, i = `${n}-fade`, o = e ? "&" : "";
  return [my(i, iU, oU, t.motionDurationMid, e), {
    [`
        ${o}${i}-enter,
        ${o}${i}-appear
      `]: {
      opacity: 0,
      animationTimingFunction: "linear"
    },
    [`${o}${i}-leave`]: {
      animationTimingFunction: "linear"
    }
  }];
}, aU = new gn("antMoveDownIn", {
  "0%": {
    transform: "translate3d(0, 100%, 0)",
    transformOrigin: "0 0",
    opacity: 0
  },
  "100%": {
    transform: "translate3d(0, 0, 0)",
    transformOrigin: "0 0",
    opacity: 1
  }
}), lU = new gn("antMoveDownOut", {
  "0%": {
    transform: "translate3d(0, 0, 0)",
    transformOrigin: "0 0",
    opacity: 1
  },
  "100%": {
    transform: "translate3d(0, 100%, 0)",
    transformOrigin: "0 0",
    opacity: 0
  }
}), sU = new gn("antMoveLeftIn", {
  "0%": {
    transform: "translate3d(-100%, 0, 0)",
    transformOrigin: "0 0",
    opacity: 0
  },
  "100%": {
    transform: "translate3d(0, 0, 0)",
    transformOrigin: "0 0",
    opacity: 1
  }
}), uU = new gn("antMoveLeftOut", {
  "0%": {
    transform: "translate3d(0, 0, 0)",
    transformOrigin: "0 0",
    opacity: 1
  },
  "100%": {
    transform: "translate3d(-100%, 0, 0)",
    transformOrigin: "0 0",
    opacity: 0
  }
}), cU = new gn("antMoveRightIn", {
  "0%": {
    transform: "translate3d(100%, 0, 0)",
    transformOrigin: "0 0",
    opacity: 0
  },
  "100%": {
    transform: "translate3d(0, 0, 0)",
    transformOrigin: "0 0",
    opacity: 1
  }
}), dU = new gn("antMoveRightOut", {
  "0%": {
    transform: "translate3d(0, 0, 0)",
    transformOrigin: "0 0",
    opacity: 1
  },
  "100%": {
    transform: "translate3d(100%, 0, 0)",
    transformOrigin: "0 0",
    opacity: 0
  }
}), fU = new gn("antMoveUpIn", {
  "0%": {
    transform: "translate3d(0, -100%, 0)",
    transformOrigin: "0 0",
    opacity: 0
  },
  "100%": {
    transform: "translate3d(0, 0, 0)",
    transformOrigin: "0 0",
    opacity: 1
  }
}), hU = new gn("antMoveUpOut", {
  "0%": {
    transform: "translate3d(0, 0, 0)",
    transformOrigin: "0 0",
    opacity: 1
  },
  "100%": {
    transform: "translate3d(0, -100%, 0)",
    transformOrigin: "0 0",
    opacity: 0
  }
}), pU = {
  "move-up": {
    inKeyframes: fU,
    outKeyframes: hU
  },
  "move-down": {
    inKeyframes: aU,
    outKeyframes: lU
  },
  "move-left": {
    inKeyframes: sU,
    outKeyframes: uU
  },
  "move-right": {
    inKeyframes: cU,
    outKeyframes: dU
  }
}, zf = (t, e) => {
  const {
    antCls: n
  } = t, i = `${n}-${e}`, {
    inKeyframes: o,
    outKeyframes: r
  } = pU[e];
  return [my(i, o, r, t.motionDurationMid), {
    [`
        ${i}-enter,
        ${i}-appear
      `]: {
      opacity: 0,
      animationTimingFunction: t.motionEaseOutCirc
    },
    [`${i}-leave`]: {
      animationTimingFunction: t.motionEaseInOutCirc
    }
  }];
}, vy = new gn("antSlideUpIn", {
  "0%": {
    transform: "scaleY(0.8)",
    transformOrigin: "0% 0%",
    opacity: 0
  },
  "100%": {
    transform: "scaleY(1)",
    transformOrigin: "0% 0%",
    opacity: 1
  }
}), yy = new gn("antSlideUpOut", {
  "0%": {
    transform: "scaleY(1)",
    transformOrigin: "0% 0%",
    opacity: 1
  },
  "100%": {
    transform: "scaleY(0.8)",
    transformOrigin: "0% 0%",
    opacity: 0
  }
}), by = new gn("antSlideDownIn", {
  "0%": {
    transform: "scaleY(0.8)",
    transformOrigin: "100% 100%",
    opacity: 0
  },
  "100%": {
    transform: "scaleY(1)",
    transformOrigin: "100% 100%",
    opacity: 1
  }
}), xy = new gn("antSlideDownOut", {
  "0%": {
    transform: "scaleY(1)",
    transformOrigin: "100% 100%",
    opacity: 1
  },
  "100%": {
    transform: "scaleY(0.8)",
    transformOrigin: "100% 100%",
    opacity: 0
  }
}), gU = new gn("antSlideLeftIn", {
  "0%": {
    transform: "scaleX(0.8)",
    transformOrigin: "0% 0%",
    opacity: 0
  },
  "100%": {
    transform: "scaleX(1)",
    transformOrigin: "0% 0%",
    opacity: 1
  }
}), mU = new gn("antSlideLeftOut", {
  "0%": {
    transform: "scaleX(1)",
    transformOrigin: "0% 0%",
    opacity: 1
  },
  "100%": {
    transform: "scaleX(0.8)",
    transformOrigin: "0% 0%",
    opacity: 0
  }
}), vU = new gn("antSlideRightIn", {
  "0%": {
    transform: "scaleX(0.8)",
    transformOrigin: "100% 0%",
    opacity: 0
  },
  "100%": {
    transform: "scaleX(1)",
    transformOrigin: "100% 0%",
    opacity: 1
  }
}), yU = new gn("antSlideRightOut", {
  "0%": {
    transform: "scaleX(1)",
    transformOrigin: "100% 0%",
    opacity: 1
  },
  "100%": {
    transform: "scaleX(0.8)",
    transformOrigin: "100% 0%",
    opacity: 0
  }
}), bU = {
  "slide-up": {
    inKeyframes: vy,
    outKeyframes: yy
  },
  "slide-down": {
    inKeyframes: by,
    outKeyframes: xy
  },
  "slide-left": {
    inKeyframes: gU,
    outKeyframes: mU
  },
  "slide-right": {
    inKeyframes: vU,
    outKeyframes: yU
  }
}, Ml = (t, e) => {
  const {
    antCls: n
  } = t, i = `${n}-${e}`, {
    inKeyframes: o,
    outKeyframes: r
  } = bU[e];
  return [my(i, o, r, t.motionDurationMid), {
    [`
      ${i}-enter,
      ${i}-appear
    `]: {
      transform: "scale(0)",
      transformOrigin: "0% 0%",
      opacity: 0,
      animationTimingFunction: t.motionEaseOutQuint
    },
    [`${i}-leave`]: {
      animationTimingFunction: t.motionEaseInQuint
    }
  }];
}, zC = new gn("antZoomIn", {
  "0%": {
    transform: "scale(0.2)",
    opacity: 0
  },
  "100%": {
    transform: "scale(1)",
    opacity: 1
  }
}), xU = new gn("antZoomOut", {
  "0%": {
    transform: "scale(1)"
  },
  "100%": {
    transform: "scale(0.2)",
    opacity: 0
  }
}), S2 = new gn("antZoomBigIn", {
  "0%": {
    transform: "scale(0.8)",
    opacity: 0
  },
  "100%": {
    transform: "scale(1)",
    opacity: 1
  }
}), w2 = new gn("antZoomBigOut", {
  "0%": {
    transform: "scale(1)"
  },
  "100%": {
    transform: "scale(0.8)",
    opacity: 0
  }
}), OU = new gn("antZoomUpIn", {
  "0%": {
    transform: "scale(0.8)",
    transformOrigin: "50% 0%",
    opacity: 0
  },
  "100%": {
    transform: "scale(1)",
    transformOrigin: "50% 0%"
  }
}), SU = new gn("antZoomUpOut", {
  "0%": {
    transform: "scale(1)",
    transformOrigin: "50% 0%"
  },
  "100%": {
    transform: "scale(0.8)",
    transformOrigin: "50% 0%",
    opacity: 0
  }
}), wU = new gn("antZoomLeftIn", {
  "0%": {
    transform: "scale(0.8)",
    transformOrigin: "0% 50%",
    opacity: 0
  },
  "100%": {
    transform: "scale(1)",
    transformOrigin: "0% 50%"
  }
}), CU = new gn("antZoomLeftOut", {
  "0%": {
    transform: "scale(1)",
    transformOrigin: "0% 50%"
  },
  "100%": {
    transform: "scale(0.8)",
    transformOrigin: "0% 50%",
    opacity: 0
  }
}), $U = new gn("antZoomRightIn", {
  "0%": {
    transform: "scale(0.8)",
    transformOrigin: "100% 50%",
    opacity: 0
  },
  "100%": {
    transform: "scale(1)",
    transformOrigin: "100% 50%"
  }
}), kU = new gn("antZoomRightOut", {
  "0%": {
    transform: "scale(1)",
    transformOrigin: "100% 50%"
  },
  "100%": {
    transform: "scale(0.8)",
    transformOrigin: "100% 50%",
    opacity: 0
  }
}), TU = new gn("antZoomDownIn", {
  "0%": {
    transform: "scale(0.8)",
    transformOrigin: "50% 100%",
    opacity: 0
  },
  "100%": {
    transform: "scale(1)",
    transformOrigin: "50% 100%"
  }
}), PU = new gn("antZoomDownOut", {
  "0%": {
    transform: "scale(1)",
    transformOrigin: "50% 100%"
  },
  "100%": {
    transform: "scale(0.8)",
    transformOrigin: "50% 100%",
    opacity: 0
  }
}), EU = {
  zoom: {
    inKeyframes: zC,
    outKeyframes: xU
  },
  "zoom-big": {
    inKeyframes: S2,
    outKeyframes: w2
  },
  "zoom-big-fast": {
    inKeyframes: S2,
    outKeyframes: w2
  },
  "zoom-left": {
    inKeyframes: wU,
    outKeyframes: CU
  },
  "zoom-right": {
    inKeyframes: $U,
    outKeyframes: kU
  },
  "zoom-up": {
    inKeyframes: OU,
    outKeyframes: SU
  },
  "zoom-down": {
    inKeyframes: TU,
    outKeyframes: PU
  }
}, gg = (t, e) => {
  const {
    antCls: n
  } = t, i = `${n}-${e}`, {
    inKeyframes: o,
    outKeyframes: r
  } = EU[e];
  return [my(i, o, r, e === "zoom-big-fast" ? t.motionDurationFast : t.motionDurationMid), {
    [`
        ${i}-enter,
        ${i}-appear
      `]: {
      transform: "scale(0)",
      opacity: 0,
      animationTimingFunction: t.motionEaseOutCirc,
      "&-prepare": {
        transform: "none"
      }
    },
    [`${i}-leave`]: {
      animationTimingFunction: t.motionEaseInOutCirc
    }
  }];
}, Oy = (t) => ({
  [t.componentCls]: {
    // For common/openAnimation
    [`${t.antCls}-motion-collapse-legacy`]: {
      overflow: "hidden",
      "&-active": {
        transition: `height ${t.motionDurationMid} ${t.motionEaseInOut},
        opacity ${t.motionDurationMid} ${t.motionEaseInOut} !important`
      }
    },
    [`${t.antCls}-motion-collapse`]: {
      overflow: "hidden",
      transition: `height ${t.motionDurationMid} ${t.motionEaseInOut},
        opacity ${t.motionDurationMid} ${t.motionEaseInOut} !important`
    }
  }
}), C2 = (t) => {
  const {
    controlPaddingHorizontal: e
  } = t;
  return {
    position: "relative",
    display: "block",
    minHeight: t.controlHeight,
    padding: `${(t.controlHeight - t.fontSize * t.lineHeight) / 2}px ${e}px`,
    color: t.colorText,
    fontWeight: "normal",
    fontSize: t.fontSize,
    lineHeight: t.lineHeight,
    boxSizing: "border-box"
  };
}, _U = (t) => {
  const {
    antCls: e,
    componentCls: n
  } = t, i = `${n}-item`;
  return [
    {
      [`${n}-dropdown`]: k(k({}, kn(t)), {
        position: "absolute",
        top: -9999,
        zIndex: t.zIndexPopup,
        boxSizing: "border-box",
        padding: t.paddingXXS,
        overflow: "hidden",
        fontSize: t.fontSize,
        // Fix select render lag of long text in chrome
        // https://github.com/ant-design/ant-design/issues/11456
        // https://github.com/ant-design/ant-design/issues/11843
        fontVariant: "initial",
        backgroundColor: t.colorBgElevated,
        borderRadius: t.borderRadiusLG,
        outline: "none",
        boxShadow: t.boxShadowSecondary,
        [`
            &${e}-slide-up-enter${e}-slide-up-enter-active${n}-dropdown-placement-bottomLeft,
            &${e}-slide-up-appear${e}-slide-up-appear-active${n}-dropdown-placement-bottomLeft
          `]: {
          animationName: vy
        },
        [`
            &${e}-slide-up-enter${e}-slide-up-enter-active${n}-dropdown-placement-topLeft,
            &${e}-slide-up-appear${e}-slide-up-appear-active${n}-dropdown-placement-topLeft
          `]: {
          animationName: by
        },
        [`&${e}-slide-up-leave${e}-slide-up-leave-active${n}-dropdown-placement-bottomLeft`]: {
          animationName: yy
        },
        [`&${e}-slide-up-leave${e}-slide-up-leave-active${n}-dropdown-placement-topLeft`]: {
          animationName: xy
        },
        "&-hidden": {
          display: "none"
        },
        "&-empty": {
          color: t.colorTextDisabled
        },
        // ========================= Options =========================
        [`${i}-empty`]: k(k({}, C2(t)), {
          color: t.colorTextDisabled
        }),
        [`${i}`]: k(k({}, C2(t)), {
          cursor: "pointer",
          transition: `background ${t.motionDurationSlow} ease`,
          borderRadius: t.borderRadiusSM,
          // =========== Group ============
          "&-group": {
            color: t.colorTextDescription,
            fontSize: t.fontSizeSM,
            cursor: "default"
          },
          // =========== Option ===========
          "&-option": {
            display: "flex",
            "&-content": k({
              flex: "auto"
            }, Ps),
            "&-state": {
              flex: "none"
            },
            [`&-active:not(${i}-option-disabled)`]: {
              backgroundColor: t.controlItemBgHover
            },
            [`&-selected:not(${i}-option-disabled)`]: {
              color: t.colorText,
              fontWeight: t.fontWeightStrong,
              backgroundColor: t.controlItemBgActive,
              [`${i}-option-state`]: {
                color: t.colorPrimary
              }
            },
            "&-disabled": {
              [`&${i}-option-selected`]: {
                backgroundColor: t.colorBgContainerDisabled
              },
              color: t.colorTextDisabled,
              cursor: "not-allowed"
            },
            "&-grouped": {
              paddingInlineStart: t.controlPaddingHorizontal * 2
            }
          }
        }),
        // =========================== RTL ===========================
        "&-rtl": {
          direction: "rtl"
        }
      })
    },
    // Follow code may reuse in other components
    Ml(t, "slide-up"),
    Ml(t, "slide-down"),
    zf(t, "move-up"),
    zf(t, "move-down")
  ];
}, Pd = 2;
function v3(t) {
  let {
    controlHeightSM: e,
    controlHeight: n,
    lineWidth: i
  } = t;
  const o = (n - e) / 2 - i, r = Math.ceil(o / 2);
  return [o, r];
}
function Ub(t, e) {
  const {
    componentCls: n,
    iconCls: i
  } = t, o = `${n}-selection-overflow`, r = t.controlHeightSM, [a] = v3(t), l = e ? `${n}-${e}` : "";
  return {
    [`${n}-multiple${l}`]: {
      fontSize: t.fontSize,
      /**
       * Do not merge `height` & `line-height` under style with `selection` & `search`, since chrome
       * may update to redesign with its align logic.
       */
      // =========================== Overflow ===========================
      [o]: {
        position: "relative",
        display: "flex",
        flex: "auto",
        flexWrap: "wrap",
        maxWidth: "100%",
        "&-item": {
          flex: "none",
          alignSelf: "center",
          maxWidth: "100%",
          display: "inline-flex"
        }
      },
      // ========================= Selector =========================
      [`${n}-selector`]: {
        display: "flex",
        flexWrap: "wrap",
        alignItems: "center",
        // Multiple is little different that horizontal is follow the vertical
        padding: `${a - Pd}px ${Pd * 2}px`,
        borderRadius: t.borderRadius,
        [`${n}-show-search&`]: {
          cursor: "text"
        },
        [`${n}-disabled&`]: {
          background: t.colorBgContainerDisabled,
          cursor: "not-allowed"
        },
        "&:after": {
          display: "inline-block",
          width: 0,
          margin: `${Pd}px 0`,
          lineHeight: `${r}px`,
          content: '"\\a0"'
        }
      },
      [`
        &${n}-show-arrow ${n}-selector,
        &${n}-allow-clear ${n}-selector
      `]: {
        paddingInlineEnd: t.fontSizeIcon + t.controlPaddingHorizontal
      },
      // ======================== Selections ========================
      [`${n}-selection-item`]: {
        position: "relative",
        display: "flex",
        flex: "none",
        boxSizing: "border-box",
        maxWidth: "100%",
        height: r,
        marginTop: Pd,
        marginBottom: Pd,
        lineHeight: `${r - t.lineWidth * 2}px`,
        background: t.colorFillSecondary,
        border: `${t.lineWidth}px solid ${t.colorSplit}`,
        borderRadius: t.borderRadiusSM,
        cursor: "default",
        transition: `font-size ${t.motionDurationSlow}, line-height ${t.motionDurationSlow}, height ${t.motionDurationSlow}`,
        userSelect: "none",
        marginInlineEnd: Pd * 2,
        paddingInlineStart: t.paddingXS,
        paddingInlineEnd: t.paddingXS / 2,
        [`${n}-disabled&`]: {
          color: t.colorTextDisabled,
          borderColor: t.colorBorder,
          cursor: "not-allowed"
        },
        // It's ok not to do this, but 24px makes bottom narrow in view should adjust
        "&-content": {
          display: "inline-block",
          marginInlineEnd: t.paddingXS / 2,
          overflow: "hidden",
          whiteSpace: "pre",
          textOverflow: "ellipsis"
        },
        "&-remove": k(k({}, ah()), {
          display: "inline-block",
          color: t.colorIcon,
          fontWeight: "bold",
          fontSize: 10,
          lineHeight: "inherit",
          cursor: "pointer",
          [`> ${i}`]: {
            verticalAlign: "-0.2em"
          },
          "&:hover": {
            color: t.colorIconHover
          }
        })
      },
      // ========================== Input ==========================
      [`${o}-item + ${o}-item`]: {
        [`${n}-selection-search`]: {
          marginInlineStart: 0
        }
      },
      [`${n}-selection-search`]: {
        display: "inline-flex",
        position: "relative",
        maxWidth: "100%",
        marginInlineStart: t.inputPaddingHorizontalBase - a,
        "\n          &-input,\n          &-mirror\n        ": {
          height: r,
          fontFamily: t.fontFamily,
          lineHeight: `${r}px`,
          transition: `all ${t.motionDurationSlow}`
        },
        "&-input": {
          width: "100%",
          minWidth: 4.1
          // fix search cursor missing
        },
        "&-mirror": {
          position: "absolute",
          top: 0,
          insetInlineStart: 0,
          insetInlineEnd: "auto",
          zIndex: 999,
          whiteSpace: "pre",
          visibility: "hidden"
        }
      },
      // ======================= Placeholder =======================
      [`${n}-selection-placeholder `]: {
        position: "absolute",
        top: "50%",
        insetInlineStart: t.inputPaddingHorizontalBase,
        insetInlineEnd: t.inputPaddingHorizontalBase,
        transform: "translateY(-50%)",
        transition: `all ${t.motionDurationSlow}`
      }
    }
  };
}
function IU(t) {
  const {
    componentCls: e
  } = t, n = dn(t, {
    controlHeight: t.controlHeightSM,
    controlHeightSM: t.controlHeightXS,
    borderRadius: t.borderRadiusSM,
    borderRadiusSM: t.borderRadiusXS
  }), [, i] = v3(t);
  return [
    Ub(t),
    // ======================== Small ========================
    // Shared
    Ub(n, "sm"),
    // Padding
    {
      [`${e}-multiple${e}-sm`]: {
        [`${e}-selection-placeholder`]: {
          insetInlineStart: t.controlPaddingHorizontalSM - t.lineWidth,
          insetInlineEnd: "auto"
        },
        // https://github.com/ant-design/ant-design/issues/29559
        [`${e}-selection-search`]: {
          marginInlineStart: i
        }
      }
    },
    // ======================== Large ========================
    // Shared
    Ub(dn(t, {
      fontSize: t.fontSizeLG,
      controlHeight: t.controlHeightLG,
      controlHeightSM: t.controlHeight,
      borderRadius: t.borderRadiusLG,
      borderRadiusSM: t.borderRadius
    }), "lg")
  ];
}
function Jb(t, e) {
  const {
    componentCls: n,
    inputPaddingHorizontalBase: i,
    borderRadius: o
  } = t, r = t.controlHeight - t.lineWidth * 2, a = Math.ceil(t.fontSize * 1.25), l = e ? `${n}-${e}` : "";
  return {
    [`${n}-single${l}`]: {
      fontSize: t.fontSize,
      // ========================= Selector =========================
      [`${n}-selector`]: k(k({}, kn(t)), {
        display: "flex",
        borderRadius: o,
        [`${n}-selection-search`]: {
          position: "absolute",
          top: 0,
          insetInlineStart: i,
          insetInlineEnd: i,
          bottom: 0,
          "&-input": {
            width: "100%"
          }
        },
        [`
          ${n}-selection-item,
          ${n}-selection-placeholder
        `]: {
          padding: 0,
          lineHeight: `${r}px`,
          transition: `all ${t.motionDurationSlow}`,
          // Firefox inline-block position calculation is not same as Chrome & Safari. Patch this:
          "@supports (-moz-appearance: meterbar)": {
            lineHeight: `${r}px`
          }
        },
        [`${n}-selection-item`]: {
          position: "relative",
          userSelect: "none"
        },
        [`${n}-selection-placeholder`]: {
          transition: "none",
          pointerEvents: "none"
        },
        // For common baseline align
        [[
          "&:after",
          /* For '' value baseline align */
          `${n}-selection-item:after`,
          /* For undefined value baseline align */
          `${n}-selection-placeholder:after`
        ].join(",")]: {
          display: "inline-block",
          width: 0,
          visibility: "hidden",
          content: '"\\a0"'
        }
      }),
      [`
        &${n}-show-arrow ${n}-selection-item,
        &${n}-show-arrow ${n}-selection-placeholder
      `]: {
        paddingInlineEnd: a
      },
      // Opacity selection if open
      [`&${n}-open ${n}-selection-item`]: {
        color: t.colorTextPlaceholder
      },
      // ========================== Input ==========================
      // We only change the style of non-customize input which is only support by `combobox` mode.
      // Not customize
      [`&:not(${n}-customize-input)`]: {
        [`${n}-selector`]: {
          width: "100%",
          height: t.controlHeight,
          padding: `0 ${i}px`,
          [`${n}-selection-search-input`]: {
            height: r
          },
          "&:after": {
            lineHeight: `${r}px`
          }
        }
      },
      [`&${n}-customize-input`]: {
        [`${n}-selector`]: {
          "&:after": {
            display: "none"
          },
          [`${n}-selection-search`]: {
            position: "static",
            width: "100%"
          },
          [`${n}-selection-placeholder`]: {
            position: "absolute",
            insetInlineStart: 0,
            insetInlineEnd: 0,
            padding: `0 ${i}px`,
            "&:after": {
              display: "none"
            }
          }
        }
      }
    }
  };
}
function MU(t) {
  const {
    componentCls: e
  } = t, n = t.controlPaddingHorizontalSM - t.lineWidth;
  return [
    Jb(t),
    // ======================== Small ========================
    // Shared
    Jb(dn(t, {
      controlHeight: t.controlHeightSM,
      borderRadius: t.borderRadiusSM
    }), "sm"),
    // padding
    {
      [`${e}-single${e}-sm`]: {
        [`&:not(${e}-customize-input)`]: {
          [`${e}-selection-search`]: {
            insetInlineStart: n,
            insetInlineEnd: n
          },
          [`${e}-selector`]: {
            padding: `0 ${n}px`
          },
          // With arrow should provides `padding-right` to show the arrow
          [`&${e}-show-arrow ${e}-selection-search`]: {
            insetInlineEnd: n + t.fontSize * 1.5
          },
          [`
            &${e}-show-arrow ${e}-selection-item,
            &${e}-show-arrow ${e}-selection-placeholder
          `]: {
            paddingInlineEnd: t.fontSize * 1.5
          }
        }
      }
    },
    // ======================== Large ========================
    // Shared
    Jb(dn(t, {
      controlHeight: t.controlHeightLG,
      fontSize: t.fontSizeLG,
      borderRadius: t.borderRadiusLG
    }), "lg")
  ];
}
function AU(t, e, n) {
  const {
    focusElCls: i,
    focus: o,
    borderElCls: r
  } = n, a = r ? "> *" : "", l = ["hover", o ? "focus" : null, "active"].filter(Boolean).map((s) => `&:${s} ${a}`).join(",");
  return {
    [`&-item:not(${e}-last-item)`]: {
      marginInlineEnd: -t.lineWidth
    },
    "&-item": k(k({
      [l]: {
        zIndex: 2
      }
    }, i ? {
      [`&${i}`]: {
        zIndex: 2
      }
    } : {}), {
      [`&[disabled] ${a}`]: {
        zIndex: 0
      }
    })
  };
}
function RU(t, e, n) {
  const {
    borderElCls: i
  } = n, o = i ? `> ${i}` : "";
  return {
    [`&-item:not(${e}-first-item):not(${e}-last-item) ${o}`]: {
      borderRadius: 0
    },
    [`&-item:not(${e}-last-item)${e}-first-item`]: {
      [`& ${o}, &${t}-sm ${o}, &${t}-lg ${o}`]: {
        borderStartEndRadius: 0,
        borderEndEndRadius: 0
      }
    },
    [`&-item:not(${e}-first-item)${e}-last-item`]: {
      [`& ${o}, &${t}-sm ${o}, &${t}-lg ${o}`]: {
        borderStartStartRadius: 0,
        borderEndStartRadius: 0
      }
    }
  };
}
function mg(t) {
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
    focus: !0
  };
  const {
    componentCls: n
  } = t, i = `${n}-compact`;
  return {
    [i]: k(k({}, AU(t, i, e)), RU(n, i, e))
  };
}
const DU = (t) => {
  const {
    componentCls: e
  } = t;
  return {
    position: "relative",
    backgroundColor: t.colorBgContainer,
    border: `${t.lineWidth}px ${t.lineType} ${t.colorBorder}`,
    transition: `all ${t.motionDurationMid} ${t.motionEaseInOut}`,
    input: {
      cursor: "pointer"
    },
    [`${e}-show-search&`]: {
      cursor: "text",
      input: {
        cursor: "auto",
        color: "inherit"
      }
    },
    [`${e}-disabled&`]: {
      color: t.colorTextDisabled,
      background: t.colorBgContainerDisabled,
      cursor: "not-allowed",
      [`${e}-multiple&`]: {
        background: t.colorBgContainerDisabled
      },
      input: {
        cursor: "not-allowed"
      }
    }
  };
}, e1 = function(t, e) {
  let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
  const {
    componentCls: i,
    borderHoverColor: o,
    outlineColor: r,
    antCls: a
  } = e, l = n ? {
    [`${i}-selector`]: {
      borderColor: o
    }
  } : {};
  return {
    [t]: {
      [`&:not(${i}-disabled):not(${i}-customize-input):not(${a}-pagination-size-changer)`]: k(k({}, l), {
        [`${i}-focused& ${i}-selector`]: {
          borderColor: o,
          boxShadow: `0 0 0 ${e.controlOutlineWidth}px ${r}`,
          borderInlineEndWidth: `${e.controlLineWidth}px !important`,
          outline: 0
        },
        [`&:hover ${i}-selector`]: {
          borderColor: o,
          borderInlineEndWidth: `${e.controlLineWidth}px !important`
        }
      })
    }
  };
}, NU = (t) => {
  const {
    componentCls: e
  } = t;
  return {
    [`${e}-selection-search-input`]: {
      margin: 0,
      padding: 0,
      background: "transparent",
      border: "none",
      outline: "none",
      appearance: "none",
      "&::-webkit-search-cancel-button": {
        display: "none",
        "-webkit-appearance": "none"
      }
    }
  };
}, LU = (t) => {
  const {
    componentCls: e,
    inputPaddingHorizontalBase: n,
    iconCls: i
  } = t;
  return {
    [e]: k(k({}, kn(t)), {
      position: "relative",
      display: "inline-block",
      cursor: "pointer",
      [`&:not(${e}-customize-input) ${e}-selector`]: k(k({}, DU(t)), NU(t)),
      // [`&:not(&-disabled):hover ${selectCls}-selector`]: {
      //   ...genHoverStyle(token),
      // },
      // ======================== Selection ========================
      [`${e}-selection-item`]: k({
        flex: 1,
        fontWeight: "normal"
      }, Ps),
      // ======================= Placeholder =======================
      [`${e}-selection-placeholder`]: k(k({}, Ps), {
        flex: 1,
        color: t.colorTextPlaceholder,
        pointerEvents: "none"
      }),
      // ========================== Arrow ==========================
      [`${e}-arrow`]: k(k({}, ah()), {
        position: "absolute",
        top: "50%",
        insetInlineStart: "auto",
        insetInlineEnd: n,
        height: t.fontSizeIcon,
        marginTop: -t.fontSizeIcon / 2,
        color: t.colorTextQuaternary,
        fontSize: t.fontSizeIcon,
        lineHeight: 1,
        textAlign: "center",
        pointerEvents: "none",
        display: "flex",
        alignItems: "center",
        [i]: {
          verticalAlign: "top",
          transition: `transform ${t.motionDurationSlow}`,
          "> svg": {
            verticalAlign: "top"
          },
          [`&:not(${e}-suffix)`]: {
            pointerEvents: "auto"
          }
        },
        [`${e}-disabled &`]: {
          cursor: "not-allowed"
        },
        "> *:not(:last-child)": {
          marginInlineEnd: 8
          // FIXME: magic
        }
      }),
      // ========================== Clear ==========================
      [`${e}-clear`]: {
        position: "absolute",
        top: "50%",
        insetInlineStart: "auto",
        insetInlineEnd: n,
        zIndex: 1,
        display: "inline-block",
        width: t.fontSizeIcon,
        height: t.fontSizeIcon,
        marginTop: -t.fontSizeIcon / 2,
        color: t.colorTextQuaternary,
        fontSize: t.fontSizeIcon,
        fontStyle: "normal",
        lineHeight: 1,
        textAlign: "center",
        textTransform: "none",
        background: t.colorBgContainer,
        cursor: "pointer",
        opacity: 0,
        transition: `color ${t.motionDurationMid} ease, opacity ${t.motionDurationSlow} ease`,
        textRendering: "auto",
        "&:before": {
          display: "block"
        },
        "&:hover": {
          color: t.colorTextTertiary
        }
      },
      "&:hover": {
        [`${e}-clear`]: {
          opacity: 1
        }
      }
    }),
    // ========================= Feedback ==========================
    [`${e}-has-feedback`]: {
      [`${e}-clear`]: {
        insetInlineEnd: n + t.fontSize + t.paddingXXS
      }
    }
  };
}, zU = (t) => {
  const {
    componentCls: e
  } = t;
  return [
    {
      [e]: {
        // ==================== BorderLess ====================
        [`&-borderless ${e}-selector`]: {
          backgroundColor: "transparent !important",
          borderColor: "transparent !important",
          boxShadow: "none !important"
        },
        // ==================== In Form ====================
        [`&${e}-in-form-item`]: {
          width: "100%"
        }
      }
    },
    // =====================================================
    // ==                       LTR                       ==
    // =====================================================
    // Base
    LU(t),
    // Single
    MU(t),
    // Multiple
    IU(t),
    // Dropdown
    _U(t),
    // =====================================================
    // ==                       RTL                       ==
    // =====================================================
    {
      [`${e}-rtl`]: {
        direction: "rtl"
      }
    },
    // =====================================================
    // ==                     Status                      ==
    // =====================================================
    e1(e, dn(t, {
      borderHoverColor: t.colorPrimaryHover,
      outlineColor: t.controlOutline
    })),
    e1(`${e}-status-error`, dn(t, {
      borderHoverColor: t.colorErrorHover,
      outlineColor: t.colorErrorOutline
    }), !0),
    e1(`${e}-status-warning`, dn(t, {
      borderHoverColor: t.colorWarningHover,
      outlineColor: t.colorWarningOutline
    }), !0),
    // =====================================================
    // ==             Space Compact                       ==
    // =====================================================
    mg(t, {
      borderElCls: `${e}-selector`,
      focusElCls: `${e}-focused`
    })
  ];
}, BU = Vn("Select", (t, e) => {
  let {
    rootPrefixCls: n
  } = e;
  const i = dn(t, {
    rootPrefixCls: n,
    inputPaddingHorizontalBase: t.paddingSM - 1
  });
  return [zU(i)];
}, (t) => ({
  zIndexPopup: t.zIndexPopupBase + 50
})), BC = () => k(k({}, ii(l3(), ["inputIcon", "mode", "getInputElement", "getRawInputElement", "backfill"])), {
  value: pn([Array, Object, String, Number]),
  defaultValue: pn([Array, Object, String, Number]),
  notFoundContent: ve.any,
  suffixIcon: ve.any,
  itemIcon: ve.any,
  size: yn(),
  mode: yn(),
  bordered: pt(!0),
  transitionName: String,
  choiceTransitionName: yn(""),
  popupClassName: String,
  /** @deprecated Please use `popupClassName` instead */
  dropdownClassName: String,
  placement: yn(),
  status: yn(),
  "onUpdate:value": ot()
}), $2 = "SECRET_COMBOBOX_MODE_DO_NOT_USE", Dt = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ASelect",
  Option: MC,
  OptGroup: AC,
  inheritAttrs: !1,
  props: Kn(BC(), {
    listHeight: 256,
    listItemHeight: 24
  }),
  SECRET_COMBOBOX_MODE_DO_NOT_USE: $2,
  slots: Object,
  setup(t, e) {
    let {
      attrs: n,
      emit: i,
      slots: o,
      expose: r
    } = e;
    const a = de(), l = jr(), s = Fr.useInject(), u = A(() => ad(s.status, t.status)), c = () => {
      var q;
      (q = a.value) === null || q === void 0 || q.focus();
    }, d = () => {
      var q;
      (q = a.value) === null || q === void 0 || q.blur();
    }, f = (q) => {
      var K;
      (K = a.value) === null || K === void 0 || K.scrollTo(q);
    }, h = A(() => {
      const {
        mode: q
      } = t;
      if (q !== "combobox")
        return q === $2 ? "combobox" : q;
    });
    process.env.NODE_ENV !== "production" && $n(!t.dropdownClassName, "Select", "`dropdownClassName` is deprecated. Please use `popupClassName` instead.");
    const {
      prefixCls: p,
      direction: g,
      renderEmpty: m,
      size: y,
      getPrefixCls: b,
      getPopupContainer: w,
      disabled: $,
      select: C
    } = Ht("select", t), {
      compactSize: P,
      compactItemClassnames: O
    } = sh(p, g), E = A(() => P.value || y.value), _ = qa(), D = A(() => {
      var q;
      return (q = $.value) !== null && q !== void 0 ? q : _.value;
    }), [M, N] = BU(p), L = A(() => b()), j = A(() => t.placement !== void 0 ? t.placement : g.value === "rtl" ? "bottomRight" : "bottomLeft"), B = A(() => Is(L.value, DX(j.value), t.transitionName)), Y = A(() => Ae({
      [`${p.value}-lg`]: E.value === "large",
      [`${p.value}-sm`]: E.value === "small",
      [`${p.value}-rtl`]: g.value === "rtl",
      [`${p.value}-borderless`]: !t.bordered,
      [`${p.value}-in-form-item`]: s.isFormItemInput
    }, Fa(p.value, u.value, s.hasFeedback), O.value, N.value)), Q = function() {
      for (var q = arguments.length, K = new Array(q), ee = 0; ee < q; ee++)
        K[ee] = arguments[ee];
      i("update:value", K[0]), i("change", ...K), l.onFieldChange();
    }, G = (q) => {
      i("blur", q), l.onFieldBlur();
    };
    r({
      blur: d,
      focus: c,
      scrollTo: f
    });
    const V = A(() => h.value === "multiple" || h.value === "tags"), H = A(() => t.showArrow !== void 0 ? t.showArrow : t.loading || !(V.value || h.value === "combobox"));
    return () => {
      var q, K, ee, ie;
      const {
        notFoundContent: ae,
        listHeight: te = 256,
        listItemHeight: U = 24,
        popupClassName: me,
        dropdownClassName: ce,
        virtual: ue,
        dropdownMatchSelectWidth: fe,
        id: he = l.id.value,
        placeholder: le = (q = o.placeholder) === null || q === void 0 ? void 0 : q.call(o),
        showArrow: ke
      } = t, {
        hasFeedback: ze,
        feedbackIcon: Re
      } = s;
      let Ye;
      ae !== void 0 ? Ye = ae : o.notFoundContent ? Ye = o.notFoundContent() : h.value === "combobox" ? Ye = null : Ye = m?.("Select") || v(pC, {
        componentName: "Select"
      }, null);
      const {
        suffixIcon: Ne,
        itemIcon: Fe,
        removeIcon: We,
        clearIcon: nt
      } = KG(k(k({}, t), {
        multiple: V.value,
        prefixCls: p.value,
        hasFeedback: ze,
        feedbackIcon: Re,
        showArrow: H.value
      }), o), Qe = ii(t, ["prefixCls", "suffixIcon", "itemIcon", "removeIcon", "clearIcon", "size", "bordered", "status"]), Pe = Ae(me || ce, {
        [`${p.value}-dropdown-${g.value}`]: g.value === "rtl"
      }, N.value);
      return M(v(eG, J(J(J({
        ref: a,
        virtual: ue,
        dropdownMatchSelectWidth: fe
      }, Qe), n), {}, {
        showSearch: (K = t.showSearch) !== null && K !== void 0 ? K : (ee = C?.value) === null || ee === void 0 ? void 0 : ee.showSearch,
        placeholder: le,
        listHeight: te,
        listItemHeight: U,
        mode: h.value,
        prefixCls: p.value,
        direction: g.value,
        inputIcon: Ne,
        menuItemSelectedIcon: Fe,
        removeIcon: We,
        clearIcon: nt,
        notFoundContent: Ye,
        class: [Y.value, n.class],
        getPopupContainer: w?.value,
        dropdownClassName: Pe,
        onChange: Q,
        onBlur: G,
        id: he,
        dropdownRender: Qe.dropdownRender || o.dropdownRender,
        transitionName: B.value,
        children: (ie = o.default) === null || ie === void 0 ? void 0 : ie.call(o),
        tagRender: t.tagRender || o.tagRender,
        optionLabelRender: o.optionLabel,
        maxTagPlaceholder: t.maxTagPlaceholder || o.maxTagPlaceholder,
        showArrow: ze || ke,
        disabled: D.value
      }), {
        option: o.option
      }));
    };
  }
});
Dt.install = function(t) {
  return t.component(Dt.name, Dt), t.component(Dt.Option.displayName, Dt.Option), t.component(Dt.OptGroup.displayName, Dt.OptGroup), t;
};
const FU = Dt.Option;
Dt.OptGroup;
var VU = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z" } }, { tag: "path", attrs: { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }] }, name: "check-circle", theme: "outlined" };
function k2(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(n);
    typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(n).filter(function(o) {
      return Object.getOwnPropertyDescriptor(n, o).enumerable;
    }))), i.forEach(function(o) {
      QU(t, o, n[o]);
    });
  }
  return t;
}
function QU(t, e, n) {
  return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
var FC = function(e, n) {
  var i = k2({}, e, n.attrs);
  return v(bn, k2({}, i, {
    icon: VU
  }), null);
};
FC.displayName = "CheckCircleOutlined";
FC.inheritAttrs = !1;
var HU = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }, { tag: "path", attrs: { d: "M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z" } }] }, name: "exclamation-circle", theme: "outlined" };
function T2(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(n);
    typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(n).filter(function(o) {
      return Object.getOwnPropertyDescriptor(n, o).enumerable;
    }))), i.forEach(function(o) {
      WU(t, o, n[o]);
    });
  }
  return t;
}
function WU(t, e, n) {
  return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
var VC = function(e, n) {
  var i = T2({}, e, n.attrs);
  return v(bn, T2({}, i, {
    icon: HU
  }), null);
};
VC.displayName = "ExclamationCircleOutlined";
VC.inheritAttrs = !1;
var jU = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }, { tag: "path", attrs: { d: "M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z" } }] }, name: "info-circle", theme: "outlined" };
function P2(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(n);
    typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(n).filter(function(o) {
      return Object.getOwnPropertyDescriptor(n, o).enumerable;
    }))), i.forEach(function(o) {
      qU(t, o, n[o]);
    });
  }
  return t;
}
function qU(t, e, n) {
  return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
var QC = function(e, n) {
  var i = P2({}, e, n.attrs);
  return v(bn, P2({}, i, {
    icon: jU
  }), null);
};
QC.displayName = "InfoCircleOutlined";
QC.inheritAttrs = !1;
var YU = { icon: { tag: "svg", attrs: { "fill-rule": "evenodd", viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm0 76c-205.4 0-372 166.6-372 372s166.6 372 372 372 372-166.6 372-372-166.6-372-372-372zm128.01 198.83c.03 0 .05.01.09.06l45.02 45.01a.2.2 0 01.05.09.12.12 0 010 .07c0 .02-.01.04-.05.08L557.25 512l127.87 127.86a.27.27 0 01.05.06v.02a.12.12 0 010 .07c0 .03-.01.05-.05.09l-45.02 45.02a.2.2 0 01-.09.05.12.12 0 01-.07 0c-.02 0-.04-.01-.08-.05L512 557.25 384.14 685.12c-.04.04-.06.05-.08.05a.12.12 0 01-.07 0c-.03 0-.05-.01-.09-.05l-45.02-45.02a.2.2 0 01-.05-.09.12.12 0 010-.07c0-.02.01-.04.06-.08L466.75 512 338.88 384.14a.27.27 0 01-.05-.06l-.01-.02a.12.12 0 010-.07c0-.03.01-.05.05-.09l45.02-45.02a.2.2 0 01.09-.05.12.12 0 01.07 0c.02 0 .04.01.08.06L512 466.75l127.86-127.86c.04-.05.06-.06.08-.06a.12.12 0 01.07 0z" } }] }, name: "close-circle", theme: "outlined" };
function E2(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(n);
    typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(n).filter(function(o) {
      return Object.getOwnPropertyDescriptor(n, o).enumerable;
    }))), i.forEach(function(o) {
      KU(t, o, n[o]);
    });
  }
  return t;
}
function KU(t, e, n) {
  return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
var HC = function(e, n) {
  var i = E2({}, e, n.attrs);
  return v(bn, E2({}, i, {
    icon: YU
  }), null);
};
HC.displayName = "CloseCircleOutlined";
HC.inheritAttrs = !1;
var XU = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z" } }] }, name: "check-circle", theme: "filled" };
function _2(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(n);
    typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(n).filter(function(o) {
      return Object.getOwnPropertyDescriptor(n, o).enumerable;
    }))), i.forEach(function(o) {
      ZU(t, o, n[o]);
    });
  }
  return t;
}
function ZU(t, e, n) {
  return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
var Vu = function(e, n) {
  var i = _2({}, e, n.attrs);
  return v(bn, _2({}, i, {
    icon: XU
  }), null);
};
Vu.displayName = "CheckCircleFilled";
Vu.inheritAttrs = !1;
var GU = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" } }] }, name: "exclamation-circle", theme: "filled" };
function I2(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(n);
    typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(n).filter(function(o) {
      return Object.getOwnPropertyDescriptor(n, o).enumerable;
    }))), i.forEach(function(o) {
      UU(t, o, n[o]);
    });
  }
  return t;
}
function UU(t, e, n) {
  return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
var Qu = function(e, n) {
  var i = I2({}, e, n.attrs);
  return v(bn, I2({}, i, {
    icon: GU
  }), null);
};
Qu.displayName = "ExclamationCircleFilled";
Qu.inheritAttrs = !1;
var JU = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" } }] }, name: "info-circle", theme: "filled" };
function M2(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(n);
    typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(n).filter(function(o) {
      return Object.getOwnPropertyDescriptor(n, o).enumerable;
    }))), i.forEach(function(o) {
      eJ(t, o, n[o]);
    });
  }
  return t;
}
function eJ(t, e, n) {
  return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
var ld = function(e, n) {
  var i = M2({}, e, n.attrs);
  return v(bn, M2({}, i, {
    icon: JU
  }), null);
};
ld.displayName = "InfoCircleFilled";
ld.inheritAttrs = !1;
const cm = ["xxxl", "xxl", "xl", "lg", "md", "sm", "xs"], tJ = (t) => ({
  xs: `(max-width: ${t.screenXSMax}px)`,
  sm: `(min-width: ${t.screenSM}px)`,
  md: `(min-width: ${t.screenMD}px)`,
  lg: `(min-width: ${t.screenLG}px)`,
  xl: `(min-width: ${t.screenXL}px)`,
  xxl: `(min-width: ${t.screenXXL}px)`,
  xxxl: `{min-width: ${t.screenXXXL}px}`
});
function y3() {
  const [, t] = lh();
  return A(() => {
    const e = tJ(t.value), n = /* @__PURE__ */ new Map();
    let i = -1, o = {};
    return {
      matchHandlers: {},
      dispatch(r) {
        return o = r, n.forEach((a) => a(o)), n.size >= 1;
      },
      subscribe(r) {
        return n.size || this.register(), i += 1, n.set(i, r), r(o), i;
      },
      unsubscribe(r) {
        n.delete(r), n.size || this.unregister();
      },
      unregister() {
        Object.keys(e).forEach((r) => {
          const a = e[r], l = this.matchHandlers[a];
          l?.mql.removeListener(l?.listener);
        }), n.clear();
      },
      register() {
        Object.keys(e).forEach((r) => {
          const a = e[r], l = (u) => {
            let {
              matches: c
            } = u;
            this.dispatch(k(k({}, o), {
              [r]: c
            }));
          }, s = window.matchMedia(a);
          s.addListener(l), this.matchHandlers[a] = {
            mql: s,
            listener: l
          }, l(s);
        });
      },
      responsiveMap: e
    };
  });
}
function b3() {
  const t = Te({});
  let e = null;
  const n = y3();
  return Lt(() => {
    e = n.value.subscribe((i) => {
      t.value = i;
    });
  }), wo(() => {
    n.value.unsubscribe(e);
  }), t;
}
function Pa(t) {
  const e = Te();
  return zt(() => {
    e.value = t();
  }, {
    flush: "sync"
    // needed so updates are immediate.
  }), e;
}
const Xr = {
  adjustX: 1,
  adjustY: 1
}, Zr = [0, 0], x3 = {
  left: {
    points: ["cr", "cl"],
    overflow: Xr,
    offset: [-4, 0],
    targetOffset: Zr
  },
  right: {
    points: ["cl", "cr"],
    overflow: Xr,
    offset: [4, 0],
    targetOffset: Zr
  },
  top: {
    points: ["bc", "tc"],
    overflow: Xr,
    offset: [0, -4],
    targetOffset: Zr
  },
  bottom: {
    points: ["tc", "bc"],
    overflow: Xr,
    offset: [0, 4],
    targetOffset: Zr
  },
  topLeft: {
    points: ["bl", "tl"],
    overflow: Xr,
    offset: [0, -4],
    targetOffset: Zr
  },
  leftTop: {
    points: ["tr", "tl"],
    overflow: Xr,
    offset: [-4, 0],
    targetOffset: Zr
  },
  topRight: {
    points: ["br", "tr"],
    overflow: Xr,
    offset: [0, -4],
    targetOffset: Zr
  },
  rightTop: {
    points: ["tl", "tr"],
    overflow: Xr,
    offset: [4, 0],
    targetOffset: Zr
  },
  bottomRight: {
    points: ["tr", "br"],
    overflow: Xr,
    offset: [0, 4],
    targetOffset: Zr
  },
  rightBottom: {
    points: ["bl", "br"],
    overflow: Xr,
    offset: [4, 0],
    targetOffset: Zr
  },
  bottomLeft: {
    points: ["tl", "bl"],
    overflow: Xr,
    offset: [0, 4],
    targetOffset: Zr
  },
  leftBottom: {
    points: ["br", "bl"],
    overflow: Xr,
    offset: [-4, 0],
    targetOffset: Zr
  }
}, nJ = {
  prefixCls: String,
  id: String,
  overlayInnerStyle: ve.any
}, iJ = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "TooltipContent",
  props: nJ,
  setup(t, e) {
    let {
      slots: n
    } = e;
    return () => {
      var i;
      return v("div", {
        class: `${t.prefixCls}-inner`,
        id: t.id,
        role: "tooltip",
        style: t.overlayInnerStyle
      }, [(i = n.overlay) === null || i === void 0 ? void 0 : i.call(n)]);
    };
  }
});
var oJ = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
function A2() {
}
const rJ = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "Tooltip",
  inheritAttrs: !1,
  props: {
    trigger: ve.any.def(["hover"]),
    defaultVisible: {
      type: Boolean,
      default: void 0
    },
    visible: {
      type: Boolean,
      default: void 0
    },
    placement: ve.string.def("right"),
    transitionName: String,
    animation: ve.any,
    afterVisibleChange: ve.func.def(() => {
    }),
    overlayStyle: {
      type: Object,
      default: void 0
    },
    overlayClassName: String,
    prefixCls: ve.string.def("rc-tooltip"),
    mouseEnterDelay: ve.number.def(0.1),
    mouseLeaveDelay: ve.number.def(0.1),
    getPopupContainer: Function,
    destroyTooltipOnHide: {
      type: Boolean,
      default: !1
    },
    align: ve.object.def(() => ({})),
    arrowContent: ve.any.def(null),
    tipId: String,
    builtinPlacements: ve.object,
    overlayInnerStyle: {
      type: Object,
      default: void 0
    },
    popupVisible: {
      type: Boolean,
      default: void 0
    },
    onVisibleChange: Function,
    onPopupAlign: Function,
    arrow: {
      type: Boolean,
      default: !0
    }
  },
  setup(t, e) {
    let {
      slots: n,
      attrs: i,
      expose: o
    } = e;
    const r = Te(), a = () => {
      const {
        prefixCls: c,
        tipId: d,
        overlayInnerStyle: f
      } = t;
      return [t.arrow ? v("div", {
        class: `${c}-arrow`,
        key: "arrow"
      }, [ca(n, t, "arrowContent")]) : null, v(iJ, {
        key: "content",
        prefixCls: c,
        id: d,
        overlayInnerStyle: f
      }, {
        overlay: n.overlay
      })];
    };
    o({
      getPopupDomNode: () => r.value.getPopupDomNode(),
      triggerDOM: r,
      forcePopupAlign: () => {
        var c;
        return (c = r.value) === null || c === void 0 ? void 0 : c.forcePopupAlign();
      }
    });
    const s = Te(!1), u = Te(!1);
    return zt(() => {
      const {
        destroyTooltipOnHide: c
      } = t;
      if (typeof c == "boolean")
        s.value = c;
      else if (c && typeof c == "object") {
        const {
          keepParent: d
        } = c;
        s.value = d === !0, u.value = d === !1;
      }
    }), () => {
      const {
        overlayClassName: c,
        trigger: d,
        mouseEnterDelay: f,
        mouseLeaveDelay: h,
        overlayStyle: p,
        prefixCls: g,
        afterVisibleChange: m,
        transitionName: y,
        animation: b,
        placement: w,
        align: $,
        destroyTooltipOnHide: C,
        defaultVisible: P
      } = t, O = oJ(t, ["overlayClassName", "trigger", "mouseEnterDelay", "mouseLeaveDelay", "overlayStyle", "prefixCls", "afterVisibleChange", "transitionName", "animation", "placement", "align", "destroyTooltipOnHide", "defaultVisible"]), E = k({}, O);
      t.visible !== void 0 && (E.popupVisible = t.visible);
      const _ = k(k(k({
        popupClassName: c,
        prefixCls: g,
        action: d,
        builtinPlacements: x3,
        popupPlacement: w,
        popupAlign: $,
        afterPopupVisibleChange: m,
        popupTransitionName: y,
        popupAnimation: b,
        defaultPopupVisible: P,
        destroyPopupOnHide: s.value,
        autoDestroy: u.value,
        mouseLeaveDelay: h,
        popupStyle: p,
        mouseEnterDelay: f
      }, E), i), {
        onPopupVisibleChange: t.onVisibleChange || A2,
        onPopupAlign: t.onPopupAlign || A2,
        ref: r,
        arrow: !!t.arrow,
        popup: a()
      });
      return v(dg, _, {
        default: n.default
      });
    };
  }
}), O3 = (() => ({
  trigger: [String, Array],
  open: {
    type: Boolean,
    default: void 0
  },
  /** @deprecated Please use `open` instead. */
  visible: {
    type: Boolean,
    default: void 0
  },
  placement: String,
  color: String,
  transitionName: String,
  overlayStyle: Vt(),
  overlayInnerStyle: Vt(),
  overlayClassName: String,
  openClassName: String,
  prefixCls: String,
  mouseEnterDelay: Number,
  mouseLeaveDelay: Number,
  getPopupContainer: Function,
  /**@deprecated Please use `arrow={{ pointAtCenter: true }}` instead. */
  arrowPointAtCenter: {
    type: Boolean,
    default: void 0
  },
  arrow: {
    type: [Boolean, Object],
    default: !0
  },
  autoAdjustOverflow: {
    type: [Boolean, Object],
    default: void 0
  },
  destroyTooltipOnHide: {
    type: Boolean,
    default: void 0
  },
  align: Vt(),
  builtinPlacements: Vt(),
  children: Array,
  /** @deprecated Please use `onOpenChange` instead. */
  onVisibleChange: Function,
  /** @deprecated Please use `onUpdate:open` instead. */
  "onUpdate:visible": Function,
  onOpenChange: Function,
  "onUpdate:open": Function
})), aJ = {
  adjustX: 1,
  adjustY: 1
}, R2 = {
  adjustX: 0,
  adjustY: 0
}, lJ = [0, 0];
function D2(t) {
  return typeof t == "boolean" ? t ? aJ : R2 : k(k({}, R2), t);
}
function S3(t) {
  const {
    arrowWidth: e = 4,
    horizontalArrowShift: n = 16,
    verticalArrowShift: i = 8,
    autoAdjustOverflow: o,
    arrowPointAtCenter: r
  } = t, a = {
    left: {
      points: ["cr", "cl"],
      offset: [-4, 0]
    },
    right: {
      points: ["cl", "cr"],
      offset: [4, 0]
    },
    top: {
      points: ["bc", "tc"],
      offset: [0, -4]
    },
    bottom: {
      points: ["tc", "bc"],
      offset: [0, 4]
    },
    topLeft: {
      points: ["bl", "tc"],
      offset: [-(n + e), -4]
    },
    leftTop: {
      points: ["tr", "cl"],
      offset: [-4, -(i + e)]
    },
    topRight: {
      points: ["br", "tc"],
      offset: [n + e, -4]
    },
    rightTop: {
      points: ["tl", "cr"],
      offset: [4, -(i + e)]
    },
    bottomRight: {
      points: ["tr", "bc"],
      offset: [n + e, 4]
    },
    rightBottom: {
      points: ["bl", "cr"],
      offset: [4, i + e]
    },
    bottomLeft: {
      points: ["tl", "bc"],
      offset: [-(n + e), 4]
    },
    leftBottom: {
      points: ["br", "cl"],
      offset: [-4, i + e]
    }
  };
  return Object.keys(a).forEach((l) => {
    a[l] = r ? k(k({}, a[l]), {
      overflow: D2(o),
      targetOffset: lJ
    }) : k(k({}, x3[l]), {
      overflow: D2(o)
    }), a[l].ignoreShake = !0;
  }), a;
}
function Zv() {
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
  for (let e = 0, n = t.length; e < n; e++)
    if (t[e] !== void 0)
      return t[e];
}
const sJ = Lp.map((t) => `${t}-inverse`), uJ = ["success", "processing", "error", "default", "warning"];
function w3(t) {
  return (arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0) ? [...sJ, ...Lp].includes(t) : Lp.includes(t);
}
function cJ(t) {
  return uJ.includes(t);
}
function dJ(t, e) {
  const n = w3(e), i = Ae({
    [`${t}-${e}`]: e && n
  }), o = {}, r = {};
  return e && !n && (o.background = e, r["--antd-arrow-background-color"] = e), {
    className: i,
    overlayStyle: o,
    arrowStyle: r
  };
}
function dm(t) {
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
  return t.map((n) => `${e}${n}`).join(",");
}
const C3 = 8;
function $3(t) {
  const e = C3, {
    sizePopupArrow: n,
    contentRadius: i,
    borderRadiusOuter: o,
    limitVerticalRadius: r
  } = t, a = n / 2 - Math.ceil(o * (Math.sqrt(2) - 1)), l = (i > 12 ? i + 2 : 12) - a, s = r ? e - a : l;
  return {
    dropdownArrowOffset: l,
    dropdownArrowOffsetVertical: s
  };
}
function k3(t, e) {
  const {
    componentCls: n,
    sizePopupArrow: i,
    marginXXS: o,
    borderRadiusXS: r,
    borderRadiusOuter: a,
    boxShadowPopoverArrow: l
  } = t, {
    colorBg: s,
    showArrowCls: u,
    contentRadius: c = t.borderRadiusLG,
    limitVerticalRadius: d
  } = e, {
    dropdownArrowOffsetVertical: f,
    dropdownArrowOffset: h
  } = $3({
    sizePopupArrow: i,
    contentRadius: c,
    borderRadiusOuter: a,
    limitVerticalRadius: d
  }), p = i / 2 + o;
  return {
    [n]: {
      // ============================ Basic ============================
      [`${n}-arrow`]: [k(k({
        position: "absolute",
        zIndex: 1,
        display: "block"
      }, cC(i, r, a, s, l)), {
        "&:before": {
          background: s
        }
      })],
      // ========================== Placement ==========================
      // Here handle the arrow position and rotate stuff
      // >>>>> Top
      [[`&-placement-top ${n}-arrow`, `&-placement-topLeft ${n}-arrow`, `&-placement-topRight ${n}-arrow`].join(",")]: {
        bottom: 0,
        transform: "translateY(100%) rotate(180deg)"
      },
      [`&-placement-top ${n}-arrow`]: {
        left: {
          _skip_check_: !0,
          value: "50%"
        },
        transform: "translateX(-50%) translateY(100%) rotate(180deg)"
      },
      [`&-placement-topLeft ${n}-arrow`]: {
        left: {
          _skip_check_: !0,
          value: h
        }
      },
      [`&-placement-topRight ${n}-arrow`]: {
        right: {
          _skip_check_: !0,
          value: h
        }
      },
      // >>>>> Bottom
      [[`&-placement-bottom ${n}-arrow`, `&-placement-bottomLeft ${n}-arrow`, `&-placement-bottomRight ${n}-arrow`].join(",")]: {
        top: 0,
        transform: "translateY(-100%)"
      },
      [`&-placement-bottom ${n}-arrow`]: {
        left: {
          _skip_check_: !0,
          value: "50%"
        },
        transform: "translateX(-50%) translateY(-100%)"
      },
      [`&-placement-bottomLeft ${n}-arrow`]: {
        left: {
          _skip_check_: !0,
          value: h
        }
      },
      [`&-placement-bottomRight ${n}-arrow`]: {
        right: {
          _skip_check_: !0,
          value: h
        }
      },
      // >>>>> Left
      [[`&-placement-left ${n}-arrow`, `&-placement-leftTop ${n}-arrow`, `&-placement-leftBottom ${n}-arrow`].join(",")]: {
        right: {
          _skip_check_: !0,
          value: 0
        },
        transform: "translateX(100%) rotate(90deg)"
      },
      [`&-placement-left ${n}-arrow`]: {
        top: {
          _skip_check_: !0,
          value: "50%"
        },
        transform: "translateY(-50%) translateX(100%) rotate(90deg)"
      },
      [`&-placement-leftTop ${n}-arrow`]: {
        top: f
      },
      [`&-placement-leftBottom ${n}-arrow`]: {
        bottom: f
      },
      // >>>>> Right
      [[`&-placement-right ${n}-arrow`, `&-placement-rightTop ${n}-arrow`, `&-placement-rightBottom ${n}-arrow`].join(",")]: {
        left: {
          _skip_check_: !0,
          value: 0
        },
        transform: "translateX(-100%) rotate(-90deg)"
      },
      [`&-placement-right ${n}-arrow`]: {
        top: {
          _skip_check_: !0,
          value: "50%"
        },
        transform: "translateY(-50%) translateX(-100%) rotate(-90deg)"
      },
      [`&-placement-rightTop ${n}-arrow`]: {
        top: f
      },
      [`&-placement-rightBottom ${n}-arrow`]: {
        bottom: f
      },
      // =========================== Offset ============================
      // Offset the popover to account for the dropdown arrow
      // >>>>> Top
      [dm(["&-placement-topLeft", "&-placement-top", "&-placement-topRight"].map((g) => g += ":not(&-arrow-hidden)"), u)]: {
        paddingBottom: p
      },
      // >>>>> Bottom
      [dm(["&-placement-bottomLeft", "&-placement-bottom", "&-placement-bottomRight"].map((g) => g += ":not(&-arrow-hidden)"), u)]: {
        paddingTop: p
      },
      // >>>>> Left
      [dm(["&-placement-leftTop", "&-placement-left", "&-placement-leftBottom"].map((g) => g += ":not(&-arrow-hidden)"), u)]: {
        paddingRight: {
          _skip_check_: !0,
          value: p
        }
      },
      // >>>>> Right
      [dm(["&-placement-rightTop", "&-placement-right", "&-placement-rightBottom"].map((g) => g += ":not(&-arrow-hidden)"), u)]: {
        paddingLeft: {
          _skip_check_: !0,
          value: p
        }
      }
    }
  };
}
const fJ = (t) => {
  const {
    componentCls: e,
    // ant-tooltip
    tooltipMaxWidth: n,
    tooltipColor: i,
    tooltipBg: o,
    tooltipBorderRadius: r,
    zIndexPopup: a,
    controlHeight: l,
    boxShadowSecondary: s,
    paddingSM: u,
    paddingXS: c,
    tooltipRadiusOuter: d
  } = t;
  return [
    {
      [e]: k(k(k(k({}, kn(t)), {
        position: "absolute",
        zIndex: a,
        display: "block",
        "&": [{
          width: "max-content"
        }, {
          width: "intrinsic"
        }],
        maxWidth: n,
        visibility: "visible",
        "&-hidden": {
          display: "none"
        },
        "--antd-arrow-background-color": o,
        // Wrapper for the tooltip content
        [`${e}-inner`]: {
          minWidth: l,
          minHeight: l,
          padding: `${u / 2}px ${c}px`,
          color: i,
          textAlign: "start",
          textDecoration: "none",
          wordWrap: "break-word",
          backgroundColor: o,
          borderRadius: r,
          boxShadow: s
        },
        // Limit left and right placement radius
        [["&-placement-left", "&-placement-leftTop", "&-placement-leftBottom", "&-placement-right", "&-placement-rightTop", "&-placement-rightBottom"].join(",")]: {
          [`${e}-inner`]: {
            borderRadius: Math.min(r, C3)
          }
        },
        [`${e}-content`]: {
          position: "relative"
        }
      }), vN(t, (f, h) => {
        let {
          darkColor: p
        } = h;
        return {
          [`&${e}-${f}`]: {
            [`${e}-inner`]: {
              backgroundColor: p
            },
            [`${e}-arrow`]: {
              "--antd-arrow-background-color": p
            }
          }
        };
      })), {
        // RTL
        "&-rtl": {
          direction: "rtl"
        }
      })
    },
    // Arrow Style
    k3(dn(t, {
      borderRadiusOuter: d
    }), {
      colorBg: "var(--antd-arrow-background-color)",
      showArrowCls: "",
      contentRadius: r,
      limitVerticalRadius: !0
    }),
    // Pure Render
    {
      [`${e}-pure`]: {
        position: "relative",
        maxWidth: "none"
      }
    }
  ];
}, hJ = ((t, e) => Vn("Tooltip", (i) => {
  if (e?.value === !1)
    return [];
  const {
    borderRadius: o,
    colorTextLightSolid: r,
    colorBgDefault: a,
    borderRadiusOuter: l
  } = i, s = dn(i, {
    // default variables
    tooltipMaxWidth: 250,
    tooltipColor: r,
    tooltipBorderRadius: o,
    tooltipBg: a,
    tooltipRadiusOuter: l > 4 ? 4 : l
  });
  return [fJ(s), gg(i, "zoom-big-fast")];
}, (i) => {
  let {
    zIndexPopupBase: o,
    colorBgSpotlight: r
  } = i;
  return {
    zIndexPopup: o + 70,
    colorBgDefault: r
  };
})(t)), pJ = (t, e) => {
  const n = {}, i = k({}, t);
  return e.forEach((o) => {
    t && o in t && (n[o] = t[o], delete i[o]);
  }), {
    picked: n,
    omitted: i
  };
}, T3 = () => k(k({}, O3()), {
  title: ve.any
}), gJ = () => ({
  trigger: "hover",
  align: {},
  placement: "top",
  mouseEnterDelay: 0.1,
  mouseLeaveDelay: 0.1,
  arrowPointAtCenter: !1,
  autoAdjustOverflow: !0
}), mJ = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ATooltip",
  inheritAttrs: !1,
  props: Kn(T3(), {
    trigger: "hover",
    align: {},
    placement: "top",
    mouseEnterDelay: 0.1,
    mouseLeaveDelay: 0.1,
    arrowPointAtCenter: !1,
    autoAdjustOverflow: !0
  }),
  slots: Object,
  // emits: ['update:visible', 'visibleChange'],
  setup(t, e) {
    let {
      slots: n,
      emit: i,
      attrs: o,
      expose: r
    } = e;
    process.env.NODE_ENV !== "production" && [["visible", "open"], ["onVisibleChange", "onOpenChange"]].forEach((D) => {
      let [M, N] = D;
      eo(t[M] === void 0, "Tooltip", `\`${M}\` is deprecated, please use \`${N}\` instead.`);
    });
    const {
      prefixCls: a,
      getPopupContainer: l,
      direction: s,
      rootPrefixCls: u
    } = Ht("tooltip", t), c = A(() => {
      var D;
      return (D = t.open) !== null && D !== void 0 ? D : t.visible;
    }), d = de(Zv([t.open, t.visible])), f = de();
    let h;
    _e(c, (D) => {
      Gt.cancel(h), h = Gt(() => {
        d.value = !!D;
      });
    });
    const p = () => {
      var D;
      const M = (D = t.title) !== null && D !== void 0 ? D : n.title;
      return !M && M !== 0;
    }, g = (D) => {
      const M = p();
      c.value === void 0 && (d.value = M ? !1 : D), M || (i("update:visible", D), i("visibleChange", D), i("update:open", D), i("openChange", D));
    };
    r({
      getPopupDomNode: () => f.value.getPopupDomNode(),
      open: d,
      forcePopupAlign: () => {
        var D;
        return (D = f.value) === null || D === void 0 ? void 0 : D.forcePopupAlign();
      }
    });
    const y = A(() => {
      var D;
      const {
        builtinPlacements: M,
        autoAdjustOverflow: N,
        arrow: L,
        arrowPointAtCenter: j
      } = t;
      let B = j;
      return typeof L == "object" && (B = (D = L.pointAtCenter) !== null && D !== void 0 ? D : j), M || S3({
        arrowPointAtCenter: B,
        autoAdjustOverflow: N
      });
    }), b = (D) => D || D === "", w = (D) => {
      const M = D.type;
      if (typeof M == "object" && D.props && ((M.__ANT_BUTTON === !0 || M === "button") && b(D.props.disabled) || M.__ANT_SWITCH === !0 && (b(D.props.disabled) || b(D.props.loading)) || M.__ANT_RADIO === !0 && b(D.props.disabled))) {
        const {
          picked: N,
          omitted: L
        } = pJ($q(D), ["position", "left", "right", "top", "bottom", "float", "display", "zIndex"]), j = k(k({
          display: "inline-block"
        }, N), {
          cursor: "not-allowed",
          lineHeight: 1,
          width: D.props && D.props.block ? "100%" : void 0
        }), B = k(k({}, L), {
          pointerEvents: "none"
        }), Y = vi(D, {
          style: B
        }, !0);
        return v("span", {
          style: j,
          class: `${a.value}-disabled-compatible-wrapper`
        }, [Y]);
      }
      return D;
    }, $ = () => {
      var D, M;
      return (D = t.title) !== null && D !== void 0 ? D : (M = n.title) === null || M === void 0 ? void 0 : M.call(n);
    }, C = (D, M) => {
      const N = y.value, L = Object.keys(N).find((j) => {
        var B, Y;
        return N[j].points[0] === ((B = M.points) === null || B === void 0 ? void 0 : B[0]) && N[j].points[1] === ((Y = M.points) === null || Y === void 0 ? void 0 : Y[1]);
      });
      if (L) {
        const j = D.getBoundingClientRect(), B = {
          top: "50%",
          left: "50%"
        };
        L.indexOf("top") >= 0 || L.indexOf("Bottom") >= 0 ? B.top = `${j.height - M.offset[1]}px` : (L.indexOf("Top") >= 0 || L.indexOf("bottom") >= 0) && (B.top = `${-M.offset[1]}px`), L.indexOf("left") >= 0 || L.indexOf("Right") >= 0 ? B.left = `${j.width - M.offset[0]}px` : (L.indexOf("right") >= 0 || L.indexOf("Left") >= 0) && (B.left = `${-M.offset[0]}px`), D.style.transformOrigin = `${B.left} ${B.top}`;
      }
    }, P = A(() => dJ(a.value, t.color)), O = A(() => o["data-popover-inject"]), [E, _] = hJ(a, A(() => !O.value));
    return () => {
      var D, M;
      const {
        openClassName: N,
        overlayClassName: L,
        overlayStyle: j,
        overlayInnerStyle: B
      } = t;
      let Y = (M = ho((D = n.default) === null || D === void 0 ? void 0 : D.call(n))) !== null && M !== void 0 ? M : null;
      Y = Y.length === 1 ? Y[0] : Y;
      let Q = d.value;
      if (c.value === void 0 && p() && (Q = !1), !Y)
        return null;
      const G = w(po(Y) && !kq(Y) ? Y : v("span", null, [Y])), V = Ae({
        [N || `${a.value}-open`]: !0,
        [G.props && G.props.class]: G.props && G.props.class
      }), H = Ae(L, {
        [`${a.value}-rtl`]: s.value === "rtl"
      }, P.value.className, _.value), q = k(k({}, P.value.overlayStyle), B), K = P.value.arrowStyle, ee = k(k(k({}, o), t), {
        prefixCls: a.value,
        arrow: !!t.arrow,
        getPopupContainer: l?.value,
        builtinPlacements: y.value,
        visible: Q,
        ref: f,
        overlayClassName: H,
        overlayStyle: k(k({}, K), j),
        overlayInnerStyle: q,
        onVisibleChange: g,
        onPopupAlign: C,
        transitionName: Is(u.value, "zoom-big-fast", t.transitionName)
      });
      return E(v(rJ, ee, {
        default: () => [d.value ? vi(G, {
          class: V
        }) : G],
        arrowContent: () => v("span", {
          class: `${a.value}-arrow-content`
        }, null),
        overlay: $
      }));
    };
  }
}), zi = ya(mJ), vJ = (t) => {
  const {
    componentCls: e,
    popoverBg: n,
    popoverColor: i,
    width: o,
    fontWeightStrong: r,
    popoverPadding: a,
    boxShadowSecondary: l,
    colorTextHeading: s,
    borderRadiusLG: u,
    zIndexPopup: c,
    marginXS: d,
    colorBgElevated: f
  } = t;
  return [
    {
      [e]: k(k({}, kn(t)), {
        position: "absolute",
        top: 0,
        // use `left` to fix https://github.com/ant-design/ant-design/issues/39195
        left: {
          _skip_check_: !0,
          value: 0
        },
        zIndex: c,
        fontWeight: "normal",
        whiteSpace: "normal",
        textAlign: "start",
        cursor: "auto",
        userSelect: "text",
        "--antd-arrow-background-color": f,
        "&-rtl": {
          direction: "rtl"
        },
        "&-hidden": {
          display: "none"
        },
        [`${e}-content`]: {
          position: "relative"
        },
        [`${e}-inner`]: {
          backgroundColor: n,
          backgroundClip: "padding-box",
          borderRadius: u,
          boxShadow: l,
          padding: a
        },
        [`${e}-title`]: {
          minWidth: o,
          marginBottom: d,
          color: s,
          fontWeight: r
        },
        [`${e}-inner-content`]: {
          color: i
        }
      })
    },
    // Arrow Style
    k3(t, {
      colorBg: "var(--antd-arrow-background-color)"
    }),
    // Pure Render
    {
      [`${e}-pure`]: {
        position: "relative",
        maxWidth: "none",
        [`${e}-content`]: {
          display: "inline-block"
        }
      }
    }
  ];
}, yJ = (t) => {
  const {
    componentCls: e
  } = t;
  return {
    [e]: Lp.map((n) => {
      const i = t[`${n}-6`];
      return {
        [`&${e}-${n}`]: {
          "--antd-arrow-background-color": i,
          [`${e}-inner`]: {
            backgroundColor: i
          },
          [`${e}-arrow`]: {
            background: "transparent"
          }
        }
      };
    })
  };
}, bJ = (t) => {
  const {
    componentCls: e,
    lineWidth: n,
    lineType: i,
    colorSplit: o,
    paddingSM: r,
    controlHeight: a,
    fontSize: l,
    lineHeight: s,
    padding: u
  } = t, c = a - Math.round(l * s), d = c / 2, f = c / 2 - n, h = u;
  return {
    [e]: {
      [`${e}-inner`]: {
        padding: 0
      },
      [`${e}-title`]: {
        margin: 0,
        padding: `${d}px ${h}px ${f}px`,
        borderBottom: `${n}px ${i} ${o}`
      },
      [`${e}-inner-content`]: {
        padding: `${r}px ${h}px`
      }
    }
  };
}, xJ = Vn("Popover", (t) => {
  const {
    colorBgElevated: e,
    colorText: n,
    wireframe: i
  } = t, o = dn(t, {
    popoverBg: e,
    popoverColor: n,
    popoverPadding: 12
    // Fixed Value
  });
  return [vJ(o), yJ(o), i && bJ(o), gg(o, "zoom-big")];
}, (t) => {
  let {
    zIndexPopupBase: e
  } = t;
  return {
    zIndexPopup: e + 30,
    width: 177
  };
}), OJ = () => k(k({}, O3()), {
  content: Mr(),
  title: Mr()
}), SJ = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "APopover",
  inheritAttrs: !1,
  props: Kn(OJ(), k(k({}, gJ()), {
    trigger: "hover",
    placement: "top",
    mouseEnterDelay: 0.1,
    mouseLeaveDelay: 0.1
  })),
  setup(t, e) {
    let {
      expose: n,
      slots: i,
      attrs: o
    } = e;
    const r = de();
    eo(t.visible === void 0, "popover", "`visible` will be removed in next major version, please use `open` instead."), n({
      getPopupDomNode: () => {
        var f, h;
        return (h = (f = r.value) === null || f === void 0 ? void 0 : f.getPopupDomNode) === null || h === void 0 ? void 0 : h.call(f);
      }
    });
    const {
      prefixCls: a,
      configProvider: l
    } = Ht("popover", t), [s, u] = xJ(a), c = A(() => l.getPrefixCls()), d = () => {
      var f, h;
      const {
        title: p = ho((f = i.title) === null || f === void 0 ? void 0 : f.call(i)),
        content: g = ho((h = i.content) === null || h === void 0 ? void 0 : h.call(i))
      } = t, m = !!(Array.isArray(p) ? p.length : p), y = !!(Array.isArray(g) ? g.length : p);
      return !m && !y ? null : v(tt, null, [m && v("div", {
        class: `${a.value}-title`
      }, [p]), v("div", {
        class: `${a.value}-inner-content`
      }, [g])]);
    };
    return () => {
      const f = Ae(t.overlayClassName, u.value);
      return s(v(zi, J(J(J({}, ii(t, ["title", "content"])), o), {}, {
        prefixCls: a.value,
        ref: r,
        overlayClassName: f,
        transitionName: Is(c.value, "zoom-big", t.transitionName),
        "data-popover-inject": !0
      }), {
        title: d,
        default: i.default
      }));
    };
  }
}), P3 = ya(SJ), N2 = (t) => !isNaN(parseFloat(t)) && isFinite(t), Ed = {
  adjustX: 1,
  adjustY: 1
}, _d = [0, 0], wJ = {
  topLeft: {
    points: ["bl", "tl"],
    overflow: Ed,
    offset: [0, -4],
    targetOffset: _d
  },
  topCenter: {
    points: ["bc", "tc"],
    overflow: Ed,
    offset: [0, -4],
    targetOffset: _d
  },
  topRight: {
    points: ["br", "tr"],
    overflow: Ed,
    offset: [0, -4],
    targetOffset: _d
  },
  bottomLeft: {
    points: ["tl", "bl"],
    overflow: Ed,
    offset: [0, 4],
    targetOffset: _d
  },
  bottomCenter: {
    points: ["tc", "bc"],
    overflow: Ed,
    offset: [0, 4],
    targetOffset: _d
  },
  bottomRight: {
    points: ["tr", "br"],
    overflow: Ed,
    offset: [0, 4],
    targetOffset: _d
  }
};
var CJ = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
const E3 = Oe({
  compatConfig: {
    MODE: 3
  },
  props: {
    minOverlayWidthMatchTrigger: {
      type: Boolean,
      default: void 0
    },
    arrow: {
      type: Boolean,
      default: !1
    },
    prefixCls: ve.string.def("rc-dropdown"),
    transitionName: String,
    overlayClassName: ve.string.def(""),
    openClassName: String,
    animation: ve.any,
    align: ve.object,
    overlayStyle: {
      type: Object,
      default: void 0
    },
    placement: ve.string.def("bottomLeft"),
    overlay: ve.any,
    trigger: ve.oneOfType([ve.string, ve.arrayOf(ve.string)]).def("hover"),
    alignPoint: {
      type: Boolean,
      default: void 0
    },
    showAction: ve.array,
    hideAction: ve.array,
    getPopupContainer: Function,
    visible: {
      type: Boolean,
      default: void 0
    },
    defaultVisible: {
      type: Boolean,
      default: !1
    },
    mouseEnterDelay: ve.number.def(0.15),
    mouseLeaveDelay: ve.number.def(0.1)
  },
  emits: ["visibleChange", "overlayClick"],
  setup(t, e) {
    let {
      slots: n,
      emit: i,
      expose: o
    } = e;
    const r = de(!!t.visible);
    _e(() => t.visible, (h) => {
      h !== void 0 && (r.value = h);
    });
    const a = de();
    o({
      triggerRef: a
    });
    const l = (h) => {
      t.visible === void 0 && (r.value = !1), i("overlayClick", h);
    }, s = (h) => {
      t.visible === void 0 && (r.value = h), i("visibleChange", h);
    }, u = () => {
      var h;
      const p = (h = n.overlay) === null || h === void 0 ? void 0 : h.call(n), g = {
        prefixCls: `${t.prefixCls}-menu`,
        onClick: l
      };
      return v(tt, {
        key: MD
      }, [t.arrow && v("div", {
        class: `${t.prefixCls}-arrow`
      }, null), vi(p, g, !1)]);
    }, c = A(() => {
      const {
        minOverlayWidthMatchTrigger: h = !t.alignPoint
      } = t;
      return h;
    }), d = () => {
      var h;
      const p = (h = n.default) === null || h === void 0 ? void 0 : h.call(n);
      return r.value && p ? vi(p[0], {
        class: t.openClassName || `${t.prefixCls}-open`
      }, !1) : p;
    }, f = A(() => !t.hideAction && t.trigger.indexOf("contextmenu") !== -1 ? ["click"] : t.hideAction);
    return () => {
      const {
        prefixCls: h,
        arrow: p,
        showAction: g,
        overlayStyle: m,
        trigger: y,
        placement: b,
        align: w,
        getPopupContainer: $,
        transitionName: C,
        animation: P,
        overlayClassName: O
      } = t, E = CJ(t, ["prefixCls", "arrow", "showAction", "overlayStyle", "trigger", "placement", "align", "getPopupContainer", "transitionName", "animation", "overlayClassName"]);
      return v(dg, J(J({}, E), {}, {
        prefixCls: h,
        ref: a,
        popupClassName: Ae(O, {
          [`${h}-show-arrow`]: p
        }),
        popupStyle: m,
        builtinPlacements: wJ,
        action: y,
        showAction: g,
        hideAction: f.value || [],
        popupPlacement: b,
        popupAlign: w,
        popupTransitionName: C,
        popupAnimation: P,
        popupVisible: r.value,
        stretch: c.value ? "minWidth" : "",
        onPopupVisibleChange: s,
        getPopupContainer: $
      }), {
        popup: u,
        default: d
      });
    };
  }
}), $J = (t) => {
  const {
    componentCls: e,
    colorPrimary: n
  } = t;
  return {
    [e]: {
      position: "absolute",
      background: "transparent",
      pointerEvents: "none",
      boxSizing: "border-box",
      color: `var(--wave-color, ${n})`,
      boxShadow: "0 0 0 0 currentcolor",
      opacity: 0.2,
      // =================== Motion ===================
      "&.wave-motion-appear": {
        transition: [`box-shadow 0.4s ${t.motionEaseOutCirc}`, `opacity 2s ${t.motionEaseOutCirc}`].join(","),
        "&-active": {
          boxShadow: "0 0 0 6px currentcolor",
          opacity: 0
        }
      }
    }
  };
}, kJ = Vn("Wave", (t) => [$J(t)]);
function TJ(t) {
  const e = (t || "").match(/rgba?\((\d*), (\d*), (\d*)(, [\d.]*)?\)/);
  return e && e[1] && e[2] && e[3] ? !(e[1] === e[2] && e[2] === e[3]) : !0;
}
function t1(t) {
  return t && t !== "#fff" && t !== "#ffffff" && t !== "rgb(255, 255, 255)" && t !== "rgba(255, 255, 255, 1)" && TJ(t) && !/rgba\((?:\d*, ){3}0\)/.test(t) && // any transparent rgba color
  t !== "transparent";
}
function PJ(t) {
  const {
    borderTopColor: e,
    borderColor: n,
    backgroundColor: i
  } = getComputedStyle(t);
  return t1(e) ? e : t1(n) ? n : t1(i) ? i : null;
}
function n1(t) {
  return Number.isNaN(t) ? 0 : t;
}
const EJ = Oe({
  props: {
    target: Vt(),
    className: String
  },
  setup(t) {
    const e = Te(null), [n, i] = zn(null), [o, r] = zn([]), [a, l] = zn(0), [s, u] = zn(0), [c, d] = zn(0), [f, h] = zn(0), [p, g] = zn(!1);
    function m() {
      const {
        target: O
      } = t, E = getComputedStyle(O);
      i(PJ(O));
      const _ = E.position === "static", {
        borderLeftWidth: D,
        borderTopWidth: M
      } = E;
      l(_ ? O.offsetLeft : n1(-parseFloat(D))), u(_ ? O.offsetTop : n1(-parseFloat(M))), d(O.offsetWidth), h(O.offsetHeight);
      const {
        borderTopLeftRadius: N,
        borderTopRightRadius: L,
        borderBottomLeftRadius: j,
        borderBottomRightRadius: B
      } = E;
      r([N, L, B, j].map((Y) => n1(parseFloat(Y))));
    }
    let y, b, w;
    const $ = () => {
      clearTimeout(w), Gt.cancel(b), y?.disconnect();
    }, C = () => {
      var O;
      const E = (O = e.value) === null || O === void 0 ? void 0 : O.parentElement;
      E && (_u(null, E), E.parentElement && E.parentElement.removeChild(E));
    };
    Lt(() => {
      $(), w = setTimeout(() => {
        C();
      }, 5e3);
      const {
        target: O
      } = t;
      O && (b = Gt(() => {
        m(), g(!0);
      }), typeof ResizeObserver < "u" && (y = new ResizeObserver(m), y.observe(O)));
    }), tn(() => {
      $();
    });
    const P = (O) => {
      O.propertyName === "opacity" && C();
    };
    return () => {
      if (!p.value)
        return null;
      const O = {
        left: `${a.value}px`,
        top: `${s.value}px`,
        width: `${c.value}px`,
        height: `${f.value}px`,
        borderRadius: o.value.map((E) => `${E}px`).join(" ")
      };
      return n && (O["--wave-color"] = n.value), v(zr, {
        appear: !0,
        name: "wave-motion",
        appearFromClass: "wave-motion-appear",
        appearActiveClass: "wave-motion-appear",
        appearToClass: "wave-motion-appear wave-motion-appear-active"
      }, {
        default: () => [v("div", {
          ref: e,
          class: t.className,
          style: O,
          onTransitionend: P
        }, null)]
      });
    };
  }
});
function _J(t, e) {
  const n = document.createElement("div");
  return n.style.position = "absolute", n.style.left = "0px", n.style.top = "0px", t?.insertBefore(n, t?.firstChild), _u(v(EJ, {
    target: t,
    className: e
  }, null), n), () => {
    _u(null, n), n.parentElement && n.parentElement.removeChild(n);
  };
}
function IJ(t, e) {
  const n = sr();
  let i;
  function o() {
    var r;
    const a = wl(n);
    i?.(), !(!((r = e?.value) === null || r === void 0) && r.disabled || !a) && (i = _J(a, t.value));
  }
  return tn(() => {
    i?.();
  }), o;
}
const WC = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "Wave",
  props: {
    disabled: Boolean
  },
  setup(t, e) {
    let {
      slots: n
    } = e;
    const i = sr(), {
      prefixCls: o,
      wave: r
    } = Ht("wave", t), [, a] = kJ(o), l = IJ(A(() => Ae(o.value, a.value)), r);
    let s;
    const u = () => {
      wl(i).removeEventListener("click", s, !0);
    };
    return Lt(() => {
      _e(() => t.disabled, () => {
        u(), rn(() => {
          const c = wl(i);
          c?.removeEventListener("click", s, !0), !(!c || c.nodeType !== 1 || t.disabled) && (s = (d) => {
            d.target.tagName === "INPUT" || !hy(d.target) || // No need wave
            !c.getAttribute || c.getAttribute("disabled") || c.disabled || c.className.includes("disabled") || c.className.includes("-leave") || l();
          }, c.addEventListener("click", s, !0));
        });
      }, {
        immediate: !0,
        flush: "post"
      });
    }), tn(() => {
      u();
    }), () => {
      var c;
      return (c = n.default) === null || c === void 0 ? void 0 : c.call(n)[0];
    };
  }
});
function _3(t) {
  return t === "danger" ? {
    danger: !0
  } : {
    type: t
  };
}
const I3 = () => ({
  prefixCls: String,
  type: String,
  htmlType: {
    type: String,
    default: "button"
  },
  shape: {
    type: String
  },
  size: {
    type: String
  },
  loading: {
    type: [Boolean, Object],
    default: () => !1
  },
  disabled: {
    type: Boolean,
    default: void 0
  },
  ghost: {
    type: Boolean,
    default: void 0
  },
  block: {
    type: Boolean,
    default: void 0
  },
  danger: {
    type: Boolean,
    default: void 0
  },
  icon: ve.any,
  href: String,
  target: String,
  title: String,
  onClick: Mf(),
  onMousedown: Mf()
}), L2 = (t) => {
  t && (t.style.width = "0px", t.style.opacity = "0", t.style.transform = "scale(0)");
}, z2 = (t) => {
  rn(() => {
    t && (t.style.width = `${t.scrollWidth}px`, t.style.opacity = "1", t.style.transform = "scale(1)");
  });
}, B2 = (t) => {
  t && t.style && (t.style.width = null, t.style.opacity = null, t.style.transform = null);
}, MJ = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "LoadingIcon",
  props: {
    prefixCls: String,
    loading: [Boolean, Object],
    existIcon: Boolean
  },
  setup(t) {
    return () => {
      const {
        existIcon: e,
        prefixCls: n,
        loading: i
      } = t;
      if (e)
        return v("span", {
          class: `${n}-loading-icon`
        }, [v(Ya, null, null)]);
      const o = !!i;
      return v(zr, {
        name: `${n}-loading-icon-motion`,
        onBeforeEnter: L2,
        onEnter: z2,
        onAfterEnter: B2,
        onBeforeLeave: z2,
        onLeave: (r) => {
          setTimeout(() => {
            L2(r);
          });
        },
        onAfterLeave: B2
      }, {
        default: () => [o ? v("span", {
          class: `${n}-loading-icon`
        }, [v(Ya, null, null)]) : null]
      });
    };
  }
}), F2 = (t, e) => ({
  // Border
  [`> span, > ${t}`]: {
    "&:not(:last-child)": {
      [`&, & > ${t}`]: {
        "&:not(:disabled)": {
          borderInlineEndColor: e
        }
      }
    },
    "&:not(:first-child)": {
      [`&, & > ${t}`]: {
        "&:not(:disabled)": {
          borderInlineStartColor: e
        }
      }
    }
  }
}), AJ = (t) => {
  const {
    componentCls: e,
    fontSize: n,
    lineWidth: i,
    colorPrimaryHover: o,
    colorErrorHover: r
  } = t;
  return {
    [`${e}-group`]: [
      {
        position: "relative",
        display: "inline-flex",
        // Border
        [`> span, > ${e}`]: {
          "&:not(:last-child)": {
            [`&, & > ${e}`]: {
              borderStartEndRadius: 0,
              borderEndEndRadius: 0
            }
          },
          "&:not(:first-child)": {
            marginInlineStart: -i,
            [`&, & > ${e}`]: {
              borderStartStartRadius: 0,
              borderEndStartRadius: 0
            }
          }
        },
        [e]: {
          position: "relative",
          zIndex: 1,
          "&:hover,\n          &:focus,\n          &:active": {
            zIndex: 2
          },
          "&[disabled]": {
            zIndex: 0
          }
        },
        [`${e}-icon-only`]: {
          fontSize: n
        }
      },
      // Border Color
      F2(`${e}-primary`, o),
      F2(`${e}-danger`, r)
    ]
  };
};
function RJ(t, e) {
  return {
    // border collapse
    [`&-item:not(${e}-last-item)`]: {
      marginBottom: -t.lineWidth
    },
    "&-item": {
      "&:hover,&:focus,&:active": {
        zIndex: 2
      },
      "&[disabled]": {
        zIndex: 0
      }
    }
  };
}
function DJ(t, e) {
  return {
    [`&-item:not(${e}-first-item):not(${e}-last-item)`]: {
      borderRadius: 0
    },
    [`&-item${e}-first-item:not(${e}-last-item)`]: {
      [`&, &${t}-sm, &${t}-lg`]: {
        borderEndEndRadius: 0,
        borderEndStartRadius: 0
      }
    },
    [`&-item${e}-last-item:not(${e}-first-item)`]: {
      [`&, &${t}-sm, &${t}-lg`]: {
        borderStartStartRadius: 0,
        borderStartEndRadius: 0
      }
    }
  };
}
function NJ(t) {
  const e = `${t.componentCls}-compact-vertical`;
  return {
    [e]: k(k({}, RJ(t, e)), DJ(t.componentCls, e))
  };
}
const LJ = (t) => {
  const {
    componentCls: e,
    iconCls: n
  } = t;
  return {
    [e]: {
      outline: "none",
      position: "relative",
      display: "inline-block",
      fontWeight: 400,
      whiteSpace: "nowrap",
      textAlign: "center",
      backgroundImage: "none",
      backgroundColor: "transparent",
      border: `${t.lineWidth}px ${t.lineType} transparent`,
      cursor: "pointer",
      transition: `all ${t.motionDurationMid} ${t.motionEaseInOut}`,
      userSelect: "none",
      touchAction: "manipulation",
      lineHeight: t.lineHeight,
      color: t.colorText,
      "> span": {
        display: "inline-block"
      },
      // Leave a space between icon and text.
      [`> ${n} + span, > span + ${n}`]: {
        marginInlineStart: t.marginXS
      },
      "> a": {
        color: "currentColor"
      },
      "&:not(:disabled)": k({}, Au(t)),
      // make `btn-icon-only` not too narrow
      [`&-icon-only${e}-compact-item`]: {
        flex: "none"
      },
      // Special styles for Primary Button
      [`&-compact-item${e}-primary`]: {
        [`&:not([disabled]) + ${e}-compact-item${e}-primary:not([disabled])`]: {
          position: "relative",
          "&:before": {
            position: "absolute",
            top: -t.lineWidth,
            insetInlineStart: -t.lineWidth,
            display: "inline-block",
            width: t.lineWidth,
            height: `calc(100% + ${t.lineWidth * 2}px)`,
            backgroundColor: t.colorPrimaryHover,
            content: '""'
          }
        }
      },
      // Special styles for Primary Button
      "&-compact-vertical-item": {
        [`&${e}-primary`]: {
          [`&:not([disabled]) + ${e}-compact-vertical-item${e}-primary:not([disabled])`]: {
            position: "relative",
            "&:before": {
              position: "absolute",
              top: -t.lineWidth,
              insetInlineStart: -t.lineWidth,
              display: "inline-block",
              width: `calc(100% + ${t.lineWidth * 2}px)`,
              height: t.lineWidth,
              backgroundColor: t.colorPrimaryHover,
              content: '""'
            }
          }
        }
      }
    }
  };
}, Ms = (t, e) => ({
  "&:not(:disabled)": {
    "&:hover": t,
    "&:active": e
  }
}), zJ = (t) => ({
  minWidth: t.controlHeight,
  paddingInlineStart: 0,
  paddingInlineEnd: 0,
  borderRadius: "50%"
}), BJ = (t) => ({
  borderRadius: t.controlHeight,
  paddingInlineStart: t.controlHeight / 2,
  paddingInlineEnd: t.controlHeight / 2
}), yO = (t) => ({
  cursor: "not-allowed",
  borderColor: t.colorBorder,
  color: t.colorTextDisabled,
  backgroundColor: t.colorBgContainerDisabled,
  boxShadow: "none"
}), Gv = (t, e, n, i, o, r, a) => ({
  [`&${t}-background-ghost`]: k(k({
    color: e || void 0,
    backgroundColor: "transparent",
    borderColor: n || void 0,
    boxShadow: "none"
  }, Ms(k({
    backgroundColor: "transparent"
  }, r), k({
    backgroundColor: "transparent"
  }, a))), {
    "&:disabled": {
      cursor: "not-allowed",
      color: i || void 0,
      borderColor: o || void 0
    }
  })
}), jC = (t) => ({
  "&:disabled": k({}, yO(t))
}), M3 = (t) => k({}, jC(t)), Uv = (t) => ({
  "&:disabled": {
    cursor: "not-allowed",
    color: t.colorTextDisabled
  }
}), A3 = (t) => k(k(k(k(k({}, M3(t)), {
  backgroundColor: t.colorBgContainer,
  borderColor: t.colorBorder,
  boxShadow: `0 ${t.controlOutlineWidth}px 0 ${t.controlTmpOutline}`
}), Ms({
  color: t.colorPrimaryHover,
  borderColor: t.colorPrimaryHover
}, {
  color: t.colorPrimaryActive,
  borderColor: t.colorPrimaryActive
})), Gv(t.componentCls, t.colorBgContainer, t.colorBgContainer, t.colorTextDisabled, t.colorBorder)), {
  [`&${t.componentCls}-dangerous`]: k(k(k({
    color: t.colorError,
    borderColor: t.colorError
  }, Ms({
    color: t.colorErrorHover,
    borderColor: t.colorErrorBorderHover
  }, {
    color: t.colorErrorActive,
    borderColor: t.colorErrorActive
  })), Gv(t.componentCls, t.colorError, t.colorError, t.colorTextDisabled, t.colorBorder)), jC(t))
}), FJ = (t) => k(k(k(k(k({}, M3(t)), {
  color: t.colorTextLightSolid,
  backgroundColor: t.colorPrimary,
  boxShadow: `0 ${t.controlOutlineWidth}px 0 ${t.controlOutline}`
}), Ms({
  color: t.colorTextLightSolid,
  backgroundColor: t.colorPrimaryHover
}, {
  color: t.colorTextLightSolid,
  backgroundColor: t.colorPrimaryActive
})), Gv(t.componentCls, t.colorPrimary, t.colorPrimary, t.colorTextDisabled, t.colorBorder, {
  color: t.colorPrimaryHover,
  borderColor: t.colorPrimaryHover
}, {
  color: t.colorPrimaryActive,
  borderColor: t.colorPrimaryActive
})), {
  [`&${t.componentCls}-dangerous`]: k(k(k({
    backgroundColor: t.colorError,
    boxShadow: `0 ${t.controlOutlineWidth}px 0 ${t.colorErrorOutline}`
  }, Ms({
    backgroundColor: t.colorErrorHover
  }, {
    backgroundColor: t.colorErrorActive
  })), Gv(t.componentCls, t.colorError, t.colorError, t.colorTextDisabled, t.colorBorder, {
    color: t.colorErrorHover,
    borderColor: t.colorErrorHover
  }, {
    color: t.colorErrorActive,
    borderColor: t.colorErrorActive
  })), jC(t))
}), VJ = (t) => k(k({}, A3(t)), {
  borderStyle: "dashed"
}), QJ = (t) => k(k(k({
  color: t.colorLink
}, Ms({
  color: t.colorLinkHover
}, {
  color: t.colorLinkActive
})), Uv(t)), {
  [`&${t.componentCls}-dangerous`]: k(k({
    color: t.colorError
  }, Ms({
    color: t.colorErrorHover
  }, {
    color: t.colorErrorActive
  })), Uv(t))
}), HJ = (t) => k(k(k({}, Ms({
  color: t.colorText,
  backgroundColor: t.colorBgTextHover
}, {
  color: t.colorText,
  backgroundColor: t.colorBgTextActive
})), Uv(t)), {
  [`&${t.componentCls}-dangerous`]: k(k({
    color: t.colorError
  }, Uv(t)), Ms({
    color: t.colorErrorHover,
    backgroundColor: t.colorErrorBg
  }, {
    color: t.colorErrorHover,
    backgroundColor: t.colorErrorBg
  }))
}), WJ = (t) => k(k({}, yO(t)), {
  [`&${t.componentCls}:hover`]: k({}, yO(t))
}), jJ = (t) => {
  const {
    componentCls: e
  } = t;
  return {
    [`${e}-default`]: A3(t),
    [`${e}-primary`]: FJ(t),
    [`${e}-dashed`]: VJ(t),
    [`${e}-link`]: QJ(t),
    [`${e}-text`]: HJ(t),
    [`${e}-disabled`]: WJ(t)
  };
}, qC = function(t) {
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
  const {
    componentCls: n,
    iconCls: i,
    controlHeight: o,
    fontSize: r,
    lineHeight: a,
    lineWidth: l,
    borderRadius: s,
    buttonPaddingHorizontal: u
  } = t, c = Math.max(0, (o - r * a) / 2 - l), d = u - l, f = `${n}-icon-only`;
  return [
    // Size
    {
      [`${n}${e}`]: {
        fontSize: r,
        height: o,
        padding: `${c}px ${d}px`,
        borderRadius: s,
        [`&${f}`]: {
          width: o,
          paddingInlineStart: 0,
          paddingInlineEnd: 0,
          [`&${n}-round`]: {
            width: "auto"
          },
          "> span": {
            transform: "scale(1.143)"
            // 14px -> 16px
          }
        },
        // Loading
        [`&${n}-loading`]: {
          opacity: t.opacityLoading,
          cursor: "default"
        },
        [`${n}-loading-icon`]: {
          transition: `width ${t.motionDurationSlow} ${t.motionEaseInOut}, opacity ${t.motionDurationSlow} ${t.motionEaseInOut}`
        },
        [`&:not(${f}) ${n}-loading-icon > ${i}`]: {
          marginInlineEnd: t.marginXS
        }
      }
    },
    // Shape - patch prefixCls again to override solid border radius style
    {
      [`${n}${n}-circle${e}`]: zJ(t)
    },
    {
      [`${n}${n}-round${e}`]: BJ(t)
    }
  ];
}, qJ = (t) => qC(t), YJ = (t) => {
  const e = dn(t, {
    controlHeight: t.controlHeightSM,
    padding: t.paddingXS,
    buttonPaddingHorizontal: 8,
    borderRadius: t.borderRadiusSM
  });
  return qC(e, `${t.componentCls}-sm`);
}, KJ = (t) => {
  const e = dn(t, {
    controlHeight: t.controlHeightLG,
    fontSize: t.fontSizeLG,
    borderRadius: t.borderRadiusLG
  });
  return qC(e, `${t.componentCls}-lg`);
}, XJ = (t) => {
  const {
    componentCls: e
  } = t;
  return {
    [e]: {
      [`&${e}-block`]: {
        width: "100%"
      }
    }
  };
}, ZJ = Vn("Button", (t) => {
  const {
    controlTmpOutline: e,
    paddingContentHorizontal: n
  } = t, i = dn(t, {
    colorOutlineDefault: e,
    buttonPaddingHorizontal: n
  });
  return [
    // Shared
    LJ(i),
    // Size
    YJ(i),
    qJ(i),
    KJ(i),
    // Block
    XJ(i),
    // Group (type, ghost, danger, disabled, loading)
    jJ(i),
    // Button Group
    AJ(i),
    // Space Compact
    mg(t, {
      focus: !1
    }),
    NJ(t)
  ];
}), GJ = () => ({
  prefixCls: String,
  size: {
    type: String
  }
}), R3 = LC(), bO = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "AButtonGroup",
  props: GJ(),
  setup(t, e) {
    let {
      slots: n
    } = e;
    const {
      prefixCls: i,
      direction: o
    } = Ht("btn-group", t), [, , r] = lh();
    R3.useProvide(Bn({
      size: A(() => t.size)
    }));
    const a = A(() => {
      const {
        size: l
      } = t;
      let s = "";
      switch (l) {
        case "large":
          s = "lg";
          break;
        case "small":
          s = "sm";
          break;
        case "middle":
        case void 0:
          break;
        default:
          $n(!l, "Button.Group", "Invalid prop `size`.");
      }
      return {
        [`${i.value}`]: !0,
        [`${i.value}-${s}`]: s,
        [`${i.value}-rtl`]: o.value === "rtl",
        [r.value]: !0
      };
    });
    return () => {
      var l;
      return v("div", {
        class: a.value
      }, [Wi((l = n.default) === null || l === void 0 ? void 0 : l.call(n))]);
    };
  }
}), V2 = /^[\u4e00-\u9fa5]{2}$/, Q2 = V2.test.bind(V2);
function fm(t) {
  return t === "text" || t === "link";
}
const en = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "AButton",
  inheritAttrs: !1,
  __ANT_BUTTON: !0,
  props: Kn(I3(), {
    type: "default"
  }),
  slots: Object,
  // emits: ['click', 'mousedown'],
  setup(t, e) {
    let {
      slots: n,
      attrs: i,
      emit: o,
      expose: r
    } = e;
    const {
      prefixCls: a,
      autoInsertSpaceInButton: l,
      direction: s,
      size: u
    } = Ht("btn", t), [c, d] = ZJ(a), f = R3.useInject(), h = qa(), p = A(() => {
      var B;
      return (B = t.disabled) !== null && B !== void 0 ? B : h.value;
    }), g = Te(null), m = Te(void 0);
    let y = !1;
    const b = Te(!1), w = Te(!1), $ = A(() => l.value !== !1), {
      compactSize: C,
      compactItemClassnames: P
    } = sh(a, s), O = A(() => typeof t.loading == "object" && t.loading.delay ? t.loading.delay || !0 : !!t.loading);
    _e(O, (B) => {
      clearTimeout(m.value), typeof O.value == "number" ? m.value = setTimeout(() => {
        b.value = B;
      }, O.value) : b.value = B;
    }, {
      immediate: !0
    });
    const E = A(() => {
      const {
        type: B,
        shape: Y = "default",
        ghost: Q,
        block: G,
        danger: V
      } = t, H = a.value, q = {
        large: "lg",
        small: "sm",
        middle: void 0
      }, K = C.value || f?.size || u.value, ee = K && q[K] || "";
      return [P.value, {
        [d.value]: !0,
        [`${H}`]: !0,
        [`${H}-${Y}`]: Y !== "default" && Y,
        [`${H}-${B}`]: B,
        [`${H}-${ee}`]: ee,
        [`${H}-loading`]: b.value,
        [`${H}-background-ghost`]: Q && !fm(B),
        [`${H}-two-chinese-chars`]: w.value && $.value,
        [`${H}-block`]: G,
        [`${H}-dangerous`]: !!V,
        [`${H}-rtl`]: s.value === "rtl"
      }];
    }), _ = () => {
      const B = g.value;
      if (!B || l.value === !1)
        return;
      const Y = B.textContent;
      y && Q2(Y) ? w.value || (w.value = !0) : w.value && (w.value = !1);
    }, D = (B) => {
      if (b.value || p.value) {
        B.preventDefault();
        return;
      }
      o("click", B);
    }, M = (B) => {
      o("mousedown", B);
    }, N = (B, Y) => {
      const Q = Y ? " " : "";
      if (B.type === pw) {
        let G = B.children.trim();
        return Q2(G) && (G = G.split("").join(Q)), v("span", null, [G]);
      }
      return B;
    };
    return zt(() => {
      $n(!(t.ghost && fm(t.type)), "Button", "`link` or `text` button can't be a `ghost` button.");
    }), Lt(_), Ns(_), tn(() => {
      m.value && clearTimeout(m.value);
    }), r({
      focus: () => {
        var B;
        (B = g.value) === null || B === void 0 || B.focus();
      },
      blur: () => {
        var B;
        (B = g.value) === null || B === void 0 || B.blur();
      }
    }), () => {
      var B, Y;
      const {
        icon: Q = (B = n.icon) === null || B === void 0 ? void 0 : B.call(n)
      } = t, G = Wi((Y = n.default) === null || Y === void 0 ? void 0 : Y.call(n));
      y = G.length === 1 && !Q && !fm(t.type);
      const {
        type: V,
        htmlType: H,
        href: q,
        title: K,
        target: ee
      } = t, ie = b.value ? "loading" : Q, ae = k(k({}, i), {
        title: K,
        disabled: p.value,
        class: [E.value, i.class, {
          [`${a.value}-icon-only`]: G.length === 0 && !!ie
        }],
        onClick: D,
        onMousedown: M
      });
      p.value || delete ae.disabled;
      const te = Q && !b.value ? Q : v(MJ, {
        existIcon: !!Q,
        prefixCls: a.value,
        loading: !!b.value
      }, null), U = G.map((ce) => N(ce, y && $.value));
      if (q !== void 0)
        return c(v("a", J(J({}, ae), {}, {
          href: q,
          target: ee,
          ref: g
        }), [te, U]));
      let me = v("button", J(J({}, ae), {}, {
        ref: g,
        type: H
      }), [te, U]);
      if (!fm(V)) {
        const ce = /* @__PURE__ */ (function() {
          return me;
        })();
        me = v(WC, {
          ref: "wave",
          disabled: !!b.value
        }, {
          default: () => [ce]
        });
      }
      return c(me);
    };
  }
});
en.Group = bO;
en.install = function(t) {
  return t.component(en.name, en), t.component(bO.name, bO), t;
};
const D3 = () => ({
  arrow: pn([Boolean, Object]),
  trigger: {
    type: [Array, String]
  },
  menu: Vt(),
  overlay: ve.any,
  /** @deprecated Please use `open` instead */
  visible: pt(),
  open: pt(),
  disabled: pt(),
  danger: pt(),
  autofocus: pt(),
  align: Vt(),
  getPopupContainer: Function,
  prefixCls: String,
  transitionName: String,
  placement: String,
  overlayClassName: String,
  overlayStyle: Vt(),
  forceRender: pt(),
  mouseEnterDelay: Number,
  mouseLeaveDelay: Number,
  openClassName: String,
  minOverlayWidthMatchTrigger: pt(),
  destroyPopupOnHide: pt(),
  /** @deprecated Please use `onOpenChange` instead */
  onVisibleChange: {
    type: Function
  },
  /** @deprecated Please use `onUpdate:open` instead */
  "onUpdate:visible": {
    type: Function
  },
  onOpenChange: {
    type: Function
  },
  "onUpdate:open": {
    type: Function
  }
}), i1 = I3(), UJ = () => k(k({}, D3()), {
  type: i1.type,
  size: String,
  htmlType: i1.htmlType,
  href: String,
  disabled: pt(),
  prefixCls: String,
  icon: ve.any,
  title: String,
  loading: i1.loading,
  onClick: Mf()
});
var JJ = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z" } }] }, name: "ellipsis", theme: "outlined" };
function H2(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(n);
    typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(n).filter(function(o) {
      return Object.getOwnPropertyDescriptor(n, o).enumerable;
    }))), i.forEach(function(o) {
      eee(t, o, n[o]);
    });
  }
  return t;
}
function eee(t, e, n) {
  return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
var vg = function(e, n) {
  var i = H2({}, e, n.attrs);
  return v(bn, H2({}, i, {
    icon: JJ
  }), null);
};
vg.displayName = "EllipsisOutlined";
vg.inheritAttrs = !1;
const tee = (t) => {
  const {
    componentCls: e,
    antCls: n,
    paddingXS: i,
    opacityLoading: o
  } = t;
  return {
    [`${e}-button`]: {
      whiteSpace: "nowrap",
      [`&${n}-btn-group > ${n}-btn`]: {
        [`&-loading, &-loading + ${n}-btn`]: {
          cursor: "default",
          pointerEvents: "none",
          opacity: o
        },
        [`&:last-child:not(:first-child):not(${n}-btn-icon-only)`]: {
          paddingInline: i
        }
      }
    }
  };
}, nee = (t) => {
  const {
    componentCls: e,
    menuCls: n,
    colorError: i,
    colorTextLightSolid: o
  } = t, r = `${n}-item`;
  return {
    [`${e}, ${e}-menu-submenu`]: {
      [`${n} ${r}`]: {
        [`&${r}-danger:not(${r}-disabled)`]: {
          color: i,
          "&:hover": {
            color: o,
            backgroundColor: i
          }
        }
      }
    }
  };
}, iee = (t) => {
  const {
    componentCls: e,
    menuCls: n,
    zIndexPopup: i,
    dropdownArrowDistance: o,
    dropdownArrowOffset: r,
    sizePopupArrow: a,
    antCls: l,
    iconCls: s,
    motionDurationMid: u,
    dropdownPaddingVertical: c,
    fontSize: d,
    dropdownEdgeChildPadding: f,
    colorTextDisabled: h,
    fontSizeIcon: p,
    controlPaddingHorizontal: g,
    colorBgElevated: m,
    boxShadowPopoverArrow: y
  } = t;
  return [
    {
      [e]: k(k({}, kn(t)), {
        position: "absolute",
        top: -9999,
        left: {
          _skip_check_: !0,
          value: -9999
        },
        zIndex: i,
        display: "block",
        // A placeholder out of dropdown visible range to avoid close when user moving
        "&::before": {
          position: "absolute",
          insetBlock: -o + a / 2,
          // insetInlineStart: -7, // FIXME: Seems not work for hidden element
          zIndex: -9999,
          opacity: 1e-4,
          content: '""'
        },
        [`${e}-wrap`]: {
          position: "relative",
          [`${l}-btn > ${s}-down`]: {
            fontSize: p
          },
          [`${s}-down::before`]: {
            transition: `transform ${u}`
          }
        },
        [`${e}-wrap-open`]: {
          [`${s}-down::before`]: {
            transform: "rotate(180deg)"
          }
        },
        "\n        &-hidden,\n        &-menu-hidden,\n        &-menu-submenu-hidden\n      ": {
          display: "none"
        },
        // =============================================================
        // ==                          Arrow                          ==
        // =============================================================
        // Offset the popover to account for the dropdown arrow
        [`
        &-show-arrow${e}-placement-topLeft,
        &-show-arrow${e}-placement-top,
        &-show-arrow${e}-placement-topRight
      `]: {
          paddingBottom: o
        },
        [`
        &-show-arrow${e}-placement-bottomLeft,
        &-show-arrow${e}-placement-bottom,
        &-show-arrow${e}-placement-bottomRight
      `]: {
          paddingTop: o
        },
        // Note: .popover-arrow is outer, .popover-arrow:after is inner
        [`${e}-arrow`]: k({
          position: "absolute",
          zIndex: 1,
          display: "block"
        }, cC(a, t.borderRadiusXS, t.borderRadiusOuter, m, y)),
        [`
        &-placement-top > ${e}-arrow,
        &-placement-topLeft > ${e}-arrow,
        &-placement-topRight > ${e}-arrow
      `]: {
          bottom: o,
          transform: "translateY(100%) rotate(180deg)"
        },
        [`&-placement-top > ${e}-arrow`]: {
          left: {
            _skip_check_: !0,
            value: "50%"
          },
          transform: "translateX(-50%) translateY(100%) rotate(180deg)"
        },
        [`&-placement-topLeft > ${e}-arrow`]: {
          left: {
            _skip_check_: !0,
            value: r
          }
        },
        [`&-placement-topRight > ${e}-arrow`]: {
          right: {
            _skip_check_: !0,
            value: r
          }
        },
        [`
          &-placement-bottom > ${e}-arrow,
          &-placement-bottomLeft > ${e}-arrow,
          &-placement-bottomRight > ${e}-arrow
        `]: {
          top: o,
          transform: "translateY(-100%)"
        },
        [`&-placement-bottom > ${e}-arrow`]: {
          left: {
            _skip_check_: !0,
            value: "50%"
          },
          transform: "translateY(-100%) translateX(-50%)"
        },
        [`&-placement-bottomLeft > ${e}-arrow`]: {
          left: {
            _skip_check_: !0,
            value: r
          }
        },
        [`&-placement-bottomRight > ${e}-arrow`]: {
          right: {
            _skip_check_: !0,
            value: r
          }
        },
        // =============================================================
        // ==                         Motion                          ==
        // =============================================================
        // When position is not enough for dropdown, the placement will revert.
        // We will handle this with revert motion name.
        [`&${l}-slide-down-enter${l}-slide-down-enter-active${e}-placement-bottomLeft,
          &${l}-slide-down-appear${l}-slide-down-appear-active${e}-placement-bottomLeft,
          &${l}-slide-down-enter${l}-slide-down-enter-active${e}-placement-bottom,
          &${l}-slide-down-appear${l}-slide-down-appear-active${e}-placement-bottom,
          &${l}-slide-down-enter${l}-slide-down-enter-active${e}-placement-bottomRight,
          &${l}-slide-down-appear${l}-slide-down-appear-active${e}-placement-bottomRight`]: {
          animationName: vy
        },
        [`&${l}-slide-up-enter${l}-slide-up-enter-active${e}-placement-topLeft,
          &${l}-slide-up-appear${l}-slide-up-appear-active${e}-placement-topLeft,
          &${l}-slide-up-enter${l}-slide-up-enter-active${e}-placement-top,
          &${l}-slide-up-appear${l}-slide-up-appear-active${e}-placement-top,
          &${l}-slide-up-enter${l}-slide-up-enter-active${e}-placement-topRight,
          &${l}-slide-up-appear${l}-slide-up-appear-active${e}-placement-topRight`]: {
          animationName: by
        },
        [`&${l}-slide-down-leave${l}-slide-down-leave-active${e}-placement-bottomLeft,
          &${l}-slide-down-leave${l}-slide-down-leave-active${e}-placement-bottom,
          &${l}-slide-down-leave${l}-slide-down-leave-active${e}-placement-bottomRight`]: {
          animationName: yy
        },
        [`&${l}-slide-up-leave${l}-slide-up-leave-active${e}-placement-topLeft,
          &${l}-slide-up-leave${l}-slide-up-leave-active${e}-placement-top,
          &${l}-slide-up-leave${l}-slide-up-leave-active${e}-placement-topRight`]: {
          animationName: xy
        }
      })
    },
    {
      // =============================================================
      // ==                          Menu                           ==
      // =============================================================
      [`${e} ${n}`]: {
        position: "relative",
        margin: 0
      },
      [`${n}-submenu-popup`]: {
        position: "absolute",
        zIndex: i,
        background: "transparent",
        boxShadow: "none",
        transformOrigin: "0 0",
        "ul,li": {
          listStyle: "none"
        },
        ul: {
          marginInline: "0.3em"
        }
      },
      [`${e}, ${e}-menu-submenu`]: {
        [n]: k(k({
          padding: f,
          listStyleType: "none",
          backgroundColor: m,
          backgroundClip: "padding-box",
          borderRadius: t.borderRadiusLG,
          outline: "none",
          boxShadow: t.boxShadowSecondary
        }, Au(t)), {
          [`${n}-item-group-title`]: {
            padding: `${c}px ${g}px`,
            color: t.colorTextDescription,
            transition: `all ${u}`
          },
          // ======================= Item Content =======================
          [`${n}-item`]: {
            position: "relative",
            display: "flex",
            alignItems: "center",
            borderRadius: t.borderRadiusSM
          },
          [`${n}-item-icon`]: {
            minWidth: d,
            marginInlineEnd: t.marginXS,
            fontSize: t.fontSizeSM
          },
          [`${n}-title-content`]: {
            flex: "auto",
            "> a": {
              color: "inherit",
              transition: `all ${u}`,
              "&:hover": {
                color: "inherit"
              },
              "&::after": {
                position: "absolute",
                inset: 0,
                content: '""'
              }
            }
          },
          // =========================== Item ===========================
          [`${n}-item, ${n}-submenu-title`]: k(k({
            clear: "both",
            margin: 0,
            padding: `${c}px ${g}px`,
            color: t.colorText,
            fontWeight: "normal",
            fontSize: d,
            lineHeight: t.lineHeight,
            cursor: "pointer",
            transition: `all ${u}`,
            "&:hover, &-active": {
              backgroundColor: t.controlItemBgHover
            }
          }, Au(t)), {
            "&-selected": {
              color: t.colorPrimary,
              backgroundColor: t.controlItemBgActive,
              "&:hover, &-active": {
                backgroundColor: t.controlItemBgActiveHover
              }
            },
            "&-disabled": {
              color: h,
              cursor: "not-allowed",
              "&:hover": {
                color: h,
                backgroundColor: m,
                cursor: "not-allowed"
              },
              a: {
                pointerEvents: "none"
              }
            },
            "&-divider": {
              height: 1,
              margin: `${t.marginXXS}px 0`,
              overflow: "hidden",
              lineHeight: 0,
              backgroundColor: t.colorSplit
            },
            [`${e}-menu-submenu-expand-icon`]: {
              position: "absolute",
              insetInlineEnd: t.paddingXS,
              [`${e}-menu-submenu-arrow-icon`]: {
                marginInlineEnd: "0 !important",
                color: t.colorTextDescription,
                fontSize: p,
                fontStyle: "normal"
              }
            }
          }),
          [`${n}-item-group-list`]: {
            margin: `0 ${t.marginXS}px`,
            padding: 0,
            listStyle: "none"
          },
          [`${n}-submenu-title`]: {
            paddingInlineEnd: g + t.fontSizeSM
          },
          [`${n}-submenu-vertical`]: {
            position: "relative"
          },
          [`${n}-submenu${n}-submenu-disabled ${e}-menu-submenu-title`]: {
            [`&, ${e}-menu-submenu-arrow-icon`]: {
              color: h,
              backgroundColor: m,
              cursor: "not-allowed"
            }
          },
          // https://github.com/ant-design/ant-design/issues/19264
          [`${n}-submenu-selected ${e}-menu-submenu-title`]: {
            color: t.colorPrimary
          }
        })
      }
    },
    // Follow code may reuse in other components
    [Ml(t, "slide-up"), Ml(t, "slide-down"), zf(t, "move-up"), zf(t, "move-down"), gg(t, "zoom-big")]
  ];
}, N3 = Vn("Dropdown", (t, e) => {
  let {
    rootPrefixCls: n
  } = e;
  const {
    marginXXS: i,
    sizePopupArrow: o,
    controlHeight: r,
    fontSize: a,
    lineHeight: l,
    paddingXXS: s,
    componentCls: u,
    borderRadiusOuter: c,
    borderRadiusLG: d
  } = t, f = (r - a * l) / 2, {
    dropdownArrowOffset: h
  } = $3({
    sizePopupArrow: o,
    contentRadius: d,
    borderRadiusOuter: c
  }), p = dn(t, {
    menuCls: `${u}-menu`,
    rootPrefixCls: n,
    dropdownArrowDistance: o / 2 + i,
    dropdownArrowOffset: h,
    dropdownPaddingVertical: f,
    dropdownEdgeChildPadding: s
  });
  return [iee(p), tee(p), nee(p)];
}, (t) => ({
  zIndexPopup: t.zIndexPopupBase + 50
}));
var oee = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
const ree = en.Group, Jv = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ADropdownButton",
  inheritAttrs: !1,
  __ANT_BUTTON: !0,
  props: Kn(UJ(), {
    trigger: "hover",
    placement: "bottomRight",
    type: "default"
  }),
  // emits: ['click', 'visibleChange', 'update:visible'],s
  slots: Object,
  setup(t, e) {
    let {
      slots: n,
      attrs: i,
      emit: o
    } = e;
    const r = (f) => {
      o("update:visible", f), o("visibleChange", f), o("update:open", f), o("openChange", f);
    }, {
      prefixCls: a,
      direction: l,
      getPopupContainer: s
    } = Ht("dropdown", t), u = A(() => `${a.value}-button`), [c, d] = N3(a);
    return () => {
      var f, h;
      const p = k(k({}, t), i), {
        type: g = "default",
        disabled: m,
        danger: y,
        loading: b,
        htmlType: w,
        class: $ = "",
        overlay: C = (f = n.overlay) === null || f === void 0 ? void 0 : f.call(n),
        trigger: P,
        align: O,
        open: E,
        visible: _,
        onVisibleChange: D,
        placement: M = l.value === "rtl" ? "bottomLeft" : "bottomRight",
        href: N,
        title: L,
        icon: j = ((h = n.icon) === null || h === void 0 ? void 0 : h.call(n)) || v(vg, null, null),
        mouseEnterDelay: B,
        mouseLeaveDelay: Y,
        overlayClassName: Q,
        overlayStyle: G,
        destroyPopupOnHide: V,
        onClick: H,
        "onUpdate:open": q
      } = p, K = oee(p, ["type", "disabled", "danger", "loading", "htmlType", "class", "overlay", "trigger", "align", "open", "visible", "onVisibleChange", "placement", "href", "title", "icon", "mouseEnterDelay", "mouseLeaveDelay", "overlayClassName", "overlayStyle", "destroyPopupOnHide", "onClick", "onUpdate:open"]), ee = {
        align: O,
        disabled: m,
        trigger: m ? [] : P,
        placement: M,
        getPopupContainer: s?.value,
        onOpenChange: r,
        mouseEnterDelay: B,
        mouseLeaveDelay: Y,
        open: E ?? _,
        overlayClassName: Q,
        overlayStyle: G,
        destroyPopupOnHide: V
      }, ie = v(en, {
        danger: y,
        type: g,
        disabled: m,
        loading: b,
        onClick: H,
        htmlType: w,
        href: N,
        title: L
      }, {
        default: n.default
      }), ae = v(en, {
        danger: y,
        type: g,
        icon: j
      }, null);
      return c(v(ree, J(J({}, K), {}, {
        class: Ae(u.value, $, d.value)
      }), {
        default: () => [n.leftButton ? n.leftButton({
          button: ie
        }) : ie, v(Nr, ee, {
          default: () => [n.rightButton ? n.rightButton({
            button: ae
          }) : ae],
          overlay: () => C
        })]
      }));
    };
  }
});
var aee = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z" } }] }, name: "right", theme: "outlined" };
function W2(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(n);
    typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(n).filter(function(o) {
      return Object.getOwnPropertyDescriptor(n, o).enumerable;
    }))), i.forEach(function(o) {
      lee(t, o, n[o]);
    });
  }
  return t;
}
function lee(t, e, n) {
  return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
var Yc = function(e, n) {
  var i = W2({}, e, n.attrs);
  return v(bn, W2({}, i, {
    icon: aee
  }), null);
};
Yc.displayName = "RightOutlined";
Yc.inheritAttrs = !1;
const L3 = Symbol("OverrideContextKey"), z3 = () => qt(L3, void 0), B3 = (t) => {
  var e, n, i;
  const {
    prefixCls: o,
    mode: r,
    selectable: a,
    validator: l,
    onClick: s,
    expandIcon: u
  } = z3() || {};
  Xt(L3, {
    prefixCls: A(() => {
      var c, d;
      return (d = (c = t.prefixCls) === null || c === void 0 ? void 0 : c.value) !== null && d !== void 0 ? d : o?.value;
    }),
    mode: A(() => {
      var c, d;
      return (d = (c = t.mode) === null || c === void 0 ? void 0 : c.value) !== null && d !== void 0 ? d : r?.value;
    }),
    selectable: A(() => {
      var c, d;
      return (d = (c = t.selectable) === null || c === void 0 ? void 0 : c.value) !== null && d !== void 0 ? d : a?.value;
    }),
    validator: (e = t.validator) !== null && e !== void 0 ? e : l,
    onClick: (n = t.onClick) !== null && n !== void 0 ? n : s,
    expandIcon: (i = t.expandIcon) !== null && i !== void 0 ? i : u?.value
  });
}, Nr = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ADropdown",
  inheritAttrs: !1,
  props: Kn(D3(), {
    mouseEnterDelay: 0.15,
    mouseLeaveDelay: 0.1,
    placement: "bottomLeft",
    trigger: "hover"
  }),
  // emits: ['visibleChange', 'update:visible'],
  slots: Object,
  setup(t, e) {
    let {
      slots: n,
      attrs: i,
      emit: o
    } = e;
    const {
      prefixCls: r,
      rootPrefixCls: a,
      direction: l,
      getPopupContainer: s
    } = Ht("dropdown", t), [u, c] = N3(r);
    process.env.NODE_ENV !== "production" && [["visible", "open"], ["onVisibleChange", "onOpenChange"], ["onUpdate:visible", "onUpdate:open"]].forEach((m) => {
      let [y, b] = m;
      eo(t[y] === void 0, "Dropdown", `\`${y}\` is deprecated which will be removed in next major version, please use \`${b}\` instead.`);
    });
    const d = A(() => {
      const {
        placement: m = "",
        transitionName: y
      } = t;
      return y !== void 0 ? y : m.includes("top") ? `${a.value}-slide-down` : `${a.value}-slide-up`;
    });
    B3({
      prefixCls: A(() => `${r.value}-menu`),
      expandIcon: A(() => v("span", {
        class: `${r.value}-menu-submenu-arrow`
      }, [v(Yc, {
        class: `${r.value}-menu-submenu-arrow-icon`
      }, null)])),
      mode: A(() => "vertical"),
      selectable: A(() => !1),
      onClick: () => {
      },
      validator: (m) => {
        let {
          mode: y
        } = m;
        eo(!y || y === "vertical", "Dropdown", `mode="${y}" is not supported for Dropdown's Menu.`);
      }
    });
    const f = () => {
      var m, y, b;
      const w = t.overlay || ((m = n.overlay) === null || m === void 0 ? void 0 : m.call(n)), $ = Array.isArray(w) ? w[0] : w;
      if (!$) return null;
      const C = $.props || {};
      $n(!C.mode || C.mode === "vertical", "Dropdown", `mode="${C.mode}" is not supported for Dropdown's Menu.`);
      const {
        selectable: P = !1,
        expandIcon: O = (b = (y = $.children) === null || y === void 0 ? void 0 : y.expandIcon) === null || b === void 0 ? void 0 : b.call(y)
      } = C, E = typeof O < "u" && po(O) ? O : v("span", {
        class: `${r.value}-menu-submenu-arrow`
      }, [v(Yc, {
        class: `${r.value}-menu-submenu-arrow-icon`
      }, null)]);
      return po($) ? vi($, {
        mode: "vertical",
        selectable: P,
        expandIcon: () => E
      }) : $;
    }, h = A(() => {
      const m = t.placement;
      if (!m)
        return l.value === "rtl" ? "bottomRight" : "bottomLeft";
      if (m.includes("Center")) {
        const y = m.slice(0, m.indexOf("Center"));
        return $n(!m.includes("Center"), "Dropdown", `You are using '${m}' placement in Dropdown, which is deprecated. Try to use '${y}' instead.`), y;
      }
      return m;
    }), p = A(() => typeof t.visible == "boolean" ? t.visible : t.open), g = (m) => {
      o("update:visible", m), o("visibleChange", m), o("update:open", m), o("openChange", m);
    };
    return () => {
      var m, y;
      const {
        arrow: b,
        trigger: w,
        disabled: $,
        overlayClassName: C
      } = t, P = (m = n.default) === null || m === void 0 ? void 0 : m.call(n)[0], O = vi(P, k({
        class: Ae((y = P?.props) === null || y === void 0 ? void 0 : y.class, {
          [`${r.value}-rtl`]: l.value === "rtl"
        }, `${r.value}-trigger`)
      }, $ ? {
        disabled: $
      } : {})), E = Ae(C, c.value, {
        [`${r.value}-rtl`]: l.value === "rtl"
      }), _ = $ ? [] : w;
      let D;
      _ && _.includes("contextmenu") && (D = !0);
      const M = S3({
        arrowPointAtCenter: typeof b == "object" && b.pointAtCenter,
        autoAdjustOverflow: !0
      }), N = ii(k(k(k({}, t), i), {
        visible: p.value,
        builtinPlacements: M,
        overlayClassName: E,
        arrow: !!b,
        alignPoint: D,
        prefixCls: r.value,
        getPopupContainer: s?.value,
        transitionName: d.value,
        trigger: _,
        onVisibleChange: g,
        placement: h.value
      }), ["overlay", "onUpdate:visible"]);
      return u(v(E3, N, {
        default: () => [O],
        overlay: f
      }));
    };
  }
});
Nr.Button = Jv;
function see(t, e, n, i) {
  let o;
  if (o !== void 0)
    return !!o;
  if (t === e)
    return !0;
  if (typeof t != "object" || !t || typeof e != "object" || !e)
    return !1;
  const r = Object.keys(t), a = Object.keys(e);
  if (r.length !== a.length)
    return !1;
  const l = Object.prototype.hasOwnProperty.bind(e);
  for (let s = 0; s < r.length; s++) {
    const u = r[s];
    if (!l(u))
      return !1;
    const c = t[u], d = e[u];
    if (o = void 0, o === !1 || o === void 0 && c !== d)
      return !1;
  }
  return !0;
}
function Fd(t, e) {
  return see(rr(t), rr(e));
}
const F3 = Symbol("menuContextKey"), V3 = (t) => {
  Xt(F3, t);
}, Bs = () => qt(F3), Q3 = Symbol("ForceRenderKey"), uee = (t) => {
  Xt(Q3, t);
}, H3 = () => qt(Q3, !1), W3 = Symbol("menuFirstLevelContextKey"), j3 = (t) => {
  Xt(W3, t);
}, cee = () => qt(W3, !0), e0 = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "MenuContextProvider",
  inheritAttrs: !1,
  props: {
    mode: {
      type: String,
      default: void 0
    },
    overflowDisabled: {
      type: Boolean,
      default: void 0
    }
  },
  setup(t, e) {
    let {
      slots: n
    } = e;
    const i = Bs(), o = k({}, i);
    return t.mode !== void 0 && (o.mode = on(t, "mode")), t.overflowDisabled !== void 0 && (o.overflowDisabled = on(t, "overflowDisabled")), V3(o), () => {
      var r;
      return (r = n.default) === null || r === void 0 ? void 0 : r.call(n);
    };
  }
}), dee = Symbol("siderCollapsed"), hm = "$$__vc-menu-more__key", q3 = Symbol("KeyPathContext"), YC = () => qt(q3, {
  parentEventKeys: A(() => []),
  parentKeys: A(() => []),
  parentInfo: {}
}), fee = (t, e, n) => {
  const {
    parentEventKeys: i,
    parentKeys: o
  } = YC(), r = A(() => [...i.value, t]), a = A(() => [...o.value, e]);
  return Xt(q3, {
    parentEventKeys: r,
    parentKeys: a,
    parentInfo: n
  }), a;
}, Y3 = Symbol("measure"), j2 = Oe({
  compatConfig: {
    MODE: 3
  },
  setup(t, e) {
    let {
      slots: n
    } = e;
    return Xt(Y3, !0), () => {
      var i;
      return (i = n.default) === null || i === void 0 ? void 0 : i.call(n);
    };
  }
}), KC = () => qt(Y3, !1);
function K3(t) {
  const {
    mode: e,
    rtl: n,
    inlineIndent: i
  } = Bs();
  return A(() => e.value !== "inline" ? null : n.value ? {
    paddingRight: `${t.value * i.value}px`
  } : {
    paddingLeft: `${t.value * i.value}px`
  });
}
let hee = 0;
const pee = () => ({
  id: String,
  role: String,
  disabled: Boolean,
  danger: Boolean,
  title: {
    type: [String, Boolean],
    default: void 0
  },
  icon: ve.any,
  onMouseenter: Function,
  onMouseleave: Function,
  onClick: Function,
  onKeydown: Function,
  onFocus: Function,
  // Internal user prop
  originItemValue: Vt()
}), Bf = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "AMenuItem",
  inheritAttrs: !1,
  props: pee(),
  slots: Object,
  setup(t, e) {
    let {
      slots: n,
      emit: i,
      attrs: o
    } = e;
    const r = sr(), a = KC(), l = typeof r.vnode.key == "symbol" ? String(r.vnode.key) : r.vnode.key;
    $n(typeof r.vnode.key != "symbol", "MenuItem", `MenuItem \`:key="${String(l)}"\` not support Symbol type`);
    const s = `menu_item_${++hee}_$$_${l}`, {
      parentEventKeys: u,
      parentKeys: c
    } = YC(), {
      prefixCls: d,
      activeKeys: f,
      disabled: h,
      changeActiveKeys: p,
      rtl: g,
      inlineCollapsed: m,
      siderCollapsed: y,
      onItemClick: b,
      selectedKeys: w,
      registerMenuInfo: $,
      unRegisterMenuInfo: C
    } = Bs(), P = cee(), O = Te(!1), E = A(() => [...c.value, l]);
    $(s, {
      eventKey: s,
      key: l,
      parentEventKeys: u,
      parentKeys: c,
      isLeaf: !0
    }), tn(() => {
      C(s);
    }), _e(f, () => {
      O.value = !!f.value.find((q) => q === l);
    }, {
      immediate: !0
    });
    const D = A(() => h.value || t.disabled), M = A(() => w.value.includes(l)), N = A(() => {
      const q = `${d.value}-item`;
      return {
        [`${q}`]: !0,
        [`${q}-danger`]: t.danger,
        [`${q}-active`]: O.value,
        [`${q}-selected`]: M.value,
        [`${q}-disabled`]: D.value
      };
    }), L = (q) => ({
      key: l,
      eventKey: s,
      keyPath: E.value,
      eventKeyPath: [...u.value, s],
      domEvent: q,
      item: k(k({}, t), o)
    }), j = (q) => {
      if (D.value)
        return;
      const K = L(q);
      i("click", q), b(K);
    }, B = (q) => {
      D.value || (p(E.value), i("mouseenter", q));
    }, Y = (q) => {
      D.value || (p([]), i("mouseleave", q));
    }, Q = (q) => {
      if (i("keydown", q), q.which === lt.ENTER) {
        const K = L(q);
        i("click", q), b(K);
      }
    }, G = (q) => {
      p(E.value), i("focus", q);
    }, V = (q, K) => {
      const ee = v("span", {
        class: `${d.value}-title-content`
      }, [K]);
      return (!q || po(K) && K.type === "span") && K && m.value && P && typeof K == "string" ? v("div", {
        class: `${d.value}-inline-collapsed-noicon`
      }, [K.charAt(0)]) : ee;
    }, H = K3(A(() => E.value.length));
    return () => {
      var q, K, ee, ie, ae;
      if (a) return null;
      const te = (q = t.title) !== null && q !== void 0 ? q : (K = n.title) === null || K === void 0 ? void 0 : K.call(n), U = Wi((ee = n.default) === null || ee === void 0 ? void 0 : ee.call(n)), me = U.length;
      let ce = te;
      typeof te > "u" ? ce = P && me ? U : "" : te === !1 && (ce = "");
      const ue = {
        title: ce
      };
      !y.value && !m.value && (ue.title = null, ue.open = !1);
      const fe = {};
      t.role === "option" && (fe["aria-selected"] = M.value);
      const he = (ie = t.icon) !== null && ie !== void 0 ? ie : (ae = n.icon) === null || ae === void 0 ? void 0 : ae.call(n, t);
      return v(zi, J(J({}, ue), {}, {
        placement: g.value ? "left" : "right",
        overlayClassName: `${d.value}-inline-collapsed-tooltip`
      }), {
        default: () => [v(bs.Item, J(J(J({
          component: "li"
        }, o), {}, {
          id: t.id,
          style: k(k({}, o.style || {}), H.value),
          class: [N.value, {
            [`${o.class}`]: !!o.class,
            [`${d.value}-item-only-child`]: (he ? me + 1 : me) === 1
          }],
          role: t.role || "menuitem",
          tabindex: t.disabled ? null : -1,
          "data-menu-id": l,
          "aria-disabled": t.disabled
        }, fe), {}, {
          onMouseenter: B,
          onMouseleave: Y,
          onClick: j,
          onKeydown: Q,
          onFocus: G,
          title: typeof te == "string" ? te : void 0
        }), {
          default: () => [vi(typeof he == "function" ? he(t.originItemValue) : he, {
            class: `${d.value}-item-icon`
          }, !1), V(he, U)]
        })]
      });
    };
  }
}), Ou = {
  adjustX: 1,
  adjustY: 1
}, gee = {
  topLeft: {
    points: ["bl", "tl"],
    overflow: Ou,
    offset: [0, -7]
  },
  bottomLeft: {
    points: ["tl", "bl"],
    overflow: Ou,
    offset: [0, 7]
  },
  leftTop: {
    points: ["tr", "tl"],
    overflow: Ou,
    offset: [-4, 0]
  },
  rightTop: {
    points: ["tl", "tr"],
    overflow: Ou,
    offset: [4, 0]
  }
}, mee = {
  topLeft: {
    points: ["bl", "tl"],
    overflow: Ou,
    offset: [0, -7]
  },
  bottomLeft: {
    points: ["tl", "bl"],
    overflow: Ou,
    offset: [0, 7]
  },
  rightTop: {
    points: ["tr", "tl"],
    overflow: Ou,
    offset: [-4, 0]
  },
  leftTop: {
    points: ["tl", "tr"],
    overflow: Ou,
    offset: [4, 0]
  }
}, vee = {
  horizontal: "bottomLeft",
  vertical: "rightTop",
  "vertical-left": "rightTop",
  "vertical-right": "leftTop"
}, q2 = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "PopupTrigger",
  inheritAttrs: !1,
  props: {
    prefixCls: String,
    mode: String,
    visible: Boolean,
    // popup: React.ReactNode;
    popupClassName: String,
    popupOffset: Array,
    disabled: Boolean,
    onVisibleChange: Function
  },
  slots: Object,
  emits: ["visibleChange"],
  setup(t, e) {
    let {
      slots: n,
      emit: i
    } = e;
    const o = Te(!1), {
      getPopupContainer: r,
      rtl: a,
      subMenuOpenDelay: l,
      subMenuCloseDelay: s,
      builtinPlacements: u,
      triggerSubMenuAction: c,
      forceSubMenuRender: d,
      motion: f,
      defaultMotions: h,
      rootClassName: p
    } = Bs(), g = H3(), m = A(() => a.value ? k(k({}, mee), u.value) : k(k({}, gee), u.value)), y = A(() => vee[t.mode]), b = Te();
    _e(() => t.visible, (C) => {
      Gt.cancel(b.value), b.value = Gt(() => {
        o.value = C;
      });
    }, {
      immediate: !0
    }), tn(() => {
      Gt.cancel(b.value);
    });
    const w = (C) => {
      i("visibleChange", C);
    }, $ = A(() => {
      var C, P;
      const O = f.value || ((C = h.value) === null || C === void 0 ? void 0 : C[t.mode]) || ((P = h.value) === null || P === void 0 ? void 0 : P.other), E = typeof O == "function" ? O() : O;
      return E ? jc(E.name, {
        css: !0
      }) : void 0;
    });
    return () => {
      const {
        prefixCls: C,
        popupClassName: P,
        mode: O,
        popupOffset: E,
        disabled: _
      } = t;
      return v(dg, {
        prefixCls: C,
        popupClassName: Ae(`${C}-popup`, {
          [`${C}-rtl`]: a.value
        }, P, p.value),
        stretch: O === "horizontal" ? "minWidth" : null,
        getPopupContainer: r.value,
        builtinPlacements: m.value,
        popupPlacement: y.value,
        popupVisible: o.value,
        popupAlign: E && {
          offset: E
        },
        action: _ ? [] : [c.value],
        mouseEnterDelay: l.value,
        mouseLeaveDelay: s.value,
        onPopupVisibleChange: w,
        forceRender: g || d.value,
        popupAnimation: $.value
      }, {
        popup: n.popup,
        default: n.default
      });
    };
  }
}), XC = (t, e) => {
  let {
    slots: n,
    attrs: i
  } = e;
  var o;
  const {
    prefixCls: r,
    mode: a
  } = Bs();
  return v("ul", J(J({}, i), {}, {
    class: Ae(r.value, `${r.value}-sub`, `${r.value}-${a.value === "inline" ? "inline" : "vertical"}`),
    "data-menu-list": !0
  }), [(o = n.default) === null || o === void 0 ? void 0 : o.call(n)]);
};
XC.displayName = "SubMenuList";
const yee = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "InlineSubMenuList",
  inheritAttrs: !1,
  props: {
    id: String,
    open: Boolean,
    keyPath: Array
  },
  setup(t, e) {
    let {
      slots: n
    } = e;
    const i = A(() => "inline"), {
      motion: o,
      mode: r,
      defaultMotions: a
    } = Bs(), l = A(() => r.value === i.value), s = de(!l.value), u = A(() => l.value ? t.open : !1);
    _e(r, () => {
      l.value && (s.value = !1);
    }, {
      flush: "post"
    });
    const c = A(() => {
      var d, f;
      const h = o.value || ((d = a.value) === null || d === void 0 ? void 0 : d[i.value]) || ((f = a.value) === null || f === void 0 ? void 0 : f.other), p = typeof h == "function" ? h() : h;
      return k(k({}, p), {
        appear: t.keyPath.length <= 1
      });
    });
    return () => {
      var d;
      return s.value ? null : v(e0, {
        mode: i.value
      }, {
        default: () => [v(zr, c.value, {
          default: () => [fa(v(XC, {
            id: t.id
          }, {
            default: () => [(d = n.default) === null || d === void 0 ? void 0 : d.call(n)]
          }), [[Qa, u.value]])]
        })]
      });
    };
  }
});
let Y2 = 0;
const bee = () => ({
  icon: ve.any,
  title: ve.any,
  disabled: Boolean,
  level: Number,
  popupClassName: String,
  popupOffset: Array,
  internalPopupClose: Boolean,
  eventKey: String,
  expandIcon: Function,
  theme: String,
  onMouseenter: Function,
  onMouseleave: Function,
  onTitleClick: Function,
  // Internal user prop
  originItemValue: Vt()
}), Ff = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ASubMenu",
  inheritAttrs: !1,
  props: bee(),
  slots: Object,
  setup(t, e) {
    let {
      slots: n,
      attrs: i,
      emit: o
    } = e;
    var r, a;
    j3(!1);
    const l = KC(), s = sr(), u = typeof s.vnode.key == "symbol" ? String(s.vnode.key) : s.vnode.key;
    $n(typeof s.vnode.key != "symbol", "SubMenu", `SubMenu \`:key="${String(u)}"\` not support Symbol type`);
    const c = Hx(u) ? u : `sub_menu_${++Y2}_$$_not_set_key`, d = (r = t.eventKey) !== null && r !== void 0 ? r : Hx(u) ? `sub_menu_${++Y2}_$$_${u}` : c, {
      parentEventKeys: f,
      parentInfo: h,
      parentKeys: p
    } = YC(), g = A(() => [...p.value, c]), m = Te([]), y = {
      eventKey: d,
      key: c,
      parentEventKeys: f,
      childrenEventKeys: m,
      parentKeys: p
    };
    (a = h.childrenEventKeys) === null || a === void 0 || a.value.push(d), tn(() => {
      var Fe;
      h.childrenEventKeys && (h.childrenEventKeys.value = (Fe = h.childrenEventKeys) === null || Fe === void 0 ? void 0 : Fe.value.filter((We) => We != d));
    }), fee(d, c, y);
    const {
      prefixCls: b,
      activeKeys: w,
      disabled: $,
      changeActiveKeys: C,
      mode: P,
      inlineCollapsed: O,
      openKeys: E,
      overflowDisabled: _,
      onOpenChange: D,
      registerMenuInfo: M,
      unRegisterMenuInfo: N,
      selectedSubMenuKeys: L,
      expandIcon: j,
      theme: B
    } = Bs(), Y = u != null, Q = !l && (H3() || !Y);
    uee(Q), (l && Y || !l && !Y || Q) && (M(d, y), tn(() => {
      N(d);
    }));
    const G = A(() => `${b.value}-submenu`), V = A(() => $.value || t.disabled), H = Te(), q = Te(), K = A(() => E.value.includes(c)), ee = A(() => !_.value && K.value), ie = A(() => L.value.includes(c)), ae = Te(!1);
    _e(w, () => {
      ae.value = !!w.value.find((Fe) => Fe === c);
    }, {
      immediate: !0
    });
    const te = (Fe) => {
      V.value || (o("titleClick", Fe, c), P.value === "inline" && D(c, !K.value));
    }, U = (Fe) => {
      V.value || (C(g.value), o("mouseenter", Fe));
    }, me = (Fe) => {
      V.value || (C([]), o("mouseleave", Fe));
    }, ce = K3(A(() => g.value.length)), ue = (Fe) => {
      P.value !== "inline" && D(c, Fe);
    }, fe = () => {
      C(g.value);
    }, he = d && `${d}-popup`, le = A(() => Ae(b.value, `${b.value}-${t.theme || B.value}`, t.popupClassName)), ke = (Fe, We) => {
      if (!We)
        return O.value && !p.value.length && Fe && typeof Fe == "string" ? v("div", {
          class: `${b.value}-inline-collapsed-noicon`
        }, [Fe.charAt(0)]) : v("span", {
          class: `${b.value}-title-content`
        }, [Fe]);
      const nt = po(Fe) && Fe.type === "span";
      return v(tt, null, [vi(typeof We == "function" ? We(t.originItemValue) : We, {
        class: `${b.value}-item-icon`
      }, !1), nt ? Fe : v("span", {
        class: `${b.value}-title-content`
      }, [Fe])]);
    }, ze = A(() => P.value !== "inline" && g.value.length > 1 ? "vertical" : P.value), Re = A(() => P.value === "horizontal" ? "vertical" : P.value), Ye = A(() => ze.value === "horizontal" ? "vertical" : ze.value), Ne = () => {
      var Fe, We;
      const nt = G.value, Qe = (Fe = t.icon) !== null && Fe !== void 0 ? Fe : (We = n.icon) === null || We === void 0 ? void 0 : We.call(n, t), Pe = t.expandIcon || n.expandIcon || j.value, Ze = ke(ca(n, t, "title"), Qe);
      return v("div", {
        style: ce.value,
        class: `${nt}-title`,
        tabindex: V.value ? null : -1,
        ref: H,
        title: typeof Ze == "string" ? Ze : null,
        "data-menu-id": c,
        "aria-expanded": ee.value,
        "aria-haspopup": !0,
        "aria-controls": he,
        "aria-disabled": V.value,
        onClick: te,
        onFocus: fe
      }, [Ze, P.value !== "horizontal" && Pe ? Pe(k(k({}, t), {
        isOpen: ee.value
      })) : v("i", {
        class: `${nt}-arrow`
      }, null)]);
    };
    return () => {
      var Fe;
      if (l)
        return Y ? (Fe = n.default) === null || Fe === void 0 ? void 0 : Fe.call(n) : null;
      const We = G.value;
      let nt = () => null;
      if (!_.value && P.value !== "inline") {
        const Qe = P.value === "horizontal" ? [0, 8] : [10, 0];
        nt = () => v(q2, {
          mode: ze.value,
          prefixCls: We,
          visible: !t.internalPopupClose && ee.value,
          popupClassName: le.value,
          popupOffset: t.popupOffset || Qe,
          disabled: V.value,
          onVisibleChange: ue
        }, {
          default: () => [Ne()],
          popup: () => v(e0, {
            mode: Ye.value
          }, {
            default: () => [v(XC, {
              id: he,
              ref: q
            }, {
              default: n.default
            })]
          })
        });
      } else
        nt = () => v(q2, null, {
          default: Ne
        });
      return v(e0, {
        mode: Re.value
      }, {
        default: () => [v(bs.Item, J(J({
          component: "li"
        }, i), {}, {
          role: "none",
          class: Ae(We, `${We}-${P.value}`, i.class, {
            [`${We}-open`]: ee.value,
            [`${We}-active`]: ae.value,
            [`${We}-selected`]: ie.value,
            [`${We}-disabled`]: V.value
          }),
          onMouseenter: U,
          onMouseleave: me,
          "data-submenu-id": c
        }), {
          default: () => v(tt, null, [nt(), !_.value && v(yee, {
            id: he,
            open: ee.value,
            keyPath: g.value
          }, {
            default: n.default
          })])
        })]
      });
    };
  }
});
function X3(t, e) {
  return t.classList ? t.classList.contains(e) : ` ${t.className} `.indexOf(` ${e} `) > -1;
}
function xO(t, e) {
  t.classList ? t.classList.add(e) : X3(t, e) || (t.className = `${t.className} ${e}`);
}
function OO(t, e) {
  if (t.classList)
    t.classList.remove(e);
  else if (X3(t, e)) {
    const n = t.className;
    t.className = ` ${n} `.replace(` ${e} `, " ");
  }
}
const Sy = function() {
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "ant-motion-collapse", e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
  return {
    name: t,
    appear: e,
    css: !0,
    onBeforeEnter: (n) => {
      n.style.height = "0px", n.style.opacity = "0", xO(n, t);
    },
    onEnter: (n) => {
      rn(() => {
        n.style.height = `${n.scrollHeight}px`, n.style.opacity = "1";
      });
    },
    onAfterEnter: (n) => {
      n && (OO(n, t), n.style.height = null, n.style.opacity = null);
    },
    onBeforeLeave: (n) => {
      xO(n, t), n.style.height = `${n.offsetHeight}px`, n.style.opacity = null;
    },
    onLeave: (n) => {
      setTimeout(() => {
        n.style.height = "0px", n.style.opacity = "0";
      });
    },
    onAfterLeave: (n) => {
      n && (OO(n, t), n.style && (n.style.height = null, n.style.opacity = null));
    }
  };
}, xee = () => ({
  title: ve.any,
  // Internal user prop
  originItemValue: Vt()
}), t0 = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "AMenuItemGroup",
  inheritAttrs: !1,
  props: xee(),
  slots: Object,
  setup(t, e) {
    let {
      slots: n,
      attrs: i
    } = e;
    const {
      prefixCls: o
    } = Bs(), r = A(() => `${o.value}-item-group`), a = KC();
    return () => {
      var l, s;
      return a ? (l = n.default) === null || l === void 0 ? void 0 : l.call(n) : v("li", J(J({}, i), {}, {
        onClick: (u) => u.stopPropagation(),
        class: r.value
      }), [v("div", {
        title: typeof t.title == "string" ? t.title : void 0,
        class: `${r.value}-title`
      }, [ca(n, t, "title")]), v("ul", {
        class: `${r.value}-list`
      }, [(s = n.default) === null || s === void 0 ? void 0 : s.call(n)])]);
    };
  }
}), Oee = () => ({
  prefixCls: String,
  dashed: Boolean
}), n0 = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "AMenuDivider",
  props: Oee(),
  setup(t) {
    const {
      prefixCls: e
    } = Bs(), n = A(() => ({
      [`${e.value}-item-divider`]: !0,
      [`${e.value}-item-divider-dashed`]: !!t.dashed
    }));
    return () => v("li", {
      class: n.value
    }, null);
  }
});
var See = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
function SO(t, e, n) {
  return (t || []).map((i, o) => {
    if (i && typeof i == "object") {
      const r = i, {
        label: a,
        children: l,
        key: s,
        type: u
      } = r, c = See(r, ["label", "children", "key", "type"]), d = s ?? `tmp-${o}`, f = n ? n.parentKeys.slice() : [], h = [], p = {
        eventKey: d,
        key: d,
        parentEventKeys: de(f),
        parentKeys: de(f),
        childrenEventKeys: de(h),
        isLeaf: !1
      };
      if (l || u === "group") {
        if (u === "group") {
          const m = SO(l, e, n);
          return v(t0, J(J({
            key: d
          }, c), {}, {
            title: a,
            originItemValue: i
          }), {
            default: () => [m]
          });
        }
        e.set(d, p), n && n.childrenEventKeys.push(d);
        const g = SO(l, e, {
          childrenEventKeys: h,
          parentKeys: [].concat(f, d)
        });
        return v(Ff, J(J({
          key: d
        }, c), {}, {
          title: a,
          originItemValue: i
        }), {
          default: () => [g]
        });
      }
      return u === "divider" ? v(n0, J({
        key: d
      }, c), null) : (p.isLeaf = !0, e.set(d, p), v(Bf, J(J({
        key: d
      }, c), {}, {
        originItemValue: i
      }), {
        default: () => [a]
      }));
    }
    return null;
  }).filter((i) => i);
}
function wee(t) {
  const e = Te([]), n = Te(!1), i = Te(/* @__PURE__ */ new Map());
  return _e(() => t.items, () => {
    const o = /* @__PURE__ */ new Map();
    n.value = !1, t.items ? (n.value = !0, e.value = SO(t.items, o)) : e.value = void 0, i.value = o;
  }, {
    immediate: !0,
    deep: !0
  }), {
    itemsNodes: e,
    store: i,
    hasItmes: n
  };
}
const Cee = (t) => {
  const {
    componentCls: e,
    motionDurationSlow: n,
    menuHorizontalHeight: i,
    colorSplit: o,
    lineWidth: r,
    lineType: a,
    menuItemPaddingInline: l
  } = t;
  return {
    [`${e}-horizontal`]: {
      lineHeight: `${i}px`,
      border: 0,
      borderBottom: `${r}px ${a} ${o}`,
      boxShadow: "none",
      "&::after": {
        display: "block",
        clear: "both",
        height: 0,
        content: '"\\20"'
      },
      // ======================= Item =======================
      [`${e}-item, ${e}-submenu`]: {
        position: "relative",
        display: "inline-block",
        verticalAlign: "bottom",
        paddingInline: l
      },
      [`> ${e}-item:hover,
        > ${e}-item-active,
        > ${e}-submenu ${e}-submenu-title:hover`]: {
        backgroundColor: "transparent"
      },
      [`${e}-item, ${e}-submenu-title`]: {
        transition: [`border-color ${n}`, `background ${n}`].join(",")
      },
      // ===================== Sub Menu =====================
      [`${e}-submenu-arrow`]: {
        display: "none"
      }
    }
  };
}, $ee = (t) => {
  let {
    componentCls: e,
    menuArrowOffset: n
  } = t;
  return {
    [`${e}-rtl`]: {
      direction: "rtl"
    },
    [`${e}-submenu-rtl`]: {
      transformOrigin: "100% 0"
    },
    // Vertical Arrow
    [`${e}-rtl${e}-vertical,
    ${e}-submenu-rtl ${e}-vertical`]: {
      [`${e}-submenu-arrow`]: {
        "&::before": {
          transform: `rotate(-45deg) translateY(-${n})`
        },
        "&::after": {
          transform: `rotate(45deg) translateY(${n})`
        }
      }
    }
  };
}, K2 = (t) => k({}, _s(t)), X2 = (t, e) => {
  const {
    componentCls: n,
    colorItemText: i,
    colorItemTextSelected: o,
    colorGroupTitle: r,
    colorItemBg: a,
    colorSubItemBg: l,
    colorItemBgSelected: s,
    colorActiveBarHeight: u,
    colorActiveBarWidth: c,
    colorActiveBarBorderSize: d,
    motionDurationSlow: f,
    motionEaseInOut: h,
    motionEaseOut: p,
    menuItemPaddingInline: g,
    motionDurationMid: m,
    colorItemTextHover: y,
    lineType: b,
    colorSplit: w,
    // Disabled
    colorItemTextDisabled: $,
    // Danger
    colorDangerItemText: C,
    colorDangerItemTextHover: P,
    colorDangerItemTextSelected: O,
    colorDangerItemBgActive: E,
    colorDangerItemBgSelected: _,
    colorItemBgHover: D,
    menuSubMenuBg: M,
    // Horizontal
    colorItemTextSelectedHorizontal: N,
    colorItemBgSelectedHorizontal: L
  } = t;
  return {
    [`${n}-${e}`]: {
      color: i,
      background: a,
      [`&${n}-root:focus-visible`]: k({}, K2(t)),
      // ======================== Item ========================
      [`${n}-item-group-title`]: {
        color: r
      },
      [`${n}-submenu-selected`]: {
        [`> ${n}-submenu-title`]: {
          color: o
        }
      },
      // Disabled
      [`${n}-item-disabled, ${n}-submenu-disabled`]: {
        color: `${$} !important`
      },
      // Hover
      [`${n}-item:hover, ${n}-submenu-title:hover`]: {
        [`&:not(${n}-item-selected):not(${n}-submenu-selected)`]: {
          color: y
        }
      },
      [`&:not(${n}-horizontal)`]: {
        [`${n}-item:not(${n}-item-selected)`]: {
          "&:hover": {
            backgroundColor: D
          },
          "&:active": {
            backgroundColor: s
          }
        },
        [`${n}-submenu-title`]: {
          "&:hover": {
            backgroundColor: D
          },
          "&:active": {
            backgroundColor: s
          }
        }
      },
      // Danger - only Item has
      [`${n}-item-danger`]: {
        color: C,
        [`&${n}-item:hover`]: {
          [`&:not(${n}-item-selected):not(${n}-submenu-selected)`]: {
            color: P
          }
        },
        [`&${n}-item:active`]: {
          background: E
        }
      },
      [`${n}-item a`]: {
        "&, &:hover": {
          color: "inherit"
        }
      },
      [`${n}-item-selected`]: {
        color: o,
        // Danger
        [`&${n}-item-danger`]: {
          color: O
        },
        "a, a:hover": {
          color: "inherit"
        }
      },
      [`& ${n}-item-selected`]: {
        backgroundColor: s,
        // Danger
        [`&${n}-item-danger`]: {
          backgroundColor: _
        }
      },
      [`${n}-item, ${n}-submenu-title`]: {
        [`&:not(${n}-item-disabled):focus-visible`]: k({}, K2(t))
      },
      [`&${n}-submenu > ${n}`]: {
        backgroundColor: M
      },
      [`&${n}-popup > ${n}`]: {
        backgroundColor: a
      },
      // ====================== Horizontal ======================
      [`&${n}-horizontal`]: k(k({}, e === "dark" ? {
        borderBottom: 0
      } : {}), {
        [`> ${n}-item, > ${n}-submenu`]: {
          top: d,
          marginTop: -d,
          marginBottom: 0,
          borderRadius: 0,
          "&::after": {
            position: "absolute",
            insetInline: g,
            bottom: 0,
            borderBottom: `${u}px solid transparent`,
            transition: `border-color ${f} ${h}`,
            content: '""'
          },
          "&:hover, &-active, &-open": {
            "&::after": {
              borderBottomWidth: u,
              borderBottomColor: N
            }
          },
          "&-selected": {
            color: N,
            backgroundColor: L,
            "&::after": {
              borderBottomWidth: u,
              borderBottomColor: N
            }
          }
        }
      }),
      // ================== Inline & Vertical ===================
      //
      [`&${n}-root`]: {
        [`&${n}-inline, &${n}-vertical`]: {
          borderInlineEnd: `${d}px ${b} ${w}`
        }
      },
      // ======================== Inline ========================
      [`&${n}-inline`]: {
        // Sub
        [`${n}-sub${n}-inline`]: {
          background: l
        },
        // Item
        [`${n}-item, ${n}-submenu-title`]: d && c ? {
          width: `calc(100% + ${d}px)`
        } : {},
        [`${n}-item`]: {
          position: "relative",
          "&::after": {
            position: "absolute",
            insetBlock: 0,
            insetInlineEnd: 0,
            borderInlineEnd: `${c}px solid ${o}`,
            transform: "scaleY(0.0001)",
            opacity: 0,
            transition: [`transform ${m} ${p}`, `opacity ${m} ${p}`].join(","),
            content: '""'
          },
          // Danger
          [`&${n}-item-danger`]: {
            "&::after": {
              borderInlineEndColor: O
            }
          }
        },
        [`${n}-selected, ${n}-item-selected`]: {
          "&::after": {
            transform: "scaleY(1)",
            opacity: 1,
            transition: [`transform ${m} ${h}`, `opacity ${m} ${h}`].join(",")
          }
        }
      }
    }
  };
}, Z2 = (t) => {
  const {
    componentCls: e,
    menuItemHeight: n,
    itemMarginInline: i,
    padding: o,
    menuArrowSize: r,
    marginXS: a,
    marginXXS: l
  } = t, s = o + r + a;
  return {
    [`${e}-item`]: {
      position: "relative"
    },
    [`${e}-item, ${e}-submenu-title`]: {
      height: n,
      lineHeight: `${n}px`,
      paddingInline: o,
      overflow: "hidden",
      textOverflow: "ellipsis",
      marginInline: i,
      marginBlock: l,
      width: `calc(100% - ${i * 2}px)`
    },
    // disable margin collapsed
    [`${e}-submenu`]: {
      paddingBottom: 0.02
    },
    [`> ${e}-item,
            > ${e}-submenu > ${e}-submenu-title`]: {
      height: n,
      lineHeight: `${n}px`
    },
    [`${e}-item-group-list ${e}-submenu-title,
            ${e}-submenu-title`]: {
      paddingInlineEnd: s
    }
  };
}, kee = (t) => {
  const {
    componentCls: e,
    iconCls: n,
    menuItemHeight: i,
    colorTextLightSolid: o,
    dropdownWidth: r,
    controlHeightLG: a,
    motionDurationMid: l,
    motionEaseOut: s,
    paddingXL: u,
    fontSizeSM: c,
    fontSizeLG: d,
    motionDurationSlow: f,
    paddingXS: h,
    boxShadowSecondary: p
  } = t, g = {
    height: i,
    lineHeight: `${i}px`,
    listStylePosition: "inside",
    listStyleType: "disc"
  };
  return [
    {
      [e]: {
        "&-inline, &-vertical": k({
          [`&${e}-root`]: {
            boxShadow: "none"
          }
        }, Z2(t))
      },
      [`${e}-submenu-popup`]: {
        [`${e}-vertical`]: k(k({}, Z2(t)), {
          boxShadow: p
        })
      }
    },
    // Vertical only
    {
      [`${e}-submenu-popup ${e}-vertical${e}-sub`]: {
        minWidth: r,
        maxHeight: `calc(100vh - ${a * 2.5}px)`,
        padding: "0",
        overflow: "hidden",
        borderInlineEnd: 0,
        // https://github.com/ant-design/ant-design/issues/22244
        // https://github.com/ant-design/ant-design/issues/26812
        "&:not([class*='-active'])": {
          overflowX: "hidden",
          overflowY: "auto"
        }
      }
    },
    // Inline Only
    {
      [`${e}-inline`]: {
        width: "100%",
        // Motion enhance for first level
        [`&${e}-root`]: {
          [`${e}-item, ${e}-submenu-title`]: {
            display: "flex",
            alignItems: "center",
            transition: [`border-color ${f}`, `background ${f}`, `padding ${l} ${s}`].join(","),
            [`> ${e}-title-content`]: {
              flex: "auto",
              minWidth: 0,
              overflow: "hidden",
              textOverflow: "ellipsis"
            },
            "> *": {
              flex: "none"
            }
          }
        },
        // >>>>> Sub
        [`${e}-sub${e}-inline`]: {
          padding: 0,
          border: 0,
          borderRadius: 0,
          boxShadow: "none",
          [`& > ${e}-submenu > ${e}-submenu-title`]: g,
          [`& ${e}-item-group-title`]: {
            paddingInlineStart: u
          }
        },
        // >>>>> Item
        [`${e}-item`]: g
      }
    },
    // Inline Collapse Only
    {
      [`${e}-inline-collapsed`]: {
        width: i * 2,
        [`&${e}-root`]: {
          [`${e}-item, ${e}-submenu ${e}-submenu-title`]: {
            [`> ${e}-inline-collapsed-noicon`]: {
              fontSize: d,
              textAlign: "center"
            }
          }
        },
        [`> ${e}-item,
          > ${e}-item-group > ${e}-item-group-list > ${e}-item,
          > ${e}-item-group > ${e}-item-group-list > ${e}-submenu > ${e}-submenu-title,
          > ${e}-submenu > ${e}-submenu-title`]: {
          insetInlineStart: 0,
          paddingInline: `calc(50% - ${c}px)`,
          textOverflow: "clip",
          [`
            ${e}-submenu-arrow,
            ${e}-submenu-expand-icon
          `]: {
            opacity: 0
          },
          [`${e}-item-icon, ${n}`]: {
            margin: 0,
            fontSize: d,
            lineHeight: `${i}px`,
            "+ span": {
              display: "inline-block",
              opacity: 0
            }
          }
        },
        [`${e}-item-icon, ${n}`]: {
          display: "inline-block"
        },
        "&-tooltip": {
          pointerEvents: "none",
          [`${e}-item-icon, ${n}`]: {
            display: "none"
          },
          "a, a:hover": {
            color: o
          }
        },
        [`${e}-item-group-title`]: k(k({}, Ps), {
          paddingInline: h
        })
      }
    }
  ];
}, G2 = (t) => {
  const {
    componentCls: e,
    fontSize: n,
    motionDurationSlow: i,
    motionDurationMid: o,
    motionEaseInOut: r,
    motionEaseOut: a,
    iconCls: l,
    controlHeightSM: s
  } = t;
  return {
    // >>>>> Item
    [`${e}-item, ${e}-submenu-title`]: {
      position: "relative",
      display: "block",
      margin: 0,
      whiteSpace: "nowrap",
      cursor: "pointer",
      transition: [`border-color ${i}`, `background ${i}`, `padding ${i} ${r}`].join(","),
      [`${e}-item-icon, ${l}`]: {
        minWidth: n,
        fontSize: n,
        transition: [`font-size ${o} ${a}`, `margin ${i} ${r}`, `color ${i}`].join(","),
        "+ span": {
          marginInlineStart: s - n,
          opacity: 1,
          transition: [`opacity ${i} ${r}`, `margin ${i}`, `color ${i}`].join(",")
        }
      },
      [`${e}-item-icon`]: k({}, ah()),
      [`&${e}-item-only-child`]: {
        [`> ${l}, > ${e}-item-icon`]: {
          marginInlineEnd: 0
        }
      }
    },
    // Disabled state sets text to gray and nukes hover/tab effects
    [`${e}-item-disabled, ${e}-submenu-disabled`]: {
      background: "none !important",
      cursor: "not-allowed",
      "&::after": {
        borderColor: "transparent !important"
      },
      a: {
        color: "inherit !important"
      },
      [`> ${e}-submenu-title`]: {
        color: "inherit !important",
        cursor: "not-allowed"
      }
    }
  };
}, U2 = (t) => {
  const {
    componentCls: e,
    motionDurationSlow: n,
    motionEaseInOut: i,
    borderRadius: o,
    menuArrowSize: r,
    menuArrowOffset: a
  } = t;
  return {
    [`${e}-submenu`]: {
      "&-expand-icon, &-arrow": {
        position: "absolute",
        top: "50%",
        insetInlineEnd: t.margin,
        width: r,
        color: "currentcolor",
        transform: "translateY(-50%)",
        transition: `transform ${n} ${i}, opacity ${n}`
      },
      "&-arrow": {
        // →
        "&::before, &::after": {
          position: "absolute",
          width: r * 0.6,
          height: r * 0.15,
          backgroundColor: "currentcolor",
          borderRadius: o,
          transition: [`background ${n} ${i}`, `transform ${n} ${i}`, `top ${n} ${i}`, `color ${n} ${i}`].join(","),
          content: '""'
        },
        "&::before": {
          transform: `rotate(45deg) translateY(-${a})`
        },
        "&::after": {
          transform: `rotate(-45deg) translateY(${a})`
        }
      }
    }
  };
}, Tee = (t) => {
  const {
    antCls: e,
    componentCls: n,
    fontSize: i,
    motionDurationSlow: o,
    motionDurationMid: r,
    motionEaseInOut: a,
    lineHeight: l,
    paddingXS: s,
    padding: u,
    colorSplit: c,
    lineWidth: d,
    zIndexPopup: f,
    borderRadiusLG: h,
    radiusSubMenuItem: p,
    menuArrowSize: g,
    menuArrowOffset: m,
    lineType: y,
    menuPanelMaskInset: b
  } = t;
  return [
    // Misc
    {
      "": {
        [`${n}`]: k(k({}, Es()), {
          // Hidden
          "&-hidden": {
            display: "none"
          }
        })
      },
      [`${n}-submenu-hidden`]: {
        display: "none"
      }
    },
    {
      [n]: k(k(k(k(k(k(k({}, kn(t)), Es()), {
        marginBottom: 0,
        paddingInlineStart: 0,
        // Override default ul/ol
        fontSize: i,
        lineHeight: 0,
        listStyle: "none",
        outline: "none",
        transition: `width ${o} cubic-bezier(0.2, 0, 0, 1) 0s`,
        "ul, ol": {
          margin: 0,
          padding: 0,
          listStyle: "none"
        },
        // Overflow ellipsis
        "&-overflow": {
          display: "flex",
          [`${n}-item`]: {
            flex: "none"
          }
        },
        [`${n}-item, ${n}-submenu, ${n}-submenu-title`]: {
          borderRadius: t.radiusItem
        },
        [`${n}-item-group-title`]: {
          padding: `${s}px ${u}px`,
          fontSize: i,
          lineHeight: l,
          transition: `all ${o}`
        },
        [`&-horizontal ${n}-submenu`]: {
          transition: [`border-color ${o} ${a}`, `background ${o} ${a}`].join(",")
        },
        [`${n}-submenu, ${n}-submenu-inline`]: {
          transition: [`border-color ${o} ${a}`, `background ${o} ${a}`, `padding ${r} ${a}`].join(",")
        },
        [`${n}-submenu ${n}-sub`]: {
          cursor: "initial",
          transition: [`background ${o} ${a}`, `padding ${o} ${a}`].join(",")
        },
        [`${n}-title-content`]: {
          transition: `color ${o}`
        },
        [`${n}-item a`]: {
          "&::before": {
            position: "absolute",
            inset: 0,
            backgroundColor: "transparent",
            content: '""'
          }
        },
        // Removed a Badge related style seems it's safe
        // https://github.com/ant-design/ant-design/issues/19809
        // >>>>> Divider
        [`${n}-item-divider`]: {
          overflow: "hidden",
          lineHeight: 0,
          borderColor: c,
          borderStyle: y,
          borderWidth: 0,
          borderTopWidth: d,
          marginBlock: d,
          padding: 0,
          "&-dashed": {
            borderStyle: "dashed"
          }
        }
      }), G2(t)), {
        [`${n}-item-group`]: {
          [`${n}-item-group-list`]: {
            margin: 0,
            padding: 0,
            [`${n}-item, ${n}-submenu-title`]: {
              paddingInline: `${i * 2}px ${u}px`
            }
          }
        },
        // ======================= Sub Menu =======================
        "&-submenu": {
          "&-popup": {
            position: "absolute",
            zIndex: f,
            background: "transparent",
            borderRadius: h,
            boxShadow: "none",
            transformOrigin: "0 0",
            // https://github.com/ant-design/ant-design/issues/13955
            "&::before": {
              position: "absolute",
              inset: `${b}px 0 0`,
              zIndex: -1,
              width: "100%",
              height: "100%",
              opacity: 0,
              content: '""'
            }
          },
          // https://github.com/ant-design/ant-design/issues/13955
          "&-placement-rightTop::before": {
            top: 0,
            insetInlineStart: b
          },
          [`> ${n}`]: k(k(k({
            borderRadius: h
          }, G2(t)), U2(t)), {
            [`${n}-item, ${n}-submenu > ${n}-submenu-title`]: {
              borderRadius: p
            },
            [`${n}-submenu-title::after`]: {
              transition: `transform ${o} ${a}`
            }
          })
        }
      }), U2(t)), {
        [`&-inline-collapsed ${n}-submenu-arrow,
        &-inline ${n}-submenu-arrow`]: {
          // ↓
          "&::before": {
            transform: `rotate(-45deg) translateX(${m})`
          },
          "&::after": {
            transform: `rotate(45deg) translateX(-${m})`
          }
        },
        [`${n}-submenu-open${n}-submenu-inline > ${n}-submenu-title > ${n}-submenu-arrow`]: {
          // ↑
          transform: `translateY(-${g * 0.2}px)`,
          "&::after": {
            transform: `rotate(-45deg) translateX(-${m})`
          },
          "&::before": {
            transform: `rotate(45deg) translateX(${m})`
          }
        }
      })
    },
    // Integration with header element so menu items have the same height
    {
      [`${e}-layout-header`]: {
        [n]: {
          lineHeight: "inherit"
        }
      }
    }
  ];
}, Pee = ((t, e) => Vn("Menu", (i, o) => {
  let {
    overrideComponentToken: r
  } = o;
  if (e?.value === !1)
    return [];
  const {
    colorBgElevated: a,
    colorPrimary: l,
    colorError: s,
    colorErrorHover: u,
    colorTextLightSolid: c
  } = i, {
    controlHeightLG: d,
    fontSize: f
  } = i, h = f / 7 * 5, p = dn(i, {
    menuItemHeight: d,
    menuItemPaddingInline: i.margin,
    menuArrowSize: h,
    menuHorizontalHeight: d * 1.15,
    menuArrowOffset: `${h * 0.25}px`,
    menuPanelMaskInset: -7,
    menuSubMenuBg: a
  }), g = new jn(c).setAlpha(0.65).toRgbString(), m = dn(p, {
    colorItemText: g,
    colorItemTextHover: c,
    colorGroupTitle: g,
    colorItemTextSelected: c,
    colorItemBg: "#001529",
    colorSubItemBg: "#000c17",
    colorItemBgActive: "transparent",
    colorItemBgSelected: l,
    colorActiveBarWidth: 0,
    colorActiveBarHeight: 0,
    colorActiveBarBorderSize: 0,
    // Disabled
    colorItemTextDisabled: new jn(c).setAlpha(0.25).toRgbString(),
    // Danger
    colorDangerItemText: s,
    colorDangerItemTextHover: u,
    colorDangerItemTextSelected: c,
    colorDangerItemBgActive: s,
    colorDangerItemBgSelected: s,
    menuSubMenuBg: "#001529",
    // Horizontal
    colorItemTextSelectedHorizontal: c,
    colorItemBgSelectedHorizontal: l
  }, k({}, r));
  return [
    // Basic
    Tee(p),
    // Horizontal
    Cee(p),
    // Vertical
    kee(p),
    // Theme
    X2(p, "light"),
    X2(m, "dark"),
    // RTL
    $ee(p),
    // Motion
    Oy(p),
    Ml(p, "slide-up"),
    Ml(p, "slide-down"),
    gg(p, "zoom-big")
  ];
}, (i) => {
  const {
    colorPrimary: o,
    colorError: r,
    colorTextDisabled: a,
    colorErrorBg: l,
    colorText: s,
    colorTextDescription: u,
    colorBgContainer: c,
    colorFillAlter: d,
    colorFillContent: f,
    lineWidth: h,
    lineWidthBold: p,
    controlItemBgActive: g,
    colorBgTextHover: m
  } = i;
  return {
    dropdownWidth: 160,
    zIndexPopup: i.zIndexPopupBase + 50,
    radiusItem: i.borderRadiusLG,
    radiusSubMenuItem: i.borderRadiusSM,
    colorItemText: s,
    colorItemTextHover: s,
    colorItemTextHoverHorizontal: o,
    colorGroupTitle: u,
    colorItemTextSelected: o,
    colorItemTextSelectedHorizontal: o,
    colorItemBg: c,
    colorItemBgHover: m,
    colorItemBgActive: f,
    colorSubItemBg: d,
    colorItemBgSelected: g,
    colorItemBgSelectedHorizontal: "transparent",
    colorActiveBarWidth: 0,
    colorActiveBarHeight: p,
    colorActiveBarBorderSize: h,
    // Disabled
    colorItemTextDisabled: a,
    // Danger
    colorDangerItemText: r,
    colorDangerItemTextHover: r,
    colorDangerItemTextSelected: r,
    colorDangerItemBgActive: l,
    colorDangerItemBgSelected: l,
    itemMarginInline: i.marginXXS
  };
})(t)), Eee = () => ({
  id: String,
  prefixCls: String,
  // donot use items, now only support inner use
  items: Array,
  disabled: Boolean,
  inlineCollapsed: Boolean,
  disabledOverflow: Boolean,
  forceSubMenuRender: Boolean,
  openKeys: Array,
  selectedKeys: Array,
  activeKey: String,
  selectable: {
    type: Boolean,
    default: !0
  },
  multiple: {
    type: Boolean,
    default: !1
  },
  tabindex: {
    type: [Number, String]
  },
  motion: Object,
  role: String,
  theme: {
    type: String,
    default: "light"
  },
  mode: {
    type: String,
    default: "vertical"
  },
  inlineIndent: {
    type: Number,
    default: 24
  },
  subMenuOpenDelay: {
    type: Number,
    default: 0
  },
  subMenuCloseDelay: {
    type: Number,
    default: 0.1
  },
  builtinPlacements: {
    type: Object
  },
  triggerSubMenuAction: {
    type: String,
    default: "hover"
  },
  getPopupContainer: Function,
  expandIcon: Function,
  onOpenChange: Function,
  onSelect: Function,
  onDeselect: Function,
  onClick: [Function, Array],
  onFocus: Function,
  onBlur: Function,
  onMousedown: Function,
  "onUpdate:openKeys": Function,
  "onUpdate:selectedKeys": Function,
  "onUpdate:activeKey": Function
}), J2 = [], Bi = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "AMenu",
  inheritAttrs: !1,
  props: Eee(),
  slots: Object,
  setup(t, e) {
    let {
      slots: n,
      emit: i,
      attrs: o
    } = e;
    const {
      direction: r,
      getPrefixCls: a
    } = Ht("menu", t), l = z3(), s = A(() => {
      var U;
      return a("menu", t.prefixCls || ((U = l?.prefixCls) === null || U === void 0 ? void 0 : U.value));
    }), [u, c] = Pee(s, A(() => !l)), d = Te(/* @__PURE__ */ new Map()), f = qt(dee, de(void 0)), h = A(() => f.value !== void 0 ? f.value : t.inlineCollapsed), {
      itemsNodes: p
    } = wee(t), g = Te(!1);
    Lt(() => {
      g.value = !0;
    }), zt(() => {
      $n(!(t.inlineCollapsed === !0 && t.mode !== "inline"), "Menu", "`inlineCollapsed` should only be used when `mode` is inline."), $n(!(f.value !== void 0 && t.inlineCollapsed === !0), "Menu", "`inlineCollapsed` not control Menu under Sider. Should set `collapsed` on Sider instead.");
    });
    const m = de([]), y = de([]), b = de({});
    _e(d, () => {
      const U = {};
      for (const me of d.value.values())
        U[me.key] = me;
      b.value = U;
    }, {
      flush: "post"
    }), zt(() => {
      if (t.activeKey !== void 0) {
        let U = [];
        const me = t.activeKey ? b.value[t.activeKey] : void 0;
        me && t.activeKey !== void 0 ? U = gb([].concat(I(me.parentKeys), t.activeKey)) : U = [], Fd(m.value, U) || (m.value = U);
      }
    }), _e(() => t.selectedKeys, (U) => {
      U && (y.value = U.slice());
    }, {
      immediate: !0,
      deep: !0
    });
    const w = de([]);
    _e([b, y], () => {
      let U = [];
      y.value.forEach((me) => {
        const ce = b.value[me];
        ce && (U = U.concat(I(ce.parentKeys)));
      }), U = gb(U), Fd(w.value, U) || (w.value = U);
    }, {
      immediate: !0
    });
    const $ = (U) => {
      if (t.selectable) {
        const {
          key: me
        } = U, ce = y.value.includes(me);
        let ue;
        t.multiple ? ce ? ue = y.value.filter((he) => he !== me) : ue = [...y.value, me] : ue = [me];
        const fe = k(k({}, U), {
          selectedKeys: ue
        });
        Fd(ue, y.value) || (t.selectedKeys === void 0 && (y.value = ue), i("update:selectedKeys", ue), ce && t.multiple ? i("deselect", fe) : i("select", fe));
      }
      D.value !== "inline" && !t.multiple && C.value.length && L(J2);
    }, C = de([]);
    _e(() => t.openKeys, function() {
      let U = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : C.value;
      Fd(C.value, U) || (C.value = U.slice());
    }, {
      immediate: !0,
      deep: !0
    });
    let P;
    const O = (U) => {
      clearTimeout(P), P = setTimeout(() => {
        t.activeKey === void 0 && (m.value = U), i("update:activeKey", U[U.length - 1]);
      });
    }, E = A(() => !!t.disabled), _ = A(() => r.value === "rtl"), D = de("vertical"), M = Te(!1);
    zt(() => {
      var U;
      (t.mode === "inline" || t.mode === "vertical") && h.value ? (D.value = "vertical", M.value = h.value) : (D.value = t.mode, M.value = !1), !((U = l?.mode) === null || U === void 0) && U.value && (D.value = l.mode.value);
    });
    const N = A(() => D.value === "inline"), L = (U) => {
      C.value = U, i("update:openKeys", U), i("openChange", U);
    }, j = de(C.value), B = Te(!1);
    _e(C, () => {
      N.value && (j.value = C.value);
    }, {
      immediate: !0
    }), _e(N, () => {
      if (!B.value) {
        B.value = !0;
        return;
      }
      N.value ? C.value = j.value : L(J2);
    }, {
      immediate: !0
    });
    const Y = A(() => ({
      [`${s.value}`]: !0,
      [`${s.value}-root`]: !0,
      [`${s.value}-${D.value}`]: !0,
      [`${s.value}-inline-collapsed`]: M.value,
      [`${s.value}-rtl`]: _.value,
      [`${s.value}-${t.theme}`]: !0
    })), Q = A(() => a()), G = A(() => ({
      horizontal: {
        name: `${Q.value}-slide-up`
      },
      inline: Sy(`${Q.value}-motion-collapse`),
      other: {
        name: `${Q.value}-zoom-big`
      }
    }));
    j3(!0);
    const V = function() {
      let U = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
      const me = [], ce = d.value;
      return U.forEach((ue) => {
        const {
          key: fe,
          childrenEventKeys: he
        } = ce.get(ue);
        me.push(fe, ...V(I(he)));
      }), me;
    }, H = (U) => {
      var me;
      i("click", U), $(U), (me = l?.onClick) === null || me === void 0 || me.call(l);
    }, q = (U, me) => {
      var ce;
      const ue = ((ce = b.value[U]) === null || ce === void 0 ? void 0 : ce.childrenEventKeys) || [];
      let fe = C.value.filter((he) => he !== U);
      if (me)
        fe.push(U);
      else if (D.value !== "inline") {
        const he = V(I(ue));
        fe = gb(fe.filter((le) => !he.includes(le)));
      }
      Fd(C, fe) || L(fe);
    }, K = (U, me) => {
      d.value.set(U, me), d.value = new Map(d.value);
    }, ee = (U) => {
      d.value.delete(U), d.value = new Map(d.value);
    }, ie = de(0), ae = A(() => {
      var U;
      return t.expandIcon || n.expandIcon || !((U = l?.expandIcon) === null || U === void 0) && U.value ? (me) => {
        let ce = t.expandIcon || n.expandIcon;
        return ce = typeof ce == "function" ? ce(me) : ce, vi(ce, {
          class: `${s.value}-submenu-expand-icon`
        }, !1);
      } : null;
    });
    V3({
      prefixCls: s,
      activeKeys: m,
      openKeys: C,
      selectedKeys: y,
      changeActiveKeys: O,
      disabled: E,
      rtl: _,
      mode: D,
      inlineIndent: A(() => t.inlineIndent),
      subMenuCloseDelay: A(() => t.subMenuCloseDelay),
      subMenuOpenDelay: A(() => t.subMenuOpenDelay),
      builtinPlacements: A(() => t.builtinPlacements),
      triggerSubMenuAction: A(() => t.triggerSubMenuAction),
      getPopupContainer: A(() => t.getPopupContainer),
      inlineCollapsed: M,
      theme: A(() => t.theme),
      siderCollapsed: f,
      defaultMotions: A(() => g.value ? G.value : null),
      motion: A(() => g.value ? t.motion : null),
      overflowDisabled: Te(void 0),
      onOpenChange: q,
      onItemClick: H,
      registerMenuInfo: K,
      unRegisterMenuInfo: ee,
      selectedSubMenuKeys: w,
      expandIcon: ae,
      forceSubMenuRender: A(() => t.forceSubMenuRender),
      rootClassName: c
    });
    const te = () => {
      var U;
      return p.value || Wi((U = n.default) === null || U === void 0 ? void 0 : U.call(n));
    };
    return () => {
      var U;
      const me = te(), ce = ie.value >= me.length - 1 || D.value !== "horizontal" || t.disabledOverflow, ue = (he) => D.value !== "horizontal" || t.disabledOverflow ? he : (
        // Need wrap for overflow dropdown that do not response for open
        he.map((le, ke) => (
          // Always wrap provider to avoid sub node re-mount
          v(e0, {
            key: le.key,
            overflowDisabled: ke > ie.value
          }, {
            default: () => le
          })
        ))
      ), fe = ((U = n.overflowedIndicator) === null || U === void 0 ? void 0 : U.call(n)) || v(vg, null, null);
      return u(v(bs, J(J({}, o), {}, {
        onMousedown: t.onMousedown,
        prefixCls: `${s.value}-overflow`,
        component: "ul",
        itemComponent: Bf,
        class: [Y.value, o.class, c.value],
        role: "menu",
        id: t.id,
        data: ue(me),
        renderRawItem: (he) => he,
        renderRawRest: (he) => {
          const le = he.length, ke = le ? me.slice(-le) : null;
          return v(tt, null, [v(Ff, {
            eventKey: hm,
            key: hm,
            title: fe,
            disabled: ce,
            internalPopupClose: le === 0
          }, {
            default: () => ke
          }), v(j2, null, {
            default: () => [v(Ff, {
              eventKey: hm,
              key: hm,
              title: fe,
              disabled: ce,
              internalPopupClose: le === 0
            }, {
              default: () => ke
            })]
          })]);
        },
        maxCount: D.value !== "horizontal" || t.disabledOverflow ? bs.INVALIDATE : bs.RESPONSIVE,
        ssr: "full",
        "data-menu-list": !0,
        onVisibleChange: (he) => {
          ie.value = he;
        }
      }), {
        default: () => [v(D0, {
          to: "body"
        }, {
          default: () => [v("div", {
            style: {
              display: "none"
            },
            "aria-hidden": !0
          }, [v(j2, null, {
            default: () => [ue(te())]
          })])]
        })]
      }));
    };
  }
});
Bi.install = function(t) {
  return t.component(Bi.name, Bi), t.component(Bf.name, Bf), t.component(Ff.name, Ff), t.component(n0.name, n0), t.component(t0.name, t0), t;
};
Bi.Item = Bf;
Bi.Divider = n0;
Bi.SubMenu = Ff;
Bi.ItemGroup = t0;
Xi.extend(dB);
Xi.extend(cB);
Xi.extend(rB);
Xi.extend(aB);
Xi.extend(lB);
Xi.extend(sB);
Xi.extend(uB);
Xi.extend((t, e) => {
  const n = e.prototype, i = n.format;
  n.format = function(r) {
    const a = (r || "").replace("Wo", "wo");
    return i.bind(this)(a);
  };
});
const _ee = {
  // ar_EG:
  // az_AZ:
  // bg_BG:
  bn_BD: "bn-bd",
  by_BY: "be",
  // ca_ES:
  // cs_CZ:
  // da_DK:
  // de_DE:
  // el_GR:
  en_GB: "en-gb",
  en_US: "en",
  // es_ES:
  // et_EE:
  // fa_IR:
  // fi_FI:
  fr_BE: "fr",
  fr_CA: "fr-ca",
  // fr_FR:
  // ga_IE:
  // gl_ES:
  // he_IL:
  // hi_IN:
  // hr_HR:
  // hu_HU:
  hy_AM: "hy-am",
  // id_ID:
  // is_IS:
  // it_IT:
  // ja_JP:
  // ka_GE:
  // kk_KZ:
  // km_KH:
  kmr_IQ: "ku",
  // kn_IN:
  // ko_KR:
  // ku_IQ: // previous ku in antd
  // lt_LT:
  // lv_LV:
  // mk_MK:
  // ml_IN:
  // mn_MN:
  // ms_MY:
  // nb_NO:
  // ne_NP:
  nl_BE: "nl-be",
  // nl_NL:
  // pl_PL:
  pt_BR: "pt-br",
  // pt_PT:
  // ro_RO:
  // ru_RU:
  // sk_SK:
  // sl_SI:
  // sr_RS:
  // sv_SE:
  // ta_IN:
  // th_TH:
  // tr_TR:
  // uk_UA:
  // ur_PK:
  // vi_VN:
  zh_CN: "zh-cn",
  zh_HK: "zh-hk",
  zh_TW: "zh-tw"
}, ic = (t) => _ee[t] || t.split("_")[0], eE = () => {
  Yx(!1, "Not match any format. Please help to fire a issue about this.");
}, Iee = /\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|k{1,2}|S/g;
function tE(t, e, n) {
  const i = [...new Set(t.split(n))];
  let o = 0;
  for (let r = 0; r < i.length; r++) {
    const a = i[r];
    if (o += a.length, o > e)
      return a;
    o += n.length;
  }
}
const nE = (t, e) => {
  if (!t) return null;
  if (Xi.isDayjs(t))
    return t;
  const n = e.matchAll(Iee);
  let i = Xi(t, e);
  if (n === null)
    return i;
  for (const o of n) {
    const r = o[0], a = o.index;
    if (r === "Q") {
      const l = t.slice(a - 1, a), s = tE(t, a, l).match(/\d+/)[0];
      i = i.quarter(parseInt(s));
    }
    if (r.toLowerCase() === "wo") {
      const l = t.slice(a - 1, a), s = tE(t, a, l).match(/\d+/)[0];
      i = i.week(parseInt(s));
    }
    r.toLowerCase() === "ww" && (i = i.week(parseInt(t.slice(a, a + r.length)))), r.toLowerCase() === "w" && (i = i.week(parseInt(t.slice(a, a + r.length + 1))));
  }
  return i;
}, Mee = {
  // get
  getNow: () => Xi(),
  getFixedDate: (t) => Xi(t, ["YYYY-M-DD", "YYYY-MM-DD"]),
  getEndDate: (t) => t.endOf("month"),
  getWeekDay: (t) => {
    const e = t.locale("en");
    return e.weekday() + e.localeData().firstDayOfWeek();
  },
  getYear: (t) => t.year(),
  getMonth: (t) => t.month(),
  getDate: (t) => t.date(),
  getHour: (t) => t.hour(),
  getMinute: (t) => t.minute(),
  getSecond: (t) => t.second(),
  // set
  addYear: (t, e) => t.add(e, "year"),
  addMonth: (t, e) => t.add(e, "month"),
  addDate: (t, e) => t.add(e, "day"),
  setYear: (t, e) => t.year(e),
  setMonth: (t, e) => t.month(e),
  setDate: (t, e) => t.date(e),
  setHour: (t, e) => t.hour(e),
  setMinute: (t, e) => t.minute(e),
  setSecond: (t, e) => t.second(e),
  // Compare
  isAfter: (t, e) => t.isAfter(e),
  isValidate: (t) => t.isValid(),
  locale: {
    getWeekFirstDay: (t) => Xi().locale(ic(t)).localeData().firstDayOfWeek(),
    getWeekFirstDate: (t, e) => e.locale(ic(t)).weekday(0),
    getWeek: (t, e) => e.locale(ic(t)).week(),
    getShortWeekDays: (t) => Xi().locale(ic(t)).localeData().weekdaysMin(),
    getShortMonths: (t) => Xi().locale(ic(t)).localeData().monthsShort(),
    format: (t, e, n) => e.locale(ic(t)).format(n),
    parse: (t, e, n) => {
      const i = ic(t);
      for (let o = 0; o < n.length; o += 1) {
        const r = n[o], a = e;
        if (r.includes("wo") || r.includes("Wo")) {
          const s = a.split("-")[0], u = a.split("-")[1], c = Xi(s, "YYYY").startOf("year").locale(i);
          for (let d = 0; d <= 52; d += 1) {
            const f = c.add(d, "week");
            if (f.format("Wo") === u)
              return f;
          }
          return eE(), null;
        }
        const l = Xi(a, r, !0).locale(i);
        if (l.isValid())
          return l;
      }
      return e || eE(), null;
    }
  },
  toDate: (t, e) => Array.isArray(t) ? t.map((n) => nE(n, e)) : nE(t, e),
  toString: (t, e) => Array.isArray(t) ? t.map((n) => Xi.isDayjs(n) ? n.format(e) : n) : Xi.isDayjs(t) ? t.format(e) : t
};
function qi(t) {
  const e = U8();
  return k(k({}, t), e);
}
const Z3 = Symbol("PanelContextProps"), ZC = (t) => {
  Xt(Z3, t);
}, zl = () => qt(Z3, {}), pm = {
  visibility: "hidden"
};
function Hu(t, e) {
  let {
    slots: n
  } = e;
  var i;
  const o = qi(t), {
    prefixCls: r,
    prevIcon: a = "‹",
    nextIcon: l = "›",
    superPrevIcon: s = "«",
    superNextIcon: u = "»",
    onSuperPrev: c,
    onSuperNext: d,
    onPrev: f,
    onNext: h
  } = o, {
    hideNextBtn: p,
    hidePrevBtn: g
  } = zl();
  return v("div", {
    class: r
  }, [c && v("button", {
    type: "button",
    onClick: c,
    tabindex: -1,
    class: `${r}-super-prev-btn`,
    style: g.value ? pm : {}
  }, [s]), f && v("button", {
    type: "button",
    onClick: f,
    tabindex: -1,
    class: `${r}-prev-btn`,
    style: g.value ? pm : {}
  }, [a]), v("div", {
    class: `${r}-view`
  }, [(i = n.default) === null || i === void 0 ? void 0 : i.call(n)]), h && v("button", {
    type: "button",
    onClick: h,
    tabindex: -1,
    class: `${r}-next-btn`,
    style: p.value ? pm : {}
  }, [l]), d && v("button", {
    type: "button",
    onClick: d,
    tabindex: -1,
    class: `${r}-super-next-btn`,
    style: p.value ? pm : {}
  }, [u])]);
}
Hu.displayName = "Header";
Hu.inheritAttrs = !1;
function GC(t) {
  const e = qi(t), {
    prefixCls: n,
    generateConfig: i,
    viewDate: o,
    onPrevDecades: r,
    onNextDecades: a
  } = e, {
    hideHeader: l
  } = zl();
  if (l)
    return null;
  const s = `${n}-header`, u = i.getYear(o), c = Math.floor(u / ds) * ds, d = c + ds - 1;
  return v(Hu, J(J({}, e), {}, {
    prefixCls: s,
    onSuperPrev: r,
    onSuperNext: a
  }), {
    default: () => [c, Ve("-"), d]
  });
}
GC.displayName = "DecadeHeader";
GC.inheritAttrs = !1;
function G3(t, e, n, i, o) {
  let r = t.setHour(e, n);
  return r = t.setMinute(r, i), r = t.setSecond(r, o), r;
}
function cv(t, e, n) {
  if (!n)
    return e;
  let i = e;
  return i = t.setHour(i, t.getHour(n)), i = t.setMinute(i, t.getMinute(n)), i = t.setSecond(i, t.getSecond(n)), i;
}
function Aee(t, e, n, i, o, r) {
  const a = Math.floor(t / i) * i;
  if (a < t)
    return [a, 60 - o, 60 - r];
  const l = Math.floor(e / o) * o;
  if (l < e)
    return [a, l, 60 - r];
  const s = Math.floor(n / r) * r;
  return [a, l, s];
}
function Ree(t, e) {
  const n = t.getYear(e), i = t.getMonth(e) + 1, o = t.getEndDate(t.getFixedDate(`${n}-${i}-01`)), r = t.getDate(o), a = i < 10 ? `0${i}` : `${i}`;
  return `${n}-${a}-${r}`;
}
function sd(t) {
  const {
    prefixCls: e,
    disabledDate: n,
    onSelect: i,
    picker: o,
    rowNum: r,
    colNum: a,
    prefixColumn: l,
    rowClassName: s,
    baseDate: u,
    getCellClassName: c,
    getCellText: d,
    getCellNode: f,
    getCellDate: h,
    generateConfig: p,
    titleCell: g,
    headerCells: m
  } = qi(t), {
    onDateMouseenter: y,
    onDateMouseleave: b,
    mode: w
  } = zl(), $ = `${e}-cell`, C = [];
  for (let P = 0; P < r; P += 1) {
    const O = [];
    let E;
    for (let _ = 0; _ < a; _ += 1) {
      const D = P * a + _, M = h(u, D), N = kO({
        cellDate: M,
        mode: w.value,
        disabledDate: n,
        generateConfig: p
      });
      _ === 0 && (E = M, l && O.push(l(E)));
      const L = g && g(M);
      O.push(v("td", {
        key: _,
        title: L,
        class: Ae($, k({
          [`${$}-disabled`]: N,
          [`${$}-start`]: d(M) === 1 || o === "year" && Number(L) % 10 === 0,
          [`${$}-end`]: L === Ree(p, M) || o === "year" && Number(L) % 10 === 9
        }, c(M))),
        onClick: (j) => {
          j.stopPropagation(), N || i(M);
        },
        onMouseenter: () => {
          !N && y && y(M);
        },
        onMouseleave: () => {
          !N && b && b(M);
        }
      }, [f ? f(M) : v("div", {
        class: `${$}-inner`
      }, [d(M)])]));
    }
    C.push(v("tr", {
      key: P,
      class: s && s(E)
    }, [O]));
  }
  return v("div", {
    class: `${e}-body`
  }, [v("table", {
    class: `${e}-content`
  }, [m && v("thead", null, [v("tr", null, [m])]), v("tbody", null, [C])])]);
}
sd.displayName = "PanelBody";
sd.inheritAttrs = !1;
const wO = 3, iE = 4;
function UC(t) {
  const e = qi(t), n = Aa - 1, {
    prefixCls: i,
    viewDate: o,
    generateConfig: r
  } = e, a = `${i}-cell`, l = r.getYear(o), s = Math.floor(l / Aa) * Aa, u = Math.floor(l / ds) * ds, c = u + ds - 1, d = r.setYear(o, u - Math.ceil((wO * iE * Aa - ds) / 2)), f = (h) => {
    const p = r.getYear(h), g = p + n;
    return {
      [`${a}-in-view`]: u <= p && g <= c,
      [`${a}-selected`]: p === s
    };
  };
  return v(sd, J(J({}, e), {}, {
    rowNum: iE,
    colNum: wO,
    baseDate: d,
    getCellText: (h) => {
      const p = r.getYear(h);
      return `${p}-${p + n}`;
    },
    getCellClassName: f,
    getCellDate: (h, p) => r.addYear(h, p * Aa)
  }), null);
}
UC.displayName = "DecadeBody";
UC.inheritAttrs = !1;
const gm = /* @__PURE__ */ new Map();
function Dee(t, e) {
  let n;
  function i() {
    hy(t) ? e() : n = Gt(() => {
      i();
    });
  }
  return i(), () => {
    Gt.cancel(n);
  };
}
function CO(t, e, n) {
  if (gm.get(t) && Gt.cancel(gm.get(t)), n <= 0) {
    gm.set(t, Gt(() => {
      t.scrollTop = e;
    }));
    return;
  }
  const o = (e - t.scrollTop) / n * 10;
  gm.set(t, Gt(() => {
    t.scrollTop += o, t.scrollTop !== e && CO(t, e, n - 10);
  }));
}
function uh(t, e) {
  let {
    onLeftRight: n,
    onCtrlLeftRight: i,
    onUpDown: o,
    onPageUpDown: r,
    onEnter: a
  } = e;
  const {
    which: l,
    ctrlKey: s,
    metaKey: u
  } = t;
  switch (l) {
    case lt.LEFT:
      if (s || u) {
        if (i)
          return i(-1), !0;
      } else if (n)
        return n(-1), !0;
      break;
    case lt.RIGHT:
      if (s || u) {
        if (i)
          return i(1), !0;
      } else if (n)
        return n(1), !0;
      break;
    case lt.UP:
      if (o)
        return o(-1), !0;
      break;
    case lt.DOWN:
      if (o)
        return o(1), !0;
      break;
    case lt.PAGE_UP:
      if (r)
        return r(-1), !0;
      break;
    case lt.PAGE_DOWN:
      if (r)
        return r(1), !0;
      break;
    case lt.ENTER:
      if (a)
        return a(), !0;
      break;
  }
  return !1;
}
function U3(t, e, n, i) {
  let o = t;
  if (!o)
    switch (e) {
      case "time":
        o = i ? "hh:mm:ss a" : "HH:mm:ss";
        break;
      case "week":
        o = "gggg-wo";
        break;
      case "month":
        o = "YYYY-MM";
        break;
      case "quarter":
        o = "YYYY-[Q]Q";
        break;
      case "year":
        o = "YYYY";
        break;
      default:
        o = n ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
    }
  return o;
}
function J3(t, e, n) {
  const i = t === "time" ? 8 : 10, o = typeof e == "function" ? e(n.getNow()).length : e.length;
  return Math.max(i, o) + 2;
}
let Ih = null;
const mm = /* @__PURE__ */ new Set();
function Nee(t) {
  return !Ih && typeof window < "u" && window.addEventListener && (Ih = (e) => {
    [...mm].forEach((n) => {
      n(e);
    });
  }, window.addEventListener("mousedown", Ih)), mm.add(t), () => {
    mm.delete(t), mm.size === 0 && (window.removeEventListener("mousedown", Ih), Ih = null);
  };
}
function Lee(t) {
  var e;
  const n = t.target;
  return t.composed && n.shadowRoot && ((e = t.composedPath) === null || e === void 0 ? void 0 : e.call(t)[0]) || n;
}
const zee = (t) => t === "month" || t === "date" ? "year" : t, Bee = (t) => t === "date" ? "month" : t, Fee = (t) => t === "month" || t === "date" ? "quarter" : t, Vee = (t) => t === "date" ? "week" : t, Qee = {
  year: zee,
  month: Bee,
  quarter: Fee,
  week: Vee,
  time: null,
  date: null
};
function e5(t, e) {
  return process.env.NODE_ENV === "test" ? !1 : t.some((n) => n && n.contains(e));
}
const Aa = 10, ds = Aa * 10;
function JC(t) {
  const e = qi(t), {
    prefixCls: n,
    onViewDateChange: i,
    generateConfig: o,
    viewDate: r,
    operationRef: a,
    onSelect: l,
    onPanelChange: s
  } = e, u = `${n}-decade-panel`;
  a.value = {
    onKeydown: (f) => uh(f, {
      onLeftRight: (h) => {
        l(o.addYear(r, h * Aa), "key");
      },
      onCtrlLeftRight: (h) => {
        l(o.addYear(r, h * ds), "key");
      },
      onUpDown: (h) => {
        l(o.addYear(r, h * Aa * wO), "key");
      },
      onEnter: () => {
        s("year", r);
      }
    })
  };
  const c = (f) => {
    const h = o.addYear(r, f * ds);
    i(h), s(null, h);
  }, d = (f) => {
    l(f, "mouse"), s("year", f);
  };
  return v("div", {
    class: u
  }, [v(GC, J(J({}, e), {}, {
    prefixCls: n,
    onPrevDecades: () => {
      c(-1);
    },
    onNextDecades: () => {
      c(1);
    }
  }), null), v(UC, J(J({}, e), {}, {
    prefixCls: n,
    onSelect: d
  }), null)]);
}
JC.displayName = "DecadePanel";
JC.inheritAttrs = !1;
const dv = 7;
function ud(t, e) {
  if (!t && !e)
    return !0;
  if (!t || !e)
    return !1;
}
function Hee(t, e, n) {
  const i = ud(e, n);
  if (typeof i == "boolean")
    return i;
  const o = Math.floor(t.getYear(e) / 10), r = Math.floor(t.getYear(n) / 10);
  return o === r;
}
function wy(t, e, n) {
  const i = ud(e, n);
  return typeof i == "boolean" ? i : t.getYear(e) === t.getYear(n);
}
function $O(t, e) {
  return Math.floor(t.getMonth(e) / 3) + 1;
}
function t5(t, e, n) {
  const i = ud(e, n);
  return typeof i == "boolean" ? i : wy(t, e, n) && $O(t, e) === $O(t, n);
}
function e$(t, e, n) {
  const i = ud(e, n);
  return typeof i == "boolean" ? i : wy(t, e, n) && t.getMonth(e) === t.getMonth(n);
}
function fs(t, e, n) {
  const i = ud(e, n);
  return typeof i == "boolean" ? i : t.getYear(e) === t.getYear(n) && t.getMonth(e) === t.getMonth(n) && t.getDate(e) === t.getDate(n);
}
function Wee(t, e, n) {
  const i = ud(e, n);
  return typeof i == "boolean" ? i : t.getHour(e) === t.getHour(n) && t.getMinute(e) === t.getMinute(n) && t.getSecond(e) === t.getSecond(n);
}
function n5(t, e, n, i) {
  const o = ud(n, i);
  return typeof o == "boolean" ? o : t.locale.getWeek(e, n) === t.locale.getWeek(e, i);
}
function sf(t, e, n) {
  return fs(t, e, n) && Wee(t, e, n);
}
function vm(t, e, n, i) {
  return !e || !n || !i ? !1 : !fs(t, e, i) && !fs(t, n, i) && t.isAfter(i, e) && t.isAfter(n, i);
}
function jee(t, e, n) {
  const i = e.locale.getWeekFirstDay(t), o = e.setDate(n, 1), r = e.getWeekDay(o);
  let a = e.addDate(o, i - r);
  return e.getMonth(a) === e.getMonth(n) && e.getDate(a) > 1 && (a = e.addDate(a, -7)), a;
}
function lp(t, e, n) {
  let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 1;
  switch (e) {
    case "year":
      return n.addYear(t, i * 10);
    case "quarter":
    case "month":
      return n.addYear(t, i);
    default:
      return n.addMonth(t, i);
  }
}
function Mo(t, e) {
  let {
    generateConfig: n,
    locale: i,
    format: o
  } = e;
  return typeof o == "function" ? o(t) : n.locale.format(i.locale, t, o);
}
function i5(t, e) {
  let {
    generateConfig: n,
    locale: i,
    formatList: o
  } = e;
  return !t || typeof o[0] == "function" ? null : n.locale.parse(i.locale, t, o);
}
function kO(t) {
  let {
    cellDate: e,
    mode: n,
    disabledDate: i,
    generateConfig: o
  } = t;
  if (!i) return !1;
  const r = (a, l, s) => {
    let u = l;
    for (; u <= s; ) {
      let c;
      switch (a) {
        case "date": {
          if (c = o.setDate(e, u), !i(c))
            return !1;
          break;
        }
        case "month": {
          if (c = o.setMonth(e, u), !kO({
            cellDate: c,
            mode: "month",
            generateConfig: o,
            disabledDate: i
          }))
            return !1;
          break;
        }
        case "year": {
          if (c = o.setYear(e, u), !kO({
            cellDate: c,
            mode: "year",
            generateConfig: o,
            disabledDate: i
          }))
            return !1;
          break;
        }
      }
      u += 1;
    }
    return !0;
  };
  switch (n) {
    case "date":
    case "week":
      return i(e);
    case "month": {
      const l = o.getDate(o.getEndDate(e));
      return r("date", 1, l);
    }
    case "quarter": {
      const a = Math.floor(o.getMonth(e) / 3) * 3, l = a + 2;
      return r("month", a, l);
    }
    case "year":
      return r("month", 0, 11);
    case "decade": {
      const a = o.getYear(e), l = Math.floor(a / Aa) * Aa, s = l + Aa - 1;
      return r("year", l, s);
    }
  }
}
function t$(t) {
  const e = qi(t), {
    hideHeader: n
  } = zl();
  if (n.value)
    return null;
  const {
    prefixCls: i,
    generateConfig: o,
    locale: r,
    value: a,
    format: l
  } = e, s = `${i}-header`;
  return v(Hu, {
    prefixCls: s
  }, {
    default: () => [a ? Mo(a, {
      locale: r,
      format: l,
      generateConfig: o
    }) : " "]
  });
}
t$.displayName = "TimeHeader";
t$.inheritAttrs = !1;
const ym = Oe({
  name: "TimeUnitColumn",
  props: ["prefixCls", "units", "onSelect", "value", "active", "hideDisabledOptions"],
  setup(t) {
    const {
      open: e
    } = zl(), n = Te(null), i = de(/* @__PURE__ */ new Map()), o = de();
    return _e(() => t.value, () => {
      const r = i.value.get(t.value);
      r && e.value !== !1 && CO(n.value, r.offsetTop, 120);
    }), tn(() => {
      var r;
      (r = o.value) === null || r === void 0 || r.call(o);
    }), _e(e, () => {
      var r;
      (r = o.value) === null || r === void 0 || r.call(o), rn(() => {
        if (e.value) {
          const a = i.value.get(t.value);
          a && (o.value = Dee(a, () => {
            CO(n.value, a.offsetTop, 0);
          }));
        }
      });
    }, {
      immediate: !0,
      flush: "post"
    }), () => {
      const {
        prefixCls: r,
        units: a,
        onSelect: l,
        value: s,
        active: u,
        hideDisabledOptions: c
      } = t, d = `${r}-cell`;
      return v("ul", {
        class: Ae(`${r}-column`, {
          [`${r}-column-active`]: u
        }),
        ref: n,
        style: {
          position: "relative"
        }
      }, [a.map((f) => c && f.disabled ? null : v("li", {
        key: f.value,
        ref: (h) => {
          i.value.set(f.value, h);
        },
        class: Ae(d, {
          [`${d}-disabled`]: f.disabled,
          [`${d}-selected`]: s === f.value
        }),
        onClick: () => {
          f.disabled || l(f.value);
        }
      }, [v("div", {
        class: `${d}-inner`
      }, [f.label])]))]);
    };
  }
});
function o5(t, e) {
  let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "0", i = String(t);
  for (; i.length < e; )
    i = `${n}${t}`;
  return i;
}
const qee = function() {
  for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++)
    e[n] = arguments[n];
  return e;
};
function r5(t) {
  return t == null ? [] : Array.isArray(t) ? t : [t];
}
function a5(t) {
  const e = {};
  return Object.keys(t).forEach((n) => {
    (n.startsWith("data-") || n.startsWith("aria-") || n === "role" || n === "name") && !n.startsWith("data-__") && (e[n] = t[n]);
  }), e;
}
function vn(t, e) {
  return t ? t[e] : null;
}
function ta(t, e, n) {
  const i = [vn(t, 0), vn(t, 1)];
  return i[n] = typeof e == "function" ? e(i[n]) : e, !i[0] && !i[1] ? null : i;
}
function o1(t, e, n, i) {
  const o = [];
  for (let r = t; r <= e; r += n)
    o.push({
      label: o5(r, 2),
      value: r,
      disabled: (i || []).includes(r)
    });
  return o;
}
const Yee = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "TimeBody",
  inheritAttrs: !1,
  props: ["generateConfig", "prefixCls", "operationRef", "activeColumnIndex", "value", "showHour", "showMinute", "showSecond", "use12Hours", "hourStep", "minuteStep", "secondStep", "disabledHours", "disabledMinutes", "disabledSeconds", "disabledTime", "hideDisabledOptions", "onSelect"],
  setup(t) {
    const e = A(() => t.value ? t.generateConfig.getHour(t.value) : -1), n = A(() => t.use12Hours ? e.value >= 12 : !1), i = A(() => t.use12Hours ? e.value % 12 : e.value), o = A(() => t.value ? t.generateConfig.getMinute(t.value) : -1), r = A(() => t.value ? t.generateConfig.getSecond(t.value) : -1), a = de(t.generateConfig.getNow()), l = de(), s = de(), u = de();
    gw(() => {
      a.value = t.generateConfig.getNow();
    }), zt(() => {
      if (t.disabledTime) {
        const m = t.disabledTime(a);
        [l.value, s.value, u.value] = [m.disabledHours, m.disabledMinutes, m.disabledSeconds];
      } else
        [l.value, s.value, u.value] = [t.disabledHours, t.disabledMinutes, t.disabledSeconds];
    });
    const c = (m, y, b, w) => {
      let $ = t.value || t.generateConfig.getNow();
      const C = Math.max(0, y), P = Math.max(0, b), O = Math.max(0, w);
      return $ = G3(t.generateConfig, $, !t.use12Hours || !m ? C : C + 12, P, O), $;
    }, d = A(() => {
      var m;
      return o1(0, 23, (m = t.hourStep) !== null && m !== void 0 ? m : 1, l.value && l.value());
    }), f = A(() => {
      if (!t.use12Hours)
        return [!1, !1];
      const m = [!0, !0];
      return d.value.forEach((y) => {
        let {
          disabled: b,
          value: w
        } = y;
        b || (w >= 12 ? m[1] = !1 : m[0] = !1);
      }), m;
    }), h = A(() => t.use12Hours ? d.value.filter(n.value ? (m) => m.value >= 12 : (m) => m.value < 12).map((m) => {
      const y = m.value % 12, b = y === 0 ? "12" : o5(y, 2);
      return k(k({}, m), {
        label: b,
        value: y
      });
    }) : d.value), p = A(() => {
      var m;
      return o1(0, 59, (m = t.minuteStep) !== null && m !== void 0 ? m : 1, s.value && s.value(e.value));
    }), g = A(() => {
      var m;
      return o1(0, 59, (m = t.secondStep) !== null && m !== void 0 ? m : 1, u.value && u.value(e.value, o.value));
    });
    return () => {
      const {
        prefixCls: m,
        operationRef: y,
        activeColumnIndex: b,
        showHour: w,
        showMinute: $,
        showSecond: C,
        use12Hours: P,
        hideDisabledOptions: O,
        onSelect: E
      } = t, _ = [], D = `${m}-content`, M = `${m}-time-panel`;
      y.value = {
        onUpDown: (j) => {
          const B = _[b];
          if (B) {
            const Y = B.units.findIndex((G) => G.value === B.value), Q = B.units.length;
            for (let G = 1; G < Q; G += 1) {
              const V = B.units[(Y + j * G + Q) % Q];
              if (V.disabled !== !0) {
                B.onSelect(V.value);
                break;
              }
            }
          }
        }
      };
      function N(j, B, Y, Q, G) {
        j !== !1 && _.push({
          node: vi(B, {
            prefixCls: M,
            value: Y,
            active: b === _.length,
            onSelect: G,
            units: Q,
            hideDisabledOptions: O
          }),
          onSelect: G,
          value: Y,
          units: Q
        });
      }
      N(w, v(ym, {
        key: "hour"
      }, null), i.value, h.value, (j) => {
        E(c(n.value, j, o.value, r.value), "mouse");
      }), N($, v(ym, {
        key: "minute"
      }, null), o.value, p.value, (j) => {
        E(c(n.value, i.value, j, r.value), "mouse");
      }), N(C, v(ym, {
        key: "second"
      }, null), r.value, g.value, (j) => {
        E(c(n.value, i.value, o.value, j), "mouse");
      });
      let L = -1;
      return typeof n.value == "boolean" && (L = n.value ? 1 : 0), N(P === !0, v(ym, {
        key: "12hours"
      }, null), L, [{
        label: "AM",
        value: 0,
        disabled: f.value[0]
      }, {
        label: "PM",
        value: 1,
        disabled: f.value[1]
      }], (j) => {
        E(c(!!j, i.value, o.value, r.value), "mouse");
      }), v("div", {
        class: D
      }, [_.map((j) => {
        let {
          node: B
        } = j;
        return B;
      })]);
    };
  }
}), Kee = (t) => t.filter((e) => e !== !1).length;
function Cy(t) {
  const e = qi(t), {
    generateConfig: n,
    format: i = "HH:mm:ss",
    prefixCls: o,
    active: r,
    operationRef: a,
    showHour: l,
    showMinute: s,
    showSecond: u,
    use12Hours: c = !1,
    onSelect: d,
    value: f
  } = e, h = `${o}-time-panel`, p = de(), g = de(-1), m = Kee([l, s, u, c]);
  return a.value = {
    onKeydown: (y) => uh(y, {
      onLeftRight: (b) => {
        g.value = (g.value + b + m) % m;
      },
      onUpDown: (b) => {
        g.value === -1 ? g.value = 0 : p.value && p.value.onUpDown(b);
      },
      onEnter: () => {
        d(f || n.getNow(), "key"), g.value = -1;
      }
    }),
    onBlur: () => {
      g.value = -1;
    }
  }, v("div", {
    class: Ae(h, {
      [`${h}-active`]: r
    })
  }, [v(t$, J(J({}, e), {}, {
    format: i,
    prefixCls: o
  }), null), v(Yee, J(J({}, e), {}, {
    prefixCls: o,
    activeColumnIndex: g.value,
    operationRef: p
  }), null)]);
}
Cy.displayName = "TimePanel";
Cy.inheritAttrs = !1;
function $y(t) {
  let {
    cellPrefixCls: e,
    generateConfig: n,
    rangedValue: i,
    hoverRangedValue: o,
    isInView: r,
    isSameCell: a,
    offsetCell: l,
    today: s,
    value: u
  } = t;
  function c(d) {
    const f = l(d, -1), h = l(d, 1), p = vn(i, 0), g = vn(i, 1), m = vn(o, 0), y = vn(o, 1), b = vm(n, m, y, d);
    function w(_) {
      return a(p, _);
    }
    function $(_) {
      return a(g, _);
    }
    const C = a(m, d), P = a(y, d), O = (b || P) && (!r(f) || $(f)), E = (b || C) && (!r(h) || w(h));
    return {
      // In view
      [`${e}-in-view`]: r(d),
      // Range
      [`${e}-in-range`]: vm(n, p, g, d),
      [`${e}-range-start`]: w(d),
      [`${e}-range-end`]: $(d),
      [`${e}-range-start-single`]: w(d) && !g,
      [`${e}-range-end-single`]: $(d) && !p,
      [`${e}-range-start-near-hover`]: w(d) && (a(f, m) || vm(n, m, y, f)),
      [`${e}-range-end-near-hover`]: $(d) && (a(h, y) || vm(n, m, y, h)),
      // Range Hover
      [`${e}-range-hover`]: b,
      [`${e}-range-hover-start`]: C,
      [`${e}-range-hover-end`]: P,
      // Range Edge
      [`${e}-range-hover-edge-start`]: O,
      [`${e}-range-hover-edge-end`]: E,
      [`${e}-range-hover-edge-start-near-range`]: O && a(f, g),
      [`${e}-range-hover-edge-end-near-range`]: E && a(h, p),
      // Others
      [`${e}-today`]: a(s, d),
      [`${e}-selected`]: a(u, d)
    };
  }
  return c;
}
const l5 = Symbol("RangeContextProps"), Xee = (t) => {
  Xt(l5, t);
}, yg = () => qt(l5, {
  rangedValue: de(),
  hoverRangedValue: de(),
  inRange: de(),
  panelPosition: de()
}), Zee = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "PanelContextProvider",
  inheritAttrs: !1,
  props: {
    value: {
      type: Object,
      default: () => ({})
    }
  },
  setup(t, e) {
    let {
      slots: n
    } = e;
    const i = {
      rangedValue: de(t.value.rangedValue),
      hoverRangedValue: de(t.value.hoverRangedValue),
      inRange: de(t.value.inRange),
      panelPosition: de(t.value.panelPosition)
    };
    return Xee(i), _e(() => t.value, () => {
      Object.keys(t.value).forEach((o) => {
        i[o] && (i[o].value = t.value[o]);
      });
    }), () => {
      var o;
      return (o = n.default) === null || o === void 0 ? void 0 : o.call(n);
    };
  }
});
function ky(t) {
  const e = qi(t), {
    prefixCls: n,
    generateConfig: i,
    prefixColumn: o,
    locale: r,
    rowCount: a,
    viewDate: l,
    value: s,
    dateRender: u
  } = e, {
    rangedValue: c,
    hoverRangedValue: d
  } = yg(), f = jee(r.locale, i, l), h = `${n}-cell`, p = i.locale.getWeekFirstDay(r.locale), g = i.getNow(), m = [], y = r.shortWeekDays || (i.locale.getShortWeekDays ? i.locale.getShortWeekDays(r.locale) : []);
  o && m.push(v("th", {
    key: "empty",
    "aria-label": "empty cell"
  }, null));
  for (let $ = 0; $ < dv; $ += 1)
    m.push(v("th", {
      key: $
    }, [y[($ + p) % dv]]));
  const b = $y({
    cellPrefixCls: h,
    today: g,
    value: s,
    generateConfig: i,
    rangedValue: o ? null : c.value,
    hoverRangedValue: o ? null : d.value,
    isSameCell: ($, C) => fs(i, $, C),
    isInView: ($) => e$(i, $, l),
    offsetCell: ($, C) => i.addDate($, C)
  }), w = u ? ($) => u({
    current: $,
    today: g
  }) : void 0;
  return v(sd, J(J({}, e), {}, {
    rowNum: a,
    colNum: dv,
    baseDate: f,
    getCellNode: w,
    getCellText: i.getDate,
    getCellClassName: b,
    getCellDate: i.addDate,
    titleCell: ($) => Mo($, {
      locale: r,
      format: "YYYY-MM-DD",
      generateConfig: i
    }),
    headerCells: m
  }), null);
}
ky.displayName = "DateBody";
ky.inheritAttrs = !1;
ky.props = [
  "prefixCls",
  "generateConfig",
  "value?",
  "viewDate",
  "locale",
  "rowCount",
  "onSelect",
  "dateRender?",
  "disabledDate?",
  // Used for week panel
  "prefixColumn?",
  "rowClassName?"
];
function n$(t) {
  const e = qi(t), {
    prefixCls: n,
    generateConfig: i,
    locale: o,
    viewDate: r,
    onNextMonth: a,
    onPrevMonth: l,
    onNextYear: s,
    onPrevYear: u,
    onYearClick: c,
    onMonthClick: d
  } = e, {
    hideHeader: f
  } = zl();
  if (f.value)
    return null;
  const h = `${n}-header`, p = o.shortMonths || (i.locale.getShortMonths ? i.locale.getShortMonths(o.locale) : []), g = i.getMonth(r), m = v("button", {
    type: "button",
    key: "year",
    onClick: c,
    tabindex: -1,
    class: `${n}-year-btn`
  }, [Mo(r, {
    locale: o,
    format: o.yearFormat,
    generateConfig: i
  })]), y = v("button", {
    type: "button",
    key: "month",
    onClick: d,
    tabindex: -1,
    class: `${n}-month-btn`
  }, [o.monthFormat ? Mo(r, {
    locale: o,
    format: o.monthFormat,
    generateConfig: i
  }) : p[g]]), b = o.monthBeforeYear ? [y, m] : [m, y];
  return v(Hu, J(J({}, e), {}, {
    prefixCls: h,
    onSuperPrev: u,
    onPrev: l,
    onNext: a,
    onSuperNext: s
  }), {
    default: () => [b]
  });
}
n$.displayName = "DateHeader";
n$.inheritAttrs = !1;
const Gee = 6;
function bg(t) {
  const e = qi(t), {
    prefixCls: n,
    panelName: i = "date",
    keyboardConfig: o,
    active: r,
    operationRef: a,
    generateConfig: l,
    value: s,
    viewDate: u,
    onViewDateChange: c,
    onPanelChange: d,
    onSelect: f
  } = e, h = `${n}-${i}-panel`;
  a.value = {
    onKeydown: (m) => uh(m, k({
      onLeftRight: (y) => {
        f(l.addDate(s || u, y), "key");
      },
      onCtrlLeftRight: (y) => {
        f(l.addYear(s || u, y), "key");
      },
      onUpDown: (y) => {
        f(l.addDate(s || u, y * dv), "key");
      },
      onPageUpDown: (y) => {
        f(l.addMonth(s || u, y), "key");
      }
    }, o))
  };
  const p = (m) => {
    const y = l.addYear(u, m);
    c(y), d(null, y);
  }, g = (m) => {
    const y = l.addMonth(u, m);
    c(y), d(null, y);
  };
  return v("div", {
    class: Ae(h, {
      [`${h}-active`]: r
    })
  }, [v(n$, J(J({}, e), {}, {
    prefixCls: n,
    value: s,
    viewDate: u,
    onPrevYear: () => {
      p(-1);
    },
    onNextYear: () => {
      p(1);
    },
    onPrevMonth: () => {
      g(-1);
    },
    onNextMonth: () => {
      g(1);
    },
    onMonthClick: () => {
      d("month", u);
    },
    onYearClick: () => {
      d("year", u);
    }
  }), null), v(ky, J(J({}, e), {}, {
    onSelect: (m) => f(m, "mouse"),
    prefixCls: n,
    value: s,
    viewDate: u,
    rowCount: Gee
  }), null)]);
}
bg.displayName = "DatePanel";
bg.inheritAttrs = !1;
const oE = qee("date", "time");
function i$(t) {
  const e = qi(t), {
    prefixCls: n,
    operationRef: i,
    generateConfig: o,
    value: r,
    defaultValue: a,
    disabledTime: l,
    showTime: s,
    onSelect: u
  } = e, c = `${n}-datetime-panel`, d = de(null), f = de({}), h = de({}), p = typeof s == "object" ? k({}, s) : {};
  function g(w) {
    const $ = oE.indexOf(d.value) + w;
    return oE[$] || null;
  }
  const m = (w) => {
    h.value.onBlur && h.value.onBlur(w), d.value = null;
  };
  i.value = {
    onKeydown: (w) => {
      if (w.which === lt.TAB) {
        const $ = g(w.shiftKey ? -1 : 1);
        return d.value = $, $ && w.preventDefault(), !0;
      }
      if (d.value) {
        const $ = d.value === "date" ? f : h;
        return $.value && $.value.onKeydown && $.value.onKeydown(w), !0;
      }
      return [lt.LEFT, lt.RIGHT, lt.UP, lt.DOWN].includes(w.which) ? (d.value = "date", !0) : !1;
    },
    onBlur: m,
    onClose: m
  };
  const y = (w, $) => {
    let C = w;
    $ === "date" && !r && p.defaultValue ? (C = o.setHour(C, o.getHour(p.defaultValue)), C = o.setMinute(C, o.getMinute(p.defaultValue)), C = o.setSecond(C, o.getSecond(p.defaultValue))) : $ === "time" && !r && a && (C = o.setYear(C, o.getYear(a)), C = o.setMonth(C, o.getMonth(a)), C = o.setDate(C, o.getDate(a))), u && u(C, "mouse");
  }, b = l ? l(r || null) : {};
  return v("div", {
    class: Ae(c, {
      [`${c}-active`]: d.value
    })
  }, [v(bg, J(J({}, e), {}, {
    operationRef: f,
    active: d.value === "date",
    onSelect: (w) => {
      y(cv(o, w, !r && typeof s == "object" ? s.defaultValue : null), "date");
    }
  }), null), v(Cy, J(J(J(J({}, e), {}, {
    format: void 0
  }, p), b), {}, {
    disabledTime: null,
    defaultValue: void 0,
    operationRef: h,
    active: d.value === "time",
    onSelect: (w) => {
      y(w, "time");
    }
  }), null)]);
}
i$.displayName = "DatetimePanel";
i$.inheritAttrs = !1;
function o$(t) {
  const e = qi(t), {
    prefixCls: n,
    generateConfig: i,
    locale: o,
    value: r
  } = e, a = `${n}-cell`, l = (c) => v("td", {
    key: "week",
    class: Ae(a, `${a}-week`)
  }, [i.locale.getWeek(o.locale, c)]), s = `${n}-week-panel-row`, u = (c) => Ae(s, {
    [`${s}-selected`]: n5(i, o.locale, r, c)
  });
  return v(bg, J(J({}, e), {}, {
    panelName: "week",
    prefixColumn: l,
    rowClassName: u,
    keyboardConfig: {
      onLeftRight: null
    }
  }), null);
}
o$.displayName = "WeekPanel";
o$.inheritAttrs = !1;
function r$(t) {
  const e = qi(t), {
    prefixCls: n,
    generateConfig: i,
    locale: o,
    viewDate: r,
    onNextYear: a,
    onPrevYear: l,
    onYearClick: s
  } = e, {
    hideHeader: u
  } = zl();
  if (u.value)
    return null;
  const c = `${n}-header`;
  return v(Hu, J(J({}, e), {}, {
    prefixCls: c,
    onSuperPrev: l,
    onSuperNext: a
  }), {
    default: () => [v("button", {
      type: "button",
      onClick: s,
      class: `${n}-year-btn`
    }, [Mo(r, {
      locale: o,
      format: o.yearFormat,
      generateConfig: i
    })])]
  });
}
r$.displayName = "MonthHeader";
r$.inheritAttrs = !1;
const s5 = 3, Uee = 4;
function a$(t) {
  const e = qi(t), {
    prefixCls: n,
    locale: i,
    value: o,
    viewDate: r,
    generateConfig: a,
    monthCellRender: l
  } = e, {
    rangedValue: s,
    hoverRangedValue: u
  } = yg(), c = `${n}-cell`, d = $y({
    cellPrefixCls: c,
    value: o,
    generateConfig: a,
    rangedValue: s.value,
    hoverRangedValue: u.value,
    isSameCell: (g, m) => e$(a, g, m),
    isInView: () => !0,
    offsetCell: (g, m) => a.addMonth(g, m)
  }), f = i.shortMonths || (a.locale.getShortMonths ? a.locale.getShortMonths(i.locale) : []), h = a.setMonth(r, 0), p = l ? (g) => l({
    current: g,
    locale: i
  }) : void 0;
  return v(sd, J(J({}, e), {}, {
    rowNum: Uee,
    colNum: s5,
    baseDate: h,
    getCellNode: p,
    getCellText: (g) => i.monthFormat ? Mo(g, {
      locale: i,
      format: i.monthFormat,
      generateConfig: a
    }) : f[a.getMonth(g)],
    getCellClassName: d,
    getCellDate: a.addMonth,
    titleCell: (g) => Mo(g, {
      locale: i,
      format: "YYYY-MM",
      generateConfig: a
    })
  }), null);
}
a$.displayName = "MonthBody";
a$.inheritAttrs = !1;
function l$(t) {
  const e = qi(t), {
    prefixCls: n,
    operationRef: i,
    onViewDateChange: o,
    generateConfig: r,
    value: a,
    viewDate: l,
    onPanelChange: s,
    onSelect: u
  } = e, c = `${n}-month-panel`;
  i.value = {
    onKeydown: (f) => uh(f, {
      onLeftRight: (h) => {
        u(r.addMonth(a || l, h), "key");
      },
      onCtrlLeftRight: (h) => {
        u(r.addYear(a || l, h), "key");
      },
      onUpDown: (h) => {
        u(r.addMonth(a || l, h * s5), "key");
      },
      onEnter: () => {
        s("date", a || l);
      }
    })
  };
  const d = (f) => {
    const h = r.addYear(l, f);
    o(h), s(null, h);
  };
  return v("div", {
    class: c
  }, [v(r$, J(J({}, e), {}, {
    prefixCls: n,
    onPrevYear: () => {
      d(-1);
    },
    onNextYear: () => {
      d(1);
    },
    onYearClick: () => {
      s("year", l);
    }
  }), null), v(a$, J(J({}, e), {}, {
    prefixCls: n,
    onSelect: (f) => {
      u(f, "mouse"), s("date", f);
    }
  }), null)]);
}
l$.displayName = "MonthPanel";
l$.inheritAttrs = !1;
function s$(t) {
  const e = qi(t), {
    prefixCls: n,
    generateConfig: i,
    locale: o,
    viewDate: r,
    onNextYear: a,
    onPrevYear: l,
    onYearClick: s
  } = e, {
    hideHeader: u
  } = zl();
  if (u.value)
    return null;
  const c = `${n}-header`;
  return v(Hu, J(J({}, e), {}, {
    prefixCls: c,
    onSuperPrev: l,
    onSuperNext: a
  }), {
    default: () => [v("button", {
      type: "button",
      onClick: s,
      class: `${n}-year-btn`
    }, [Mo(r, {
      locale: o,
      format: o.yearFormat,
      generateConfig: i
    })])]
  });
}
s$.displayName = "QuarterHeader";
s$.inheritAttrs = !1;
const Jee = 4, ete = 1;
function u$(t) {
  const e = qi(t), {
    prefixCls: n,
    locale: i,
    value: o,
    viewDate: r,
    generateConfig: a
  } = e, {
    rangedValue: l,
    hoverRangedValue: s
  } = yg(), u = `${n}-cell`, c = $y({
    cellPrefixCls: u,
    value: o,
    generateConfig: a,
    rangedValue: l.value,
    hoverRangedValue: s.value,
    isSameCell: (f, h) => t5(a, f, h),
    isInView: () => !0,
    offsetCell: (f, h) => a.addMonth(f, h * 3)
  }), d = a.setDate(a.setMonth(r, 0), 1);
  return v(sd, J(J({}, e), {}, {
    rowNum: ete,
    colNum: Jee,
    baseDate: d,
    getCellText: (f) => Mo(f, {
      locale: i,
      format: i.quarterFormat || "[Q]Q",
      generateConfig: a
    }),
    getCellClassName: c,
    getCellDate: (f, h) => a.addMonth(f, h * 3),
    titleCell: (f) => Mo(f, {
      locale: i,
      format: "YYYY-[Q]Q",
      generateConfig: a
    })
  }), null);
}
u$.displayName = "QuarterBody";
u$.inheritAttrs = !1;
function c$(t) {
  const e = qi(t), {
    prefixCls: n,
    operationRef: i,
    onViewDateChange: o,
    generateConfig: r,
    value: a,
    viewDate: l,
    onPanelChange: s,
    onSelect: u
  } = e, c = `${n}-quarter-panel`;
  i.value = {
    onKeydown: (f) => uh(f, {
      onLeftRight: (h) => {
        u(r.addMonth(a || l, h * 3), "key");
      },
      onCtrlLeftRight: (h) => {
        u(r.addYear(a || l, h), "key");
      },
      onUpDown: (h) => {
        u(r.addYear(a || l, h), "key");
      }
    })
  };
  const d = (f) => {
    const h = r.addYear(l, f);
    o(h), s(null, h);
  };
  return v("div", {
    class: c
  }, [v(s$, J(J({}, e), {}, {
    prefixCls: n,
    onPrevYear: () => {
      d(-1);
    },
    onNextYear: () => {
      d(1);
    },
    onYearClick: () => {
      s("year", l);
    }
  }), null), v(u$, J(J({}, e), {}, {
    prefixCls: n,
    onSelect: (f) => {
      u(f, "mouse");
    }
  }), null)]);
}
c$.displayName = "QuarterPanel";
c$.inheritAttrs = !1;
function d$(t) {
  const e = qi(t), {
    prefixCls: n,
    generateConfig: i,
    viewDate: o,
    onPrevDecade: r,
    onNextDecade: a,
    onDecadeClick: l
  } = e, {
    hideHeader: s
  } = zl();
  if (s.value)
    return null;
  const u = `${n}-header`, c = i.getYear(o), d = Math.floor(c / Su) * Su, f = d + Su - 1;
  return v(Hu, J(J({}, e), {}, {
    prefixCls: u,
    onSuperPrev: r,
    onSuperNext: a
  }), {
    default: () => [v("button", {
      type: "button",
      onClick: l,
      class: `${n}-decade-btn`
    }, [d, Ve("-"), f])]
  });
}
d$.displayName = "YearHeader";
d$.inheritAttrs = !1;
const TO = 3, rE = 4;
function f$(t) {
  const e = qi(t), {
    prefixCls: n,
    value: i,
    viewDate: o,
    locale: r,
    generateConfig: a
  } = e, {
    rangedValue: l,
    hoverRangedValue: s
  } = yg(), u = `${n}-cell`, c = a.getYear(o), d = Math.floor(c / Su) * Su, f = d + Su - 1, h = a.setYear(o, d - Math.ceil((TO * rE - Su) / 2)), p = (m) => {
    const y = a.getYear(m);
    return d <= y && y <= f;
  }, g = $y({
    cellPrefixCls: u,
    value: i,
    generateConfig: a,
    rangedValue: l.value,
    hoverRangedValue: s.value,
    isSameCell: (m, y) => wy(a, m, y),
    isInView: p,
    offsetCell: (m, y) => a.addYear(m, y)
  });
  return v(sd, J(J({}, e), {}, {
    rowNum: rE,
    colNum: TO,
    baseDate: h,
    getCellText: a.getYear,
    getCellClassName: g,
    getCellDate: a.addYear,
    titleCell: (m) => Mo(m, {
      locale: r,
      format: "YYYY",
      generateConfig: a
    })
  }), null);
}
f$.displayName = "YearBody";
f$.inheritAttrs = !1;
const Su = 10;
function h$(t) {
  const e = qi(t), {
    prefixCls: n,
    operationRef: i,
    onViewDateChange: o,
    generateConfig: r,
    value: a,
    viewDate: l,
    sourceMode: s,
    onSelect: u,
    onPanelChange: c
  } = e, d = `${n}-year-panel`;
  i.value = {
    onKeydown: (h) => uh(h, {
      onLeftRight: (p) => {
        u(r.addYear(a || l, p), "key");
      },
      onCtrlLeftRight: (p) => {
        u(r.addYear(a || l, p * Su), "key");
      },
      onUpDown: (p) => {
        u(r.addYear(a || l, p * TO), "key");
      },
      onEnter: () => {
        c(s === "date" ? "date" : "month", a || l);
      }
    })
  };
  const f = (h) => {
    const p = r.addYear(l, h * 10);
    o(p), c(null, p);
  };
  return v("div", {
    class: d
  }, [v(d$, J(J({}, e), {}, {
    prefixCls: n,
    onPrevDecade: () => {
      f(-1);
    },
    onNextDecade: () => {
      f(1);
    },
    onDecadeClick: () => {
      c("decade", l);
    }
  }), null), v(f$, J(J({}, e), {}, {
    prefixCls: n,
    onSelect: (h) => {
      c(s === "date" ? "date" : "month", h), u(h, "mouse");
    }
  }), null)]);
}
h$.displayName = "YearPanel";
h$.inheritAttrs = !1;
function u5(t, e, n) {
  return n ? v("div", {
    class: `${t}-footer-extra`
  }, [n(e)]) : null;
}
function c5(t) {
  let {
    prefixCls: e,
    components: n = {},
    needConfirmButton: i,
    onNow: o,
    onOk: r,
    okDisabled: a,
    showNow: l,
    locale: s
  } = t, u, c;
  if (i) {
    const d = n.button || "button";
    o && l !== !1 && (u = v("li", {
      class: `${e}-now`
    }, [v("a", {
      class: `${e}-now-btn`,
      onClick: o
    }, [s.now])])), c = i && v("li", {
      class: `${e}-ok`
    }, [v(d, {
      disabled: a,
      onClick: (f) => {
        f.stopPropagation(), r && r();
      }
    }, {
      default: () => [s.ok]
    })]);
  }
  return !u && !c ? null : v("ul", {
    class: `${e}-ranges`
  }, [u, c]);
}
function tte() {
  return Oe({
    name: "PickerPanel",
    inheritAttrs: !1,
    props: {
      prefixCls: String,
      locale: Object,
      generateConfig: Object,
      value: Object,
      defaultValue: Object,
      pickerValue: Object,
      defaultPickerValue: Object,
      disabledDate: Function,
      mode: String,
      picker: {
        type: String,
        default: "date"
      },
      tabindex: {
        type: [Number, String],
        default: 0
      },
      showNow: {
        type: Boolean,
        default: void 0
      },
      showTime: [Boolean, Object],
      showToday: Boolean,
      renderExtraFooter: Function,
      dateRender: Function,
      hideHeader: {
        type: Boolean,
        default: void 0
      },
      onSelect: Function,
      onChange: Function,
      onPanelChange: Function,
      onMousedown: Function,
      onPickerValueChange: Function,
      onOk: Function,
      components: Object,
      direction: String,
      hourStep: {
        type: Number,
        default: 1
      },
      minuteStep: {
        type: Number,
        default: 1
      },
      secondStep: {
        type: Number,
        default: 1
      }
    },
    setup(t, e) {
      let {
        attrs: n
      } = e;
      const i = A(() => t.picker === "date" && !!t.showTime || t.picker === "time"), o = A(() => 24 % t.hourStep === 0), r = A(() => 60 % t.minuteStep === 0), a = A(() => 60 % t.secondStep === 0);
      process.env.NODE_ENV !== "production" && zt(() => {
        const {
          generateConfig: Q,
          value: G,
          hourStep: V = 1,
          minuteStep: H = 1,
          secondStep: q = 1
        } = t;
        Nn(!G || Q.isValidate(G), "Invalidate date pass to `value`."), Nn(!G || Q.isValidate(G), "Invalidate date pass to `defaultValue`."), Nn(o.value, `\`hourStep\` ${V} is invalid. It should be a factor of 24.`), Nn(r.value, `\`minuteStep\` ${H} is invalid. It should be a factor of 60.`), Nn(a.value, `\`secondStep\` ${q} is invalid. It should be a factor of 60.`);
      });
      const l = zl(), {
        operationRef: s,
        onSelect: u,
        hideRanges: c,
        defaultOpenValue: d
      } = l, {
        inRange: f,
        panelPosition: h,
        rangedValue: p,
        hoverRangedValue: g
      } = yg(), m = de({}), [y, b] = er(null, {
        value: on(t, "value"),
        defaultValue: t.defaultValue,
        postState: (Q) => !Q && d?.value && t.picker === "time" ? d.value : Q
      }), [w, $] = er(null, {
        value: on(t, "pickerValue"),
        defaultValue: t.defaultPickerValue || y.value,
        postState: (Q) => {
          const {
            generateConfig: G,
            showTime: V,
            defaultValue: H
          } = t, q = G.getNow();
          return Q ? !y.value && t.showTime ? typeof V == "object" ? cv(G, Array.isArray(Q) ? Q[0] : Q, V.defaultValue || q) : H ? cv(G, Array.isArray(Q) ? Q[0] : Q, H) : cv(G, Array.isArray(Q) ? Q[0] : Q, q) : Q : q;
        }
      }), C = (Q) => {
        $(Q), t.onPickerValueChange && t.onPickerValueChange(Q);
      }, P = (Q) => {
        const G = Qee[t.picker];
        return G ? G(Q) : Q;
      }, [O, E] = er(() => t.picker === "time" ? "time" : P("date"), {
        value: on(t, "mode")
      });
      _e(() => t.picker, () => {
        E(t.picker);
      });
      const _ = de(O.value), D = (Q) => {
        _.value = Q;
      }, M = (Q, G) => {
        const {
          onPanelChange: V,
          generateConfig: H
        } = t, q = P(Q || O.value);
        D(O.value), E(q), V && (O.value !== q || sf(H, w.value, w.value)) && V(G, q);
      }, N = function(Q, G) {
        let V = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
        const {
          picker: H,
          generateConfig: q,
          onSelect: K,
          onChange: ee,
          disabledDate: ie
        } = t;
        (O.value === H || V) && (b(Q), K && K(Q), u && u(Q, G), ee && !sf(q, Q, y.value) && !ie?.(Q) && ee(Q));
      }, L = (Q) => m.value && m.value.onKeydown ? ([lt.LEFT, lt.RIGHT, lt.UP, lt.DOWN, lt.PAGE_UP, lt.PAGE_DOWN, lt.ENTER].includes(Q.which) && Q.preventDefault(), m.value.onKeydown(Q)) : (Nn(!1, "Panel not correct handle keyDown event. Please help to fire issue about this."), !1), j = (Q) => {
        m.value && m.value.onBlur && m.value.onBlur(Q);
      }, B = () => {
        const {
          generateConfig: Q,
          hourStep: G,
          minuteStep: V,
          secondStep: H
        } = t, q = Q.getNow(), K = Aee(Q.getHour(q), Q.getMinute(q), Q.getSecond(q), o.value ? G : 1, r.value ? V : 1, a.value ? H : 1), ee = G3(
          Q,
          q,
          K[0],
          // hour
          K[1],
          // minute
          K[2]
        );
        N(ee, "submit");
      }, Y = A(() => {
        const {
          prefixCls: Q,
          direction: G
        } = t;
        return Ae(`${Q}-panel`, {
          [`${Q}-panel-has-range`]: p && p.value && p.value[0] && p.value[1],
          [`${Q}-panel-has-range-hover`]: g && g.value && g.value[0] && g.value[1],
          [`${Q}-panel-rtl`]: G === "rtl"
        });
      });
      return ZC(k(k({}, l), {
        mode: O,
        hideHeader: A(() => {
          var Q;
          return t.hideHeader !== void 0 ? t.hideHeader : (Q = l.hideHeader) === null || Q === void 0 ? void 0 : Q.value;
        }),
        hidePrevBtn: A(() => f.value && h.value === "right"),
        hideNextBtn: A(() => f.value && h.value === "left")
      })), _e(() => t.value, () => {
        t.value && $(t.value);
      }), () => {
        const {
          prefixCls: Q = "ant-picker",
          locale: G,
          generateConfig: V,
          disabledDate: H,
          picker: q = "date",
          tabindex: K = 0,
          showNow: ee,
          showTime: ie,
          showToday: ae,
          renderExtraFooter: te,
          onMousedown: U,
          onOk: me,
          components: ce
        } = t;
        s && h.value !== "right" && (s.value = {
          onKeydown: L,
          onClose: () => {
            m.value && m.value.onClose && m.value.onClose();
          }
        });
        let ue;
        const fe = k(k(k({}, n), t), {
          operationRef: m,
          prefixCls: Q,
          viewDate: w.value,
          value: y.value,
          onViewDateChange: C,
          sourceMode: _.value,
          onPanelChange: M,
          disabledDate: H
        });
        switch (delete fe.onChange, delete fe.onSelect, O.value) {
          case "decade":
            ue = v(JC, J(J({}, fe), {}, {
              onSelect: (ze, Re) => {
                C(ze), N(ze, Re);
              }
            }), null);
            break;
          case "year":
            ue = v(h$, J(J({}, fe), {}, {
              onSelect: (ze, Re) => {
                C(ze), N(ze, Re);
              }
            }), null);
            break;
          case "month":
            ue = v(l$, J(J({}, fe), {}, {
              onSelect: (ze, Re) => {
                C(ze), N(ze, Re);
              }
            }), null);
            break;
          case "quarter":
            ue = v(c$, J(J({}, fe), {}, {
              onSelect: (ze, Re) => {
                C(ze), N(ze, Re);
              }
            }), null);
            break;
          case "week":
            ue = v(o$, J(J({}, fe), {}, {
              onSelect: (ze, Re) => {
                C(ze), N(ze, Re);
              }
            }), null);
            break;
          case "time":
            delete fe.showTime, ue = v(Cy, J(J(J({}, fe), typeof ie == "object" ? ie : null), {}, {
              onSelect: (ze, Re) => {
                C(ze), N(ze, Re);
              }
            }), null);
            break;
          default:
            ie ? ue = v(i$, J(J({}, fe), {}, {
              onSelect: (ze, Re) => {
                C(ze), N(ze, Re);
              }
            }), null) : ue = v(bg, J(J({}, fe), {}, {
              onSelect: (ze, Re) => {
                C(ze), N(ze, Re);
              }
            }), null);
        }
        let he, le;
        c?.value || (he = u5(Q, O.value, te), le = c5({
          prefixCls: Q,
          components: ce,
          needConfirmButton: i.value,
          okDisabled: !y.value || H && H(y.value),
          locale: G,
          showNow: ee,
          onNow: i.value && B,
          onOk: () => {
            y.value && (N(y.value, "submit", !0), me && me(y.value));
          }
        }));
        let ke;
        if (ae && O.value === "date" && q === "date" && !ie) {
          const ze = V.getNow(), Re = `${Q}-today-btn`, Ye = H && H(ze);
          ke = v("a", {
            class: Ae(Re, Ye && `${Re}-disabled`),
            "aria-disabled": Ye,
            onClick: () => {
              Ye || N(ze, "mouse", !0);
            }
          }, [G.today]);
        }
        return v("div", {
          tabindex: K,
          class: Ae(Y.value, n.class),
          style: n.style,
          onKeydown: L,
          onBlur: j,
          onMousedown: U
        }, [ue, he || le || ke ? v("div", {
          class: `${Q}-footer`
        }, [he, le, ke]) : null]);
      };
    }
  });
}
const nte = tte(), d5 = ((t) => v(nte, t)), ite = {
  bottomLeft: {
    points: ["tl", "bl"],
    offset: [0, 4],
    overflow: {
      adjustX: 1,
      adjustY: 1
    }
  },
  bottomRight: {
    points: ["tr", "br"],
    offset: [0, 4],
    overflow: {
      adjustX: 1,
      adjustY: 1
    }
  },
  topLeft: {
    points: ["bl", "tl"],
    offset: [0, -4],
    overflow: {
      adjustX: 0,
      adjustY: 1
    }
  },
  topRight: {
    points: ["br", "tr"],
    offset: [0, -4],
    overflow: {
      adjustX: 0,
      adjustY: 1
    }
  }
};
function f5(t, e) {
  let {
    slots: n
  } = e;
  const {
    prefixCls: i,
    popupStyle: o,
    visible: r,
    dropdownClassName: a,
    dropdownAlign: l,
    transitionName: s,
    getPopupContainer: u,
    range: c,
    popupPlacement: d,
    direction: f
  } = qi(t), h = `${i}-dropdown`;
  return v(dg, {
    showAction: [],
    hideAction: [],
    popupPlacement: d !== void 0 ? d : f === "rtl" ? "bottomRight" : "bottomLeft",
    builtinPlacements: ite,
    prefixCls: h,
    popupTransitionName: s,
    popupAlign: l,
    popupVisible: r,
    popupClassName: Ae(a, {
      [`${h}-range`]: c,
      [`${h}-rtl`]: f === "rtl"
    }),
    popupStyle: o,
    getPopupContainer: u
  }, {
    default: n.default,
    popup: n.popupElement
  });
}
const h5 = Oe({
  name: "PresetPanel",
  props: {
    prefixCls: String,
    presets: {
      type: Array,
      default: () => []
    },
    onClick: Function,
    onHover: Function
  },
  setup(t) {
    return () => t.presets.length ? v("div", {
      class: `${t.prefixCls}-presets`
    }, [v("ul", null, [t.presets.map((e, n) => {
      let {
        label: i,
        value: o
      } = e;
      return v("li", {
        key: n,
        onClick: (r) => {
          r.stopPropagation(), t.onClick(o);
        },
        onMouseenter: () => {
          var r;
          (r = t.onHover) === null || r === void 0 || r.call(t, o);
        },
        onMouseleave: () => {
          var r;
          (r = t.onHover) === null || r === void 0 || r.call(t, null);
        }
      }, [i]);
    })])]) : null;
  }
});
function PO(t) {
  let {
    open: e,
    value: n,
    isClickOutside: i,
    triggerOpen: o,
    forwardKeydown: r,
    onKeydown: a,
    blurToCancel: l,
    onSubmit: s,
    onCancel: u,
    onFocus: c,
    onBlur: d
  } = t;
  const f = Te(!1), h = Te(!1), p = Te(!1), g = Te(!1), m = Te(!1), y = A(() => ({
    onMousedown: () => {
      f.value = !0, o(!0);
    },
    onKeydown: (w) => {
      if (a(w, () => {
        m.value = !0;
      }), !m.value) {
        switch (w.which) {
          case lt.ENTER: {
            e.value ? s() !== !1 && (f.value = !0) : o(!0), w.preventDefault();
            return;
          }
          case lt.TAB: {
            f.value && e.value && !w.shiftKey ? (f.value = !1, w.preventDefault()) : !f.value && e.value && !r(w) && w.shiftKey && (f.value = !0, w.preventDefault());
            return;
          }
          case lt.ESC: {
            f.value = !0, u();
            return;
          }
        }
        !e.value && ![lt.SHIFT].includes(w.which) ? o(!0) : f.value || r(w);
      }
    },
    onFocus: (w) => {
      f.value = !0, h.value = !0, c && c(w);
    },
    onBlur: (w) => {
      if (p.value || !i(document.activeElement)) {
        p.value = !1;
        return;
      }
      l.value ? setTimeout(() => {
        let {
          activeElement: $
        } = document;
        for (; $ && $.shadowRoot; )
          $ = $.shadowRoot.activeElement;
        i($) && u();
      }, 0) : e.value && (o(!1), g.value && s()), h.value = !1, d && d(w);
    }
  }));
  _e(e, () => {
    g.value = !1;
  }), _e(n, () => {
    g.value = !0;
  });
  const b = Te();
  return Lt(() => {
    b.value = Nee((w) => {
      const $ = Lee(w);
      if (e.value) {
        const C = i($);
        C ? (!h.value || C) && o(!1) : (p.value = !0, Gt(() => {
          p.value = !1;
        }));
      }
    });
  }), tn(() => {
    b.value && b.value();
  }), [y, {
    focused: h,
    typing: f
  }];
}
function EO(t) {
  let {
    valueTexts: e,
    onTextChange: n
  } = t;
  const i = de("");
  function o(a) {
    i.value = a, n(a);
  }
  function r() {
    i.value = e.value[0];
  }
  return _e(() => [...e.value], function(a) {
    let l = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
    a.join("||") !== l.join("||") && e.value.every((s) => s !== i.value) && r();
  }, {
    immediate: !0
  }), [i, o, r];
}
function i0(t, e) {
  let {
    formatList: n,
    generateConfig: i,
    locale: o
  } = e;
  const r = r3(() => {
    if (!t.value)
      return [[""], ""];
    let s = "";
    const u = [];
    for (let c = 0; c < n.value.length; c += 1) {
      const d = n.value[c], f = Mo(t.value, {
        generateConfig: i.value,
        locale: o.value,
        format: d
      });
      u.push(f), c === 0 && (s = f);
    }
    return [u, s];
  }, [t, n], (s, u) => u[0] !== s[0] || !Fd(u[1], s[1])), a = A(() => r.value[0]), l = A(() => r.value[1]);
  return [a, l];
}
function _O(t, e) {
  let {
    formatList: n,
    generateConfig: i,
    locale: o
  } = e;
  const r = de(null);
  let a;
  function l(d) {
    let f = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
    if (Gt.cancel(a), f) {
      r.value = d;
      return;
    }
    a = Gt(() => {
      r.value = d;
    });
  }
  const [, s] = i0(r, {
    formatList: n,
    generateConfig: i,
    locale: o
  });
  function u(d) {
    l(d);
  }
  function c() {
    let d = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
    l(null, d);
  }
  return _e(t, () => {
    c(!0);
  }), tn(() => {
    Gt.cancel(a);
  }), [s, u, c];
}
function p5(t, e) {
  return A(() => t?.value ? t.value : e?.value ? (pr(!1, "`ranges` is deprecated. Please use `presets` instead."), Object.keys(e.value).map((i) => {
    const o = e.value[i], r = typeof o == "function" ? o() : o;
    return {
      label: i,
      value: r
    };
  })) : []);
}
function g5(t) {
  const {
    picker: e,
    disabledHours: n,
    disabledMinutes: i,
    disabledSeconds: o
  } = t;
  e === "time" && (n || i || o) && Nn(!1, "'disabledHours', 'disabledMinutes', 'disabledSeconds' will be removed in the next major version, please use 'disabledTime' instead.");
}
function ote() {
  return Oe({
    name: "Picker",
    inheritAttrs: !1,
    props: ["prefixCls", "id", "tabindex", "dropdownClassName", "dropdownAlign", "popupStyle", "transitionName", "generateConfig", "locale", "inputReadOnly", "allowClear", "autofocus", "showTime", "showNow", "showHour", "showMinute", "showSecond", "picker", "format", "use12Hours", "value", "defaultValue", "open", "defaultOpen", "defaultOpenValue", "suffixIcon", "presets", "clearIcon", "disabled", "disabledDate", "placeholder", "getPopupContainer", "panelRender", "inputRender", "onChange", "onOpenChange", "onPanelChange", "onFocus", "onBlur", "onMousedown", "onMouseup", "onMouseenter", "onMouseleave", "onContextmenu", "onClick", "onKeydown", "onSelect", "direction", "autocomplete", "showToday", "renderExtraFooter", "dateRender", "minuteStep", "hourStep", "secondStep", "hideDisabledOptions"],
    setup(t, e) {
      let {
        attrs: n,
        expose: i
      } = e;
      const o = de(null), r = A(() => t.presets), a = p5(r), l = A(() => {
        var H;
        return (H = t.picker) !== null && H !== void 0 ? H : "date";
      }), s = A(() => l.value === "date" && !!t.showTime || l.value === "time");
      process.env.NODE_ENV !== "production" && g5(t);
      const u = A(() => r5(U3(t.format, l.value, t.showTime, t.use12Hours))), c = de(null), d = de(null), f = de(null), [h, p] = er(null, {
        value: on(t, "value"),
        defaultValue: t.defaultValue
      }), g = de(h.value), m = (H) => {
        g.value = H;
      }, y = de(null), [b, w] = er(!1, {
        value: on(t, "open"),
        defaultValue: t.defaultOpen,
        postState: (H) => t.disabled ? !1 : H,
        onChange: (H) => {
          t.onOpenChange && t.onOpenChange(H), !H && y.value && y.value.onClose && y.value.onClose();
        }
      }), [$, C] = i0(g, {
        formatList: u,
        generateConfig: on(t, "generateConfig"),
        locale: on(t, "locale")
      }), [P, O, E] = EO({
        valueTexts: $,
        onTextChange: (H) => {
          const q = i5(H, {
            locale: t.locale,
            formatList: u.value,
            generateConfig: t.generateConfig
          });
          q && (!t.disabledDate || !t.disabledDate(q)) && m(q);
        }
      }), _ = (H) => {
        const {
          onChange: q,
          generateConfig: K,
          locale: ee
        } = t;
        m(H), p(H), q && !sf(K, h.value, H) && q(H, H ? Mo(H, {
          generateConfig: K,
          locale: ee,
          format: u.value[0]
        }) : "");
      }, D = (H) => {
        t.disabled && H || w(H);
      }, M = (H) => b.value && y.value && y.value.onKeydown ? y.value.onKeydown(H) : (Nn(!1, "Picker not correct forward Keydown operation. Please help to fire issue about this."), !1), N = function() {
        t.onMouseup && t.onMouseup(...arguments), o.value && (o.value.focus(), D(!0));
      }, [L, {
        focused: j,
        typing: B
      }] = PO({
        blurToCancel: s,
        open: b,
        value: P,
        triggerOpen: D,
        forwardKeydown: M,
        isClickOutside: (H) => !e5([c.value, d.value, f.value], H),
        onSubmit: () => (
          // When user typing disabledDate with keyboard and enter, this value will be empty
          !g.value || // Normal disabled check
          t.disabledDate && t.disabledDate(g.value) ? !1 : (_(g.value), D(!1), E(), !0)
        ),
        onCancel: () => {
          D(!1), m(h.value), E();
        },
        onKeydown: (H, q) => {
          var K;
          (K = t.onKeydown) === null || K === void 0 || K.call(t, H, q);
        },
        onFocus: (H) => {
          var q;
          (q = t.onFocus) === null || q === void 0 || q.call(t, H);
        },
        onBlur: (H) => {
          var q;
          (q = t.onBlur) === null || q === void 0 || q.call(t, H);
        }
      });
      _e([b, $], () => {
        b.value || (m(h.value), !$.value.length || $.value[0] === "" ? O("") : C.value !== P.value && E());
      }), _e(l, () => {
        b.value || E();
      }), _e(h, () => {
        m(h.value);
      });
      const [Y, Q, G] = _O(P, {
        formatList: u,
        generateConfig: on(t, "generateConfig"),
        locale: on(t, "locale")
      }), V = (H, q) => {
        (q === "submit" || q !== "key" && !s.value) && (_(H), D(!1));
      };
      return ZC({
        operationRef: y,
        hideHeader: A(() => l.value === "time"),
        onSelect: V,
        open: b,
        defaultOpenValue: on(t, "defaultOpenValue"),
        onDateMouseenter: Q,
        onDateMouseleave: G
      }), i({
        focus: () => {
          o.value && o.value.focus();
        },
        blur: () => {
          o.value && o.value.blur();
        }
      }), () => {
        const {
          prefixCls: H = "rc-picker",
          id: q,
          tabindex: K,
          dropdownClassName: ee,
          dropdownAlign: ie,
          popupStyle: ae,
          transitionName: te,
          generateConfig: U,
          locale: me,
          inputReadOnly: ce,
          allowClear: ue,
          autofocus: fe,
          picker: he = "date",
          defaultOpenValue: le,
          suffixIcon: ke,
          clearIcon: ze,
          disabled: Re,
          placeholder: Ye,
          getPopupContainer: Ne,
          panelRender: Fe,
          onMousedown: We,
          onMouseenter: nt,
          onMouseleave: Qe,
          onContextmenu: Pe,
          onClick: Ze,
          onSelect: Ce,
          direction: $e,
          autocomplete: Le = "off"
        } = t, Ke = k(k(k({}, t), n), {
          class: Ae({
            [`${H}-panel-focused`]: !B.value
          }),
          style: void 0,
          pickerValue: void 0,
          onPickerValueChange: void 0,
          onChange: null
        });
        let qe = v("div", {
          class: `${H}-panel-layout`
        }, [v(h5, {
          prefixCls: H,
          presets: a.value,
          onClick: (st) => {
            _(st), D(!1);
          }
        }, null), v(d5, J(J({}, Ke), {}, {
          generateConfig: U,
          value: g.value,
          locale: me,
          tabindex: -1,
          onSelect: (st) => {
            Ce?.(st), m(st);
          },
          direction: $e,
          onPanelChange: (st, gt) => {
            const {
              onPanelChange: Et
            } = t;
            G(!0), Et?.(st, gt);
          }
        }), null)]);
        Fe && (qe = Fe(qe));
        const rt = v("div", {
          class: `${H}-panel-container`,
          ref: c,
          onMousedown: (st) => {
            st.preventDefault();
          }
        }, [qe]);
        let De;
        ke && (De = v("span", {
          class: `${H}-suffix`
        }, [ke]));
        let Be;
        ue && h.value && !Re && (Be = v("span", {
          onMousedown: (st) => {
            st.preventDefault(), st.stopPropagation();
          },
          onMouseup: (st) => {
            st.preventDefault(), st.stopPropagation(), _(null), D(!1);
          },
          class: `${H}-clear`,
          role: "button"
        }, [ze || v("span", {
          class: `${H}-clear-btn`
        }, null)]));
        const je = k(k(k(k({
          id: q,
          tabindex: K,
          disabled: Re,
          readonly: ce || typeof u.value[0] == "function" || !B.value,
          value: Y.value || P.value,
          onInput: (st) => {
            O(st.target.value);
          },
          autofocus: fe,
          placeholder: Ye,
          ref: o,
          title: P.value
        }, L.value), {
          size: J3(he, u.value[0], U)
        }), a5(t)), {
          autocomplete: Le
        }), at = t.inputRender ? t.inputRender(je) : v("input", je, null);
        process.env.NODE_ENV !== "production" && Nn(!le, "`defaultOpenValue` may confuse user for the current value status. Please use `defaultValue` instead.");
        const mt = $e === "rtl" ? "bottomRight" : "bottomLeft";
        return v("div", {
          ref: f,
          class: Ae(H, n.class, {
            [`${H}-disabled`]: Re,
            [`${H}-focused`]: j.value,
            [`${H}-rtl`]: $e === "rtl"
          }),
          style: n.style,
          onMousedown: We,
          onMouseup: N,
          onMouseenter: nt,
          onMouseleave: Qe,
          onContextmenu: Pe,
          onClick: Ze
        }, [v("div", {
          class: Ae(`${H}-input`, {
            [`${H}-input-placeholder`]: !!Y.value
          }),
          ref: d
        }, [at, De, Be]), v(f5, {
          visible: b.value,
          popupStyle: ae,
          prefixCls: H,
          dropdownClassName: ee,
          dropdownAlign: ie,
          getPopupContainer: Ne,
          transitionName: te,
          popupPlacement: mt,
          direction: $e
        }, {
          default: () => [v("div", {
            style: {
              pointerEvents: "none",
              position: "absolute",
              top: 0,
              bottom: 0,
              left: 0,
              right: 0
            }
          }, null)],
          popupElement: () => rt
        })]);
      };
    }
  });
}
const rte = ote();
function ate(t, e) {
  let {
    picker: n,
    locale: i,
    selectedValue: o,
    disabledDate: r,
    disabled: a,
    generateConfig: l
  } = t;
  const s = A(() => vn(o.value, 0)), u = A(() => vn(o.value, 1));
  function c(g) {
    return l.value.locale.getWeekFirstDate(i.value.locale, g);
  }
  function d(g) {
    const m = l.value.getYear(g), y = l.value.getMonth(g);
    return m * 100 + y;
  }
  function f(g) {
    const m = l.value.getYear(g), y = $O(l.value, g);
    return m * 10 + y;
  }
  return [(g) => {
    var m;
    if (r && (!((m = r?.value) === null || m === void 0) && m.call(r, g)))
      return !0;
    if (a[1] && u)
      return !fs(l.value, g, u.value) && l.value.isAfter(g, u.value);
    if (e.value[1] && u.value)
      switch (n.value) {
        case "quarter":
          return f(g) > f(u.value);
        case "month":
          return d(g) > d(u.value);
        case "week":
          return c(g) > c(u.value);
        default:
          return !fs(l.value, g, u.value) && l.value.isAfter(g, u.value);
      }
    return !1;
  }, (g) => {
    var m;
    if (!((m = r.value) === null || m === void 0) && m.call(r, g))
      return !0;
    if (a[0] && s)
      return !fs(l.value, g, u.value) && l.value.isAfter(s.value, g);
    if (e.value[0] && s.value)
      switch (n.value) {
        case "quarter":
          return f(g) < f(s.value);
        case "month":
          return d(g) < d(s.value);
        case "week":
          return c(g) < c(s.value);
        default:
          return !fs(l.value, g, s.value) && l.value.isAfter(s.value, g);
      }
    return !1;
  }];
}
function lte(t, e, n, i) {
  const o = lp(t, n, i, 1);
  function r(a) {
    return a(t, e) ? "same" : a(o, e) ? "closing" : "far";
  }
  switch (n) {
    case "year":
      return r((a, l) => Hee(i, a, l));
    case "quarter":
    case "month":
      return r((a, l) => wy(i, a, l));
    default:
      return r((a, l) => e$(i, a, l));
  }
}
function ste(t, e, n, i) {
  const o = vn(t, 0), r = vn(t, 1);
  if (e === 0)
    return o;
  if (o && r)
    switch (lte(o, r, n, i)) {
      case "same":
        return o;
      case "closing":
        return o;
      default:
        return lp(r, n, i, -1);
    }
  return o;
}
function ute(t) {
  let {
    values: e,
    picker: n,
    defaultDates: i,
    generateConfig: o
  } = t;
  const r = de([vn(i, 0), vn(i, 1)]), a = de(null), l = A(() => vn(e.value, 0)), s = A(() => vn(e.value, 1)), u = (h) => r.value[h] ? r.value[h] : vn(a.value, h) || ste(e.value, h, n.value, o.value) || l.value || s.value || o.value.getNow(), c = de(null), d = de(null);
  zt(() => {
    c.value = u(0), d.value = u(1);
  });
  function f(h, p) {
    if (h) {
      let g = ta(a.value, h, p);
      r.value = ta(r.value, null, p) || [null, null];
      const m = (p + 1) % 2;
      vn(e.value, m) || (g = ta(g, h, m)), a.value = g;
    } else (l.value || s.value) && (a.value = null);
  }
  return [c, d, f];
}
function cte(t) {
  return CA() ? ($A(t), !0) : !1;
}
function dte(t) {
  return typeof t == "function" ? t() : I(t);
}
function m5(t) {
  var e;
  const n = dte(t);
  return (e = n?.$el) !== null && e !== void 0 ? e : n;
}
function fte(t) {
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
  sr() ? Lt(t) : e ? t() : rn(t);
}
function hte(t) {
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
  const n = Te(), i = () => n.value = !!t();
  return i(), fte(i, e), n;
}
var r1;
const v5 = typeof window < "u";
v5 && (!((r1 = window?.navigator) === null || r1 === void 0) && r1.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
const pte = v5 ? window : void 0;
var gte = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
function mte(t, e) {
  let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
  const {
    window: i = pte
  } = n, o = gte(n, ["window"]);
  let r;
  const a = hte(() => i && "ResizeObserver" in i), l = () => {
    r && (r.disconnect(), r = void 0);
  }, s = _e(() => m5(t), (c) => {
    l(), a.value && i && c && (r = new ResizeObserver(e), r.observe(c, o));
  }, {
    immediate: !0,
    flush: "post"
  }), u = () => {
    l(), s();
  };
  return cte(u), {
    isSupported: a,
    stop: u
  };
}
function Mh(t) {
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
    width: 0,
    height: 0
  }, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
  const {
    box: i = "content-box"
  } = n, o = Te(e.width), r = Te(e.height);
  return mte(t, (a) => {
    let [l] = a;
    const s = i === "border-box" ? l.borderBoxSize : i === "content-box" ? l.contentBoxSize : l.devicePixelContentBoxSize;
    s ? (o.value = s.reduce((u, c) => {
      let {
        inlineSize: d
      } = c;
      return u + d;
    }, 0), r.value = s.reduce((u, c) => {
      let {
        blockSize: d
      } = c;
      return u + d;
    }, 0)) : (o.value = l.contentRect.width, r.value = l.contentRect.height);
  }, n), _e(() => m5(t), (a) => {
    o.value = a ? e.width : 0, r.value = a ? e.height : 0;
  }), {
    width: o,
    height: r
  };
}
function aE(t, e) {
  return t && t[0] && t[1] && e.isAfter(t[0], t[1]) ? [t[1], t[0]] : t;
}
function lE(t, e, n, i) {
  return !!(t || i && i[e] || n[(e + 1) % 2]);
}
function vte() {
  return Oe({
    name: "RangerPicker",
    inheritAttrs: !1,
    props: ["prefixCls", "id", "popupStyle", "dropdownClassName", "transitionName", "dropdownAlign", "getPopupContainer", "generateConfig", "locale", "placeholder", "autofocus", "disabled", "format", "picker", "showTime", "showNow", "showHour", "showMinute", "showSecond", "use12Hours", "separator", "value", "defaultValue", "defaultPickerValue", "open", "defaultOpen", "disabledDate", "disabledTime", "dateRender", "panelRender", "ranges", "allowEmpty", "allowClear", "suffixIcon", "clearIcon", "pickerRef", "inputReadOnly", "mode", "renderExtraFooter", "onChange", "onOpenChange", "onPanelChange", "onCalendarChange", "onFocus", "onBlur", "onMousedown", "onMouseup", "onMouseenter", "onMouseleave", "onClick", "onOk", "onKeydown", "components", "order", "direction", "activePickerIndex", "autocomplete", "minuteStep", "hourStep", "secondStep", "hideDisabledOptions", "disabledMinutes", "presets", "prevIcon", "nextIcon", "superPrevIcon", "superNextIcon"],
    setup(t, e) {
      let {
        attrs: n,
        expose: i
      } = e;
      const o = A(() => t.picker === "date" && !!t.showTime || t.picker === "time"), r = A(() => t.presets), a = A(() => t.ranges), l = p5(r, a), s = de({}), u = de(null), c = de(null), d = de(null), f = de(null), h = de(null), p = de(null), g = de(null), m = de(null);
      process.env.NODE_ENV !== "production" && g5(t);
      const y = A(() => r5(U3(t.format, t.picker, t.showTime, t.use12Hours))), [b, w] = er(0, {
        value: on(t, "activePickerIndex")
      }), $ = de(null), C = A(() => {
        const {
          disabled: Ue
        } = t;
        return Array.isArray(Ue) ? Ue : [Ue || !1, Ue || !1];
      }), [P, O] = er(null, {
        value: on(t, "value"),
        defaultValue: t.defaultValue,
        postState: (Ue) => t.picker === "time" && !t.order ? Ue : aE(Ue, t.generateConfig)
      }), [E, _, D] = ute({
        values: P,
        picker: on(t, "picker"),
        defaultDates: t.defaultPickerValue,
        generateConfig: on(t, "generateConfig")
      }), [M, N] = er(P.value, {
        postState: (Ue) => {
          let yt = Ue;
          if (C.value[0] && C.value[1])
            return yt;
          for (let xt = 0; xt < 2; xt += 1)
            C.value[xt] && !vn(yt, xt) && !vn(t.allowEmpty, xt) && (yt = ta(yt, t.generateConfig.getNow(), xt));
          return yt;
        }
      }), [L, j] = er([t.picker, t.picker], {
        value: on(t, "mode")
      });
      _e(() => t.picker, () => {
        j([t.picker, t.picker]);
      });
      const B = (Ue, yt) => {
        var xt;
        j(Ue), (xt = t.onPanelChange) === null || xt === void 0 || xt.call(t, yt, Ue);
      }, [Y, Q] = ate({
        picker: on(t, "picker"),
        selectedValue: M,
        locale: on(t, "locale"),
        disabled: C,
        disabledDate: on(t, "disabledDate"),
        generateConfig: on(t, "generateConfig")
      }, s), [G, V] = er(!1, {
        value: on(t, "open"),
        defaultValue: t.defaultOpen,
        postState: (Ue) => C.value[b.value] ? !1 : Ue,
        onChange: (Ue) => {
          var yt;
          (yt = t.onOpenChange) === null || yt === void 0 || yt.call(t, Ue), !Ue && $.value && $.value.onClose && $.value.onClose();
        }
      }), H = A(() => G.value && b.value === 0), q = A(() => G.value && b.value === 1), K = de(0), ee = de(0), ie = de(0), {
        width: ae
      } = Mh(u);
      _e([G, ae], () => {
        !G.value && u.value && (ie.value = ae.value);
      });
      const {
        width: te
      } = Mh(c), {
        width: U
      } = Mh(m), {
        width: me
      } = Mh(d), {
        width: ce
      } = Mh(h);
      _e([b, G, te, U, me, ce, () => t.direction], () => {
        ee.value = 0, b.value ? d.value && h.value && (ee.value = me.value + ce.value, te.value && U.value && ee.value > te.value - U.value - (t.direction === "rtl" || m.value.offsetLeft > ee.value ? 0 : m.value.offsetLeft) && (K.value = ee.value)) : b.value === 0 && (K.value = 0);
      }, {
        immediate: !0
      });
      const ue = de();
      function fe(Ue, yt) {
        if (Ue)
          clearTimeout(ue.value), s.value[yt] = !0, w(yt), V(Ue), G.value || D(null, yt);
        else if (b.value === yt) {
          V(Ue);
          const xt = s.value;
          ue.value = setTimeout(() => {
            xt === s.value && (s.value = {});
          });
        }
      }
      function he(Ue) {
        fe(!0, Ue), setTimeout(() => {
          const yt = [p, g][Ue];
          yt.value && yt.value.focus();
        }, 0);
      }
      function le(Ue, yt) {
        let xt = Ue, fn = vn(xt, 0), Oi = vn(xt, 1);
        const {
          generateConfig: yi,
          locale: io,
          picker: Ln,
          order: Bt,
          onCalendarChange: Fi,
          allowEmpty: vo,
          onChange: Sn,
          showTime: Zn
        } = t;
        fn && Oi && yi.isAfter(fn, Oi) && (// WeekPicker only compare week
        Ln === "week" && !n5(yi, io.locale, fn, Oi) || // QuotaPicker only compare week
        Ln === "quarter" && !t5(yi, fn, Oi) || // Other non-TimePicker compare date
        Ln !== "week" && Ln !== "quarter" && Ln !== "time" && !(Zn ? sf(yi, fn, Oi) : fs(yi, fn, Oi)) ? (yt === 0 ? (xt = [fn, null], Oi = null) : (fn = null, xt = [null, Oi]), s.value = {
          [yt]: !0
        }) : (Ln !== "time" || Bt !== !1) && (xt = aE(xt, yi))), N(xt);
        const wn = xt && xt[0] ? Mo(xt[0], {
          generateConfig: yi,
          locale: io,
          format: y.value[0]
        }) : "", Gn = xt && xt[1] ? Mo(xt[1], {
          generateConfig: yi,
          locale: io,
          format: y.value[0]
        }) : "";
        Fi && Fi(xt, [wn, Gn], {
          range: yt === 0 ? "start" : "end"
        });
        const Ho = lE(fn, 0, C.value, vo), Si = lE(Oi, 1, C.value, vo);
        (xt === null || Ho && Si) && (O(xt), Sn && (!sf(yi, vn(P.value, 0), fn) || !sf(yi, vn(P.value, 1), Oi)) && Sn(xt, [wn, Gn]));
        let $o = null;
        yt === 0 && !C.value[1] ? $o = 1 : yt === 1 && !C.value[0] && ($o = 0), $o !== null && $o !== b.value && (!s.value[$o] || !vn(xt, $o)) && vn(xt, yt) ? he($o) : fe(!1, yt);
      }
      const ke = (Ue) => G && $.value && $.value.onKeydown ? $.value.onKeydown(Ue) : (Nn(!1, "Picker not correct forward Keydown operation. Please help to fire issue about this."), !1), ze = {
        formatList: y,
        generateConfig: on(t, "generateConfig"),
        locale: on(t, "locale")
      }, [Re, Ye] = i0(A(() => vn(M.value, 0)), ze), [Ne, Fe] = i0(A(() => vn(M.value, 1)), ze), We = (Ue, yt) => {
        const xt = i5(Ue, {
          locale: t.locale,
          formatList: y.value,
          generateConfig: t.generateConfig
        });
        xt && !(yt === 0 ? Y : Q)(xt) && (N(ta(M.value, xt, yt)), D(xt, yt));
      }, [nt, Qe, Pe] = EO({
        valueTexts: Re,
        onTextChange: (Ue) => We(Ue, 0)
      }), [Ze, Ce, $e] = EO({
        valueTexts: Ne,
        onTextChange: (Ue) => We(Ue, 1)
      }), [Le, Ke] = zn(null), [qe, rt] = zn(null), [De, Be, je] = _O(nt, ze), [at, mt, st] = _O(Ze, ze), gt = (Ue) => {
        rt(ta(M.value, Ue, b.value)), b.value === 0 ? Be(Ue) : mt(Ue);
      }, Et = () => {
        rt(ta(M.value, null, b.value)), b.value === 0 ? je() : st();
      }, It = (Ue, yt) => ({
        forwardKeydown: ke,
        onBlur: (xt) => {
          var fn;
          (fn = t.onBlur) === null || fn === void 0 || fn.call(t, xt);
        },
        isClickOutside: (xt) => !e5([c.value, d.value, f.value, u.value], xt),
        onFocus: (xt) => {
          var fn;
          w(Ue), (fn = t.onFocus) === null || fn === void 0 || fn.call(t, xt);
        },
        triggerOpen: (xt) => {
          fe(xt, Ue);
        },
        onSubmit: () => {
          if (
            // When user typing disabledDate with keyboard and enter, this value will be empty
            !M.value || // Normal disabled check
            t.disabledDate && t.disabledDate(M.value[Ue])
          )
            return !1;
          le(M.value, Ue), yt();
        },
        onCancel: () => {
          fe(!1, Ue), N(P.value), yt();
        }
      }), [_t, {
        focused: wt,
        typing: Nt
      }] = PO(k(k({}, It(0, Pe)), {
        blurToCancel: o,
        open: H,
        value: nt,
        onKeydown: (Ue, yt) => {
          var xt;
          (xt = t.onKeydown) === null || xt === void 0 || xt.call(t, Ue, yt);
        }
      })), [nn, {
        focused: sn,
        typing: xn
      }] = PO(k(k({}, It(1, $e)), {
        blurToCancel: o,
        open: q,
        value: Ze,
        onKeydown: (Ue, yt) => {
          var xt;
          (xt = t.onKeydown) === null || xt === void 0 || xt.call(t, Ue, yt);
        }
      })), Pn = (Ue) => {
        var yt;
        (yt = t.onClick) === null || yt === void 0 || yt.call(t, Ue), !G.value && !p.value.contains(Ue.target) && !g.value.contains(Ue.target) && (C.value[0] ? C.value[1] || he(1) : he(0));
      }, bt = (Ue) => {
        var yt;
        (yt = t.onMousedown) === null || yt === void 0 || yt.call(t, Ue), G.value && (wt.value || sn.value) && !p.value.contains(Ue.target) && !g.value.contains(Ue.target) && Ue.preventDefault();
      }, Xn = A(() => {
        var Ue;
        return !((Ue = P.value) === null || Ue === void 0) && Ue[0] ? Mo(P.value[0], {
          locale: t.locale,
          format: "YYYYMMDDHHmmss",
          generateConfig: t.generateConfig
        }) : "";
      }), En = A(() => {
        var Ue;
        return !((Ue = P.value) === null || Ue === void 0) && Ue[1] ? Mo(P.value[1], {
          locale: t.locale,
          format: "YYYYMMDDHHmmss",
          generateConfig: t.generateConfig
        }) : "";
      });
      _e([G, Re, Ne], () => {
        G.value || (N(P.value), !Re.value.length || Re.value[0] === "" ? Qe("") : Ye.value !== nt.value && Pe(), !Ne.value.length || Ne.value[0] === "" ? Ce("") : Fe.value !== Ze.value && $e());
      }), _e([Xn, En], () => {
        N(P.value);
      }), process.env.NODE_ENV !== "production" && zt(() => {
        const {
          value: Ue,
          disabled: yt
        } = t;
        Ue && Array.isArray(yt) && (vn(yt, 0) && !vn(Ue, 0) || vn(yt, 1) && !vn(Ue, 1)) && Nn(!1, "`disabled` should not set with empty `value`. You should set `allowEmpty` or `value` instead.");
      }), i({
        focus: () => {
          p.value && p.value.focus();
        },
        blur: () => {
          p.value && p.value.blur(), g.value && g.value.blur();
        }
      });
      const di = A(() => G.value && qe.value && qe.value[0] && qe.value[1] && t.generateConfig.isAfter(qe.value[1], qe.value[0]) ? qe.value : null);
      function Ri() {
        let Ue = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, yt = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
        const {
          generateConfig: xt,
          showTime: fn,
          dateRender: Oi,
          direction: yi,
          disabledTime: io,
          prefixCls: Ln,
          locale: Bt
        } = t;
        let Fi = fn;
        if (fn && typeof fn == "object" && fn.defaultValue) {
          const Sn = fn.defaultValue;
          Fi = k(k({}, fn), {
            defaultValue: vn(Sn, b.value) || void 0
          });
        }
        let vo = null;
        return Oi && (vo = (Sn) => {
          let {
            current: Zn,
            today: wn
          } = Sn;
          return Oi({
            current: Zn,
            today: wn,
            info: {
              range: b.value ? "end" : "start"
            }
          });
        }), v(Zee, {
          value: {
            inRange: !0,
            panelPosition: Ue,
            rangedValue: Le.value || M.value,
            hoverRangedValue: di.value
          }
        }, {
          default: () => [v(d5, J(J(J({}, t), yt), {}, {
            dateRender: vo,
            showTime: Fi,
            mode: L.value[b.value],
            generateConfig: xt,
            style: void 0,
            direction: yi,
            disabledDate: b.value === 0 ? Y : Q,
            disabledTime: (Sn) => io ? io(Sn, b.value === 0 ? "start" : "end") : !1,
            class: Ae({
              [`${Ln}-panel-focused`]: b.value === 0 ? !Nt.value : !xn.value
            }),
            value: vn(M.value, b.value),
            locale: Bt,
            tabIndex: -1,
            onPanelChange: (Sn, Zn) => {
              b.value === 0 && je(!0), b.value === 1 && st(!0), B(ta(L.value, Zn, b.value), ta(M.value, Sn, b.value));
              let wn = Sn;
              Ue === "right" && L.value[b.value] === Zn && (wn = lp(wn, Zn, xt, -1)), D(wn, b.value);
            },
            onOk: null,
            onSelect: void 0,
            onChange: void 0,
            defaultValue: b.value === 0 ? vn(M.value, 1) : vn(M.value, 0)
          }), null)]
        });
      }
      const zo = (Ue, yt) => {
        const xt = ta(M.value, Ue, b.value);
        yt === "submit" || yt !== "key" && !o.value ? (le(xt, b.value), b.value === 0 ? je() : st()) : N(xt);
      };
      return ZC({
        operationRef: $,
        hideHeader: A(() => t.picker === "time"),
        onDateMouseenter: gt,
        onDateMouseleave: Et,
        hideRanges: A(() => !0),
        onSelect: zo,
        open: G
      }), () => {
        const {
          prefixCls: Ue = "rc-picker",
          id: yt,
          popupStyle: xt,
          dropdownClassName: fn,
          transitionName: Oi,
          dropdownAlign: yi,
          getPopupContainer: io,
          generateConfig: Ln,
          locale: Bt,
          placeholder: Fi,
          autofocus: vo,
          picker: Sn = "date",
          showTime: Zn,
          separator: wn = "~",
          disabledDate: Gn,
          panelRender: Ho,
          allowClear: Si,
          suffixIcon: ur,
          clearIcon: $o,
          inputReadOnly: Fl,
          renderExtraFooter: Vl,
          onMouseenter: ba,
          onMouseleave: Za,
          onMouseup: Hs,
          onOk: Ga,
          components: Ws,
          direction: xa,
          autocomplete: Ua = "off"
        } = t, Wu = xa === "rtl" ? {
          right: `${ee.value}px`
        } : {
          left: `${ee.value}px`
        };
        function Wo() {
          let Pi;
          const jo = u5(Ue, L.value[b.value], Vl), Ql = c5({
            prefixCls: Ue,
            components: Ws,
            needConfirmButton: o.value,
            okDisabled: !vn(M.value, b.value) || Gn && Gn(M.value[b.value]),
            locale: Bt,
            onOk: () => {
              vn(M.value, b.value) && (le(M.value, b.value), Ga && Ga(M.value));
            }
          });
          if (Sn !== "time" && !Zn) {
            const yo = b.value === 0 ? E.value : _.value, Ks = lp(yo, Sn, Ln), Zs = L.value[b.value] === Sn, Ja = Ri(Zs ? "left" : !1, {
              pickerValue: yo,
              onPickerValueChange: (Ku) => {
                D(Ku, b.value);
              }
            }), pd = Ri("right", {
              pickerValue: Ks,
              onPickerValueChange: (Ku) => {
                D(lp(Ku, Sn, Ln, -1), b.value);
              }
            });
            xa === "rtl" ? Pi = v(tt, null, [pd, Zs && Ja]) : Pi = v(tt, null, [Ja, Zs && pd]);
          } else
            Pi = Ri();
          let qo = v("div", {
            class: `${Ue}-panel-layout`
          }, [v(h5, {
            prefixCls: Ue,
            presets: l.value,
            onClick: (yo) => {
              le(yo, null), fe(!1, b.value);
            },
            onHover: (yo) => {
              Ke(yo);
            }
          }, null), v("div", null, [v("div", {
            class: `${Ue}-panels`
          }, [Pi]), (jo || Ql) && v("div", {
            class: `${Ue}-footer`
          }, [jo, Ql])])]);
          return Ho && (qo = Ho(qo)), v("div", {
            class: `${Ue}-panel-container`,
            style: {
              marginLeft: `${K.value}px`
            },
            ref: c,
            onMousedown: (yo) => {
              yo.preventDefault();
            }
          }, [qo]);
        }
        const hd = v("div", {
          class: Ae(`${Ue}-range-wrapper`, `${Ue}-${Sn}-range-wrapper`),
          style: {
            minWidth: `${ie.value}px`
          }
        }, [v("div", {
          ref: m,
          class: `${Ue}-range-arrow`,
          style: Wu
        }, null), Wo()]);
        let ju;
        ur && (ju = v("span", {
          class: `${Ue}-suffix`
        }, [ur]));
        let js;
        Si && (vn(P.value, 0) && !C.value[0] || vn(P.value, 1) && !C.value[1]) && (js = v("span", {
          onMousedown: (Pi) => {
            Pi.preventDefault(), Pi.stopPropagation();
          },
          onMouseup: (Pi) => {
            Pi.preventDefault(), Pi.stopPropagation();
            let jo = P.value;
            C.value[0] || (jo = ta(jo, null, 0)), C.value[1] || (jo = ta(jo, null, 1)), le(jo, null), fe(!1, b.value);
          },
          class: `${Ue}-clear`
        }, [$o || v("span", {
          class: `${Ue}-clear-btn`
        }, null)]));
        const qu = {
          size: J3(Sn, y.value[0], Ln)
        };
        let Yu = 0, qs = 0;
        d.value && f.value && h.value && (b.value === 0 ? qs = d.value.offsetWidth : (Yu = ee.value, qs = f.value.offsetWidth));
        const Ys = xa === "rtl" ? {
          right: `${Yu}px`
        } : {
          left: `${Yu}px`
        };
        return v("div", J({
          ref: u,
          class: Ae(Ue, `${Ue}-range`, n.class, {
            [`${Ue}-disabled`]: C.value[0] && C.value[1],
            [`${Ue}-focused`]: b.value === 0 ? wt.value : sn.value,
            [`${Ue}-rtl`]: xa === "rtl"
          }),
          style: n.style,
          onClick: Pn,
          onMouseenter: ba,
          onMouseleave: Za,
          onMousedown: bt,
          onMouseup: Hs
        }, a5(t)), [v("div", {
          class: Ae(`${Ue}-input`, {
            [`${Ue}-input-active`]: b.value === 0,
            [`${Ue}-input-placeholder`]: !!De.value
          }),
          ref: d
        }, [v("input", J(J(J({
          id: yt,
          disabled: C.value[0],
          readonly: Fl || typeof y.value[0] == "function" || !Nt.value,
          value: De.value || nt.value,
          onInput: (Pi) => {
            Qe(Pi.target.value);
          },
          autofocus: vo,
          placeholder: vn(Fi, 0) || "",
          ref: p
        }, _t.value), qu), {}, {
          autocomplete: Ua
        }), null)]), v("div", {
          class: `${Ue}-range-separator`,
          ref: h
        }, [wn]), v("div", {
          class: Ae(`${Ue}-input`, {
            [`${Ue}-input-active`]: b.value === 1,
            [`${Ue}-input-placeholder`]: !!at.value
          }),
          ref: f
        }, [v("input", J(J(J({
          disabled: C.value[1],
          readonly: Fl || typeof y.value[0] == "function" || !xn.value,
          value: at.value || Ze.value,
          onInput: (Pi) => {
            Ce(Pi.target.value);
          },
          placeholder: vn(Fi, 1) || "",
          ref: g
        }, nn.value), qu), {}, {
          autocomplete: Ua
        }), null)]), v("div", {
          class: `${Ue}-active-bar`,
          style: k(k({}, Ys), {
            width: `${qs}px`,
            position: "absolute"
          })
        }, null), ju, js, v(f5, {
          visible: G.value,
          popupStyle: xt,
          prefixCls: Ue,
          dropdownClassName: fn,
          dropdownAlign: yi,
          getPopupContainer: io,
          transitionName: Oi,
          range: !0,
          direction: xa
        }, {
          default: () => [v("div", {
            style: {
              pointerEvents: "none",
              position: "absolute",
              top: 0,
              bottom: 0,
              left: 0,
              right: 0
            }
          }, null)],
          popupElement: () => hd
        })]);
      };
    }
  });
}
const yte = vte();
var bte = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
const xte = {
  prefixCls: String,
  name: String,
  id: String,
  type: String,
  defaultChecked: {
    type: [Boolean, Number],
    default: void 0
  },
  checked: {
    type: [Boolean, Number],
    default: void 0
  },
  disabled: Boolean,
  tabindex: {
    type: [Number, String]
  },
  readonly: Boolean,
  autofocus: Boolean,
  value: ve.any,
  required: Boolean
}, y5 = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "Checkbox",
  inheritAttrs: !1,
  props: Kn(xte, {
    prefixCls: "rc-checkbox",
    type: "checkbox",
    defaultChecked: !1
  }),
  emits: ["click", "change"],
  setup(t, e) {
    let {
      attrs: n,
      emit: i,
      expose: o
    } = e;
    const r = de(t.checked === void 0 ? t.defaultChecked : t.checked), a = de();
    _e(() => t.checked, () => {
      r.value = t.checked;
    }), o({
      focus() {
        var c;
        (c = a.value) === null || c === void 0 || c.focus();
      },
      blur() {
        var c;
        (c = a.value) === null || c === void 0 || c.blur();
      }
    });
    const l = de(), s = (c) => {
      if (t.disabled)
        return;
      t.checked === void 0 && (r.value = c.target.checked), c.shiftKey = l.value;
      const d = {
        target: k(k({}, t), {
          checked: c.target.checked
        }),
        stopPropagation() {
          c.stopPropagation();
        },
        preventDefault() {
          c.preventDefault();
        },
        nativeEvent: c
      };
      t.checked !== void 0 && (a.value.checked = !!t.checked), i("change", d), l.value = !1;
    }, u = (c) => {
      i("click", c), l.value = c.shiftKey;
    };
    return () => {
      const {
        prefixCls: c,
        name: d,
        id: f,
        type: h,
        disabled: p,
        readonly: g,
        tabindex: m,
        autofocus: y,
        value: b,
        required: w
      } = t, $ = bte(t, ["prefixCls", "name", "id", "type", "disabled", "readonly", "tabindex", "autofocus", "value", "required"]), {
        class: C,
        onFocus: P,
        onBlur: O,
        onKeydown: E,
        onKeypress: _,
        onKeyup: D
      } = n, M = k(k({}, $), n), N = Object.keys(M).reduce((B, Y) => ((Y.startsWith("data-") || Y.startsWith("aria-") || Y === "role") && (B[Y] = M[Y]), B), {}), L = Ae(c, C, {
        [`${c}-checked`]: r.value,
        [`${c}-disabled`]: p
      }), j = k(k({
        name: d,
        id: f,
        type: h,
        readonly: g,
        disabled: p,
        tabindex: m,
        class: `${c}-input`,
        checked: !!r.value,
        autofocus: y,
        value: b
      }, N), {
        onChange: s,
        onClick: u,
        onFocus: P,
        onBlur: O,
        onKeydown: E,
        onKeypress: _,
        onKeyup: D,
        required: w
      });
      return v("span", {
        class: L
      }, [v("input", J({
        ref: a
      }, j), null), v("span", {
        class: `${c}-inner`
      }, null)]);
    };
  }
}), b5 = Symbol("radioGroupContextKey"), Ote = (t) => {
  Xt(b5, t);
}, Ste = () => qt(b5, void 0), x5 = Symbol("radioOptionTypeContextKey"), wte = (t) => {
  Xt(x5, t);
}, Cte = () => qt(x5, void 0), $te = new gn("antRadioEffect", {
  "0%": {
    transform: "scale(1)",
    opacity: 0.5
  },
  "100%": {
    transform: "scale(1.6)",
    opacity: 0
  }
}), kte = (t) => {
  const {
    componentCls: e,
    antCls: n
  } = t, i = `${e}-group`;
  return {
    [i]: k(k({}, kn(t)), {
      display: "inline-block",
      fontSize: 0,
      // RTL
      [`&${i}-rtl`]: {
        direction: "rtl"
      },
      [`${n}-badge ${n}-badge-count`]: {
        zIndex: 1
      },
      [`> ${n}-badge:not(:first-child) > ${n}-button-wrapper`]: {
        borderInlineStart: "none"
      }
    })
  };
}, Tte = (t) => {
  const {
    componentCls: e,
    radioWrapperMarginRight: n,
    radioCheckedColor: i,
    radioSize: o,
    motionDurationSlow: r,
    motionDurationMid: a,
    motionEaseInOut: l,
    motionEaseInOutCirc: s,
    radioButtonBg: u,
    colorBorder: c,
    lineWidth: d,
    radioDotSize: f,
    colorBgContainerDisabled: h,
    colorTextDisabled: p,
    paddingXS: g,
    radioDotDisabledColor: m,
    lineType: y,
    radioDotDisabledSize: b,
    wireframe: w,
    colorWhite: $
  } = t, C = `${e}-inner`;
  return {
    [`${e}-wrapper`]: k(k({}, kn(t)), {
      position: "relative",
      display: "inline-flex",
      alignItems: "baseline",
      marginInlineStart: 0,
      marginInlineEnd: n,
      cursor: "pointer",
      // RTL
      [`&${e}-wrapper-rtl`]: {
        direction: "rtl"
      },
      "&-disabled": {
        cursor: "not-allowed",
        color: t.colorTextDisabled
      },
      "&::after": {
        display: "inline-block",
        width: 0,
        overflow: "hidden",
        content: '"\\a0"'
      },
      // hashId 在 wrapper 上，只能铺平
      [`${e}-checked::after`]: {
        position: "absolute",
        insetBlockStart: 0,
        insetInlineStart: 0,
        width: "100%",
        height: "100%",
        border: `${d}px ${y} ${i}`,
        borderRadius: "50%",
        visibility: "hidden",
        animationName: $te,
        animationDuration: r,
        animationTimingFunction: l,
        animationFillMode: "both",
        content: '""'
      },
      [e]: k(k({}, kn(t)), {
        position: "relative",
        display: "inline-block",
        outline: "none",
        cursor: "pointer",
        alignSelf: "center"
      }),
      [`${e}-wrapper:hover &,
        &:hover ${C}`]: {
        borderColor: i
      },
      [`${e}-input:focus-visible + ${C}`]: k({}, _s(t)),
      [`${e}:hover::after, ${e}-wrapper:hover &::after`]: {
        visibility: "visible"
      },
      [`${e}-inner`]: {
        "&::after": {
          boxSizing: "border-box",
          position: "absolute",
          insetBlockStart: "50%",
          insetInlineStart: "50%",
          display: "block",
          width: o,
          height: o,
          marginBlockStart: o / -2,
          marginInlineStart: o / -2,
          backgroundColor: w ? i : $,
          borderBlockStart: 0,
          borderInlineStart: 0,
          borderRadius: o,
          transform: "scale(0)",
          opacity: 0,
          transition: `all ${r} ${s}`,
          content: '""'
        },
        boxSizing: "border-box",
        position: "relative",
        insetBlockStart: 0,
        insetInlineStart: 0,
        display: "block",
        width: o,
        height: o,
        backgroundColor: u,
        borderColor: c,
        borderStyle: "solid",
        borderWidth: d,
        borderRadius: "50%",
        transition: `all ${a}`
      },
      [`${e}-input`]: {
        position: "absolute",
        insetBlockStart: 0,
        insetInlineEnd: 0,
        insetBlockEnd: 0,
        insetInlineStart: 0,
        zIndex: 1,
        cursor: "pointer",
        opacity: 0
      },
      // 选中状态
      [`${e}-checked`]: {
        [C]: {
          borderColor: i,
          backgroundColor: w ? u : i,
          "&::after": {
            transform: `scale(${f / o})`,
            opacity: 1,
            transition: `all ${r} ${s}`
          }
        }
      },
      [`${e}-disabled`]: {
        cursor: "not-allowed",
        [C]: {
          backgroundColor: h,
          borderColor: c,
          cursor: "not-allowed",
          "&::after": {
            backgroundColor: m
          }
        },
        [`${e}-input`]: {
          cursor: "not-allowed"
        },
        [`${e}-disabled + span`]: {
          color: p,
          cursor: "not-allowed"
        },
        [`&${e}-checked`]: {
          [C]: {
            "&::after": {
              transform: `scale(${b / o})`
            }
          }
        }
      },
      [`span${e} + *`]: {
        paddingInlineStart: g,
        paddingInlineEnd: g
      }
    })
  };
}, Pte = (t) => {
  const {
    radioButtonColor: e,
    controlHeight: n,
    componentCls: i,
    lineWidth: o,
    lineType: r,
    colorBorder: a,
    motionDurationSlow: l,
    motionDurationMid: s,
    radioButtonPaddingHorizontal: u,
    fontSize: c,
    radioButtonBg: d,
    fontSizeLG: f,
    controlHeightLG: h,
    controlHeightSM: p,
    paddingXS: g,
    borderRadius: m,
    borderRadiusSM: y,
    borderRadiusLG: b,
    radioCheckedColor: w,
    radioButtonCheckedBg: $,
    radioButtonHoverColor: C,
    radioButtonActiveColor: P,
    radioSolidCheckedColor: O,
    colorTextDisabled: E,
    colorBgContainerDisabled: _,
    radioDisabledButtonCheckedColor: D,
    radioDisabledButtonCheckedBg: M
  } = t;
  return {
    [`${i}-button-wrapper`]: {
      position: "relative",
      display: "inline-block",
      height: n,
      margin: 0,
      paddingInline: u,
      paddingBlock: 0,
      color: e,
      fontSize: c,
      lineHeight: `${n - o * 2}px`,
      background: d,
      border: `${o}px ${r} ${a}`,
      // strange align fix for chrome but works
      // https://gw.alipayobjects.com/zos/rmsportal/VFTfKXJuogBAXcvfAUWJ.gif
      borderBlockStartWidth: o + 0.02,
      borderInlineStartWidth: 0,
      borderInlineEndWidth: o,
      cursor: "pointer",
      transition: [`color ${s}`, `background ${s}`, `border-color ${s}`, `box-shadow ${s}`].join(","),
      a: {
        color: e
      },
      [`> ${i}-button`]: {
        position: "absolute",
        insetBlockStart: 0,
        insetInlineStart: 0,
        zIndex: -1,
        width: "100%",
        height: "100%"
      },
      "&:not(:first-child)": {
        "&::before": {
          position: "absolute",
          insetBlockStart: -o,
          insetInlineStart: -o,
          display: "block",
          boxSizing: "content-box",
          width: 1,
          height: "100%",
          paddingBlock: o,
          paddingInline: 0,
          backgroundColor: a,
          transition: `background-color ${l}`,
          content: '""'
        }
      },
      "&:first-child": {
        borderInlineStart: `${o}px ${r} ${a}`,
        borderStartStartRadius: m,
        borderEndStartRadius: m
      },
      "&:last-child": {
        borderStartEndRadius: m,
        borderEndEndRadius: m
      },
      "&:first-child:last-child": {
        borderRadius: m
      },
      [`${i}-group-large &`]: {
        height: h,
        fontSize: f,
        lineHeight: `${h - o * 2}px`,
        "&:first-child": {
          borderStartStartRadius: b,
          borderEndStartRadius: b
        },
        "&:last-child": {
          borderStartEndRadius: b,
          borderEndEndRadius: b
        }
      },
      [`${i}-group-small &`]: {
        height: p,
        paddingInline: g - o,
        paddingBlock: 0,
        lineHeight: `${p - o * 2}px`,
        "&:first-child": {
          borderStartStartRadius: y,
          borderEndStartRadius: y
        },
        "&:last-child": {
          borderStartEndRadius: y,
          borderEndEndRadius: y
        }
      },
      "&:hover": {
        position: "relative",
        color: w
      },
      "&:has(:focus-visible)": k({}, _s(t)),
      [`${i}-inner, input[type='checkbox'], input[type='radio']`]: {
        width: 0,
        height: 0,
        opacity: 0,
        pointerEvents: "none"
      },
      [`&-checked:not(${i}-button-wrapper-disabled)`]: {
        zIndex: 1,
        color: w,
        background: $,
        borderColor: w,
        "&::before": {
          backgroundColor: w
        },
        "&:first-child": {
          borderColor: w
        },
        "&:hover": {
          color: C,
          borderColor: C,
          "&::before": {
            backgroundColor: C
          }
        },
        "&:active": {
          color: P,
          borderColor: P,
          "&::before": {
            backgroundColor: P
          }
        }
      },
      [`${i}-group-solid &-checked:not(${i}-button-wrapper-disabled)`]: {
        color: O,
        background: w,
        borderColor: w,
        "&:hover": {
          color: O,
          background: C,
          borderColor: C
        },
        "&:active": {
          color: O,
          background: P,
          borderColor: P
        }
      },
      "&-disabled": {
        color: E,
        backgroundColor: _,
        borderColor: a,
        cursor: "not-allowed",
        "&:first-child, &:hover": {
          color: E,
          backgroundColor: _,
          borderColor: a
        }
      },
      [`&-disabled${i}-button-wrapper-checked`]: {
        color: D,
        backgroundColor: M,
        borderColor: a,
        boxShadow: "none"
      }
    }
  };
}, O5 = Vn("Radio", (t) => {
  const {
    padding: e,
    lineWidth: n,
    controlItemBgActiveDisabled: i,
    colorTextDisabled: o,
    colorBgContainer: r,
    fontSizeLG: a,
    controlOutline: l,
    colorPrimaryHover: s,
    colorPrimaryActive: u,
    colorText: c,
    colorPrimary: d,
    marginXS: f,
    controlOutlineWidth: h,
    colorTextLightSolid: p,
    wireframe: g
  } = t, m = `0 0 0 ${h}px ${l}`, y = m, b = a, w = 4, $ = b - w * 2, C = g ? $ : b - (w + n) * 2, P = d, O = c, E = s, _ = u, D = e - n, L = dn(t, {
    radioFocusShadow: m,
    radioButtonFocusShadow: y,
    radioSize: b,
    radioDotSize: C,
    radioDotDisabledSize: $,
    radioCheckedColor: P,
    radioDotDisabledColor: o,
    radioSolidCheckedColor: p,
    radioButtonBg: r,
    radioButtonCheckedBg: r,
    radioButtonColor: O,
    radioButtonHoverColor: E,
    radioButtonActiveColor: _,
    radioButtonPaddingHorizontal: D,
    radioDisabledButtonCheckedBg: i,
    radioDisabledButtonCheckedColor: o,
    radioWrapperMarginRight: f
  });
  return [kte(L), Tte(L), Pte(L)];
});
var Ete = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
const S5 = () => ({
  prefixCls: String,
  checked: pt(),
  disabled: pt(),
  isGroup: pt(),
  value: ve.any,
  name: String,
  id: String,
  autofocus: pt(),
  onChange: ot(),
  onFocus: ot(),
  onBlur: ot(),
  onClick: ot(),
  "onUpdate:checked": ot(),
  "onUpdate:value": ot()
}), uo = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ARadio",
  inheritAttrs: !1,
  props: S5(),
  setup(t, e) {
    let {
      emit: n,
      expose: i,
      slots: o,
      attrs: r
    } = e;
    const a = jr(), l = Fr.useInject(), s = Cte(), u = Ste(), c = qa(), d = A(() => {
      var E;
      return (E = g.value) !== null && E !== void 0 ? E : c.value;
    }), f = de(), {
      prefixCls: h,
      direction: p,
      disabled: g
    } = Ht("radio", t), m = A(() => u?.optionType.value === "button" || s === "button" ? `${h.value}-button` : h.value), y = qa(), [b, w] = O5(h);
    i({
      focus: () => {
        f.value.focus();
      },
      blur: () => {
        f.value.blur();
      }
    });
    const P = (E) => {
      const _ = E.target.checked;
      n("update:checked", _), n("update:value", _), n("change", E), a.onFieldChange();
    }, O = (E) => {
      n("change", E), u && u.onChange && u.onChange(E);
    };
    return () => {
      var E;
      const _ = u, {
        prefixCls: D,
        id: M = a.id.value
      } = t, N = Ete(t, ["prefixCls", "id"]), L = k(k({
        prefixCls: m.value,
        id: M
      }, ii(N, ["onUpdate:checked", "onUpdate:value"])), {
        disabled: (E = g.value) !== null && E !== void 0 ? E : y.value
      });
      _ ? (L.name = _.name.value, L.onChange = O, L.checked = t.value === _.value.value, L.disabled = d.value || _.disabled.value) : L.onChange = P;
      const j = Ae({
        [`${m.value}-wrapper`]: !0,
        [`${m.value}-wrapper-checked`]: L.checked,
        [`${m.value}-wrapper-disabled`]: L.disabled,
        [`${m.value}-wrapper-rtl`]: p.value === "rtl",
        [`${m.value}-wrapper-in-form-item`]: l.isFormItemInput
      }, r.class, w.value);
      return b(v("label", J(J({}, r), {}, {
        class: j
      }), [v(y5, J(J({}, L), {}, {
        type: "radio",
        ref: f
      }), null), o.default && v("span", null, [o.default()])]));
    };
  }
}), _te = () => ({
  prefixCls: String,
  value: ve.any,
  size: yn(),
  options: ui(),
  disabled: pt(),
  name: String,
  buttonStyle: yn("outline"),
  id: String,
  optionType: yn("default"),
  onChange: ot(),
  "onUpdate:value": ot()
}), w5 = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ARadioGroup",
  inheritAttrs: !1,
  props: _te(),
  // emits: ['update:value', 'change'],
  setup(t, e) {
    let {
      slots: n,
      emit: i,
      attrs: o
    } = e;
    const r = jr(), {
      prefixCls: a,
      direction: l,
      size: s
    } = Ht("radio", t), [u, c] = O5(a), d = de(t.value), f = de(!1);
    return _e(() => t.value, (p) => {
      d.value = p, f.value = !1;
    }), Ote({
      onChange: (p) => {
        const g = d.value, {
          value: m
        } = p.target;
        "value" in t || (d.value = m), !f.value && m !== g && (f.value = !0, i("update:value", m), i("change", p), r.onFieldChange()), rn(() => {
          f.value = !1;
        });
      },
      value: d,
      disabled: A(() => t.disabled),
      name: A(() => t.name),
      optionType: A(() => t.optionType)
    }), () => {
      var p;
      const {
        options: g,
        buttonStyle: m,
        id: y = r.id.value
      } = t, b = `${a.value}-group`, w = Ae(b, `${b}-${m}`, {
        [`${b}-${s.value}`]: s.value,
        [`${b}-rtl`]: l.value === "rtl"
      }, o.class, c.value);
      let $ = null;
      return g && g.length > 0 ? $ = g.map((C) => {
        if (typeof C == "string" || typeof C == "number")
          return v(uo, {
            key: C,
            prefixCls: a.value,
            disabled: t.disabled,
            value: C,
            checked: d.value === C
          }, {
            default: () => [C]
          });
        const {
          value: P,
          disabled: O,
          label: E
        } = C;
        return v(uo, {
          key: `radio-group-value-options-${P}`,
          prefixCls: a.value,
          disabled: O || t.disabled,
          value: P,
          checked: d.value === P
        }, {
          default: () => [E]
        });
      }) : $ = (p = n.default) === null || p === void 0 ? void 0 : p.call(n), u(v("div", J(J({}, o), {}, {
        class: w,
        id: y
      }), [$]));
    };
  }
}), Ite = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ARadioButton",
  inheritAttrs: !1,
  props: S5(),
  setup(t, e) {
    let {
      slots: n,
      attrs: i
    } = e;
    const {
      prefixCls: o
    } = Ht("radio", t);
    return wte("button"), () => {
      var r;
      return v(uo, J(J(J({}, i), t), {}, {
        prefixCls: o.value
      }), {
        default: () => [(r = n.default) === null || r === void 0 ? void 0 : r.call(n)]
      });
    };
  }
});
uo.Group = w5;
uo.Button = Ite;
uo.install = function(t) {
  return t.component(uo.name, uo), t.component(uo.Group.name, uo.Group), t.component(uo.Button.name, uo.Button), t;
};
const C5 = (t) => ({
  // Firefox
  "&::-moz-placeholder": {
    opacity: 1
  },
  "&::placeholder": {
    color: t,
    userSelect: "none"
    // https://github.com/ant-design/ant-design/pull/32639
  },
  "&:placeholder-shown": {
    textOverflow: "ellipsis"
  }
}), ch = (t) => ({
  borderColor: t.inputBorderHoverColor,
  borderInlineEndWidth: t.lineWidth
}), Kc = (t) => ({
  borderColor: t.inputBorderHoverColor,
  boxShadow: `0 0 0 ${t.controlOutlineWidth}px ${t.controlOutline}`,
  borderInlineEndWidth: t.lineWidth,
  outline: 0
}), $5 = (t) => ({
  color: t.colorTextDisabled,
  backgroundColor: t.colorBgContainerDisabled,
  borderColor: t.colorBorder,
  boxShadow: "none",
  cursor: "not-allowed",
  opacity: 1,
  "&:hover": k({}, ch(dn(t, {
    inputBorderHoverColor: t.colorBorder
  })))
}), k5 = (t) => {
  const {
    inputPaddingVerticalLG: e,
    fontSizeLG: n,
    lineHeightLG: i,
    borderRadiusLG: o,
    inputPaddingHorizontalLG: r
  } = t;
  return {
    padding: `${e}px ${r}px`,
    fontSize: n,
    lineHeight: i,
    borderRadius: o
  };
}, p$ = (t) => ({
  padding: `${t.inputPaddingVerticalSM}px ${t.controlPaddingHorizontalSM - 1}px`,
  borderRadius: t.borderRadiusSM
}), Ty = (t, e) => {
  const {
    componentCls: n,
    colorError: i,
    colorWarning: o,
    colorErrorOutline: r,
    colorWarningOutline: a,
    colorErrorBorderHover: l,
    colorWarningBorderHover: s
  } = t;
  return {
    [`&-status-error:not(${e}-disabled):not(${e}-borderless)${e}`]: {
      borderColor: i,
      "&:hover": {
        borderColor: l
      },
      "&:focus, &-focused": k({}, Kc(dn(t, {
        inputBorderActiveColor: i,
        inputBorderHoverColor: i,
        controlOutline: r
      }))),
      [`${n}-prefix`]: {
        color: i
      }
    },
    [`&-status-warning:not(${e}-disabled):not(${e}-borderless)${e}`]: {
      borderColor: o,
      "&:hover": {
        borderColor: s
      },
      "&:focus, &-focused": k({}, Kc(dn(t, {
        inputBorderActiveColor: o,
        inputBorderHoverColor: o,
        controlOutline: a
      }))),
      [`${n}-prefix`]: {
        color: o
      }
    }
  };
}, dh = (t) => k(k({
  position: "relative",
  display: "inline-block",
  width: "100%",
  minWidth: 0,
  padding: `${t.inputPaddingVertical}px ${t.inputPaddingHorizontal}px`,
  color: t.colorText,
  fontSize: t.fontSize,
  lineHeight: t.lineHeight,
  backgroundColor: t.colorBgContainer,
  backgroundImage: "none",
  borderWidth: t.lineWidth,
  borderStyle: t.lineType,
  borderColor: t.colorBorder,
  borderRadius: t.borderRadius,
  transition: `all ${t.motionDurationMid}`
}, C5(t.colorTextPlaceholder)), {
  "&:hover": k({}, ch(t)),
  "&:focus, &-focused": k({}, Kc(t)),
  "&-disabled, &[disabled]": k({}, $5(t)),
  "&-borderless": {
    "&, &:hover, &:focus, &-focused, &-disabled, &[disabled]": {
      backgroundColor: "transparent",
      border: "none",
      boxShadow: "none"
    }
  },
  // Reset height for `textarea`s
  "textarea&": {
    maxWidth: "100%",
    height: "auto",
    minHeight: t.controlHeight,
    lineHeight: t.lineHeight,
    verticalAlign: "bottom",
    transition: `all ${t.motionDurationSlow}, height 0s`,
    resize: "vertical"
  },
  // Size
  "&-lg": k({}, k5(t)),
  "&-sm": k({}, p$(t)),
  // RTL
  "&-rtl": {
    direction: "rtl"
  },
  "&-textarea-rtl": {
    direction: "rtl"
  }
}), T5 = (t) => {
  const {
    componentCls: e,
    antCls: n
  } = t;
  return {
    position: "relative",
    display: "table",
    width: "100%",
    borderCollapse: "separate",
    borderSpacing: 0,
    // Undo padding and float of grid classes
    "&[class*='col-']": {
      paddingInlineEnd: t.paddingXS,
      "&:last-child": {
        paddingInlineEnd: 0
      }
    },
    // Sizing options
    [`&-lg ${e}, &-lg > ${e}-group-addon`]: k({}, k5(t)),
    [`&-sm ${e}, &-sm > ${e}-group-addon`]: k({}, p$(t)),
    [`> ${e}`]: {
      display: "table-cell",
      "&:not(:first-child):not(:last-child)": {
        borderRadius: 0
      }
    },
    [`${e}-group`]: {
      "&-addon, &-wrap": {
        display: "table-cell",
        width: 1,
        whiteSpace: "nowrap",
        verticalAlign: "middle",
        "&:not(:first-child):not(:last-child)": {
          borderRadius: 0
        }
      },
      "&-wrap > *": {
        display: "block !important"
      },
      "&-addon": {
        position: "relative",
        padding: `0 ${t.inputPaddingHorizontal}px`,
        color: t.colorText,
        fontWeight: "normal",
        fontSize: t.fontSize,
        textAlign: "center",
        backgroundColor: t.colorFillAlter,
        border: `${t.lineWidth}px ${t.lineType} ${t.colorBorder}`,
        borderRadius: t.borderRadius,
        transition: `all ${t.motionDurationSlow}`,
        lineHeight: 1,
        // Reset Select's style in addon
        [`${n}-select`]: {
          margin: `-${t.inputPaddingVertical + 1}px -${t.inputPaddingHorizontal}px`,
          [`&${n}-select-single:not(${n}-select-customize-input)`]: {
            [`${n}-select-selector`]: {
              backgroundColor: "inherit",
              border: `${t.lineWidth}px ${t.lineType} transparent`,
              boxShadow: "none"
            }
          },
          "&-open, &-focused": {
            [`${n}-select-selector`]: {
              color: t.colorPrimary
            }
          }
        },
        // https://github.com/ant-design/ant-design/issues/31333
        [`${n}-cascader-picker`]: {
          margin: `-9px -${t.inputPaddingHorizontal}px`,
          backgroundColor: "transparent",
          [`${n}-cascader-input`]: {
            textAlign: "start",
            border: 0,
            boxShadow: "none"
          }
        }
      },
      "&-addon:first-child": {
        borderInlineEnd: 0
      },
      "&-addon:last-child": {
        borderInlineStart: 0
      }
    },
    [`${e}`]: {
      float: "inline-start",
      width: "100%",
      marginBottom: 0,
      textAlign: "inherit",
      "&:focus": {
        zIndex: 1,
        borderInlineEndWidth: 1
      },
      "&:hover": {
        zIndex: 1,
        borderInlineEndWidth: 1,
        [`${e}-search-with-button &`]: {
          zIndex: 0
        }
      }
    },
    // Reset rounded corners
    [`> ${e}:first-child, ${e}-group-addon:first-child`]: {
      borderStartEndRadius: 0,
      borderEndEndRadius: 0,
      // Reset Select's style in addon
      [`${n}-select ${n}-select-selector`]: {
        borderStartEndRadius: 0,
        borderEndEndRadius: 0
      }
    },
    [`> ${e}-affix-wrapper`]: {
      [`&:not(:first-child) ${e}`]: {
        borderStartStartRadius: 0,
        borderEndStartRadius: 0
      },
      [`&:not(:last-child) ${e}`]: {
        borderStartEndRadius: 0,
        borderEndEndRadius: 0
      }
    },
    [`> ${e}:last-child, ${e}-group-addon:last-child`]: {
      borderStartStartRadius: 0,
      borderEndStartRadius: 0,
      // Reset Select's style in addon
      [`${n}-select ${n}-select-selector`]: {
        borderStartStartRadius: 0,
        borderEndStartRadius: 0
      }
    },
    [`${e}-affix-wrapper`]: {
      "&:not(:last-child)": {
        borderStartEndRadius: 0,
        borderEndEndRadius: 0,
        [`${e}-search &`]: {
          borderStartStartRadius: t.borderRadius,
          borderEndStartRadius: t.borderRadius
        }
      },
      [`&:not(:first-child), ${e}-search &:not(:first-child)`]: {
        borderStartStartRadius: 0,
        borderEndStartRadius: 0
      }
    },
    [`&${e}-group-compact`]: k(k({
      display: "block"
    }, Es()), {
      [`${e}-group-addon, ${e}-group-wrap, > ${e}`]: {
        "&:not(:first-child):not(:last-child)": {
          borderInlineEndWidth: t.lineWidth,
          "&:hover": {
            zIndex: 1
          },
          "&:focus": {
            zIndex: 1
          }
        }
      },
      "& > *": {
        display: "inline-block",
        float: "none",
        verticalAlign: "top",
        borderRadius: 0
      },
      [`& > ${e}-affix-wrapper`]: {
        display: "inline-flex"
      },
      [`& > ${n}-picker-range`]: {
        display: "inline-flex"
      },
      "& > *:not(:last-child)": {
        marginInlineEnd: -t.lineWidth,
        borderInlineEndWidth: t.lineWidth
      },
      // Undo float for .ant-input-group .ant-input
      [`${e}`]: {
        float: "none"
      },
      // reset border for Select, DatePicker, AutoComplete, Cascader, Mention, TimePicker, Input
      [`& > ${n}-select > ${n}-select-selector,
      & > ${n}-select-auto-complete ${e},
      & > ${n}-cascader-picker ${e},
      & > ${e}-group-wrapper ${e}`]: {
        borderInlineEndWidth: t.lineWidth,
        borderRadius: 0,
        "&:hover": {
          zIndex: 1
        },
        "&:focus": {
          zIndex: 1
        }
      },
      [`& > ${n}-select-focused`]: {
        zIndex: 1
      },
      // update z-index for arrow icon
      [`& > ${n}-select > ${n}-select-arrow`]: {
        zIndex: 1
        // https://github.com/ant-design/ant-design/issues/20371
      },
      [`& > *:first-child,
      & > ${n}-select:first-child > ${n}-select-selector,
      & > ${n}-select-auto-complete:first-child ${e},
      & > ${n}-cascader-picker:first-child ${e}`]: {
        borderStartStartRadius: t.borderRadius,
        borderEndStartRadius: t.borderRadius
      },
      [`& > *:last-child,
      & > ${n}-select:last-child > ${n}-select-selector,
      & > ${n}-cascader-picker:last-child ${e},
      & > ${n}-cascader-picker-focused:last-child ${e}`]: {
        borderInlineEndWidth: t.lineWidth,
        borderStartEndRadius: t.borderRadius,
        borderEndEndRadius: t.borderRadius
      },
      // https://github.com/ant-design/ant-design/issues/12493
      [`& > ${n}-select-auto-complete ${e}`]: {
        verticalAlign: "top"
      },
      [`${e}-group-wrapper + ${e}-group-wrapper`]: {
        marginInlineStart: -t.lineWidth,
        [`${e}-affix-wrapper`]: {
          borderRadius: 0
        }
      },
      [`${e}-group-wrapper:not(:last-child)`]: {
        [`&${e}-search > ${e}-group`]: {
          [`& > ${e}-group-addon > ${e}-search-button`]: {
            borderRadius: 0
          },
          [`& > ${e}`]: {
            borderStartStartRadius: t.borderRadius,
            borderStartEndRadius: 0,
            borderEndEndRadius: 0,
            borderEndStartRadius: t.borderRadius
          }
        }
      }
    }),
    [`&&-sm ${n}-btn`]: {
      fontSize: t.fontSizeSM,
      height: t.controlHeightSM,
      lineHeight: "normal"
    },
    [`&&-lg ${n}-btn`]: {
      fontSize: t.fontSizeLG,
      height: t.controlHeightLG,
      lineHeight: "normal"
    },
    // Fix https://github.com/ant-design/ant-design/issues/5754
    [`&&-lg ${n}-select-single ${n}-select-selector`]: {
      height: `${t.controlHeightLG}px`,
      [`${n}-select-selection-item, ${n}-select-selection-placeholder`]: {
        // -2 is for the border size & override default
        lineHeight: `${t.controlHeightLG - 2}px`
      },
      [`${n}-select-selection-search-input`]: {
        height: `${t.controlHeightLG}px`
      }
    },
    [`&&-sm ${n}-select-single ${n}-select-selector`]: {
      height: `${t.controlHeightSM}px`,
      [`${n}-select-selection-item, ${n}-select-selection-placeholder`]: {
        // -2 is for the border size & override default
        lineHeight: `${t.controlHeightSM - 2}px`
      },
      [`${n}-select-selection-search-input`]: {
        height: `${t.controlHeightSM}px`
      }
    }
  };
}, Mte = (t) => {
  const {
    componentCls: e,
    controlHeightSM: n,
    lineWidth: i
  } = t, r = (n - i * 2 - 16) / 2;
  return {
    [e]: k(k(k(k({}, kn(t)), dh(t)), Ty(t, e)), {
      '&[type="color"]': {
        height: t.controlHeight,
        [`&${e}-lg`]: {
          height: t.controlHeightLG
        },
        [`&${e}-sm`]: {
          height: n,
          paddingTop: r,
          paddingBottom: r
        }
      }
    })
  };
}, Ate = (t) => {
  const {
    componentCls: e
  } = t;
  return {
    // ========================= Input =========================
    [`${e}-clear-icon`]: {
      margin: 0,
      color: t.colorTextQuaternary,
      fontSize: t.fontSizeIcon,
      verticalAlign: -1,
      // https://github.com/ant-design/ant-design/pull/18151
      // https://codesandbox.io/s/wizardly-sun-u10br
      cursor: "pointer",
      transition: `color ${t.motionDurationSlow}`,
      "&:hover": {
        color: t.colorTextTertiary
      },
      "&:active": {
        color: t.colorText
      },
      "&-hidden": {
        visibility: "hidden"
      },
      "&-has-suffix": {
        margin: `0 ${t.inputAffixPadding}px`
      }
    },
    // ======================= TextArea ========================
    "&-textarea-with-clear-btn": {
      padding: "0 !important",
      border: "0 !important",
      [`${e}-clear-icon`]: {
        position: "absolute",
        insetBlockStart: t.paddingXS,
        insetInlineEnd: t.paddingXS,
        zIndex: 1
      }
    }
  };
}, Rte = (t) => {
  const {
    componentCls: e,
    inputAffixPadding: n,
    colorTextDescription: i,
    motionDurationSlow: o,
    colorIcon: r,
    colorIconHover: a,
    iconCls: l
  } = t;
  return {
    [`${e}-affix-wrapper`]: k(k(k(k(k({}, dh(t)), {
      display: "inline-flex",
      [`&:not(${e}-affix-wrapper-disabled):hover`]: k(k({}, ch(t)), {
        zIndex: 1,
        [`${e}-search-with-button &`]: {
          zIndex: 0
        }
      }),
      "&-focused, &:focus": {
        zIndex: 1
      },
      "&-disabled": {
        [`${e}[disabled]`]: {
          background: "transparent"
        }
      },
      [`> input${e}`]: {
        padding: 0,
        fontSize: "inherit",
        border: "none",
        borderRadius: 0,
        outline: "none",
        "&:focus": {
          boxShadow: "none !important"
        }
      },
      "&::before": {
        width: 0,
        visibility: "hidden",
        content: '"\\a0"'
      },
      [`${e}`]: {
        "&-prefix, &-suffix": {
          display: "flex",
          flex: "none",
          alignItems: "center",
          "> *:not(:last-child)": {
            marginInlineEnd: t.paddingXS
          }
        },
        "&-show-count-suffix": {
          color: i
        },
        "&-show-count-has-suffix": {
          marginInlineEnd: t.paddingXXS
        },
        "&-prefix": {
          marginInlineEnd: n
        },
        "&-suffix": {
          marginInlineStart: n
        }
      }
    }), Ate(t)), {
      // password
      [`${l}${e}-password-icon`]: {
        color: r,
        cursor: "pointer",
        transition: `all ${o}`,
        "&:hover": {
          color: a
        }
      }
    }), Ty(t, `${e}-affix-wrapper`))
  };
}, Dte = (t) => {
  const {
    componentCls: e,
    colorError: n,
    colorSuccess: i,
    borderRadiusLG: o,
    borderRadiusSM: r
  } = t;
  return {
    [`${e}-group`]: k(k(k({}, kn(t)), T5(t)), {
      "&-rtl": {
        direction: "rtl"
      },
      "&-wrapper": {
        display: "inline-block",
        width: "100%",
        textAlign: "start",
        verticalAlign: "top",
        "&-rtl": {
          direction: "rtl"
        },
        // Size
        "&-lg": {
          [`${e}-group-addon`]: {
            borderRadius: o
          }
        },
        "&-sm": {
          [`${e}-group-addon`]: {
            borderRadius: r
          }
        },
        // Status
        "&-status-error": {
          [`${e}-group-addon`]: {
            color: n,
            borderColor: n
          }
        },
        "&-status-warning": {
          [`${e}-group-addon:last-child`]: {
            color: i,
            borderColor: i
          }
        }
      }
    })
  };
}, Nte = (t) => {
  const {
    componentCls: e,
    antCls: n
  } = t, i = `${e}-search`;
  return {
    [i]: {
      [`${e}`]: {
        "&:hover, &:focus": {
          borderColor: t.colorPrimaryHover,
          [`+ ${e}-group-addon ${i}-button:not(${n}-btn-primary)`]: {
            borderInlineStartColor: t.colorPrimaryHover
          }
        }
      },
      [`${e}-affix-wrapper`]: {
        borderRadius: 0
      },
      // fix slight height diff in Firefox:
      // https://ant.design/components/auto-complete-cn/#components-auto-complete-demo-certain-category
      [`${e}-lg`]: {
        lineHeight: t.lineHeightLG - 2e-4
      },
      [`> ${e}-group`]: {
        [`> ${e}-group-addon:last-child`]: {
          insetInlineStart: -1,
          padding: 0,
          border: 0,
          [`${i}-button`]: {
            paddingTop: 0,
            paddingBottom: 0,
            borderStartStartRadius: 0,
            borderStartEndRadius: t.borderRadius,
            borderEndEndRadius: t.borderRadius,
            borderEndStartRadius: 0
          },
          [`${i}-button:not(${n}-btn-primary)`]: {
            color: t.colorTextDescription,
            "&:hover": {
              color: t.colorPrimaryHover
            },
            "&:active": {
              color: t.colorPrimaryActive
            },
            [`&${n}-btn-loading::before`]: {
              insetInlineStart: 0,
              insetInlineEnd: 0,
              insetBlockStart: 0,
              insetBlockEnd: 0
            }
          }
        }
      },
      [`${i}-button`]: {
        height: t.controlHeight,
        "&:hover, &:focus": {
          zIndex: 1
        }
      },
      [`&-large ${i}-button`]: {
        height: t.controlHeightLG
      },
      [`&-small ${i}-button`]: {
        height: t.controlHeightSM
      },
      "&-rtl": {
        direction: "rtl"
      },
      // ===================== Compact Item Customized Styles =====================
      [`&${e}-compact-item`]: {
        [`&:not(${e}-compact-last-item)`]: {
          [`${e}-group-addon`]: {
            [`${e}-search-button`]: {
              marginInlineEnd: -t.lineWidth,
              borderRadius: 0
            }
          }
        },
        [`&:not(${e}-compact-first-item)`]: {
          [`${e},${e}-affix-wrapper`]: {
            borderRadius: 0
          }
        },
        [`> ${e}-group-addon ${e}-search-button,
        > ${e},
        ${e}-affix-wrapper`]: {
          "&:hover,&:focus,&:active": {
            zIndex: 2
          }
        },
        [`> ${e}-affix-wrapper-focused`]: {
          zIndex: 2
        }
      }
    }
  };
};
function Py(t) {
  return dn(t, {
    inputAffixPadding: t.paddingXXS,
    inputPaddingVertical: Math.max(Math.round((t.controlHeight - t.fontSize * t.lineHeight) / 2 * 10) / 10 - t.lineWidth, 3),
    inputPaddingVerticalLG: Math.ceil((t.controlHeightLG - t.fontSizeLG * t.lineHeightLG) / 2 * 10) / 10 - t.lineWidth,
    inputPaddingVerticalSM: Math.max(Math.round((t.controlHeightSM - t.fontSize * t.lineHeight) / 2 * 10) / 10 - t.lineWidth, 0),
    inputPaddingHorizontal: t.paddingSM - t.lineWidth,
    inputPaddingHorizontalSM: t.paddingXS - t.lineWidth,
    inputPaddingHorizontalLG: t.controlPaddingHorizontal - t.lineWidth,
    inputBorderHoverColor: t.colorPrimaryHover,
    inputBorderActiveColor: t.colorPrimaryHover
  });
}
const Lte = (t) => {
  const {
    componentCls: e,
    inputPaddingHorizontal: n,
    paddingLG: i
  } = t, o = `${e}-textarea`;
  return {
    [o]: {
      position: "relative",
      [`${o}-suffix`]: {
        position: "absolute",
        top: 0,
        insetInlineEnd: n,
        bottom: 0,
        zIndex: 1,
        display: "inline-flex",
        alignItems: "center",
        margin: "auto"
      },
      "&-status-error,\n        &-status-warning,\n        &-status-success,\n        &-status-validating": {
        [`&${o}-has-feedback`]: {
          [`${e}`]: {
            paddingInlineEnd: i
          }
        }
      },
      "&-show-count": {
        // https://github.com/ant-design/ant-design/issues/33049
        [`> ${e}`]: {
          height: "100%"
        },
        "&::after": {
          color: t.colorTextDescription,
          whiteSpace: "nowrap",
          content: "attr(data-count)",
          pointerEvents: "none",
          float: "right"
        }
      },
      "&-rtl": {
        "&::after": {
          float: "left"
        }
      }
    }
  };
}, g$ = Vn("Input", (t) => {
  const e = Py(t);
  return [
    Mte(e),
    Lte(e),
    Rte(e),
    Dte(e),
    Nte(e),
    // =====================================================
    // ==             Space Compact                       ==
    // =====================================================
    mg(e)
  ];
}), a1 = (t, e, n, i) => {
  const {
    lineHeight: o
  } = t, r = Math.floor(n * o) + 2, a = Math.max((e - r) / 2, 0), l = Math.max(e - r - a, 0);
  return {
    padding: `${a}px ${i}px ${l}px`
  };
}, zte = (t) => {
  const {
    componentCls: e,
    pickerCellCls: n,
    pickerCellInnerCls: i,
    pickerPanelCellHeight: o,
    motionDurationSlow: r,
    borderRadiusSM: a,
    motionDurationMid: l,
    controlItemBgHover: s,
    lineWidth: u,
    lineType: c,
    colorPrimary: d,
    controlItemBgActive: f,
    colorTextLightSolid: h,
    controlHeightSM: p,
    pickerDateHoverRangeBorderColor: g,
    pickerCellBorderGap: m,
    pickerBasicCellHoverWithRangeColor: y,
    pickerPanelCellWidth: b,
    colorTextDisabled: w,
    colorBgContainerDisabled: $
  } = t;
  return {
    "&::before": {
      position: "absolute",
      top: "50%",
      insetInlineStart: 0,
      insetInlineEnd: 0,
      zIndex: 1,
      height: o,
      transform: "translateY(-50%)",
      transition: `all ${r}`,
      content: '""'
    },
    // >>> Default
    [i]: {
      position: "relative",
      zIndex: 2,
      display: "inline-block",
      minWidth: o,
      height: o,
      lineHeight: `${o}px`,
      borderRadius: a,
      transition: `background ${l}, border ${l}`
    },
    // >>> Hover
    [`&:hover:not(${n}-in-view),
    &:hover:not(${n}-selected):not(${n}-range-start):not(${n}-range-end):not(${n}-range-hover-start):not(${n}-range-hover-end)`]: {
      [i]: {
        background: s
      }
    },
    // >>> Today
    [`&-in-view${n}-today ${i}`]: {
      "&::before": {
        position: "absolute",
        top: 0,
        insetInlineEnd: 0,
        bottom: 0,
        insetInlineStart: 0,
        zIndex: 1,
        border: `${u}px ${c} ${d}`,
        borderRadius: a,
        content: '""'
      }
    },
    // >>> In Range
    [`&-in-view${n}-in-range`]: {
      position: "relative",
      "&::before": {
        background: f
      }
    },
    // >>> Selected
    [`&-in-view${n}-selected ${i},
      &-in-view${n}-range-start ${i},
      &-in-view${n}-range-end ${i}`]: {
      color: h,
      background: d
    },
    [`&-in-view${n}-range-start:not(${n}-range-start-single),
      &-in-view${n}-range-end:not(${n}-range-end-single)`]: {
      "&::before": {
        background: f
      }
    },
    [`&-in-view${n}-range-start::before`]: {
      insetInlineStart: "50%"
    },
    [`&-in-view${n}-range-end::before`]: {
      insetInlineEnd: "50%"
    },
    // >>> Range Hover
    [`&-in-view${n}-range-hover-start:not(${n}-in-range):not(${n}-range-start):not(${n}-range-end),
      &-in-view${n}-range-hover-end:not(${n}-in-range):not(${n}-range-start):not(${n}-range-end),
      &-in-view${n}-range-hover-start${n}-range-start-single,
      &-in-view${n}-range-hover-start${n}-range-start${n}-range-end${n}-range-end-near-hover,
      &-in-view${n}-range-hover-end${n}-range-start${n}-range-end${n}-range-start-near-hover,
      &-in-view${n}-range-hover-end${n}-range-end-single,
      &-in-view${n}-range-hover:not(${n}-in-range)`]: {
      "&::after": {
        position: "absolute",
        top: "50%",
        zIndex: 0,
        height: p,
        borderTop: `${u}px dashed ${g}`,
        borderBottom: `${u}px dashed ${g}`,
        transform: "translateY(-50%)",
        transition: `all ${r}`,
        content: '""'
      }
    },
    // Add space for stash
    "&-range-hover-start::after,\n      &-range-hover-end::after,\n      &-range-hover::after": {
      insetInlineEnd: 0,
      insetInlineStart: m
    },
    // Hover with in range
    [`&-in-view${n}-in-range${n}-range-hover::before,
      &-in-view${n}-range-start${n}-range-hover::before,
      &-in-view${n}-range-end${n}-range-hover::before,
      &-in-view${n}-range-start:not(${n}-range-start-single)${n}-range-hover-start::before,
      &-in-view${n}-range-end:not(${n}-range-end-single)${n}-range-hover-end::before,
      ${e}-panel
      > :not(${e}-date-panel)
      &-in-view${n}-in-range${n}-range-hover-start::before,
      ${e}-panel
      > :not(${e}-date-panel)
      &-in-view${n}-in-range${n}-range-hover-end::before`]: {
      background: y
    },
    // range start border-radius
    [`&-in-view${n}-range-start:not(${n}-range-start-single):not(${n}-range-end) ${i}`]: {
      borderStartStartRadius: a,
      borderEndStartRadius: a,
      borderStartEndRadius: 0,
      borderEndEndRadius: 0
    },
    // range end border-radius
    [`&-in-view${n}-range-end:not(${n}-range-end-single):not(${n}-range-start) ${i}`]: {
      borderStartStartRadius: 0,
      borderEndStartRadius: 0,
      borderStartEndRadius: a,
      borderEndEndRadius: a
    },
    [`&-range-hover${n}-range-end::after`]: {
      insetInlineStart: "50%"
    },
    // Edge start
    [`tr > &-in-view${n}-range-hover:first-child::after,
      tr > &-in-view${n}-range-hover-end:first-child::after,
      &-in-view${n}-start${n}-range-hover-edge-start${n}-range-hover-edge-start-near-range::after,
      &-in-view${n}-range-hover-edge-start:not(${n}-range-hover-edge-start-near-range)::after,
      &-in-view${n}-range-hover-start::after`]: {
      insetInlineStart: (b - o) / 2,
      borderInlineStart: `${u}px dashed ${g}`,
      borderStartStartRadius: u,
      borderEndStartRadius: u
    },
    // Edge end
    [`tr > &-in-view${n}-range-hover:last-child::after,
      tr > &-in-view${n}-range-hover-start:last-child::after,
      &-in-view${n}-end${n}-range-hover-edge-end${n}-range-hover-edge-end-near-range::after,
      &-in-view${n}-range-hover-edge-end:not(${n}-range-hover-edge-end-near-range)::after,
      &-in-view${n}-range-hover-end::after`]: {
      insetInlineEnd: (b - o) / 2,
      borderInlineEnd: `${u}px dashed ${g}`,
      borderStartEndRadius: u,
      borderEndEndRadius: u
    },
    // >>> Disabled
    "&-disabled": {
      color: w,
      pointerEvents: "none",
      [i]: {
        background: "transparent"
      },
      "&::before": {
        background: $
      }
    },
    [`&-disabled${n}-today ${i}::before`]: {
      borderColor: w
    }
  };
}, Bte = (t) => {
  const {
    componentCls: e,
    pickerCellInnerCls: n,
    pickerYearMonthCellWidth: i,
    pickerControlIconSize: o,
    pickerPanelCellWidth: r,
    paddingSM: a,
    paddingXS: l,
    paddingXXS: s,
    colorBgContainer: u,
    lineWidth: c,
    lineType: d,
    borderRadiusLG: f,
    colorPrimary: h,
    colorTextHeading: p,
    colorSplit: g,
    pickerControlIconBorderWidth: m,
    colorIcon: y,
    pickerTextHeight: b,
    motionDurationMid: w,
    colorIconHover: $,
    fontWeightStrong: C,
    pickerPanelCellHeight: P,
    pickerCellPaddingVertical: O,
    colorTextDisabled: E,
    colorText: _,
    fontSize: D,
    pickerBasicCellHoverWithRangeColor: M,
    motionDurationSlow: N,
    pickerPanelWithoutTimeCellHeight: L,
    pickerQuarterPanelContentHeight: j,
    colorLink: B,
    colorLinkActive: Y,
    colorLinkHover: Q,
    pickerDateHoverRangeBorderColor: G,
    borderRadiusSM: V,
    colorTextLightSolid: H,
    borderRadius: q,
    controlItemBgHover: K,
    pickerTimePanelColumnHeight: ee,
    pickerTimePanelColumnWidth: ie,
    pickerTimePanelCellHeight: ae,
    controlItemBgActive: te,
    marginXXS: U
  } = t, me = r * 7 + a * 2 + 4, ce = (me - l * 2) / 3 - i - a;
  return {
    [e]: {
      "&-panel": {
        display: "inline-flex",
        flexDirection: "column",
        textAlign: "center",
        background: u,
        border: `${c}px ${d} ${g}`,
        borderRadius: f,
        outline: "none",
        "&-focused": {
          borderColor: h
        },
        "&-rtl": {
          direction: "rtl",
          [`${e}-prev-icon,
              ${e}-super-prev-icon`]: {
            transform: "rotate(45deg)"
          },
          [`${e}-next-icon,
              ${e}-super-next-icon`]: {
            transform: "rotate(-135deg)"
          }
        }
      },
      // ========================================================
      // =                     Shared Panel                     =
      // ========================================================
      "&-decade-panel,\n        &-year-panel,\n        &-quarter-panel,\n        &-month-panel,\n        &-week-panel,\n        &-date-panel,\n        &-time-panel": {
        display: "flex",
        flexDirection: "column",
        width: me
      },
      // ======================= Header =======================
      "&-header": {
        display: "flex",
        padding: `0 ${l}px`,
        color: p,
        borderBottom: `${c}px ${d} ${g}`,
        "> *": {
          flex: "none"
        },
        button: {
          padding: 0,
          color: y,
          lineHeight: `${b}px`,
          background: "transparent",
          border: 0,
          cursor: "pointer",
          transition: `color ${w}`
        },
        "> button": {
          minWidth: "1.6em",
          fontSize: D,
          "&:hover": {
            color: $
          }
        },
        "&-view": {
          flex: "auto",
          fontWeight: C,
          lineHeight: `${b}px`,
          button: {
            color: "inherit",
            fontWeight: "inherit",
            verticalAlign: "top",
            "&:not(:first-child)": {
              marginInlineStart: l
            },
            "&:hover": {
              color: h
            }
          }
        }
      },
      // Arrow button
      "&-prev-icon,\n        &-next-icon,\n        &-super-prev-icon,\n        &-super-next-icon": {
        position: "relative",
        display: "inline-block",
        width: o,
        height: o,
        "&::before": {
          position: "absolute",
          top: 0,
          insetInlineStart: 0,
          display: "inline-block",
          width: o,
          height: o,
          border: "0 solid currentcolor",
          borderBlockStartWidth: m,
          borderBlockEndWidth: 0,
          borderInlineStartWidth: m,
          borderInlineEndWidth: 0,
          content: '""'
        }
      },
      "&-super-prev-icon,\n        &-super-next-icon": {
        "&::after": {
          position: "absolute",
          top: Math.ceil(o / 2),
          insetInlineStart: Math.ceil(o / 2),
          display: "inline-block",
          width: o,
          height: o,
          border: "0 solid currentcolor",
          borderBlockStartWidth: m,
          borderBlockEndWidth: 0,
          borderInlineStartWidth: m,
          borderInlineEndWidth: 0,
          content: '""'
        }
      },
      "&-prev-icon,\n        &-super-prev-icon": {
        transform: "rotate(-45deg)"
      },
      "&-next-icon,\n        &-super-next-icon": {
        transform: "rotate(135deg)"
      },
      // ======================== Body ========================
      "&-content": {
        width: "100%",
        tableLayout: "fixed",
        borderCollapse: "collapse",
        "th, td": {
          position: "relative",
          minWidth: P,
          fontWeight: "normal"
        },
        th: {
          height: P + O * 2,
          color: _,
          verticalAlign: "middle"
        }
      },
      "&-cell": k({
        padding: `${O}px 0`,
        color: E,
        cursor: "pointer",
        // In view
        "&-in-view": {
          color: _
        }
      }, zte(t)),
      // DatePanel only
      [`&-date-panel ${e}-cell-in-view${e}-cell-in-range${e}-cell-range-hover-start ${n},
        &-date-panel ${e}-cell-in-view${e}-cell-in-range${e}-cell-range-hover-end ${n}`]: {
        "&::after": {
          position: "absolute",
          top: 0,
          bottom: 0,
          zIndex: -1,
          background: M,
          transition: `all ${N}`,
          content: '""'
        }
      },
      [`&-date-panel
        ${e}-cell-in-view${e}-cell-in-range${e}-cell-range-hover-start
        ${n}::after`]: {
        insetInlineEnd: -(r - P) / 2,
        insetInlineStart: 0
      },
      [`&-date-panel ${e}-cell-in-view${e}-cell-in-range${e}-cell-range-hover-end ${n}::after`]: {
        insetInlineEnd: 0,
        insetInlineStart: -(r - P) / 2
      },
      // Hover with range start & end
      [`&-range-hover${e}-range-start::after`]: {
        insetInlineEnd: "50%"
      },
      "&-decade-panel,\n        &-year-panel,\n        &-quarter-panel,\n        &-month-panel": {
        [`${e}-content`]: {
          height: L * 4
        },
        [n]: {
          padding: `0 ${l}px`
        }
      },
      "&-quarter-panel": {
        [`${e}-content`]: {
          height: j
        }
      },
      // ======================== Footer ========================
      [`&-panel ${e}-footer`]: {
        borderTop: `${c}px ${d} ${g}`
      },
      "&-footer": {
        width: "min-content",
        minWidth: "100%",
        lineHeight: `${b - 2 * c}px`,
        textAlign: "center",
        "&-extra": {
          padding: `0 ${a}`,
          lineHeight: `${b - 2 * c}px`,
          textAlign: "start",
          "&:not(:last-child)": {
            borderBottom: `${c}px ${d} ${g}`
          }
        }
      },
      "&-now": {
        textAlign: "start"
      },
      "&-today-btn": {
        color: B,
        "&:hover": {
          color: Q
        },
        "&:active": {
          color: Y
        },
        [`&${e}-today-btn-disabled`]: {
          color: E,
          cursor: "not-allowed"
        }
      },
      // ========================================================
      // =                       Special                        =
      // ========================================================
      // ===================== Decade Panel =====================
      "&-decade-panel": {
        [n]: {
          padding: `0 ${l / 2}px`
        },
        [`${e}-cell::before`]: {
          display: "none"
        }
      },
      // ============= Year & Quarter & Month Panel =============
      "&-year-panel,\n        &-quarter-panel,\n        &-month-panel": {
        [`${e}-body`]: {
          padding: `0 ${l}px`
        },
        [n]: {
          width: i
        },
        [`${e}-cell-range-hover-start::after`]: {
          insetInlineStart: ce,
          borderInlineStart: `${c}px dashed ${G}`,
          borderStartStartRadius: V,
          borderBottomStartRadius: V,
          borderStartEndRadius: 0,
          borderBottomEndRadius: 0,
          [`${e}-panel-rtl &`]: {
            insetInlineEnd: ce,
            borderInlineEnd: `${c}px dashed ${G}`,
            borderStartStartRadius: 0,
            borderBottomStartRadius: 0,
            borderStartEndRadius: V,
            borderBottomEndRadius: V
          }
        },
        [`${e}-cell-range-hover-end::after`]: {
          insetInlineEnd: ce,
          borderInlineEnd: `${c}px dashed ${G}`,
          borderStartStartRadius: 0,
          borderEndStartRadius: 0,
          borderStartEndRadius: q,
          borderEndEndRadius: q,
          [`${e}-panel-rtl &`]: {
            insetInlineStart: ce,
            borderInlineStart: `${c}px dashed ${G}`,
            borderStartStartRadius: q,
            borderEndStartRadius: q,
            borderStartEndRadius: 0,
            borderEndEndRadius: 0
          }
        }
      },
      // ====================== Week Panel ======================
      "&-week-panel": {
        [`${e}-body`]: {
          padding: `${l}px ${a}px`
        },
        // Clear cell style
        [`${e}-cell`]: {
          [`&:hover ${n},
            &-selected ${n},
            ${n}`]: {
            background: "transparent !important"
          }
        },
        "&-row": {
          td: {
            transition: `background ${w}`,
            "&:first-child": {
              borderStartStartRadius: V,
              borderEndStartRadius: V
            },
            "&:last-child": {
              borderStartEndRadius: V,
              borderEndEndRadius: V
            }
          },
          "&:hover td": {
            background: K
          },
          "&-selected td,\n            &-selected:hover td": {
            background: h,
            [`&${e}-cell-week`]: {
              color: new jn(H).setAlpha(0.5).toHexString()
            },
            [`&${e}-cell-today ${n}::before`]: {
              borderColor: H
            },
            [n]: {
              color: H
            }
          }
        }
      },
      // ====================== Date Panel ======================
      "&-date-panel": {
        [`${e}-body`]: {
          padding: `${l}px ${a}px`
        },
        [`${e}-content`]: {
          width: r * 7,
          th: {
            width: r
          }
        }
      },
      // ==================== Datetime Panel ====================
      "&-datetime-panel": {
        display: "flex",
        [`${e}-time-panel`]: {
          borderInlineStart: `${c}px ${d} ${g}`
        },
        [`${e}-date-panel,
          ${e}-time-panel`]: {
          transition: `opacity ${N}`
        },
        // Keyboard
        "&-active": {
          [`${e}-date-panel,
            ${e}-time-panel`]: {
            opacity: 0.3,
            "&-active": {
              opacity: 1
            }
          }
        }
      },
      // ====================== Time Panel ======================
      "&-time-panel": {
        width: "auto",
        minWidth: "auto",
        direction: "ltr",
        [`${e}-content`]: {
          display: "flex",
          flex: "auto",
          height: ee
        },
        "&-column": {
          flex: "1 0 auto",
          width: ie,
          margin: `${s}px 0`,
          padding: 0,
          overflowY: "hidden",
          textAlign: "start",
          listStyle: "none",
          transition: `background ${w}`,
          overflowX: "hidden",
          "&::after": {
            display: "block",
            height: ee - ae,
            content: '""'
          },
          "&:not(:first-child)": {
            borderInlineStart: `${c}px ${d} ${g}`
          },
          "&-active": {
            background: new jn(te).setAlpha(0.2).toHexString()
          },
          "&:hover": {
            overflowY: "auto"
          },
          "> li": {
            margin: 0,
            padding: 0,
            [`&${e}-time-panel-cell`]: {
              marginInline: U,
              [`${e}-time-panel-cell-inner`]: {
                display: "block",
                width: ie - 2 * U,
                height: ae,
                margin: 0,
                paddingBlock: 0,
                paddingInlineEnd: 0,
                paddingInlineStart: (ie - ae) / 2,
                color: _,
                lineHeight: `${ae}px`,
                borderRadius: V,
                cursor: "pointer",
                transition: `background ${w}`,
                "&:hover": {
                  background: K
                }
              },
              "&-selected": {
                [`${e}-time-panel-cell-inner`]: {
                  background: te
                }
              },
              "&-disabled": {
                [`${e}-time-panel-cell-inner`]: {
                  color: E,
                  background: "transparent",
                  cursor: "not-allowed"
                }
              }
            }
          }
        }
      },
      // https://github.com/ant-design/ant-design/issues/39227
      [`&-datetime-panel ${e}-time-panel-column:after`]: {
        height: ee - ae + s * 2
      }
    }
  };
}, Fte = (t) => {
  const {
    componentCls: e,
    colorBgContainer: n,
    colorError: i,
    colorErrorOutline: o,
    colorWarning: r,
    colorWarningOutline: a
  } = t;
  return {
    [e]: {
      [`&-status-error${e}`]: {
        "&, &:not([disabled]):hover": {
          backgroundColor: n,
          borderColor: i
        },
        "&-focused, &:focus": k({}, Kc(dn(t, {
          inputBorderActiveColor: i,
          inputBorderHoverColor: i,
          controlOutline: o
        }))),
        [`${e}-active-bar`]: {
          background: i
        }
      },
      [`&-status-warning${e}`]: {
        "&, &:not([disabled]):hover": {
          backgroundColor: n,
          borderColor: r
        },
        "&-focused, &:focus": k({}, Kc(dn(t, {
          inputBorderActiveColor: r,
          inputBorderHoverColor: r,
          controlOutline: a
        }))),
        [`${e}-active-bar`]: {
          background: r
        }
      }
    }
  };
}, Vte = (t) => {
  const {
    componentCls: e,
    antCls: n,
    boxShadowPopoverArrow: i,
    controlHeight: o,
    fontSize: r,
    inputPaddingHorizontal: a,
    colorBgContainer: l,
    lineWidth: s,
    lineType: u,
    colorBorder: c,
    borderRadius: d,
    motionDurationMid: f,
    colorBgContainerDisabled: h,
    colorTextDisabled: p,
    colorTextPlaceholder: g,
    controlHeightLG: m,
    fontSizeLG: y,
    controlHeightSM: b,
    inputPaddingHorizontalSM: w,
    paddingXS: $,
    marginXS: C,
    colorTextDescription: P,
    lineWidthBold: O,
    lineHeight: E,
    colorPrimary: _,
    motionDurationSlow: D,
    zIndexPopup: M,
    paddingXXS: N,
    paddingSM: L,
    pickerTextHeight: j,
    controlItemBgActive: B,
    colorPrimaryBorder: Y,
    sizePopupArrow: Q,
    borderRadiusXS: G,
    borderRadiusOuter: V,
    colorBgElevated: H,
    borderRadiusLG: q,
    boxShadowSecondary: K,
    borderRadiusSM: ee,
    colorSplit: ie,
    controlItemBgHover: ae,
    presetsWidth: te,
    presetsMaxWidth: U
  } = t;
  return [
    {
      [e]: k(k(k({}, kn(t)), a1(t, o, r, a)), {
        position: "relative",
        display: "inline-flex",
        alignItems: "center",
        background: l,
        lineHeight: 1,
        border: `${s}px ${u} ${c}`,
        borderRadius: d,
        transition: `border ${f}, box-shadow ${f}`,
        "&:hover, &-focused": k({}, ch(t)),
        "&-focused": k({}, Kc(t)),
        [`&${e}-disabled`]: {
          background: h,
          borderColor: c,
          cursor: "not-allowed",
          [`${e}-suffix`]: {
            color: p
          }
        },
        [`&${e}-borderless`]: {
          backgroundColor: "transparent !important",
          borderColor: "transparent !important",
          boxShadow: "none !important"
        },
        // ======================== Input =========================
        [`${e}-input`]: {
          position: "relative",
          display: "inline-flex",
          alignItems: "center",
          width: "100%",
          "> input": k(k({}, dh(t)), {
            flex: "auto",
            // Fix Firefox flex not correct:
            // https://github.com/ant-design/ant-design/pull/20023#issuecomment-564389553
            minWidth: 1,
            height: "auto",
            padding: 0,
            background: "transparent",
            border: 0,
            "&:focus": {
              boxShadow: "none"
            },
            "&[disabled]": {
              background: "transparent"
            }
          }),
          "&:hover": {
            [`${e}-clear`]: {
              opacity: 1
            }
          },
          "&-placeholder": {
            "> input": {
              color: g
            }
          }
        },
        // Size
        "&-large": k(k({}, a1(t, m, y, a)), {
          [`${e}-input > input`]: {
            fontSize: y
          }
        }),
        "&-small": k({}, a1(t, b, r, w)),
        [`${e}-suffix`]: {
          display: "flex",
          flex: "none",
          alignSelf: "center",
          marginInlineStart: $ / 2,
          color: p,
          lineHeight: 1,
          pointerEvents: "none",
          "> *": {
            verticalAlign: "top",
            "&:not(:last-child)": {
              marginInlineEnd: C
            }
          }
        },
        [`${e}-clear`]: {
          position: "absolute",
          top: "50%",
          insetInlineEnd: 0,
          color: p,
          lineHeight: 1,
          background: l,
          transform: "translateY(-50%)",
          cursor: "pointer",
          opacity: 0,
          transition: `opacity ${f}, color ${f}`,
          "> *": {
            verticalAlign: "top"
          },
          "&:hover": {
            color: P
          }
        },
        [`${e}-separator`]: {
          position: "relative",
          display: "inline-block",
          width: "1em",
          height: y,
          color: p,
          fontSize: y,
          verticalAlign: "top",
          cursor: "default",
          [`${e}-focused &`]: {
            color: P
          },
          [`${e}-range-separator &`]: {
            [`${e}-disabled &`]: {
              cursor: "not-allowed"
            }
          }
        },
        // ======================== Range =========================
        "&-range": {
          position: "relative",
          display: "inline-flex",
          // Clear
          [`${e}-clear`]: {
            insetInlineEnd: a
          },
          "&:hover": {
            [`${e}-clear`]: {
              opacity: 1
            }
          },
          // Active bar
          [`${e}-active-bar`]: {
            bottom: -s,
            height: O,
            marginInlineStart: a,
            background: _,
            opacity: 0,
            transition: `all ${D} ease-out`,
            pointerEvents: "none"
          },
          [`&${e}-focused`]: {
            [`${e}-active-bar`]: {
              opacity: 1
            }
          },
          [`${e}-range-separator`]: {
            alignItems: "center",
            padding: `0 ${$}px`,
            lineHeight: 1
          },
          [`&${e}-small`]: {
            [`${e}-clear`]: {
              insetInlineEnd: w
            },
            [`${e}-active-bar`]: {
              marginInlineStart: w
            }
          }
        },
        // ======================= Dropdown =======================
        "&-dropdown": k(k(k({}, kn(t)), Bte(t)), {
          position: "absolute",
          // Fix incorrect position of picker popup
          // https://github.com/ant-design/ant-design/issues/35590
          top: -9999,
          left: {
            _skip_check_: !0,
            value: -9999
          },
          zIndex: M,
          [`&${e}-dropdown-hidden`]: {
            display: "none"
          },
          [`&${e}-dropdown-placement-bottomLeft`]: {
            [`${e}-range-arrow`]: {
              top: 0,
              display: "block",
              transform: "translateY(-100%)"
            }
          },
          [`&${e}-dropdown-placement-topLeft`]: {
            [`${e}-range-arrow`]: {
              bottom: 0,
              display: "block",
              transform: "translateY(100%) rotate(180deg)"
            }
          },
          [`&${n}-slide-up-enter${n}-slide-up-enter-active${e}-dropdown-placement-topLeft,
          &${n}-slide-up-enter${n}-slide-up-enter-active${e}-dropdown-placement-topRight,
          &${n}-slide-up-appear${n}-slide-up-appear-active${e}-dropdown-placement-topLeft,
          &${n}-slide-up-appear${n}-slide-up-appear-active${e}-dropdown-placement-topRight`]: {
            animationName: by
          },
          [`&${n}-slide-up-enter${n}-slide-up-enter-active${e}-dropdown-placement-bottomLeft,
          &${n}-slide-up-enter${n}-slide-up-enter-active${e}-dropdown-placement-bottomRight,
          &${n}-slide-up-appear${n}-slide-up-appear-active${e}-dropdown-placement-bottomLeft,
          &${n}-slide-up-appear${n}-slide-up-appear-active${e}-dropdown-placement-bottomRight`]: {
            animationName: vy
          },
          [`&${n}-slide-up-leave${n}-slide-up-leave-active${e}-dropdown-placement-topLeft,
          &${n}-slide-up-leave${n}-slide-up-leave-active${e}-dropdown-placement-topRight`]: {
            animationName: xy
          },
          [`&${n}-slide-up-leave${n}-slide-up-leave-active${e}-dropdown-placement-bottomLeft,
          &${n}-slide-up-leave${n}-slide-up-leave-active${e}-dropdown-placement-bottomRight`]: {
            animationName: yy
          },
          // Time picker with additional style
          [`${e}-panel > ${e}-time-panel`]: {
            paddingTop: N
          },
          // ======================== Ranges ========================
          [`${e}-ranges`]: {
            marginBottom: 0,
            padding: `${N}px ${L}px`,
            overflow: "hidden",
            lineHeight: `${j - 2 * s - $ / 2}px`,
            textAlign: "start",
            listStyle: "none",
            display: "flex",
            justifyContent: "space-between",
            "> li": {
              display: "inline-block"
            },
            // https://github.com/ant-design/ant-design/issues/23687
            [`${e}-preset > ${n}-tag-blue`]: {
              color: _,
              background: B,
              borderColor: Y,
              cursor: "pointer"
            },
            [`${e}-ok`]: {
              marginInlineStart: "auto"
            }
          },
          [`${e}-range-wrapper`]: {
            display: "flex",
            position: "relative"
          },
          [`${e}-range-arrow`]: k({
            position: "absolute",
            zIndex: 1,
            display: "none",
            marginInlineStart: a * 1.5,
            transition: `left ${D} ease-out`
          }, cC(Q, G, V, H, i)),
          [`${e}-panel-container`]: {
            overflow: "hidden",
            verticalAlign: "top",
            background: H,
            borderRadius: q,
            boxShadow: K,
            transition: `margin ${D}`,
            // ======================== Layout ========================
            [`${e}-panel-layout`]: {
              display: "flex",
              flexWrap: "nowrap",
              alignItems: "stretch"
            },
            // ======================== Preset ========================
            [`${e}-presets`]: {
              display: "flex",
              flexDirection: "column",
              minWidth: te,
              maxWidth: U,
              ul: {
                height: 0,
                flex: "auto",
                listStyle: "none",
                overflow: "auto",
                margin: 0,
                padding: $,
                borderInlineEnd: `${s}px ${u} ${ie}`,
                li: k(k({}, Ps), {
                  borderRadius: ee,
                  paddingInline: $,
                  paddingBlock: (b - Math.round(r * E)) / 2,
                  cursor: "pointer",
                  transition: `all ${D}`,
                  "+ li": {
                    marginTop: C
                  },
                  "&:hover": {
                    background: ae
                  }
                })
              }
            },
            // ======================== Panels ========================
            [`${e}-panels`]: {
              display: "inline-flex",
              flexWrap: "nowrap",
              direction: "ltr",
              [`${e}-panel`]: {
                borderWidth: `0 0 ${s}px`
              },
              "&:last-child": {
                [`${e}-panel`]: {
                  borderWidth: 0
                }
              }
            },
            [`${e}-panel`]: {
              verticalAlign: "top",
              background: "transparent",
              borderRadius: 0,
              borderWidth: 0,
              [`${e}-content,
            table`]: {
                textAlign: "center"
              },
              "&-focused": {
                borderColor: c
              }
            }
          }
        }),
        "&-dropdown-range": {
          padding: `${Q * 2 / 3}px 0`,
          "&-hidden": {
            display: "none"
          }
        },
        "&-rtl": {
          direction: "rtl",
          [`${e}-separator`]: {
            transform: "rotate(180deg)"
          },
          [`${e}-footer`]: {
            "&-extra": {
              direction: "rtl"
            }
          }
        }
      })
    },
    // Follow code may reuse in other components
    Ml(t, "slide-up"),
    Ml(t, "slide-down"),
    zf(t, "move-up"),
    zf(t, "move-down")
  ];
}, Qte = (t) => {
  const {
    componentCls: n,
    controlHeightLG: i,
    controlHeightSM: o,
    colorPrimary: r,
    paddingXXS: a
  } = t;
  return {
    pickerCellCls: `${n}-cell`,
    pickerCellInnerCls: `${n}-cell-inner`,
    pickerTextHeight: i,
    pickerPanelCellWidth: o * 1.5,
    pickerPanelCellHeight: o,
    pickerDateHoverRangeBorderColor: new jn(r).lighten(20).toHexString(),
    pickerBasicCellHoverWithRangeColor: new jn(r).lighten(35).toHexString(),
    pickerPanelWithoutTimeCellHeight: i * 1.65,
    pickerYearMonthCellWidth: i * 1.5,
    pickerTimePanelColumnHeight: 224,
    pickerTimePanelColumnWidth: i * 1.4,
    pickerTimePanelCellHeight: 28,
    pickerQuarterPanelContentHeight: i * 1.4,
    pickerCellPaddingVertical: a,
    pickerCellBorderGap: 2,
    pickerControlIconSize: 7,
    pickerControlIconBorderWidth: 1.5
  };
}, P5 = Vn("DatePicker", (t) => {
  const e = dn(Py(t), Qte(t));
  return [
    Vte(e),
    Fte(e),
    // =====================================================
    // ==             Space Compact                       ==
    // =====================================================
    mg(t, {
      focusElCls: `${t.componentCls}-focused`
    })
  ];
}, (t) => ({
  presetsWidth: 120,
  presetsMaxWidth: 200,
  zIndexPopup: t.zIndexPopupBase + 50
}));
function Hte(t) {
  const e = Te(), n = Te(!1);
  function i() {
    for (var o = arguments.length, r = new Array(o), a = 0; a < o; a++)
      r[a] = arguments[a];
    n.value || (Gt.cancel(e.value), e.value = Gt(() => {
      t(...r);
    }));
  }
  return tn(() => {
    n.value = !0, Gt.cancel(e.value);
  }), i;
}
function Wte(t) {
  const e = Te([]), n = Te(typeof t == "function" ? t() : t), i = Hte(() => {
    let r = n.value;
    e.value.forEach((a) => {
      r = a(r);
    }), e.value = [], n.value = r;
  });
  function o(r) {
    e.value.push(r), i();
  }
  return [n, o];
}
const jte = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "TabNode",
  props: {
    id: {
      type: String
    },
    prefixCls: {
      type: String
    },
    tab: {
      type: Object
    },
    active: {
      type: Boolean
    },
    closable: {
      type: Boolean
    },
    editable: {
      type: Object
    },
    onClick: {
      type: Function
    },
    onResize: {
      type: Function
    },
    renderWrapper: {
      type: Function
    },
    removeAriaLabel: {
      type: String
    },
    // onRemove: { type: Function as PropType<() => void> },
    onFocus: {
      type: Function
    }
  },
  emits: ["click", "resize", "remove", "focus"],
  setup(t, e) {
    let {
      expose: n,
      attrs: i
    } = e;
    const o = de();
    function r(s) {
      var u;
      !((u = t.tab) === null || u === void 0) && u.disabled || t.onClick(s);
    }
    n({
      domRef: o
    });
    function a(s) {
      var u;
      s.preventDefault(), s.stopPropagation(), t.editable.onEdit("remove", {
        key: (u = t.tab) === null || u === void 0 ? void 0 : u.key,
        event: s
      });
    }
    const l = A(() => {
      var s;
      return t.editable && t.closable !== !1 && !(!((s = t.tab) === null || s === void 0) && s.disabled);
    });
    return () => {
      var s;
      const {
        prefixCls: u,
        id: c,
        active: d,
        tab: {
          key: f,
          tab: h,
          disabled: p,
          closeIcon: g
        },
        renderWrapper: m,
        removeAriaLabel: y,
        editable: b,
        onFocus: w
      } = t, $ = `${u}-tab`, C = v("div", {
        key: f,
        ref: o,
        class: Ae($, {
          [`${$}-with-remove`]: l.value,
          [`${$}-active`]: d,
          [`${$}-disabled`]: p
        }),
        style: i.style,
        onClick: r
      }, [v("div", {
        role: "tab",
        "aria-selected": d,
        id: c && `${c}-tab-${f}`,
        class: `${$}-btn`,
        "aria-controls": c && `${c}-panel-${f}`,
        "aria-disabled": p,
        tabindex: p ? null : 0,
        onClick: (P) => {
          P.stopPropagation(), r(P);
        },
        onKeydown: (P) => {
          [lt.SPACE, lt.ENTER].includes(P.which) && (P.preventDefault(), r(P));
        },
        onFocus: w
      }, [typeof h == "function" ? h() : h]), l.value && v("button", {
        type: "button",
        "aria-label": y || "remove",
        tabindex: 0,
        class: `${$}-remove`,
        onClick: (P) => {
          P.stopPropagation(), a(P);
        }
      }, [g?.() || ((s = b.removeIcon) === null || s === void 0 ? void 0 : s.call(b)) || "×"])]);
      return m ? m(C) : C;
    };
  }
}), sE = {
  width: 0,
  height: 0,
  left: 0,
  top: 0
};
function qte(t, e) {
  const n = de(/* @__PURE__ */ new Map());
  return zt(() => {
    var i, o;
    const r = /* @__PURE__ */ new Map(), a = t.value, l = e.value.get((i = a[0]) === null || i === void 0 ? void 0 : i.key) || sE, s = l.left + l.width;
    for (let u = 0; u < a.length; u += 1) {
      const {
        key: c
      } = a[u];
      let d = e.value.get(c);
      d || (d = e.value.get((o = a[u - 1]) === null || o === void 0 ? void 0 : o.key) || sE);
      const f = r.get(c) || k({}, d);
      f.right = s - f.left - f.width, r.set(c, f);
    }
    n.value = new Map(r);
  }), n;
}
const E5 = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "AddButton",
  inheritAttrs: !1,
  props: {
    prefixCls: String,
    editable: {
      type: Object
    },
    locale: {
      type: Object,
      default: void 0
    }
  },
  setup(t, e) {
    let {
      expose: n,
      attrs: i
    } = e;
    const o = de();
    return n({
      domRef: o
    }), () => {
      const {
        prefixCls: r,
        editable: a,
        locale: l
      } = t;
      return !a || a.showAdd === !1 ? null : v("button", {
        ref: o,
        type: "button",
        class: `${r}-nav-add`,
        style: i.style,
        "aria-label": l?.addAriaLabel || "Add tab",
        onClick: (s) => {
          a.onEdit("add", {
            event: s
          });
        }
      }, [a.addIcon ? a.addIcon() : "+"]);
    };
  }
}), Yte = {
  prefixCls: {
    type: String
  },
  id: {
    type: String
  },
  tabs: {
    type: Object
  },
  rtl: {
    type: Boolean
  },
  tabBarGutter: {
    type: Number
  },
  activeKey: {
    type: [String, Number]
  },
  mobile: {
    type: Boolean
  },
  moreIcon: ve.any,
  moreTransitionName: {
    type: String
  },
  editable: {
    type: Object
  },
  locale: {
    type: Object,
    default: void 0
  },
  removeAriaLabel: String,
  onTabClick: {
    type: Function
  },
  popupClassName: String,
  getPopupContainer: ot()
}, Kte = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "OperationNode",
  inheritAttrs: !1,
  props: Yte,
  emits: ["tabClick"],
  slots: Object,
  setup(t, e) {
    let {
      attrs: n,
      slots: i
    } = e;
    const [o, r] = zn(!1), [a, l] = zn(null), s = (h) => {
      const p = t.tabs.filter((y) => !y.disabled);
      let g = p.findIndex((y) => y.key === a.value) || 0;
      const m = p.length;
      for (let y = 0; y < m; y += 1) {
        g = (g + h + m) % m;
        const b = p[g];
        if (!b.disabled) {
          l(b.key);
          return;
        }
      }
    }, u = (h) => {
      const {
        which: p
      } = h;
      if (!o.value) {
        [lt.DOWN, lt.SPACE, lt.ENTER].includes(p) && (r(!0), h.preventDefault());
        return;
      }
      switch (p) {
        case lt.UP:
          s(-1), h.preventDefault();
          break;
        case lt.DOWN:
          s(1), h.preventDefault();
          break;
        case lt.ESC:
          r(!1);
          break;
        case lt.SPACE:
        case lt.ENTER:
          a.value !== null && t.onTabClick(a.value, h);
          break;
      }
    }, c = A(() => `${t.id}-more-popup`), d = A(() => a.value !== null ? `${c.value}-${a.value}` : null), f = (h, p) => {
      h.preventDefault(), h.stopPropagation(), t.editable.onEdit("remove", {
        key: p,
        event: h
      });
    };
    return Lt(() => {
      _e(a, () => {
        const h = document.getElementById(d.value);
        h && h.scrollIntoView && h.scrollIntoView(!1);
      }, {
        flush: "post",
        immediate: !0
      });
    }), _e(o, () => {
      o.value || l(null);
    }), B3({}), () => {
      var h;
      const {
        prefixCls: p,
        id: g,
        tabs: m,
        locale: y,
        mobile: b,
        moreIcon: w = ((h = i.moreIcon) === null || h === void 0 ? void 0 : h.call(i)) || v(vg, null, null),
        moreTransitionName: $,
        editable: C,
        tabBarGutter: P,
        rtl: O,
        onTabClick: E,
        popupClassName: _
      } = t;
      if (!m.length) return null;
      const D = `${p}-dropdown`, M = y?.dropdownAriaLabel, N = {
        [O ? "marginRight" : "marginLeft"]: P
      };
      m.length || (N.visibility = "hidden", N.order = 1);
      const L = Ae({
        [`${D}-rtl`]: O,
        [`${_}`]: !0
      }), j = b ? null : v(E3, {
        prefixCls: D,
        trigger: ["hover"],
        visible: o.value,
        transitionName: $,
        onVisibleChange: r,
        overlayClassName: L,
        mouseEnterDelay: 0.1,
        mouseLeaveDelay: 0.1,
        getPopupContainer: t.getPopupContainer
      }, {
        overlay: () => v(Bi, {
          onClick: (B) => {
            let {
              key: Y,
              domEvent: Q
            } = B;
            E(Y, Q), r(!1);
          },
          id: c.value,
          tabindex: -1,
          role: "listbox",
          "aria-activedescendant": d.value,
          selectedKeys: [a.value],
          "aria-label": M !== void 0 ? M : "expanded dropdown"
        }, {
          default: () => [m.map((B) => {
            var Y, Q;
            const G = C && B.closable !== !1 && !B.disabled;
            return v(Bf, {
              key: B.key,
              id: `${c.value}-${B.key}`,
              role: "option",
              "aria-controls": g && `${g}-panel-${B.key}`,
              disabled: B.disabled
            }, {
              default: () => [v("span", null, [typeof B.tab == "function" ? B.tab() : B.tab]), G && v("button", {
                type: "button",
                "aria-label": t.removeAriaLabel || "remove",
                tabindex: 0,
                class: `${D}-menu-item-remove`,
                onClick: (V) => {
                  V.stopPropagation(), f(V, B.key);
                }
              }, [((Y = B.closeIcon) === null || Y === void 0 ? void 0 : Y.call(B)) || ((Q = C.removeIcon) === null || Q === void 0 ? void 0 : Q.call(C)) || "×"])]
            });
          })]
        }),
        default: () => v("button", {
          type: "button",
          class: `${p}-nav-more`,
          style: N,
          tabindex: -1,
          "aria-hidden": "true",
          "aria-haspopup": "listbox",
          "aria-controls": c.value,
          id: `${g}-more`,
          "aria-expanded": o.value,
          onKeydown: u
        }, [w])
      });
      return v("div", {
        class: Ae(`${p}-nav-operations`, n.class),
        style: n.style
      }, [j, v(E5, {
        prefixCls: p,
        locale: y,
        editable: C
      }, null)]);
    };
  }
}), _5 = Symbol("tabsContextKey"), I5 = (t) => {
  Xt(_5, t);
}, M5 = () => qt(_5, {
  tabs: de([]),
  prefixCls: de()
});
Oe({
  compatConfig: {
    MODE: 3
  },
  name: "TabsContextProvider",
  inheritAttrs: !1,
  props: {
    tabs: {
      type: Object,
      default: void 0
    },
    prefixCls: {
      type: String,
      default: void 0
    }
  },
  setup(t, e) {
    let {
      slots: n
    } = e;
    return I5(_c(t)), () => {
      var i;
      return (i = n.default) === null || i === void 0 ? void 0 : i.call(n);
    };
  }
});
const Xte = 0.1, uE = 0.01, fv = 20, cE = Math.pow(0.995, fv);
function Zte(t, e) {
  const [n, i] = zn(), [o, r] = zn(0), [a, l] = zn(0), [s, u] = zn(), c = de();
  function d(C) {
    const {
      screenX: P,
      screenY: O
    } = C.touches[0];
    i({
      x: P,
      y: O
    }), clearInterval(c.value);
  }
  function f(C) {
    if (!n.value) return;
    C.preventDefault();
    const {
      screenX: P,
      screenY: O
    } = C.touches[0], E = P - n.value.x, _ = O - n.value.y;
    e(E, _), i({
      x: P,
      y: O
    });
    const D = Date.now();
    l(D - o.value), r(D), u({
      x: E,
      y: _
    });
  }
  function h() {
    if (!n.value) return;
    const C = s.value;
    if (i(null), u(null), C) {
      const P = C.x / a.value, O = C.y / a.value, E = Math.abs(P), _ = Math.abs(O);
      if (Math.max(E, _) < Xte) return;
      let D = P, M = O;
      c.value = setInterval(() => {
        if (Math.abs(D) < uE && Math.abs(M) < uE) {
          clearInterval(c.value);
          return;
        }
        D *= cE, M *= cE, e(D * fv, M * fv);
      }, fv);
    }
  }
  const p = de();
  function g(C) {
    const {
      deltaX: P,
      deltaY: O
    } = C;
    let E = 0;
    const _ = Math.abs(P), D = Math.abs(O);
    _ === D ? E = p.value === "x" ? P : O : _ > D ? (E = P, p.value = "x") : (E = O, p.value = "y"), e(-E, -E) && C.preventDefault();
  }
  const m = de({
    onTouchStart: d,
    onTouchMove: f,
    onTouchEnd: h,
    onWheel: g
  });
  function y(C) {
    m.value.onTouchStart(C);
  }
  function b(C) {
    m.value.onTouchMove(C);
  }
  function w(C) {
    m.value.onTouchEnd(C);
  }
  function $(C) {
    m.value.onWheel(C);
  }
  Lt(() => {
    var C, P;
    document.addEventListener("touchmove", b, {
      passive: !1
    }), document.addEventListener("touchend", w, {
      passive: !1
    }), (C = t.value) === null || C === void 0 || C.addEventListener("touchstart", y, {
      passive: !1
    }), (P = t.value) === null || P === void 0 || P.addEventListener("wheel", $, {
      passive: !1
    });
  }), tn(() => {
    document.removeEventListener("touchmove", b), document.removeEventListener("touchend", w);
  });
}
function dE(t, e) {
  const n = de(t);
  function i(o) {
    const r = typeof o == "function" ? o(n.value) : o;
    r !== n.value && e(r, n.value), n.value = r;
  }
  return [n, i];
}
const Gte = () => {
  const t = de(/* @__PURE__ */ new Map()), e = (n) => (i) => {
    t.value.set(n, i);
  };
  return gw(() => {
    t.value = /* @__PURE__ */ new Map();
  }), [e, t];
}, fE = {
  width: 0,
  height: 0,
  left: 0,
  top: 0,
  right: 0
}, Ute = () => ({
  id: {
    type: String
  },
  tabPosition: {
    type: String
  },
  activeKey: {
    type: [String, Number]
  },
  rtl: {
    type: Boolean
  },
  animated: Vt(),
  editable: Vt(),
  moreIcon: ve.any,
  moreTransitionName: {
    type: String
  },
  mobile: {
    type: Boolean
  },
  tabBarGutter: {
    type: Number
  },
  renderTabBar: {
    type: Function
  },
  locale: Vt(),
  popupClassName: String,
  getPopupContainer: ot(),
  onTabClick: {
    type: Function
  },
  onTabScroll: {
    type: Function
  }
}), Jte = (t, e) => {
  const {
    offsetWidth: n,
    offsetHeight: i,
    offsetTop: o,
    offsetLeft: r
  } = t, {
    width: a,
    height: l,
    x: s,
    y: u
  } = t.getBoundingClientRect();
  return Math.abs(a - n) < 1 ? [a, l, s - e.x, u - e.y] : [n, i, r, o];
}, hE = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "TabNavList",
  inheritAttrs: !1,
  props: Ute(),
  slots: Object,
  emits: ["tabClick", "tabScroll"],
  setup(t, e) {
    let {
      attrs: n,
      slots: i
    } = e;
    const {
      tabs: o,
      prefixCls: r
    } = M5(), a = Te(), l = Te(), s = Te(), u = Te(), [c, d] = Gte(), f = A(() => t.tabPosition === "top" || t.tabPosition === "bottom"), [h, p] = dE(0, (Ne, Fe) => {
      f.value && t.onTabScroll && t.onTabScroll({
        direction: Ne > Fe ? "left" : "right"
      });
    }), [g, m] = dE(0, (Ne, Fe) => {
      !f.value && t.onTabScroll && t.onTabScroll({
        direction: Ne > Fe ? "top" : "bottom"
      });
    }), [y, b] = zn(0), [w, $] = zn(0), [C, P] = zn(null), [O, E] = zn(null), [_, D] = zn(0), [M, N] = zn(0), [L, j] = Wte(/* @__PURE__ */ new Map()), B = qte(o, L), Y = A(() => `${r.value}-nav-operations-hidden`), Q = Te(0), G = Te(0);
    zt(() => {
      f.value ? t.rtl ? (Q.value = 0, G.value = Math.max(0, y.value - C.value)) : (Q.value = Math.min(0, C.value - y.value), G.value = 0) : (Q.value = Math.min(0, O.value - w.value), G.value = 0);
    });
    const V = (Ne) => Ne < Q.value ? Q.value : Ne > G.value ? G.value : Ne, H = Te(), [q, K] = zn(), ee = () => {
      K(Date.now());
    }, ie = () => {
      clearTimeout(H.value);
    }, ae = (Ne, Fe) => {
      Ne((We) => V(We + Fe));
    };
    Zte(a, (Ne, Fe) => {
      if (f.value) {
        if (C.value >= y.value)
          return !1;
        ae(p, Ne);
      } else {
        if (O.value >= w.value)
          return !1;
        ae(m, Fe);
      }
      return ie(), ee(), !0;
    }), _e(q, () => {
      ie(), q.value && (H.value = setTimeout(() => {
        K(0);
      }, 100));
    });
    const te = function() {
      let Ne = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : t.activeKey;
      const Fe = B.value.get(Ne) || {
        width: 0,
        height: 0,
        left: 0,
        right: 0,
        top: 0
      };
      if (f.value) {
        let We = h.value;
        t.rtl ? Fe.right < h.value ? We = Fe.right : Fe.right + Fe.width > h.value + C.value && (We = Fe.right + Fe.width - C.value) : Fe.left < -h.value ? We = -Fe.left : Fe.left + Fe.width > -h.value + C.value && (We = -(Fe.left + Fe.width - C.value)), m(0), p(V(We));
      } else {
        let We = g.value;
        Fe.top < -g.value ? We = -Fe.top : Fe.top + Fe.height > -g.value + O.value && (We = -(Fe.top + Fe.height - O.value)), p(0), m(V(We));
      }
    }, U = Te(0), me = Te(0);
    zt(() => {
      let Ne, Fe, We, nt, Qe, Pe;
      const Ze = B.value;
      ["top", "bottom"].includes(t.tabPosition) ? (Ne = "width", nt = C.value, Qe = y.value, Pe = _.value, Fe = t.rtl ? "right" : "left", We = Math.abs(h.value)) : (Ne = "height", nt = O.value, Qe = y.value, Pe = M.value, Fe = "top", We = -g.value);
      let Ce = nt;
      Qe + Pe > nt && Qe < nt && (Ce = nt - Pe);
      const $e = o.value;
      if (!$e.length)
        return [U.value, me.value] = [0, 0];
      const Le = $e.length;
      let Ke = Le;
      for (let rt = 0; rt < Le; rt += 1) {
        const De = Ze.get($e[rt].key) || fE;
        if (De[Fe] + De[Ne] > We + Ce) {
          Ke = rt - 1;
          break;
        }
      }
      let qe = 0;
      for (let rt = Le - 1; rt >= 0; rt -= 1)
        if ((Ze.get($e[rt].key) || fE)[Fe] < We) {
          qe = rt + 1;
          break;
        }
      return [U.value, me.value] = [qe, Ke];
    });
    const ce = () => {
      j(() => {
        var Ne;
        const Fe = /* @__PURE__ */ new Map(), We = (Ne = l.value) === null || Ne === void 0 ? void 0 : Ne.getBoundingClientRect();
        return o.value.forEach((nt) => {
          let {
            key: Qe
          } = nt;
          const Pe = d.value.get(Qe), Ze = Pe?.$el || Pe;
          if (Ze) {
            const [Ce, $e, Le, Ke] = Jte(Ze, We);
            Fe.set(Qe, {
              width: Ce,
              height: $e,
              left: Le,
              top: Ke
            });
          }
        }), Fe;
      });
    };
    _e(() => o.value.map((Ne) => Ne.key).join("%%"), () => {
      ce();
    }, {
      flush: "post"
    });
    const ue = () => {
      var Ne, Fe, We, nt, Qe;
      const Pe = ((Ne = a.value) === null || Ne === void 0 ? void 0 : Ne.offsetWidth) || 0, Ze = ((Fe = a.value) === null || Fe === void 0 ? void 0 : Fe.offsetHeight) || 0, Ce = ((We = u.value) === null || We === void 0 ? void 0 : We.$el) || {}, $e = Ce.offsetWidth || 0, Le = Ce.offsetHeight || 0;
      P(Pe), E(Ze), D($e), N(Le);
      const Ke = (((nt = l.value) === null || nt === void 0 ? void 0 : nt.offsetWidth) || 0) - $e, qe = (((Qe = l.value) === null || Qe === void 0 ? void 0 : Qe.offsetHeight) || 0) - Le;
      b(Ke), $(qe), ce();
    }, fe = A(() => [...o.value.slice(0, U.value), ...o.value.slice(me.value + 1)]), [he, le] = zn(), ke = A(() => B.value.get(t.activeKey)), ze = Te(), Re = () => {
      Gt.cancel(ze.value);
    };
    _e([ke, f, () => t.rtl], () => {
      const Ne = {};
      ke.value && (f.value ? (t.rtl ? Ne.right = yc(ke.value.right) : Ne.left = yc(ke.value.left), Ne.width = yc(ke.value.width)) : (Ne.top = yc(ke.value.top), Ne.height = yc(ke.value.height))), Re(), ze.value = Gt(() => {
        le(Ne);
      });
    }), _e([() => t.activeKey, ke, B, f], () => {
      te();
    }, {
      flush: "post"
    }), _e([() => t.rtl, () => t.tabBarGutter, () => t.activeKey, () => o.value], () => {
      ue();
    }, {
      flush: "post"
    });
    const Ye = (Ne) => {
      let {
        position: Fe,
        prefixCls: We,
        extra: nt
      } = Ne;
      if (!nt) return null;
      const Qe = nt?.({
        position: Fe
      });
      return Qe ? v("div", {
        class: `${We}-extra-content`
      }, [Qe]) : null;
    };
    return tn(() => {
      ie(), Re();
    }), () => {
      const {
        id: Ne,
        animated: Fe,
        activeKey: We,
        rtl: nt,
        editable: Qe,
        locale: Pe,
        tabPosition: Ze,
        tabBarGutter: Ce,
        onTabClick: $e
      } = t, {
        class: Le,
        style: Ke
      } = n, qe = r.value, rt = !!fe.value.length, De = `${qe}-nav-wrap`;
      let Be, je, at, mt;
      f.value ? nt ? (je = h.value > 0, Be = h.value + C.value < y.value) : (Be = h.value < 0, je = -h.value + C.value < y.value) : (at = g.value < 0, mt = -g.value + O.value < w.value);
      const st = {};
      Ze === "top" || Ze === "bottom" ? st[nt ? "marginRight" : "marginLeft"] = typeof Ce == "number" ? `${Ce}px` : Ce : st.marginTop = typeof Ce == "number" ? `${Ce}px` : Ce;
      const gt = o.value.map((Et, It) => {
        const {
          key: _t
        } = Et;
        return v(jte, {
          id: Ne,
          prefixCls: qe,
          key: _t,
          tab: Et,
          style: It === 0 ? void 0 : st,
          closable: Et.closable,
          editable: Qe,
          active: _t === We,
          removeAriaLabel: Pe?.removeAriaLabel,
          ref: c(_t),
          onClick: (wt) => {
            $e(_t, wt);
          },
          onFocus: () => {
            te(_t), ee(), a.value && (nt || (a.value.scrollLeft = 0), a.value.scrollTop = 0);
          }
        }, i);
      });
      return v("div", {
        role: "tablist",
        class: Ae(`${qe}-nav`, Le),
        style: Ke,
        onKeydown: () => {
          ee();
        }
      }, [v(Ye, {
        position: "left",
        prefixCls: qe,
        extra: i.leftExtra
      }, null), v(Mu, {
        onResize: ue
      }, {
        default: () => [v("div", {
          class: Ae(De, {
            [`${De}-ping-left`]: Be,
            [`${De}-ping-right`]: je,
            [`${De}-ping-top`]: at,
            [`${De}-ping-bottom`]: mt
          }),
          ref: a
        }, [v(Mu, {
          onResize: ue
        }, {
          default: () => [v("div", {
            ref: l,
            class: `${qe}-nav-list`,
            style: {
              transform: `translate(${h.value}px, ${g.value}px)`,
              transition: q.value ? "none" : void 0
            }
          }, [gt, v(E5, {
            ref: u,
            prefixCls: qe,
            locale: Pe,
            editable: Qe,
            style: k(k({}, gt.length === 0 ? void 0 : st), {
              visibility: rt ? "hidden" : null
            })
          }, null), v("div", {
            class: Ae(`${qe}-ink-bar`, {
              [`${qe}-ink-bar-animated`]: Fe.inkBar
            }),
            style: he.value
          }, null)])]
        })])]
      }), v(Kte, J(J({}, t), {}, {
        removeAriaLabel: Pe?.removeAriaLabel,
        ref: s,
        prefixCls: qe,
        tabs: fe.value,
        class: !rt && Y.value
      }), IA(i, ["moreIcon"])), v(Ye, {
        position: "right",
        prefixCls: qe,
        extra: i.rightExtra
      }, null), v(Ye, {
        position: "right",
        prefixCls: qe,
        extra: i.tabBarExtraContent
      }, null)]);
    };
  }
}), ene = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "TabPanelList",
  inheritAttrs: !1,
  props: {
    activeKey: {
      type: [String, Number]
    },
    id: {
      type: String
    },
    rtl: {
      type: Boolean
    },
    animated: {
      type: Object,
      default: void 0
    },
    tabPosition: {
      type: String
    },
    destroyInactiveTabPane: {
      type: Boolean
    }
  },
  setup(t) {
    const {
      tabs: e,
      prefixCls: n
    } = M5();
    return () => {
      const {
        id: i,
        activeKey: o,
        animated: r,
        tabPosition: a,
        rtl: l,
        destroyInactiveTabPane: s
      } = t, u = r.tabPane, c = n.value, d = e.value.findIndex((f) => f.key === o);
      return v("div", {
        class: `${c}-content-holder`
      }, [v("div", {
        class: [`${c}-content`, `${c}-content-${a}`, {
          [`${c}-content-animated`]: u
        }],
        style: d && u ? {
          [l ? "marginRight" : "marginLeft"]: `-${d}00%`
        } : null
      }, [e.value.map((f) => vi(f.node, {
        key: f.key,
        prefixCls: c,
        tabKey: f.key,
        id: i,
        animated: u,
        active: f.key === o,
        destroyInactiveTabPane: s
      }))])]);
    };
  }
});
var tne = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z" } }, { tag: "path", attrs: { d: "M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z" } }] }, name: "plus", theme: "outlined" };
function pE(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(n);
    typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(n).filter(function(o) {
      return Object.getOwnPropertyDescriptor(n, o).enumerable;
    }))), i.forEach(function(o) {
      nne(t, o, n[o]);
    });
  }
  return t;
}
function nne(t, e, n) {
  return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
var m$ = function(e, n) {
  var i = pE({}, e, n.attrs);
  return v(bn, pE({}, i, {
    icon: tne
  }), null);
};
m$.displayName = "PlusOutlined";
m$.inheritAttrs = !1;
const ine = (t) => {
  const {
    componentCls: e,
    motionDurationSlow: n
  } = t;
  return [
    {
      [e]: {
        [`${e}-switch`]: {
          "&-appear, &-enter": {
            transition: "none",
            "&-start": {
              opacity: 0
            },
            "&-active": {
              opacity: 1,
              transition: `opacity ${n}`
            }
          },
          "&-leave": {
            position: "absolute",
            transition: "none",
            inset: 0,
            "&-start": {
              opacity: 1
            },
            "&-active": {
              opacity: 0,
              transition: `opacity ${n}`
            }
          }
        }
      }
    },
    // Follow code may reuse in other components
    [Ml(t, "slide-up"), Ml(t, "slide-down")]
  ];
}, one = (t) => {
  const {
    componentCls: e,
    tabsCardHorizontalPadding: n,
    tabsCardHeadBackground: i,
    tabsCardGutter: o,
    colorSplit: r
  } = t;
  return {
    [`${e}-card`]: {
      [`> ${e}-nav, > div > ${e}-nav`]: {
        [`${e}-tab`]: {
          margin: 0,
          padding: n,
          background: i,
          border: `${t.lineWidth}px ${t.lineType} ${r}`,
          transition: `all ${t.motionDurationSlow} ${t.motionEaseInOut}`
        },
        [`${e}-tab-active`]: {
          color: t.colorPrimary,
          background: t.colorBgContainer
        },
        [`${e}-ink-bar`]: {
          visibility: "hidden"
        }
      },
      // ========================== Top & Bottom ==========================
      [`&${e}-top, &${e}-bottom`]: {
        [`> ${e}-nav, > div > ${e}-nav`]: {
          [`${e}-tab + ${e}-tab`]: {
            marginLeft: {
              _skip_check_: !0,
              value: `${o}px`
            }
          }
        }
      },
      [`&${e}-top`]: {
        [`> ${e}-nav, > div > ${e}-nav`]: {
          [`${e}-tab`]: {
            borderRadius: `${t.borderRadiusLG}px ${t.borderRadiusLG}px 0 0`
          },
          [`${e}-tab-active`]: {
            borderBottomColor: t.colorBgContainer
          }
        }
      },
      [`&${e}-bottom`]: {
        [`> ${e}-nav, > div > ${e}-nav`]: {
          [`${e}-tab`]: {
            borderRadius: `0 0 ${t.borderRadiusLG}px ${t.borderRadiusLG}px`
          },
          [`${e}-tab-active`]: {
            borderTopColor: t.colorBgContainer
          }
        }
      },
      // ========================== Left & Right ==========================
      [`&${e}-left, &${e}-right`]: {
        [`> ${e}-nav, > div > ${e}-nav`]: {
          [`${e}-tab + ${e}-tab`]: {
            marginTop: `${o}px`
          }
        }
      },
      [`&${e}-left`]: {
        [`> ${e}-nav, > div > ${e}-nav`]: {
          [`${e}-tab`]: {
            borderRadius: {
              _skip_check_: !0,
              value: `${t.borderRadiusLG}px 0 0 ${t.borderRadiusLG}px`
            }
          },
          [`${e}-tab-active`]: {
            borderRightColor: {
              _skip_check_: !0,
              value: t.colorBgContainer
            }
          }
        }
      },
      [`&${e}-right`]: {
        [`> ${e}-nav, > div > ${e}-nav`]: {
          [`${e}-tab`]: {
            borderRadius: {
              _skip_check_: !0,
              value: `0 ${t.borderRadiusLG}px ${t.borderRadiusLG}px 0`
            }
          },
          [`${e}-tab-active`]: {
            borderLeftColor: {
              _skip_check_: !0,
              value: t.colorBgContainer
            }
          }
        }
      }
    }
  };
}, rne = (t) => {
  const {
    componentCls: e,
    tabsHoverColor: n,
    dropdownEdgeChildVerticalPadding: i
  } = t;
  return {
    [`${e}-dropdown`]: k(k({}, kn(t)), {
      position: "absolute",
      top: -9999,
      left: {
        _skip_check_: !0,
        value: -9999
      },
      zIndex: t.zIndexPopup,
      display: "block",
      "&-hidden": {
        display: "none"
      },
      [`${e}-dropdown-menu`]: {
        maxHeight: t.tabsDropdownHeight,
        margin: 0,
        padding: `${i}px 0`,
        overflowX: "hidden",
        overflowY: "auto",
        textAlign: {
          _skip_check_: !0,
          value: "left"
        },
        listStyleType: "none",
        backgroundColor: t.colorBgContainer,
        backgroundClip: "padding-box",
        borderRadius: t.borderRadiusLG,
        outline: "none",
        boxShadow: t.boxShadowSecondary,
        "&-item": k(k({}, Ps), {
          display: "flex",
          alignItems: "center",
          minWidth: t.tabsDropdownWidth,
          margin: 0,
          padding: `${t.paddingXXS}px ${t.paddingSM}px`,
          color: t.colorText,
          fontWeight: "normal",
          fontSize: t.fontSize,
          lineHeight: t.lineHeight,
          cursor: "pointer",
          transition: `all ${t.motionDurationSlow}`,
          "> span": {
            flex: 1,
            whiteSpace: "nowrap"
          },
          "&-remove": {
            flex: "none",
            marginLeft: {
              _skip_check_: !0,
              value: t.marginSM
            },
            color: t.colorTextDescription,
            fontSize: t.fontSizeSM,
            background: "transparent",
            border: 0,
            cursor: "pointer",
            "&:hover": {
              color: n
            }
          },
          "&:hover": {
            background: t.controlItemBgHover
          },
          "&-disabled": {
            "&, &:hover": {
              color: t.colorTextDisabled,
              background: "transparent",
              cursor: "not-allowed"
            }
          }
        })
      }
    })
  };
}, ane = (t) => {
  const {
    componentCls: e,
    margin: n,
    colorSplit: i
  } = t;
  return {
    // ========================== Top & Bottom ==========================
    [`${e}-top, ${e}-bottom`]: {
      flexDirection: "column",
      [`> ${e}-nav, > div > ${e}-nav`]: {
        margin: `0 0 ${n}px 0`,
        "&::before": {
          position: "absolute",
          right: {
            _skip_check_: !0,
            value: 0
          },
          left: {
            _skip_check_: !0,
            value: 0
          },
          borderBottom: `${t.lineWidth}px ${t.lineType} ${i}`,
          content: "''"
        },
        [`${e}-ink-bar`]: {
          height: t.lineWidthBold,
          "&-animated": {
            transition: `width ${t.motionDurationSlow}, left ${t.motionDurationSlow},
            right ${t.motionDurationSlow}`
          }
        },
        [`${e}-nav-wrap`]: {
          "&::before, &::after": {
            top: 0,
            bottom: 0,
            width: t.controlHeight
          },
          "&::before": {
            left: {
              _skip_check_: !0,
              value: 0
            },
            boxShadow: t.boxShadowTabsOverflowLeft
          },
          "&::after": {
            right: {
              _skip_check_: !0,
              value: 0
            },
            boxShadow: t.boxShadowTabsOverflowRight
          },
          [`&${e}-nav-wrap-ping-left::before`]: {
            opacity: 1
          },
          [`&${e}-nav-wrap-ping-right::after`]: {
            opacity: 1
          }
        }
      }
    },
    [`${e}-top`]: {
      [`> ${e}-nav,
        > div > ${e}-nav`]: {
        "&::before": {
          bottom: 0
        },
        [`${e}-ink-bar`]: {
          bottom: 0
        }
      }
    },
    [`${e}-bottom`]: {
      [`> ${e}-nav, > div > ${e}-nav`]: {
        order: 1,
        marginTop: `${n}px`,
        marginBottom: 0,
        "&::before": {
          top: 0
        },
        [`${e}-ink-bar`]: {
          top: 0
        }
      },
      [`> ${e}-content-holder, > div > ${e}-content-holder`]: {
        order: 0
      }
    },
    // ========================== Left & Right ==========================
    [`${e}-left, ${e}-right`]: {
      [`> ${e}-nav, > div > ${e}-nav`]: {
        flexDirection: "column",
        minWidth: t.controlHeight * 1.25,
        // >>>>>>>>>>> Tab
        [`${e}-tab`]: {
          padding: `${t.paddingXS}px ${t.paddingLG}px`,
          textAlign: "center"
        },
        [`${e}-tab + ${e}-tab`]: {
          margin: `${t.margin}px 0 0 0`
        },
        // >>>>>>>>>>> Nav
        [`${e}-nav-wrap`]: {
          flexDirection: "column",
          "&::before, &::after": {
            right: {
              _skip_check_: !0,
              value: 0
            },
            left: {
              _skip_check_: !0,
              value: 0
            },
            height: t.controlHeight
          },
          "&::before": {
            top: 0,
            boxShadow: t.boxShadowTabsOverflowTop
          },
          "&::after": {
            bottom: 0,
            boxShadow: t.boxShadowTabsOverflowBottom
          },
          [`&${e}-nav-wrap-ping-top::before`]: {
            opacity: 1
          },
          [`&${e}-nav-wrap-ping-bottom::after`]: {
            opacity: 1
          }
        },
        // >>>>>>>>>>> Ink Bar
        [`${e}-ink-bar`]: {
          width: t.lineWidthBold,
          "&-animated": {
            transition: `height ${t.motionDurationSlow}, top ${t.motionDurationSlow}`
          }
        },
        [`${e}-nav-list, ${e}-nav-operations`]: {
          flex: "1 0 auto",
          flexDirection: "column"
        }
      }
    },
    [`${e}-left`]: {
      [`> ${e}-nav, > div > ${e}-nav`]: {
        [`${e}-ink-bar`]: {
          right: {
            _skip_check_: !0,
            value: 0
          }
        }
      },
      [`> ${e}-content-holder, > div > ${e}-content-holder`]: {
        marginLeft: {
          _skip_check_: !0,
          value: `-${t.lineWidth}px`
        },
        borderLeft: {
          _skip_check_: !0,
          value: `${t.lineWidth}px ${t.lineType} ${t.colorBorder}`
        },
        [`> ${e}-content > ${e}-tabpane`]: {
          paddingLeft: {
            _skip_check_: !0,
            value: t.paddingLG
          }
        }
      }
    },
    [`${e}-right`]: {
      [`> ${e}-nav, > div > ${e}-nav`]: {
        order: 1,
        [`${e}-ink-bar`]: {
          left: {
            _skip_check_: !0,
            value: 0
          }
        }
      },
      [`> ${e}-content-holder, > div > ${e}-content-holder`]: {
        order: 0,
        marginRight: {
          _skip_check_: !0,
          value: -t.lineWidth
        },
        borderRight: {
          _skip_check_: !0,
          value: `${t.lineWidth}px ${t.lineType} ${t.colorBorder}`
        },
        [`> ${e}-content > ${e}-tabpane`]: {
          paddingRight: {
            _skip_check_: !0,
            value: t.paddingLG
          }
        }
      }
    }
  };
}, lne = (t) => {
  const {
    componentCls: e,
    padding: n
  } = t;
  return {
    [e]: {
      "&-small": {
        [`> ${e}-nav`]: {
          [`${e}-tab`]: {
            padding: `${t.paddingXS}px 0`,
            fontSize: t.fontSize
          }
        }
      },
      "&-large": {
        [`> ${e}-nav`]: {
          [`${e}-tab`]: {
            padding: `${n}px 0`,
            fontSize: t.fontSizeLG
          }
        }
      }
    },
    [`${e}-card`]: {
      [`&${e}-small`]: {
        [`> ${e}-nav`]: {
          [`${e}-tab`]: {
            padding: `${t.paddingXXS * 1.5}px ${n}px`
          }
        },
        [`&${e}-bottom`]: {
          [`> ${e}-nav ${e}-tab`]: {
            borderRadius: `0 0 ${t.borderRadius}px ${t.borderRadius}px`
          }
        },
        [`&${e}-top`]: {
          [`> ${e}-nav ${e}-tab`]: {
            borderRadius: `${t.borderRadius}px ${t.borderRadius}px 0 0`
          }
        },
        [`&${e}-right`]: {
          [`> ${e}-nav ${e}-tab`]: {
            borderRadius: {
              _skip_check_: !0,
              value: `0 ${t.borderRadius}px ${t.borderRadius}px 0`
            }
          }
        },
        [`&${e}-left`]: {
          [`> ${e}-nav ${e}-tab`]: {
            borderRadius: {
              _skip_check_: !0,
              value: `${t.borderRadius}px 0 0 ${t.borderRadius}px`
            }
          }
        }
      },
      [`&${e}-large`]: {
        [`> ${e}-nav`]: {
          [`${e}-tab`]: {
            padding: `${t.paddingXS}px ${n}px ${t.paddingXXS * 1.5}px`
          }
        }
      }
    }
  };
}, sne = (t) => {
  const {
    componentCls: e,
    tabsActiveColor: n,
    tabsHoverColor: i,
    iconCls: o,
    tabsHorizontalGutter: r
  } = t, a = `${e}-tab`;
  return {
    [a]: {
      position: "relative",
      display: "inline-flex",
      alignItems: "center",
      padding: `${t.paddingSM}px 0`,
      fontSize: `${t.fontSize}px`,
      background: "transparent",
      border: 0,
      outline: "none",
      cursor: "pointer",
      "&-btn, &-remove": k({
        "&:focus:not(:focus-visible), &:active": {
          color: n
        }
      }, Au(t)),
      "&-btn": {
        outline: "none",
        transition: "all 0.3s"
      },
      "&-remove": {
        flex: "none",
        marginRight: {
          _skip_check_: !0,
          value: -t.marginXXS
        },
        marginLeft: {
          _skip_check_: !0,
          value: t.marginXS
        },
        color: t.colorTextDescription,
        fontSize: t.fontSizeSM,
        background: "transparent",
        border: "none",
        outline: "none",
        cursor: "pointer",
        transition: `all ${t.motionDurationSlow}`,
        "&:hover": {
          color: t.colorTextHeading
        }
      },
      "&:hover": {
        color: i
      },
      [`&${a}-active ${a}-btn`]: {
        color: t.colorPrimary,
        textShadow: t.tabsActiveTextShadow
      },
      [`&${a}-disabled`]: {
        color: t.colorTextDisabled,
        cursor: "not-allowed"
      },
      [`&${a}-disabled ${a}-btn, &${a}-disabled ${e}-remove`]: {
        "&:focus, &:active": {
          color: t.colorTextDisabled
        }
      },
      [`& ${a}-remove ${o}`]: {
        margin: 0
      },
      [o]: {
        marginRight: {
          _skip_check_: !0,
          value: t.marginSM
        }
      }
    },
    [`${a} + ${a}`]: {
      margin: {
        _skip_check_: !0,
        value: `0 0 0 ${r}px`
      }
    }
  };
}, une = (t) => {
  const {
    componentCls: e,
    tabsHorizontalGutter: n,
    iconCls: i,
    tabsCardGutter: o
  } = t;
  return {
    [`${e}-rtl`]: {
      direction: "rtl",
      [`${e}-nav`]: {
        [`${e}-tab`]: {
          margin: {
            _skip_check_: !0,
            value: `0 0 0 ${n}px`
          },
          [`${e}-tab:last-of-type`]: {
            marginLeft: {
              _skip_check_: !0,
              value: 0
            }
          },
          [i]: {
            marginRight: {
              _skip_check_: !0,
              value: 0
            },
            marginLeft: {
              _skip_check_: !0,
              value: `${t.marginSM}px`
            }
          },
          [`${e}-tab-remove`]: {
            marginRight: {
              _skip_check_: !0,
              value: `${t.marginXS}px`
            },
            marginLeft: {
              _skip_check_: !0,
              value: `-${t.marginXXS}px`
            },
            [i]: {
              margin: 0
            }
          }
        }
      },
      [`&${e}-left`]: {
        [`> ${e}-nav`]: {
          order: 1
        },
        [`> ${e}-content-holder`]: {
          order: 0
        }
      },
      [`&${e}-right`]: {
        [`> ${e}-nav`]: {
          order: 0
        },
        [`> ${e}-content-holder`]: {
          order: 1
        }
      },
      // ====================== Card ======================
      [`&${e}-card${e}-top, &${e}-card${e}-bottom`]: {
        [`> ${e}-nav, > div > ${e}-nav`]: {
          [`${e}-tab + ${e}-tab`]: {
            marginRight: {
              _skip_check_: !0,
              value: `${o}px`
            },
            marginLeft: {
              _skip_check_: !0,
              value: 0
            }
          }
        }
      }
    },
    [`${e}-dropdown-rtl`]: {
      direction: "rtl"
    },
    [`${e}-menu-item`]: {
      [`${e}-dropdown-rtl`]: {
        textAlign: {
          _skip_check_: !0,
          value: "right"
        }
      }
    }
  };
}, cne = (t) => {
  const {
    componentCls: e,
    tabsCardHorizontalPadding: n,
    tabsCardHeight: i,
    tabsCardGutter: o,
    tabsHoverColor: r,
    tabsActiveColor: a,
    colorSplit: l
  } = t;
  return {
    [e]: k(k(k(k({}, kn(t)), {
      display: "flex",
      // ========================== Navigation ==========================
      [`> ${e}-nav, > div > ${e}-nav`]: {
        position: "relative",
        display: "flex",
        flex: "none",
        alignItems: "center",
        [`${e}-nav-wrap`]: {
          position: "relative",
          display: "flex",
          flex: "auto",
          alignSelf: "stretch",
          overflow: "hidden",
          whiteSpace: "nowrap",
          transform: "translate(0)",
          // >>>>> Ping shadow
          "&::before, &::after": {
            position: "absolute",
            zIndex: 1,
            opacity: 0,
            transition: `opacity ${t.motionDurationSlow}`,
            content: "''",
            pointerEvents: "none"
          }
        },
        [`${e}-nav-list`]: {
          position: "relative",
          display: "flex",
          transition: `opacity ${t.motionDurationSlow}`
        },
        // >>>>>>>> Operations
        [`${e}-nav-operations`]: {
          display: "flex",
          alignSelf: "stretch"
        },
        [`${e}-nav-operations-hidden`]: {
          position: "absolute",
          visibility: "hidden",
          pointerEvents: "none"
        },
        [`${e}-nav-more`]: {
          position: "relative",
          padding: n,
          background: "transparent",
          border: 0,
          "&::after": {
            position: "absolute",
            right: {
              _skip_check_: !0,
              value: 0
            },
            bottom: 0,
            left: {
              _skip_check_: !0,
              value: 0
            },
            height: t.controlHeightLG / 8,
            transform: "translateY(100%)",
            content: "''"
          }
        },
        [`${e}-nav-add`]: k({
          minWidth: `${i}px`,
          marginLeft: {
            _skip_check_: !0,
            value: `${o}px`
          },
          padding: `0 ${t.paddingXS}px`,
          background: "transparent",
          border: `${t.lineWidth}px ${t.lineType} ${l}`,
          borderRadius: `${t.borderRadiusLG}px ${t.borderRadiusLG}px 0 0`,
          outline: "none",
          cursor: "pointer",
          color: t.colorText,
          transition: `all ${t.motionDurationSlow} ${t.motionEaseInOut}`,
          "&:hover": {
            color: r
          },
          "&:active, &:focus:not(:focus-visible)": {
            color: a
          }
        }, Au(t))
      },
      [`${e}-extra-content`]: {
        flex: "none"
      },
      // ============================ InkBar ============================
      [`${e}-ink-bar`]: {
        position: "absolute",
        background: t.colorPrimary,
        pointerEvents: "none"
      }
    }), sne(t)), {
      // =========================== TabPanes ===========================
      [`${e}-content`]: {
        position: "relative",
        display: "flex",
        width: "100%",
        "&-animated": {
          transition: "margin 0.3s"
        }
      },
      [`${e}-content-holder`]: {
        flex: "auto",
        minWidth: 0,
        minHeight: 0
      },
      [`${e}-tabpane`]: {
        outline: "none",
        flex: "none",
        width: "100%"
      }
    }),
    [`${e}-centered`]: {
      [`> ${e}-nav, > div > ${e}-nav`]: {
        [`${e}-nav-wrap`]: {
          [`&:not([class*='${e}-nav-wrap-ping'])`]: {
            justifyContent: "center"
          }
        }
      }
    }
  };
}, dne = Vn("Tabs", (t) => {
  const e = t.controlHeightLG, n = dn(t, {
    tabsHoverColor: t.colorPrimaryHover,
    tabsActiveColor: t.colorPrimaryActive,
    tabsCardHorizontalPadding: `${(e - Math.round(t.fontSize * t.lineHeight)) / 2 - t.lineWidth}px ${t.padding}px`,
    tabsCardHeight: e,
    tabsCardGutter: t.marginXXS / 2,
    tabsHorizontalGutter: 32,
    tabsCardHeadBackground: t.colorFillAlter,
    dropdownEdgeChildVerticalPadding: t.paddingXXS,
    tabsActiveTextShadow: "0 0 0.25px currentcolor",
    tabsDropdownHeight: 200,
    tabsDropdownWidth: 120
  });
  return [lne(n), une(n), ane(n), rne(n), one(n), cne(n), ine(n)];
}, (t) => ({
  zIndexPopup: t.zIndexPopupBase + 50
}));
let gE = 0;
const A5 = () => ({
  prefixCls: {
    type: String
  },
  id: {
    type: String
  },
  popupClassName: String,
  getPopupContainer: ot(),
  activeKey: {
    type: [String, Number]
  },
  defaultActiveKey: {
    type: [String, Number]
  },
  direction: yn(),
  animated: pn([Boolean, Object]),
  renderTabBar: ot(),
  tabBarGutter: {
    type: Number
  },
  tabBarStyle: Vt(),
  tabPosition: yn(),
  destroyInactiveTabPane: pt(),
  hideAdd: Boolean,
  type: yn(),
  size: yn(),
  centered: Boolean,
  onEdit: ot(),
  onChange: ot(),
  onTabClick: ot(),
  onTabScroll: ot(),
  "onUpdate:activeKey": ot(),
  // Accessibility
  locale: Vt(),
  onPrevClick: ot(),
  onNextClick: ot(),
  tabBarExtraContent: ve.any
});
function fne(t) {
  return t.map((e) => {
    if (po(e)) {
      const n = k({}, e.props || {});
      for (const [f, h] of Object.entries(n))
        delete n[f], n[sg(f)] = h;
      const i = e.children || {}, o = e.key !== void 0 ? e.key : void 0, {
        tab: r = i.tab,
        disabled: a,
        forceRender: l,
        closable: s,
        animated: u,
        active: c,
        destroyInactiveTabPane: d
      } = n;
      return k(k({
        key: o
      }, n), {
        node: e,
        closeIcon: i.closeIcon,
        tab: r,
        disabled: a === "" || a,
        forceRender: l === "" || l,
        closable: s === "" || s,
        animated: u === "" || u,
        active: c === "" || c,
        destroyInactiveTabPane: d === "" || d
      });
    }
    return null;
  }).filter((e) => e);
}
const hne = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "InternalTabs",
  inheritAttrs: !1,
  props: k(k({}, Kn(A5(), {
    tabPosition: "top",
    animated: {
      inkBar: !0,
      tabPane: !1
    }
  })), {
    tabs: ui()
  }),
  slots: Object,
  // emits: ['tabClick', 'tabScroll', 'change', 'update:activeKey'],
  setup(t, e) {
    let {
      attrs: n,
      slots: i
    } = e;
    $n(t.onPrevClick === void 0 && t.onNextClick === void 0, "Tabs", "`onPrevClick / @prevClick` and `onNextClick / @nextClick` has been removed. Please use `onTabScroll / @tabScroll` instead."), $n(t.tabBarExtraContent === void 0, "Tabs", "`tabBarExtraContent` prop has been removed. Please use `rightExtra` slot instead."), $n(i.tabBarExtraContent === void 0, "Tabs", "`tabBarExtraContent` slot is deprecated. Please use `rightExtra` slot instead.");
    const {
      prefixCls: o,
      direction: r,
      size: a,
      rootPrefixCls: l,
      getPopupContainer: s
    } = Ht("tabs", t), [u, c] = dne(o), d = A(() => r.value === "rtl"), f = A(() => {
      const {
        animated: O,
        tabPosition: E
      } = t;
      return O === !1 || ["left", "right"].includes(E) ? {
        inkBar: !1,
        tabPane: !1
      } : O === !0 ? {
        inkBar: !0,
        tabPane: !0
      } : k({
        inkBar: !0,
        tabPane: !1
      }, typeof O == "object" ? O : {});
    }), [h, p] = zn(!1);
    Lt(() => {
      p(PC());
    });
    const [g, m] = er(() => {
      var O;
      return (O = t.tabs[0]) === null || O === void 0 ? void 0 : O.key;
    }, {
      value: A(() => t.activeKey),
      defaultValue: t.defaultActiveKey
    }), [y, b] = zn(() => t.tabs.findIndex((O) => O.key === g.value));
    zt(() => {
      var O;
      let E = t.tabs.findIndex((_) => _.key === g.value);
      E === -1 && (E = Math.max(0, Math.min(y.value, t.tabs.length - 1)), m((O = t.tabs[E]) === null || O === void 0 ? void 0 : O.key)), b(E);
    });
    const [w, $] = er(null, {
      value: A(() => t.id)
    }), C = A(() => h.value && !["left", "right"].includes(t.tabPosition) ? "top" : t.tabPosition);
    Lt(() => {
      t.id || ($(`rc-tabs-${process.env.NODE_ENV === "test" ? "test" : gE}`), gE += 1);
    });
    const P = (O, E) => {
      var _, D;
      (_ = t.onTabClick) === null || _ === void 0 || _.call(t, O, E);
      const M = O !== g.value;
      m(O), M && ((D = t.onChange) === null || D === void 0 || D.call(t, O));
    };
    return I5({
      tabs: A(() => t.tabs),
      prefixCls: o
    }), () => {
      const {
        id: O,
        type: E,
        tabBarGutter: _,
        tabBarStyle: D,
        locale: M,
        destroyInactiveTabPane: N,
        renderTabBar: L = i.renderTabBar,
        onTabScroll: j,
        hideAdd: B,
        centered: Y
      } = t, Q = {
        id: w.value,
        activeKey: g.value,
        animated: f.value,
        tabPosition: C.value,
        rtl: d.value,
        mobile: h.value
      };
      let G;
      E === "editable-card" && (G = {
        onEdit: (K, ee) => {
          let {
            key: ie,
            event: ae
          } = ee;
          var te;
          (te = t.onEdit) === null || te === void 0 || te.call(t, K === "add" ? ae : ie, K);
        },
        removeIcon: () => v(Ll, null, null),
        addIcon: i.addIcon ? i.addIcon : () => v(m$, null, null),
        showAdd: B !== !0
      });
      let V;
      const H = k(k({}, Q), {
        moreTransitionName: `${l.value}-slide-up`,
        editable: G,
        locale: M,
        tabBarGutter: _,
        onTabClick: P,
        onTabScroll: j,
        style: D,
        getPopupContainer: s.value,
        popupClassName: Ae(t.popupClassName, c.value)
      });
      L ? V = L(k(k({}, H), {
        DefaultTabBar: hE
      })) : V = v(hE, H, IA(i, ["moreIcon", "leftExtra", "rightExtra", "tabBarExtraContent"]));
      const q = o.value;
      return u(v("div", J(J({}, n), {}, {
        id: O,
        class: Ae(q, `${q}-${C.value}`, {
          [c.value]: !0,
          [`${q}-${a.value}`]: a.value,
          [`${q}-card`]: ["card", "editable-card"].includes(E),
          [`${q}-editable-card`]: E === "editable-card",
          [`${q}-centered`]: Y,
          [`${q}-mobile`]: h.value,
          [`${q}-editable`]: E === "editable-card",
          [`${q}-rtl`]: d.value
        }, n.class)
      }), [V, v(ene, J(J({
        destroyInactiveTabPane: N
      }, Q), {}, {
        animated: f.value
      }), null)]));
    };
  }
}), uf = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ATabs",
  inheritAttrs: !1,
  props: Kn(A5(), {
    tabPosition: "top",
    animated: {
      inkBar: !0,
      tabPane: !1
    }
  }),
  slots: Object,
  // emits: ['tabClick', 'tabScroll', 'change', 'update:activeKey'],
  setup(t, e) {
    let {
      attrs: n,
      slots: i,
      emit: o
    } = e;
    const r = (a) => {
      o("update:activeKey", a), o("change", a);
    };
    return () => {
      var a;
      const l = fne(Wi((a = i.default) === null || a === void 0 ? void 0 : a.call(i)));
      return v(hne, J(J(J({}, ii(t, ["onUpdate:activeKey"])), n), {}, {
        onChange: r,
        tabs: l
      }), i);
    };
  }
}), pne = () => ({
  tab: ve.any,
  disabled: {
    type: Boolean
  },
  forceRender: {
    type: Boolean
  },
  closable: {
    type: Boolean
  },
  animated: {
    type: Boolean
  },
  active: {
    type: Boolean
  },
  destroyInactiveTabPane: {
    type: Boolean
  },
  // Pass by TabPaneList
  prefixCls: {
    type: String
  },
  tabKey: {
    type: [String, Number]
  },
  id: {
    type: String
  }
  // closeIcon: PropTypes.any,
}), IO = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ATabPane",
  inheritAttrs: !1,
  __ANT_TAB_PANE: !0,
  props: pne(),
  slots: Object,
  setup(t, e) {
    let {
      attrs: n,
      slots: i
    } = e;
    const o = de(t.forceRender);
    _e([() => t.active, () => t.destroyInactiveTabPane], () => {
      t.active ? o.value = !0 : t.destroyInactiveTabPane && (o.value = !1);
    }, {
      immediate: !0
    });
    const r = A(() => t.active ? {} : t.animated ? {
      visibility: "hidden",
      height: 0,
      overflowY: "hidden"
    } : {
      display: "none"
    });
    return () => {
      var a;
      const {
        prefixCls: l,
        forceRender: s,
        id: u,
        active: c,
        tabKey: d
      } = t;
      return v("div", {
        id: u && `${u}-panel-${d}`,
        role: "tabpanel",
        tabindex: c ? 0 : -1,
        "aria-labelledby": u && `${u}-tab-${d}`,
        "aria-hidden": !c,
        style: [r.value, n.style],
        class: [`${l}-tabpane`, c && `${l}-tabpane-active`, n.class]
      }, [(c || o.value || s) && ((a = i.default) === null || a === void 0 ? void 0 : a.call(i))]);
    };
  }
});
uf.TabPane = IO;
uf.install = function(t) {
  return t.component(uf.name, uf), t.component(IO.name, IO), t;
};
const gne = (t) => {
  const {
    antCls: e,
    componentCls: n,
    cardHeadHeight: i,
    cardPaddingBase: o,
    cardHeadTabsMarginBottom: r
  } = t;
  return k(k({
    display: "flex",
    justifyContent: "center",
    flexDirection: "column",
    minHeight: i,
    marginBottom: -1,
    padding: `0 ${o}px`,
    color: t.colorTextHeading,
    fontWeight: t.fontWeightStrong,
    fontSize: t.fontSizeLG,
    background: "transparent",
    borderBottom: `${t.lineWidth}px ${t.lineType} ${t.colorBorderSecondary}`,
    borderRadius: `${t.borderRadiusLG}px ${t.borderRadiusLG}px 0 0`
  }, Es()), {
    "&-wrapper": {
      width: "100%",
      display: "flex",
      alignItems: "center"
    },
    "&-title": k(k({
      display: "inline-block",
      flex: 1
    }, Ps), {
      [`
          > ${n}-typography,
          > ${n}-typography-edit-content
        `]: {
        insetInlineStart: 0,
        marginTop: 0,
        marginBottom: 0
      }
    }),
    [`${e}-tabs-top`]: {
      clear: "both",
      marginBottom: r,
      color: t.colorText,
      fontWeight: "normal",
      fontSize: t.fontSize,
      "&-bar": {
        borderBottom: `${t.lineWidth}px ${t.lineType} ${t.colorBorderSecondary}`
      }
    }
  });
}, mne = (t) => {
  const {
    cardPaddingBase: e,
    colorBorderSecondary: n,
    cardShadow: i,
    lineWidth: o
  } = t;
  return {
    width: "33.33%",
    padding: e,
    border: 0,
    borderRadius: 0,
    boxShadow: `
      ${o}px 0 0 0 ${n},
      0 ${o}px 0 0 ${n},
      ${o}px ${o}px 0 0 ${n},
      ${o}px 0 0 0 ${n} inset,
      0 ${o}px 0 0 ${n} inset;
    `,
    transition: `all ${t.motionDurationMid}`,
    "&-hoverable:hover": {
      position: "relative",
      zIndex: 1,
      boxShadow: i
    }
  };
}, vne = (t) => {
  const {
    componentCls: e,
    iconCls: n,
    cardActionsLiMargin: i,
    cardActionsIconSize: o,
    colorBorderSecondary: r
  } = t;
  return k(k({
    margin: 0,
    padding: 0,
    listStyle: "none",
    background: t.colorBgContainer,
    borderTop: `${t.lineWidth}px ${t.lineType} ${r}`,
    display: "flex",
    borderRadius: `0 0 ${t.borderRadiusLG}px ${t.borderRadiusLG}px `
  }, Es()), {
    "& > li": {
      margin: i,
      color: t.colorTextDescription,
      textAlign: "center",
      "> span": {
        position: "relative",
        display: "block",
        minWidth: t.cardActionsIconSize * 2,
        fontSize: t.fontSize,
        lineHeight: t.lineHeight,
        cursor: "pointer",
        "&:hover": {
          color: t.colorPrimary,
          transition: `color ${t.motionDurationMid}`
        },
        [`a:not(${e}-btn), > ${n}`]: {
          display: "inline-block",
          width: "100%",
          color: t.colorTextDescription,
          lineHeight: `${t.fontSize * t.lineHeight}px`,
          transition: `color ${t.motionDurationMid}`,
          "&:hover": {
            color: t.colorPrimary
          }
        },
        [`> ${n}`]: {
          fontSize: o,
          lineHeight: `${o * t.lineHeight}px`
        }
      },
      "&:not(:last-child)": {
        borderInlineEnd: `${t.lineWidth}px ${t.lineType} ${r}`
      }
    }
  });
}, yne = (t) => k(k({
  margin: `-${t.marginXXS}px 0`,
  display: "flex"
}, Es()), {
  "&-avatar": {
    paddingInlineEnd: t.padding
  },
  "&-detail": {
    overflow: "hidden",
    flex: 1,
    "> div:not(:last-child)": {
      marginBottom: t.marginXS
    }
  },
  "&-title": k({
    color: t.colorTextHeading,
    fontWeight: t.fontWeightStrong,
    fontSize: t.fontSizeLG
  }, Ps),
  "&-description": {
    color: t.colorTextDescription
  }
}), bne = (t) => {
  const {
    componentCls: e,
    cardPaddingBase: n,
    colorFillAlter: i
  } = t;
  return {
    [`${e}-head`]: {
      padding: `0 ${n}px`,
      background: i,
      "&-title": {
        fontSize: t.fontSize
      }
    },
    [`${e}-body`]: {
      padding: `${t.padding}px ${n}px`
    }
  };
}, xne = (t) => {
  const {
    componentCls: e
  } = t;
  return {
    overflow: "hidden",
    [`${e}-body`]: {
      userSelect: "none"
    }
  };
}, One = (t) => {
  const {
    componentCls: e,
    cardShadow: n,
    cardHeadPadding: i,
    colorBorderSecondary: o,
    boxShadow: r,
    cardPaddingBase: a
  } = t;
  return {
    [e]: k(k({}, kn(t)), {
      position: "relative",
      background: t.colorBgContainer,
      borderRadius: t.borderRadiusLG,
      [`&:not(${e}-bordered)`]: {
        boxShadow: r
      },
      [`${e}-head`]: gne(t),
      [`${e}-extra`]: {
        // https://stackoverflow.com/a/22429853/3040605
        marginInlineStart: "auto",
        color: "",
        fontWeight: "normal",
        fontSize: t.fontSize
      },
      [`${e}-body`]: k({
        padding: a,
        borderRadius: ` 0 0 ${t.borderRadiusLG}px ${t.borderRadiusLG}px`
      }, Es()),
      [`${e}-grid`]: mne(t),
      [`${e}-cover`]: {
        "> *": {
          display: "block",
          width: "100%"
        },
        img: {
          borderRadius: `${t.borderRadiusLG}px ${t.borderRadiusLG}px 0 0`
        }
      },
      [`${e}-actions`]: vne(t),
      [`${e}-meta`]: yne(t)
    }),
    [`${e}-bordered`]: {
      border: `${t.lineWidth}px ${t.lineType} ${o}`,
      [`${e}-cover`]: {
        marginTop: -1,
        marginInlineStart: -1,
        marginInlineEnd: -1
      }
    },
    [`${e}-hoverable`]: {
      cursor: "pointer",
      transition: `box-shadow ${t.motionDurationMid}, border-color ${t.motionDurationMid}`,
      "&:hover": {
        borderColor: "transparent",
        boxShadow: n
      }
    },
    [`${e}-contain-grid`]: {
      [`${e}-body`]: {
        display: "flex",
        flexWrap: "wrap"
      },
      [`&:not(${e}-loading) ${e}-body`]: {
        marginBlockStart: -t.lineWidth,
        marginInlineStart: -t.lineWidth,
        padding: 0
      }
    },
    [`${e}-contain-tabs`]: {
      [`> ${e}-head`]: {
        [`${e}-head-title, ${e}-extra`]: {
          paddingTop: i
        }
      }
    },
    [`${e}-type-inner`]: bne(t),
    [`${e}-loading`]: xne(t),
    [`${e}-rtl`]: {
      direction: "rtl"
    }
  };
}, Sne = (t) => {
  const {
    componentCls: e,
    cardPaddingSM: n,
    cardHeadHeightSM: i
  } = t;
  return {
    [`${e}-small`]: {
      [`> ${e}-head`]: {
        minHeight: i,
        padding: `0 ${n}px`,
        fontSize: t.fontSize,
        [`> ${e}-head-wrapper`]: {
          [`> ${e}-extra`]: {
            fontSize: t.fontSize
          }
        }
      },
      [`> ${e}-body`]: {
        padding: n
      }
    },
    [`${e}-small${e}-contain-tabs`]: {
      [`> ${e}-head`]: {
        [`${e}-head-title, ${e}-extra`]: {
          minHeight: i,
          paddingTop: 0,
          display: "flex",
          alignItems: "center"
        }
      }
    }
  };
}, wne = Vn("Card", (t) => {
  const e = dn(t, {
    cardShadow: t.boxShadowCard,
    cardHeadHeight: t.fontSizeLG * t.lineHeightLG + t.padding * 2,
    cardHeadHeightSM: t.fontSize * t.lineHeight + t.paddingXS * 2,
    cardHeadPadding: t.padding,
    cardPaddingBase: t.paddingLG,
    cardHeadTabsMarginBottom: -t.padding - t.lineWidth,
    cardActionsLiMargin: `${t.paddingSM}px 0`,
    cardActionsIconSize: t.fontSize,
    cardPaddingSM: 12
    // Fixed padding.
  });
  return [
    // Style
    One(e),
    // Size
    Sne(e)
  ];
}), Cne = () => ({
  prefixCls: String,
  width: {
    type: [Number, String]
  }
}), v$ = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "SkeletonTitle",
  props: Cne(),
  setup(t) {
    return () => {
      const {
        prefixCls: e,
        width: n
      } = t, i = typeof n == "number" ? `${n}px` : n;
      return v("h3", {
        class: e,
        style: {
          width: i
        }
      }, null);
    };
  }
}), $ne = () => ({
  prefixCls: String,
  width: {
    type: [Number, String, Array]
  },
  rows: Number
}), kne = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "SkeletonParagraph",
  props: $ne(),
  setup(t) {
    const e = (n) => {
      const {
        width: i,
        rows: o = 2
      } = t;
      if (Array.isArray(i))
        return i[n];
      if (o - 1 === n)
        return i;
    };
    return () => {
      const {
        prefixCls: n,
        rows: i
      } = t, o = [...Array(i)].map((r, a) => {
        const l = e(a);
        return v("li", {
          key: a,
          style: {
            width: typeof l == "number" ? `${l}px` : l
          }
        }, null);
      });
      return v("ul", {
        class: n
      }, [o]);
    };
  }
}), Ey = () => ({
  prefixCls: String,
  size: [String, Number],
  shape: String,
  active: {
    type: Boolean,
    default: void 0
  }
}), xg = (t) => {
  const {
    prefixCls: e,
    size: n,
    shape: i
  } = t, o = Ae({
    [`${e}-lg`]: n === "large",
    [`${e}-sm`]: n === "small"
  }), r = Ae({
    [`${e}-circle`]: i === "circle",
    [`${e}-square`]: i === "square",
    [`${e}-round`]: i === "round"
  }), a = typeof n == "number" ? {
    width: `${n}px`,
    height: `${n}px`,
    lineHeight: `${n}px`
  } : {};
  return v("span", {
    class: Ae(e, o, r),
    style: a
  }, null);
};
xg.displayName = "SkeletonElement";
const Tne = new gn("ant-skeleton-loading", {
  "0%": {
    transform: "translateX(-37.5%)"
  },
  "100%": {
    transform: "translateX(37.5%)"
  }
}), _y = (t) => ({
  height: t,
  lineHeight: `${t}px`
}), cf = (t) => k({
  width: t
}, _y(t)), Pne = (t) => ({
  position: "relative",
  // fix https://github.com/ant-design/ant-design/issues/36444
  // https://monshin.github.io/202109/css/safari-border-radius-overflow-hidden/
  /* stylelint-disable-next-line property-no-vendor-prefix,value-no-vendor-prefix */
  zIndex: 0,
  overflow: "hidden",
  background: "transparent",
  "&::after": {
    position: "absolute",
    top: 0,
    insetInlineEnd: "-150%",
    bottom: 0,
    insetInlineStart: "-150%",
    background: t.skeletonLoadingBackground,
    animationName: Tne,
    animationDuration: t.skeletonLoadingMotionDuration,
    animationTimingFunction: "ease",
    animationIterationCount: "infinite",
    content: '""'
  }
}), l1 = (t) => k({
  width: t * 5,
  minWidth: t * 5
}, _y(t)), Ene = (t) => {
  const {
    skeletonAvatarCls: e,
    color: n,
    controlHeight: i,
    controlHeightLG: o,
    controlHeightSM: r
  } = t;
  return {
    [`${e}`]: k({
      display: "inline-block",
      verticalAlign: "top",
      background: n
    }, cf(i)),
    [`${e}${e}-circle`]: {
      borderRadius: "50%"
    },
    [`${e}${e}-lg`]: k({}, cf(o)),
    [`${e}${e}-sm`]: k({}, cf(r))
  };
}, _ne = (t) => {
  const {
    controlHeight: e,
    borderRadiusSM: n,
    skeletonInputCls: i,
    controlHeightLG: o,
    controlHeightSM: r,
    color: a
  } = t;
  return {
    [`${i}`]: k({
      display: "inline-block",
      verticalAlign: "top",
      background: a,
      borderRadius: n
    }, l1(e)),
    [`${i}-lg`]: k({}, l1(o)),
    [`${i}-sm`]: k({}, l1(r))
  };
}, mE = (t) => k({
  width: t
}, _y(t)), Ine = (t) => {
  const {
    skeletonImageCls: e,
    imageSizeBase: n,
    color: i,
    borderRadiusSM: o
  } = t;
  return {
    [`${e}`]: k(k({
      display: "flex",
      alignItems: "center",
      justifyContent: "center",
      verticalAlign: "top",
      background: i,
      borderRadius: o
    }, mE(n * 2)), {
      [`${e}-path`]: {
        fill: "#bfbfbf"
      },
      [`${e}-svg`]: k(k({}, mE(n)), {
        maxWidth: n * 4,
        maxHeight: n * 4
      }),
      [`${e}-svg${e}-svg-circle`]: {
        borderRadius: "50%"
      }
    }),
    [`${e}${e}-circle`]: {
      borderRadius: "50%"
    }
  };
}, s1 = (t, e, n) => {
  const {
    skeletonButtonCls: i
  } = t;
  return {
    [`${n}${i}-circle`]: {
      width: e,
      minWidth: e,
      borderRadius: "50%"
    },
    [`${n}${i}-round`]: {
      borderRadius: e
    }
  };
}, u1 = (t) => k({
  width: t * 2,
  minWidth: t * 2
}, _y(t)), Mne = (t) => {
  const {
    borderRadiusSM: e,
    skeletonButtonCls: n,
    controlHeight: i,
    controlHeightLG: o,
    controlHeightSM: r,
    color: a
  } = t;
  return k(k(k(k(k({
    [`${n}`]: k({
      display: "inline-block",
      verticalAlign: "top",
      background: a,
      borderRadius: e,
      width: i * 2,
      minWidth: i * 2
    }, u1(i))
  }, s1(t, i, n)), {
    [`${n}-lg`]: k({}, u1(o))
  }), s1(t, o, `${n}-lg`)), {
    [`${n}-sm`]: k({}, u1(r))
  }), s1(t, r, `${n}-sm`));
}, Ane = (t) => {
  const {
    componentCls: e,
    skeletonAvatarCls: n,
    skeletonTitleCls: i,
    skeletonParagraphCls: o,
    skeletonButtonCls: r,
    skeletonInputCls: a,
    skeletonImageCls: l,
    controlHeight: s,
    controlHeightLG: u,
    controlHeightSM: c,
    color: d,
    padding: f,
    marginSM: h,
    borderRadius: p,
    skeletonTitleHeight: g,
    skeletonBlockRadius: m,
    skeletonParagraphLineHeight: y,
    controlHeightXS: b,
    skeletonParagraphMarginTop: w
  } = t;
  return {
    [`${e}`]: {
      display: "table",
      width: "100%",
      [`${e}-header`]: {
        display: "table-cell",
        paddingInlineEnd: f,
        verticalAlign: "top",
        // Avatar
        [`${n}`]: k({
          display: "inline-block",
          verticalAlign: "top",
          background: d
        }, cf(s)),
        [`${n}-circle`]: {
          borderRadius: "50%"
        },
        [`${n}-lg`]: k({}, cf(u)),
        [`${n}-sm`]: k({}, cf(c))
      },
      [`${e}-content`]: {
        display: "table-cell",
        width: "100%",
        verticalAlign: "top",
        // Title
        [`${i}`]: {
          width: "100%",
          height: g,
          background: d,
          borderRadius: m,
          [`+ ${o}`]: {
            marginBlockStart: c
          }
        },
        // paragraph
        [`${o}`]: {
          padding: 0,
          "> li": {
            width: "100%",
            height: y,
            listStyle: "none",
            background: d,
            borderRadius: m,
            "+ li": {
              marginBlockStart: b
            }
          }
        },
        [`${o}> li:last-child:not(:first-child):not(:nth-child(2))`]: {
          width: "61%"
        }
      },
      [`&-round ${e}-content`]: {
        [`${i}, ${o} > li`]: {
          borderRadius: p
        }
      }
    },
    [`${e}-with-avatar ${e}-content`]: {
      // Title
      [`${i}`]: {
        marginBlockStart: h,
        [`+ ${o}`]: {
          marginBlockStart: w
        }
      }
    },
    // Skeleton element
    [`${e}${e}-element`]: k(k(k(k({
      display: "inline-block",
      width: "auto"
    }, Mne(t)), Ene(t)), _ne(t)), Ine(t)),
    // Skeleton Block Button, Input
    [`${e}${e}-block`]: {
      width: "100%",
      [`${r}`]: {
        width: "100%"
      },
      [`${a}`]: {
        width: "100%"
      }
    },
    // With active animation
    [`${e}${e}-active`]: {
      [`
        ${i},
        ${o} > li,
        ${n},
        ${r},
        ${a},
        ${l}
      `]: k({}, Pne(t))
    }
  };
}, Og = Vn("Skeleton", (t) => {
  const {
    componentCls: e
  } = t, n = dn(t, {
    skeletonAvatarCls: `${e}-avatar`,
    skeletonTitleCls: `${e}-title`,
    skeletonParagraphCls: `${e}-paragraph`,
    skeletonButtonCls: `${e}-button`,
    skeletonInputCls: `${e}-input`,
    skeletonImageCls: `${e}-image`,
    imageSizeBase: t.controlHeight * 1.5,
    skeletonTitleHeight: t.controlHeight / 2,
    skeletonBlockRadius: t.borderRadiusSM,
    skeletonParagraphLineHeight: t.controlHeight / 2,
    skeletonParagraphMarginTop: t.marginLG + t.marginXXS,
    borderRadius: 100,
    skeletonLoadingBackground: `linear-gradient(90deg, ${t.color} 25%, ${t.colorGradientEnd} 37%, ${t.color} 63%)`,
    skeletonLoadingMotionDuration: "1.4s"
  });
  return [Ane(n)];
}, (t) => {
  const {
    colorFillContent: e,
    colorFill: n
  } = t;
  return {
    color: e,
    colorGradientEnd: n
  };
}), Rne = () => ({
  active: {
    type: Boolean,
    default: void 0
  },
  loading: {
    type: Boolean,
    default: void 0
  },
  prefixCls: String,
  avatar: {
    type: [Boolean, Object],
    default: void 0
  },
  title: {
    type: [Boolean, Object],
    default: void 0
  },
  paragraph: {
    type: [Boolean, Object],
    default: void 0
  },
  round: {
    type: Boolean,
    default: void 0
  }
});
function c1(t) {
  return t && typeof t == "object" ? t : {};
}
function Dne(t, e) {
  return t && !e ? {
    size: "large",
    shape: "square"
  } : {
    size: "large",
    shape: "circle"
  };
}
function Nne(t, e) {
  return !t && e ? {
    width: "38%"
  } : t && e ? {
    width: "50%"
  } : {};
}
function Lne(t, e) {
  const n = {};
  return (!t || !e) && (n.width = "61%"), !t && e ? n.rows = 3 : n.rows = 2, n;
}
const gr = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ASkeleton",
  props: Kn(Rne(), {
    avatar: !1,
    title: !0,
    paragraph: !0
  }),
  setup(t, e) {
    let {
      slots: n
    } = e;
    const {
      prefixCls: i,
      direction: o
    } = Ht("skeleton", t), [r, a] = Og(i);
    return () => {
      var l;
      const {
        loading: s,
        avatar: u,
        title: c,
        paragraph: d,
        active: f,
        round: h
      } = t, p = i.value;
      if (s || t.loading === void 0) {
        const g = !!u || u === "", m = !!c || c === "", y = !!d || d === "";
        let b;
        if (g) {
          const C = k(k({
            prefixCls: `${p}-avatar`
          }, Dne(m, y)), c1(u));
          b = v("div", {
            class: `${p}-header`
          }, [v(xg, C, null)]);
        }
        let w;
        if (m || y) {
          let C;
          if (m) {
            const O = k(k({
              prefixCls: `${p}-title`
            }, Nne(g, y)), c1(c));
            C = v(v$, O, null);
          }
          let P;
          if (y) {
            const O = k(k({
              prefixCls: `${p}-paragraph`
            }, Lne(g, m)), c1(d));
            P = v(kne, O, null);
          }
          w = v("div", {
            class: `${p}-content`
          }, [C, P]);
        }
        const $ = Ae(p, {
          [`${p}-with-avatar`]: g,
          [`${p}-active`]: f,
          [`${p}-rtl`]: o.value === "rtl",
          [`${p}-round`]: h,
          [a.value]: !0
        });
        return r(v("div", {
          class: $
        }, [b, w]));
      }
      return (l = n.default) === null || l === void 0 ? void 0 : l.call(n);
    };
  }
}), zne = () => k(k({}, Ey()), {
  size: String,
  block: Boolean
}), R5 = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ASkeletonButton",
  props: Kn(zne(), {
    size: "default"
  }),
  setup(t) {
    const {
      prefixCls: e
    } = Ht("skeleton", t), [n, i] = Og(e), o = A(() => Ae(e.value, `${e.value}-element`, {
      [`${e.value}-active`]: t.active,
      [`${e.value}-block`]: t.block
    }, i.value));
    return () => n(v("div", {
      class: o.value
    }, [v(xg, J(J({}, t), {}, {
      prefixCls: `${e.value}-button`
    }), null)]));
  }
}), D5 = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ASkeletonInput",
  props: k(k({}, ii(Ey(), ["shape"])), {
    size: String,
    block: Boolean
  }),
  setup(t) {
    const {
      prefixCls: e
    } = Ht("skeleton", t), [n, i] = Og(e), o = A(() => Ae(e.value, `${e.value}-element`, {
      [`${e.value}-active`]: t.active,
      [`${e.value}-block`]: t.block
    }, i.value));
    return () => n(v("div", {
      class: o.value
    }, [v(xg, J(J({}, t), {}, {
      prefixCls: `${e.value}-input`
    }), null)]));
  }
}), Bne = "M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z", N5 = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ASkeletonImage",
  props: ii(Ey(), ["size", "shape", "active"]),
  setup(t) {
    const {
      prefixCls: e
    } = Ht("skeleton", t), [n, i] = Og(e), o = A(() => Ae(e.value, `${e.value}-element`, i.value));
    return () => n(v("div", {
      class: o.value
    }, [v("div", {
      class: `${e.value}-image`
    }, [v("svg", {
      viewBox: "0 0 1098 1024",
      xmlns: "http://www.w3.org/2000/svg",
      class: `${e.value}-image-svg`
    }, [v("path", {
      d: Bne,
      class: `${e.value}-image-path`
    }, null)])])]));
  }
}), Fne = () => k(k({}, Ey()), {
  shape: String
}), L5 = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ASkeletonAvatar",
  props: Kn(Fne(), {
    size: "default",
    shape: "circle"
  }),
  setup(t) {
    const {
      prefixCls: e
    } = Ht("skeleton", t), [n, i] = Og(e), o = A(() => Ae(e.value, `${e.value}-element`, {
      [`${e.value}-active`]: t.active
    }, i.value));
    return () => n(v("div", {
      class: o.value
    }, [v(xg, J(J({}, t), {}, {
      prefixCls: `${e.value}-avatar`
    }), null)]));
  }
});
gr.Button = R5;
gr.Avatar = L5;
gr.Input = D5;
gr.Image = N5;
gr.Title = v$;
gr.install = function(t) {
  return t.component(gr.name, gr), t.component(gr.Button.name, R5), t.component(gr.Avatar.name, L5), t.component(gr.Input.name, D5), t.component(gr.Image.name, N5), t.component(gr.Title.name, v$), t;
};
const {
  TabPane: Vne
} = uf, Qne = () => ({
  prefixCls: String,
  title: ve.any,
  extra: ve.any,
  bordered: {
    type: Boolean,
    default: !0
  },
  bodyStyle: {
    type: Object,
    default: void 0
  },
  headStyle: {
    type: Object,
    default: void 0
  },
  loading: {
    type: Boolean,
    default: !1
  },
  hoverable: {
    type: Boolean,
    default: !1
  },
  type: {
    type: String
  },
  size: {
    type: String
  },
  actions: ve.any,
  tabList: {
    type: Array
  },
  tabBarExtraContent: ve.any,
  activeTabKey: String,
  defaultActiveTabKey: String,
  cover: ve.any,
  onTabChange: {
    type: Function
  }
}), df = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ACard",
  inheritAttrs: !1,
  props: Qne(),
  slots: Object,
  setup(t, e) {
    let {
      slots: n,
      attrs: i
    } = e;
    const {
      prefixCls: o,
      direction: r,
      size: a
    } = Ht("card", t), [l, s] = wne(o), u = (f) => f.map((p, g) => or(p) && !iy(p) || !or(p) ? v("li", {
      style: {
        width: `${100 / f.length}%`
      },
      key: `action-${g}`
    }, [v("span", null, [p])]) : null), c = (f) => {
      var h;
      (h = t.onTabChange) === null || h === void 0 || h.call(t, f);
    }, d = function() {
      let f = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], h;
      return f.forEach((p) => {
        p && EA(p.type) && p.type.__ANT_CARD_GRID && (h = !0);
      }), h;
    };
    return () => {
      var f, h, p, g, m, y;
      const {
        headStyle: b = {},
        bodyStyle: w = {},
        loading: $,
        bordered: C = !0,
        type: P,
        tabList: O,
        hoverable: E,
        activeTabKey: _,
        defaultActiveTabKey: D,
        tabBarExtraContent: M = Ph((f = n.tabBarExtraContent) === null || f === void 0 ? void 0 : f.call(n)),
        title: N = Ph((h = n.title) === null || h === void 0 ? void 0 : h.call(n)),
        extra: L = Ph((p = n.extra) === null || p === void 0 ? void 0 : p.call(n)),
        actions: j = Ph((g = n.actions) === null || g === void 0 ? void 0 : g.call(n)),
        cover: B = Ph((m = n.cover) === null || m === void 0 ? void 0 : m.call(n))
      } = t, Y = Wi((y = n.default) === null || y === void 0 ? void 0 : y.call(n)), Q = o.value, G = {
        [`${Q}`]: !0,
        [s.value]: !0,
        [`${Q}-loading`]: $,
        [`${Q}-bordered`]: C,
        [`${Q}-hoverable`]: !!E,
        [`${Q}-contain-grid`]: d(Y),
        [`${Q}-contain-tabs`]: O && O.length,
        [`${Q}-${a.value}`]: a.value,
        [`${Q}-type-${P}`]: !!P,
        [`${Q}-rtl`]: r.value === "rtl"
      }, V = v(gr, {
        loading: !0,
        active: !0,
        paragraph: {
          rows: 4
        },
        title: !1
      }, {
        default: () => [Y]
      }), H = _ !== void 0, q = {
        size: "large",
        [H ? "activeKey" : "defaultActiveKey"]: H ? _ : D,
        onChange: c,
        class: `${Q}-head-tabs`
      };
      let K;
      const ee = O && O.length ? v(uf, q, {
        default: () => [O.map((U) => {
          const {
            tab: me,
            slots: ce
          } = U, ue = ce?.tab;
          $n(!ce, "Card", "tabList slots is deprecated, Please use `customTab` instead.");
          let fe = me !== void 0 ? me : n[ue] ? n[ue](U) : null;
          return fe = fy(n, "customTab", U, () => [fe]), v(Vne, {
            tab: fe,
            key: U.key,
            disabled: U.disabled
          }, null);
        })],
        rightExtra: M ? () => M : null
      }) : null;
      (N || L || ee) && (K = v("div", {
        class: `${Q}-head`,
        style: b
      }, [v("div", {
        class: `${Q}-head-wrapper`
      }, [N && v("div", {
        class: `${Q}-head-title`
      }, [N]), L && v("div", {
        class: `${Q}-extra`
      }, [L])]), ee]));
      const ie = B ? v("div", {
        class: `${Q}-cover`
      }, [B]) : null, ae = v("div", {
        class: `${Q}-body`,
        style: w
      }, [$ ? V : Y]), te = j && j.length ? v("ul", {
        class: `${Q}-actions`
      }, [u(j)]) : null;
      return l(v("div", J(J({
        ref: "cardContainerRef"
      }, i), {}, {
        class: [G, i.class]
      }), [K, ie, Y && Y.length ? ae : null, te]));
    };
  }
}), Hne = () => ({
  prefixCls: String,
  title: Rb(),
  description: Rb(),
  avatar: Rb()
}), MO = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ACardMeta",
  props: Hne(),
  slots: Object,
  setup(t, e) {
    let {
      slots: n
    } = e;
    const {
      prefixCls: i
    } = Ht("card", t);
    return () => {
      const o = {
        [`${i.value}-meta`]: !0
      }, r = ca(n, t, "avatar"), a = ca(n, t, "title"), l = ca(n, t, "description"), s = r ? v("div", {
        class: `${i.value}-meta-avatar`
      }, [r]) : null, u = a ? v("div", {
        class: `${i.value}-meta-title`
      }, [a]) : null, c = l ? v("div", {
        class: `${i.value}-meta-description`
      }, [l]) : null, d = u || c ? v("div", {
        class: `${i.value}-meta-detail`
      }, [u, c]) : null;
      return v("div", {
        class: o
      }, [s, d]);
    };
  }
}), Wne = () => ({
  prefixCls: String,
  hoverable: {
    type: Boolean,
    default: !0
  }
}), AO = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ACardGrid",
  __ANT_CARD_GRID: !0,
  props: Wne(),
  setup(t, e) {
    let {
      slots: n
    } = e;
    const {
      prefixCls: i
    } = Ht("card", t), o = A(() => ({
      [`${i.value}-grid`]: !0,
      [`${i.value}-grid-hoverable`]: t.hoverable
    }));
    return () => {
      var r;
      return v("div", {
        class: o.value
      }, [(r = n.default) === null || r === void 0 ? void 0 : r.call(n)]);
    };
  }
});
df.Meta = MO;
df.Grid = AO;
df.install = function(t) {
  return t.component(df.name, df), t.component(MO.name, MO), t.component(AO.name, AO), t;
};
const jne = () => ({
  prefixCls: String,
  activeKey: pn([Array, Number, String]),
  defaultActiveKey: pn([Array, Number, String]),
  accordion: pt(),
  destroyInactivePanel: pt(),
  bordered: pt(),
  expandIcon: ot(),
  openAnimation: ve.object,
  expandIconPosition: yn(),
  collapsible: yn(),
  ghost: pt(),
  onChange: ot(),
  "onUpdate:activeKey": ot()
}), z5 = () => ({
  openAnimation: ve.object,
  prefixCls: String,
  header: ve.any,
  headerClass: String,
  showArrow: pt(),
  isActive: pt(),
  destroyInactivePanel: pt(),
  /** @deprecated Use `collapsible="disabled"` instead */
  disabled: pt(),
  accordion: pt(),
  forceRender: pt(),
  expandIcon: ot(),
  extra: ve.any,
  panelKey: pn(),
  collapsible: yn(),
  role: String,
  onItemClick: ot()
}), qne = (t) => {
  const {
    componentCls: e,
    collapseContentBg: n,
    padding: i,
    collapseContentPaddingHorizontal: o,
    collapseHeaderBg: r,
    collapseHeaderPadding: a,
    collapsePanelBorderRadius: l,
    lineWidth: s,
    lineType: u,
    colorBorder: c,
    colorText: d,
    colorTextHeading: f,
    colorTextDisabled: h,
    fontSize: p,
    lineHeight: g,
    marginSM: m,
    paddingSM: y,
    motionDurationSlow: b,
    fontSizeIcon: w
  } = t, $ = `${s}px ${u} ${c}`;
  return {
    [e]: k(k({}, kn(t)), {
      backgroundColor: r,
      border: $,
      borderBottom: 0,
      borderRadius: `${l}px`,
      "&-rtl": {
        direction: "rtl"
      },
      [`& > ${e}-item`]: {
        borderBottom: $,
        "&:last-child": {
          [`
            &,
            & > ${e}-header`]: {
            borderRadius: `0 0 ${l}px ${l}px`
          }
        },
        [`> ${e}-header`]: {
          position: "relative",
          display: "flex",
          flexWrap: "nowrap",
          alignItems: "flex-start",
          padding: a,
          color: f,
          lineHeight: g,
          cursor: "pointer",
          transition: `all ${b}, visibility 0s`,
          [`> ${e}-header-text`]: {
            flex: "auto"
          },
          "&:focus": {
            outline: "none"
          },
          // >>>>> Arrow
          [`${e}-expand-icon`]: {
            height: p * g,
            display: "flex",
            alignItems: "center",
            paddingInlineEnd: m
          },
          [`${e}-arrow`]: k(k({}, ah()), {
            fontSize: w,
            svg: {
              transition: `transform ${b}`
            }
          }),
          // >>>>> Text
          [`${e}-header-text`]: {
            marginInlineEnd: "auto"
          }
        },
        [`${e}-header-collapsible-only`]: {
          cursor: "default",
          [`${e}-header-text`]: {
            flex: "none",
            cursor: "pointer"
          },
          [`${e}-expand-icon`]: {
            cursor: "pointer"
          }
        },
        [`${e}-icon-collapsible-only`]: {
          cursor: "default",
          [`${e}-expand-icon`]: {
            cursor: "pointer"
          }
        },
        [`&${e}-no-arrow`]: {
          [`> ${e}-header`]: {
            paddingInlineStart: y
          }
        }
      },
      [`${e}-content`]: {
        color: d,
        backgroundColor: n,
        borderTop: $,
        [`& > ${e}-content-box`]: {
          padding: `${i}px ${o}px`
        },
        "&-hidden": {
          display: "none"
        }
      },
      [`${e}-item:last-child`]: {
        [`> ${e}-content`]: {
          borderRadius: `0 0 ${l}px ${l}px`
        }
      },
      [`& ${e}-item-disabled > ${e}-header`]: {
        "\n          &,\n          & > .arrow\n        ": {
          color: h,
          cursor: "not-allowed"
        }
      },
      // ========================== Icon Position ==========================
      [`&${e}-icon-position-end`]: {
        [`& > ${e}-item`]: {
          [`> ${e}-header`]: {
            [`${e}-expand-icon`]: {
              order: 1,
              paddingInlineEnd: 0,
              paddingInlineStart: m
            }
          }
        }
      }
    })
  };
}, Yne = (t) => {
  const {
    componentCls: e
  } = t, n = `> ${e}-item > ${e}-header ${e}-arrow svg`;
  return {
    [`${e}-rtl`]: {
      [n]: {
        transform: "rotate(180deg)"
      }
    }
  };
}, Kne = (t) => {
  const {
    componentCls: e,
    collapseHeaderBg: n,
    paddingXXS: i,
    colorBorder: o
  } = t;
  return {
    [`${e}-borderless`]: {
      backgroundColor: n,
      border: 0,
      [`> ${e}-item`]: {
        borderBottom: `1px solid ${o}`
      },
      [`
        > ${e}-item:last-child,
        > ${e}-item:last-child ${e}-header
      `]: {
        borderRadius: 0
      },
      [`> ${e}-item:last-child`]: {
        borderBottom: 0
      },
      [`> ${e}-item > ${e}-content`]: {
        backgroundColor: "transparent",
        borderTop: 0
      },
      [`> ${e}-item > ${e}-content > ${e}-content-box`]: {
        paddingTop: i
      }
    }
  };
}, Xne = (t) => {
  const {
    componentCls: e,
    paddingSM: n
  } = t;
  return {
    [`${e}-ghost`]: {
      backgroundColor: "transparent",
      border: 0,
      [`> ${e}-item`]: {
        borderBottom: 0,
        [`> ${e}-content`]: {
          backgroundColor: "transparent",
          border: 0,
          [`> ${e}-content-box`]: {
            paddingBlock: n
          }
        }
      }
    }
  };
}, Zne = Vn("Collapse", (t) => {
  const e = dn(t, {
    collapseContentBg: t.colorBgContainer,
    collapseHeaderBg: t.colorFillAlter,
    collapseHeaderPadding: `${t.paddingSM}px ${t.padding}px`,
    collapsePanelBorderRadius: t.borderRadiusLG,
    collapseContentPaddingHorizontal: 16
    // Fixed value
  });
  return [qne(e), Kne(e), Xne(e), Yne(e), Oy(e)];
});
function vE(t) {
  let e = t;
  if (!Array.isArray(e)) {
    const n = typeof e;
    e = n === "number" || n === "string" ? [e] : [];
  }
  return e.map((n) => String(n));
}
const Tu = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ACollapse",
  inheritAttrs: !1,
  props: Kn(jne(), {
    accordion: !1,
    destroyInactivePanel: !1,
    bordered: !0,
    expandIconPosition: "start"
  }),
  slots: Object,
  setup(t, e) {
    let {
      attrs: n,
      slots: i,
      emit: o
    } = e;
    const r = de(vE(Zv([t.activeKey, t.defaultActiveKey])));
    _e(() => t.activeKey, () => {
      r.value = vE(t.activeKey);
    }, {
      deep: !0
    });
    const {
      prefixCls: a,
      direction: l,
      rootPrefixCls: s
    } = Ht("collapse", t), [u, c] = Zne(a), d = A(() => {
      const {
        expandIconPosition: y
      } = t;
      return y !== void 0 ? y : l.value === "rtl" ? "end" : "start";
    }), f = (y) => {
      const {
        expandIcon: b = i.expandIcon
      } = t, w = b ? b(y) : v(Yc, {
        rotate: y.isActive ? 90 : void 0
      }, null);
      return v("div", {
        class: [`${a.value}-expand-icon`, c.value],
        onClick: () => ["header", "icon"].includes(t.collapsible) && p(y.panelKey)
      }, [po(Array.isArray(b) ? w[0] : w) ? vi(w, {
        class: `${a.value}-arrow`
      }, !1) : w]);
    }, h = (y) => {
      t.activeKey === void 0 && (r.value = y);
      const b = t.accordion ? y[0] : y;
      o("update:activeKey", b), o("change", b);
    }, p = (y) => {
      let b = r.value;
      if (t.accordion)
        b = b[0] === y ? [] : [y];
      else {
        b = [...b];
        const w = b.indexOf(y);
        w > -1 ? b.splice(w, 1) : b.push(y);
      }
      h(b);
    }, g = (y, b) => {
      var w, $, C;
      if (iy(y)) return;
      const P = r.value, {
        accordion: O,
        destroyInactivePanel: E,
        collapsible: _,
        openAnimation: D
      } = t, M = D || Sy(`${s.value}-motion-collapse`), N = String((w = y.key) !== null && w !== void 0 ? w : b), {
        header: L = (C = ($ = y.children) === null || $ === void 0 ? void 0 : $.header) === null || C === void 0 ? void 0 : C.call($),
        headerClass: j,
        collapsible: B,
        disabled: Y
      } = y.props || {};
      let Q = !1;
      O ? Q = P[0] === N : Q = P.indexOf(N) > -1;
      let G = B ?? _;
      (Y || Y === "") && (G = "disabled");
      const V = {
        key: N,
        panelKey: N,
        header: L,
        headerClass: j,
        isActive: Q,
        prefixCls: a.value,
        destroyInactivePanel: E,
        openAnimation: M,
        accordion: O,
        onItemClick: G === "disabled" ? null : p,
        expandIcon: f,
        collapsible: G
      };
      return vi(y, V);
    }, m = () => {
      var y;
      return Wi((y = i.default) === null || y === void 0 ? void 0 : y.call(i)).map(g);
    };
    return () => {
      const {
        accordion: y,
        bordered: b,
        ghost: w
      } = t, $ = Ae(a.value, {
        [`${a.value}-borderless`]: !b,
        [`${a.value}-icon-position-${d.value}`]: !0,
        [`${a.value}-rtl`]: l.value === "rtl",
        [`${a.value}-ghost`]: !!w,
        [n.class]: !!n.class
      }, c.value);
      return u(v("div", J(J({
        class: $
      }, oq(n)), {}, {
        style: n.style,
        role: y ? "tablist" : null
      }), [m()]));
    };
  }
}), Gne = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "PanelContent",
  props: z5(),
  setup(t, e) {
    let {
      slots: n
    } = e;
    const i = Te(!1);
    return zt(() => {
      (t.isActive || t.forceRender) && (i.value = !0);
    }), () => {
      var o;
      if (!i.value) return null;
      const {
        prefixCls: r,
        isActive: a,
        role: l
      } = t;
      return v("div", {
        class: Ae(`${r}-content`, {
          [`${r}-content-active`]: a,
          [`${r}-content-inactive`]: !a
        }),
        role: l
      }, [v("div", {
        class: `${r}-content-box`
      }, [(o = n.default) === null || o === void 0 ? void 0 : o.call(n)])]);
    };
  }
}), RO = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ACollapsePanel",
  inheritAttrs: !1,
  props: Kn(z5(), {
    showArrow: !0,
    isActive: !1,
    onItemClick() {
    },
    headerClass: "",
    forceRender: !1
  }),
  slots: Object,
  // emits: ['itemClick'],
  setup(t, e) {
    let {
      slots: n,
      emit: i,
      attrs: o
    } = e;
    $n(t.disabled === void 0, "Collapse.Panel", '`disabled` is deprecated. Please use `collapsible="disabled"` instead.');
    const {
      prefixCls: r
    } = Ht("collapse", t), a = () => {
      i("itemClick", t.panelKey);
    }, l = (s) => {
      (s.key === "Enter" || s.keyCode === 13 || s.which === 13) && a();
    };
    return () => {
      var s, u;
      const {
        header: c = (s = n.header) === null || s === void 0 ? void 0 : s.call(n),
        headerClass: d,
        isActive: f,
        showArrow: h,
        destroyInactivePanel: p,
        accordion: g,
        forceRender: m,
        openAnimation: y,
        expandIcon: b = n.expandIcon,
        extra: w = (u = n.extra) === null || u === void 0 ? void 0 : u.call(n),
        collapsible: $
      } = t, C = $ === "disabled", P = r.value, O = Ae(`${P}-header`, {
        [d]: d,
        [`${P}-header-collapsible-only`]: $ === "header",
        [`${P}-icon-collapsible-only`]: $ === "icon"
      }), E = Ae({
        [`${P}-item`]: !0,
        [`${P}-item-active`]: f,
        [`${P}-item-disabled`]: C,
        [`${P}-no-arrow`]: !h,
        [`${o.class}`]: !!o.class
      });
      let _ = v("i", {
        class: "arrow"
      }, null);
      h && typeof b == "function" && (_ = b(t));
      const D = fa(v(Gne, {
        prefixCls: P,
        isActive: f,
        forceRender: m,
        role: g ? "tabpanel" : null
      }, {
        default: n.default
      }), [[Qa, f]]), M = k({
        appear: !1,
        css: !1
      }, y);
      return v("div", J(J({}, o), {}, {
        class: E
      }), [v("div", {
        class: O,
        onClick: () => !["header", "icon"].includes($) && a(),
        role: g ? "tab" : "button",
        tabindex: C ? -1 : 0,
        "aria-expanded": f,
        onKeypress: l
      }, [h && _, v("span", {
        onClick: () => $ === "header" && a(),
        class: `${P}-header-text`
      }, [c]), w && v("div", {
        class: `${P}-extra`
      }, [w])]), v(zr, M, {
        default: () => [!p || f ? D : null]
      })]);
    };
  }
});
Tu.Panel = RO;
Tu.install = function(t) {
  return t.component(Tu.name, Tu), t.component(RO.name, RO), t;
};
const B5 = Symbol("TreeContextKey"), Une = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "TreeContext",
  props: {
    value: {
      type: Object
    }
  },
  setup(t, e) {
    let {
      slots: n
    } = e;
    return Xt(B5, A(() => t.value)), () => {
      var i;
      return (i = n.default) === null || i === void 0 ? void 0 : i.call(n);
    };
  }
}), y$ = () => qt(B5, A(() => ({}))), F5 = Symbol("KeysStateKey"), Jne = (t) => {
  Xt(F5, t);
}, V5 = () => qt(F5, {
  expandedKeys: Te([]),
  selectedKeys: Te([]),
  loadedKeys: Te([]),
  loadingKeys: Te([]),
  checkedKeys: Te([]),
  halfCheckedKeys: Te([]),
  expandedKeysSet: A(() => /* @__PURE__ */ new Set()),
  selectedKeysSet: A(() => /* @__PURE__ */ new Set()),
  loadedKeysSet: A(() => /* @__PURE__ */ new Set()),
  loadingKeysSet: A(() => /* @__PURE__ */ new Set()),
  checkedKeysSet: A(() => /* @__PURE__ */ new Set()),
  halfCheckedKeysSet: A(() => /* @__PURE__ */ new Set()),
  flattenNodes: Te([])
}), eie = (t) => {
  let {
    prefixCls: e,
    level: n,
    isStart: i,
    isEnd: o
  } = t;
  const r = `${e}-indent-unit`, a = [];
  for (let l = 0; l < n; l += 1)
    a.push(v("span", {
      key: l,
      class: {
        [r]: !0,
        [`${r}-start`]: i[l],
        [`${r}-end`]: o[l]
      }
    }, null));
  return v("span", {
    "aria-hidden": "true",
    class: `${e}-indent`
  }, [a]);
}, Q5 = {
  eventKey: [String, Number],
  prefixCls: String,
  // By parent
  // expanded: { type: Boolean, default: undefined },
  // selected: { type: Boolean, default: undefined },
  // checked: { type: Boolean, default: undefined },
  // loaded: { type: Boolean, default: undefined },
  // loading: { type: Boolean, default: undefined },
  // halfChecked: { type: Boolean, default: undefined },
  // dragOver: { type: Boolean, default: undefined },
  // dragOverGapTop: { type: Boolean, default: undefined },
  // dragOverGapBottom: { type: Boolean, default: undefined },
  // pos: String,
  title: ve.any,
  /** New added in Tree for easy data access */
  data: {
    type: Object,
    default: void 0
  },
  parent: {
    type: Object,
    default: void 0
  },
  isStart: {
    type: Array
  },
  isEnd: {
    type: Array
  },
  active: {
    type: Boolean,
    default: void 0
  },
  onMousemove: {
    type: Function
  },
  // By user
  isLeaf: {
    type: Boolean,
    default: void 0
  },
  checkable: {
    type: Boolean,
    default: void 0
  },
  selectable: {
    type: Boolean,
    default: void 0
  },
  disabled: {
    type: Boolean,
    default: void 0
  },
  disableCheckbox: {
    type: Boolean,
    default: void 0
  },
  icon: ve.any,
  switcherIcon: ve.any,
  domRef: {
    type: Function
  }
}, tie = {
  prefixCls: {
    type: String
  },
  // data: { type: Array as PropType<FlattenNode[]> },
  motion: {
    type: Object
  },
  focusable: {
    type: Boolean
  },
  activeItem: {
    type: Object
  },
  focused: {
    type: Boolean
  },
  tabindex: {
    type: Number
  },
  checkable: {
    type: Boolean
  },
  selectable: {
    type: Boolean
  },
  disabled: {
    type: Boolean
  },
  // expandedKeys: { type: Array as PropType<Key[]> },
  // selectedKeys: { type: Array as PropType<Key[]> },
  // checkedKeys: { type: Array as PropType<Key[]> },
  // loadedKeys: { type: Array as PropType<Key[]> },
  // loadingKeys: { type: Array as PropType<Key[]> },
  // halfCheckedKeys: { type: Array as PropType<Key[]> },
  // keyEntities: { type: Object as PropType<Record<Key, DataEntity<DataNode>>> },
  // dragging: { type: Boolean as PropType<boolean> },
  // dragOverNodeKey: { type: [String, Number] as PropType<Key> },
  // dropPosition: { type: Number as PropType<number> },
  // Virtual list
  height: {
    type: Number
  },
  itemHeight: {
    type: Number
  },
  virtual: {
    type: Boolean
  },
  onScroll: {
    type: Function
  },
  onKeydown: {
    type: Function
  },
  onFocus: {
    type: Function
  },
  onBlur: {
    type: Function
  },
  onActiveChange: {
    type: Function
  },
  onContextmenu: {
    type: Function
  },
  onListChangeStart: {
    type: Function
  },
  onListChangeEnd: {
    type: Function
  }
}, H5 = () => ({
  prefixCls: String,
  focusable: {
    type: Boolean,
    default: void 0
  },
  activeKey: [Number, String],
  tabindex: Number,
  children: ve.any,
  treeData: {
    type: Array
  },
  fieldNames: {
    type: Object
  },
  showLine: {
    type: [Boolean, Object],
    default: void 0
  },
  showIcon: {
    type: Boolean,
    default: void 0
  },
  icon: ve.any,
  selectable: {
    type: Boolean,
    default: void 0
  },
  expandAction: [String, Boolean],
  disabled: {
    type: Boolean,
    default: void 0
  },
  multiple: {
    type: Boolean,
    default: void 0
  },
  checkable: {
    type: Boolean,
    default: void 0
  },
  checkStrictly: {
    type: Boolean,
    default: void 0
  },
  draggable: {
    type: [Function, Boolean]
  },
  defaultExpandParent: {
    type: Boolean,
    default: void 0
  },
  autoExpandParent: {
    type: Boolean,
    default: void 0
  },
  defaultExpandAll: {
    type: Boolean,
    default: void 0
  },
  defaultExpandedKeys: {
    type: Array
  },
  expandedKeys: {
    type: Array
  },
  defaultCheckedKeys: {
    type: Array
  },
  checkedKeys: {
    type: [Object, Array]
  },
  defaultSelectedKeys: {
    type: Array
  },
  selectedKeys: {
    type: Array
  },
  allowDrop: {
    type: Function
  },
  dropIndicatorRender: {
    type: Function
  },
  onFocus: {
    type: Function
  },
  onBlur: {
    type: Function
  },
  onKeydown: {
    type: Function
  },
  onContextmenu: {
    type: Function
  },
  onClick: {
    type: Function
  },
  onDblclick: {
    type: Function
  },
  onScroll: {
    type: Function
  },
  onExpand: {
    type: Function
  },
  onCheck: {
    type: Function
  },
  onSelect: {
    type: Function
  },
  onLoad: {
    type: Function
  },
  loadData: {
    type: Function
  },
  loadedKeys: {
    type: Array
  },
  onMouseenter: {
    type: Function
  },
  onMouseleave: {
    type: Function
  },
  onRightClick: {
    type: Function
  },
  onDragstart: {
    type: Function
  },
  onDragenter: {
    type: Function
  },
  onDragover: {
    type: Function
  },
  onDragleave: {
    type: Function
  },
  onDragend: {
    type: Function
  },
  onDrop: {
    type: Function
  },
  /**
   * Used for `rc-tree-select` only.
   * Do not use in your production code directly since this will be refactor.
   */
  onActiveChange: {
    type: Function
  },
  filterTreeNode: {
    type: Function
  },
  motion: ve.any,
  switcherIcon: ve.any,
  // Virtual List
  height: Number,
  itemHeight: Number,
  virtual: {
    type: Boolean,
    default: void 0
  },
  // direction for drag logic
  direction: {
    type: String
  },
  rootClassName: String,
  rootStyle: Object
});
var nie = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
const yE = "open", bE = "close", iie = "---", DO = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ATreeNode",
  inheritAttrs: !1,
  props: Q5,
  isTreeNode: 1,
  setup(t, e) {
    let {
      attrs: n,
      slots: i,
      expose: o
    } = e;
    Nn(!("slots" in t.data), `treeData slots is deprecated, please use ${Object.keys(t.data.slots || {}).map((Ce) => "`v-slot:" + Ce + "` ")}instead`);
    const r = Te(!1), a = y$(), {
      expandedKeysSet: l,
      selectedKeysSet: s,
      loadedKeysSet: u,
      loadingKeysSet: c,
      checkedKeysSet: d,
      halfCheckedKeysSet: f
    } = V5(), {
      dragOverNodeKey: h,
      dropPosition: p,
      keyEntities: g
    } = a.value, m = A(() => hv(t.eventKey, {
      expandedKeysSet: l.value,
      selectedKeysSet: s.value,
      loadedKeysSet: u.value,
      loadingKeysSet: c.value,
      checkedKeysSet: d.value,
      halfCheckedKeysSet: f.value,
      dragOverNodeKey: h,
      dropPosition: p,
      keyEntities: g
    })), y = Pa(() => m.value.expanded), b = Pa(() => m.value.selected), w = Pa(() => m.value.checked), $ = Pa(() => m.value.loaded), C = Pa(() => m.value.loading), P = Pa(() => m.value.halfChecked), O = Pa(() => m.value.dragOver), E = Pa(() => m.value.dragOverGapTop), _ = Pa(() => m.value.dragOverGapBottom), D = Pa(() => m.value.pos), M = Te(), N = A(() => {
      const {
        eventKey: Ce
      } = t, {
        keyEntities: $e
      } = a.value, {
        children: Le
      } = $e[Ce] || {};
      return !!(Le || []).length;
    }), L = A(() => {
      const {
        isLeaf: Ce
      } = t, {
        loadData: $e
      } = a.value, Le = N.value;
      return Ce === !1 ? !1 : Ce || !$e && !Le || $e && $.value && !Le;
    }), j = A(() => L.value ? null : y.value ? yE : bE), B = A(() => {
      const {
        disabled: Ce
      } = t, {
        disabled: $e
      } = a.value;
      return !!($e || Ce);
    }), Y = A(() => {
      const {
        checkable: Ce
      } = t, {
        checkable: $e
      } = a.value;
      return !$e || Ce === !1 ? !1 : $e;
    }), Q = A(() => {
      const {
        selectable: Ce
      } = t, {
        selectable: $e
      } = a.value;
      return typeof Ce == "boolean" ? Ce : $e;
    }), G = A(() => {
      const {
        data: Ce,
        active: $e,
        checkable: Le,
        disableCheckbox: Ke,
        disabled: qe,
        selectable: rt
      } = t;
      return k(k({
        active: $e,
        checkable: Le,
        disableCheckbox: Ke,
        disabled: qe,
        selectable: rt
      }, Ce), {
        dataRef: Ce,
        data: Ce,
        isLeaf: L.value,
        checked: w.value,
        expanded: y.value,
        loading: C.value,
        selected: b.value,
        halfChecked: P.value
      });
    }), V = sr(), H = A(() => {
      const {
        eventKey: Ce
      } = t, {
        keyEntities: $e
      } = a.value, {
        parent: Le
      } = $e[Ce] || {};
      return k(k({}, pv(k({}, t, m.value))), {
        parent: Le
      });
    }), q = Bn({
      eventData: H,
      eventKey: A(() => t.eventKey),
      selectHandle: M,
      pos: D,
      key: V.vnode.key
    });
    o(q);
    const K = (Ce) => {
      const {
        onNodeDoubleClick: $e
      } = a.value;
      $e(Ce, H.value);
    }, ee = (Ce) => {
      if (B.value) return;
      const {
        onNodeSelect: $e
      } = a.value;
      Ce.preventDefault(), $e(Ce, H.value);
    }, ie = (Ce) => {
      if (B.value) return;
      const {
        disableCheckbox: $e
      } = t, {
        onNodeCheck: Le
      } = a.value;
      if (!Y.value || $e) return;
      Ce.preventDefault();
      const Ke = !w.value;
      Le(Ce, H.value, Ke);
    }, ae = (Ce) => {
      const {
        onNodeClick: $e
      } = a.value;
      $e(Ce, H.value), Q.value ? ee(Ce) : ie(Ce);
    }, te = (Ce) => {
      const {
        onNodeMouseEnter: $e
      } = a.value;
      $e(Ce, H.value);
    }, U = (Ce) => {
      const {
        onNodeMouseLeave: $e
      } = a.value;
      $e(Ce, H.value);
    }, me = (Ce) => {
      const {
        onNodeContextMenu: $e
      } = a.value;
      $e(Ce, H.value);
    }, ce = (Ce) => {
      const {
        onNodeDragStart: $e
      } = a.value;
      Ce.stopPropagation(), r.value = !0, $e(Ce, q);
      try {
        Ce.dataTransfer.setData("text/plain", "");
      } catch {
      }
    }, ue = (Ce) => {
      const {
        onNodeDragEnter: $e
      } = a.value;
      Ce.preventDefault(), Ce.stopPropagation(), $e(Ce, q);
    }, fe = (Ce) => {
      const {
        onNodeDragOver: $e
      } = a.value;
      Ce.preventDefault(), Ce.stopPropagation(), $e(Ce, q);
    }, he = (Ce) => {
      const {
        onNodeDragLeave: $e
      } = a.value;
      Ce.stopPropagation(), $e(Ce, q);
    }, le = (Ce) => {
      const {
        onNodeDragEnd: $e
      } = a.value;
      Ce.stopPropagation(), r.value = !1, $e(Ce, q);
    }, ke = (Ce) => {
      const {
        onNodeDrop: $e
      } = a.value;
      Ce.preventDefault(), Ce.stopPropagation(), r.value = !1, $e(Ce, q);
    }, ze = (Ce) => {
      const {
        onNodeExpand: $e
      } = a.value;
      C.value || $e(Ce, H.value);
    }, Re = () => {
      const {
        data: Ce
      } = t, {
        draggable: $e
      } = a.value;
      return !!($e && (!$e.nodeDraggable || $e.nodeDraggable(Ce)));
    }, Ye = () => {
      const {
        draggable: Ce,
        prefixCls: $e
      } = a.value;
      return Ce && Ce?.icon ? v("span", {
        class: `${$e}-draggable-icon`
      }, [Ce.icon]) : null;
    }, Ne = () => {
      var Ce, $e, Le;
      const {
        switcherIcon: Ke = i.switcherIcon || ((Ce = a.value.slots) === null || Ce === void 0 ? void 0 : Ce[(Le = ($e = t.data) === null || $e === void 0 ? void 0 : $e.slots) === null || Le === void 0 ? void 0 : Le.switcherIcon])
      } = t, {
        switcherIcon: qe
      } = a.value, rt = Ke || qe;
      return typeof rt == "function" ? rt(G.value) : rt;
    }, Fe = () => {
      const {
        loadData: Ce,
        onNodeLoad: $e
      } = a.value;
      C.value || Ce && y.value && !L.value && !N.value && !$.value && $e(H.value);
    };
    Lt(() => {
      Fe();
    }), Ns(() => {
      Fe();
    });
    const We = () => {
      const {
        prefixCls: Ce
      } = a.value, $e = Ne();
      if (L.value)
        return $e !== !1 ? v("span", {
          class: Ae(`${Ce}-switcher`, `${Ce}-switcher-noop`)
        }, [$e]) : null;
      const Le = Ae(`${Ce}-switcher`, `${Ce}-switcher_${y.value ? yE : bE}`);
      return $e !== !1 ? v("span", {
        onClick: ze,
        class: Le
      }, [$e]) : null;
    }, nt = () => {
      var Ce, $e;
      const {
        disableCheckbox: Le
      } = t, {
        prefixCls: Ke
      } = a.value, qe = B.value;
      return Y.value ? v("span", {
        class: Ae(`${Ke}-checkbox`, w.value && `${Ke}-checkbox-checked`, !w.value && P.value && `${Ke}-checkbox-indeterminate`, (qe || Le) && `${Ke}-checkbox-disabled`),
        onClick: ie
      }, [($e = (Ce = a.value).customCheckable) === null || $e === void 0 ? void 0 : $e.call(Ce)]) : null;
    }, Qe = () => {
      const {
        prefixCls: Ce
      } = a.value;
      return v("span", {
        class: Ae(`${Ce}-iconEle`, `${Ce}-icon__${j.value || "docu"}`, C.value && `${Ce}-icon_loading`)
      }, null);
    }, Pe = () => {
      const {
        disabled: Ce,
        eventKey: $e
      } = t, {
        draggable: Le,
        dropLevelOffset: Ke,
        dropPosition: qe,
        prefixCls: rt,
        indent: De,
        dropIndicatorRender: Be,
        dragOverNodeKey: je,
        direction: at
      } = a.value;
      return !Ce && Le !== !1 && je === $e ? Be({
        dropPosition: qe,
        dropLevelOffset: Ke,
        indent: De,
        prefixCls: rt,
        direction: at
      }) : null;
    }, Ze = () => {
      var Ce, $e, Le, Ke, qe, rt;
      const {
        // title = slots.title ||
        //   context.value.slots?.[props.data?.slots?.title] ||
        //   context.value.slots?.title,
        // selected,
        icon: De = i.icon,
        // loading,
        data: Be
      } = t, je = i.title || ((Ce = a.value.slots) === null || Ce === void 0 ? void 0 : Ce[(Le = ($e = t.data) === null || $e === void 0 ? void 0 : $e.slots) === null || Le === void 0 ? void 0 : Le.title]) || ((Ke = a.value.slots) === null || Ke === void 0 ? void 0 : Ke.title) || t.title, {
        prefixCls: at,
        showIcon: mt,
        icon: st,
        loadData: gt
        // slots: contextSlots,
      } = a.value, Et = B.value, It = `${at}-node-content-wrapper`;
      let _t;
      if (mt) {
        const nn = De || ((qe = a.value.slots) === null || qe === void 0 ? void 0 : qe[(rt = Be?.slots) === null || rt === void 0 ? void 0 : rt.icon]) || st;
        _t = nn ? v("span", {
          class: Ae(`${at}-iconEle`, `${at}-icon__customize`)
        }, [typeof nn == "function" ? nn(G.value) : nn]) : Qe();
      } else gt && C.value && (_t = Qe());
      let wt;
      typeof je == "function" ? wt = je(G.value) : wt = je, wt = wt === void 0 ? iie : wt;
      const Nt = v("span", {
        class: `${at}-title`
      }, [wt]);
      return v("span", {
        ref: M,
        title: typeof je == "string" ? je : "",
        class: Ae(`${It}`, `${It}-${j.value || "normal"}`, !Et && (b.value || r.value) && `${at}-node-selected`),
        onMouseenter: te,
        onMouseleave: U,
        onContextmenu: me,
        onClick: ae,
        onDblclick: K
      }, [_t, Nt, Pe()]);
    };
    return () => {
      const Ce = k(k({}, t), n), {
        eventKey: $e,
        isLeaf: Le,
        isStart: Ke,
        isEnd: qe,
        domRef: rt,
        active: De,
        data: Be,
        onMousemove: je,
        selectable: at
      } = Ce, mt = nie(Ce, ["eventKey", "isLeaf", "isStart", "isEnd", "domRef", "active", "data", "onMousemove", "selectable"]), {
        prefixCls: st,
        filterTreeNode: gt,
        keyEntities: Et,
        dropContainerKey: It,
        dropTargetKey: _t,
        draggingNodeKey: wt
      } = a.value, Nt = B.value, nn = rd(mt, {
        aria: !0,
        data: !0
      }), {
        level: sn
      } = Et[$e] || {}, xn = qe[qe.length - 1], Pn = Re(), bt = !Nt && Pn, Xn = wt === $e, En = at !== void 0 ? {
        "aria-selected": !!at
      } : void 0;
      return v("div", J(J({
        ref: rt,
        class: Ae(n.class, `${st}-treenode`, {
          [`${st}-treenode-disabled`]: Nt,
          [`${st}-treenode-switcher-${y.value ? "open" : "close"}`]: !Le,
          [`${st}-treenode-checkbox-checked`]: w.value,
          [`${st}-treenode-checkbox-indeterminate`]: P.value,
          [`${st}-treenode-selected`]: b.value,
          [`${st}-treenode-loading`]: C.value,
          [`${st}-treenode-active`]: De,
          [`${st}-treenode-leaf-last`]: xn,
          [`${st}-treenode-draggable`]: bt,
          dragging: Xn,
          "drop-target": _t === $e,
          "drop-container": It === $e,
          "drag-over": !Nt && O.value,
          "drag-over-gap-top": !Nt && E.value,
          "drag-over-gap-bottom": !Nt && _.value,
          "filter-node": gt && gt(H.value)
        }),
        style: n.style,
        draggable: bt,
        "aria-grabbed": Xn,
        onDragstart: bt ? ce : void 0,
        onDragenter: Pn ? ue : void 0,
        onDragover: Pn ? fe : void 0,
        onDragleave: Pn ? he : void 0,
        onDrop: Pn ? ke : void 0,
        onDragend: Pn ? le : void 0,
        onMousemove: je
      }, En), nn), [v(eie, {
        prefixCls: st,
        level: sn,
        isStart: Ke,
        isEnd: qe
      }, null), Ye(), We(), nt(), Ze()]);
    };
  }
});
function dl(t, e) {
  if (!t) return [];
  const n = t.slice(), i = n.indexOf(e);
  return i >= 0 && n.splice(i, 1), n;
}
function es(t, e) {
  const n = (t || []).slice();
  return n.indexOf(e) === -1 && n.push(e), n;
}
function b$(t) {
  return t.split("-");
}
function W5(t, e) {
  return `${t}-${e}`;
}
function oie(t) {
  return t && t.type && t.type.isTreeNode;
}
function rie(t, e) {
  const n = [], i = e[t];
  function o() {
    (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []).forEach((a) => {
      let {
        key: l,
        children: s
      } = a;
      n.push(l), o(s);
    });
  }
  return o(i.children), n;
}
function aie(t) {
  if (t.parent) {
    const e = b$(t.pos);
    return Number(e[e.length - 1]) === t.parent.children.length - 1;
  }
  return !1;
}
function lie(t) {
  const e = b$(t.pos);
  return Number(e[e.length - 1]) === 0;
}
function xE(t, e, n, i, o, r, a, l, s, u) {
  var c;
  const {
    clientX: d,
    clientY: f
  } = t, {
    top: h,
    height: p
  } = t.target.getBoundingClientRect(), m = ((u === "rtl" ? -1 : 1) * ((o?.x || 0) - d) - 12) / i;
  let y = l[n.eventKey];
  if (f < h + p / 2) {
    const D = a.findIndex((L) => L.key === y.key), M = D <= 0 ? 0 : D - 1, N = a[M].key;
    y = l[N];
  }
  const b = y.key, w = y, $ = y.key;
  let C = 0, P = 0;
  if (!s.has(b))
    for (let D = 0; D < m && aie(y); D += 1)
      y = y.parent, P += 1;
  const O = e.eventData, E = y.node;
  let _ = !0;
  return lie(y) && y.level === 0 && f < h + p / 2 && r({
    dragNode: O,
    dropNode: E,
    dropPosition: -1
  }) && y.key === n.eventKey ? C = -1 : (w.children || []).length && s.has($) ? r({
    dragNode: O,
    dropNode: E,
    dropPosition: 0
  }) ? C = 0 : _ = !1 : P === 0 ? m > -1.5 ? r({
    dragNode: O,
    dropNode: E,
    dropPosition: 1
  }) ? C = 1 : _ = !1 : r({
    dragNode: O,
    dropNode: E,
    dropPosition: 0
  }) ? C = 0 : r({
    dragNode: O,
    dropNode: E,
    dropPosition: 1
  }) ? C = 1 : _ = !1 : r({
    dragNode: O,
    dropNode: E,
    dropPosition: 1
  }) ? C = 1 : _ = !1, {
    dropPosition: C,
    dropLevelOffset: P,
    dropTargetKey: y.key,
    dropTargetPos: y.pos,
    dragOverNodeKey: $,
    dropContainerKey: C === 0 ? null : ((c = y.parent) === null || c === void 0 ? void 0 : c.key) || null,
    dropAllowed: _
  };
}
function OE(t, e) {
  if (!t) return;
  const {
    multiple: n
  } = e;
  return n ? t.slice() : t.length ? [t[0]] : t;
}
function d1(t) {
  if (!t)
    return null;
  let e;
  if (Array.isArray(t))
    e = {
      checkedKeys: t,
      halfCheckedKeys: void 0
    };
  else if (typeof t == "object")
    e = {
      checkedKeys: t.checked || void 0,
      halfCheckedKeys: t.halfChecked || void 0
    };
  else
    return Nn(!1, "`checkedKeys` is not an array or an object"), null;
  return e;
}
function NO(t, e) {
  const n = /* @__PURE__ */ new Set();
  function i(o) {
    if (n.has(o)) return;
    const r = e[o];
    if (!r) return;
    n.add(o);
    const {
      parent: a,
      node: l
    } = r;
    l.disabled || a && i(a.key);
  }
  return (t || []).forEach((o) => {
    i(o);
  }), [...n];
}
var sie = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
function Sg(t, e) {
  return t ?? e;
}
function Iy(t) {
  const {
    title: e,
    _title: n,
    key: i,
    children: o
  } = t || {}, r = e || "title";
  return {
    title: r,
    _title: n || [r],
    key: i || "key",
    children: o || "children"
  };
}
function LO(t) {
  function e() {
    let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
    return ho(n).map((o) => {
      var r, a, l, s;
      if (!oie(o))
        return Nn(!o, "Tree/TreeNode can only accept TreeNode as children."), null;
      const u = o.children || {}, c = o.key, d = {};
      for (const [D, M] of Object.entries(o.props))
        d[sg(D)] = M;
      const {
        isLeaf: f,
        checkable: h,
        selectable: p,
        disabled: g,
        disableCheckbox: m
      } = d, y = {
        isLeaf: f || f === "" || void 0,
        checkable: h || h === "" || void 0,
        selectable: p || p === "" || void 0,
        disabled: g || g === "" || void 0,
        disableCheckbox: m || m === "" || void 0
      }, b = k(k({}, d), y), {
        title: w = (r = u.title) === null || r === void 0 ? void 0 : r.call(u, b),
        icon: $ = (a = u.icon) === null || a === void 0 ? void 0 : a.call(u, b),
        switcherIcon: C = (l = u.switcherIcon) === null || l === void 0 ? void 0 : l.call(u, b)
      } = d, P = sie(d, ["title", "icon", "switcherIcon"]), O = (s = u.default) === null || s === void 0 ? void 0 : s.call(u), E = k(k(k({}, P), {
        title: w,
        icon: $,
        switcherIcon: C,
        key: c,
        isLeaf: f
      }), y), _ = e(O);
      return _.length && (E.children = _), E;
    });
  }
  return e(t);
}
function uie(t, e, n) {
  const {
    _title: i,
    key: o,
    children: r
  } = Iy(n), a = new Set(e === !0 ? [] : e), l = [];
  function s(u) {
    let c = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;
    return u.map((d, f) => {
      const h = W5(c ? c.pos : "0", f), p = Sg(d[o], h);
      let g;
      for (let y = 0; y < i.length; y += 1) {
        const b = i[y];
        if (d[b] !== void 0) {
          g = d[b];
          break;
        }
      }
      const m = k(k({}, ii(d, [...i, o, r])), {
        title: g,
        key: p,
        parent: c,
        pos: h,
        children: null,
        data: d,
        isStart: [...c ? c.isStart : [], f === 0],
        isEnd: [...c ? c.isEnd : [], f === u.length - 1]
      });
      return l.push(m), e === !0 || a.has(p) ? m.children = s(d[r] || [], m) : m.children = [], m;
    });
  }
  return s(t), l;
}
function cie(t, e, n) {
  let i = {};
  typeof n == "object" ? i = n : i = {
    externalGetKey: n
  }, i = i || {};
  const {
    childrenPropName: o,
    externalGetKey: r,
    fieldNames: a
  } = i, {
    key: l,
    children: s
  } = Iy(a), u = o || s;
  let c;
  r ? typeof r == "string" ? c = (f) => f[r] : typeof r == "function" && (c = (f) => r(f)) : c = (f, h) => Sg(f[l], h);
  function d(f, h, p, g) {
    const m = f ? f[u] : t, y = f ? W5(p.pos, h) : "0", b = f ? [...g, f] : [];
    if (f) {
      const w = c(f, y), $ = {
        node: f,
        index: h,
        pos: y,
        key: w,
        parentPos: p.node ? p.pos : null,
        level: p.level + 1,
        nodes: b
      };
      e($);
    }
    m && m.forEach((w, $) => {
      d(w, $, {
        node: f,
        pos: y,
        level: p ? p.level + 1 : -1
      }, b);
    });
  }
  d(null);
}
function x$(t) {
  let {
    initWrapper: e,
    processEntity: n,
    onProcessFinished: i,
    externalGetKey: o,
    childrenPropName: r,
    fieldNames: a
  } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, l = arguments.length > 2 ? arguments[2] : void 0;
  const s = o || l, u = {}, c = {};
  let d = {
    posEntities: u,
    keyEntities: c
  };
  return e && (d = e(d) || d), cie(t, (f) => {
    const {
      node: h,
      index: p,
      pos: g,
      key: m,
      parentPos: y,
      level: b,
      nodes: w
    } = f, $ = {
      node: h,
      nodes: w,
      index: p,
      key: m,
      pos: g,
      level: b
    }, C = Sg(m, g);
    u[g] = $, c[C] = $, $.parent = u[y], $.parent && ($.parent.children = $.parent.children || [], $.parent.children.push($)), n && n($, d);
  }, {
    externalGetKey: s,
    childrenPropName: r,
    fieldNames: a
  }), i && i(d), d;
}
function hv(t, e) {
  let {
    expandedKeysSet: n,
    selectedKeysSet: i,
    loadedKeysSet: o,
    loadingKeysSet: r,
    checkedKeysSet: a,
    halfCheckedKeysSet: l,
    dragOverNodeKey: s,
    dropPosition: u,
    keyEntities: c
  } = e;
  const d = c[t];
  return {
    eventKey: t,
    expanded: n.has(t),
    selected: i.has(t),
    loaded: o.has(t),
    loading: r.has(t),
    checked: a.has(t),
    halfChecked: l.has(t),
    pos: String(d ? d.pos : ""),
    parent: d.parent,
    // [Legacy] Drag props
    // Since the interaction of drag is changed, the semantic of the props are
    // not accuracy, I think it should be finally removed
    dragOver: s === t && u === 0,
    dragOverGapTop: s === t && u === -1,
    dragOverGapBottom: s === t && u === 1
  };
}
function pv(t) {
  const {
    data: e,
    expanded: n,
    selected: i,
    checked: o,
    loaded: r,
    loading: a,
    halfChecked: l,
    dragOver: s,
    dragOverGapTop: u,
    dragOverGapBottom: c,
    pos: d,
    active: f,
    eventKey: h
  } = t, p = k(k({
    dataRef: e
  }, e), {
    expanded: n,
    selected: i,
    checked: o,
    loaded: r,
    loading: a,
    halfChecked: l,
    dragOver: s,
    dragOverGapTop: u,
    dragOverGapBottom: c,
    pos: d,
    active: f,
    eventKey: h,
    key: h
  });
  return "props" in p || Object.defineProperty(p, "props", {
    get() {
      return Nn(!1, "Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."), t;
    }
  }), p;
}
function j5(t, e) {
  const n = /* @__PURE__ */ new Set();
  return t.forEach((i) => {
    e.has(i) || n.add(i);
  }), n;
}
function die(t) {
  const {
    disabled: e,
    disableCheckbox: n,
    checkable: i
  } = t || {};
  return !!(e || n) || i === !1;
}
function fie(t, e, n, i) {
  const o = new Set(t), r = /* @__PURE__ */ new Set();
  for (let l = 0; l <= n; l += 1)
    (e.get(l) || /* @__PURE__ */ new Set()).forEach((u) => {
      const {
        key: c,
        node: d,
        children: f = []
      } = u;
      o.has(c) && !i(d) && f.filter((h) => !i(h.node)).forEach((h) => {
        o.add(h.key);
      });
    });
  const a = /* @__PURE__ */ new Set();
  for (let l = n; l >= 0; l -= 1)
    (e.get(l) || /* @__PURE__ */ new Set()).forEach((u) => {
      const {
        parent: c,
        node: d
      } = u;
      if (i(d) || !u.parent || a.has(u.parent.key))
        return;
      if (i(u.parent.node)) {
        a.add(c.key);
        return;
      }
      let f = !0, h = !1;
      (c.children || []).filter((p) => !i(p.node)).forEach((p) => {
        let {
          key: g
        } = p;
        const m = o.has(g);
        f && !m && (f = !1), !h && (m || r.has(g)) && (h = !0);
      }), f && o.add(c.key), h && r.add(c.key), a.add(c.key);
    });
  return {
    checkedKeys: Array.from(o),
    halfCheckedKeys: Array.from(j5(r, o))
  };
}
function hie(t, e, n, i, o) {
  const r = new Set(t);
  let a = new Set(e);
  for (let s = 0; s <= i; s += 1)
    (n.get(s) || /* @__PURE__ */ new Set()).forEach((c) => {
      const {
        key: d,
        node: f,
        children: h = []
      } = c;
      !r.has(d) && !a.has(d) && !o(f) && h.filter((p) => !o(p.node)).forEach((p) => {
        r.delete(p.key);
      });
    });
  a = /* @__PURE__ */ new Set();
  const l = /* @__PURE__ */ new Set();
  for (let s = i; s >= 0; s -= 1)
    (n.get(s) || /* @__PURE__ */ new Set()).forEach((c) => {
      const {
        parent: d,
        node: f
      } = c;
      if (o(f) || !c.parent || l.has(c.parent.key))
        return;
      if (o(c.parent.node)) {
        l.add(d.key);
        return;
      }
      let h = !0, p = !1;
      (d.children || []).filter((g) => !o(g.node)).forEach((g) => {
        let {
          key: m
        } = g;
        const y = r.has(m);
        h && !y && (h = !1), !p && (y || a.has(m)) && (p = !0);
      }), h || r.delete(d.key), p && a.add(d.key), l.add(d.key);
    });
  return {
    checkedKeys: Array.from(r),
    halfCheckedKeys: Array.from(j5(a, r))
  };
}
function ff(t, e, n, i, o, r) {
  const a = [];
  let l;
  r ? l = r : l = die;
  const s = new Set(t.filter((c) => {
    const d = !!n[c];
    return d || a.push(c), d;
  }));
  JD(!a.length, `Tree missing follow keys: ${a.slice(0, 100).map((c) => `'${c}'`).join(", ")}`);
  let u;
  return e === !0 ? u = fie(s, o, i, l) : u = hie(s, e.halfCheckedKeys, o, i, l), u;
}
function q5(t) {
  const e = de(0), n = Te();
  return zt(() => {
    const i = /* @__PURE__ */ new Map();
    let o = 0;
    const r = t.value || {};
    for (const a in r)
      if (Object.prototype.hasOwnProperty.call(r, a)) {
        const l = r[a], {
          level: s
        } = l;
        let u = i.get(s);
        u || (u = /* @__PURE__ */ new Set(), i.set(s, u)), u.add(l), o = Math.max(o, s);
      }
    e.value = o, n.value = i;
  }), {
    maxLevel: e,
    levelEntities: n
  };
}
var pie = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z" } }] }, name: "left", theme: "outlined" };
function SE(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(n);
    typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(n).filter(function(o) {
      return Object.getOwnPropertyDescriptor(n, o).enumerable;
    }))), i.forEach(function(o) {
      gie(t, o, n[o]);
    });
  }
  return t;
}
function gie(t, e, n) {
  return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
var o0 = function(e, n) {
  var i = SE({}, e, n.attrs);
  return v(bn, SE({}, i, {
    icon: pie
  }), null);
};
o0.displayName = "LeftOutlined";
o0.inheritAttrs = !1;
const Y5 = () => Or() && window.document.documentElement, K5 = (t) => {
  if (Or() && window.document.documentElement) {
    const e = Array.isArray(t) ? t : [t], {
      documentElement: n
    } = window.document;
    return e.some((i) => i in n.style);
  }
  return !1;
}, mie = (t, e) => {
  if (!K5(t))
    return !1;
  const n = document.createElement("div"), i = n.style[t];
  return n.style[t] = e, n.style[t] !== i;
};
function vie(t, e) {
  return !Array.isArray(t) && e !== void 0 ? mie(t, e) : K5(t);
}
let bm;
const yie = () => {
  if (!Y5())
    return !1;
  if (bm !== void 0)
    return bm;
  const t = document.createElement("div");
  return t.style.display = "flex", t.style.flexDirection = "column", t.style.rowGap = "1px", t.appendChild(document.createElement("div")), t.appendChild(document.createElement("div")), document.body.appendChild(t), bm = t.scrollHeight === 1, document.body.removeChild(t), bm;
}, X5 = (() => {
  const t = Te(!1);
  return Lt(() => {
    t.value = yie();
  }), t;
}), Z5 = Symbol("rowContextKey"), bie = (t) => {
  Xt(Z5, t);
}, xie = () => qt(Z5, {
  gutter: A(() => {
  }),
  wrap: A(() => {
  }),
  supportFlexGap: A(() => {
  })
}), Oie = (t) => {
  const {
    componentCls: e
  } = t;
  return {
    // Grid system
    [e]: {
      display: "flex",
      flexFlow: "row wrap",
      minWidth: 0,
      "&::before, &::after": {
        display: "flex"
      },
      "&-no-wrap": {
        flexWrap: "nowrap"
      },
      // The origin of the X-axis
      "&-start": {
        justifyContent: "flex-start"
      },
      // The center of the X-axis
      "&-center": {
        justifyContent: "center"
      },
      // The opposite of the X-axis
      "&-end": {
        justifyContent: "flex-end"
      },
      "&-space-between": {
        justifyContent: "space-between"
      },
      "&-space-around ": {
        justifyContent: "space-around"
      },
      "&-space-evenly ": {
        justifyContent: "space-evenly"
      },
      // Align at the top
      "&-top": {
        alignItems: "flex-start"
      },
      // Align at the center
      "&-middle": {
        alignItems: "center"
      },
      "&-bottom": {
        alignItems: "flex-end"
      }
    }
  };
}, Sie = (t) => {
  const {
    componentCls: e
  } = t;
  return {
    // Grid system
    [e]: {
      position: "relative",
      maxWidth: "100%",
      // Prevent columns from collapsing when empty
      minHeight: 1
    }
  };
}, wie = (t, e) => {
  const {
    componentCls: n,
    gridColumns: i
  } = t, o = {};
  for (let r = i; r >= 0; r--)
    r === 0 ? (o[`${n}${e}-${r}`] = {
      display: "none"
    }, o[`${n}-push-${r}`] = {
      insetInlineStart: "auto"
    }, o[`${n}-pull-${r}`] = {
      insetInlineEnd: "auto"
    }, o[`${n}${e}-push-${r}`] = {
      insetInlineStart: "auto"
    }, o[`${n}${e}-pull-${r}`] = {
      insetInlineEnd: "auto"
    }, o[`${n}${e}-offset-${r}`] = {
      marginInlineEnd: 0
    }, o[`${n}${e}-order-${r}`] = {
      order: 0
    }) : (o[`${n}${e}-${r}`] = {
      display: "block",
      flex: `0 0 ${r / i * 100}%`,
      maxWidth: `${r / i * 100}%`
    }, o[`${n}${e}-push-${r}`] = {
      insetInlineStart: `${r / i * 100}%`
    }, o[`${n}${e}-pull-${r}`] = {
      insetInlineEnd: `${r / i * 100}%`
    }, o[`${n}${e}-offset-${r}`] = {
      marginInlineStart: `${r / i * 100}%`
    }, o[`${n}${e}-order-${r}`] = {
      order: r
    });
  return o;
}, zO = (t, e) => wie(t, e), Cie = (t, e, n) => ({
  [`@media (min-width: ${e}px)`]: k({}, zO(t, n))
}), $ie = Vn("Grid", (t) => [Oie(t)]), kie = Vn("Grid", (t) => {
  const e = dn(t, {
    gridColumns: 24
    // Row is divided into 24 parts in Grid
  }), n = {
    "-sm": e.screenSMMin,
    "-md": e.screenMDMin,
    "-lg": e.screenLGMin,
    "-xl": e.screenXLMin,
    "-xxl": e.screenXXLMin
  };
  return [Sie(e), zO(e, ""), zO(e, "-xs"), Object.keys(n).map((i) => Cie(e, n[i], i)).reduce((i, o) => k(k({}, i), o), {})];
}), Tie = () => ({
  align: pn([String, Object]),
  justify: pn([String, Object]),
  prefixCls: String,
  gutter: pn([Number, Array, Object], 0),
  wrap: {
    type: Boolean,
    default: void 0
  }
}), G5 = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ARow",
  inheritAttrs: !1,
  props: Tie(),
  setup(t, e) {
    let {
      slots: n,
      attrs: i
    } = e;
    const {
      prefixCls: o,
      direction: r
    } = Ht("row", t), [a, l] = $ie(o);
    let s;
    const u = y3(), c = de({
      xs: !0,
      sm: !0,
      md: !0,
      lg: !0,
      xl: !0,
      xxl: !0
    }), d = de({
      xs: !1,
      sm: !1,
      md: !1,
      lg: !1,
      xl: !1,
      xxl: !1
    }), f = (w) => A(() => {
      if (typeof t[w] == "string")
        return t[w];
      if (typeof t[w] != "object")
        return "";
      for (let $ = 0; $ < cm.length; $++) {
        const C = cm[$];
        if (!d.value[C]) continue;
        const P = t[w][C];
        if (P !== void 0)
          return P;
      }
      return "";
    }), h = f("align"), p = f("justify"), g = X5();
    Lt(() => {
      s = u.value.subscribe((w) => {
        d.value = w;
        const $ = t.gutter || 0;
        (!Array.isArray($) && typeof $ == "object" || Array.isArray($) && (typeof $[0] == "object" || typeof $[1] == "object")) && (c.value = w);
      });
    }), tn(() => {
      u.value.unsubscribe(s);
    });
    const m = A(() => {
      const w = [void 0, void 0], {
        gutter: $ = 0
      } = t;
      return (Array.isArray($) ? $ : [$, void 0]).forEach((P, O) => {
        if (typeof P == "object")
          for (let E = 0; E < cm.length; E++) {
            const _ = cm[E];
            if (c.value[_] && P[_] !== void 0) {
              w[O] = P[_];
              break;
            }
          }
        else
          w[O] = P;
      }), w;
    });
    bie({
      gutter: m,
      supportFlexGap: g,
      wrap: A(() => t.wrap)
    });
    const y = A(() => Ae(o.value, {
      [`${o.value}-no-wrap`]: t.wrap === !1,
      [`${o.value}-${p.value}`]: p.value,
      [`${o.value}-${h.value}`]: h.value,
      [`${o.value}-rtl`]: r.value === "rtl"
    }, i.class, l.value)), b = A(() => {
      const w = m.value, $ = {}, C = w[0] != null && w[0] > 0 ? `${w[0] / -2}px` : void 0, P = w[1] != null && w[1] > 0 ? `${w[1] / -2}px` : void 0;
      return C && ($.marginLeft = C, $.marginRight = C), g.value ? $.rowGap = `${w[1]}px` : P && ($.marginTop = P, $.marginBottom = P), $;
    });
    return () => {
      var w;
      return a(v("div", J(J({}, i), {}, {
        class: y.value,
        style: k(k({}, b.value), i.style)
      }), [(w = n.default) === null || w === void 0 ? void 0 : w.call(n)]));
    };
  }
});
function kc() {
  return kc = Object.assign ? Object.assign.bind() : function(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e];
      for (var i in n)
        Object.prototype.hasOwnProperty.call(n, i) && (t[i] = n[i]);
    }
    return t;
  }, kc.apply(this, arguments);
}
function Pie(t, e) {
  t.prototype = Object.create(e.prototype), t.prototype.constructor = t, Qp(t, e);
}
function BO(t) {
  return BO = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(n) {
    return n.__proto__ || Object.getPrototypeOf(n);
  }, BO(t);
}
function Qp(t, e) {
  return Qp = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(i, o) {
    return i.__proto__ = o, i;
  }, Qp(t, e);
}
function Eie() {
  if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
  if (typeof Proxy == "function") return !0;
  try {
    return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    })), !0;
  } catch {
    return !1;
  }
}
function gv(t, e, n) {
  return Eie() ? gv = Reflect.construct.bind() : gv = function(o, r, a) {
    var l = [null];
    l.push.apply(l, r);
    var s = Function.bind.apply(o, l), u = new s();
    return a && Qp(u, a.prototype), u;
  }, gv.apply(null, arguments);
}
function _ie(t) {
  return Function.toString.call(t).indexOf("[native code]") !== -1;
}
function FO(t) {
  var e = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
  return FO = function(i) {
    if (i === null || !_ie(i)) return i;
    if (typeof i != "function")
      throw new TypeError("Super expression must either be null or a function");
    if (typeof e < "u") {
      if (e.has(i)) return e.get(i);
      e.set(i, o);
    }
    function o() {
      return gv(i, arguments, BO(this).constructor);
    }
    return o.prototype = Object.create(i.prototype, {
      constructor: {
        value: o,
        enumerable: !1,
        writable: !0,
        configurable: !0
      }
    }), Qp(o, i);
  }, FO(t);
}
var Iie = /%[sdj%]/g, U5 = function() {
};
typeof process < "u" && process.env && process.env.NODE_ENV !== "production" && typeof window < "u" && typeof document < "u" && (U5 = function(e, n) {
  typeof console < "u" && console.warn && typeof ASYNC_VALIDATOR_NO_WARNING > "u" && n.every(function(i) {
    return typeof i == "string";
  }) && console.warn(e, n);
});
function VO(t) {
  if (!t || !t.length) return null;
  var e = {};
  return t.forEach(function(n) {
    var i = n.field;
    e[i] = e[i] || [], e[i].push(n);
  }), e;
}
function Ar(t) {
  for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
    n[i - 1] = arguments[i];
  var o = 0, r = n.length;
  if (typeof t == "function")
    return t.apply(null, n);
  if (typeof t == "string") {
    var a = t.replace(Iie, function(l) {
      if (l === "%%")
        return "%";
      if (o >= r)
        return l;
      switch (l) {
        case "%s":
          return String(n[o++]);
        case "%d":
          return Number(n[o++]);
        case "%j":
          try {
            return JSON.stringify(n[o++]);
          } catch {
            return "[Circular]";
          }
          break;
        default:
          return l;
      }
    });
    return a;
  }
  return t;
}
function Mie(t) {
  return t === "string" || t === "url" || t === "hex" || t === "email" || t === "date" || t === "pattern";
}
function go(t, e) {
  return !!(t == null || e === "array" && Array.isArray(t) && !t.length || Mie(e) && typeof t == "string" && !t);
}
function Aie(t, e, n) {
  var i = [], o = 0, r = t.length;
  function a(l) {
    i.push.apply(i, l || []), o++, o === r && n(i);
  }
  t.forEach(function(l) {
    e(l, a);
  });
}
function wE(t, e, n) {
  var i = 0, o = t.length;
  function r(a) {
    if (a && a.length) {
      n(a);
      return;
    }
    var l = i;
    i = i + 1, l < o ? e(t[l], r) : n([]);
  }
  r([]);
}
function Rie(t) {
  var e = [];
  return Object.keys(t).forEach(function(n) {
    e.push.apply(e, t[n] || []);
  }), e;
}
var CE = /* @__PURE__ */ (function(t) {
  Pie(e, t);
  function e(n, i) {
    var o;
    return o = t.call(this, "Async Validation Error") || this, o.errors = n, o.fields = i, o;
  }
  return e;
})(/* @__PURE__ */ FO(Error));
function Die(t, e, n, i, o) {
  if (e.first) {
    var r = new Promise(function(f, h) {
      var p = function(y) {
        return i(y), y.length ? h(new CE(y, VO(y))) : f(o);
      }, g = Rie(t);
      wE(g, n, p);
    });
    return r.catch(function(f) {
      return f;
    }), r;
  }
  var a = e.firstFields === !0 ? Object.keys(t) : e.firstFields || [], l = Object.keys(t), s = l.length, u = 0, c = [], d = new Promise(function(f, h) {
    var p = function(m) {
      if (c.push.apply(c, m), u++, u === s)
        return i(c), c.length ? h(new CE(c, VO(c))) : f(o);
    };
    l.length || (i(c), f(o)), l.forEach(function(g) {
      var m = t[g];
      a.indexOf(g) !== -1 ? wE(m, n, p) : Aie(m, n, p);
    });
  });
  return d.catch(function(f) {
    return f;
  }), d;
}
function Nie(t) {
  return !!(t && t.message !== void 0);
}
function Lie(t, e) {
  for (var n = t, i = 0; i < e.length; i++) {
    if (n == null)
      return n;
    n = n[e[i]];
  }
  return n;
}
function $E(t, e) {
  return function(n) {
    var i;
    return t.fullFields ? i = Lie(e, t.fullFields) : i = e[n.field || t.fullField], Nie(n) ? (n.field = n.field || t.fullField, n.fieldValue = i, n) : {
      message: typeof n == "function" ? n() : n,
      fieldValue: i,
      field: n.field || t.fullField
    };
  };
}
function kE(t, e) {
  if (e) {
    for (var n in e)
      if (e.hasOwnProperty(n)) {
        var i = e[n];
        typeof i == "object" && typeof t[n] == "object" ? t[n] = kc({}, t[n], i) : t[n] = i;
      }
  }
  return t;
}
var J5 = function(e, n, i, o, r, a) {
  e.required && (!i.hasOwnProperty(e.field) || go(n, a || e.type)) && o.push(Ar(r.messages.required, e.fullField));
}, zie = function(e, n, i, o, r) {
  (/^\s+$/.test(n) || n === "") && o.push(Ar(r.messages.whitespace, e.fullField));
}, xm, Bie = (function() {
  if (xm)
    return xm;
  var t = "[a-fA-F\\d:]", e = function($) {
    return $ && $.includeBoundaries ? "(?:(?<=\\s|^)(?=" + t + ")|(?<=" + t + ")(?=\\s|$))" : "";
  }, n = "(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}", i = "[a-fA-F\\d]{1,4}", o = (`
(?:
(?:` + i + ":){7}(?:" + i + `|:)|                                    // 1:2:3:4:5:6:7::  1:2:3:4:5:6:7:8
(?:` + i + ":){6}(?:" + n + "|:" + i + `|:)|                             // 1:2:3:4:5:6::    1:2:3:4:5:6::8   1:2:3:4:5:6::8  1:2:3:4:5:6::1.2.3.4
(?:` + i + ":){5}(?::" + n + "|(?::" + i + `){1,2}|:)|                   // 1:2:3:4:5::      1:2:3:4:5::7:8   1:2:3:4:5::8    1:2:3:4:5::7:1.2.3.4
(?:` + i + ":){4}(?:(?::" + i + "){0,1}:" + n + "|(?::" + i + `){1,3}|:)| // 1:2:3:4::        1:2:3:4::6:7:8   1:2:3:4::8      1:2:3:4::6:7:1.2.3.4
(?:` + i + ":){3}(?:(?::" + i + "){0,2}:" + n + "|(?::" + i + `){1,4}|:)| // 1:2:3::          1:2:3::5:6:7:8   1:2:3::8        1:2:3::5:6:7:1.2.3.4
(?:` + i + ":){2}(?:(?::" + i + "){0,3}:" + n + "|(?::" + i + `){1,5}|:)| // 1:2::            1:2::4:5:6:7:8   1:2::8          1:2::4:5:6:7:1.2.3.4
(?:` + i + ":){1}(?:(?::" + i + "){0,4}:" + n + "|(?::" + i + `){1,6}|:)| // 1::              1::3:4:5:6:7:8   1::8            1::3:4:5:6:7:1.2.3.4
(?::(?:(?::` + i + "){0,5}:" + n + "|(?::" + i + `){1,7}|:))             // ::2:3:4:5:6:7:8  ::2:3:4:5:6:7:8  ::8             ::1.2.3.4
)(?:%[0-9a-zA-Z]{1,})?                                             // %eth0            %1
`).replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim(), r = new RegExp("(?:^" + n + "$)|(?:^" + o + "$)"), a = new RegExp("^" + n + "$"), l = new RegExp("^" + o + "$"), s = function($) {
    return $ && $.exact ? r : new RegExp("(?:" + e($) + n + e($) + ")|(?:" + e($) + o + e($) + ")", "g");
  };
  s.v4 = function(w) {
    return w && w.exact ? a : new RegExp("" + e(w) + n + e(w), "g");
  }, s.v6 = function(w) {
    return w && w.exact ? l : new RegExp("" + e(w) + o + e(w), "g");
  };
  var u = "(?:(?:[a-z]+:)?//)", c = "(?:\\S+(?::\\S*)?@)?", d = s.v4().source, f = s.v6().source, h = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)", p = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*", g = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))", m = "(?::\\d{2,5})?", y = '(?:[/?#][^\\s"]*)?', b = "(?:" + u + "|www\\.)" + c + "(?:localhost|" + d + "|" + f + "|" + h + p + g + ")" + m + y;
  return xm = new RegExp("(?:^" + b + "$)", "i"), xm;
}), TE = {
  // http://emailregex.com/
  email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,
  // url: new RegExp(
  //   '^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$',
  //   'i',
  // ),
  hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i
}, Kh = {
  integer: function(e) {
    return Kh.number(e) && parseInt(e, 10) === e;
  },
  float: function(e) {
    return Kh.number(e) && !Kh.integer(e);
  },
  array: function(e) {
    return Array.isArray(e);
  },
  regexp: function(e) {
    if (e instanceof RegExp)
      return !0;
    try {
      return !!new RegExp(e);
    } catch {
      return !1;
    }
  },
  date: function(e) {
    return typeof e.getTime == "function" && typeof e.getMonth == "function" && typeof e.getYear == "function" && !isNaN(e.getTime());
  },
  number: function(e) {
    return isNaN(e) ? !1 : typeof e == "number";
  },
  object: function(e) {
    return typeof e == "object" && !Kh.array(e);
  },
  method: function(e) {
    return typeof e == "function";
  },
  email: function(e) {
    return typeof e == "string" && e.length <= 320 && !!e.match(TE.email);
  },
  url: function(e) {
    return typeof e == "string" && e.length <= 2048 && !!e.match(Bie());
  },
  hex: function(e) {
    return typeof e == "string" && !!e.match(TE.hex);
  }
}, Fie = function(e, n, i, o, r) {
  if (e.required && n === void 0) {
    J5(e, n, i, o, r);
    return;
  }
  var a = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"], l = e.type;
  a.indexOf(l) > -1 ? Kh[l](n) || o.push(Ar(r.messages.types[l], e.fullField, e.type)) : l && typeof n !== e.type && o.push(Ar(r.messages.types[l], e.fullField, e.type));
}, Vie = function(e, n, i, o, r) {
  var a = typeof e.len == "number", l = typeof e.min == "number", s = typeof e.max == "number", u = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, c = n, d = null, f = typeof n == "number", h = typeof n == "string", p = Array.isArray(n);
  if (f ? d = "number" : h ? d = "string" : p && (d = "array"), !d)
    return !1;
  p && (c = n.length), h && (c = n.replace(u, "_").length), a ? c !== e.len && o.push(Ar(r.messages[d].len, e.fullField, e.len)) : l && !s && c < e.min ? o.push(Ar(r.messages[d].min, e.fullField, e.min)) : s && !l && c > e.max ? o.push(Ar(r.messages[d].max, e.fullField, e.max)) : l && s && (c < e.min || c > e.max) && o.push(Ar(r.messages[d].range, e.fullField, e.min, e.max));
}, Id = "enum", Qie = function(e, n, i, o, r) {
  e[Id] = Array.isArray(e[Id]) ? e[Id] : [], e[Id].indexOf(n) === -1 && o.push(Ar(r.messages[Id], e.fullField, e[Id].join(", ")));
}, Hie = function(e, n, i, o, r) {
  if (e.pattern) {
    if (e.pattern instanceof RegExp)
      e.pattern.lastIndex = 0, e.pattern.test(n) || o.push(Ar(r.messages.pattern.mismatch, e.fullField, n, e.pattern));
    else if (typeof e.pattern == "string") {
      var a = new RegExp(e.pattern);
      a.test(n) || o.push(Ar(r.messages.pattern.mismatch, e.fullField, n, e.pattern));
    }
  }
}, An = {
  required: J5,
  whitespace: zie,
  type: Fie,
  range: Vie,
  enum: Qie,
  pattern: Hie
}, Wie = function(e, n, i, o, r) {
  var a = [], l = e.required || !e.required && o.hasOwnProperty(e.field);
  if (l) {
    if (go(n, "string") && !e.required)
      return i();
    An.required(e, n, o, a, r, "string"), go(n, "string") || (An.type(e, n, o, a, r), An.range(e, n, o, a, r), An.pattern(e, n, o, a, r), e.whitespace === !0 && An.whitespace(e, n, o, a, r));
  }
  i(a);
}, jie = function(e, n, i, o, r) {
  var a = [], l = e.required || !e.required && o.hasOwnProperty(e.field);
  if (l) {
    if (go(n) && !e.required)
      return i();
    An.required(e, n, o, a, r), n !== void 0 && An.type(e, n, o, a, r);
  }
  i(a);
}, qie = function(e, n, i, o, r) {
  var a = [], l = e.required || !e.required && o.hasOwnProperty(e.field);
  if (l) {
    if (n === "" && (n = void 0), go(n) && !e.required)
      return i();
    An.required(e, n, o, a, r), n !== void 0 && (An.type(e, n, o, a, r), An.range(e, n, o, a, r));
  }
  i(a);
}, Yie = function(e, n, i, o, r) {
  var a = [], l = e.required || !e.required && o.hasOwnProperty(e.field);
  if (l) {
    if (go(n) && !e.required)
      return i();
    An.required(e, n, o, a, r), n !== void 0 && An.type(e, n, o, a, r);
  }
  i(a);
}, Kie = function(e, n, i, o, r) {
  var a = [], l = e.required || !e.required && o.hasOwnProperty(e.field);
  if (l) {
    if (go(n) && !e.required)
      return i();
    An.required(e, n, o, a, r), go(n) || An.type(e, n, o, a, r);
  }
  i(a);
}, Xie = function(e, n, i, o, r) {
  var a = [], l = e.required || !e.required && o.hasOwnProperty(e.field);
  if (l) {
    if (go(n) && !e.required)
      return i();
    An.required(e, n, o, a, r), n !== void 0 && (An.type(e, n, o, a, r), An.range(e, n, o, a, r));
  }
  i(a);
}, Zie = function(e, n, i, o, r) {
  var a = [], l = e.required || !e.required && o.hasOwnProperty(e.field);
  if (l) {
    if (go(n) && !e.required)
      return i();
    An.required(e, n, o, a, r), n !== void 0 && (An.type(e, n, o, a, r), An.range(e, n, o, a, r));
  }
  i(a);
}, Gie = function(e, n, i, o, r) {
  var a = [], l = e.required || !e.required && o.hasOwnProperty(e.field);
  if (l) {
    if (n == null && !e.required)
      return i();
    An.required(e, n, o, a, r, "array"), n != null && (An.type(e, n, o, a, r), An.range(e, n, o, a, r));
  }
  i(a);
}, Uie = function(e, n, i, o, r) {
  var a = [], l = e.required || !e.required && o.hasOwnProperty(e.field);
  if (l) {
    if (go(n) && !e.required)
      return i();
    An.required(e, n, o, a, r), n !== void 0 && An.type(e, n, o, a, r);
  }
  i(a);
}, Jie = "enum", eoe = function(e, n, i, o, r) {
  var a = [], l = e.required || !e.required && o.hasOwnProperty(e.field);
  if (l) {
    if (go(n) && !e.required)
      return i();
    An.required(e, n, o, a, r), n !== void 0 && An[Jie](e, n, o, a, r);
  }
  i(a);
}, toe = function(e, n, i, o, r) {
  var a = [], l = e.required || !e.required && o.hasOwnProperty(e.field);
  if (l) {
    if (go(n, "string") && !e.required)
      return i();
    An.required(e, n, o, a, r), go(n, "string") || An.pattern(e, n, o, a, r);
  }
  i(a);
}, noe = function(e, n, i, o, r) {
  var a = [], l = e.required || !e.required && o.hasOwnProperty(e.field);
  if (l) {
    if (go(n, "date") && !e.required)
      return i();
    if (An.required(e, n, o, a, r), !go(n, "date")) {
      var s;
      n instanceof Date ? s = n : s = new Date(n), An.type(e, s, o, a, r), s && An.range(e, s.getTime(), o, a, r);
    }
  }
  i(a);
}, ioe = function(e, n, i, o, r) {
  var a = [], l = Array.isArray(n) ? "array" : typeof n;
  An.required(e, n, o, a, r, l), i(a);
}, f1 = function(e, n, i, o, r) {
  var a = e.type, l = [], s = e.required || !e.required && o.hasOwnProperty(e.field);
  if (s) {
    if (go(n, a) && !e.required)
      return i();
    An.required(e, n, o, l, r, a), go(n, a) || An.type(e, n, o, l, r);
  }
  i(l);
}, ooe = function(e, n, i, o, r) {
  var a = [], l = e.required || !e.required && o.hasOwnProperty(e.field);
  if (l) {
    if (go(n) && !e.required)
      return i();
    An.required(e, n, o, a, r);
  }
  i(a);
}, sp = {
  string: Wie,
  method: jie,
  number: qie,
  boolean: Yie,
  regexp: Kie,
  integer: Xie,
  float: Zie,
  array: Gie,
  object: Uie,
  enum: eoe,
  pattern: toe,
  date: noe,
  url: f1,
  hex: f1,
  email: f1,
  required: ioe,
  any: ooe
};
function QO() {
  return {
    default: "Validation error on field %s",
    required: "%s is required",
    enum: "%s must be one of %s",
    whitespace: "%s cannot be empty",
    date: {
      format: "%s date %s is invalid for format %s",
      parse: "%s date could not be parsed, %s is invalid ",
      invalid: "%s date %s is invalid"
    },
    types: {
      string: "%s is not a %s",
      method: "%s is not a %s (function)",
      array: "%s is not an %s",
      object: "%s is not an %s",
      number: "%s is not a %s",
      date: "%s is not a %s",
      boolean: "%s is not a %s",
      integer: "%s is not an %s",
      float: "%s is not a %s",
      regexp: "%s is not a valid %s",
      email: "%s is not a valid %s",
      url: "%s is not a valid %s",
      hex: "%s is not a valid %s"
    },
    string: {
      len: "%s must be exactly %s characters",
      min: "%s must be at least %s characters",
      max: "%s cannot be longer than %s characters",
      range: "%s must be between %s and %s characters"
    },
    number: {
      len: "%s must equal %s",
      min: "%s cannot be less than %s",
      max: "%s cannot be greater than %s",
      range: "%s must be between %s and %s"
    },
    array: {
      len: "%s must be exactly %s in length",
      min: "%s cannot be less than %s in length",
      max: "%s cannot be greater than %s in length",
      range: "%s must be between %s and %s in length"
    },
    pattern: {
      mismatch: "%s value %s does not match pattern %s"
    },
    clone: function() {
      var e = JSON.parse(JSON.stringify(this));
      return e.clone = this.clone, e;
    }
  };
}
var HO = QO(), wg = /* @__PURE__ */ (function() {
  function t(n) {
    this.rules = null, this._messages = HO, this.define(n);
  }
  var e = t.prototype;
  return e.define = function(i) {
    var o = this;
    if (!i)
      throw new Error("Cannot configure a schema with no rules");
    if (typeof i != "object" || Array.isArray(i))
      throw new Error("Rules must be an object");
    this.rules = {}, Object.keys(i).forEach(function(r) {
      var a = i[r];
      o.rules[r] = Array.isArray(a) ? a : [a];
    });
  }, e.messages = function(i) {
    return i && (this._messages = kE(QO(), i)), this._messages;
  }, e.validate = function(i, o, r) {
    var a = this;
    o === void 0 && (o = {}), r === void 0 && (r = function() {
    });
    var l = i, s = o, u = r;
    if (typeof s == "function" && (u = s, s = {}), !this.rules || Object.keys(this.rules).length === 0)
      return u && u(null, l), Promise.resolve(l);
    function c(g) {
      var m = [], y = {};
      function b($) {
        if (Array.isArray($)) {
          var C;
          m = (C = m).concat.apply(C, $);
        } else
          m.push($);
      }
      for (var w = 0; w < g.length; w++)
        b(g[w]);
      m.length ? (y = VO(m), u(m, y)) : u(null, l);
    }
    if (s.messages) {
      var d = this.messages();
      d === HO && (d = QO()), kE(d, s.messages), s.messages = d;
    } else
      s.messages = this.messages();
    var f = {}, h = s.keys || Object.keys(this.rules);
    h.forEach(function(g) {
      var m = a.rules[g], y = l[g];
      m.forEach(function(b) {
        var w = b;
        typeof w.transform == "function" && (l === i && (l = kc({}, l)), y = l[g] = w.transform(y)), typeof w == "function" ? w = {
          validator: w
        } : w = kc({}, w), w.validator = a.getValidationMethod(w), w.validator && (w.field = g, w.fullField = w.fullField || g, w.type = a.getType(w), f[g] = f[g] || [], f[g].push({
          rule: w,
          value: y,
          source: l,
          field: g
        }));
      });
    });
    var p = {};
    return Die(f, s, function(g, m) {
      var y = g.rule, b = (y.type === "object" || y.type === "array") && (typeof y.fields == "object" || typeof y.defaultField == "object");
      b = b && (y.required || !y.required && g.value), y.field = g.field;
      function w(P, O) {
        return kc({}, O, {
          fullField: y.fullField + "." + P,
          fullFields: y.fullFields ? [].concat(y.fullFields, [P]) : [P]
        });
      }
      function $(P) {
        P === void 0 && (P = []);
        var O = Array.isArray(P) ? P : [P];
        !s.suppressWarning && O.length && t.warning("async-validator:", O), O.length && y.message !== void 0 && (O = [].concat(y.message));
        var E = O.map($E(y, l));
        if (s.first && E.length)
          return p[y.field] = 1, m(E);
        if (!b)
          m(E);
        else {
          if (y.required && !g.value)
            return y.message !== void 0 ? E = [].concat(y.message).map($E(y, l)) : s.error && (E = [s.error(y, Ar(s.messages.required, y.field))]), m(E);
          var _ = {};
          y.defaultField && Object.keys(g.value).map(function(N) {
            _[N] = y.defaultField;
          }), _ = kc({}, _, g.rule.fields);
          var D = {};
          Object.keys(_).forEach(function(N) {
            var L = _[N], j = Array.isArray(L) ? L : [L];
            D[N] = j.map(w.bind(null, N));
          });
          var M = new t(D);
          M.messages(s.messages), g.rule.options && (g.rule.options.messages = s.messages, g.rule.options.error = s.error), M.validate(g.value, g.rule.options || s, function(N) {
            var L = [];
            E && E.length && L.push.apply(L, E), N && N.length && L.push.apply(L, N), m(L.length ? L : null);
          });
        }
      }
      var C;
      if (y.asyncValidator)
        C = y.asyncValidator(y, g.value, $, g.source, s);
      else if (y.validator) {
        try {
          C = y.validator(y, g.value, $, g.source, s);
        } catch (P) {
          console.error?.(P), s.suppressValidatorError || setTimeout(function() {
            throw P;
          }, 0), $(P.message);
        }
        C === !0 ? $() : C === !1 ? $(typeof y.message == "function" ? y.message(y.fullField || y.field) : y.message || (y.fullField || y.field) + " fails") : C instanceof Array ? $(C) : C instanceof Error && $(C.message);
      }
      C && C.then && C.then(function() {
        return $();
      }, function(P) {
        return $(P);
      });
    }, function(g) {
      c(g);
    }, l);
  }, e.getType = function(i) {
    if (i.type === void 0 && i.pattern instanceof RegExp && (i.type = "pattern"), typeof i.validator != "function" && i.type && !sp.hasOwnProperty(i.type))
      throw new Error(Ar("Unknown rule type %s", i.type));
    return i.type || "string";
  }, e.getValidationMethod = function(i) {
    if (typeof i.validator == "function")
      return i.validator;
    var o = Object.keys(i), r = o.indexOf("message");
    return r !== -1 && o.splice(r, 1), o.length === 1 && o[0] === "required" ? sp.required : sp[this.getType(i)] || void 0;
  }, t;
})();
wg.register = function(e, n) {
  if (typeof n != "function")
    throw new Error("Cannot register a validator by type, validator is not a function");
  sp[e] = n;
};
wg.warning = U5;
wg.messages = HO;
wg.validators = sp;
function Pu(t) {
  return t == null ? [] : Array.isArray(t) ? t : [t];
}
function eL(t, e) {
  let n = t;
  for (let i = 0; i < e.length; i += 1) {
    if (n == null)
      return;
    n = n[e[i]];
  }
  return n;
}
function tL(t, e, n, i) {
  if (!e.length)
    return n;
  const [o, ...r] = e;
  let a;
  return !t && typeof o == "number" ? a = [] : Array.isArray(t) ? a = [...t] : a = k({}, t), i && n === void 0 && r.length === 1 ? delete a[o][r[0]] : a[o] = tL(a[o], r, n, i), a;
}
function roe(t, e, n) {
  let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1;
  return e.length && i && n === void 0 && !eL(t, e.slice(0, -1)) ? t : tL(t, e, n, i);
}
function WO(t) {
  return Pu(t);
}
function aoe(t, e) {
  return eL(t, e);
}
function loe(t, e, n) {
  let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1;
  return roe(t, e, n, i);
}
function soe(t, e) {
  return t && t.some((n) => coe(n, e));
}
function PE(t) {
  return typeof t == "object" && t !== null && Object.getPrototypeOf(t) === Object.prototype;
}
function nL(t, e) {
  const n = Array.isArray(t) ? [...t] : k({}, t);
  return e && Object.keys(e).forEach((i) => {
    const o = n[i], r = e[i], a = PE(o) && PE(r);
    n[i] = a ? nL(o, r || {}) : r;
  }), n;
}
function uoe(t) {
  for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
    n[i - 1] = arguments[i];
  return n.reduce((o, r) => nL(o, r), t);
}
function EE(t, e) {
  let n = {};
  return e.forEach((i) => {
    const o = aoe(t, i);
    n = loe(n, i, o);
  }), n;
}
function coe(t, e) {
  return !t || !e || t.length !== e.length ? !1 : t.every((n, i) => e[i] === n);
}
const $r = "'${name}' is not a valid ${type}", My = {
  default: "Validation error on field '${name}'",
  required: "'${name}' is required",
  enum: "'${name}' must be one of [${enum}]",
  whitespace: "'${name}' cannot be empty",
  date: {
    format: "'${name}' is invalid for format date",
    parse: "'${name}' could not be parsed as date",
    invalid: "'${name}' is invalid date"
  },
  types: {
    string: $r,
    method: $r,
    array: $r,
    object: $r,
    number: $r,
    date: $r,
    boolean: $r,
    integer: $r,
    float: $r,
    regexp: $r,
    email: $r,
    url: $r,
    hex: $r
  },
  string: {
    len: "'${name}' must be exactly ${len} characters",
    min: "'${name}' must be at least ${min} characters",
    max: "'${name}' cannot be longer than ${max} characters",
    range: "'${name}' must be between ${min} and ${max} characters"
  },
  number: {
    len: "'${name}' must equal ${len}",
    min: "'${name}' cannot be less than ${min}",
    max: "'${name}' cannot be greater than ${max}",
    range: "'${name}' must be between ${min} and ${max}"
  },
  array: {
    len: "'${name}' must be exactly ${len} in length",
    min: "'${name}' cannot be less than ${min} in length",
    max: "'${name}' cannot be greater than ${max} in length",
    range: "'${name}' must be between ${min} and ${max} in length"
  },
  pattern: {
    mismatch: "'${name}' does not match pattern ${pattern}"
  }
};
var Ay = function(t, e, n, i) {
  function o(r) {
    return r instanceof n ? r : new n(function(a) {
      a(r);
    });
  }
  return new (n || (n = Promise))(function(r, a) {
    function l(c) {
      try {
        u(i.next(c));
      } catch (d) {
        a(d);
      }
    }
    function s(c) {
      try {
        u(i.throw(c));
      } catch (d) {
        a(d);
      }
    }
    function u(c) {
      c.done ? r(c.value) : o(c.value).then(l, s);
    }
    u((i = i.apply(t, e || [])).next());
  });
};
const doe = wg;
function foe(t, e) {
  return t.replace(/\$\{\w+\}/g, (n) => {
    const i = n.slice(2, -1);
    return e[i];
  });
}
function jO(t, e, n, i, o) {
  return Ay(this, void 0, void 0, function* () {
    const r = k({}, n);
    delete r.ruleIndex, delete r.trigger;
    let a = null;
    r && r.type === "array" && r.defaultField && (a = r.defaultField, delete r.defaultField);
    const l = new doe({
      [t]: [r]
    }), s = uoe({}, My, i.validateMessages);
    l.messages(s);
    let u = [];
    try {
      yield Promise.resolve(l.validate({
        [t]: e
      }, k({}, i)));
    } catch (f) {
      f.errors ? u = f.errors.map((h, p) => {
        let {
          message: g
        } = h;
        return (
          // Wrap VueNode with `key`
          po(g) ? Eu(g, {
            key: `error_${p}`
          }) : g
        );
      }) : (console.error(f), u = [s.default()]);
    }
    if (!u.length && a)
      return (yield Promise.all(e.map((h, p) => jO(`${t}.${p}`, h, a, i, o)))).reduce((h, p) => [...h, ...p], []);
    const c = k(k(k({}, n), {
      name: t,
      enum: (n.enum || []).join(", ")
    }), o);
    return u.map((f) => typeof f == "string" ? foe(f, c) : f);
  });
}
function iL(t, e, n, i, o, r) {
  const a = t.join("."), l = n.map((u, c) => {
    const d = u.validator, f = k(k({}, u), {
      ruleIndex: c
    });
    return d && (f.validator = (h, p, g) => {
      let m = !1;
      const b = d(h, p, function() {
        for (var w = arguments.length, $ = new Array(w), C = 0; C < w; C++)
          $[C] = arguments[C];
        Promise.resolve().then(() => {
          Nn(!m, "Your validator function has already return a promise. `callback` will be ignored."), m || g(...$);
        });
      });
      m = b && typeof b.then == "function" && typeof b.catch == "function", Nn(m, "`callback` is deprecated. Please return a promise instead."), m && b.then(() => {
        g();
      }).catch((w) => {
        g(w || " ");
      });
    }), f;
  }).sort((u, c) => {
    let {
      warningOnly: d,
      ruleIndex: f
    } = u, {
      warningOnly: h,
      ruleIndex: p
    } = c;
    return !!d == !!h ? f - p : d ? 1 : -1;
  });
  let s;
  if (o === !0)
    s = new Promise((u, c) => Ay(this, void 0, void 0, function* () {
      for (let d = 0; d < l.length; d += 1) {
        const f = l[d], h = yield jO(a, e, f, i, r);
        if (h.length) {
          c([{
            errors: h,
            rule: f
          }]);
          return;
        }
      }
      u([]);
    }));
  else {
    const u = l.map((c) => jO(a, e, c, i, r).then((d) => ({
      errors: d,
      rule: c
    })));
    s = (o ? poe(u) : hoe(u)).then((c) => Promise.reject(c));
  }
  return s.catch((u) => u), s;
}
function hoe(t) {
  return Ay(this, void 0, void 0, function* () {
    return Promise.all(t).then((e) => [].concat(...e));
  });
}
function poe(t) {
  return Ay(this, void 0, void 0, function* () {
    let e = 0;
    return new Promise((n) => {
      t.forEach((i) => {
        i.then((o) => {
          o.errors.length && n([o]), e += 1, e === t.length && n([]);
        });
      });
    });
  });
}
const oL = Symbol("formContextKey"), rL = (t) => {
  Xt(oL, t);
}, O$ = () => qt(oL, {
  name: A(() => {
  }),
  labelAlign: A(() => "right"),
  vertical: A(() => !1),
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  addField: (t, e) => {
  },
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  removeField: (t) => {
  },
  model: A(() => {
  }),
  rules: A(() => {
  }),
  colon: A(() => {
  }),
  labelWrap: A(() => {
  }),
  labelCol: A(() => {
  }),
  requiredMark: A(() => !1),
  validateTrigger: A(() => {
  }),
  onValidate: () => {
  },
  validateMessages: A(() => My)
}), aL = Symbol("formItemPrefixContextKey"), goe = (t) => {
  Xt(aL, t);
}, moe = () => qt(aL, {
  prefixCls: A(() => "")
});
function voe(t) {
  return typeof t == "number" ? `${t} ${t} auto` : /^\d+(\.\d+)?(px|em|rem|%)$/.test(t) ? `0 0 ${t}` : t;
}
const yoe = () => ({
  span: [String, Number],
  order: [String, Number],
  offset: [String, Number],
  push: [String, Number],
  pull: [String, Number],
  xs: {
    type: [String, Number, Object],
    default: void 0
  },
  sm: {
    type: [String, Number, Object],
    default: void 0
  },
  md: {
    type: [String, Number, Object],
    default: void 0
  },
  lg: {
    type: [String, Number, Object],
    default: void 0
  },
  xl: {
    type: [String, Number, Object],
    default: void 0
  },
  xxl: {
    type: [String, Number, Object],
    default: void 0
  },
  prefixCls: String,
  flex: [String, Number]
}), boe = ["xs", "sm", "md", "lg", "xl", "xxl"], S$ = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ACol",
  inheritAttrs: !1,
  props: yoe(),
  setup(t, e) {
    let {
      slots: n,
      attrs: i
    } = e;
    const {
      gutter: o,
      supportFlexGap: r,
      wrap: a
    } = xie(), {
      prefixCls: l,
      direction: s
    } = Ht("col", t), [u, c] = kie(l), d = A(() => {
      const {
        span: h,
        order: p,
        offset: g,
        push: m,
        pull: y
      } = t, b = l.value;
      let w = {};
      return boe.forEach(($) => {
        let C = {};
        const P = t[$];
        typeof P == "number" ? C.span = P : typeof P == "object" && (C = P || {}), w = k(k({}, w), {
          [`${b}-${$}-${C.span}`]: C.span !== void 0,
          [`${b}-${$}-order-${C.order}`]: C.order || C.order === 0,
          [`${b}-${$}-offset-${C.offset}`]: C.offset || C.offset === 0,
          [`${b}-${$}-push-${C.push}`]: C.push || C.push === 0,
          [`${b}-${$}-pull-${C.pull}`]: C.pull || C.pull === 0,
          [`${b}-rtl`]: s.value === "rtl"
        });
      }), Ae(b, {
        [`${b}-${h}`]: h !== void 0,
        [`${b}-order-${p}`]: p,
        [`${b}-offset-${g}`]: g,
        [`${b}-push-${m}`]: m,
        [`${b}-pull-${y}`]: y
      }, w, i.class, c.value);
    }), f = A(() => {
      const {
        flex: h
      } = t, p = o.value, g = {};
      if (p && p[0] > 0) {
        const m = `${p[0] / 2}px`;
        g.paddingLeft = m, g.paddingRight = m;
      }
      if (p && p[1] > 0 && !r.value) {
        const m = `${p[1] / 2}px`;
        g.paddingTop = m, g.paddingBottom = m;
      }
      return h && (g.flex = voe(h), a.value === !1 && !g.minWidth && (g.minWidth = 0)), g;
    });
    return () => {
      var h;
      return u(v("div", J(J({}, i), {}, {
        class: d.value,
        style: [f.value, i.style]
      }), [(h = n.default) === null || h === void 0 ? void 0 : h.call(n)]));
    };
  }
});
var xoe = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }, { tag: "path", attrs: { d: "M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z" } }] }, name: "question-circle", theme: "outlined" };
function _E(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(n);
    typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(n).filter(function(o) {
      return Object.getOwnPropertyDescriptor(n, o).enumerable;
    }))), i.forEach(function(o) {
      Ooe(t, o, n[o]);
    });
  }
  return t;
}
function Ooe(t, e, n) {
  return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
var w$ = function(e, n) {
  var i = _E({}, e, n.attrs);
  return v(bn, _E({}, i, {
    icon: xoe
  }), null);
};
w$.displayName = "QuestionCircleOutlined";
w$.inheritAttrs = !1;
const C$ = (t, e) => {
  let {
    slots: n,
    emit: i,
    attrs: o
  } = e;
  var r, a, l, s, u;
  const {
    prefixCls: c,
    htmlFor: d,
    labelCol: f,
    labelAlign: h,
    colon: p,
    required: g,
    requiredMark: m
  } = k(k({}, t), o), [y] = Bu("Form"), b = (r = t.label) !== null && r !== void 0 ? r : (a = n.label) === null || a === void 0 ? void 0 : a.call(n);
  if (!b) return null;
  const {
    vertical: w,
    labelAlign: $,
    labelCol: C,
    labelWrap: P,
    colon: O
  } = O$(), E = f || C?.value || {}, _ = h || $?.value, D = `${c}-item-label`, M = Ae(D, _ === "left" && `${D}-left`, E.class, {
    [`${D}-wrap`]: !!P.value
  });
  let N = b;
  const L = p === !0 || O?.value !== !1 && p !== !1;
  if (L && !w.value && typeof b == "string" && b.trim() !== "" && (N = b.replace(/[:|：]\s*$/, "")), t.tooltip || n.tooltip) {
    const Y = v("span", {
      class: `${c}-item-tooltip`
    }, [v(zi, {
      title: t.tooltip
    }, {
      default: () => [v(w$, null, null)]
    })]);
    N = v(tt, null, [N, n.tooltip ? (l = n.tooltip) === null || l === void 0 ? void 0 : l.call(n, {
      class: `${c}-item-tooltip`
    }) : Y]);
  }
  m === "optional" && !g && (N = v(tt, null, [N, v("span", {
    class: `${c}-item-optional`
  }, [((s = y.value) === null || s === void 0 ? void 0 : s.optional) || ((u = ks.Form) === null || u === void 0 ? void 0 : u.optional)])]));
  const B = Ae({
    [`${c}-item-required`]: g,
    [`${c}-item-required-mark-optional`]: m === "optional",
    [`${c}-item-no-colon`]: !L
  });
  return v(S$, J(J({}, E), {}, {
    class: M
  }), {
    default: () => [v("label", {
      for: d,
      class: B,
      title: typeof b == "string" ? b : "",
      onClick: (Y) => i("click", Y)
    }, [N])]
  });
};
C$.displayName = "FormItemLabel";
C$.inheritAttrs = !1;
const Soe = (t) => {
  const {
    componentCls: e
  } = t, n = `${e}-show-help`, i = `${e}-show-help-item`;
  return {
    [n]: {
      // Explain holder
      transition: `opacity ${t.motionDurationSlow} ${t.motionEaseInOut}`,
      "&-appear, &-enter": {
        opacity: 0,
        "&-active": {
          opacity: 1
        }
      },
      "&-leave": {
        opacity: 1,
        "&-active": {
          opacity: 0
        }
      },
      // Explain
      [i]: {
        overflow: "hidden",
        transition: `height ${t.motionDurationSlow} ${t.motionEaseInOut},
                     opacity ${t.motionDurationSlow} ${t.motionEaseInOut},
                     transform ${t.motionDurationSlow} ${t.motionEaseInOut} !important`,
        [`&${i}-appear, &${i}-enter`]: {
          transform: "translateY(-5px)",
          opacity: 0,
          "&-active": {
            transform: "translateY(0)",
            opacity: 1
          }
        },
        [`&${i}-leave-active`]: {
          transform: "translateY(-5px)"
        }
      }
    }
  };
}, woe = (t) => ({
  legend: {
    display: "block",
    width: "100%",
    marginBottom: t.marginLG,
    padding: 0,
    color: t.colorTextDescription,
    fontSize: t.fontSizeLG,
    lineHeight: "inherit",
    border: 0,
    borderBottom: `${t.lineWidth}px ${t.lineType} ${t.colorBorder}`
  },
  label: {
    fontSize: t.fontSize
  },
  'input[type="search"]': {
    boxSizing: "border-box"
  },
  // Position radios and checkboxes better
  'input[type="radio"], input[type="checkbox"]': {
    lineHeight: "normal"
  },
  'input[type="file"]': {
    display: "block"
  },
  // Make range inputs behave like textual form controls
  'input[type="range"]': {
    display: "block",
    width: "100%"
  },
  // Make multiple select elements height not fixed
  "select[multiple], select[size]": {
    height: "auto"
  },
  // Focus for file, radio, and checkbox
  "input[type='file']:focus,\n  input[type='radio']:focus,\n  input[type='checkbox']:focus": {
    outline: 0,
    boxShadow: `0 0 0 ${t.controlOutlineWidth}px ${t.controlOutline}`
  },
  // Adjust output element
  output: {
    display: "block",
    paddingTop: 15,
    color: t.colorText,
    fontSize: t.fontSize,
    lineHeight: t.lineHeight
  }
}), IE = (t, e) => {
  const {
    formItemCls: n
  } = t;
  return {
    [n]: {
      [`${n}-label > label`]: {
        height: e
      },
      [`${n}-control-input`]: {
        minHeight: e
      }
    }
  };
}, Coe = (t) => {
  const {
    componentCls: e
  } = t;
  return {
    [t.componentCls]: k(k(k({}, kn(t)), woe(t)), {
      [`${e}-text`]: {
        display: "inline-block",
        paddingInlineEnd: t.paddingSM
      },
      // ================================================================
      // =                             Size                             =
      // ================================================================
      "&-small": k({}, IE(t, t.controlHeightSM)),
      "&-large": k({}, IE(t, t.controlHeightLG))
    })
  };
}, $oe = (t) => {
  const {
    formItemCls: e,
    iconCls: n,
    componentCls: i,
    rootPrefixCls: o
  } = t;
  return {
    [e]: k(k({}, kn(t)), {
      marginBottom: t.marginLG,
      verticalAlign: "top",
      "&-with-help": {
        transition: "none"
      },
      [`&-hidden,
        &-hidden.${o}-row`]: {
        // https://github.com/ant-design/ant-design/issues/26141
        display: "none"
      },
      "&-has-warning": {
        [`${e}-split`]: {
          color: t.colorError
        }
      },
      "&-has-error": {
        [`${e}-split`]: {
          color: t.colorWarning
        }
      },
      // ==============================================================
      // =                            Label                           =
      // ==============================================================
      [`${e}-label`]: {
        display: "inline-block",
        flexGrow: 0,
        overflow: "hidden",
        whiteSpace: "nowrap",
        textAlign: "end",
        verticalAlign: "middle",
        "&-left": {
          textAlign: "start"
        },
        "&-wrap": {
          overflow: "unset",
          lineHeight: `${t.lineHeight} - 0.25em`,
          whiteSpace: "unset"
        },
        "> label": {
          position: "relative",
          display: "inline-flex",
          alignItems: "center",
          maxWidth: "100%",
          height: t.controlHeight,
          color: t.colorTextHeading,
          fontSize: t.fontSize,
          [`> ${n}`]: {
            fontSize: t.fontSize,
            verticalAlign: "top"
          },
          // Required mark
          [`&${e}-required:not(${e}-required-mark-optional)::before`]: {
            display: "inline-block",
            marginInlineEnd: t.marginXXS,
            color: t.colorError,
            fontSize: t.fontSize,
            fontFamily: "SimSun, sans-serif",
            lineHeight: 1,
            content: '"*"',
            [`${i}-hide-required-mark &`]: {
              display: "none"
            }
          },
          // Optional mark
          [`${e}-optional`]: {
            display: "inline-block",
            marginInlineStart: t.marginXXS,
            color: t.colorTextDescription,
            [`${i}-hide-required-mark &`]: {
              display: "none"
            }
          },
          // Optional mark
          [`${e}-tooltip`]: {
            color: t.colorTextDescription,
            cursor: "help",
            writingMode: "horizontal-tb",
            marginInlineStart: t.marginXXS
          },
          "&::after": {
            content: '":"',
            position: "relative",
            marginBlock: 0,
            marginInlineStart: t.marginXXS / 2,
            marginInlineEnd: t.marginXS
          },
          [`&${e}-no-colon::after`]: {
            content: '" "'
          }
        }
      },
      // ==============================================================
      // =                            Input                           =
      // ==============================================================
      [`${e}-control`]: {
        display: "flex",
        flexDirection: "column",
        flexGrow: 1,
        [`&:first-child:not([class^="'${o}-col-'"]):not([class*="' ${o}-col-'"])`]: {
          width: "100%"
        },
        "&-input": {
          position: "relative",
          display: "flex",
          alignItems: "center",
          minHeight: t.controlHeight,
          "&-content": {
            flex: "auto",
            maxWidth: "100%"
          }
        }
      },
      // ==============================================================
      // =                           Explain                          =
      // ==============================================================
      [e]: {
        "&-explain, &-extra": {
          clear: "both",
          color: t.colorTextDescription,
          fontSize: t.fontSize,
          lineHeight: t.lineHeight
        },
        "&-explain-connected": {
          width: "100%"
        },
        "&-extra": {
          minHeight: t.controlHeightSM,
          transition: `color ${t.motionDurationMid} ${t.motionEaseOut}`
          // sync input color transition
        },
        "&-explain": {
          "&-error": {
            color: t.colorError
          },
          "&-warning": {
            color: t.colorWarning
          }
        }
      },
      [`&-with-help ${e}-explain`]: {
        height: "auto",
        opacity: 1
      },
      // ==============================================================
      // =                        Feedback Icon                       =
      // ==============================================================
      [`${e}-feedback-icon`]: {
        fontSize: t.fontSize,
        textAlign: "center",
        visibility: "visible",
        animationName: zC,
        animationDuration: t.motionDurationMid,
        animationTimingFunction: t.motionEaseOutBack,
        pointerEvents: "none",
        "&-success": {
          color: t.colorSuccess
        },
        "&-error": {
          color: t.colorError
        },
        "&-warning": {
          color: t.colorWarning
        },
        "&-validating": {
          color: t.colorPrimary
        }
      }
    })
  };
}, koe = (t) => {
  const {
    componentCls: e,
    formItemCls: n,
    rootPrefixCls: i
  } = t;
  return {
    [`${e}-horizontal`]: {
      [`${n}-label`]: {
        flexGrow: 0
      },
      [`${n}-control`]: {
        flex: "1 1 0",
        // https://github.com/ant-design/ant-design/issues/32777
        // https://github.com/ant-design/ant-design/issues/33773
        minWidth: 0
      },
      // https://github.com/ant-design/ant-design/issues/32980
      [`${n}-label.${i}-col-24 + ${n}-control`]: {
        minWidth: "unset"
      }
    }
  };
}, Toe = (t) => {
  const {
    componentCls: e,
    formItemCls: n
  } = t;
  return {
    [`${e}-inline`]: {
      display: "flex",
      flexWrap: "wrap",
      [n]: {
        flex: "none",
        flexWrap: "nowrap",
        marginInlineEnd: t.margin,
        marginBottom: 0,
        "&-with-help": {
          marginBottom: t.marginLG
        },
        [`> ${n}-label,
        > ${n}-control`]: {
          display: "inline-block",
          verticalAlign: "top"
        },
        [`> ${n}-label`]: {
          flex: "none"
        },
        [`${e}-text`]: {
          display: "inline-block"
        },
        [`${n}-has-feedback`]: {
          display: "inline-block"
        }
      }
    }
  };
}, Vd = (t) => ({
  margin: 0,
  padding: `0 0 ${t.paddingXS}px`,
  whiteSpace: "initial",
  textAlign: "start",
  "> label": {
    margin: 0,
    "&::after": {
      display: "none"
    }
  }
}), Poe = (t) => {
  const {
    componentCls: e,
    formItemCls: n
  } = t;
  return {
    [`${n} ${n}-label`]: Vd(t),
    [e]: {
      [n]: {
        flexWrap: "wrap",
        [`${n}-label,
          ${n}-control`]: {
          flex: "0 0 100%",
          maxWidth: "100%"
        }
      }
    }
  };
}, Eoe = (t) => {
  const {
    componentCls: e,
    formItemCls: n,
    rootPrefixCls: i
  } = t;
  return {
    [`${e}-vertical`]: {
      [n]: {
        "&-row": {
          flexDirection: "column"
        },
        "&-label > label": {
          height: "auto"
        },
        [`${e}-item-control`]: {
          width: "100%"
        }
      }
    },
    [`${e}-vertical ${n}-label,
      .${i}-col-24${n}-label,
      .${i}-col-xl-24${n}-label`]: Vd(t),
    [`@media (max-width: ${t.screenXSMax}px)`]: [Poe(t), {
      [e]: {
        [`.${i}-col-xs-24${n}-label`]: Vd(t)
      }
    }],
    [`@media (max-width: ${t.screenSMMax}px)`]: {
      [e]: {
        [`.${i}-col-sm-24${n}-label`]: Vd(t)
      }
    },
    [`@media (max-width: ${t.screenMDMax}px)`]: {
      [e]: {
        [`.${i}-col-md-24${n}-label`]: Vd(t)
      }
    },
    [`@media (max-width: ${t.screenLGMax}px)`]: {
      [e]: {
        [`.${i}-col-lg-24${n}-label`]: Vd(t)
      }
    }
  };
}, $$ = Vn("Form", (t, e) => {
  let {
    rootPrefixCls: n
  } = e;
  const i = dn(t, {
    formItemCls: `${t.componentCls}-item`,
    rootPrefixCls: n
  });
  return [Coe(i), $oe(i), Soe(i), koe(i), Toe(i), Eoe(i), Oy(i), zC];
}), _oe = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ErrorList",
  inheritAttrs: !1,
  props: ["errors", "help", "onErrorVisibleChanged", "helpStatus", "warnings"],
  setup(t, e) {
    let {
      attrs: n
    } = e;
    const {
      prefixCls: i,
      status: o
    } = moe(), r = A(() => `${i.value}-item-explain`), a = A(() => !!(t.errors && t.errors.length)), l = de(o.value), [, s] = $$(i);
    return _e([a, o], () => {
      a.value && (l.value = o.value);
    }), () => {
      var u, c;
      const d = Sy(`${i.value}-show-help-item`), f = wC(`${i.value}-show-help-item`, d);
      return f.role = "alert", f.class = [s.value, r.value, n.class, `${i.value}-show-help`], v(zr, J(J({}, jc(`${i.value}-show-help`)), {}, {
        onAfterEnter: () => t.onErrorVisibleChanged(!0),
        onAfterLeave: () => t.onErrorVisibleChanged(!1)
      }), {
        default: () => [fa(v(mw, J(J({}, f), {}, {
          tag: "div"
        }), {
          default: () => [(c = t.errors) === null || c === void 0 ? void 0 : c.map((h, p) => v("div", {
            key: p,
            class: l.value ? `${r.value}-${l.value}` : ""
          }, [h]))]
        }), [[Qa, !!(!((u = t.errors) === null || u === void 0) && u.length)]])]
      });
    };
  }
}), Ioe = Oe({
  compatConfig: {
    MODE: 3
  },
  slots: Object,
  inheritAttrs: !1,
  props: ["prefixCls", "errors", "hasFeedback", "onDomErrorVisibleChange", "wrapperCol", "help", "extra", "status", "marginBottom", "onErrorVisibleChanged"],
  setup(t, e) {
    let {
      slots: n
    } = e;
    const i = O$(), {
      wrapperCol: o
    } = i, r = k({}, i);
    return delete r.labelCol, delete r.wrapperCol, rL(r), goe({
      prefixCls: A(() => t.prefixCls),
      status: A(() => t.status)
    }), () => {
      var a, l, s;
      const {
        prefixCls: u,
        wrapperCol: c,
        marginBottom: d,
        onErrorVisibleChanged: f,
        help: h = (a = n.help) === null || a === void 0 ? void 0 : a.call(n),
        errors: p = ho((l = n.errors) === null || l === void 0 ? void 0 : l.call(n)),
        // hasFeedback,
        // status,
        extra: g = (s = n.extra) === null || s === void 0 ? void 0 : s.call(n)
      } = t, m = `${u}-item`, y = c || o?.value || {}, b = Ae(`${m}-control`, y.class);
      return v(S$, J(J({}, y), {}, {
        class: b
      }), {
        default: () => {
          var w;
          return v(tt, null, [v("div", {
            class: `${m}-control-input`
          }, [v("div", {
            class: `${m}-control-input-content`
          }, [(w = n.default) === null || w === void 0 ? void 0 : w.call(n)])]), d !== null || p.length ? v("div", {
            style: {
              display: "flex",
              flexWrap: "nowrap"
            }
          }, [v(_oe, {
            errors: p,
            help: h,
            class: `${m}-explain-connected`,
            onErrorVisibleChanged: f
          }, null), !!d && v("div", {
            style: {
              width: 0,
              height: `${d}px`
            }
          }, null)]) : null, g ? v("div", {
            class: `${m}-extra`
          }, [g]) : null]);
        }
      });
    };
  }
});
function Moe(t) {
  const e = Te(t.value.slice());
  let n = null;
  return zt(() => {
    clearTimeout(n), n = setTimeout(() => {
      e.value = t.value;
    }, t.value.length ? 0 : 10);
  }), e;
}
ja("success", "warning", "error", "validating", "");
const Aoe = {
  success: Vu,
  warning: Qu,
  error: Wr,
  validating: Ya
};
function h1(t, e, n) {
  let i = t;
  const o = e;
  let r = 0;
  try {
    for (let a = o.length; r < a - 1 && !(!i && !n); ++r) {
      const l = o[r];
      if (l in i)
        i = i[l];
      else {
        if (n)
          throw Error("please transfer a valid name path to form item!");
        break;
      }
    }
    if (n && !i)
      throw Error("please transfer a valid name path to form item!");
  } catch {
    console.error("please transfer a valid name path to form item!");
  }
  return {
    o: i,
    k: o[r],
    v: i ? i[o[r]] : void 0
  };
}
const Roe = () => ({
  htmlFor: String,
  prefixCls: String,
  label: ve.any,
  help: ve.any,
  extra: ve.any,
  labelCol: {
    type: Object
  },
  wrapperCol: {
    type: Object
  },
  hasFeedback: {
    type: Boolean,
    default: !1
  },
  colon: {
    type: Boolean,
    default: void 0
  },
  labelAlign: String,
  prop: {
    type: [String, Number, Array]
  },
  name: {
    type: [String, Number, Array]
  },
  rules: [Array, Object],
  autoLink: {
    type: Boolean,
    default: !0
  },
  required: {
    type: Boolean,
    default: void 0
  },
  validateFirst: {
    type: Boolean,
    default: void 0
  },
  validateStatus: ve.oneOf(ja("", "success", "warning", "error", "validating")),
  validateTrigger: {
    type: [String, Array]
  },
  messageVariables: {
    type: Object
  },
  hidden: Boolean,
  noStyle: Boolean,
  tooltip: String
});
let Doe = 0;
const Noe = "form_item", Loe = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "AFormItem",
  inheritAttrs: !1,
  __ANT_NEW_FORM_ITEM: !0,
  props: Roe(),
  slots: Object,
  setup(t, e) {
    let {
      slots: n,
      attrs: i,
      expose: o
    } = e;
    Nn(t.prop === void 0, "`prop` is deprecated. Please use `name` instead.");
    const r = `form-item-${++Doe}`, {
      prefixCls: a
    } = Ht("form", t), [l, s] = $$(a), u = Te(), c = O$(), d = A(() => t.name || t.prop), f = Te([]), h = Te(!1), p = Te(), g = A(() => {
      const ae = d.value;
      return WO(ae);
    }), m = A(() => {
      if (g.value.length) {
        const ae = c.name.value, te = g.value.join("_");
        return ae ? `${ae}_${te}` : `${Noe}_${te}`;
      } else
        return;
    }), y = () => {
      const ae = c.model.value;
      if (!(!ae || !d.value))
        return h1(ae, g.value, !0).v;
    }, b = A(() => y()), w = Te(Gm(b.value)), $ = A(() => {
      let ae = t.validateTrigger !== void 0 ? t.validateTrigger : c.validateTrigger.value;
      return ae = ae === void 0 ? "change" : ae, Pu(ae);
    }), C = A(() => {
      let ae = c.rules.value;
      const te = t.rules, U = t.required !== void 0 ? {
        required: !!t.required,
        trigger: $.value
      } : [], me = h1(ae, g.value);
      ae = ae ? me.o[me.k] || me.v : [];
      const ce = [].concat(te || ae || []);
      return fB(ce, (ue) => ue.required) ? ce : ce.concat(U);
    }), P = A(() => {
      const ae = C.value;
      let te = !1;
      return ae && ae.length && ae.every((U) => U.required ? (te = !0, !1) : !0), te || t.required;
    }), O = Te();
    zt(() => {
      O.value = t.validateStatus;
    });
    const E = A(() => {
      let ae = {};
      return typeof t.label == "string" ? ae.label = t.label : t.name && (ae.label = String(t.name)), t.messageVariables && (ae = k(k({}, ae), t.messageVariables)), ae;
    }), _ = (ae) => {
      if (g.value.length === 0)
        return;
      const {
        validateFirst: te = !1
      } = t, {
        triggerName: U
      } = ae || {};
      let me = C.value;
      if (U && (me = me.filter((ue) => {
        const {
          trigger: fe
        } = ue;
        return !fe && !$.value.length ? !0 : Pu(fe || $.value).includes(U);
      })), !me.length)
        return Promise.resolve();
      const ce = iL(g.value, b.value, me, k({
        validateMessages: c.validateMessages.value
      }, ae), te, E.value);
      return O.value = "validating", f.value = [], ce.catch((ue) => ue).then(function() {
        let ue = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
        if (O.value === "validating") {
          const fe = ue.filter((he) => he && he.errors.length);
          O.value = fe.length ? "error" : "success", f.value = fe.map((he) => he.errors), c.onValidate(d.value, !f.value.length, f.value.length ? rr(f.value[0]) : null);
        }
      }), ce;
    }, D = () => {
      _({
        triggerName: "blur"
      });
    }, M = () => {
      if (h.value) {
        h.value = !1;
        return;
      }
      _({
        triggerName: "change"
      });
    }, N = () => {
      O.value = t.validateStatus, h.value = !1, f.value = [];
    }, L = () => {
      var ae;
      O.value = t.validateStatus, h.value = !0, f.value = [];
      const te = c.model.value || {}, U = b.value, me = h1(te, g.value, !0);
      Array.isArray(U) ? me.o[me.k] = [].concat((ae = w.value) !== null && ae !== void 0 ? ae : []) : me.o[me.k] = w.value, rn(() => {
        h.value = !1;
      });
    }, j = A(() => t.htmlFor === void 0 ? m.value : t.htmlFor), B = () => {
      const ae = j.value;
      if (!ae || !p.value)
        return;
      const te = p.value.$el.querySelector(`[id="${ae}"]`);
      te && te.focus && te.focus();
    };
    o({
      onFieldBlur: D,
      onFieldChange: M,
      clearValidate: N,
      resetField: L
    }), XG({
      id: m,
      onFieldBlur: () => {
        t.autoLink && D();
      },
      onFieldChange: () => {
        t.autoLink && M();
      },
      clearValidate: N
    }, A(() => !!(t.autoLink && c.model.value && d.value)));
    let Y = !1;
    _e(d, (ae) => {
      ae ? Y || (Y = !0, c.addField(r, {
        fieldValue: b,
        fieldId: m,
        fieldName: d,
        resetField: L,
        clearValidate: N,
        namePath: g,
        validateRules: _,
        rules: C
      })) : (Y = !1, c.removeField(r));
    }, {
      immediate: !0
    }), tn(() => {
      c.removeField(r);
    });
    const Q = Moe(f), G = A(() => t.validateStatus !== void 0 ? t.validateStatus : Q.value.length ? "error" : O.value), V = A(() => ({
      [`${a.value}-item`]: !0,
      [s.value]: !0,
      // Status
      [`${a.value}-item-has-feedback`]: G.value && t.hasFeedback,
      [`${a.value}-item-has-success`]: G.value === "success",
      [`${a.value}-item-has-warning`]: G.value === "warning",
      [`${a.value}-item-has-error`]: G.value === "error",
      [`${a.value}-item-is-validating`]: G.value === "validating",
      [`${a.value}-item-hidden`]: t.hidden
    })), H = Bn({});
    Fr.useProvide(H), zt(() => {
      let ae;
      if (t.hasFeedback) {
        const te = G.value && Aoe[G.value];
        ae = te ? v("span", {
          class: Ae(`${a.value}-item-feedback-icon`, `${a.value}-item-feedback-icon-${G.value}`)
        }, [v(te, null, null)]) : null;
      }
      k(H, {
        status: G.value,
        hasFeedback: t.hasFeedback,
        feedbackIcon: ae,
        isFormItemInput: !0
      });
    });
    const q = Te(null), K = Te(!1), ee = () => {
      if (u.value) {
        const ae = getComputedStyle(u.value);
        q.value = parseInt(ae.marginBottom, 10);
      }
    };
    Lt(() => {
      _e(K, () => {
        K.value && ee();
      }, {
        flush: "post",
        immediate: !0
      });
    });
    const ie = (ae) => {
      ae || (q.value = null);
    };
    return () => {
      var ae, te;
      if (t.noStyle) return (ae = n.default) === null || ae === void 0 ? void 0 : ae.call(n);
      const U = (te = t.help) !== null && te !== void 0 ? te : n.help ? ho(n.help()) : null, me = !!(U != null && Array.isArray(U) && U.length || Q.value.length);
      return K.value = me, l(v("div", {
        class: [V.value, me ? `${a.value}-item-with-help` : "", i.class],
        ref: u
      }, [v(G5, J(J({}, i), {}, {
        class: `${a.value}-item-row`,
        key: "row"
      }), {
        default: () => {
          var ce, ue;
          return v(tt, null, [v(C$, J(J({}, t), {}, {
            htmlFor: j.value,
            required: P.value,
            requiredMark: c.requiredMark.value,
            prefixCls: a.value,
            onClick: B,
            label: t.label
          }), {
            label: n.label,
            tooltip: n.tooltip
          }), v(Ioe, J(J({}, t), {}, {
            errors: U != null ? Pu(U) : Q.value,
            marginBottom: q.value,
            prefixCls: a.value,
            status: G.value,
            ref: p,
            help: U,
            extra: (ce = t.extra) !== null && ce !== void 0 ? ce : (ue = n.extra) === null || ue === void 0 ? void 0 : ue.call(n),
            onErrorVisibleChanged: ie
          }), {
            default: n.default
          })]);
        }
      }), !!q.value && v("div", {
        class: `${a.value}-margin-offset`,
        style: {
          marginBottom: `-${q.value}px`
        }
      }, null)]));
    };
  }
});
function lL(t) {
  let e = !1, n = t.length;
  const i = [];
  return t.length ? new Promise((o, r) => {
    t.forEach((a, l) => {
      a.catch((s) => (e = !0, s)).then((s) => {
        n -= 1, i[l] = s, !(n > 0) && (e && r(i), o(i));
      });
    });
  }) : Promise.resolve([]);
}
function ME(t) {
  let e = !1;
  return t && t.length && t.every((n) => n.required ? (e = !0, !1) : !0), e;
}
function AE(t) {
  return t == null ? [] : Array.isArray(t) ? t : [t];
}
function p1(t, e, n) {
  let i = t;
  e = e.replace(/\[(\w+)\]/g, ".$1"), e = e.replace(/^\./, "");
  const o = e.split(".");
  let r = 0;
  for (let a = o.length; r < a - 1 && !(!i && !n); ++r) {
    const l = o[r];
    if (l in i)
      i = i[l];
    else {
      if (n)
        throw new Error("please transfer a valid name path to validate!");
      break;
    }
  }
  return {
    o: i,
    k: o[r],
    v: i ? i[o[r]] : null,
    isValid: i && o[r] in i
  };
}
function zoe(t) {
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : de({}), n = arguments.length > 2 ? arguments[2] : void 0;
  const i = Gm(I(t)), o = Bn({}), r = Te([]), a = (w) => {
    k(I(t), k(k({}, Gm(i)), w)), rn(() => {
      Object.keys(o).forEach(($) => {
        o[$] = {
          autoLink: !1,
          required: ME(I(e)[$])
        };
      });
    });
  }, l = function() {
    let w = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], $ = arguments.length > 1 ? arguments[1] : void 0;
    return $.length ? w.filter((C) => {
      const P = AE(C.trigger || "change");
      return hB(P, $).length;
    }) : w;
  };
  let s = null;
  const u = function(w) {
    let $ = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, C = arguments.length > 2 ? arguments[2] : void 0;
    const P = [], O = {};
    for (let D = 0; D < w.length; D++) {
      const M = w[D], N = p1(I(t), M, C);
      if (!N.isValid) continue;
      O[M] = N.v;
      const L = l(I(e)[M], AE($ && $.trigger));
      L.length && P.push(c(M, N.v, L, $ || {}).then(() => ({
        name: M,
        errors: [],
        warnings: []
      })).catch((j) => {
        const B = [], Y = [];
        return j.forEach((Q) => {
          let {
            rule: {
              warningOnly: G
            },
            errors: V
          } = Q;
          G ? Y.push(...V) : B.push(...V);
        }), B.length ? Promise.reject({
          name: M,
          errors: B,
          warnings: Y
        }) : {
          name: M,
          errors: B,
          warnings: Y
        };
      }));
    }
    const E = lL(P);
    s = E;
    const _ = E.then(() => s === E ? Promise.resolve(O) : Promise.reject([])).catch((D) => {
      const M = D.filter((N) => N && N.errors.length);
      return M.length ? Promise.reject({
        values: O,
        errorFields: M,
        outOfDate: s !== E
      }) : Promise.resolve(O);
    });
    return _.catch((D) => D), _;
  }, c = function(w, $, C) {
    let P = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
    const O = iL([w], $, C, k({
      validateMessages: My
    }, P), !!P.validateFirst);
    return o[w] ? (o[w].validateStatus = "validating", O.catch((E) => E).then(function() {
      let E = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
      var _;
      if (o[w].validateStatus === "validating") {
        const D = E.filter((M) => M && M.errors.length);
        o[w].validateStatus = D.length ? "error" : "success", o[w].help = D.length ? D.map((M) => M.errors) : null, (_ = n?.onValidate) === null || _ === void 0 || _.call(n, w, !D.length, D.length ? rr(o[w].help[0]) : null);
      }
    }), O) : O.catch((E) => E);
  }, d = (w, $) => {
    let C = [], P = !0;
    w ? Array.isArray(w) ? C = w : C = [w] : (P = !1, C = r.value);
    const O = u(C, $ || {}, P);
    return O.catch((E) => E), O;
  }, f = (w) => {
    let $ = [];
    w ? Array.isArray(w) ? $ = w : $ = [w] : $ = r.value, $.forEach((C) => {
      o[C] && k(o[C], {
        validateStatus: "",
        help: null
      });
    });
  }, h = (w) => {
    const $ = {
      autoLink: !1
    }, C = [], P = Array.isArray(w) ? w : [w];
    for (let O = 0; O < P.length; O++) {
      const E = P[O];
      E?.validateStatus === "error" && ($.validateStatus = "error", E.help && C.push(E.help)), $.required = $.required || E?.required;
    }
    return $.help = C, $;
  };
  let p = i, g = !0;
  const m = (w) => {
    const $ = [];
    r.value.forEach((C) => {
      const P = p1(w, C, !1), O = p1(p, C, !1);
      (g && n?.immediate && P.isValid || !yw(P.v, O.v)) && $.push(C);
    }), d($, {
      trigger: "change"
    }), g = !1, p = Gm(rr(w));
  }, y = n?.debounce;
  let b = !0;
  return _e(e, () => {
    r.value = e ? Object.keys(I(e)) : [], !b && n && n.validateOnRuleChange && d(), b = !1;
  }, {
    deep: !0,
    immediate: !0
  }), _e(r, () => {
    const w = {};
    r.value.forEach(($) => {
      w[$] = k({}, o[$], {
        autoLink: !1,
        required: ME(I(e)[$])
      }), delete o[$];
    });
    for (const $ in o)
      Object.prototype.hasOwnProperty.call(o, $) && delete o[$];
    k(o, w);
  }, {
    immediate: !0
  }), _e(t, y && y.wait ? _A(m, y.wait, pB(y, ["wait"])) : m, {
    immediate: n && !!n.immediate,
    deep: !0
  }), {
    modelRef: t,
    rulesRef: e,
    initialModel: i,
    validateInfos: o,
    resetFields: a,
    validate: d,
    validateField: c,
    mergeValidateInfo: h,
    clearValidate: f
  };
}
const Boe = () => ({
  layout: ve.oneOf(ja("horizontal", "inline", "vertical")),
  labelCol: Vt(),
  wrapperCol: Vt(),
  colon: pt(),
  labelAlign: yn(),
  labelWrap: pt(),
  prefixCls: String,
  requiredMark: pn([String, Boolean]),
  /** @deprecated Will warning in future branch. Pls use `requiredMark` instead. */
  hideRequiredMark: pt(),
  model: ve.object,
  rules: Vt(),
  validateMessages: Vt(),
  validateOnRuleChange: pt(),
  // 提交失败自动滚动到第一个错误字段
  scrollToFirstError: Mr(),
  onSubmit: ot(),
  name: String,
  validateTrigger: pn([String, Array]),
  size: yn(),
  disabled: pt(),
  onValuesChange: ot(),
  onFieldsChange: ot(),
  onFinish: ot(),
  onFinishFailed: ot(),
  onValidate: ot()
});
function Foe(t, e) {
  return yw(Pu(t), Pu(e));
}
const hu = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "AForm",
  inheritAttrs: !1,
  props: Kn(Boe(), {
    layout: "horizontal",
    hideRequiredMark: !1,
    colon: !0
  }),
  Item: Loe,
  useForm: zoe,
  // emits: ['finishFailed', 'submit', 'finish', 'validate'],
  setup(t, e) {
    let {
      emit: n,
      slots: i,
      expose: o,
      attrs: r
    } = e;
    const {
      prefixCls: a,
      direction: l,
      form: s,
      size: u,
      disabled: c
    } = Ht("form", t), d = A(() => t.requiredMark === "" || t.requiredMark), f = A(() => {
      var Q;
      return d.value !== void 0 ? d.value : s && ((Q = s.value) === null || Q === void 0 ? void 0 : Q.requiredMark) !== void 0 ? s.value.requiredMark : !t.hideRequiredMark;
    });
    wN(u), VD(c);
    const h = A(() => {
      var Q, G;
      return (Q = t.colon) !== null && Q !== void 0 ? Q : (G = s.value) === null || G === void 0 ? void 0 : G.colon;
    }), {
      validateMessages: p
    } = Pq(), g = A(() => k(k(k({}, My), p.value), t.validateMessages)), [m, y] = $$(a), b = A(() => Ae(a.value, {
      [`${a.value}-${t.layout}`]: !0,
      [`${a.value}-hide-required-mark`]: f.value === !1,
      [`${a.value}-rtl`]: l.value === "rtl",
      [`${a.value}-${u.value}`]: u.value
    }, y.value)), w = de(), $ = {}, C = (Q, G) => {
      $[Q] = G;
    }, P = (Q) => {
      delete $[Q];
    }, O = (Q) => {
      const G = !!Q, V = G ? Pu(Q).map(WO) : [];
      return G ? Object.values($).filter((H) => V.findIndex((q) => Foe(q, H.fieldName.value)) > -1) : Object.values($);
    }, E = (Q) => {
      if (!t.model) {
        eo(!1, "Form", "model is required for resetFields to work.");
        return;
      }
      O(Q).forEach((G) => {
        G.resetField();
      });
    }, _ = (Q) => {
      O(Q).forEach((G) => {
        G.clearValidate();
      });
    }, D = (Q) => {
      const {
        scrollToFirstError: G
      } = t;
      if (n("finishFailed", Q), G && Q.errorFields.length) {
        let V = {};
        typeof G == "object" && (V = G), N(Q.errorFields[0].name, V);
      }
    }, M = function() {
      return B(...arguments);
    }, N = function(Q) {
      let G = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
      const V = O(Q ? [Q] : void 0);
      if (V.length) {
        const H = V[0].fieldId.value, q = H ? document.getElementById(H) : null;
        q && xK(q, k({
          scrollMode: "if-needed",
          block: "nearest"
        }, G));
      }
    }, L = function() {
      let Q = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0;
      if (Q === !0) {
        const G = [];
        return Object.values($).forEach((V) => {
          let {
            namePath: H
          } = V;
          G.push(H.value);
        }), EE(t.model, G);
      } else
        return EE(t.model, Q);
    }, j = (Q, G) => {
      if (eo(!(Q instanceof Function), "Form", "validateFields/validateField/validate not support callback, please use promise instead"), !t.model)
        return eo(!1, "Form", "model is required for validateFields to work."), Promise.reject("Form `model` is required for validateFields to work.");
      const V = !!Q, H = V ? Pu(Q).map(WO) : [], q = [];
      Object.values($).forEach((ie) => {
        var ae;
        if (V || H.push(ie.namePath.value), !(!((ae = ie.rules) === null || ae === void 0) && ae.value.length))
          return;
        const te = ie.namePath.value;
        if (!V || soe(H, te)) {
          const U = ie.validateRules(k({
            validateMessages: g.value
          }, G));
          q.push(U.then(() => ({
            name: te,
            errors: [],
            warnings: []
          })).catch((me) => {
            const ce = [], ue = [];
            return me.forEach((fe) => {
              let {
                rule: {
                  warningOnly: he
                },
                errors: le
              } = fe;
              he ? ue.push(...le) : ce.push(...le);
            }), ce.length ? Promise.reject({
              name: te,
              errors: ce,
              warnings: ue
            }) : {
              name: te,
              errors: ce,
              warnings: ue
            };
          }));
        }
      });
      const K = lL(q);
      w.value = K;
      const ee = K.then(() => w.value === K ? Promise.resolve(L(H)) : Promise.reject([])).catch((ie) => {
        const ae = ie.filter((te) => te && te.errors.length);
        return Promise.reject({
          values: L(H),
          errorFields: ae,
          outOfDate: w.value !== K
        });
      });
      return ee.catch((ie) => ie), ee;
    }, B = function() {
      return j(...arguments);
    }, Y = (Q) => {
      Q.preventDefault(), Q.stopPropagation(), n("submit", Q), t.model && j().then((V) => {
        n("finish", V);
      }).catch((V) => {
        D(V);
      });
    };
    return o({
      resetFields: E,
      clearValidate: _,
      validateFields: j,
      getFieldsValue: L,
      validate: M,
      scrollToField: N
    }), rL({
      model: A(() => t.model),
      name: A(() => t.name),
      labelAlign: A(() => t.labelAlign),
      labelCol: A(() => t.labelCol),
      labelWrap: A(() => t.labelWrap),
      wrapperCol: A(() => t.wrapperCol),
      vertical: A(() => t.layout === "vertical"),
      colon: h,
      requiredMark: f,
      validateTrigger: A(() => t.validateTrigger),
      rules: A(() => t.rules),
      addField: C,
      removeField: P,
      onValidate: (Q, G, V) => {
        n("validate", Q, G, V);
      },
      validateMessages: g
    }), _e(() => t.rules, () => {
      t.validateOnRuleChange && j();
    }), () => {
      var Q;
      return m(v("form", J(J({}, r), {}, {
        onSubmit: Y,
        class: [b.value, r.class]
      }), [(Q = i.default) === null || Q === void 0 ? void 0 : Q.call(i)]));
    };
  }
});
hu.useInjectFormItemContext = jr;
hu.ItemRest = mO;
hu.install = function(t) {
  return t.component(hu.name, hu), t.component(hu.Item.name, hu.Item), t.component(mO.name, mO), t;
};
const Voe = new gn("antCheckboxEffect", {
  "0%": {
    transform: "scale(1)",
    opacity: 0.5
  },
  "100%": {
    transform: "scale(1.6)",
    opacity: 0
  }
}), Qoe = (t) => {
  const {
    checkboxCls: e
  } = t, n = `${e}-wrapper`;
  return [
    // ===================== Basic =====================
    {
      // Group
      [`${e}-group`]: k(k({}, kn(t)), {
        display: "inline-flex",
        flexWrap: "wrap",
        columnGap: t.marginXS,
        // Group > Grid
        [`> ${t.antCls}-row`]: {
          flex: 1
        }
      }),
      // Wrapper
      [n]: k(k({}, kn(t)), {
        display: "inline-flex",
        alignItems: "baseline",
        cursor: "pointer",
        // Fix checkbox & radio in flex align #30260
        "&:after": {
          display: "inline-block",
          width: 0,
          overflow: "hidden",
          content: "'\\a0'"
        },
        // Checkbox near checkbox
        [`& + ${n}`]: {
          marginInlineStart: 0
        },
        [`&${n}-in-form-item`]: {
          'input[type="checkbox"]': {
            width: 14,
            height: 14
            // FIXME: magic
          }
        }
      }),
      // Wrapper > Checkbox
      [e]: k(k({}, kn(t)), {
        position: "relative",
        whiteSpace: "nowrap",
        lineHeight: 1,
        cursor: "pointer",
        // To make alignment right when `controlHeight` is changed
        // Ref: https://github.com/ant-design/ant-design/issues/41564
        alignSelf: "center",
        // Wrapper > Checkbox > input
        [`${e}-input`]: {
          position: "absolute",
          // Since baseline align will get additional space offset,
          // we need to move input to top to make it align with text.
          // Ref: https://github.com/ant-design/ant-design/issues/38926#issuecomment-1486137799
          inset: 0,
          zIndex: 1,
          cursor: "pointer",
          opacity: 0,
          margin: 0,
          [`&:focus-visible + ${e}-inner`]: k({}, _s(t))
        },
        // Wrapper > Checkbox > inner
        [`${e}-inner`]: {
          boxSizing: "border-box",
          position: "relative",
          top: 0,
          insetInlineStart: 0,
          display: "block",
          width: t.checkboxSize,
          height: t.checkboxSize,
          direction: "ltr",
          backgroundColor: t.colorBgContainer,
          border: `${t.lineWidth}px ${t.lineType} ${t.colorBorder}`,
          borderRadius: t.borderRadiusSM,
          borderCollapse: "separate",
          transition: `all ${t.motionDurationSlow}`,
          "&:after": {
            boxSizing: "border-box",
            position: "absolute",
            top: "50%",
            insetInlineStart: "21.5%",
            display: "table",
            width: t.checkboxSize / 14 * 5,
            height: t.checkboxSize / 14 * 8,
            border: `${t.lineWidthBold}px solid ${t.colorWhite}`,
            borderTop: 0,
            borderInlineStart: 0,
            transform: "rotate(45deg) scale(0) translate(-50%,-50%)",
            opacity: 0,
            content: '""',
            transition: `all ${t.motionDurationFast} ${t.motionEaseInBack}, opacity ${t.motionDurationFast}`
          }
        },
        // Wrapper > Checkbox + Text
        "& + span": {
          paddingInlineStart: t.paddingXS,
          paddingInlineEnd: t.paddingXS
        }
      })
    },
    // ================= Indeterminate =================
    {
      [e]: {
        "&-indeterminate": {
          // Wrapper > Checkbox > inner
          [`${e}-inner`]: {
            "&:after": {
              top: "50%",
              insetInlineStart: "50%",
              width: t.fontSizeLG / 2,
              height: t.fontSizeLG / 2,
              backgroundColor: t.colorPrimary,
              border: 0,
              transform: "translate(-50%, -50%) scale(1)",
              opacity: 1,
              content: '""'
            }
          }
        }
      }
    },
    // ===================== Hover =====================
    {
      // Wrapper
      [`${n}:hover ${e}:after`]: {
        visibility: "visible"
      },
      // Wrapper & Wrapper > Checkbox
      [`
        ${n}:not(${n}-disabled),
        ${e}:not(${e}-disabled)
      `]: {
        [`&:hover ${e}-inner`]: {
          borderColor: t.colorPrimary
        }
      },
      [`${n}:not(${n}-disabled)`]: {
        [`&:hover ${e}-checked:not(${e}-disabled) ${e}-inner`]: {
          backgroundColor: t.colorPrimaryHover,
          borderColor: "transparent"
        },
        [`&:hover ${e}-checked:not(${e}-disabled):after`]: {
          borderColor: t.colorPrimaryHover
        }
      }
    },
    // ==================== Checked ====================
    {
      // Wrapper > Checkbox
      [`${e}-checked`]: {
        [`${e}-inner`]: {
          backgroundColor: t.colorPrimary,
          borderColor: t.colorPrimary,
          "&:after": {
            opacity: 1,
            transform: "rotate(45deg) scale(1) translate(-50%,-50%)",
            transition: `all ${t.motionDurationMid} ${t.motionEaseOutBack} ${t.motionDurationFast}`
          }
        },
        // Checked Effect
        "&:after": {
          position: "absolute",
          top: 0,
          insetInlineStart: 0,
          width: "100%",
          height: "100%",
          borderRadius: t.borderRadiusSM,
          visibility: "hidden",
          border: `${t.lineWidthBold}px solid ${t.colorPrimary}`,
          animationName: Voe,
          animationDuration: t.motionDurationSlow,
          animationTimingFunction: "ease-in-out",
          animationFillMode: "backwards",
          content: '""',
          transition: `all ${t.motionDurationSlow}`
        }
      },
      [`
        ${n}-checked:not(${n}-disabled),
        ${e}-checked:not(${e}-disabled)
      `]: {
        [`&:hover ${e}-inner`]: {
          backgroundColor: t.colorPrimaryHover,
          borderColor: "transparent"
        },
        [`&:hover ${e}:after`]: {
          borderColor: t.colorPrimaryHover
        }
      }
    },
    // ==================== Disable ====================
    {
      // Wrapper
      [`${n}-disabled`]: {
        cursor: "not-allowed"
      },
      // Wrapper > Checkbox
      [`${e}-disabled`]: {
        // Wrapper > Checkbox > input
        [`&, ${e}-input`]: {
          cursor: "not-allowed",
          // Disabled for native input to enable Tooltip event handler
          // ref: https://github.com/ant-design/ant-design/issues/39822#issuecomment-1365075901
          pointerEvents: "none"
        },
        // Wrapper > Checkbox > inner
        [`${e}-inner`]: {
          background: t.colorBgContainerDisabled,
          borderColor: t.colorBorder,
          "&:after": {
            borderColor: t.colorTextDisabled
          }
        },
        "&:after": {
          display: "none"
        },
        "& + span": {
          color: t.colorTextDisabled
        },
        [`&${e}-indeterminate ${e}-inner::after`]: {
          background: t.colorTextDisabled
        }
      }
    }
  ];
};
function sL(t, e) {
  const n = dn(e, {
    checkboxCls: `.${t}`,
    checkboxSize: e.controlInteractiveSize
  });
  return [Qoe(n)];
}
const uL = Vn("Checkbox", (t, e) => {
  let {
    prefixCls: n
  } = e;
  return [sL(n, t)];
}), Hoe = () => ({
  name: String,
  prefixCls: String,
  options: ui([]),
  disabled: Boolean,
  id: String
}), Woe = () => k(k({}, Hoe()), {
  defaultValue: ui(),
  value: ui(),
  onChange: ot(),
  "onUpdate:value": ot()
}), joe = () => ({
  prefixCls: String,
  defaultChecked: pt(),
  checked: pt(),
  disabled: pt(),
  isGroup: pt(),
  value: ve.any,
  name: String,
  id: String,
  indeterminate: pt(),
  type: yn("checkbox"),
  autofocus: pt(),
  onChange: ot(),
  "onUpdate:checked": ot(),
  onClick: ot(),
  skipGroup: pt(!1)
}), qoe = () => k(k({}, joe()), {
  indeterminate: pt(!1)
}), cL = Symbol("CheckboxGroupContext");
var RE = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
const fo = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ACheckbox",
  inheritAttrs: !1,
  __ANT_CHECKBOX: !0,
  props: qoe(),
  // emits: ['change', 'update:checked'],
  setup(t, e) {
    let {
      emit: n,
      attrs: i,
      slots: o,
      expose: r
    } = e;
    const a = jr(), l = Fr.useInject(), {
      prefixCls: s,
      direction: u,
      disabled: c
    } = Ht("checkbox", t), d = qa(), [f, h] = uL(s), p = qt(cL, void 0), g = Symbol("checkboxUniId"), m = A(() => p?.disabled.value || c.value);
    zt(() => {
      !t.skipGroup && p && p.registerValue(g, t.value);
    }), tn(() => {
      p && p.cancelValue(g);
    }), Lt(() => {
      eo(!!(t.checked !== void 0 || p || t.value === void 0), "Checkbox", "`value` is not validate prop, do you mean `checked`?");
    });
    const y = (C) => {
      const P = C.target.checked;
      n("update:checked", P), n("change", C), a.onFieldChange();
    }, b = de();
    return r({
      focus: () => {
        var C;
        (C = b.value) === null || C === void 0 || C.focus();
      },
      blur: () => {
        var C;
        (C = b.value) === null || C === void 0 || C.blur();
      }
    }), () => {
      var C;
      const P = Wi((C = o.default) === null || C === void 0 ? void 0 : C.call(o)), {
        indeterminate: O,
        skipGroup: E,
        id: _ = a.id.value
      } = t, D = RE(t, ["indeterminate", "skipGroup", "id"]), {
        onMouseenter: M,
        onMouseleave: N,
        onInput: L,
        class: j,
        style: B
      } = i, Y = RE(i, ["onMouseenter", "onMouseleave", "onInput", "class", "style"]), Q = k(k(k(k({}, D), {
        id: _,
        prefixCls: s.value
      }), Y), {
        disabled: m.value
      });
      p && !E ? (Q.onChange = function() {
        for (var q = arguments.length, K = new Array(q), ee = 0; ee < q; ee++)
          K[ee] = arguments[ee];
        n("change", ...K), p.toggleOption({
          label: P,
          value: t.value
        });
      }, Q.name = p.name.value, Q.checked = p.mergedValue.value.includes(t.value), Q.disabled = m.value || d.value, Q.indeterminate = O) : Q.onChange = y;
      const G = Ae({
        [`${s.value}-wrapper`]: !0,
        [`${s.value}-rtl`]: u.value === "rtl",
        [`${s.value}-wrapper-checked`]: Q.checked,
        [`${s.value}-wrapper-disabled`]: Q.disabled,
        [`${s.value}-wrapper-in-form-item`]: l.isFormItemInput
      }, j, h.value), V = Ae({
        [`${s.value}-indeterminate`]: O
      }, h.value);
      return f(v("label", {
        class: G,
        style: B,
        onMouseenter: M,
        onMouseleave: N
      }, [v(y5, J(J({
        "aria-checked": O ? "mixed" : void 0
      }, Q), {}, {
        class: V,
        ref: b
      }), null), P.length ? v("span", null, [P]) : null]));
    };
  }
}), qO = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ACheckboxGroup",
  inheritAttrs: !1,
  props: Woe(),
  // emits: ['change', 'update:value'],
  setup(t, e) {
    let {
      slots: n,
      attrs: i,
      emit: o,
      expose: r
    } = e;
    const a = jr(), {
      prefixCls: l,
      direction: s
    } = Ht("checkbox", t), u = A(() => `${l.value}-group`), [c, d] = uL(u), f = de((t.value === void 0 ? t.defaultValue : t.value) || []);
    _e(() => t.value, () => {
      f.value = t.value || [];
    });
    const h = A(() => t.options.map(($) => typeof $ == "string" || typeof $ == "number" ? {
      label: $,
      value: $
    } : $)), p = de(Symbol()), g = de(/* @__PURE__ */ new Map()), m = ($) => {
      g.value.delete($), p.value = Symbol();
    }, y = ($, C) => {
      g.value.set($, C), p.value = Symbol();
    }, b = de(/* @__PURE__ */ new Map());
    return _e(p, () => {
      const $ = /* @__PURE__ */ new Map();
      for (const C of g.value.values())
        $.set(C, !0);
      b.value = $;
    }), Xt(cL, {
      cancelValue: m,
      registerValue: y,
      toggleOption: ($) => {
        const C = f.value.indexOf($.value), P = [...f.value];
        C === -1 ? P.push($.value) : P.splice(C, 1), t.value === void 0 && (f.value = P);
        const O = P.filter((E) => b.value.has(E)).sort((E, _) => {
          const D = h.value.findIndex((N) => N.value === E), M = h.value.findIndex((N) => N.value === _);
          return D - M;
        });
        o("update:value", O), o("change", O), a.onFieldChange();
      },
      mergedValue: f,
      name: A(() => t.name),
      disabled: A(() => t.disabled)
    }), r({
      mergedValue: f
    }), () => {
      var $;
      const {
        id: C = a.id.value
      } = t;
      let P = null;
      return h.value && h.value.length > 0 && (P = h.value.map((O) => {
        var E;
        return v(fo, {
          prefixCls: l.value,
          key: O.value.toString(),
          disabled: "disabled" in O ? O.disabled : t.disabled,
          indeterminate: O.indeterminate,
          value: O.value,
          checked: f.value.indexOf(O.value) !== -1,
          onChange: O.onChange,
          class: `${u.value}-item`
        }, {
          default: () => [n.label !== void 0 ? (E = n.label) === null || E === void 0 ? void 0 : E.call(n, O) : O.label]
        });
      })), c(v("div", J(J({}, i), {}, {
        class: [u.value, {
          [`${u.value}-rtl`]: s.value === "rtl"
        }, i.class, d.value],
        id: C
      }), [P || (($ = n.default) === null || $ === void 0 ? void 0 : $.call(n))]));
    };
  }
});
fo.Group = qO;
fo.install = function(t) {
  return t.component(fo.name, fo), t.component(qO.name, qO), t;
};
const Yoe = ya(S$);
let mv = k({}, ks.Modal);
function Koe(t) {
  t ? mv = k(k({}, mv), t) : mv = k({}, ks.Modal);
}
function Xoe() {
  return mv;
}
const YO = "internalMark", vv = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ALocaleProvider",
  props: {
    locale: {
      type: Object
    },
    ANT_MARK__: String
  },
  setup(t, e) {
    let {
      slots: n
    } = e;
    eo(t.ANT_MARK__ === YO, "LocaleProvider", "`LocaleProvider` is deprecated. Please use `locale` with `ConfigProvider` instead");
    const i = Bn({
      antLocale: k(k({}, t.locale), {
        exist: !0
      }),
      ANT_MARK__: YO
    });
    return Xt("localeData", i), _e(() => t.locale, (o) => {
      Koe(o && o.Modal), i.antLocale = k(k({}, o), {
        exist: !0
      });
    }, {
      immediate: !0
    }), () => {
      var o;
      return (o = n.default) === null || o === void 0 ? void 0 : o.call(n);
    };
  }
});
vv.install = function(t) {
  return t.component(vv.name, vv), t;
};
const Zoe = ya(vv), Ry = Oe({
  name: "Notice",
  inheritAttrs: !1,
  props: ["prefixCls", "duration", "updateMark", "noticeKey", "closeIcon", "closable", "props", "onClick", "onClose", "holder", "visible"],
  setup(t, e) {
    let {
      attrs: n,
      slots: i
    } = e, o, r = !1;
    const a = A(() => t.duration === void 0 ? 4.5 : t.duration), l = () => {
      a.value && !r && (o = setTimeout(() => {
        u();
      }, a.value * 1e3));
    }, s = () => {
      o && (clearTimeout(o), o = null);
    }, u = (d) => {
      d && d.stopPropagation(), s();
      const {
        onClose: f,
        noticeKey: h
      } = t;
      f && f(h);
    }, c = () => {
      s(), l();
    };
    return Lt(() => {
      l();
    }), wo(() => {
      r = !0, s();
    }), _e([a, () => t.updateMark, () => t.visible], (d, f) => {
      let [h, p, g] = d, [m, y, b] = f;
      (h !== m || p !== y || g !== b && b) && c();
    }, {
      flush: "post"
    }), () => {
      var d, f;
      const {
        prefixCls: h,
        closable: p,
        closeIcon: g = (d = i.closeIcon) === null || d === void 0 ? void 0 : d.call(i),
        onClick: m,
        holder: y
      } = t, {
        class: b,
        style: w
      } = n, $ = `${h}-notice`, C = Object.keys(n).reduce((O, E) => ((E.startsWith("data-") || E.startsWith("aria-") || E === "role") && (O[E] = n[E]), O), {}), P = v("div", J({
        class: Ae($, b, {
          [`${$}-closable`]: p
        }),
        style: w,
        onMouseenter: s,
        onMouseleave: l,
        onClick: m
      }, C), [v("div", {
        class: `${$}-content`
      }, [(f = i.default) === null || f === void 0 ? void 0 : f.call(i)]), p ? v("a", {
        tabindex: 0,
        onClick: u,
        class: `${$}-close`
      }, [g || v("span", {
        class: `${$}-close-x`
      }, null)]) : null]);
      return y ? v(D0, {
        to: y
      }, {
        default: () => P
      }) : P;
    };
  }
});
var Goe = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
let DE = 0;
const Uoe = Date.now();
function NE() {
  const t = DE;
  return DE += 1, `rcNotification_${Uoe}_${t}`;
}
const r0 = Oe({
  name: "Notification",
  inheritAttrs: !1,
  props: ["prefixCls", "transitionName", "animation", "maxCount", "closeIcon", "hashId"],
  setup(t, e) {
    let {
      attrs: n,
      expose: i,
      slots: o
    } = e;
    const r = /* @__PURE__ */ new Map(), a = de([]), l = A(() => {
      const {
        prefixCls: c,
        animation: d = "fade"
      } = t;
      let f = t.transitionName;
      return !f && d && (f = `${c}-${d}`), wC(f);
    }), s = (c, d) => {
      const f = c.key || NE(), h = k(k({}, c), {
        key: f
      }), {
        maxCount: p
      } = t, g = a.value.map((y) => y.notice.key).indexOf(f), m = a.value.concat();
      g !== -1 ? m.splice(g, 1, {
        notice: h,
        holderCallback: d
      }) : (p && a.value.length >= p && (h.key = m[0].notice.key, h.updateMark = NE(), h.userPassKey = f, m.shift()), m.push({
        notice: h,
        holderCallback: d
      })), a.value = m;
    }, u = (c) => {
      a.value = rr(a.value).filter((d) => {
        let {
          notice: {
            key: f,
            userPassKey: h
          }
        } = d;
        return (h || f) !== c;
      });
    };
    return i({
      add: s,
      remove: u,
      notices: a
    }), () => {
      var c;
      const {
        prefixCls: d,
        closeIcon: f = (c = o.closeIcon) === null || c === void 0 ? void 0 : c.call(o, {
          prefixCls: d
        })
      } = t, h = a.value.map((g, m) => {
        let {
          notice: y,
          holderCallback: b
        } = g;
        const w = m === a.value.length - 1 ? y.updateMark : void 0, {
          key: $,
          userPassKey: C
        } = y, {
          content: P
        } = y, O = k(k(k({
          prefixCls: d,
          closeIcon: typeof f == "function" ? f({
            prefixCls: d
          }) : f
        }, y), y.props), {
          key: $,
          noticeKey: C || $,
          updateMark: w,
          onClose: (E) => {
            var _;
            u(E), (_ = y.onClose) === null || _ === void 0 || _.call(y);
          },
          onClick: y.onClick
        });
        return b ? v("div", {
          key: $,
          class: `${d}-hook-holder`,
          ref: (E) => {
            typeof $ > "u" || (E ? (r.set($, E), b(E, O)) : r.delete($));
          }
        }, null) : v(Ry, J(J({}, O), {}, {
          class: Ae(O.class, t.hashId)
        }), {
          default: () => [typeof P == "function" ? P({
            prefixCls: d
          }) : P]
        });
      }), p = {
        [d]: 1,
        [n.class]: !!n.class,
        [t.hashId]: !0
      };
      return v("div", {
        class: p,
        style: n.style || {
          top: "65px",
          left: "50%"
        }
      }, [v(mw, J({
        tag: "div"
      }, l.value), {
        default: () => [h]
      })]);
    };
  }
});
r0.newInstance = function(e, n) {
  const i = e || {}, {
    name: o = "notification",
    getContainer: r,
    appContext: a,
    prefixCls: l,
    rootPrefixCls: s,
    transitionName: u,
    hasTransitionName: c,
    useStyle: d
  } = i, f = Goe(i, ["name", "getContainer", "appContext", "prefixCls", "rootPrefixCls", "transitionName", "hasTransitionName", "useStyle"]), h = document.createElement("div");
  r ? r().appendChild(h) : document.body.appendChild(h);
  const p = Oe({
    compatConfig: {
      MODE: 3
    },
    name: "NotificationWrapper",
    setup(m, y) {
      let {
        attrs: b
      } = y;
      const w = Te(), $ = A(() => Eo.getPrefixCls(o, l)), [, C] = d($);
      return Lt(() => {
        n({
          notice(P) {
            var O;
            (O = w.value) === null || O === void 0 || O.add(P);
          },
          removeNotice(P) {
            var O;
            (O = w.value) === null || O === void 0 || O.remove(P);
          },
          destroy() {
            _u(null, h), h.parentNode && h.parentNode.removeChild(h);
          },
          component: w
        });
      }), () => {
        const P = Eo, O = P.getRootPrefixCls(s, $.value), E = c ? u : `${$.value}-${u}`;
        return v(xs, J(J({}, P), {}, {
          prefixCls: O
        }), {
          default: () => [v(r0, J(J({
            ref: w
          }, b), {}, {
            prefixCls: $.value,
            transitionName: E,
            hashId: C.value
          }), null)]
        });
      };
    }
  }), g = v(p, f);
  g.appContext = a || g.appContext, _u(g, h);
};
let LE = 0;
const Joe = Date.now();
function zE() {
  const t = LE;
  return LE += 1, `rcNotification_${Joe}_${t}`;
}
const ere = Oe({
  name: "HookNotification",
  inheritAttrs: !1,
  props: ["prefixCls", "transitionName", "animation", "maxCount", "closeIcon", "hashId", "remove", "notices", "getStyles", "getClassName", "onAllRemoved", "getContainer"],
  setup(t, e) {
    let {
      attrs: n,
      slots: i
    } = e;
    const o = /* @__PURE__ */ new Map(), r = A(() => t.notices), a = A(() => {
      let c = t.transitionName;
      if (!c && t.animation)
        switch (typeof t.animation) {
          case "string":
            c = t.animation;
            break;
          case "function":
            c = t.animation().name;
            break;
          case "object":
            c = t.animation.name;
            break;
          default:
            c = `${t.prefixCls}-fade`;
            break;
        }
      return wC(c);
    }), l = (c) => t.remove(c), s = de({});
    _e(r, () => {
      const c = {};
      Object.keys(s.value).forEach((d) => {
        c[d] = [];
      }), t.notices.forEach((d) => {
        const {
          placement: f = "topRight"
        } = d.notice;
        f && (c[f] = c[f] || [], c[f].push(d));
      }), s.value = c;
    });
    const u = A(() => Object.keys(s.value));
    return () => {
      var c;
      const {
        prefixCls: d,
        closeIcon: f = (c = i.closeIcon) === null || c === void 0 ? void 0 : c.call(i, {
          prefixCls: d
        })
      } = t, h = u.value.map((p) => {
        var g, m;
        const y = s.value[p], b = (g = t.getClassName) === null || g === void 0 ? void 0 : g.call(t, p), w = (m = t.getStyles) === null || m === void 0 ? void 0 : m.call(t, p), $ = y.map((O, E) => {
          let {
            notice: _,
            holderCallback: D
          } = O;
          const M = E === r.value.length - 1 ? _.updateMark : void 0, {
            key: N,
            userPassKey: L
          } = _, {
            content: j
          } = _, B = k(k(k({
            prefixCls: d,
            closeIcon: typeof f == "function" ? f({
              prefixCls: d
            }) : f
          }, _), _.props), {
            key: N,
            noticeKey: L || N,
            updateMark: M,
            onClose: (Y) => {
              var Q;
              l(Y), (Q = _.onClose) === null || Q === void 0 || Q.call(_);
            },
            onClick: _.onClick
          });
          return D ? v("div", {
            key: N,
            class: `${d}-hook-holder`,
            ref: (Y) => {
              typeof N > "u" || (Y ? (o.set(N, Y), D(Y, B)) : o.delete(N));
            }
          }, null) : v(Ry, J(J({}, B), {}, {
            class: Ae(B.class, t.hashId)
          }), {
            default: () => [typeof j == "function" ? j({
              prefixCls: d
            }) : j]
          });
        }), C = {
          [d]: 1,
          [`${d}-${p}`]: 1,
          [n.class]: !!n.class,
          [t.hashId]: !0,
          [b]: !!b
        };
        function P() {
          var O;
          y.length > 0 || (Reflect.deleteProperty(s.value, p), (O = t.onAllRemoved) === null || O === void 0 || O.call(t));
        }
        return v("div", {
          key: p,
          class: C,
          style: n.style || w || {
            top: "65px",
            left: "50%"
          }
        }, [v(mw, J(J({
          tag: "div"
        }, a.value), {}, {
          onAfterLeave: P
        }), {
          default: () => [$]
        })]);
      });
      return v(YN, {
        getContainer: t.getContainer
      }, {
        default: () => [h]
      });
    };
  }
});
var tre = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
const nre = () => document.body;
let BE = 0;
function ire() {
  const t = {};
  for (var e = arguments.length, n = new Array(e), i = 0; i < e; i++)
    n[i] = arguments[i];
  return n.forEach((o) => {
    o && Object.keys(o).forEach((r) => {
      const a = o[r];
      a !== void 0 && (t[r] = a);
    });
  }), t;
}
function dL() {
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
  const {
    getContainer: e = nre,
    motion: n,
    prefixCls: i,
    maxCount: o,
    getClassName: r,
    getStyles: a,
    onAllRemoved: l
  } = t, s = tre(t, ["getContainer", "motion", "prefixCls", "maxCount", "getClassName", "getStyles", "onAllRemoved"]), u = Te([]), c = Te(), d = (y, b) => {
    const w = y.key || zE(), $ = k(k({}, y), {
      key: w
    }), C = u.value.map((O) => O.notice.key).indexOf(w), P = u.value.concat();
    C !== -1 ? P.splice(C, 1, {
      notice: $,
      holderCallback: b
    }) : (o && u.value.length >= o && ($.key = P[0].notice.key, $.updateMark = zE(), $.userPassKey = w, P.shift()), P.push({
      notice: $,
      holderCallback: b
    })), u.value = P;
  }, f = (y) => {
    u.value = u.value.filter((b) => {
      let {
        notice: {
          key: w,
          userPassKey: $
        }
      } = b;
      return ($ || w) !== y;
    });
  }, h = () => {
    u.value = [];
  }, p = () => v(ere, {
    ref: c,
    prefixCls: i,
    maxCount: o,
    notices: u.value,
    remove: f,
    getClassName: r,
    getStyles: a,
    animation: n,
    hashId: t.hashId,
    onAllRemoved: l,
    getContainer: e
  }, null), g = Te([]), m = {
    open: (y) => {
      const b = ire(s, y);
      (b.key === null || b.key === void 0) && (b.key = `vc-notification-${BE}`, BE += 1), g.value = [...g.value, {
        type: "open",
        config: b
      }];
    },
    close: (y) => {
      g.value = [...g.value, {
        type: "close",
        key: y
      }];
    },
    destroy: () => {
      g.value = [...g.value, {
        type: "destroy"
      }];
    }
  };
  return _e(g, () => {
    g.value.length && (g.value.forEach((y) => {
      switch (y.type) {
        case "open":
          d(y.config);
          break;
        case "close":
          f(y.key);
          break;
        case "destroy":
          h();
          break;
      }
    }), g.value = []);
  }), [m, p];
}
const ore = (t) => {
  const {
    componentCls: e,
    iconCls: n,
    boxShadowSecondary: i,
    colorBgElevated: o,
    colorSuccess: r,
    colorError: a,
    colorWarning: l,
    colorInfo: s,
    fontSizeLG: u,
    motionEaseInOutCirc: c,
    motionDurationSlow: d,
    marginXS: f,
    paddingXS: h,
    borderRadiusLG: p,
    zIndexPopup: g,
    // Custom token
    messageNoticeContentPadding: m
  } = t, y = new gn("MessageMoveIn", {
    "0%": {
      padding: 0,
      transform: "translateY(-100%)",
      opacity: 0
    },
    "100%": {
      padding: h,
      transform: "translateY(0)",
      opacity: 1
    }
  }), b = new gn("MessageMoveOut", {
    "0%": {
      maxHeight: t.height,
      padding: h,
      opacity: 1
    },
    "100%": {
      maxHeight: 0,
      padding: 0,
      opacity: 0
    }
  });
  return [
    // ============================ Holder ============================
    {
      [e]: k(k({}, kn(t)), {
        position: "fixed",
        top: f,
        left: "50%",
        transform: "translateX(-50%)",
        width: "100%",
        pointerEvents: "none",
        zIndex: g,
        [`${e}-move-up`]: {
          animationFillMode: "forwards"
        },
        [`
        ${e}-move-up-appear,
        ${e}-move-up-enter
      `]: {
          animationName: y,
          animationDuration: d,
          animationPlayState: "paused",
          animationTimingFunction: c
        },
        [`
        ${e}-move-up-appear${e}-move-up-appear-active,
        ${e}-move-up-enter${e}-move-up-enter-active
      `]: {
          animationPlayState: "running"
        },
        [`${e}-move-up-leave`]: {
          animationName: b,
          animationDuration: d,
          animationPlayState: "paused",
          animationTimingFunction: c
        },
        [`${e}-move-up-leave${e}-move-up-leave-active`]: {
          animationPlayState: "running"
        },
        "&-rtl": {
          direction: "rtl",
          span: {
            direction: "rtl"
          }
        }
      })
    },
    // ============================ Notice ============================
    {
      [`${e}-notice`]: {
        padding: h,
        textAlign: "center",
        [n]: {
          verticalAlign: "text-bottom",
          marginInlineEnd: f,
          fontSize: u
        },
        [`${e}-notice-content`]: {
          display: "inline-block",
          padding: m,
          background: o,
          borderRadius: p,
          boxShadow: i,
          pointerEvents: "all"
        },
        [`${e}-success ${n}`]: {
          color: r
        },
        [`${e}-error ${n}`]: {
          color: a
        },
        [`${e}-warning ${n}`]: {
          color: l
        },
        [`
        ${e}-info ${n},
        ${e}-loading ${n}`]: {
          color: s
        }
      }
    },
    // ============================= Pure =============================
    {
      [`${e}-notice-pure-panel`]: {
        padding: 0,
        textAlign: "start"
      }
    }
  ];
}, k$ = Vn("Message", (t) => {
  const e = dn(t, {
    messageNoticeContentPadding: `${(t.controlHeightLG - t.fontSize * t.lineHeight) / 2}px ${t.paddingSM}px`
  });
  return [ore(e)];
}, (t) => ({
  height: 150,
  zIndexPopup: t.zIndexPopupBase + 10
})), rre = {
  info: v(ld, null, null),
  success: v(Vu, null, null),
  error: v(Wr, null, null),
  warning: v(Qu, null, null),
  loading: v(Ya, null, null)
}, fL = Oe({
  name: "PureContent",
  inheritAttrs: !1,
  props: ["prefixCls", "type", "icon"],
  setup(t, e) {
    let {
      slots: n
    } = e;
    return () => {
      var i;
      return v("div", {
        class: Ae(`${t.prefixCls}-custom-content`, `${t.prefixCls}-${t.type}`)
      }, [t.icon || rre[t.type], v("span", null, [(i = n.default) === null || i === void 0 ? void 0 : i.call(n)])]);
    };
  }
});
Oe({
  name: "PurePanel",
  inheritAttrs: !1,
  props: ["prefixCls", "class", "type", "icon", "content"],
  setup(t, e) {
    let {
      slots: n,
      attrs: i
    } = e;
    var o;
    const {
      getPrefixCls: r
    } = oy(), a = A(() => t.prefixCls || r("message")), [, l] = k$(a);
    return v(Ry, J(J({}, i), {}, {
      prefixCls: a.value,
      class: Ae(l.value, `${a.value}-notice-pure-panel`),
      noticeKey: "pure",
      duration: null
    }), {
      default: () => [v(fL, {
        prefixCls: a.value,
        type: t.type,
        icon: t.icon
      }, {
        default: () => [(o = n.default) === null || o === void 0 ? void 0 : o.call(n)]
      })]
    });
  }
});
var are = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
const lre = 8, sre = 3, ure = Oe({
  name: "Holder",
  inheritAttrs: !1,
  props: ["top", "prefixCls", "getContainer", "maxCount", "duration", "rtl", "transitionName", "onAllRemoved", "animation", "staticGetContainer"],
  setup(t, e) {
    let {
      expose: n
    } = e;
    var i, o;
    const {
      getPrefixCls: r,
      getPopupContainer: a
    } = Ht("message", t), l = A(() => r("message", t.prefixCls)), [, s] = k$(l), u = () => {
      var g;
      const m = (g = t.top) !== null && g !== void 0 ? g : lre;
      return {
        left: "50%",
        transform: "translateX(-50%)",
        top: typeof m == "number" ? `${m}px` : m
      };
    }, c = () => Ae(s.value, t.rtl ? `${l.value}-rtl` : ""), d = () => {
      var g;
      return vC({
        prefixCls: l.value,
        animation: (g = t.animation) !== null && g !== void 0 ? g : "move-up",
        transitionName: t.transitionName
      });
    }, f = v("span", {
      class: `${l.value}-close-x`
    }, [v(Ll, {
      class: `${l.value}-close-icon`
    }, null)]), [h, p] = dL({
      //@ts-ignore
      getStyles: u,
      prefixCls: l.value,
      getClassName: c,
      motion: d,
      closable: !1,
      closeIcon: f,
      duration: (i = t.duration) !== null && i !== void 0 ? i : sre,
      getContainer: (o = t.staticGetContainer) !== null && o !== void 0 ? o : a.value,
      maxCount: t.maxCount,
      onAllRemoved: t.onAllRemoved
    });
    return n(k(k({}, h), {
      prefixCls: l,
      hashId: s
    })), p;
  }
});
let FE = 0;
function cre(t) {
  const e = Te(null), n = Symbol("messageHolderKey"), i = (s) => {
    var u;
    (u = e.value) === null || u === void 0 || u.close(s);
  }, o = (s) => {
    if (!e.value) {
      const C = () => {
      };
      return C.then = () => {
      }, C;
    }
    const {
      open: u,
      prefixCls: c,
      hashId: d
    } = e.value, f = `${c}-notice`, {
      content: h,
      icon: p,
      type: g,
      key: m,
      class: y,
      onClose: b
    } = s, w = are(s, ["content", "icon", "type", "key", "class", "onClose"]);
    let $ = m;
    return $ == null && (FE += 1, $ = `antd-message-${FE}`), rq((C) => (u(k(k({}, w), {
      key: $,
      content: () => v(fL, {
        prefixCls: c,
        type: g,
        icon: typeof p == "function" ? p() : p
      }, {
        default: () => [typeof h == "function" ? h() : h]
      }),
      placement: "top",
      // @ts-ignore
      class: Ae(g && `${f}-${g}`, d, y),
      onClose: () => {
        b?.(), C();
      }
    })), () => {
      i($);
    }));
  }, a = {
    open: o,
    destroy: (s) => {
      var u;
      s !== void 0 ? i(s) : (u = e.value) === null || u === void 0 || u.destroy();
    }
  };
  return ["info", "success", "warning", "error", "loading"].forEach((s) => {
    const u = (c, d, f) => {
      let h;
      c && typeof c == "object" && "content" in c ? h = c : h = {
        content: c
      };
      let p, g;
      typeof d == "function" ? g = d : (p = d, g = f);
      const m = k(k({
        onClose: g,
        duration: p
      }, h), {
        type: s
      });
      return o(m);
    };
    a[s] = u;
  }), [a, () => v(ure, J(J({
    key: n
  }, t), {}, {
    ref: e
  }), null)];
}
function hL(t) {
  return cre(t);
}
let pL = 3, gL, tr, dre = 1, mL = "", vL = "move-up", yL = !1, bL = () => document.body, xL, OL = !1;
function fre() {
  return dre++;
}
function hre(t) {
  t.top !== void 0 && (gL = t.top, tr = null), t.duration !== void 0 && (pL = t.duration), t.prefixCls !== void 0 && (mL = t.prefixCls), t.getContainer !== void 0 && (bL = t.getContainer, tr = null), t.transitionName !== void 0 && (vL = t.transitionName, tr = null, yL = !0), t.maxCount !== void 0 && (xL = t.maxCount, tr = null), t.rtl !== void 0 && (OL = t.rtl);
}
function pre(t, e) {
  if (tr) {
    e(tr);
    return;
  }
  r0.newInstance({
    appContext: t.appContext,
    prefixCls: t.prefixCls || mL,
    rootPrefixCls: t.rootPrefixCls,
    transitionName: vL,
    hasTransitionName: yL,
    style: {
      top: gL
    },
    getContainer: bL || t.getPopupContainer,
    maxCount: xL,
    name: "message",
    useStyle: k$
  }, (n) => {
    if (tr) {
      e(tr);
      return;
    }
    tr = n, e(n);
  });
}
const SL = {
  info: ld,
  success: Vu,
  error: Wr,
  warning: Qu,
  loading: Ya
}, gre = Object.keys(SL);
function mre(t) {
  const e = t.duration !== void 0 ? t.duration : pL, n = t.key || fre(), i = new Promise((r) => {
    const a = () => (typeof t.onClose == "function" && t.onClose(), r(!0));
    pre(t, (l) => {
      l.notice({
        key: n,
        duration: e,
        style: t.style || {},
        class: t.class,
        content: (s) => {
          let {
            prefixCls: u
          } = s;
          const c = SL[t.type], d = c ? v(c, null, null) : "", f = Ae(`${u}-custom-content`, {
            [`${u}-${t.type}`]: t.type,
            [`${u}-rtl`]: OL === !0
          });
          return v("div", {
            class: f
          }, [typeof t.icon == "function" ? t.icon() : t.icon || d, v("span", null, [typeof t.content == "function" ? t.content() : t.content])]);
        },
        onClose: a,
        onClick: t.onClick
      });
    });
  }), o = () => {
    tr && tr.removeNotice(n);
  };
  return o.then = (r, a) => i.then(r, a), o.promise = i, o;
}
function vre(t) {
  return Object.prototype.toString.call(t) === "[object Object]" && !!t.content;
}
const Hp = {
  open: mre,
  config: hre,
  destroy(t) {
    if (tr)
      if (t) {
        const {
          removeNotice: e
        } = tr;
        e(t);
      } else {
        const {
          destroy: e
        } = tr;
        e(), tr = null;
      }
  }
};
function yre(t, e) {
  t[e] = (n, i, o) => vre(n) ? t.open(k(k({}, n), {
    type: e
  })) : (typeof i == "function" && (o = i, i = void 0), t.open({
    content: n,
    duration: i,
    type: e,
    onClose: o
  }));
}
gre.forEach((t) => yre(Hp, t));
Hp.warn = Hp.warning;
Hp.useMessage = hL;
const bre = (t) => {
  const {
    componentCls: e,
    width: n,
    notificationMarginEdge: i
  } = t, o = new gn("antNotificationTopFadeIn", {
    "0%": {
      marginTop: "-100%",
      opacity: 0
    },
    "100%": {
      marginTop: 0,
      opacity: 1
    }
  }), r = new gn("antNotificationBottomFadeIn", {
    "0%": {
      marginBottom: "-100%",
      opacity: 0
    },
    "100%": {
      marginBottom: 0,
      opacity: 1
    }
  }), a = new gn("antNotificationLeftFadeIn", {
    "0%": {
      right: {
        _skip_check_: !0,
        value: n
      },
      opacity: 0
    },
    "100%": {
      right: {
        _skip_check_: !0,
        value: 0
      },
      opacity: 1
    }
  });
  return {
    [`&${e}-top, &${e}-bottom`]: {
      marginInline: 0
    },
    [`&${e}-top`]: {
      [`${e}-fade-enter${e}-fade-enter-active, ${e}-fade-appear${e}-fade-appear-active`]: {
        animationName: o
      }
    },
    [`&${e}-bottom`]: {
      [`${e}-fade-enter${e}-fade-enter-active, ${e}-fade-appear${e}-fade-appear-active`]: {
        animationName: r
      }
    },
    [`&${e}-topLeft, &${e}-bottomLeft`]: {
      marginInlineEnd: 0,
      marginInlineStart: i,
      [`${e}-fade-enter${e}-fade-enter-active, ${e}-fade-appear${e}-fade-appear-active`]: {
        animationName: a
      }
    }
  };
}, xre = (t) => {
  const {
    iconCls: e,
    componentCls: n,
    // .ant-notification
    boxShadowSecondary: i,
    fontSizeLG: o,
    notificationMarginBottom: r,
    borderRadiusLG: a,
    colorSuccess: l,
    colorInfo: s,
    colorWarning: u,
    colorError: c,
    colorTextHeading: d,
    notificationBg: f,
    notificationPadding: h,
    notificationMarginEdge: p,
    motionDurationMid: g,
    motionEaseInOut: m,
    fontSize: y,
    lineHeight: b,
    width: w,
    notificationIconSize: $
  } = t, C = `${n}-notice`, P = new gn("antNotificationFadeIn", {
    "0%": {
      left: {
        _skip_check_: !0,
        value: w
      },
      opacity: 0
    },
    "100%": {
      left: {
        _skip_check_: !0,
        value: 0
      },
      opacity: 1
    }
  }), O = new gn("antNotificationFadeOut", {
    "0%": {
      maxHeight: t.animationMaxHeight,
      marginBottom: r,
      opacity: 1
    },
    "100%": {
      maxHeight: 0,
      marginBottom: 0,
      paddingTop: 0,
      paddingBottom: 0,
      opacity: 0
    }
  });
  return [
    // ============================ Holder ============================
    {
      [n]: k(k(k(k({}, kn(t)), {
        position: "fixed",
        zIndex: t.zIndexPopup,
        marginInlineEnd: p,
        [`${n}-hook-holder`]: {
          position: "relative"
        },
        [`&${n}-top, &${n}-bottom`]: {
          [`${n}-notice`]: {
            marginInline: "auto auto"
          }
        },
        [`&${n}-topLeft, &${n}-bottomLeft`]: {
          [`${n}-notice`]: {
            marginInlineEnd: "auto",
            marginInlineStart: 0
          }
        },
        //  animation
        [`${n}-fade-enter, ${n}-fade-appear`]: {
          animationDuration: t.motionDurationMid,
          animationTimingFunction: m,
          animationFillMode: "both",
          opacity: 0,
          animationPlayState: "paused"
        },
        [`${n}-fade-leave`]: {
          animationTimingFunction: m,
          animationFillMode: "both",
          animationDuration: g,
          animationPlayState: "paused"
        },
        [`${n}-fade-enter${n}-fade-enter-active, ${n}-fade-appear${n}-fade-appear-active`]: {
          animationName: P,
          animationPlayState: "running"
        },
        [`${n}-fade-leave${n}-fade-leave-active`]: {
          animationName: O,
          animationPlayState: "running"
        }
      }), bre(t)), {
        // RTL
        "&-rtl": {
          direction: "rtl",
          [`${n}-notice-btn`]: {
            float: "left"
          }
        }
      })
    },
    // ============================ Notice ============================
    {
      [C]: {
        position: "relative",
        width: w,
        maxWidth: `calc(100vw - ${p * 2}px)`,
        marginBottom: r,
        marginInlineStart: "auto",
        padding: h,
        overflow: "hidden",
        lineHeight: b,
        wordWrap: "break-word",
        background: f,
        borderRadius: a,
        boxShadow: i,
        [`${n}-close-icon`]: {
          fontSize: y,
          cursor: "pointer"
        },
        [`${C}-message`]: {
          marginBottom: t.marginXS,
          color: d,
          fontSize: o,
          lineHeight: t.lineHeightLG
        },
        [`${C}-description`]: {
          fontSize: y
        },
        [`&${C}-closable ${C}-message`]: {
          paddingInlineEnd: t.paddingLG
        },
        [`${C}-with-icon ${C}-message`]: {
          marginBottom: t.marginXS,
          marginInlineStart: t.marginSM + $,
          fontSize: o
        },
        [`${C}-with-icon ${C}-description`]: {
          marginInlineStart: t.marginSM + $,
          fontSize: y
        },
        // Icon & color style in different selector level
        // https://github.com/ant-design/ant-design/issues/16503
        // https://github.com/ant-design/ant-design/issues/15512
        [`${C}-icon`]: {
          position: "absolute",
          fontSize: $,
          lineHeight: 0,
          // icon-font
          [`&-success${e}`]: {
            color: l
          },
          [`&-info${e}`]: {
            color: s
          },
          [`&-warning${e}`]: {
            color: u
          },
          [`&-error${e}`]: {
            color: c
          }
        },
        [`${C}-close`]: {
          position: "absolute",
          top: t.notificationPaddingVertical,
          insetInlineEnd: t.notificationPaddingHorizontal,
          color: t.colorIcon,
          outline: "none",
          width: t.notificationCloseButtonSize,
          height: t.notificationCloseButtonSize,
          borderRadius: t.borderRadiusSM,
          transition: `background-color ${t.motionDurationMid}, color ${t.motionDurationMid}`,
          display: "flex",
          alignItems: "center",
          justifyContent: "center",
          "&:hover": {
            color: t.colorIconHover,
            backgroundColor: t.wireframe ? "transparent" : t.colorFillContent
          }
        },
        [`${C}-btn`]: {
          float: "right",
          marginTop: t.marginSM
        }
      }
    },
    // ============================= Pure =============================
    {
      [`${C}-pure-panel`]: {
        margin: 0
      }
    }
  ];
}, T$ = Vn("Notification", (t) => {
  const e = t.paddingMD, n = t.paddingLG, i = dn(t, {
    // default.less variables
    notificationBg: t.colorBgElevated,
    notificationPaddingVertical: e,
    notificationPaddingHorizontal: n,
    // index.less variables
    notificationPadding: `${t.paddingMD}px ${t.paddingContentHorizontalLG}px`,
    notificationMarginBottom: t.margin,
    notificationMarginEdge: t.marginLG,
    animationMaxHeight: 150,
    notificationIconSize: t.fontSizeLG * t.lineHeightLG,
    notificationCloseButtonSize: t.controlHeightLG * 0.55
  });
  return [xre(i)];
}, (t) => ({
  zIndexPopup: t.zIndexPopupBase + 50,
  width: 384
}));
function wL(t, e) {
  return e || v("span", {
    class: `${t}-close-x`
  }, [v(Ll, {
    class: `${t}-close-icon`
  }, null)]);
}
v(ld, null, null), v(Vu, null, null), v(Wr, null, null), v(Qu, null, null), v(Ya, null, null);
const Ore = {
  success: Vu,
  info: ld,
  error: Wr,
  warning: Qu
};
function CL(t) {
  let {
    prefixCls: e,
    icon: n,
    type: i,
    message: o,
    description: r,
    btn: a
  } = t, l = null;
  if (n)
    l = v("span", {
      class: `${e}-icon`
    }, [Kd(n)]);
  else if (i) {
    const s = Ore[i];
    l = v(s, {
      class: `${e}-icon ${e}-icon-${i}`
    }, null);
  }
  return v("div", {
    class: Ae({
      [`${e}-with-icon`]: l
    }),
    role: "alert"
  }, [l, v("div", {
    class: `${e}-message`
  }, [o]), v("div", {
    class: `${e}-description`
  }, [r]), a && v("div", {
    class: `${e}-btn`
  }, [a])]);
}
Oe({
  name: "PurePanel",
  inheritAttrs: !1,
  props: ["prefixCls", "icon", "type", "message", "description", "btn", "closeIcon"],
  setup(t) {
    const {
      getPrefixCls: e
    } = Ht("notification", t), n = A(() => t.prefixCls || e("notification")), i = A(() => `${n.value}-notice`), [, o] = T$(n);
    return () => v(Ry, J(J({}, t), {}, {
      prefixCls: n.value,
      class: Ae(o.value, `${i.value}-pure-panel`),
      noticeKey: "pure",
      duration: null,
      closable: t.closable,
      closeIcon: wL(n.value, t.closeIcon)
    }), {
      default: () => [v(CL, {
        prefixCls: i.value,
        icon: t.icon,
        type: t.type,
        message: t.message,
        description: t.description,
        btn: t.btn
      }, null)]
    });
  }
});
function $L(t, e, n) {
  let i;
  switch (e = typeof e == "number" ? `${e}px` : e, n = typeof n == "number" ? `${n}px` : n, t) {
    case "top":
      i = {
        left: "50%",
        transform: "translateX(-50%)",
        right: "auto",
        top: e,
        bottom: "auto"
      };
      break;
    case "topLeft":
      i = {
        left: 0,
        top: e,
        bottom: "auto"
      };
      break;
    case "topRight":
      i = {
        right: 0,
        top: e,
        bottom: "auto"
      };
      break;
    case "bottom":
      i = {
        left: "50%",
        transform: "translateX(-50%)",
        right: "auto",
        top: "auto",
        bottom: n
      };
      break;
    case "bottomLeft":
      i = {
        left: 0,
        top: "auto",
        bottom: n
      };
      break;
    default:
      i = {
        right: 0,
        top: "auto",
        bottom: n
      };
      break;
  }
  return i;
}
function Sre(t) {
  return {
    name: `${t}-fade`
  };
}
var wre = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
const VE = 24, Cre = 4.5, $re = Oe({
  name: "Holder",
  inheritAttrs: !1,
  props: ["prefixCls", "class", "type", "icon", "content", "onAllRemoved"],
  setup(t, e) {
    let {
      expose: n
    } = e;
    const {
      getPrefixCls: i,
      getPopupContainer: o
    } = Ht("notification", t), r = A(() => t.prefixCls || i("notification")), a = (f) => {
      var h, p;
      return $L(f, (h = t.top) !== null && h !== void 0 ? h : VE, (p = t.bottom) !== null && p !== void 0 ? p : VE);
    }, [, l] = T$(r), s = () => Ae(l.value, {
      [`${r.value}-rtl`]: t.rtl
    }), u = () => Sre(r.value), [c, d] = dL({
      prefixCls: r.value,
      getStyles: a,
      getClassName: s,
      motion: u,
      closable: !0,
      closeIcon: wL(r.value),
      duration: Cre,
      getContainer: () => {
        var f, h;
        return ((f = t.getPopupContainer) === null || f === void 0 ? void 0 : f.call(t)) || ((h = o.value) === null || h === void 0 ? void 0 : h.call(o)) || document.body;
      },
      maxCount: t.maxCount,
      hashId: l.value,
      onAllRemoved: t.onAllRemoved
    });
    return n(k(k({}, c), {
      prefixCls: r.value,
      hashId: l
    })), d;
  }
});
function kre(t) {
  const e = Te(null), n = Symbol("notificationHolderKey"), i = (l) => {
    if (!e.value)
      return;
    const {
      open: s,
      prefixCls: u,
      hashId: c
    } = e.value, d = `${u}-notice`, {
      message: f,
      description: h,
      icon: p,
      type: g,
      btn: m,
      class: y
    } = l, b = wre(l, ["message", "description", "icon", "type", "btn", "class"]);
    return s(k(k({
      placement: "topRight"
    }, b), {
      content: () => v(CL, {
        prefixCls: d,
        icon: typeof p == "function" ? p() : p,
        type: g,
        message: typeof f == "function" ? f() : f,
        description: typeof h == "function" ? h() : h,
        btn: typeof m == "function" ? m() : m
      }, null),
      // @ts-ignore
      class: Ae(g && `${d}-${g}`, c, y)
    }));
  }, r = {
    open: i,
    destroy: (l) => {
      var s, u;
      l !== void 0 ? (s = e.value) === null || s === void 0 || s.close(l) : (u = e.value) === null || u === void 0 || u.destroy();
    }
  };
  return ["success", "info", "warning", "error"].forEach((l) => {
    r[l] = (s) => i(k(k({}, s), {
      type: l
    }));
  }), [r, () => v($re, J(J({
    key: n
  }, t), {}, {
    ref: e
  }), null)];
}
function kL(t) {
  return kre(t);
}
const Oc = {};
let TL = 4.5, PL = "24px", EL = "24px", KO = "", _L = "topRight", IL = () => document.body, ML = null, XO = !1, AL;
function Tre(t) {
  const {
    duration: e,
    placement: n,
    bottom: i,
    top: o,
    getContainer: r,
    closeIcon: a,
    prefixCls: l
  } = t;
  l !== void 0 && (KO = l), e !== void 0 && (TL = e), n !== void 0 && (_L = n), i !== void 0 && (EL = typeof i == "number" ? `${i}px` : i), o !== void 0 && (PL = typeof o == "number" ? `${o}px` : o), r !== void 0 && (IL = r), a !== void 0 && (ML = a), t.rtl !== void 0 && (XO = t.rtl), t.maxCount !== void 0 && (AL = t.maxCount);
}
function Pre(t, e) {
  let {
    prefixCls: n,
    placement: i = _L,
    getContainer: o = IL,
    top: r,
    bottom: a,
    closeIcon: l = ML,
    appContext: s
  } = t;
  const {
    getPrefixCls: u
  } = Fre(), c = u("notification", n || KO), d = `${c}-${i}-${XO}`, f = Oc[d];
  if (f) {
    Promise.resolve(f).then((p) => {
      e(p);
    });
    return;
  }
  const h = Ae(`${c}-${i}`, {
    [`${c}-rtl`]: XO === !0
  });
  r0.newInstance({
    name: "notification",
    prefixCls: n || KO,
    useStyle: T$,
    class: h,
    style: $L(i, r ?? PL, a ?? EL),
    appContext: s,
    getContainer: o,
    closeIcon: (p) => {
      let {
        prefixCls: g
      } = p;
      return v("span", {
        class: `${g}-close-x`
      }, [Kd(l, {}, v(Ll, {
        class: `${g}-close-icon`
      }, null))]);
    },
    maxCount: AL,
    hasTransitionName: !0
  }, (p) => {
    Oc[d] = p, e(p);
  });
}
const Ere = {
  success: FC,
  info: QC,
  error: HC,
  warning: VC
};
function _re(t) {
  const {
    icon: e,
    type: n,
    description: i,
    message: o,
    btn: r
  } = t, a = t.duration === void 0 ? TL : t.duration;
  Pre(t, (l) => {
    l.notice({
      content: (s) => {
        let {
          prefixCls: u
        } = s;
        const c = `${u}-notice`;
        let d = null;
        if (e)
          d = () => v("span", {
            class: `${c}-icon`
          }, [Kd(e)]);
        else if (n) {
          const f = Ere[n];
          d = () => v(f, {
            class: `${c}-icon ${c}-icon-${n}`
          }, null);
        }
        return v("div", {
          class: d ? `${c}-with-icon` : ""
        }, [d && d(), v("div", {
          class: `${c}-message`
        }, [!i && d ? v("span", {
          class: `${c}-message-single-line-auto-margin`
        }, null) : null, Kd(o)]), v("div", {
          class: `${c}-description`
        }, [Kd(i)]), r ? v("span", {
          class: `${c}-btn`
        }, [Kd(r)]) : null]);
      },
      duration: a,
      closable: !0,
      onClose: t.onClose,
      onClick: t.onClick,
      key: t.key,
      style: t.style || {},
      class: t.class
    });
  });
}
const Vf = {
  open: _re,
  close(t) {
    Object.keys(Oc).forEach((e) => Promise.resolve(Oc[e]).then((n) => {
      n.removeNotice(t);
    }));
  },
  config: Tre,
  destroy() {
    Object.keys(Oc).forEach((t) => {
      Promise.resolve(Oc[t]).then((e) => {
        e.destroy();
      }), delete Oc[t];
    });
  }
}, Ire = ["success", "info", "warning", "error"];
Ire.forEach((t) => {
  Vf[t] = (e) => Vf.open(k(k({}, e), {
    type: t
  }));
});
Vf.warn = Vf.warning;
Vf.useNotification = kL;
const Mre = `-ant-${Date.now()}-${Math.random()}`;
function Are(t, e) {
  const n = {}, i = (a, l) => {
    let s = a.clone();
    return s = l?.(s) || s, s.toRgbString();
  }, o = (a, l) => {
    const s = new jn(a), u = Ts(s.toRgbString());
    n[`${l}-color`] = i(s), n[`${l}-color-disabled`] = u[1], n[`${l}-color-hover`] = u[4], n[`${l}-color-active`] = u[6], n[`${l}-color-outline`] = s.clone().setAlpha(0.2).toRgbString(), n[`${l}-color-deprecated-bg`] = u[0], n[`${l}-color-deprecated-border`] = u[2];
  };
  if (e.primaryColor) {
    o(e.primaryColor, "primary");
    const a = new jn(e.primaryColor), l = Ts(a.toRgbString());
    l.forEach((u, c) => {
      n[`primary-${c + 1}`] = u;
    }), n["primary-color-deprecated-l-35"] = i(a, (u) => u.lighten(35)), n["primary-color-deprecated-l-20"] = i(a, (u) => u.lighten(20)), n["primary-color-deprecated-t-20"] = i(a, (u) => u.tint(20)), n["primary-color-deprecated-t-50"] = i(a, (u) => u.tint(50)), n["primary-color-deprecated-f-12"] = i(a, (u) => u.setAlpha(u.getAlpha() * 0.12));
    const s = new jn(l[0]);
    n["primary-color-active-deprecated-f-30"] = i(s, (u) => u.setAlpha(u.getAlpha() * 0.3)), n["primary-color-active-deprecated-d-02"] = i(s, (u) => u.darken(2));
  }
  return e.successColor && o(e.successColor, "success"), e.warningColor && o(e.warningColor, "warning"), e.errorColor && o(e.errorColor, "error"), e.infoColor && o(e.infoColor, "info"), `
  :root {
    ${Object.keys(n).map((a) => `--${t}-${a}: ${n[a]};`).join(`
`)}
  }
  `.trim();
}
function Rre(t, e) {
  const n = Are(t, e);
  Or() ? Dp(n, `${Mre}-dynamic-theme`) : eo(!1, "ConfigProvider", "SSR do not support dynamic theme with css variables.");
}
const Dre = (t) => {
  const [e, n] = lh();
  return Jx(A(() => ({
    theme: e.value,
    token: n.value,
    hashId: "",
    path: ["ant-design-icons", t.value]
  })), () => [{
    [`.${t.value}`]: k(k({}, ah()), {
      [`.${t.value} .${t.value}-icon`]: {
        display: "block"
      }
    })
  }]);
};
function Nre(t, e) {
  const n = A(() => t?.value || {}), i = A(() => n.value.inherit === !1 || !e?.value ? dC : e.value);
  return A(() => {
    if (!t?.value)
      return e?.value;
    const r = k({}, i.value.components);
    return Object.keys(t.value.components || {}).forEach((a) => {
      r[a] = k(k({}, r[a]), t.value.components[a]);
    }), k(k(k({}, i.value), n.value), {
      token: k(k({}, i.value.token), n.value.token),
      components: r
    });
  });
}
var Lre = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
const zre = "ant";
function hf() {
  return Eo.prefixCls || zre;
}
function RL() {
  return Eo.iconPrefixCls || oC;
}
const P$ = Bn({}), Eo = Bn({});
zt(() => {
  k(Eo, P$), Eo.prefixCls = hf(), Eo.iconPrefixCls = RL(), Eo.getPrefixCls = (t, e) => e || (t ? `${Eo.prefixCls}-${t}` : Eo.prefixCls), Eo.getRootPrefixCls = () => Eo.prefixCls ? Eo.prefixCls : hf();
});
let g1;
const Bre = (t) => {
  g1 && g1(), g1 = zt(() => {
    k(P$, Bn(t)), k(Eo, Bn(t));
  }), t.theme && Rre(hf(), t.theme);
}, Fre = () => ({
  getPrefixCls: (t, e) => e || (t ? `${hf()}-${t}` : hf()),
  getIconPrefixCls: RL,
  getRootPrefixCls: () => Eo.prefixCls ? Eo.prefixCls : hf()
}), xs = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "AConfigProvider",
  inheritAttrs: !1,
  props: Eq(),
  setup(t, e) {
    let {
      slots: n
    } = e;
    const i = oy(), o = (B, Y) => {
      const {
        prefixCls: Q = "ant"
      } = t;
      if (Y) return Y;
      const G = Q || i.getPrefixCls("");
      return B ? `${G}-${B}` : G;
    }, r = A(() => t.iconPrefixCls || i.iconPrefixCls.value || oC), a = A(() => r.value !== i.iconPrefixCls.value), l = A(() => {
      var B;
      return t.csp || ((B = i.csp) === null || B === void 0 ? void 0 : B.value);
    }), s = Dre(r), u = Nre(A(() => t.theme), A(() => {
      var B;
      return (B = i.theme) === null || B === void 0 ? void 0 : B.value;
    })), c = (B) => (t.renderEmpty || n.renderEmpty || i.renderEmpty || vK)(B), d = A(() => {
      var B, Y;
      return (B = t.autoInsertSpaceInButton) !== null && B !== void 0 ? B : (Y = i.autoInsertSpaceInButton) === null || Y === void 0 ? void 0 : Y.value;
    }), f = A(() => {
      var B;
      return t.locale || ((B = i.locale) === null || B === void 0 ? void 0 : B.value);
    });
    _e(f, () => {
      P$.locale = f.value;
    }, {
      immediate: !0
    });
    const h = A(() => {
      var B;
      return t.direction || ((B = i.direction) === null || B === void 0 ? void 0 : B.value);
    }), p = A(() => {
      var B, Y;
      return (B = t.space) !== null && B !== void 0 ? B : (Y = i.space) === null || Y === void 0 ? void 0 : Y.value;
    }), g = A(() => {
      var B, Y;
      return (B = t.virtual) !== null && B !== void 0 ? B : (Y = i.virtual) === null || Y === void 0 ? void 0 : Y.value;
    }), m = A(() => {
      var B, Y;
      return (B = t.dropdownMatchSelectWidth) !== null && B !== void 0 ? B : (Y = i.dropdownMatchSelectWidth) === null || Y === void 0 ? void 0 : Y.value;
    }), y = A(() => {
      var B;
      return t.getTargetContainer !== void 0 ? t.getTargetContainer : (B = i.getTargetContainer) === null || B === void 0 ? void 0 : B.value;
    }), b = A(() => {
      var B;
      return t.getPopupContainer !== void 0 ? t.getPopupContainer : (B = i.getPopupContainer) === null || B === void 0 ? void 0 : B.value;
    }), w = A(() => {
      var B;
      return t.pageHeader !== void 0 ? t.pageHeader : (B = i.pageHeader) === null || B === void 0 ? void 0 : B.value;
    }), $ = A(() => {
      var B;
      return t.input !== void 0 ? t.input : (B = i.input) === null || B === void 0 ? void 0 : B.value;
    }), C = A(() => {
      var B;
      return t.pagination !== void 0 ? t.pagination : (B = i.pagination) === null || B === void 0 ? void 0 : B.value;
    }), P = A(() => {
      var B;
      return t.form !== void 0 ? t.form : (B = i.form) === null || B === void 0 ? void 0 : B.value;
    }), O = A(() => {
      var B;
      return t.select !== void 0 ? t.select : (B = i.select) === null || B === void 0 ? void 0 : B.value;
    }), E = A(() => t.componentSize), _ = A(() => t.componentDisabled), D = A(() => {
      var B, Y;
      return (B = t.wave) !== null && B !== void 0 ? B : (Y = i.wave) === null || Y === void 0 ? void 0 : Y.value;
    }), M = {
      csp: l,
      autoInsertSpaceInButton: d,
      locale: f,
      direction: h,
      space: p,
      virtual: g,
      dropdownMatchSelectWidth: m,
      getPrefixCls: o,
      iconPrefixCls: r,
      theme: A(() => {
        var B, Y;
        return (B = u.value) !== null && B !== void 0 ? B : (Y = i.theme) === null || Y === void 0 ? void 0 : Y.value;
      }),
      renderEmpty: c,
      getTargetContainer: y,
      getPopupContainer: b,
      pageHeader: w,
      input: $,
      pagination: C,
      form: P,
      select: O,
      componentSize: E,
      componentDisabled: _,
      transformCellText: A(() => t.transformCellText),
      wave: D
    }, N = A(() => {
      const B = u.value || {}, {
        algorithm: Y,
        token: Q
      } = B, G = Lre(B, ["algorithm", "token"]), V = Y && (!Array.isArray(Y) || Y.length > 0) ? nN(Y) : void 0;
      return k(k({}, G), {
        theme: V,
        token: k(k({}, uy), Q)
      });
    }), L = A(() => {
      var B, Y;
      let Q = {};
      return f.value && (Q = ((B = f.value.Form) === null || B === void 0 ? void 0 : B.defaultValidateMessages) || ((Y = ks.Form) === null || Y === void 0 ? void 0 : Y.defaultValidateMessages) || {}), t.form && t.form.validateMessages && (Q = k(k({}, Q), t.form.validateMessages)), Q;
    });
    _q(M), Tq({
      validateMessages: L
    }), wN(E), VD(_);
    const j = (B) => {
      var Y, Q;
      let G = a.value ? s((Y = n.default) === null || Y === void 0 ? void 0 : Y.call(n)) : (Q = n.default) === null || Q === void 0 ? void 0 : Q.call(n);
      if (t.theme) {
        const V = /* @__PURE__ */ (function() {
          return G;
        })();
        G = v(fK, {
          value: N.value
        }, {
          default: () => [V]
        });
      }
      return v(Zoe, {
        locale: f.value || B,
        ANT_MARK__: YO
      }, {
        default: () => [G]
      });
    };
    return zt(() => {
      h.value && (Hp.config({
        rtl: h.value === "rtl"
      }), Vf.config({
        rtl: h.value === "rtl"
      }));
    }), () => v(WD, {
      children: (B, Y, Q) => j(Q)
    }, null);
  }
});
xs.config = Bre;
xs.install = function(t) {
  t.component(xs.name, xs);
};
const Vre = (t, e) => {
  let {
    attrs: n,
    slots: i
  } = e;
  return v(en, J(J({
    size: "small",
    type: "primary"
  }, t), n), i);
}, Om = (t, e, n) => {
  const i = tq(n);
  return {
    [`${t.componentCls}-${e}`]: {
      color: t[`color${n}`],
      background: t[`color${i}Bg`],
      borderColor: t[`color${i}Border`],
      [`&${t.componentCls}-borderless`]: {
        borderColor: "transparent"
      }
    }
  };
}, Qre = (t) => vN(t, (e, n) => {
  let {
    textColor: i,
    lightBorderColor: o,
    lightColor: r,
    darkColor: a
  } = n;
  return {
    [`${t.componentCls}-${e}`]: {
      color: i,
      background: r,
      borderColor: o,
      // Inverse color
      "&-inverse": {
        color: t.colorTextLightSolid,
        background: a,
        borderColor: a
      },
      [`&${t.componentCls}-borderless`]: {
        borderColor: "transparent"
      }
    }
  };
}), Hre = (t) => {
  const {
    paddingXXS: e,
    lineWidth: n,
    tagPaddingHorizontal: i,
    componentCls: o
  } = t, r = i - n, a = e - n;
  return {
    // Result
    [o]: k(k({}, kn(t)), {
      display: "inline-block",
      height: "auto",
      marginInlineEnd: t.marginXS,
      paddingInline: r,
      fontSize: t.tagFontSize,
      lineHeight: `${t.tagLineHeight}px`,
      whiteSpace: "nowrap",
      background: t.tagDefaultBg,
      border: `${t.lineWidth}px ${t.lineType} ${t.colorBorder}`,
      borderRadius: t.borderRadiusSM,
      opacity: 1,
      transition: `all ${t.motionDurationMid}`,
      textAlign: "start",
      // RTL
      [`&${o}-rtl`]: {
        direction: "rtl"
      },
      "&, a, a:hover": {
        color: t.tagDefaultColor
      },
      [`${o}-close-icon`]: {
        marginInlineStart: a,
        color: t.colorTextDescription,
        fontSize: t.tagIconSize,
        cursor: "pointer",
        transition: `all ${t.motionDurationMid}`,
        "&:hover": {
          color: t.colorTextHeading
        }
      },
      [`&${o}-has-color`]: {
        borderColor: "transparent",
        [`&, a, a:hover, ${t.iconCls}-close, ${t.iconCls}-close:hover`]: {
          color: t.colorTextLightSolid
        }
      },
      "&-checkable": {
        backgroundColor: "transparent",
        borderColor: "transparent",
        cursor: "pointer",
        [`&:not(${o}-checkable-checked):hover`]: {
          color: t.colorPrimary,
          backgroundColor: t.colorFillSecondary
        },
        "&:active, &-checked": {
          color: t.colorTextLightSolid
        },
        "&-checked": {
          backgroundColor: t.colorPrimary,
          "&:hover": {
            backgroundColor: t.colorPrimaryHover
          }
        },
        "&:active": {
          backgroundColor: t.colorPrimaryActive
        }
      },
      "&-hidden": {
        display: "none"
      },
      // To ensure that a space will be placed between character and `Icon`.
      [`> ${t.iconCls} + span, > span + ${t.iconCls}`]: {
        marginInlineStart: r
      }
    }),
    [`${o}-borderless`]: {
      borderColor: "transparent",
      background: t.tagBorderlessBg
    }
  };
}, DL = Vn("Tag", (t) => {
  const {
    fontSize: e,
    lineHeight: n,
    lineWidth: i,
    fontSizeIcon: o
  } = t, r = Math.round(e * n), a = t.fontSizeSM, l = r - i * 2, s = t.colorFillAlter, u = t.colorText, c = dn(t, {
    tagFontSize: a,
    tagLineHeight: l,
    tagDefaultBg: s,
    tagDefaultColor: u,
    tagIconSize: o - 2 * i,
    tagPaddingHorizontal: 8,
    tagBorderlessBg: t.colorFillTertiary
  });
  return [Hre(c), Qre(c), Om(c, "success", "Success"), Om(c, "processing", "Info"), Om(c, "error", "Error"), Om(c, "warning", "Warning")];
}), Wre = () => ({
  prefixCls: String,
  checked: {
    type: Boolean,
    default: void 0
  },
  onChange: {
    type: Function
  },
  onClick: {
    type: Function
  },
  "onUpdate:checked": Function
}), ZO = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ACheckableTag",
  inheritAttrs: !1,
  props: Wre(),
  // emits: ['update:checked', 'change', 'click'],
  setup(t, e) {
    let {
      slots: n,
      emit: i,
      attrs: o
    } = e;
    const {
      prefixCls: r
    } = Ht("tag", t), [a, l] = DL(r), s = (c) => {
      const {
        checked: d
      } = t;
      i("update:checked", !d), i("change", !d), i("click", c);
    }, u = A(() => Ae(r.value, l.value, {
      [`${r.value}-checkable`]: !0,
      [`${r.value}-checkable-checked`]: t.checked
    }));
    return () => {
      var c;
      return a(v("span", J(J({}, o), {}, {
        class: [u.value, o.class],
        onClick: s
      }), [(c = n.default) === null || c === void 0 ? void 0 : c.call(n)]));
    };
  }
}), jre = () => ({
  prefixCls: String,
  color: {
    type: String
  },
  closable: {
    type: Boolean,
    default: !1
  },
  closeIcon: ve.any,
  /** @deprecated `visible` will be removed in next major version. */
  visible: {
    type: Boolean,
    default: void 0
  },
  onClose: {
    type: Function
  },
  onClick: Mf(),
  "onUpdate:visible": Function,
  icon: ve.any,
  bordered: {
    type: Boolean,
    default: !0
  }
}), Va = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ATag",
  inheritAttrs: !1,
  props: jre(),
  // emits: ['update:visible', 'close'],
  slots: Object,
  setup(t, e) {
    let {
      slots: n,
      emit: i,
      attrs: o
    } = e;
    const {
      prefixCls: r,
      direction: a
    } = Ht("tag", t), [l, s] = DL(r), u = Te(!0);
    process.env.NODE_ENV !== "production" && eo(t.visible === void 0, "Tag", '`visible` is deprecated, please use `<Tag v-show="visible" />` instead.'), zt(() => {
      t.visible !== void 0 && (u.value = t.visible);
    });
    const c = (p) => {
      p.stopPropagation(), i("update:visible", !1), i("close", p), !p.defaultPrevented && t.visible === void 0 && (u.value = !1);
    }, d = A(() => w3(t.color) || cJ(t.color)), f = A(() => Ae(r.value, s.value, {
      [`${r.value}-${t.color}`]: d.value,
      [`${r.value}-has-color`]: t.color && !d.value,
      [`${r.value}-hidden`]: !u.value,
      [`${r.value}-rtl`]: a.value === "rtl",
      [`${r.value}-borderless`]: !t.bordered
    })), h = (p) => {
      i("click", p);
    };
    return () => {
      var p, g, m;
      const {
        icon: y = (p = n.icon) === null || p === void 0 ? void 0 : p.call(n),
        color: b,
        closeIcon: w = (g = n.closeIcon) === null || g === void 0 ? void 0 : g.call(n),
        closable: $ = !1
      } = t, C = () => $ ? w ? v("span", {
        class: `${r.value}-close-icon`,
        onClick: c
      }, [w]) : v(Ll, {
        class: `${r.value}-close-icon`,
        onClick: c
      }, null) : null, P = {
        backgroundColor: b && !d.value ? b : void 0
      }, O = y || null, E = (m = n.default) === null || m === void 0 ? void 0 : m.call(n), _ = O ? v(tt, null, [O, v("span", null, [E])]) : E, D = t.onClick !== void 0, M = v("span", J(J({}, o), {}, {
        onClick: h,
        class: [f.value, o.class],
        style: [P, o.style]
      }), [_, C()]);
      return l(D ? v(WC, null, {
        default: () => [M]
      }) : M);
    };
  }
});
Va.CheckableTag = ZO;
Va.install = function(t) {
  return t.component(Va.name, Va), t.component(ZO.name, ZO), t;
};
function qre(t, e) {
  let {
    slots: n,
    attrs: i
  } = e;
  return v(Va, J(J({
    color: "blue"
  }, t), i), n);
}
var Yre = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zm-40 656H184V460h656v380zM184 392V256h128v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h256v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h128v136H184z" } }] }, name: "calendar", theme: "outlined" };
function QE(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(n);
    typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(n).filter(function(o) {
      return Object.getOwnPropertyDescriptor(n, o).enumerable;
    }))), i.forEach(function(o) {
      Kre(t, o, n[o]);
    });
  }
  return t;
}
function Kre(t, e, n) {
  return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
var Dy = function(e, n) {
  var i = QE({}, e, n.attrs);
  return v(bn, QE({}, i, {
    icon: Yre
  }), null);
};
Dy.displayName = "CalendarOutlined";
Dy.inheritAttrs = !1;
var Xre = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }, { tag: "path", attrs: { d: "M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z" } }] }, name: "clock-circle", theme: "outlined" };
function HE(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(n);
    typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(n).filter(function(o) {
      return Object.getOwnPropertyDescriptor(n, o).enumerable;
    }))), i.forEach(function(o) {
      Zre(t, o, n[o]);
    });
  }
  return t;
}
function Zre(t, e, n) {
  return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
var Ny = function(e, n) {
  var i = HE({}, e, n.attrs);
  return v(bn, HE({}, i, {
    icon: Xre
  }), null);
};
Ny.displayName = "ClockCircleOutlined";
Ny.inheritAttrs = !1;
function Gre(t, e, n) {
  return n !== void 0 ? n : e === "year" && t.lang.yearPlaceholder ? t.lang.yearPlaceholder : e === "quarter" && t.lang.quarterPlaceholder ? t.lang.quarterPlaceholder : e === "month" && t.lang.monthPlaceholder ? t.lang.monthPlaceholder : e === "week" && t.lang.weekPlaceholder ? t.lang.weekPlaceholder : e === "time" && t.timePickerLocale.placeholder ? t.timePickerLocale.placeholder : t.lang.placeholder;
}
function Ure(t, e, n) {
  return n !== void 0 ? n : e === "year" && t.lang.yearPlaceholder ? t.lang.rangeYearPlaceholder : e === "month" && t.lang.monthPlaceholder ? t.lang.rangeMonthPlaceholder : e === "week" && t.lang.weekPlaceholder ? t.lang.rangeWeekPlaceholder : e === "time" && t.timePickerLocale.placeholder ? t.timePickerLocale.rangePlaceholder : t.lang.rangePlaceholder;
}
function NL(t, e) {
  const n = {
    adjustX: 1,
    adjustY: 1
  };
  switch (e) {
    case "bottomLeft":
      return {
        points: ["tl", "bl"],
        offset: [0, 4],
        overflow: n
      };
    case "bottomRight":
      return {
        points: ["tr", "br"],
        offset: [0, 4],
        overflow: n
      };
    case "topLeft":
      return {
        points: ["bl", "tl"],
        offset: [0, -4],
        overflow: n
      };
    case "topRight":
      return {
        points: ["br", "tr"],
        offset: [0, -4],
        overflow: n
      };
    default:
      return {
        points: t === "rtl" ? ["tr", "br"] : ["tl", "bl"],
        offset: [0, 4],
        overflow: n
      };
  }
}
function LL() {
  return {
    id: String,
    /**
     * @deprecated `dropdownClassName` is deprecated which will be removed in next major
     *   version.Please use `popupClassName` instead.
     */
    dropdownClassName: String,
    popupClassName: String,
    popupStyle: Vt(),
    transitionName: String,
    placeholder: String,
    allowClear: pt(),
    autofocus: pt(),
    disabled: pt(),
    tabindex: Number,
    open: pt(),
    defaultOpen: pt(),
    /** Make input readOnly to avoid popup keyboard in mobile */
    inputReadOnly: pt(),
    format: pn([String, Function, Array]),
    // Value
    // format:  string | CustomFormat<DateType> | (string | CustomFormat<DateType>)[];
    // Render
    // suffixIcon?: VueNode;
    // clearIcon?: VueNode;
    // prevIcon?: VueNode;
    // nextIcon?: VueNode;
    // superPrevIcon?: VueNode;
    // superNextIcon?: VueNode;
    getPopupContainer: ot(),
    panelRender: ot(),
    // // Events
    onChange: ot(),
    "onUpdate:value": ot(),
    onOk: ot(),
    onOpenChange: ot(),
    "onUpdate:open": ot(),
    onFocus: ot(),
    onBlur: ot(),
    onMousedown: ot(),
    onMouseup: ot(),
    onMouseenter: ot(),
    onMouseleave: ot(),
    onClick: ot(),
    onContextmenu: ot(),
    onKeydown: ot(),
    // WAI-ARIA
    role: String,
    name: String,
    autocomplete: String,
    direction: yn(),
    showToday: pt(),
    showTime: pn([Boolean, Object]),
    locale: Vt(),
    size: yn(),
    bordered: pt(),
    dateRender: ot(),
    disabledDate: ot(),
    mode: yn(),
    picker: yn(),
    valueFormat: String,
    placement: yn(),
    status: yn(),
    /** @deprecated Please use `disabledTime` instead. */
    disabledHours: ot(),
    /** @deprecated Please use `disabledTime` instead. */
    disabledMinutes: ot(),
    /** @deprecated Please use `disabledTime` instead. */
    disabledSeconds: ot()
  };
}
function Jre() {
  return {
    defaultPickerValue: pn([Object, String]),
    defaultValue: pn([Object, String]),
    value: pn([Object, String]),
    presets: ui(),
    disabledTime: ot(),
    renderExtraFooter: ot(),
    showNow: pt(),
    monthCellRender: ot(),
    // deprecated  Please use `monthCellRender"` instead.',
    monthCellContentRender: ot()
  };
}
function eae() {
  return {
    allowEmpty: ui(),
    dateRender: ot(),
    defaultPickerValue: ui(),
    defaultValue: ui(),
    value: ui(),
    presets: ui(),
    disabledTime: ot(),
    disabled: pn([Boolean, Array]),
    renderExtraFooter: ot(),
    separator: {
      type: String
    },
    showTime: pn([Boolean, Object]),
    ranges: Vt(),
    placeholder: ui(),
    mode: ui(),
    onChange: ot(),
    "onUpdate:value": ot(),
    onCalendarChange: ot(),
    onPanelChange: ot(),
    onOk: ot()
  };
}
var tae = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
function nae(t, e) {
  function n(u, c) {
    const d = k(k(k({}, LL()), Jre()), e);
    return Oe({
      compatConfig: {
        MODE: 3
      },
      name: c,
      inheritAttrs: !1,
      props: d,
      slots: Object,
      setup(f, h) {
        let {
          slots: p,
          expose: g,
          attrs: m,
          emit: y
        } = h;
        const b = f, w = jr(), $ = Fr.useInject();
        process.env.NODE_ENV !== "production" && ($n(u !== "quarter", c || "DatePicker", `DatePicker.${c} is legacy usage. Please use DatePicker[picker='${u}'] directly.`), $n(!b.dropdownClassName, c || "DatePicker", "`dropdownClassName` is deprecated. Please use `popupClassName` instead."), $n(!(b.monthCellContentRender || p.monthCellContentRender), c || "DatePicker", '`monthCellContentRender` is deprecated. Please use `monthCellRender"` instead.'), $n(!m.getCalendarContainer, c || "DatePicker", '`getCalendarContainer` is deprecated. Please use `getPopupContainer"` instead.'));
        const {
          prefixCls: C,
          direction: P,
          getPopupContainer: O,
          size: E,
          rootPrefixCls: _,
          disabled: D
        } = Ht("picker", b), {
          compactSize: M,
          compactItemClassnames: N
        } = sh(C, P), L = A(() => M.value || E.value), [j, B] = P5(C), Y = de();
        g({
          focus: () => {
            var me;
            (me = Y.value) === null || me === void 0 || me.focus();
          },
          blur: () => {
            var me;
            (me = Y.value) === null || me === void 0 || me.blur();
          }
        });
        const Q = (me) => b.valueFormat ? t.toString(me, b.valueFormat) : me, G = (me, ce) => {
          const ue = Q(me);
          y("update:value", ue), y("change", ue, ce), w.onFieldChange();
        }, V = (me) => {
          y("update:open", me), y("openChange", me);
        }, H = (me) => {
          y("focus", me);
        }, q = (me) => {
          y("blur", me), w.onFieldBlur();
        }, K = (me, ce) => {
          const ue = Q(me);
          y("panelChange", ue, ce);
        }, ee = (me) => {
          const ce = Q(me);
          y("ok", ce);
        }, [ie] = Bu("DatePicker", Vv), ae = A(() => b.value ? b.valueFormat ? t.toDate(b.value, b.valueFormat) : b.value : b.value === "" ? void 0 : b.value), te = A(() => b.defaultValue ? b.valueFormat ? t.toDate(b.defaultValue, b.valueFormat) : b.defaultValue : b.defaultValue === "" ? void 0 : b.defaultValue), U = A(() => b.defaultPickerValue ? b.valueFormat ? t.toDate(b.defaultPickerValue, b.valueFormat) : b.defaultPickerValue : b.defaultPickerValue === "" ? void 0 : b.defaultPickerValue);
        return () => {
          var me, ce, ue, fe, he, le;
          const ke = k(k({}, ie.value), b.locale), ze = k(k({}, b), m), {
            bordered: Re = !0,
            placeholder: Ye,
            suffixIcon: Ne = (me = p.suffixIcon) === null || me === void 0 ? void 0 : me.call(p),
            showToday: Fe = !0,
            transitionName: We,
            allowClear: nt = !0,
            dateRender: Qe = p.dateRender,
            renderExtraFooter: Pe = p.renderExtraFooter,
            monthCellRender: Ze = p.monthCellRender || b.monthCellContentRender || p.monthCellContentRender,
            clearIcon: Ce = (ce = p.clearIcon) === null || ce === void 0 ? void 0 : ce.call(p),
            id: $e = w.id.value
          } = ze, Le = tae(ze, ["bordered", "placeholder", "suffixIcon", "showToday", "transitionName", "allowClear", "dateRender", "renderExtraFooter", "monthCellRender", "clearIcon", "id"]), Ke = ze.showTime === "" ? !0 : ze.showTime, {
            format: qe
          } = ze;
          let rt = {};
          u && (rt.picker = u);
          const De = u || ze.picker || "date";
          rt = k(k(k({}, rt), Ke ? a0(k({
            format: qe,
            picker: De
          }, typeof Ke == "object" ? Ke : {})) : {}), De === "time" ? a0(k(k({
            format: qe
          }, Le), {
            picker: De
          })) : {});
          const Be = C.value, je = v(tt, null, [Ne || (u === "time" ? v(Ny, null, null) : v(Dy, null, null)), $.hasFeedback && $.feedbackIcon]);
          return j(v(rte, J(J(J({
            monthCellRender: Ze,
            dateRender: Qe,
            renderExtraFooter: Pe,
            ref: Y,
            placeholder: Gre(ke, De, Ye),
            suffixIcon: je,
            dropdownAlign: NL(P.value, b.placement),
            clearIcon: Ce || v(Wr, null, null),
            allowClear: nt,
            transitionName: We || `${_.value}-slide-up`
          }, Le), rt), {}, {
            id: $e,
            picker: De,
            value: ae.value,
            defaultValue: te.value,
            defaultPickerValue: U.value,
            showToday: Fe,
            locale: ke.lang,
            class: Ae({
              [`${Be}-${L.value}`]: L.value,
              [`${Be}-borderless`]: !Re
            }, Fa(Be, ad($.status, b.status), $.hasFeedback), m.class, B.value, N.value),
            disabled: D.value,
            prefixCls: Be,
            getPopupContainer: m.getCalendarContainer || O.value,
            generateConfig: t,
            prevIcon: ((ue = p.prevIcon) === null || ue === void 0 ? void 0 : ue.call(p)) || v("span", {
              class: `${Be}-prev-icon`
            }, null),
            nextIcon: ((fe = p.nextIcon) === null || fe === void 0 ? void 0 : fe.call(p)) || v("span", {
              class: `${Be}-next-icon`
            }, null),
            superPrevIcon: ((he = p.superPrevIcon) === null || he === void 0 ? void 0 : he.call(p)) || v("span", {
              class: `${Be}-super-prev-icon`
            }, null),
            superNextIcon: ((le = p.superNextIcon) === null || le === void 0 ? void 0 : le.call(p)) || v("span", {
              class: `${Be}-super-next-icon`
            }, null),
            components: zL,
            direction: P.value,
            dropdownClassName: Ae(B.value, b.popupClassName, b.dropdownClassName),
            onChange: G,
            onOpenChange: V,
            onFocus: H,
            onBlur: q,
            onPanelChange: K,
            onOk: ee
          }), null));
        };
      }
    });
  }
  const i = n(void 0, "ADatePicker"), o = n("week", "AWeekPicker"), r = n("month", "AMonthPicker"), a = n("year", "AYearPicker"), l = n("time", "TimePicker"), s = n("quarter", "AQuarterPicker");
  return {
    DatePicker: i,
    WeekPicker: o,
    MonthPicker: r,
    YearPicker: a,
    TimePicker: l,
    QuarterPicker: s
  };
}
var iae = { icon: { tag: "svg", attrs: { viewBox: "0 0 1024 1024", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M873.1 596.2l-164-208A32 32 0 00684 376h-64.8c-6.7 0-10.4 7.7-6.3 13l144.3 183H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h695.9c26.8 0 41.7-30.8 25.2-51.8z" } }] }, name: "swap-right", theme: "outlined" };
function WE(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(n);
    typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(n).filter(function(o) {
      return Object.getOwnPropertyDescriptor(n, o).enumerable;
    }))), i.forEach(function(o) {
      oae(t, o, n[o]);
    });
  }
  return t;
}
function oae(t, e, n) {
  return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
var E$ = function(e, n) {
  var i = WE({}, e, n.attrs);
  return v(bn, WE({}, i, {
    icon: iae
  }), null);
};
E$.displayName = "SwapRightOutlined";
E$.inheritAttrs = !1;
var rae = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
function aae(t, e) {
  return Oe({
    compatConfig: {
      MODE: 3
    },
    name: "ARangePicker",
    inheritAttrs: !1,
    props: k(k(k({}, LL()), eae()), e),
    slots: Object,
    setup(i, o) {
      let {
        expose: r,
        slots: a,
        attrs: l,
        emit: s
      } = o;
      const u = i, c = jr(), d = Fr.useInject();
      process.env.NODE_ENV !== "production" && ($n(!u.dropdownClassName, "RangePicker", "`dropdownClassName` is deprecated. Please use `popupClassName` instead."), $n(!l.getCalendarContainer, "DatePicker", '`getCalendarContainer` is deprecated. Please use `getPopupContainer"` instead.'));
      const {
        prefixCls: f,
        direction: h,
        getPopupContainer: p,
        size: g,
        rootPrefixCls: m,
        disabled: y
      } = Ht("picker", u), {
        compactSize: b,
        compactItemClassnames: w
      } = sh(f, h), $ = A(() => b.value || g.value), [C, P] = P5(f), O = de();
      r({
        focus: () => {
          var H;
          (H = O.value) === null || H === void 0 || H.focus();
        },
        blur: () => {
          var H;
          (H = O.value) === null || H === void 0 || H.blur();
        }
      });
      const E = (H) => u.valueFormat ? t.toString(H, u.valueFormat) : H, _ = (H, q) => {
        const K = E(H);
        s("update:value", K), s("change", K, q), c.onFieldChange();
      }, D = (H) => {
        s("update:open", H), s("openChange", H);
      }, M = (H) => {
        s("focus", H);
      }, N = (H) => {
        s("blur", H), c.onFieldBlur();
      }, L = (H, q) => {
        const K = E(H);
        s("panelChange", K, q);
      }, j = (H) => {
        const q = E(H);
        s("ok", q);
      }, B = (H, q, K) => {
        const ee = E(H);
        s("calendarChange", ee, q, K);
      }, [Y] = Bu("DatePicker", Vv), Q = A(() => u.value && u.valueFormat ? t.toDate(u.value, u.valueFormat) : u.value), G = A(() => u.defaultValue && u.valueFormat ? t.toDate(u.defaultValue, u.valueFormat) : u.defaultValue), V = A(() => u.defaultPickerValue && u.valueFormat ? t.toDate(u.defaultPickerValue, u.valueFormat) : u.defaultPickerValue);
      return () => {
        var H, q, K, ee, ie, ae, te;
        const U = k(k({}, Y.value), u.locale), me = k(k({}, u), l), {
          prefixCls: ce,
          bordered: ue = !0,
          placeholder: fe,
          suffixIcon: he = (H = a.suffixIcon) === null || H === void 0 ? void 0 : H.call(a),
          picker: le = "date",
          transitionName: ke,
          allowClear: ze = !0,
          dateRender: Re = a.dateRender,
          renderExtraFooter: Ye = a.renderExtraFooter,
          separator: Ne = (q = a.separator) === null || q === void 0 ? void 0 : q.call(a),
          clearIcon: Fe = (K = a.clearIcon) === null || K === void 0 ? void 0 : K.call(a),
          id: We = c.id.value
        } = me, nt = rae(me, ["prefixCls", "bordered", "placeholder", "suffixIcon", "picker", "transitionName", "allowClear", "dateRender", "renderExtraFooter", "separator", "clearIcon", "id"]);
        delete nt["onUpdate:value"], delete nt["onUpdate:open"];
        const {
          format: Qe,
          showTime: Pe
        } = me;
        let Ze = {};
        Ze = k(k(k({}, Ze), Pe ? a0(k({
          format: Qe,
          picker: le
        }, Pe)) : {}), le === "time" ? a0(k(k({
          format: Qe
        }, ii(nt, ["disabledTime"])), {
          picker: le
        })) : {});
        const Ce = f.value, $e = v(tt, null, [he || (le === "time" ? v(Ny, null, null) : v(Dy, null, null)), d.hasFeedback && d.feedbackIcon]);
        return C(v(yte, J(J(J({
          dateRender: Re,
          renderExtraFooter: Ye,
          separator: Ne || v("span", {
            "aria-label": "to",
            class: `${Ce}-separator`
          }, [v(E$, null, null)]),
          ref: O,
          dropdownAlign: NL(h.value, u.placement),
          placeholder: Ure(U, le, fe),
          suffixIcon: $e,
          clearIcon: Fe || v(Wr, null, null),
          allowClear: ze,
          transitionName: ke || `${m.value}-slide-up`
        }, nt), Ze), {}, {
          disabled: y.value,
          id: We,
          value: Q.value,
          defaultValue: G.value,
          defaultPickerValue: V.value,
          picker: le,
          class: Ae({
            [`${Ce}-${$.value}`]: $.value,
            [`${Ce}-borderless`]: !ue
          }, Fa(Ce, ad(d.status, u.status), d.hasFeedback), l.class, P.value, w.value),
          locale: U.lang,
          prefixCls: Ce,
          getPopupContainer: l.getCalendarContainer || p.value,
          generateConfig: t,
          prevIcon: ((ee = a.prevIcon) === null || ee === void 0 ? void 0 : ee.call(a)) || v("span", {
            class: `${Ce}-prev-icon`
          }, null),
          nextIcon: ((ie = a.nextIcon) === null || ie === void 0 ? void 0 : ie.call(a)) || v("span", {
            class: `${Ce}-next-icon`
          }, null),
          superPrevIcon: ((ae = a.superPrevIcon) === null || ae === void 0 ? void 0 : ae.call(a)) || v("span", {
            class: `${Ce}-super-prev-icon`
          }, null),
          superNextIcon: ((te = a.superNextIcon) === null || te === void 0 ? void 0 : te.call(a)) || v("span", {
            class: `${Ce}-super-next-icon`
          }, null),
          components: zL,
          direction: h.value,
          dropdownClassName: Ae(P.value, u.popupClassName, u.dropdownClassName),
          onChange: _,
          onOpenChange: D,
          onFocus: M,
          onBlur: N,
          onPanelChange: L,
          onOk: j,
          onCalendarChange: B
        }), null));
      };
    }
  });
}
const zL = {
  button: Vre,
  rangeItem: qre
};
function lae(t) {
  return t ? Array.isArray(t) ? t : [t] : [];
}
function a0(t) {
  const {
    format: e,
    picker: n,
    showHour: i,
    showMinute: o,
    showSecond: r,
    use12Hours: a
  } = t, l = lae(e)[0], s = k({}, t);
  return l && typeof l == "string" && (!l.includes("s") && r === void 0 && (s.showSecond = !1), !l.includes("m") && o === void 0 && (s.showMinute = !1), !l.includes("H") && !l.includes("h") && i === void 0 && (s.showHour = !1), (l.includes("a") || l.includes("A")) && a === void 0 && (s.use12Hours = !0)), n === "time" ? s : (typeof l == "function" && delete s.format, {
    showTime: s
  });
}
function sae(t, e) {
  const {
    DatePicker: n,
    WeekPicker: i,
    MonthPicker: o,
    YearPicker: r,
    TimePicker: a,
    QuarterPicker: l
  } = nae(t, e), s = aae(t, e);
  return {
    DatePicker: n,
    WeekPicker: i,
    MonthPicker: o,
    YearPicker: r,
    TimePicker: a,
    QuarterPicker: l,
    RangePicker: s
  };
}
const {
  DatePicker: m1,
  WeekPicker: v1,
  MonthPicker: y1,
  YearPicker: uae,
  TimePicker: cae,
  QuarterPicker: b1,
  RangePicker: x1
} = sae(Mee), dae = k(m1, {
  WeekPicker: v1,
  MonthPicker: y1,
  YearPicker: uae,
  RangePicker: x1,
  TimePicker: cae,
  QuarterPicker: b1,
  install: (t) => (t.component(m1.name, m1), t.component(x1.name, x1), t.component(y1.name, y1), t.component(v1.name, v1), t.component(b1.name, b1), t)
}), fae = (t) => {
  const {
    componentCls: e,
    sizePaddingEdgeHorizontal: n,
    colorSplit: i,
    lineWidth: o
  } = t;
  return {
    [e]: k(k({}, kn(t)), {
      borderBlockStart: `${o}px solid ${i}`,
      // vertical
      "&-vertical": {
        position: "relative",
        top: "-0.06em",
        display: "inline-block",
        height: "0.9em",
        margin: `0 ${t.dividerVerticalGutterMargin}px`,
        verticalAlign: "middle",
        borderTop: 0,
        borderInlineStart: `${o}px solid ${i}`
      },
      "&-horizontal": {
        display: "flex",
        clear: "both",
        width: "100%",
        minWidth: "100%",
        margin: `${t.dividerHorizontalGutterMargin}px 0`
      },
      [`&-horizontal${e}-with-text`]: {
        display: "flex",
        alignItems: "center",
        margin: `${t.dividerHorizontalWithTextGutterMargin}px 0`,
        color: t.colorTextHeading,
        fontWeight: 500,
        fontSize: t.fontSizeLG,
        whiteSpace: "nowrap",
        textAlign: "center",
        borderBlockStart: `0 ${i}`,
        "&::before, &::after": {
          position: "relative",
          width: "50%",
          borderBlockStart: `${o}px solid transparent`,
          // Chrome not accept `inherit` in `border-top`
          borderBlockStartColor: "inherit",
          borderBlockEnd: 0,
          transform: "translateY(50%)",
          content: "''"
        }
      },
      [`&-horizontal${e}-with-text-left`]: {
        "&::before": {
          width: "5%"
        },
        "&::after": {
          width: "95%"
        }
      },
      [`&-horizontal${e}-with-text-right`]: {
        "&::before": {
          width: "95%"
        },
        "&::after": {
          width: "5%"
        }
      },
      [`${e}-inner-text`]: {
        display: "inline-block",
        padding: "0 1em"
      },
      "&-dashed": {
        background: "none",
        borderColor: i,
        borderStyle: "dashed",
        borderWidth: `${o}px 0 0`
      },
      [`&-horizontal${e}-with-text${e}-dashed`]: {
        "&::before, &::after": {
          borderStyle: "dashed none none"
        }
      },
      [`&-vertical${e}-dashed`]: {
        borderInlineStartWidth: o,
        borderInlineEnd: 0,
        borderBlockStart: 0,
        borderBlockEnd: 0
      },
      [`&-plain${e}-with-text`]: {
        color: t.colorText,
        fontWeight: "normal",
        fontSize: t.fontSize
      },
      [`&-horizontal${e}-with-text-left${e}-no-default-orientation-margin-left`]: {
        "&::before": {
          width: 0
        },
        "&::after": {
          width: "100%"
        },
        [`${e}-inner-text`]: {
          paddingInlineStart: n
        }
      },
      [`&-horizontal${e}-with-text-right${e}-no-default-orientation-margin-right`]: {
        "&::before": {
          width: "100%"
        },
        "&::after": {
          width: 0
        },
        [`${e}-inner-text`]: {
          paddingInlineEnd: n
        }
      }
    })
  };
}, hae = Vn("Divider", (t) => {
  const e = dn(t, {
    dividerVerticalGutterMargin: t.marginXS,
    dividerHorizontalWithTextGutterMargin: t.margin,
    dividerHorizontalGutterMargin: t.marginLG
  });
  return [fae(e)];
}, {
  sizePaddingEdgeHorizontal: 0
}), pae = () => ({
  prefixCls: String,
  type: {
    type: String,
    default: "horizontal"
  },
  dashed: {
    type: Boolean,
    default: !1
  },
  orientation: {
    type: String,
    default: "center"
  },
  plain: {
    type: Boolean,
    default: !1
  },
  orientationMargin: [String, Number]
}), gae = Oe({
  name: "ADivider",
  inheritAttrs: !1,
  compatConfig: {
    MODE: 3
  },
  props: pae(),
  setup(t, e) {
    let {
      slots: n,
      attrs: i
    } = e;
    const {
      prefixCls: o,
      direction: r
    } = Ht("divider", t), [a, l] = hae(o), s = A(() => t.orientation === "left" && t.orientationMargin != null), u = A(() => t.orientation === "right" && t.orientationMargin != null), c = A(() => {
      const {
        type: h,
        dashed: p,
        plain: g
      } = t, m = o.value;
      return {
        [m]: !0,
        [l.value]: !!l.value,
        [`${m}-${h}`]: !0,
        [`${m}-dashed`]: !!p,
        [`${m}-plain`]: !!g,
        [`${m}-rtl`]: r.value === "rtl",
        [`${m}-no-default-orientation-margin-left`]: s.value,
        [`${m}-no-default-orientation-margin-right`]: u.value
      };
    }), d = A(() => {
      const h = typeof t.orientationMargin == "number" ? `${t.orientationMargin}px` : t.orientationMargin;
      return k(k({}, s.value && {
        marginLeft: h
      }), u.value && {
        marginRight: h
      });
    }), f = A(() => t.orientation.length > 0 ? "-" + t.orientation : t.orientation);
    return () => {
      var h;
      const p = Wi((h = n.default) === null || h === void 0 ? void 0 : h.call(n));
      return a(v("div", J(J({}, i), {}, {
        class: [c.value, p.length ? `${o.value}-with-text ${o.value}-with-text${f.value}` : "", i.class],
        role: "separator"
      }), [p.length ? v("span", {
        class: `${o.value}-inner-text`,
        style: d.value
      }, [p]) : null]));
    };
  }
}), mae = ya(gae);
Nr.Button = Jv;
Nr.install = function(t) {
  return t.component(Nr.name, Nr), t.component(Jv.name, Jv), t;
};
const BL = () => ({
  prefixCls: String,
  width: ve.oneOfType([ve.string, ve.number]),
  height: ve.oneOfType([ve.string, ve.number]),
  style: {
    type: Object,
    default: void 0
  },
  class: String,
  rootClassName: String,
  rootStyle: Vt(),
  placement: {
    type: String
  },
  wrapperClassName: String,
  level: {
    type: [String, Array]
  },
  levelMove: {
    type: [Number, Function, Array]
  },
  duration: String,
  ease: String,
  showMask: {
    type: Boolean,
    default: void 0
  },
  maskClosable: {
    type: Boolean,
    default: void 0
  },
  maskStyle: {
    type: Object,
    default: void 0
  },
  afterVisibleChange: Function,
  keyboard: {
    type: Boolean,
    default: void 0
  },
  contentWrapperStyle: ui(),
  autofocus: {
    type: Boolean,
    default: void 0
  },
  open: {
    type: Boolean,
    default: void 0
  },
  // Motion
  motion: ot(),
  maskMotion: Vt()
}), vae = () => k(k({}, BL()), {
  forceRender: {
    type: Boolean,
    default: void 0
  },
  getContainer: ve.oneOfType([ve.string, ve.func, ve.object, ve.looseBool])
}), yae = () => k(k({}, BL()), {
  getContainer: Function,
  getOpenCount: Function,
  scrollLocker: ve.any,
  inline: Boolean
});
function bae(t) {
  return Array.isArray(t) ? t : [t];
}
const xae = {
  transition: "transitionend",
  WebkitTransition: "webkitTransitionEnd",
  MozTransition: "transitionend",
  OTransition: "oTransitionEnd otransitionend"
};
Object.keys(xae).filter((t) => {
  if (typeof document > "u")
    return !1;
  const e = document.getElementsByTagName("html")[0];
  return t in (e ? e.style : {});
})[0];
const Oae = !(typeof window < "u" && window.document && window.document.createElement);
var Sae = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
const jE = Oe({
  compatConfig: {
    MODE: 3
  },
  inheritAttrs: !1,
  props: yae(),
  emits: ["close", "handleClick", "change"],
  setup(t, e) {
    let {
      emit: n,
      slots: i
    } = e;
    const o = Te(), r = Te(), a = Te(), l = Te(), s = Te();
    let u = [];
    `${Number((Date.now() + Math.random()).toString().replace(".", Math.round(Math.random() * 9).toString())).toString(16)}`, Lt(() => {
      rn(() => {
        var y;
        const {
          open: b,
          getContainer: w,
          showMask: $,
          autofocus: C
        } = t, P = w?.();
        p(t), b && (P && (P.parentNode, document.body), rn(() => {
          C && c();
        }), $ && ((y = t.scrollLocker) === null || y === void 0 || y.lock()));
      });
    }), _e(() => t.level, () => {
      p(t);
    }, {
      flush: "post"
    }), _e(() => t.open, () => {
      const {
        open: y,
        getContainer: b,
        scrollLocker: w,
        showMask: $,
        autofocus: C
      } = t, P = b?.();
      P && (P.parentNode, document.body), y ? (C && c(), $ && w?.lock()) : w?.unLock();
    }, {
      flush: "post"
    }), wo(() => {
      var y;
      const {
        open: b
      } = t;
      b && (document.body.style.touchAction = ""), (y = t.scrollLocker) === null || y === void 0 || y.unLock();
    }), _e(() => t.placement, (y) => {
      y && (s.value = null);
    });
    const c = () => {
      var y, b;
      (b = (y = r.value) === null || y === void 0 ? void 0 : y.focus) === null || b === void 0 || b.call(y);
    }, d = (y) => {
      n("close", y);
    }, f = (y) => {
      y.keyCode === lt.ESC && (y.stopPropagation(), d(y));
    }, h = () => {
      const {
        open: y,
        afterVisibleChange: b
      } = t;
      b && b(!!y);
    }, p = (y) => {
      let {
        level: b,
        getContainer: w
      } = y;
      if (Oae)
        return;
      const $ = w?.(), C = $ ? $.parentNode : null;
      u = [], b === "all" ? (C ? Array.prototype.slice.call(C.children) : []).forEach((O) => {
        O.nodeName !== "SCRIPT" && O.nodeName !== "STYLE" && O.nodeName !== "LINK" && O !== $ && u.push(O);
      }) : b && bae(b).forEach((P) => {
        document.querySelectorAll(P).forEach((O) => {
          u.push(O);
        });
      });
    }, g = (y) => {
      n("handleClick", y);
    }, m = Te(!1);
    return _e(r, () => {
      rn(() => {
        m.value = !0;
      });
    }), () => {
      var y, b;
      const {
        width: w,
        height: $,
        open: C,
        prefixCls: P,
        placement: O,
        level: E,
        levelMove: _,
        ease: D,
        duration: M,
        getContainer: N,
        onChange: L,
        afterVisibleChange: j,
        showMask: B,
        maskClosable: Y,
        maskStyle: Q,
        keyboard: G,
        getOpenCount: V,
        scrollLocker: H,
        contentWrapperStyle: q,
        style: K,
        class: ee,
        rootClassName: ie,
        rootStyle: ae,
        maskMotion: te,
        motion: U,
        inline: me
      } = t, ce = Sae(t, ["width", "height", "open", "prefixCls", "placement", "level", "levelMove", "ease", "duration", "getContainer", "onChange", "afterVisibleChange", "showMask", "maskClosable", "maskStyle", "keyboard", "getOpenCount", "scrollLocker", "contentWrapperStyle", "style", "class", "rootClassName", "rootStyle", "maskMotion", "motion", "inline"]), ue = C && m.value, fe = Ae(P, {
        [`${P}-${O}`]: !0,
        [`${P}-open`]: ue,
        [`${P}-inline`]: me,
        "no-mask": !B,
        [ie]: !0
      }), he = typeof U == "function" ? U(O) : U;
      return v("div", J(J({}, ii(ce, ["autofocus"])), {}, {
        tabindex: -1,
        class: fe,
        style: ae,
        ref: r,
        onKeydown: ue && G ? f : void 0
      }), [v(zr, te, {
        default: () => [B && fa(v("div", {
          class: `${P}-mask`,
          onClick: Y ? d : void 0,
          style: Q,
          ref: a
        }, null), [[Qa, ue]])]
      }), v(zr, J(J({}, he), {}, {
        onAfterEnter: h,
        onAfterLeave: h
      }), {
        default: () => [fa(v("div", {
          class: `${P}-content-wrapper`,
          style: [q],
          ref: o
        }, [v("div", {
          class: [`${P}-content`, ee],
          style: K,
          ref: s
        }, [(y = i.default) === null || y === void 0 ? void 0 : y.call(i)]), i.handler ? v("div", {
          onClick: g,
          ref: l
        }, [(b = i.handler) === null || b === void 0 ? void 0 : b.call(i)]) : null]), [[Qa, ue]])]
      })]);
    };
  }
});
var qE = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
const wae = Oe({
  compatConfig: {
    MODE: 3
  },
  inheritAttrs: !1,
  props: Kn(vae(), {
    prefixCls: "drawer",
    placement: "left",
    getContainer: "body",
    level: "all",
    duration: ".3s",
    ease: "cubic-bezier(0.78, 0.14, 0.15, 0.86)",
    afterVisibleChange: () => {
    },
    showMask: !0,
    maskClosable: !0,
    maskStyle: {},
    wrapperClassName: "",
    keyboard: !0,
    forceRender: !1,
    autofocus: !0
  }),
  emits: ["handleClick", "close"],
  setup(t, e) {
    let {
      emit: n,
      slots: i
    } = e;
    const o = de(null), r = (l) => {
      n("handleClick", l);
    }, a = (l) => {
      n("close", l);
    };
    return () => {
      const {
        getContainer: l,
        wrapperClassName: s,
        rootClassName: u,
        rootStyle: c,
        forceRender: d
      } = t, f = qE(t, ["getContainer", "wrapperClassName", "rootClassName", "rootStyle", "forceRender"]);
      let h = null;
      if (!l)
        return v(jE, J(J({}, f), {}, {
          rootClassName: u,
          rootStyle: c,
          open: t.open,
          onClose: a,
          onHandleClick: r,
          inline: !0
        }), i);
      const p = !!i.handler || d;
      return (p || t.open || o.value) && (h = v($C, {
        autoLock: !0,
        visible: t.open,
        forceRender: p,
        getContainer: l,
        wrapperClassName: s
      }, {
        default: (g) => {
          var {
            visible: m,
            afterClose: y
          } = g, b = qE(g, ["visible", "afterClose"]);
          return v(jE, J(J(J({
            ref: o
          }, f), b), {}, {
            rootClassName: u,
            rootStyle: c,
            open: m !== void 0 ? m : t.open,
            afterVisibleChange: y !== void 0 ? y : t.afterVisibleChange,
            onClose: a,
            onHandleClick: r
          }), i);
        }
      })), h;
    };
  }
}), Cae = (t) => {
  const {
    componentCls: e,
    motionDurationSlow: n
  } = t, i = {
    "&-enter, &-appear, &-leave": {
      "&-start": {
        transition: "none"
      },
      "&-active": {
        transition: `all ${n}`
      }
    }
  };
  return {
    [e]: {
      // ======================== Mask ========================
      [`${e}-mask-motion`]: {
        "&-enter, &-appear, &-leave": {
          "&-active": {
            transition: `all ${n}`
          }
        },
        "&-enter, &-appear": {
          opacity: 0,
          "&-active": {
            opacity: 1
          }
        },
        "&-leave": {
          opacity: 1,
          "&-active": {
            opacity: 0
          }
        }
      },
      // ======================= Panel ========================
      [`${e}-panel-motion`]: {
        // Left
        "&-left": [i, {
          "&-enter, &-appear": {
            "&-start": {
              transform: "translateX(-100%) !important"
            },
            "&-active": {
              transform: "translateX(0)"
            }
          },
          "&-leave": {
            transform: "translateX(0)",
            "&-active": {
              transform: "translateX(-100%)"
            }
          }
        }],
        // Right
        "&-right": [i, {
          "&-enter, &-appear": {
            "&-start": {
              transform: "translateX(100%) !important"
            },
            "&-active": {
              transform: "translateX(0)"
            }
          },
          "&-leave": {
            transform: "translateX(0)",
            "&-active": {
              transform: "translateX(100%)"
            }
          }
        }],
        // Top
        "&-top": [i, {
          "&-enter, &-appear": {
            "&-start": {
              transform: "translateY(-100%) !important"
            },
            "&-active": {
              transform: "translateY(0)"
            }
          },
          "&-leave": {
            transform: "translateY(0)",
            "&-active": {
              transform: "translateY(-100%)"
            }
          }
        }],
        // Bottom
        "&-bottom": [i, {
          "&-enter, &-appear": {
            "&-start": {
              transform: "translateY(100%) !important"
            },
            "&-active": {
              transform: "translateY(0)"
            }
          },
          "&-leave": {
            transform: "translateY(0)",
            "&-active": {
              transform: "translateY(100%)"
            }
          }
        }]
      }
    }
  };
}, $ae = (t) => {
  const {
    componentCls: e,
    zIndexPopup: n,
    colorBgMask: i,
    colorBgElevated: o,
    motionDurationSlow: r,
    motionDurationMid: a,
    padding: l,
    paddingLG: s,
    fontSizeLG: u,
    lineHeightLG: c,
    lineWidth: d,
    lineType: f,
    colorSplit: h,
    marginSM: p,
    colorIcon: g,
    colorIconHover: m,
    colorText: y,
    fontWeightStrong: b,
    drawerFooterPaddingVertical: w,
    drawerFooterPaddingHorizontal: $
  } = t, C = `${e}-content-wrapper`;
  return {
    [e]: {
      position: "fixed",
      inset: 0,
      zIndex: n,
      pointerEvents: "none",
      "&-pure": {
        position: "relative",
        background: o,
        [`&${e}-left`]: {
          boxShadow: t.boxShadowDrawerLeft
        },
        [`&${e}-right`]: {
          boxShadow: t.boxShadowDrawerRight
        },
        [`&${e}-top`]: {
          boxShadow: t.boxShadowDrawerUp
        },
        [`&${e}-bottom`]: {
          boxShadow: t.boxShadowDrawerDown
        }
      },
      "&-inline": {
        position: "absolute"
      },
      // ====================== Mask ======================
      [`${e}-mask`]: {
        position: "absolute",
        inset: 0,
        zIndex: n,
        background: i,
        pointerEvents: "auto"
      },
      // ==================== Content =====================
      [C]: {
        position: "absolute",
        zIndex: n,
        transition: `all ${r}`,
        "&-hidden": {
          display: "none"
        }
      },
      // Placement
      [`&-left > ${C}`]: {
        top: 0,
        bottom: 0,
        left: {
          _skip_check_: !0,
          value: 0
        },
        boxShadow: t.boxShadowDrawerLeft
      },
      [`&-right > ${C}`]: {
        top: 0,
        right: {
          _skip_check_: !0,
          value: 0
        },
        bottom: 0,
        boxShadow: t.boxShadowDrawerRight
      },
      [`&-top > ${C}`]: {
        top: 0,
        insetInline: 0,
        boxShadow: t.boxShadowDrawerUp
      },
      [`&-bottom > ${C}`]: {
        bottom: 0,
        insetInline: 0,
        boxShadow: t.boxShadowDrawerDown
      },
      [`${e}-content`]: {
        width: "100%",
        height: "100%",
        overflow: "auto",
        background: o,
        pointerEvents: "auto"
      },
      // ===================== Panel ======================
      [`${e}-wrapper-body`]: {
        display: "flex",
        flexDirection: "column",
        width: "100%",
        height: "100%"
      },
      // Header
      [`${e}-header`]: {
        display: "flex",
        flex: 0,
        alignItems: "center",
        padding: `${l}px ${s}px`,
        fontSize: u,
        lineHeight: c,
        borderBottom: `${d}px ${f} ${h}`,
        "&-title": {
          display: "flex",
          flex: 1,
          alignItems: "center",
          minWidth: 0,
          minHeight: 0
        }
      },
      [`${e}-extra`]: {
        flex: "none"
      },
      [`${e}-close`]: {
        display: "inline-block",
        marginInlineEnd: p,
        color: g,
        fontWeight: b,
        fontSize: u,
        fontStyle: "normal",
        lineHeight: 1,
        textAlign: "center",
        textTransform: "none",
        textDecoration: "none",
        background: "transparent",
        border: 0,
        outline: 0,
        cursor: "pointer",
        transition: `color ${a}`,
        textRendering: "auto",
        "&:focus, &:hover": {
          color: m,
          textDecoration: "none"
        }
      },
      [`${e}-title`]: {
        flex: 1,
        margin: 0,
        color: y,
        fontWeight: t.fontWeightStrong,
        fontSize: u,
        lineHeight: c
      },
      // Body
      [`${e}-body`]: {
        flex: 1,
        minWidth: 0,
        minHeight: 0,
        padding: s,
        overflow: "auto"
      },
      // Footer
      [`${e}-footer`]: {
        flexShrink: 0,
        padding: `${w}px ${$}px`,
        borderTop: `${d}px ${f} ${h}`
      },
      // ====================== RTL =======================
      "&-rtl": {
        direction: "rtl"
      }
    }
  };
}, kae = Vn("Drawer", (t) => {
  const e = dn(t, {
    drawerFooterPaddingVertical: t.paddingXS,
    drawerFooterPaddingHorizontal: t.padding
  });
  return [$ae(e), Cae(e)];
}, (t) => ({
  zIndexPopup: t.zIndexPopupBase
}));
var Tae = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
const Pae = ["top", "right", "bottom", "left"], YE = {
  distance: 180
}, Eae = () => ({
  autofocus: {
    type: Boolean,
    default: void 0
  },
  closable: {
    type: Boolean,
    default: void 0
  },
  closeIcon: ve.any,
  destroyOnClose: {
    type: Boolean,
    default: void 0
  },
  forceRender: {
    type: Boolean,
    default: void 0
  },
  getContainer: {
    type: [String, Function, Boolean, Object],
    default: void 0
  },
  maskClosable: {
    type: Boolean,
    default: void 0
  },
  mask: {
    type: Boolean,
    default: void 0
  },
  maskStyle: Vt(),
  rootClassName: String,
  rootStyle: Vt(),
  size: {
    type: String
  },
  drawerStyle: Vt(),
  headerStyle: Vt(),
  bodyStyle: Vt(),
  contentWrapperStyle: {
    type: Object,
    default: void 0
  },
  title: ve.any,
  /** @deprecated Please use `open` instead */
  visible: {
    type: Boolean,
    default: void 0
  },
  open: {
    type: Boolean,
    default: void 0
  },
  width: ve.oneOfType([ve.string, ve.number]),
  height: ve.oneOfType([ve.string, ve.number]),
  zIndex: Number,
  prefixCls: String,
  push: ve.oneOfType([ve.looseBool, {
    type: Object
  }]),
  placement: ve.oneOf(Pae),
  keyboard: {
    type: Boolean,
    default: void 0
  },
  extra: ve.any,
  footer: ve.any,
  footerStyle: Vt(),
  level: ve.any,
  levelMove: {
    type: [Number, Array, Function]
  },
  handle: ve.any,
  /** @deprecated Use `@afterVisibleChange` instead */
  afterVisibleChange: Function,
  /** @deprecated Please use `@afterOpenChange` instead */
  onAfterVisibleChange: Function,
  onAfterOpenChange: Function,
  /** @deprecated Please use `onUpdate:open` instead */
  "onUpdate:visible": Function,
  "onUpdate:open": Function,
  onClose: Function
}), _ae = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ADrawer",
  inheritAttrs: !1,
  props: Kn(Eae(), {
    closable: !0,
    placement: "right",
    maskClosable: !0,
    mask: !0,
    level: null,
    keyboard: !0,
    push: YE
  }),
  slots: Object,
  // emits: ['update:visible', 'close', 'afterVisibleChange'],
  setup(t, e) {
    let {
      emit: n,
      slots: i,
      attrs: o
    } = e;
    const r = Te(!1), a = Te(!1), l = Te(null), s = Te(!1), u = Te(!1), c = A(() => {
      var V;
      return (V = t.open) !== null && V !== void 0 ? V : t.visible;
    });
    _e(c, () => {
      c.value ? s.value = !0 : u.value = !1;
    }, {
      immediate: !0
    }), _e([c, s], () => {
      c.value && s.value && (u.value = !0);
    }, {
      immediate: !0
    });
    const d = qt("parentDrawerOpts", null), {
      prefixCls: f,
      getPopupContainer: h,
      direction: p
    } = Ht("drawer", t), [g, m] = kae(f), y = A(() => (
      // 有可能为 false，所以不能直接判断
      t.getContainer === void 0 && h?.value ? () => h.value(document.body) : t.getContainer
    ));
    $n(!t.afterVisibleChange, "Drawer", "`afterVisibleChange` prop is deprecated, please use `@afterVisibleChange` event instead"), process.env.NODE_ENV !== "production" && [["visible", "open"], ["onUpdate:visible", "onUpdate:open"], ["onAfterVisibleChange", "onAfterOpenChange"]].forEach((V) => {
      let [H, q] = V;
      $n(!t[H], "Drawer", `\`${H}\` is deprecated, please use \`${q}\` instead.`);
    }), Xt("parentDrawerOpts", {
      setPush: () => {
        r.value = !0;
      },
      setPull: () => {
        r.value = !1, rn(() => {
          $();
        });
      }
    }), Lt(() => {
      c.value && d && d.setPush();
    }), wo(() => {
      d && d.setPull();
    }), _e(u, () => {
      d && (u.value ? d.setPush() : d.setPull());
    }, {
      flush: "post"
    });
    const $ = () => {
      var V, H;
      (H = (V = l.value) === null || V === void 0 ? void 0 : V.domFocus) === null || H === void 0 || H.call(V);
    }, C = (V) => {
      n("update:visible", !1), n("update:open", !1), n("close", V);
    }, P = (V) => {
      var H;
      V || (a.value === !1 && (a.value = !0), t.destroyOnClose && (s.value = !1)), (H = t.afterVisibleChange) === null || H === void 0 || H.call(t, V), n("afterVisibleChange", V), n("afterOpenChange", V);
    }, O = A(() => {
      const {
        push: V,
        placement: H
      } = t;
      let q;
      return typeof V == "boolean" ? q = V ? YE.distance : 0 : q = V.distance, q = parseFloat(String(q || 0)), H === "left" || H === "right" ? `translateX(${H === "left" ? q : -q}px)` : H === "top" || H === "bottom" ? `translateY(${H === "top" ? q : -q}px)` : null;
    }), E = A(() => {
      var V;
      return (V = t.width) !== null && V !== void 0 ? V : t.size === "large" ? 736 : 378;
    }), _ = A(() => {
      var V;
      return (V = t.height) !== null && V !== void 0 ? V : t.size === "large" ? 736 : 378;
    }), D = A(() => {
      const {
        mask: V,
        placement: H
      } = t;
      if (!u.value && !V)
        return {};
      const q = {};
      return H === "left" || H === "right" ? q.width = N2(E.value) ? `${E.value}px` : E.value : q.height = N2(_.value) ? `${_.value}px` : _.value, q;
    }), M = A(() => {
      const {
        zIndex: V,
        contentWrapperStyle: H
      } = t, q = D.value;
      return [{
        zIndex: V,
        transform: r.value ? O.value : void 0
      }, k({}, H), q];
    }), N = (V) => {
      const {
        closable: H,
        headerStyle: q
      } = t, K = ca(i, t, "extra"), ee = ca(i, t, "title");
      return !ee && !H ? null : v("div", {
        class: Ae(`${V}-header`, {
          [`${V}-header-close-only`]: H && !ee && !K
        }),
        style: q
      }, [v("div", {
        class: `${V}-header-title`
      }, [L(V), ee && v("div", {
        class: `${V}-title`
      }, [ee])]), K && v("div", {
        class: `${V}-extra`
      }, [K])]);
    }, L = (V) => {
      var H;
      const {
        closable: q
      } = t, K = i.closeIcon ? (H = i.closeIcon) === null || H === void 0 ? void 0 : H.call(i) : t.closeIcon;
      return q && v("button", {
        key: "closer",
        onClick: C,
        "aria-label": "Close",
        class: `${V}-close`
      }, [K === void 0 ? v(Ll, null, null) : K]);
    }, j = (V) => {
      var H;
      if (a.value && !t.forceRender && !s.value)
        return null;
      const {
        bodyStyle: q,
        drawerStyle: K
      } = t;
      return v("div", {
        class: `${V}-wrapper-body`,
        style: K
      }, [N(V), v("div", {
        key: "body",
        class: `${V}-body`,
        style: q
      }, [(H = i.default) === null || H === void 0 ? void 0 : H.call(i)]), B(V)]);
    }, B = (V) => {
      const H = ca(i, t, "footer");
      if (!H)
        return null;
      const q = `${V}-footer`;
      return v("div", {
        class: q,
        style: t.footerStyle
      }, [H]);
    }, Y = A(() => Ae({
      "no-mask": !t.mask,
      [`${f.value}-rtl`]: p.value === "rtl"
    }, t.rootClassName, m.value)), Q = A(() => jc(Is(f.value, "mask-motion"))), G = (V) => jc(Is(f.value, `panel-motion-${V}`));
    return () => {
      const {
        width: V,
        height: H,
        placement: q,
        mask: K,
        forceRender: ee
      } = t, ie = Tae(t, ["width", "height", "placement", "mask", "forceRender"]), ae = k(k(k({}, o), ii(ie, ["size", "closeIcon", "closable", "destroyOnClose", "drawerStyle", "headerStyle", "bodyStyle", "title", "push", "onAfterVisibleChange", "onClose", "onUpdate:visible", "onUpdate:open", "visible"])), {
        forceRender: ee,
        onClose: C,
        afterVisibleChange: P,
        handler: !1,
        prefixCls: f.value,
        open: u.value,
        showMask: K,
        placement: q,
        ref: l
      });
      return g(v(Vp, null, {
        default: () => [v(wae, J(J({}, ae), {}, {
          maskMotion: Q.value,
          motion: G,
          width: E.value,
          height: _.value,
          getContainer: y.value,
          rootClassName: Y.value,
          rootStyle: t.rootStyle,
          contentWrapperStyle: M.value
        }), {
          handler: t.handle ? () => t.handle : i.handle,
          default: () => j(f.value)
        })]
      }));
    };
  }
}), Iae = ya(_ae), up = (t) => t != null && (Array.isArray(t) ? ho(t).length : !0);
function _$(t) {
  return up(t.prefix) || up(t.suffix) || up(t.allowClear);
}
function yv(t) {
  return up(t.addonBefore) || up(t.addonAfter);
}
function GO(t) {
  return typeof t > "u" || t === null ? "" : String(t);
}
function cp(t, e, n, i) {
  if (!n)
    return;
  const o = e;
  if (e.type === "click") {
    Object.defineProperty(o, "target", {
      writable: !0
    }), Object.defineProperty(o, "currentTarget", {
      writable: !0
    });
    const r = t.cloneNode(!0);
    o.target = r, o.currentTarget = r, r.value = "", n(o);
    return;
  }
  if (i !== void 0) {
    Object.defineProperty(o, "target", {
      writable: !0
    }), Object.defineProperty(o, "currentTarget", {
      writable: !0
    }), o.target = t, o.currentTarget = t, t.value = i, n(o);
    return;
  }
  n(o);
}
function FL(t, e) {
  if (!t) return;
  t.focus(e);
  const {
    cursor: n
  } = e || {};
  if (n) {
    const i = t.value.length;
    switch (n) {
      case "start":
        t.setSelectionRange(0, 0);
        break;
      case "end":
        t.setSelectionRange(i, i);
        break;
      default:
        t.setSelectionRange(0, i);
    }
  }
}
const Mae = () => ({
  addonBefore: ve.any,
  addonAfter: ve.any,
  prefix: ve.any,
  suffix: ve.any,
  clearIcon: ve.any,
  affixWrapperClassName: String,
  groupClassName: String,
  wrapperClassName: String,
  inputClassName: String,
  allowClear: {
    type: Boolean,
    default: void 0
  }
}), VL = () => k(k({}, Mae()), {
  value: {
    type: [String, Number, Symbol],
    default: void 0
  },
  defaultValue: {
    type: [String, Number, Symbol],
    default: void 0
  },
  inputElement: ve.any,
  prefixCls: String,
  disabled: {
    type: Boolean,
    default: void 0
  },
  focused: {
    type: Boolean,
    default: void 0
  },
  triggerFocus: Function,
  readonly: {
    type: Boolean,
    default: void 0
  },
  handleReset: Function,
  hidden: {
    type: Boolean,
    default: void 0
  }
}), QL = () => k(k({}, VL()), {
  id: String,
  placeholder: {
    type: [String, Number]
  },
  autocomplete: String,
  type: yn("text"),
  name: String,
  size: {
    type: String
  },
  autofocus: {
    type: Boolean,
    default: void 0
  },
  lazy: {
    type: Boolean,
    default: !0
  },
  maxlength: Number,
  loading: {
    type: Boolean,
    default: void 0
  },
  bordered: {
    type: Boolean,
    default: void 0
  },
  showCount: {
    type: [Boolean, Object]
  },
  htmlSize: Number,
  onPressEnter: Function,
  onKeydown: Function,
  onKeyup: Function,
  onFocus: Function,
  onBlur: Function,
  onChange: Function,
  onInput: Function,
  "onUpdate:value": Function,
  onCompositionstart: Function,
  onCompositionend: Function,
  valueModifiers: Object,
  hidden: {
    type: Boolean,
    default: void 0
  },
  status: String
}), Aae = Oe({
  name: "BaseInput",
  inheritAttrs: !1,
  props: VL(),
  setup(t, e) {
    let {
      slots: n,
      attrs: i
    } = e;
    const o = de(), r = (l) => {
      var s;
      if (!((s = o.value) === null || s === void 0) && s.contains(l.target)) {
        const {
          triggerFocus: u
        } = t;
        u?.();
      }
    }, a = () => {
      var l;
      const {
        allowClear: s,
        value: u,
        disabled: c,
        readonly: d,
        handleReset: f,
        suffix: h = n.suffix,
        prefixCls: p
      } = t;
      if (!s)
        return null;
      const g = !c && !d && u, m = `${p}-clear-icon`, y = ((l = n.clearIcon) === null || l === void 0 ? void 0 : l.call(n)) || "*";
      return v("span", {
        onClick: f,
        onMousedown: (b) => b.preventDefault(),
        class: Ae({
          [`${m}-hidden`]: !g,
          [`${m}-has-suffix`]: !!h
        }, m),
        role: "button",
        tabindex: -1
      }, [y]);
    };
    return () => {
      var l, s;
      const {
        focused: u,
        value: c,
        disabled: d,
        allowClear: f,
        readonly: h,
        hidden: p,
        prefixCls: g,
        prefix: m = (l = n.prefix) === null || l === void 0 ? void 0 : l.call(n),
        suffix: y = (s = n.suffix) === null || s === void 0 ? void 0 : s.call(n),
        addonAfter: b = n.addonAfter,
        addonBefore: w = n.addonBefore,
        inputElement: $,
        affixWrapperClassName: C,
        wrapperClassName: P,
        groupClassName: O
      } = t;
      let E = vi($, {
        value: c,
        hidden: p
      });
      if (_$({
        prefix: m,
        suffix: y,
        allowClear: f
      })) {
        const _ = `${g}-affix-wrapper`, D = Ae(_, {
          [`${_}-disabled`]: d,
          [`${_}-focused`]: u,
          [`${_}-readonly`]: h,
          [`${_}-input-with-clear-btn`]: y && f && c
        }, !yv({
          addonAfter: b,
          addonBefore: w
        }) && i.class, C), M = (y || f) && v("span", {
          class: `${g}-suffix`
        }, [a(), y]);
        E = v("span", {
          class: D,
          style: i.style,
          hidden: !yv({
            addonAfter: b,
            addonBefore: w
          }) && p,
          onMousedown: r,
          ref: o
        }, [m && v("span", {
          class: `${g}-prefix`
        }, [m]), vi($, {
          style: null,
          value: c,
          hidden: null
        }), M]);
      }
      if (yv({
        addonAfter: b,
        addonBefore: w
      })) {
        const _ = `${g}-group`, D = `${_}-addon`, M = Ae(`${g}-wrapper`, _, P), N = Ae(`${g}-group-wrapper`, i.class, O);
        return v("span", {
          class: N,
          style: i.style,
          hidden: p
        }, [v("span", {
          class: M
        }, [w && v("span", {
          class: D
        }, [w]), vi(E, {
          style: null,
          hidden: null
        }), b && v("span", {
          class: D
        }, [b])])]);
      }
      return E;
    };
  }
});
var Rae = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
const Dae = Oe({
  name: "VCInput",
  inheritAttrs: !1,
  props: QL(),
  setup(t, e) {
    let {
      slots: n,
      attrs: i,
      expose: o,
      emit: r
    } = e;
    const a = Te(t.value === void 0 ? t.defaultValue : t.value), l = Te(!1), s = Te(), u = Te();
    _e(() => t.value, () => {
      a.value = t.value;
    }), _e(() => t.disabled, () => {
      t.disabled && (l.value = !1);
    });
    const c = (O) => {
      s.value && FL(s.value.input, O);
    }, d = () => {
      var O;
      (O = s.value.input) === null || O === void 0 || O.blur();
    }, f = (O, E, _) => {
      var D;
      (D = s.value.input) === null || D === void 0 || D.setSelectionRange(O, E, _);
    }, h = () => {
      var O;
      (O = s.value.input) === null || O === void 0 || O.select();
    };
    o({
      focus: c,
      blur: d,
      input: A(() => {
        var O;
        return (O = s.value.input) === null || O === void 0 ? void 0 : O.input;
      }),
      stateValue: a,
      setSelectionRange: f,
      select: h
    });
    const p = (O) => {
      r("change", O);
    }, g = (O, E) => {
      a.value !== O && (t.value === void 0 ? a.value = O : rn(() => {
        var _;
        s.value.input.value !== a.value && ((_ = u.value) === null || _ === void 0 || _.$forceUpdate());
      }), rn(() => {
        E && E();
      }));
    }, m = (O) => {
      const {
        value: E
      } = O.target;
      if (a.value === E) return;
      const _ = O.target.value;
      cp(s.value.input, O, p), g(_);
    }, y = (O) => {
      O.keyCode === 13 && r("pressEnter", O), r("keydown", O);
    }, b = (O) => {
      l.value = !0, r("focus", O);
    }, w = (O) => {
      l.value = !1, r("blur", O);
    }, $ = (O) => {
      cp(s.value.input, O, p), g("", () => {
        c();
      });
    }, C = () => {
      var O, E;
      const {
        addonBefore: _ = n.addonBefore,
        addonAfter: D = n.addonAfter,
        disabled: M,
        valueModifiers: N = {},
        htmlSize: L,
        autocomplete: j,
        prefixCls: B,
        inputClassName: Y,
        prefix: Q = (O = n.prefix) === null || O === void 0 ? void 0 : O.call(n),
        suffix: G = (E = n.suffix) === null || E === void 0 ? void 0 : E.call(n),
        allowClear: V,
        type: H = "text"
      } = t, q = ii(t, [
        "prefixCls",
        "onPressEnter",
        "addonBefore",
        "addonAfter",
        "prefix",
        "suffix",
        "allowClear",
        // Input elements must be either controlled or uncontrolled,
        // specify either the value prop, or the defaultValue prop, but not both.
        "defaultValue",
        "size",
        "bordered",
        "htmlSize",
        "lazy",
        "showCount",
        "valueModifiers",
        "showCount",
        "affixWrapperClassName",
        "groupClassName",
        "inputClassName",
        "wrapperClassName"
      ]), K = k(k(k({}, q), i), {
        autocomplete: j,
        onChange: m,
        onInput: m,
        onFocus: b,
        onBlur: w,
        onKeydown: y,
        class: Ae(B, {
          [`${B}-disabled`]: M
        }, Y, !yv({
          addonAfter: D,
          addonBefore: _
        }) && !_$({
          prefix: Q,
          suffix: G,
          allowClear: V
        }) && i.class),
        ref: s,
        key: "ant-input",
        size: L,
        type: H,
        lazy: t.lazy
      });
      return N.lazy && delete K.onInput, K.autofocus || delete K.autofocus, v(fg, ii(K, ["size"]), null);
    }, P = () => {
      var O;
      const {
        maxlength: E,
        suffix: _ = (O = n.suffix) === null || O === void 0 ? void 0 : O.call(n),
        showCount: D,
        prefixCls: M
      } = t, N = Number(E) > 0;
      if (_ || D) {
        const L = [...GO(a.value)].length, j = typeof D == "object" ? D.formatter({
          count: L,
          maxlength: E
        }) : `${L}${N ? ` / ${E}` : ""}`;
        return v(tt, null, [!!D && v("span", {
          class: Ae(`${M}-show-count-suffix`, {
            [`${M}-show-count-has-suffix`]: !!_
          })
        }, [j]), _]);
      }
      return null;
    };
    return Lt(() => {
      process.env.NODE_ENV === "test" && t.autofocus && c();
    }), () => {
      const {
        prefixCls: O,
        disabled: E
      } = t, _ = Rae(t, ["prefixCls", "disabled"]);
      return v(Aae, J(J(J({}, _), i), {}, {
        ref: u,
        prefixCls: O,
        inputElement: C(),
        handleReset: $,
        value: GO(a.value),
        focused: l.value,
        triggerFocus: c,
        suffix: P(),
        disabled: E
      }), n);
    };
  }
}), Ly = () => ii(QL(), ["wrapperClassName", "groupClassName", "inputClassName", "affixWrapperClassName"]), HL = () => k(k({}, ii(Ly(), ["prefix", "addonBefore", "addonAfter", "suffix"])), {
  rows: Number,
  autosize: {
    type: [Boolean, Object],
    default: void 0
  },
  autoSize: {
    type: [Boolean, Object],
    default: void 0
  },
  onResize: {
    type: Function
  },
  onCompositionstart: Mf(),
  onCompositionend: Mf(),
  valueModifiers: Object
});
var Nae = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
const jt = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "AInput",
  inheritAttrs: !1,
  props: Ly(),
  setup(t, e) {
    let {
      slots: n,
      attrs: i,
      expose: o,
      emit: r
    } = e;
    const a = de(), l = jr(), s = Fr.useInject(), u = A(() => ad(s.status, t.status)), {
      direction: c,
      prefixCls: d,
      size: f,
      autocomplete: h
    } = Ht("input", t), {
      compactSize: p,
      compactItemClassnames: g
    } = sh(d, c), m = A(() => p.value || f.value), [y, b] = g$(d), w = qa();
    o({
      focus: (L) => {
        var j;
        (j = a.value) === null || j === void 0 || j.focus(L);
      },
      blur: () => {
        var L;
        (L = a.value) === null || L === void 0 || L.blur();
      },
      input: a,
      setSelectionRange: (L, j, B) => {
        var Y;
        (Y = a.value) === null || Y === void 0 || Y.setSelectionRange(L, j, B);
      },
      select: () => {
        var L;
        (L = a.value) === null || L === void 0 || L.select();
      }
    });
    const E = de([]), _ = () => {
      E.value.push(setTimeout(() => {
        var L, j, B, Y;
        !((L = a.value) === null || L === void 0) && L.input && ((j = a.value) === null || j === void 0 ? void 0 : j.input.getAttribute("type")) === "password" && (!((B = a.value) === null || B === void 0) && B.input.hasAttribute("value")) && ((Y = a.value) === null || Y === void 0 || Y.input.removeAttribute("value"));
      }));
    };
    Lt(() => {
      _();
    }), gw(() => {
      E.value.forEach((L) => clearTimeout(L));
    }), tn(() => {
      E.value.forEach((L) => clearTimeout(L));
    });
    const D = (L) => {
      _(), r("blur", L), l.onFieldBlur();
    }, M = (L) => {
      _(), r("focus", L);
    }, N = (L) => {
      r("update:value", L.target.value), r("change", L), r("input", L), l.onFieldChange();
    };
    return () => {
      var L, j, B, Y, Q, G;
      const {
        hasFeedback: V,
        feedbackIcon: H
      } = s, {
        allowClear: q,
        bordered: K = !0,
        prefix: ee = (L = n.prefix) === null || L === void 0 ? void 0 : L.call(n),
        suffix: ie = (j = n.suffix) === null || j === void 0 ? void 0 : j.call(n),
        addonAfter: ae = (B = n.addonAfter) === null || B === void 0 ? void 0 : B.call(n),
        addonBefore: te = (Y = n.addonBefore) === null || Y === void 0 ? void 0 : Y.call(n),
        id: U = (Q = l.id) === null || Q === void 0 ? void 0 : Q.value
      } = t, me = Nae(t, ["allowClear", "bordered", "prefix", "suffix", "addonAfter", "addonBefore", "id"]), ce = (V || ie) && v(tt, null, [ie, V && H]), ue = d.value, fe = _$({
        prefix: ee,
        suffix: ie
      }) || !!V, he = n.clearIcon || (() => v(Wr, null, null));
      return y(v(Dae, J(J(J({}, i), ii(me, ["onUpdate:value", "onChange", "onInput"])), {}, {
        onChange: N,
        id: U,
        disabled: (G = t.disabled) !== null && G !== void 0 ? G : w.value,
        ref: a,
        prefixCls: ue,
        autocomplete: h.value,
        onBlur: D,
        onFocus: M,
        prefix: ee,
        suffix: ce,
        allowClear: q,
        addonAfter: ae && v(Vp, null, {
          default: () => [v(Xv, null, {
            default: () => [ae]
          })]
        }),
        addonBefore: te && v(Vp, null, {
          default: () => [v(Xv, null, {
            default: () => [te]
          })]
        }),
        class: [i.class, g.value],
        inputClassName: Ae({
          [`${ue}-sm`]: m.value === "small",
          [`${ue}-lg`]: m.value === "large",
          [`${ue}-rtl`]: c.value === "rtl",
          [`${ue}-borderless`]: !K
        }, !fe && Fa(ue, u.value), b.value),
        affixWrapperClassName: Ae({
          [`${ue}-affix-wrapper-sm`]: m.value === "small",
          [`${ue}-affix-wrapper-lg`]: m.value === "large",
          [`${ue}-affix-wrapper-rtl`]: c.value === "rtl",
          [`${ue}-affix-wrapper-borderless`]: !K
        }, Fa(`${ue}-affix-wrapper`, u.value, V), b.value),
        wrapperClassName: Ae({
          [`${ue}-group-rtl`]: c.value === "rtl"
        }, b.value),
        groupClassName: Ae({
          [`${ue}-group-wrapper-sm`]: m.value === "small",
          [`${ue}-group-wrapper-lg`]: m.value === "large",
          [`${ue}-group-wrapper-rtl`]: c.value === "rtl"
        }, Fa(`${ue}-group-wrapper`, u.value, V), b.value)
      }), k(k({}, n), {
        clearIcon: he
      })));
    };
  }
}), Lae = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "AInputGroup",
  inheritAttrs: !1,
  props: {
    prefixCls: String,
    size: {
      type: String
    },
    compact: {
      type: Boolean,
      default: void 0
    }
  },
  setup(t, e) {
    let {
      slots: n,
      attrs: i
    } = e;
    const {
      prefixCls: o,
      direction: r,
      getPrefixCls: a
    } = Ht("input-group", t), l = Fr.useInject();
    Fr.useProvide(l, {
      isFormItemInput: !1
    });
    const s = A(() => a("input")), [u, c] = g$(s), d = A(() => {
      const f = o.value;
      return {
        [`${f}`]: !0,
        [c.value]: !0,
        [`${f}-lg`]: t.size === "large",
        [`${f}-sm`]: t.size === "small",
        [`${f}-compact`]: t.compact,
        [`${f}-rtl`]: r.value === "rtl"
      };
    });
    return () => {
      var f;
      return u(v("span", J(J({}, i), {}, {
        class: Ae(d.value, i.class)
      }), [(f = n.default) === null || f === void 0 ? void 0 : f.call(n)]));
    };
  }
});
var zae = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
const Bae = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "AInputSearch",
  inheritAttrs: !1,
  props: k(k({}, Ly()), {
    inputPrefixCls: String,
    // 不能设置默认值 https://github.com/vueComponent/ant-design-vue/issues/1916
    enterButton: ve.any,
    onSearch: {
      type: Function
    }
  }),
  setup(t, e) {
    let {
      slots: n,
      attrs: i,
      expose: o,
      emit: r
    } = e;
    const a = Te(), l = Te(!1);
    o({
      focus: () => {
        var C;
        (C = a.value) === null || C === void 0 || C.focus();
      },
      blur: () => {
        var C;
        (C = a.value) === null || C === void 0 || C.blur();
      }
    });
    const c = (C) => {
      r("update:value", C.target.value), C && C.target && C.type === "click" && r("search", C.target.value, C), r("change", C);
    }, d = (C) => {
      var P;
      document.activeElement === ((P = a.value) === null || P === void 0 ? void 0 : P.input) && C.preventDefault();
    }, f = (C) => {
      var P, O;
      r("search", (O = (P = a.value) === null || P === void 0 ? void 0 : P.input) === null || O === void 0 ? void 0 : O.stateValue, C);
    }, h = (C) => {
      l.value || t.loading || f(C);
    }, p = (C) => {
      l.value = !0, r("compositionstart", C);
    }, g = (C) => {
      l.value = !1, r("compositionend", C);
    }, {
      prefixCls: m,
      getPrefixCls: y,
      direction: b,
      size: w
    } = Ht("input-search", t), $ = A(() => y("input", t.inputPrefixCls));
    return () => {
      var C, P, O, E;
      const {
        disabled: _,
        loading: D,
        addonAfter: M = (C = n.addonAfter) === null || C === void 0 ? void 0 : C.call(n),
        suffix: N = (P = n.suffix) === null || P === void 0 ? void 0 : P.call(n)
      } = t, L = zae(t, ["disabled", "loading", "addonAfter", "suffix"]);
      let {
        enterButton: j = (E = (O = n.enterButton) === null || O === void 0 ? void 0 : O.call(n)) !== null && E !== void 0 ? E : !1
      } = t;
      j = j || j === "";
      const B = typeof j == "boolean" ? v(pg, null, null) : null, Y = `${m.value}-button`, Q = Array.isArray(j) ? j[0] : j;
      let G;
      const V = Q.type && EA(Q.type) && Q.type.__ANT_BUTTON;
      if (V || Q.tagName === "button")
        G = vi(Q, k({
          onMousedown: d,
          onClick: f,
          key: "enterButton"
        }, V ? {
          class: Y,
          size: w.value
        } : {}), !1);
      else {
        const q = B && !j;
        G = v(en, {
          class: Y,
          type: j ? "primary" : void 0,
          size: w.value,
          disabled: _,
          key: "enterButton",
          onMousedown: d,
          onClick: f,
          loading: D,
          icon: q ? B : null
        }, {
          default: () => [q ? null : B || j]
        });
      }
      M && (G = [G, M]);
      const H = Ae(m.value, {
        [`${m.value}-rtl`]: b.value === "rtl",
        [`${m.value}-${w.value}`]: !!w.value,
        [`${m.value}-with-button`]: !!j
      }, i.class);
      return v(jt, J(J(J({
        ref: a
      }, ii(L, ["onUpdate:value", "onSearch", "enterButton"])), i), {}, {
        onPressEnter: h,
        onCompositionstart: p,
        onCompositionend: g,
        size: w.value,
        prefixCls: $.value,
        addonAfter: G,
        suffix: N,
        onChange: c,
        class: H,
        disabled: _
      }), n);
    };
  }
}), KE = (t) => t != null && (Array.isArray(t) ? ho(t).length : !0);
function Fae(t) {
  return KE(t.addonBefore) || KE(t.addonAfter);
}
const Vae = ["text", "input"], Qae = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ClearableLabeledInput",
  inheritAttrs: !1,
  props: {
    prefixCls: String,
    inputType: ve.oneOf(ja("text", "input")),
    value: Mr(),
    defaultValue: Mr(),
    allowClear: {
      type: Boolean,
      default: void 0
    },
    element: Mr(),
    handleReset: Function,
    disabled: {
      type: Boolean,
      default: void 0
    },
    direction: {
      type: String
    },
    size: {
      type: String
    },
    suffix: Mr(),
    prefix: Mr(),
    addonBefore: Mr(),
    addonAfter: Mr(),
    readonly: {
      type: Boolean,
      default: void 0
    },
    focused: {
      type: Boolean,
      default: void 0
    },
    bordered: {
      type: Boolean,
      default: !0
    },
    triggerFocus: {
      type: Function
    },
    hidden: Boolean,
    status: String,
    hashId: String
  },
  setup(t, e) {
    let {
      slots: n,
      attrs: i
    } = e;
    const o = Fr.useInject(), r = (l) => {
      const {
        value: s,
        disabled: u,
        readonly: c,
        handleReset: d,
        suffix: f = n.suffix
      } = t, h = !u && !c && s, p = `${l}-clear-icon`;
      return v(Wr, {
        onClick: d,
        onMousedown: (g) => g.preventDefault(),
        class: Ae({
          [`${p}-hidden`]: !h,
          [`${p}-has-suffix`]: !!f
        }, p),
        role: "button"
      }, null);
    }, a = (l, s) => {
      const {
        value: u,
        allowClear: c,
        direction: d,
        bordered: f,
        hidden: h,
        status: p,
        addonAfter: g = n.addonAfter,
        addonBefore: m = n.addonBefore,
        hashId: y
      } = t, {
        status: b,
        hasFeedback: w
      } = o;
      if (!c)
        return vi(s, {
          value: u,
          disabled: t.disabled
        });
      const $ = Ae(`${l}-affix-wrapper`, `${l}-affix-wrapper-textarea-with-clear-btn`, Fa(`${l}-affix-wrapper`, ad(b, p), w), {
        [`${l}-affix-wrapper-rtl`]: d === "rtl",
        [`${l}-affix-wrapper-borderless`]: !f,
        // className will go to addon wrapper
        [`${i.class}`]: !Fae({
          addonAfter: g,
          addonBefore: m
        }) && i.class
      }, y);
      return v("span", {
        class: $,
        style: i.style,
        hidden: h
      }, [vi(s, {
        style: null,
        value: u,
        disabled: t.disabled
      }), r(l)]);
    };
    return () => {
      var l;
      const {
        prefixCls: s,
        inputType: u,
        element: c = (l = n.element) === null || l === void 0 ? void 0 : l.call(n)
      } = t;
      return u === Vae[0] ? a(s, c) : null;
    };
  }
}), Hae = `
  min-height:0 !important;
  max-height:none !important;
  height:0 !important;
  visibility:hidden !important;
  overflow:hidden !important;
  position:absolute !important;
  z-index:-1000 !important;
  top:0 !important;
  right:0 !important;
  pointer-events: none !important;
`, Wae = ["letter-spacing", "line-height", "padding-top", "padding-bottom", "font-family", "font-weight", "font-size", "font-variant", "text-rendering", "text-transform", "width", "text-indent", "padding-left", "padding-right", "border-width", "box-sizing", "word-break", "white-space"], O1 = {};
let Gr;
function jae(t) {
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
  const n = t.getAttribute("id") || t.getAttribute("data-reactid") || t.getAttribute("name");
  if (e && O1[n])
    return O1[n];
  const i = window.getComputedStyle(t), o = i.getPropertyValue("box-sizing") || i.getPropertyValue("-moz-box-sizing") || i.getPropertyValue("-webkit-box-sizing"), r = parseFloat(i.getPropertyValue("padding-bottom")) + parseFloat(i.getPropertyValue("padding-top")), a = parseFloat(i.getPropertyValue("border-bottom-width")) + parseFloat(i.getPropertyValue("border-top-width")), s = {
    sizingStyle: Wae.map((u) => `${u}:${i.getPropertyValue(u)}`).join(";"),
    paddingSize: r,
    borderSize: a,
    boxSizing: o
  };
  return e && n && (O1[n] = s), s;
}
function qae(t) {
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null, i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null;
  Gr || (Gr = document.createElement("textarea"), Gr.setAttribute("tab-index", "-1"), Gr.setAttribute("aria-hidden", "true"), document.body.appendChild(Gr)), t.getAttribute("wrap") ? Gr.setAttribute("wrap", t.getAttribute("wrap")) : Gr.removeAttribute("wrap");
  const {
    paddingSize: o,
    borderSize: r,
    boxSizing: a,
    sizingStyle: l
  } = jae(t, e);
  Gr.setAttribute("style", `${l};${Hae}`), Gr.value = t.value || t.placeholder || "";
  let s, u, c, d = Gr.scrollHeight;
  if (a === "border-box" ? d += r : a === "content-box" && (d -= o), n !== null || i !== null) {
    Gr.value = " ";
    const h = Gr.scrollHeight - o;
    n !== null && (s = h * n, a === "border-box" && (s = s + o + r), d = Math.max(s, d)), i !== null && (u = h * i, a === "border-box" && (u = u + o + r), c = d > u ? "" : "hidden", d = Math.min(u, d));
  }
  const f = {
    height: `${d}px`,
    overflowY: c,
    resize: "none"
  };
  return s && (f.minHeight = `${s}px`), u && (f.maxHeight = `${u}px`), f;
}
const S1 = 0, w1 = 1, C1 = 2, Yae = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ResizableTextArea",
  inheritAttrs: !1,
  props: HL(),
  setup(t, e) {
    let {
      attrs: n,
      emit: i,
      expose: o
    } = e, r, a;
    const l = de(), s = de({}), u = de(C1);
    tn(() => {
      Gt.cancel(r), Gt.cancel(a);
    });
    const c = () => {
      try {
        if (l.value && document.activeElement === l.value.input) {
          const P = l.value.getSelectionStart(), O = l.value.getSelectionEnd(), E = l.value.getScrollTop();
          l.value.setSelectionRange(P, O), l.value.setScrollTop(E);
        }
      } catch {
      }
    }, d = de(), f = de();
    zt(() => {
      const P = t.autoSize || t.autosize;
      P ? (d.value = P.minRows, f.value = P.maxRows) : (d.value = void 0, f.value = void 0);
    });
    const h = A(() => !!(t.autoSize || t.autosize)), p = () => {
      u.value = S1;
    };
    _e([() => t.value, d, f, h], () => {
      h.value && p();
    }, {
      immediate: !0
    });
    const g = de();
    _e([u, l], () => {
      if (l.value)
        if (u.value === S1)
          u.value = w1;
        else if (u.value === w1) {
          const P = qae(l.value.input, !1, d.value, f.value);
          u.value = C1, g.value = P;
        } else
          c();
    }, {
      immediate: !0,
      flush: "post"
    });
    const m = sr(), y = de(), b = () => {
      Gt.cancel(y.value);
    }, w = (P) => {
      u.value === C1 && (i("resize", P), h.value && (b(), y.value = Gt(() => {
        p();
      })));
    };
    tn(() => {
      b();
    }), o({
      resizeTextarea: () => {
        p();
      },
      textArea: A(() => {
        var P;
        return (P = l.value) === null || P === void 0 ? void 0 : P.input;
      }),
      instance: m
    }), eo(t.autosize === void 0, "Input.TextArea", "autosize is deprecated, please use autoSize instead.");
    const C = () => {
      const {
        prefixCls: P,
        disabled: O
      } = t, E = ii(t, ["prefixCls", "onPressEnter", "autoSize", "autosize", "defaultValue", "allowClear", "type", "maxlength", "valueModifiers"]), _ = Ae(P, n.class, {
        [`${P}-disabled`]: O
      }), D = h.value ? g.value : null, M = [n.style, s.value, D], N = k(k(k({}, E), n), {
        style: M,
        class: _
      });
      return (u.value === S1 || u.value === w1) && M.push({
        overflowX: "hidden",
        overflowY: "hidden"
      }), N.autofocus || delete N.autofocus, N.rows === 0 && delete N.rows, v(Mu, {
        onResize: w,
        disabled: !h.value
      }, {
        default: () => [v(fg, J(J({}, N), {}, {
          ref: l,
          tag: "textarea"
        }), null)]
      });
    };
    return () => C();
  }
});
function WL(t, e) {
  return [...t || ""].slice(0, e).join("");
}
function XE(t, e, n, i) {
  let o = n;
  return t ? o = WL(n, i) : [...e || ""].length < n.length && [...n || ""].length > i && (o = e), o;
}
const Kae = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ATextarea",
  inheritAttrs: !1,
  props: HL(),
  setup(t, e) {
    let {
      attrs: n,
      expose: i,
      emit: o
    } = e;
    var r;
    const a = jr(), l = Fr.useInject(), s = A(() => ad(l.status, t.status)), u = Te((r = t.value) !== null && r !== void 0 ? r : t.defaultValue), c = Te(), d = Te(""), {
      prefixCls: f,
      size: h,
      direction: p
    } = Ht("input", t), [g, m] = g$(f), y = qa(), b = A(() => t.showCount === "" || t.showCount || !1), w = A(() => Number(t.maxlength) > 0), $ = Te(!1), C = Te(), P = Te(0), O = (V) => {
      $.value = !0, C.value = d.value, P.value = V.currentTarget.selectionStart, o("compositionstart", V);
    }, E = (V) => {
      var H;
      $.value = !1;
      let q = V.currentTarget.value;
      if (w.value) {
        const K = P.value >= t.maxlength + 1 || P.value === ((H = C.value) === null || H === void 0 ? void 0 : H.length);
        q = XE(K, C.value, q, t.maxlength);
      }
      q !== d.value && (N(q), cp(V.currentTarget, V, B, q)), o("compositionend", V);
    }, _ = sr();
    _e(() => t.value, () => {
      var V;
      "value" in _.vnode.props, u.value = (V = t.value) !== null && V !== void 0 ? V : "";
    });
    const D = (V) => {
      var H;
      FL((H = c.value) === null || H === void 0 ? void 0 : H.textArea, V);
    }, M = () => {
      var V, H;
      (H = (V = c.value) === null || V === void 0 ? void 0 : V.textArea) === null || H === void 0 || H.blur();
    }, N = (V, H) => {
      u.value !== V && (t.value === void 0 ? u.value = V : rn(() => {
        var q, K, ee;
        c.value.textArea.value !== d.value && ((ee = (q = c.value) === null || q === void 0 ? void 0 : (K = q.instance).update) === null || ee === void 0 || ee.call(K));
      }), rn(() => {
        H && H();
      }));
    }, L = (V) => {
      V.keyCode === 13 && o("pressEnter", V), o("keydown", V);
    }, j = (V) => {
      const {
        onBlur: H
      } = t;
      H?.(V), a.onFieldBlur();
    }, B = (V) => {
      o("update:value", V.target.value), o("change", V), o("input", V), a.onFieldChange();
    }, Y = (V) => {
      cp(c.value.textArea, V, B), N("", () => {
        D();
      });
    }, Q = (V) => {
      let H = V.target.value;
      if (u.value !== H) {
        if (w.value) {
          const q = V.target, K = q.selectionStart >= t.maxlength + 1 || q.selectionStart === H.length || !q.selectionStart;
          H = XE(K, d.value, H, t.maxlength);
        }
        cp(V.currentTarget, V, B, H), N(H);
      }
    }, G = () => {
      var V, H;
      const {
        class: q
      } = n, {
        bordered: K = !0
      } = t, ee = k(k(k({}, ii(t, ["allowClear"])), n), {
        class: [{
          [`${f.value}-borderless`]: !K,
          [`${q}`]: q && !b.value,
          [`${f.value}-sm`]: h.value === "small",
          [`${f.value}-lg`]: h.value === "large"
        }, Fa(f.value, s.value), m.value],
        disabled: y.value,
        showCount: null,
        prefixCls: f.value,
        onInput: Q,
        onChange: Q,
        onBlur: j,
        onKeydown: L,
        onCompositionstart: O,
        onCompositionend: E
      });
      return !((V = t.valueModifiers) === null || V === void 0) && V.lazy && delete ee.onInput, v(Yae, J(J({}, ee), {}, {
        id: (H = ee?.id) !== null && H !== void 0 ? H : a.id.value,
        ref: c,
        maxlength: t.maxlength,
        lazy: t.lazy
      }), null);
    };
    return i({
      focus: D,
      blur: M,
      resizableTextArea: c
    }), zt(() => {
      let V = GO(u.value);
      !$.value && w.value && (t.value === null || t.value === void 0) && (V = WL(V, t.maxlength)), d.value = V;
    }), () => {
      var V;
      const {
        maxlength: H,
        bordered: q = !0,
        hidden: K
      } = t, {
        style: ee,
        class: ie
      } = n, ae = k(k(k({}, t), n), {
        prefixCls: f.value,
        inputType: "text",
        handleReset: Y,
        direction: p.value,
        bordered: q,
        style: b.value ? void 0 : ee,
        hashId: m.value,
        disabled: (V = t.disabled) !== null && V !== void 0 ? V : y.value
      });
      let te = v(Qae, J(J({}, ae), {}, {
        value: d.value,
        status: t.status
      }), {
        element: G
      });
      if (b.value || l.hasFeedback) {
        const U = [...d.value].length;
        let me = "";
        typeof b.value == "object" ? me = b.value.formatter({
          value: d.value,
          count: U,
          maxlength: H
        }) : me = `${U}${w.value ? ` / ${H}` : ""}`, te = v("div", {
          hidden: K,
          class: Ae(`${f.value}-textarea`, {
            [`${f.value}-textarea-rtl`]: p.value === "rtl",
            [`${f.value}-textarea-show-count`]: b.value,
            [`${f.value}-textarea-in-form-item`]: l.isFormItemInput
          }, `${f.value}-textarea-show-count`, ie, m.value),
          style: ee,
          "data-count": typeof me != "object" ? me : void 0
        }, [te, l.hasFeedback && v("span", {
          class: `${f.value}-textarea-suffix`
        }, [l.feedbackIcon])]);
      }
      return g(te);
    };
  }
});
var Xae = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z" } }] }, name: "eye", theme: "outlined" };
function ZE(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(n);
    typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(n).filter(function(o) {
      return Object.getOwnPropertyDescriptor(n, o).enumerable;
    }))), i.forEach(function(o) {
      Zae(t, o, n[o]);
    });
  }
  return t;
}
function Zae(t, e, n) {
  return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
var I$ = function(e, n) {
  var i = ZE({}, e, n.attrs);
  return v(bn, ZE({}, i, {
    icon: Xae
  }), null);
};
I$.displayName = "EyeOutlined";
I$.inheritAttrs = !1;
var Gae = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z" } }, { tag: "path", attrs: { d: "M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z" } }] }, name: "eye-invisible", theme: "outlined" };
function GE(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(n);
    typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(n).filter(function(o) {
      return Object.getOwnPropertyDescriptor(n, o).enumerable;
    }))), i.forEach(function(o) {
      Uae(t, o, n[o]);
    });
  }
  return t;
}
function Uae(t, e, n) {
  return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
var M$ = function(e, n) {
  var i = GE({}, e, n.attrs);
  return v(bn, GE({}, i, {
    icon: Gae
  }), null);
};
M$.displayName = "EyeInvisibleOutlined";
M$.inheritAttrs = !1;
var Jae = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
const ele = {
  click: "onClick",
  hover: "onMouseover"
}, tle = (t) => t ? v(I$, null, null) : v(M$, null, null), nle = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "AInputPassword",
  inheritAttrs: !1,
  props: k(k({}, Ly()), {
    prefixCls: String,
    inputPrefixCls: String,
    action: {
      type: String,
      default: "click"
    },
    visibilityToggle: {
      type: Boolean,
      default: !0
    },
    visible: {
      type: Boolean,
      default: void 0
    },
    "onUpdate:visible": Function,
    iconRender: Function
  }),
  setup(t, e) {
    let {
      slots: n,
      attrs: i,
      expose: o,
      emit: r
    } = e;
    const a = Te(!1), l = () => {
      const {
        disabled: m
      } = t;
      m || (a.value = !a.value, r("update:visible", a.value));
    };
    zt(() => {
      t.visible !== void 0 && (a.value = !!t.visible);
    });
    const s = Te();
    o({
      focus: () => {
        var m;
        (m = s.value) === null || m === void 0 || m.focus();
      },
      blur: () => {
        var m;
        (m = s.value) === null || m === void 0 || m.blur();
      }
    });
    const d = (m) => {
      const {
        action: y,
        iconRender: b = n.iconRender || tle
      } = t, w = ele[y] || "", $ = b(a.value), C = {
        [w]: l,
        class: `${m}-icon`,
        key: "passwordIcon",
        onMousedown: (P) => {
          P.preventDefault();
        },
        onMouseup: (P) => {
          P.preventDefault();
        }
      };
      return vi(po($) ? $ : v("span", null, [$]), C);
    }, {
      prefixCls: f,
      getPrefixCls: h
    } = Ht("input-password", t), p = A(() => h("input", t.inputPrefixCls)), g = () => {
      const {
        size: m,
        visibilityToggle: y
      } = t, b = Jae(t, ["size", "visibilityToggle"]), w = y && d(f.value), $ = Ae(f.value, i.class, {
        [`${f.value}-${m}`]: !!m
      }), C = k(k(k({}, ii(b, ["suffix", "iconRender", "action"])), i), {
        type: a.value ? "text" : "password",
        class: $,
        prefixCls: p.value,
        suffix: w
      });
      return m && (C.size = m), v(jt, J({
        ref: s
      }, C), n);
    };
    return () => g();
  }
});
jt.Group = Lae;
jt.Search = Bae;
jt.TextArea = Kae;
jt.Password = nle;
jt.install = function(t) {
  return t.component(jt.name, jt), t.component(jt.Group.name, jt.Group), t.component(jt.Search.name, jt.Search), t.component(jt.TextArea.name, jt.TextArea), t.component(jt.Password.name, jt.Password), t;
};
function A$() {
  return {
    keyboard: {
      type: Boolean,
      default: void 0
    },
    mask: {
      type: Boolean,
      default: void 0
    },
    afterClose: Function,
    closable: {
      type: Boolean,
      default: void 0
    },
    maskClosable: {
      type: Boolean,
      default: void 0
    },
    visible: {
      type: Boolean,
      default: void 0
    },
    destroyOnClose: {
      type: Boolean,
      default: void 0
    },
    mousePosition: ve.shape({
      x: Number,
      y: Number
    }).loose,
    title: ve.any,
    footer: ve.any,
    transitionName: String,
    maskTransitionName: String,
    animation: ve.any,
    maskAnimation: ve.any,
    wrapStyle: {
      type: Object,
      default: void 0
    },
    bodyStyle: {
      type: Object,
      default: void 0
    },
    maskStyle: {
      type: Object,
      default: void 0
    },
    prefixCls: String,
    wrapClassName: String,
    rootClassName: String,
    width: [String, Number],
    height: [String, Number],
    zIndex: Number,
    bodyProps: ve.any,
    maskProps: ve.any,
    wrapProps: ve.any,
    getContainer: ve.any,
    dialogStyle: {
      type: Object,
      default: void 0
    },
    dialogClass: String,
    closeIcon: ve.any,
    forceRender: {
      type: Boolean,
      default: void 0
    },
    getOpenCount: Function,
    // https://github.com/ant-design/ant-design/issues/19771
    // https://github.com/react-component/dialog/issues/95
    focusTriggerAfterClose: {
      type: Boolean,
      default: void 0
    },
    onClose: Function,
    modalRender: Function
  };
}
function UE(t, e, n) {
  let i = e;
  return !i && n && (i = `${t}-${n}`), i;
}
let JE = -1;
function ile() {
  return JE += 1, JE;
}
function e_(t, e) {
  let n = t[`page${e ? "Y" : "X"}Offset`];
  const i = `scroll${e ? "Top" : "Left"}`;
  if (typeof n != "number") {
    const o = t.document;
    n = o.documentElement[i], typeof n != "number" && (n = o.body[i]);
  }
  return n;
}
function ole(t) {
  const e = t.getBoundingClientRect(), n = {
    left: e.left,
    top: e.top
  }, i = t.ownerDocument, o = i.defaultView || i.parentWindow;
  return n.left += e_(o), n.top += e_(o, !0), n;
}
const rle = {
  width: 0,
  height: 0,
  overflow: "hidden",
  outline: "none"
}, ale = {
  outline: "none"
}, lle = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "DialogContent",
  inheritAttrs: !1,
  props: k(k({}, A$()), {
    motionName: String,
    ariaId: String,
    onVisibleChanged: Function,
    onMousedown: Function,
    onMouseup: Function
  }),
  setup(t, e) {
    let {
      expose: n,
      slots: i,
      attrs: o
    } = e;
    const r = de(), a = de(), l = de();
    n({
      focus: () => {
        var f;
        (f = r.value) === null || f === void 0 || f.focus({
          preventScroll: !0
        });
      },
      changeActive: (f) => {
        const {
          activeElement: h
        } = document;
        f && h === a.value ? r.value.focus({
          preventScroll: !0
        }) : !f && h === r.value && a.value.focus({
          preventScroll: !0
        });
      }
    });
    const s = de(), u = A(() => {
      const {
        width: f,
        height: h
      } = t, p = {};
      return f !== void 0 && (p.width = typeof f == "number" ? `${f}px` : f), h !== void 0 && (p.height = typeof h == "number" ? `${h}px` : h), s.value && (p.transformOrigin = s.value), p;
    }), c = () => {
      rn(() => {
        if (l.value) {
          const f = ole(l.value);
          s.value = t.mousePosition ? `${t.mousePosition.x - f.left}px ${t.mousePosition.y - f.top}px` : "";
        }
      });
    }, d = (f) => {
      t.onVisibleChanged(f);
    };
    return () => {
      var f, h, p, g;
      const {
        prefixCls: m,
        footer: y = (f = i.footer) === null || f === void 0 ? void 0 : f.call(i),
        title: b = (h = i.title) === null || h === void 0 ? void 0 : h.call(i),
        ariaId: w,
        closable: $,
        closeIcon: C = (p = i.closeIcon) === null || p === void 0 ? void 0 : p.call(i),
        onClose: P,
        bodyStyle: O,
        bodyProps: E,
        onMousedown: _,
        onMouseup: D,
        visible: M,
        modalRender: N = i.modalRender,
        destroyOnClose: L,
        motionName: j
      } = t;
      let B;
      y && (B = v("div", {
        class: `${m}-footer`
      }, [y]));
      let Y;
      b && (Y = v("div", {
        class: `${m}-header`
      }, [v("div", {
        class: `${m}-title`,
        id: w
      }, [b])]));
      let Q;
      $ && (Q = v("button", {
        type: "button",
        onClick: P,
        "aria-label": "Close",
        class: `${m}-close`
      }, [C || v("span", {
        class: `${m}-close-x`
      }, null)]));
      const G = v("div", {
        class: `${m}-content`
      }, [Q, Y, v("div", J({
        class: `${m}-body`,
        style: O
      }, E), [(g = i.default) === null || g === void 0 ? void 0 : g.call(i)]), B]), V = jc(j);
      return v(zr, J(J({}, V), {}, {
        onBeforeEnter: c,
        onAfterEnter: () => d(!0),
        onAfterLeave: () => d(!1)
      }), {
        default: () => [M || !L ? fa(v("div", J(J({}, o), {}, {
          ref: l,
          key: "dialog-element",
          role: "document",
          style: [u.value, o.style],
          class: [m, o.class],
          onMousedown: _,
          onMouseup: D
        }), [v("div", {
          tabindex: 0,
          ref: r,
          style: ale
        }, [N ? N({
          originVNode: G
        }) : G]), v("div", {
          tabindex: 0,
          ref: a,
          style: rle
        }, null)]), [[Qa, M]]) : null]
      });
    };
  }
}), sle = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "DialogMask",
  props: {
    prefixCls: String,
    visible: Boolean,
    motionName: String,
    maskProps: Object
  },
  setup(t, e) {
    return () => {
      const {
        prefixCls: n,
        visible: i,
        maskProps: o,
        motionName: r
      } = t, a = jc(r);
      return v(zr, a, {
        default: () => [fa(v("div", J({
          class: `${n}-mask`
        }, o), null), [[Qa, i]])]
      });
    };
  }
}), t_ = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "VcDialog",
  inheritAttrs: !1,
  props: Kn(k(k({}, A$()), {
    getOpenCount: Function,
    scrollLocker: Object
  }), {
    mask: !0,
    visible: !1,
    keyboard: !0,
    closable: !0,
    maskClosable: !0,
    destroyOnClose: !1,
    prefixCls: "rc-dialog",
    getOpenCount: () => null,
    focusTriggerAfterClose: !0
  }),
  setup(t, e) {
    let {
      attrs: n,
      slots: i
    } = e;
    const o = Te(), r = Te(), a = Te(), l = Te(t.visible), s = Te(`vcDialogTitle${ile()}`), u = (y) => {
      var b, w;
      if (y)
        fu(r.value, document.activeElement) || (o.value = document.activeElement, (b = a.value) === null || b === void 0 || b.focus());
      else {
        const $ = l.value;
        if (l.value = !1, t.mask && o.value && t.focusTriggerAfterClose) {
          try {
            o.value.focus({
              preventScroll: !0
            });
          } catch {
          }
          o.value = null;
        }
        $ && ((w = t.afterClose) === null || w === void 0 || w.call(t));
      }
    }, c = (y) => {
      var b;
      (b = t.onClose) === null || b === void 0 || b.call(t, y);
    }, d = Te(!1), f = Te(), h = () => {
      clearTimeout(f.value), d.value = !0;
    }, p = () => {
      f.value = setTimeout(() => {
        d.value = !1;
      });
    }, g = (y) => {
      if (!t.maskClosable) return null;
      d.value ? d.value = !1 : r.value === y.target && c(y);
    }, m = (y) => {
      if (t.keyboard && y.keyCode === lt.ESC) {
        y.stopPropagation(), c(y);
        return;
      }
      t.visible && y.keyCode === lt.TAB && a.value.changeActive(!y.shiftKey);
    };
    return _e(() => t.visible, () => {
      t.visible && (l.value = !0);
    }, {
      flush: "post"
    }), tn(() => {
      var y;
      clearTimeout(f.value), (y = t.scrollLocker) === null || y === void 0 || y.unLock();
    }), zt(() => {
      var y, b;
      (y = t.scrollLocker) === null || y === void 0 || y.unLock(), l.value && ((b = t.scrollLocker) === null || b === void 0 || b.lock());
    }), () => {
      const {
        prefixCls: y,
        mask: b,
        visible: w,
        maskTransitionName: $,
        maskAnimation: C,
        zIndex: P,
        wrapClassName: O,
        rootClassName: E,
        wrapStyle: _,
        closable: D,
        maskProps: M,
        maskStyle: N,
        transitionName: L,
        animation: j,
        wrapProps: B,
        title: Y = i.title
      } = t, {
        style: Q,
        class: G
      } = n;
      return v("div", J({
        class: [`${y}-root`, E]
      }, rd(t, {
        data: !0
      })), [v(sle, {
        prefixCls: y,
        visible: b && w,
        motionName: UE(y, $, C),
        style: k({
          zIndex: P
        }, N),
        maskProps: M
      }, null), v("div", J({
        tabIndex: -1,
        onKeydown: m,
        class: Ae(`${y}-wrap`, O),
        ref: r,
        onClick: g,
        role: "dialog",
        "aria-labelledby": Y ? s.value : null,
        style: k(k({
          zIndex: P
        }, _), {
          display: l.value ? null : "none"
        })
      }, B), [v(lle, J(J({}, ii(t, ["scrollLocker"])), {}, {
        style: Q,
        class: G,
        onMousedown: h,
        onMouseup: p,
        ref: a,
        closable: D,
        ariaId: s.value,
        prefixCls: y,
        visible: w,
        onClose: c,
        onVisibleChanged: u,
        motionName: UE(y, L, j)
      }), i)])]);
    };
  }
}), ule = A$(), cle = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "DialogWrap",
  inheritAttrs: !1,
  props: Kn(ule, {
    visible: !1
  }),
  setup(t, e) {
    let {
      attrs: n,
      slots: i
    } = e;
    const o = de(t.visible);
    return CC({}, {
      inTriggerContext: !1
    }), _e(() => t.visible, () => {
      t.visible && (o.value = !0);
    }, {
      flush: "post"
    }), () => {
      const {
        visible: r,
        getContainer: a,
        forceRender: l,
        destroyOnClose: s = !1,
        afterClose: u
      } = t;
      let c = k(k(k({}, t), n), {
        ref: "_component",
        key: "dialog"
      });
      return a === !1 ? v(t_, J(J({}, c), {}, {
        getOpenCount: () => 2
      }), i) : !l && s && !o.value ? null : v($C, {
        autoLock: !0,
        visible: r,
        forceRender: l,
        getContainer: a
      }, {
        default: (d) => (c = k(k(k({}, c), d), {
          afterClose: () => {
            u?.(), o.value = !1;
          }
        }), v(t_, c, i))
      });
    };
  }
});
function n_(t) {
  return {
    position: t,
    top: 0,
    insetInlineEnd: 0,
    bottom: 0,
    insetInlineStart: 0
  };
}
const dle = (t) => {
  const {
    componentCls: e
  } = t;
  return [{
    [`${e}-root`]: {
      [`${e}${t.antCls}-zoom-enter, ${e}${t.antCls}-zoom-appear`]: {
        // reset scale avoid mousePosition bug
        transform: "none",
        opacity: 0,
        animationDuration: t.motionDurationSlow,
        // https://github.com/ant-design/ant-design/issues/11777
        userSelect: "none"
      },
      [`${e}${t.antCls}-zoom-leave ${e}-content`]: {
        pointerEvents: "none"
      },
      [`${e}-mask`]: k(k({}, n_("fixed")), {
        zIndex: t.zIndexPopupBase,
        height: "100%",
        backgroundColor: t.colorBgMask,
        [`${e}-hidden`]: {
          display: "none"
        }
      }),
      [`${e}-wrap`]: k(k({}, n_("fixed")), {
        overflow: "auto",
        outline: 0,
        WebkitOverflowScrolling: "touch"
      })
    }
  }, {
    [`${e}-root`]: rU(t)
  }];
}, fle = (t) => {
  const {
    componentCls: e
  } = t;
  return [
    // ======================== Root =========================
    {
      [`${e}-root`]: {
        [`${e}-wrap`]: {
          zIndex: t.zIndexPopupBase,
          position: "fixed",
          inset: 0,
          overflow: "auto",
          outline: 0,
          WebkitOverflowScrolling: "touch"
        },
        [`${e}-wrap-rtl`]: {
          direction: "rtl"
        },
        [`${e}-centered`]: {
          textAlign: "center",
          "&::before": {
            display: "inline-block",
            width: 0,
            height: "100%",
            verticalAlign: "middle",
            content: '""'
          },
          [e]: {
            top: 0,
            display: "inline-block",
            paddingBottom: 0,
            textAlign: "start",
            verticalAlign: "middle"
          }
        },
        [`@media (max-width: ${t.screenSMMax})`]: {
          [e]: {
            maxWidth: "calc(100vw - 16px)",
            margin: `${t.marginXS} auto`
          },
          [`${e}-centered`]: {
            [e]: {
              flex: 1
            }
          }
        }
      }
    },
    // ======================== Modal ========================
    {
      [e]: k(k({}, kn(t)), {
        pointerEvents: "none",
        position: "relative",
        top: 100,
        width: "auto",
        maxWidth: `calc(100vw - ${t.margin * 2}px)`,
        margin: "0 auto",
        paddingBottom: t.paddingLG,
        [`${e}-title`]: {
          margin: 0,
          color: t.modalHeadingColor,
          fontWeight: t.fontWeightStrong,
          fontSize: t.modalHeaderTitleFontSize,
          lineHeight: t.modalHeaderTitleLineHeight,
          wordWrap: "break-word"
        },
        [`${e}-content`]: {
          position: "relative",
          backgroundColor: t.modalContentBg,
          backgroundClip: "padding-box",
          border: 0,
          borderRadius: t.borderRadiusLG,
          boxShadow: t.boxShadowSecondary,
          pointerEvents: "auto",
          padding: `${t.paddingMD}px ${t.paddingContentHorizontalLG}px`
        },
        [`${e}-close`]: k({
          position: "absolute",
          top: (t.modalHeaderCloseSize - t.modalCloseBtnSize) / 2,
          insetInlineEnd: (t.modalHeaderCloseSize - t.modalCloseBtnSize) / 2,
          zIndex: t.zIndexPopupBase + 10,
          padding: 0,
          color: t.modalCloseColor,
          fontWeight: t.fontWeightStrong,
          lineHeight: 1,
          textDecoration: "none",
          background: "transparent",
          borderRadius: t.borderRadiusSM,
          width: t.modalConfirmIconSize,
          height: t.modalConfirmIconSize,
          border: 0,
          outline: 0,
          cursor: "pointer",
          transition: `color ${t.motionDurationMid}, background-color ${t.motionDurationMid}`,
          "&-x": {
            display: "block",
            fontSize: t.fontSizeLG,
            fontStyle: "normal",
            lineHeight: `${t.modalCloseBtnSize}px`,
            textAlign: "center",
            textTransform: "none",
            textRendering: "auto"
          },
          "&:hover": {
            color: t.modalIconHoverColor,
            backgroundColor: t.wireframe ? "transparent" : t.colorFillContent,
            textDecoration: "none"
          },
          "&:active": {
            backgroundColor: t.wireframe ? "transparent" : t.colorFillContentHover
          }
        }, Au(t)),
        [`${e}-header`]: {
          color: t.colorText,
          background: t.modalHeaderBg,
          borderRadius: `${t.borderRadiusLG}px ${t.borderRadiusLG}px 0 0`,
          marginBottom: t.marginXS
        },
        [`${e}-body`]: {
          fontSize: t.fontSize,
          lineHeight: t.lineHeight,
          wordWrap: "break-word"
        },
        [`${e}-footer`]: {
          textAlign: "end",
          background: t.modalFooterBg,
          marginTop: t.marginSM,
          [`${t.antCls}-btn + ${t.antCls}-btn:not(${t.antCls}-dropdown-trigger)`]: {
            marginBottom: 0,
            marginInlineStart: t.marginXS
          }
        },
        [`${e}-open`]: {
          overflow: "hidden"
        }
      })
    },
    // ======================== Pure =========================
    {
      [`${e}-pure-panel`]: {
        top: "auto",
        padding: 0,
        display: "flex",
        flexDirection: "column",
        [`${e}-content,
          ${e}-body,
          ${e}-confirm-body-wrapper`]: {
          display: "flex",
          flexDirection: "column",
          flex: "auto"
        },
        [`${e}-confirm-body`]: {
          marginBottom: "auto"
        }
      }
    }
  ];
}, hle = (t) => {
  const {
    componentCls: e
  } = t, n = `${e}-confirm`;
  return {
    [n]: {
      "&-rtl": {
        direction: "rtl"
      },
      [`${t.antCls}-modal-header`]: {
        display: "none"
      },
      [`${n}-body-wrapper`]: k({}, Es()),
      [`${n}-body`]: {
        display: "flex",
        flexWrap: "wrap",
        alignItems: "center",
        [`${n}-title`]: {
          flex: "0 0 100%",
          display: "block",
          // create BFC to avoid
          // https://user-images.githubusercontent.com/507615/37702510-ba844e06-2d2d-11e8-9b67-8e19be57f445.png
          overflow: "hidden",
          color: t.colorTextHeading,
          fontWeight: t.fontWeightStrong,
          fontSize: t.modalHeaderTitleFontSize,
          lineHeight: t.modalHeaderTitleLineHeight,
          [`+ ${n}-content`]: {
            marginBlockStart: t.marginXS,
            flexBasis: "100%",
            maxWidth: `calc(100% - ${t.modalConfirmIconSize + t.marginSM}px)`
          }
        },
        [`${n}-content`]: {
          color: t.colorText,
          fontSize: t.fontSize
        },
        [`> ${t.iconCls}`]: {
          flex: "none",
          marginInlineEnd: t.marginSM,
          fontSize: t.modalConfirmIconSize,
          [`+ ${n}-title`]: {
            flex: 1
          },
          // `content` after `icon` should set marginLeft
          [`+ ${n}-title + ${n}-content`]: {
            marginInlineStart: t.modalConfirmIconSize + t.marginSM
          }
        }
      },
      [`${n}-btns`]: {
        textAlign: "end",
        marginTop: t.marginSM,
        [`${t.antCls}-btn + ${t.antCls}-btn`]: {
          marginBottom: 0,
          marginInlineStart: t.marginXS
        }
      }
    },
    [`${n}-error ${n}-body > ${t.iconCls}`]: {
      color: t.colorError
    },
    [`${n}-warning ${n}-body > ${t.iconCls},
        ${n}-confirm ${n}-body > ${t.iconCls}`]: {
      color: t.colorWarning
    },
    [`${n}-info ${n}-body > ${t.iconCls}`]: {
      color: t.colorInfo
    },
    [`${n}-success ${n}-body > ${t.iconCls}`]: {
      color: t.colorSuccess
    },
    // https://github.com/ant-design/ant-design/issues/37329
    [`${e}-zoom-leave ${e}-btns`]: {
      pointerEvents: "none"
    }
  };
}, ple = (t) => {
  const {
    componentCls: e
  } = t;
  return {
    [`${e}-root`]: {
      [`${e}-wrap-rtl`]: {
        direction: "rtl",
        [`${e}-confirm-body`]: {
          direction: "rtl"
        }
      }
    }
  };
}, gle = (t) => {
  const {
    componentCls: e,
    antCls: n
  } = t, i = `${e}-confirm`;
  return {
    [e]: {
      [`${e}-content`]: {
        padding: 0
      },
      [`${e}-header`]: {
        padding: t.modalHeaderPadding,
        borderBottom: `${t.modalHeaderBorderWidth}px ${t.modalHeaderBorderStyle} ${t.modalHeaderBorderColorSplit}`,
        marginBottom: 0
      },
      [`${e}-body`]: {
        padding: t.modalBodyPadding
      },
      [`${e}-footer`]: {
        padding: `${t.modalFooterPaddingVertical}px ${t.modalFooterPaddingHorizontal}px`,
        borderTop: `${t.modalFooterBorderWidth}px ${t.modalFooterBorderStyle} ${t.modalFooterBorderColorSplit}`,
        borderRadius: `0 0 ${t.borderRadiusLG}px ${t.borderRadiusLG}px`,
        marginTop: 0
      }
    },
    [i]: {
      [`${n}-modal-body`]: {
        padding: `${t.padding * 2}px ${t.padding * 2}px ${t.paddingLG}px`
      },
      [`${i}-body`]: {
        [`> ${t.iconCls}`]: {
          marginInlineEnd: t.margin,
          // `content` after `icon` should set marginLeft
          [`+ ${i}-title + ${i}-content`]: {
            marginInlineStart: t.modalConfirmIconSize + t.margin
          }
        }
      },
      [`${i}-btns`]: {
        marginTop: t.marginLG
      }
    }
  };
}, mle = Vn("Modal", (t) => {
  const e = t.padding, n = t.fontSizeHeading5, i = t.lineHeightHeading5, o = dn(t, {
    modalBodyPadding: t.paddingLG,
    modalHeaderBg: t.colorBgElevated,
    modalHeaderPadding: `${e}px ${t.paddingLG}px`,
    modalHeaderBorderWidth: t.lineWidth,
    modalHeaderBorderStyle: t.lineType,
    modalHeaderTitleLineHeight: i,
    modalHeaderTitleFontSize: n,
    modalHeaderBorderColorSplit: t.colorSplit,
    modalHeaderCloseSize: i * n + e * 2,
    modalContentBg: t.colorBgElevated,
    modalHeadingColor: t.colorTextHeading,
    modalCloseColor: t.colorTextDescription,
    modalFooterBg: "transparent",
    modalFooterBorderColorSplit: t.colorSplit,
    modalFooterBorderStyle: t.lineType,
    modalFooterPaddingVertical: t.paddingXS,
    modalFooterPaddingHorizontal: t.padding,
    modalFooterBorderWidth: t.lineWidth,
    modalConfirmTitleFontSize: t.fontSizeLG,
    modalIconHoverColor: t.colorIconHover,
    modalConfirmIconSize: t.fontSize * t.lineHeight,
    modalCloseBtnSize: t.controlHeightLG * 0.55
  });
  return [fle(o), hle(o), ple(o), dle(o), t.wireframe && gle(o), gg(o, "zoom")];
});
var vle = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z" } }] }, name: "up", theme: "outlined" };
function i_(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(n);
    typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(n).filter(function(o) {
      return Object.getOwnPropertyDescriptor(n, o).enumerable;
    }))), i.forEach(function(o) {
      yle(t, o, n[o]);
    });
  }
  return t;
}
function yle(t, e, n) {
  return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
var R$ = function(e, n) {
  var i = i_({}, e, n.attrs);
  return v(bn, i_({}, i, {
    icon: vle
  }), null);
};
R$.displayName = "UpOutlined";
R$.inheritAttrs = !1;
function UO() {
  return typeof BigInt == "function";
}
function dp(t) {
  let e = t.trim(), n = e.startsWith("-");
  n && (e = e.slice(1)), e = e.replace(/(\.\d*[^0])0*$/, "$1").replace(/\.0*$/, "").replace(/^0+/, ""), e.startsWith(".") && (e = `0${e}`);
  const i = e || "0", o = i.split("."), r = o[0] || "0", a = o[1] || "0";
  r === "0" && a === "0" && (n = !1);
  const l = n ? "-" : "";
  return {
    negative: n,
    negativeStr: l,
    trimStr: i,
    integerStr: r,
    decimalStr: a,
    fullStr: `${l}${i}`
  };
}
function D$(t) {
  const e = String(t);
  return !Number.isNaN(Number(e)) && e.includes("e");
}
function Wp(t) {
  const e = String(t);
  if (D$(t)) {
    let n = Number(e.slice(e.indexOf("e-") + 2));
    const i = e.match(/\.(\d+)/);
    return i?.[1] && (n += i[1].length), n;
  }
  return e.includes(".") && L$(e) ? e.length - e.indexOf(".") - 1 : 0;
}
function N$(t) {
  let e = String(t);
  if (D$(t)) {
    if (t > Number.MAX_SAFE_INTEGER)
      return String(UO() ? BigInt(t).toString() : Number.MAX_SAFE_INTEGER);
    if (t < Number.MIN_SAFE_INTEGER)
      return String(UO() ? BigInt(t).toString() : Number.MIN_SAFE_INTEGER);
    e = t.toFixed(Wp(e));
  }
  return dp(e).fullStr;
}
function L$(t) {
  return typeof t == "number" ? !Number.isNaN(t) : t ? (
    // Normal type: 11.28
    /^\s*-?\d+(\.\d+)?\s*$/.test(t) || // Pre-number: 1.
    /^\s*-?\d+\.\s*$/.test(t) || // Post-number: .1
    /^\s*-?\.\d+\s*$/.test(t)
  ) : !1;
}
function jL(t) {
  return !t && t !== 0 && !Number.isNaN(t) || !String(t).trim();
}
class Sc {
  constructor(e) {
    if (this.origin = "", jL(e)) {
      this.empty = !0;
      return;
    }
    this.origin = String(e), this.number = Number(e);
  }
  negate() {
    return new Sc(-this.toNumber());
  }
  add(e) {
    if (this.isInvalidate())
      return new Sc(e);
    const n = Number(e);
    if (Number.isNaN(n))
      return this;
    const i = this.number + n;
    if (i > Number.MAX_SAFE_INTEGER)
      return new Sc(Number.MAX_SAFE_INTEGER);
    if (i < Number.MIN_SAFE_INTEGER)
      return new Sc(Number.MIN_SAFE_INTEGER);
    const o = Math.max(Wp(this.number), Wp(n));
    return new Sc(i.toFixed(o));
  }
  isEmpty() {
    return this.empty;
  }
  isNaN() {
    return Number.isNaN(this.number);
  }
  isInvalidate() {
    return this.isEmpty() || this.isNaN();
  }
  equals(e) {
    return this.toNumber() === e?.toNumber();
  }
  lessEquals(e) {
    return this.add(e.negate().toString()).toNumber() <= 0;
  }
  toNumber() {
    return this.number;
  }
  toString() {
    return (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0) ? this.isInvalidate() ? "" : N$(this.number) : this.origin;
  }
}
class Zd {
  constructor(e) {
    if (this.origin = "", jL(e)) {
      this.empty = !0;
      return;
    }
    if (this.origin = String(e), e === "-" || Number.isNaN(e)) {
      this.nan = !0;
      return;
    }
    let n = e;
    if (D$(n) && (n = Number(n)), n = typeof n == "string" ? n : N$(n), L$(n)) {
      const i = dp(n);
      this.negative = i.negative;
      const o = i.trimStr.split(".");
      this.integer = BigInt(o[0]);
      const r = o[1] || "0";
      this.decimal = BigInt(r), this.decimalLen = r.length;
    } else
      this.nan = !0;
  }
  getMark() {
    return this.negative ? "-" : "";
  }
  getIntegerStr() {
    return this.integer.toString();
  }
  getDecimalStr() {
    return this.decimal.toString().padStart(this.decimalLen, "0");
  }
  /**
   * Align BigIntDecimal with same decimal length. e.g. 12.3 + 5 = 1230000
   * This is used for add function only.
   */
  alignDecimal(e) {
    const n = `${this.getMark()}${this.getIntegerStr()}${this.getDecimalStr().padEnd(e, "0")}`;
    return BigInt(n);
  }
  negate() {
    const e = new Zd(this.toString());
    return e.negative = !e.negative, e;
  }
  add(e) {
    if (this.isInvalidate())
      return new Zd(e);
    const n = new Zd(e);
    if (n.isInvalidate())
      return this;
    const i = Math.max(this.getDecimalStr().length, n.getDecimalStr().length), o = this.alignDecimal(i), r = n.alignDecimal(i), a = (o + r).toString(), {
      negativeStr: l,
      trimStr: s
    } = dp(a), u = `${l}${s.padStart(i + 1, "0")}`;
    return new Zd(`${u.slice(0, -i)}.${u.slice(-i)}`);
  }
  isEmpty() {
    return this.empty;
  }
  isNaN() {
    return this.nan;
  }
  isInvalidate() {
    return this.isEmpty() || this.isNaN();
  }
  equals(e) {
    return this.toString() === e?.toString();
  }
  lessEquals(e) {
    return this.add(e.negate().toString()).toNumber() <= 0;
  }
  toNumber() {
    return this.isNaN() ? NaN : Number(this.toString());
  }
  toString() {
    return (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0) ? this.isInvalidate() ? "" : dp(`${this.getMark()}${this.getIntegerStr()}.${this.getDecimalStr()}`).fullStr : this.origin;
  }
}
function pl(t) {
  return UO() ? new Zd(t) : new Sc(t);
}
function JO(t, e, n) {
  let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1;
  if (t === "")
    return "";
  const {
    negativeStr: o,
    integerStr: r,
    decimalStr: a
  } = dp(t), l = `${e}${a}`, s = `${o}${r}`;
  if (n >= 0) {
    const u = Number(a[n]);
    if (u >= 5 && !i) {
      const c = pl(t).add(`${o}0.${"0".repeat(n)}${10 - u}`);
      return JO(c.toString(), e, n, i);
    }
    return n === 0 ? s : `${s}${e}${a.padEnd(n, "0").slice(0, n)}`;
  }
  return l === ".0" ? s : `${s}${l}`;
}
const ble = 200, xle = 600, Ole = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "StepHandler",
  inheritAttrs: !1,
  props: {
    prefixCls: String,
    upDisabled: Boolean,
    downDisabled: Boolean,
    onStep: ot()
  },
  slots: Object,
  setup(t, e) {
    let {
      slots: n,
      emit: i
    } = e;
    const o = de(), r = (l, s) => {
      l.preventDefault(), i("step", s);
      function u() {
        i("step", s), o.value = setTimeout(u, ble);
      }
      o.value = setTimeout(u, xle);
    }, a = () => {
      clearTimeout(o.value);
    };
    return tn(() => {
      a();
    }), () => {
      if (PC())
        return null;
      const {
        prefixCls: l,
        upDisabled: s,
        downDisabled: u
      } = t, c = `${l}-handler`, d = Ae(c, `${c}-up`, {
        [`${c}-up-disabled`]: s
      }), f = Ae(c, `${c}-down`, {
        [`${c}-down-disabled`]: u
      }), h = {
        unselectable: "on",
        role: "button",
        onMouseup: a,
        onMouseleave: a
      }, {
        upNode: p,
        downNode: g
      } = n;
      return v("div", {
        class: `${c}-wrap`
      }, [v("span", J(J({}, h), {}, {
        onMousedown: (m) => {
          r(m, !0);
        },
        "aria-label": "Increase Value",
        "aria-disabled": s,
        class: d
      }), [p?.() || v("span", {
        unselectable: "on",
        class: `${l}-handler-up-inner`
      }, null)]), v("span", J(J({}, h), {}, {
        onMousedown: (m) => {
          r(m, !1);
        },
        "aria-label": "Decrease Value",
        "aria-disabled": u,
        class: f
      }), [g?.() || v("span", {
        unselectable: "on",
        class: `${l}-handler-down-inner`
      }, null)])]);
    };
  }
});
function Sle(t, e) {
  const n = de(null);
  function i() {
    try {
      const {
        selectionStart: r,
        selectionEnd: a,
        value: l
      } = t.value, s = l.substring(0, r), u = l.substring(a);
      n.value = {
        start: r,
        end: a,
        value: l,
        beforeTxt: s,
        afterTxt: u
      };
    } catch {
    }
  }
  function o() {
    if (t.value && n.value && e.value)
      try {
        const {
          value: r
        } = t.value, {
          beforeTxt: a,
          afterTxt: l,
          start: s
        } = n.value;
        let u = r.length;
        if (r.endsWith(l))
          u = r.length - n.value.afterTxt.length;
        else if (r.startsWith(a))
          u = a.length;
        else {
          const c = a[s - 1], d = r.indexOf(c, s - 1);
          d !== -1 && (u = d + 1);
        }
        t.value.setSelectionRange(u, u);
      } catch (r) {
        Nn(!1, `Something warning of cursor restore. Please fire issue about this: ${r.message}`);
      }
  }
  return [i, o];
}
const wle = (() => {
  const t = Te(0), e = () => {
    Gt.cancel(t.value);
  };
  return tn(() => {
    e();
  }), (n) => {
    e(), t.value = Gt(() => {
      n();
    });
  };
});
var Cle = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
const o_ = (t, e) => t || e.isEmpty() ? e.toString() : e.toNumber(), r_ = (t) => {
  const e = pl(t);
  return e.isInvalidate() ? null : e;
}, qL = () => ({
  /** value will show as string */
  stringMode: pt(),
  defaultValue: pn([String, Number]),
  value: pn([String, Number]),
  prefixCls: yn(),
  min: pn([String, Number]),
  max: pn([String, Number]),
  step: pn([String, Number], 1),
  tabindex: Number,
  controls: pt(!0),
  readonly: pt(),
  disabled: pt(),
  autofocus: pt(),
  keyboard: pt(!0),
  /** Parse display value to validate number */
  parser: ot(),
  /** Transform `value` to display value show in input */
  formatter: ot(),
  /** Syntactic sugar of `formatter`. Config precision of display. */
  precision: Number,
  /** Syntactic sugar of `formatter`. Config decimal separator of display. */
  decimalSeparator: String,
  onInput: ot(),
  onChange: ot(),
  onPressEnter: ot(),
  onStep: ot(),
  onBlur: ot(),
  onFocus: ot()
}), $le = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "InnerInputNumber",
  inheritAttrs: !1,
  props: k(k({}, qL()), {
    lazy: Boolean
  }),
  slots: Object,
  setup(t, e) {
    let {
      attrs: n,
      slots: i,
      emit: o,
      expose: r
    } = e;
    const a = Te(), l = Te(!1), s = Te(!1), u = Te(!1), c = Te(pl(t.value));
    function d(K) {
      t.value === void 0 && (c.value = K);
    }
    const f = (K, ee) => {
      if (!ee)
        return t.precision >= 0 ? t.precision : Math.max(Wp(K), Wp(t.step));
    }, h = (K) => {
      const ee = String(K);
      if (t.parser)
        return t.parser(ee);
      let ie = ee;
      return t.decimalSeparator && (ie = ie.replace(t.decimalSeparator, ".")), ie.replace(/[^\w.-]+/g, "");
    }, p = Te(""), g = (K, ee) => {
      if (t.formatter)
        return t.formatter(K, {
          userTyping: ee,
          input: String(p.value)
        });
      let ie = typeof K == "number" ? N$(K) : K;
      if (!ee) {
        const ae = f(ie, ee);
        if (L$(ie) && (t.decimalSeparator || ae >= 0)) {
          const te = t.decimalSeparator || ".";
          ie = JO(ie, te, ae);
        }
      }
      return ie;
    }, m = (() => {
      const K = t.value;
      return c.value.isInvalidate() && ["string", "number"].includes(typeof K) ? Number.isNaN(K) ? "" : K : g(c.value.toString(), !1);
    })();
    p.value = m;
    function y(K, ee) {
      p.value = g(
        // Invalidate number is sometime passed by external control, we should let it go
        // Otherwise is controlled by internal interactive logic which check by userTyping
        // You can ref 'show limited value when input is not focused' test for more info.
        K.isInvalidate() ? K.toString(!1) : K.toString(!ee),
        ee
      );
    }
    const b = A(() => r_(t.max)), w = A(() => r_(t.min)), $ = A(() => !b.value || !c.value || c.value.isInvalidate() ? !1 : b.value.lessEquals(c.value)), C = A(() => !w.value || !c.value || c.value.isInvalidate() ? !1 : c.value.lessEquals(w.value)), [P, O] = Sle(a, l), E = (K) => b.value && !K.lessEquals(b.value) ? b.value : w.value && !w.value.lessEquals(K) ? w.value : null, _ = (K) => !E(K), D = (K, ee) => {
      var ie;
      let ae = K, te = _(ae) || ae.isEmpty();
      if (!ae.isEmpty() && !ee && (ae = E(ae) || ae, te = !0), !t.readonly && !t.disabled && te) {
        const U = ae.toString(), me = f(U, ee);
        return me >= 0 && (ae = pl(JO(U, ".", me))), ae.equals(c.value) || (d(ae), (ie = t.onChange) === null || ie === void 0 || ie.call(t, ae.isEmpty() ? null : o_(t.stringMode, ae)), t.value === void 0 && y(ae, ee)), ae;
      }
      return c.value;
    }, M = wle(), N = (K) => {
      var ee;
      if (P(), p.value = K, !u.value) {
        const ie = h(K), ae = pl(ie);
        ae.isNaN() || D(ae, !0);
      }
      (ee = t.onInput) === null || ee === void 0 || ee.call(t, K), M(() => {
        let ie = K;
        t.parser || (ie = K.replace(/。/g, ".")), ie !== K && N(ie);
      });
    }, L = () => {
      u.value = !0;
    }, j = () => {
      u.value = !1, N(a.value.value);
    }, B = (K) => {
      N(K.target.value);
    }, Y = (K) => {
      var ee, ie;
      if (K && $.value || !K && C.value)
        return;
      s.value = !1;
      let ae = pl(t.step);
      K || (ae = ae.negate());
      const te = (c.value || pl(0)).add(ae.toString()), U = D(te, !1);
      (ee = t.onStep) === null || ee === void 0 || ee.call(t, o_(t.stringMode, U), {
        offset: t.step,
        type: K ? "up" : "down"
      }), (ie = a.value) === null || ie === void 0 || ie.focus();
    }, Q = (K) => {
      const ee = pl(h(p.value));
      let ie = ee;
      ee.isNaN() ? ie = c.value : ie = D(ee, K), t.value !== void 0 ? y(c.value, !1) : ie.isNaN() || y(ie, !1);
    }, G = () => {
      s.value = !0;
    }, V = (K) => {
      var ee;
      const {
        which: ie
      } = K;
      s.value = !0, ie === lt.ENTER && (u.value || (s.value = !1), Q(!1), (ee = t.onPressEnter) === null || ee === void 0 || ee.call(t, K)), t.keyboard !== !1 && !u.value && [lt.UP, lt.DOWN].includes(ie) && (Y(lt.UP === ie), K.preventDefault());
    }, H = () => {
      s.value = !1;
    }, q = (K) => {
      Q(!1), l.value = !1, s.value = !1, o("blur", K);
    };
    return _e(() => t.precision, () => {
      c.value.isInvalidate() || y(c.value, !1);
    }, {
      flush: "post"
    }), _e(() => t.value, () => {
      const K = pl(t.value);
      c.value = K;
      const ee = pl(h(p.value));
      (!K.equals(ee) || !s.value || t.formatter) && y(K, s.value);
    }, {
      flush: "post"
    }), _e(p, () => {
      t.formatter && O();
    }, {
      flush: "post"
    }), _e(() => t.disabled, (K) => {
      K && (l.value = !1);
    }), r({
      focus: () => {
        var K;
        (K = a.value) === null || K === void 0 || K.focus();
      },
      blur: () => {
        var K;
        (K = a.value) === null || K === void 0 || K.blur();
      }
    }), () => {
      const K = k(k({}, n), t), {
        prefixCls: ee = "rc-input-number",
        min: ie,
        max: ae,
        step: te = 1,
        defaultValue: U,
        value: me,
        disabled: ce,
        readonly: ue,
        keyboard: fe,
        controls: he = !0,
        autofocus: le,
        stringMode: ke,
        parser: ze,
        formatter: Re,
        precision: Ye,
        decimalSeparator: Ne,
        onChange: Fe,
        onInput: We,
        onPressEnter: nt,
        onStep: Qe,
        lazy: Pe,
        class: Ze,
        style: Ce
      } = K, $e = Cle(K, ["prefixCls", "min", "max", "step", "defaultValue", "value", "disabled", "readonly", "keyboard", "controls", "autofocus", "stringMode", "parser", "formatter", "precision", "decimalSeparator", "onChange", "onInput", "onPressEnter", "onStep", "lazy", "class", "style"]), {
        upHandler: Le,
        downHandler: Ke
      } = i, qe = `${ee}-input`, rt = {};
      return Pe ? rt.onChange = B : rt.onInput = B, v("div", {
        class: Ae(ee, Ze, {
          [`${ee}-focused`]: l.value,
          [`${ee}-disabled`]: ce,
          [`${ee}-readonly`]: ue,
          [`${ee}-not-a-number`]: c.value.isNaN(),
          [`${ee}-out-of-range`]: !c.value.isInvalidate() && !_(c.value)
        }),
        style: Ce,
        onKeydown: V,
        onKeyup: H
      }, [he && v(Ole, {
        prefixCls: ee,
        upDisabled: $.value,
        downDisabled: C.value,
        onStep: Y
      }, {
        upNode: Le,
        downNode: Ke
      }), v("div", {
        class: `${qe}-wrap`
      }, [v("input", J(J(J({
        autofocus: le,
        autocomplete: "off",
        role: "spinbutton",
        "aria-valuemin": ie,
        "aria-valuemax": ae,
        "aria-valuenow": c.value.isInvalidate() ? null : c.value.toString(),
        step: te
      }, $e), {}, {
        ref: a,
        class: qe,
        value: p.value,
        disabled: ce,
        readonly: ue,
        onFocus: (De) => {
          l.value = !0, o("focus", De);
        }
      }, rt), {}, {
        onBlur: q,
        onCompositionstart: L,
        onCompositionend: j,
        onBeforeinput: G
      }), null)])]);
    };
  }
});
function $1(t) {
  return t != null;
}
const kle = (t) => {
  const {
    componentCls: e,
    lineWidth: n,
    lineType: i,
    colorBorder: o,
    borderRadius: r,
    fontSizeLG: a,
    controlHeightLG: l,
    controlHeightSM: s,
    colorError: u,
    inputPaddingHorizontalSM: c,
    colorTextDescription: d,
    motionDurationMid: f,
    colorPrimary: h,
    controlHeight: p,
    inputPaddingHorizontal: g,
    colorBgContainer: m,
    colorTextDisabled: y,
    borderRadiusSM: b,
    borderRadiusLG: w,
    controlWidth: $,
    handleVisible: C
  } = t;
  return [
    {
      [e]: k(k(k(k({}, kn(t)), dh(t)), Ty(t, e)), {
        display: "inline-block",
        width: $,
        margin: 0,
        padding: 0,
        border: `${n}px ${i} ${o}`,
        borderRadius: r,
        "&-rtl": {
          direction: "rtl",
          [`${e}-input`]: {
            direction: "rtl"
          }
        },
        "&-lg": {
          padding: 0,
          fontSize: a,
          borderRadius: w,
          [`input${e}-input`]: {
            height: l - 2 * n
          }
        },
        "&-sm": {
          padding: 0,
          borderRadius: b,
          [`input${e}-input`]: {
            height: s - 2 * n,
            padding: `0 ${c}px`
          }
        },
        "&:hover": k({}, ch(t)),
        "&-focused": k({}, Kc(t)),
        "&-disabled": k(k({}, $5(t)), {
          [`${e}-input`]: {
            cursor: "not-allowed"
          }
        }),
        // ===================== Out Of Range =====================
        "&-out-of-range": {
          input: {
            color: u
          }
        },
        // Style for input-group: input with label, with button or dropdown...
        "&-group": k(k(k({}, kn(t)), T5(t)), {
          "&-wrapper": {
            display: "inline-block",
            textAlign: "start",
            verticalAlign: "top",
            [`${e}-affix-wrapper`]: {
              width: "100%"
            },
            // Size
            "&-lg": {
              [`${e}-group-addon`]: {
                borderRadius: w
              }
            },
            "&-sm": {
              [`${e}-group-addon`]: {
                borderRadius: b
              }
            }
          }
        }),
        [e]: {
          "&-input": k(k({
            width: "100%",
            height: p - 2 * n,
            padding: `0 ${g}px`,
            textAlign: "start",
            backgroundColor: "transparent",
            border: 0,
            borderRadius: r,
            outline: 0,
            transition: `all ${f} linear`,
            appearance: "textfield",
            color: t.colorText,
            fontSize: "inherit",
            verticalAlign: "top"
          }, C5(t.colorTextPlaceholder)), {
            '&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button': {
              margin: 0,
              /* stylelint-disable-next-line property-no-vendor-prefix */
              webkitAppearance: "none",
              appearance: "none"
            }
          })
        }
      })
    },
    // Handler
    {
      [e]: {
        [`&:hover ${e}-handler-wrap, &-focused ${e}-handler-wrap`]: {
          opacity: 1
        },
        [`${e}-handler-wrap`]: {
          position: "absolute",
          insetBlockStart: 0,
          insetInlineEnd: 0,
          width: t.handleWidth,
          height: "100%",
          background: m,
          borderStartStartRadius: 0,
          borderStartEndRadius: r,
          borderEndEndRadius: r,
          borderEndStartRadius: 0,
          opacity: C === !0 ? 1 : 0,
          display: "flex",
          flexDirection: "column",
          alignItems: "stretch",
          transition: `opacity ${f} linear ${f}`,
          // Fix input number inside Menu makes icon too large
          // We arise the selector priority by nest selector here
          // https://github.com/ant-design/ant-design/issues/14367
          [`${e}-handler`]: {
            display: "flex",
            alignItems: "center",
            justifyContent: "center",
            flex: "auto",
            height: "40%",
            [`
              ${e}-handler-up-inner,
              ${e}-handler-down-inner
            `]: {
              marginInlineEnd: 0,
              fontSize: t.handleFontSize
            }
          }
        },
        [`${e}-handler`]: {
          height: "50%",
          overflow: "hidden",
          color: d,
          fontWeight: "bold",
          lineHeight: 0,
          textAlign: "center",
          cursor: "pointer",
          borderInlineStart: `${n}px ${i} ${o}`,
          transition: `all ${f} linear`,
          "&:active": {
            background: t.colorFillAlter
          },
          // Hover
          "&:hover": {
            height: "60%",
            [`
              ${e}-handler-up-inner,
              ${e}-handler-down-inner
            `]: {
              color: h
            }
          },
          "&-up-inner, &-down-inner": k(k({}, ah()), {
            color: d,
            transition: `all ${f} linear`,
            userSelect: "none"
          })
        },
        [`${e}-handler-up`]: {
          borderStartEndRadius: r
        },
        [`${e}-handler-down`]: {
          borderBlockStart: `${n}px ${i} ${o}`,
          borderEndEndRadius: r
        },
        // Disabled
        "&-disabled, &-readonly": {
          [`${e}-handler-wrap`]: {
            display: "none"
          },
          [`${e}-input`]: {
            color: "inherit"
          }
        },
        [`
          ${e}-handler-up-disabled,
          ${e}-handler-down-disabled
        `]: {
          cursor: "not-allowed"
        },
        [`
          ${e}-handler-up-disabled:hover &-handler-up-inner,
          ${e}-handler-down-disabled:hover &-handler-down-inner
        `]: {
          color: y
        }
      }
    },
    // Border-less
    {
      [`${e}-borderless`]: {
        borderColor: "transparent",
        boxShadow: "none",
        [`${e}-handler-down`]: {
          borderBlockStartWidth: 0
        }
      }
    }
  ];
}, Tle = (t) => {
  const {
    componentCls: e,
    inputPaddingHorizontal: n,
    inputAffixPadding: i,
    controlWidth: o,
    borderRadiusLG: r,
    borderRadiusSM: a
  } = t;
  return {
    [`${e}-affix-wrapper`]: k(k(k({}, dh(t)), Ty(t, `${e}-affix-wrapper`)), {
      // or number handler will cover form status
      position: "relative",
      display: "inline-flex",
      width: o,
      padding: 0,
      paddingInlineStart: n,
      "&-lg": {
        borderRadius: r
      },
      "&-sm": {
        borderRadius: a
      },
      [`&:not(${e}-affix-wrapper-disabled):hover`]: k(k({}, ch(t)), {
        zIndex: 1
      }),
      "&-focused, &:focus": {
        zIndex: 1
      },
      "&-disabled": {
        [`${e}[disabled]`]: {
          background: "transparent"
        }
      },
      [`> div${e}`]: {
        width: "100%",
        border: "none",
        outline: "none",
        [`&${e}-focused`]: {
          boxShadow: "none !important"
        }
      },
      [`input${e}-input`]: {
        padding: 0
      },
      "&::before": {
        width: 0,
        visibility: "hidden",
        content: '"\\a0"'
      },
      [`${e}-handler-wrap`]: {
        zIndex: 2
      },
      [e]: {
        "&-prefix, &-suffix": {
          display: "flex",
          flex: "none",
          alignItems: "center",
          pointerEvents: "none"
        },
        "&-prefix": {
          marginInlineEnd: i
        },
        "&-suffix": {
          position: "absolute",
          insetBlockStart: 0,
          insetInlineEnd: 0,
          zIndex: 1,
          height: "100%",
          marginInlineEnd: n,
          marginInlineStart: i
        }
      }
    })
  };
}, Ple = Vn("InputNumber", (t) => {
  const e = Py(t);
  return [
    kle(e),
    Tle(e),
    // =====================================================
    // ==             Space Compact                       ==
    // =====================================================
    mg(e)
  ];
}, (t) => ({
  controlWidth: 90,
  handleWidth: t.controlHeightSM - t.lineWidth * 2,
  handleFontSize: t.fontSize / 2,
  handleVisible: "auto"
}));
var Ele = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
const a_ = qL(), _le = () => k(k({}, a_), {
  size: yn(),
  bordered: pt(!0),
  placeholder: String,
  name: String,
  id: String,
  type: String,
  addonBefore: ve.any,
  addonAfter: ve.any,
  prefix: ve.any,
  "onUpdate:value": a_.onChange,
  valueModifiers: Object,
  status: yn()
}), k1 = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "AInputNumber",
  inheritAttrs: !1,
  props: _le(),
  // emits: ['focus', 'blur', 'change', 'input', 'update:value'],
  slots: Object,
  setup(t, e) {
    let {
      emit: n,
      expose: i,
      attrs: o,
      slots: r
    } = e;
    var a;
    const l = jr(), s = Fr.useInject(), u = A(() => ad(s.status, t.status)), {
      prefixCls: c,
      size: d,
      direction: f,
      disabled: h
    } = Ht("input-number", t), {
      compactSize: p,
      compactItemClassnames: g
    } = sh(c, f), m = qa(), y = A(() => {
      var L;
      return (L = h.value) !== null && L !== void 0 ? L : m.value;
    }), [b, w] = Ple(c), $ = A(() => p.value || d.value), C = Te((a = t.value) !== null && a !== void 0 ? a : t.defaultValue), P = Te(!1);
    _e(() => t.value, () => {
      C.value = t.value;
    });
    const O = Te(null), E = () => {
      var L;
      (L = O.value) === null || L === void 0 || L.focus();
    };
    i({
      focus: E,
      blur: () => {
        var L;
        (L = O.value) === null || L === void 0 || L.blur();
      }
    });
    const D = (L) => {
      t.value === void 0 && (C.value = L), n("update:value", L), n("change", L), l.onFieldChange();
    }, M = (L) => {
      P.value = !1, n("blur", L), l.onFieldBlur();
    }, N = (L) => {
      P.value = !0, n("focus", L);
    };
    return () => {
      var L, j, B, Y;
      const {
        hasFeedback: Q,
        isFormItemInput: G,
        feedbackIcon: V
      } = s, H = (L = t.id) !== null && L !== void 0 ? L : l.id.value, q = k(k(k({}, o), t), {
        id: H,
        disabled: y.value
      }), {
        class: K,
        bordered: ee,
        readonly: ie,
        style: ae,
        addonBefore: te = (j = r.addonBefore) === null || j === void 0 ? void 0 : j.call(r),
        addonAfter: U = (B = r.addonAfter) === null || B === void 0 ? void 0 : B.call(r),
        prefix: me = (Y = r.prefix) === null || Y === void 0 ? void 0 : Y.call(r),
        valueModifiers: ce = {}
      } = q, ue = Ele(q, ["class", "bordered", "readonly", "style", "addonBefore", "addonAfter", "prefix", "valueModifiers"]), fe = c.value, he = Ae({
        [`${fe}-lg`]: $.value === "large",
        [`${fe}-sm`]: $.value === "small",
        [`${fe}-rtl`]: f.value === "rtl",
        [`${fe}-readonly`]: ie,
        [`${fe}-borderless`]: !ee,
        [`${fe}-in-form-item`]: G
      }, Fa(fe, u.value), K, g.value, w.value);
      let le = v($le, J(J({}, ii(ue, ["size", "defaultValue"])), {}, {
        ref: O,
        lazy: !!ce.lazy,
        value: C.value,
        class: he,
        prefixCls: fe,
        readonly: ie,
        onChange: D,
        onBlur: M,
        onFocus: N
      }), {
        upHandler: r.upIcon ? () => v("span", {
          class: `${fe}-handler-up-inner`
        }, [r.upIcon()]) : () => v(R$, {
          class: `${fe}-handler-up-inner`
        }, null),
        downHandler: r.downIcon ? () => v("span", {
          class: `${fe}-handler-down-inner`
        }, [r.downIcon()]) : () => v(hg, {
          class: `${fe}-handler-down-inner`
        }, null)
      });
      const ke = $1(te) || $1(U), ze = $1(me);
      if (ze || Q) {
        const Re = Ae(`${fe}-affix-wrapper`, Fa(`${fe}-affix-wrapper`, u.value, Q), {
          [`${fe}-affix-wrapper-focused`]: P.value,
          [`${fe}-affix-wrapper-disabled`]: y.value,
          [`${fe}-affix-wrapper-sm`]: $.value === "small",
          [`${fe}-affix-wrapper-lg`]: $.value === "large",
          [`${fe}-affix-wrapper-rtl`]: f.value === "rtl",
          [`${fe}-affix-wrapper-readonly`]: ie,
          [`${fe}-affix-wrapper-borderless`]: !ee,
          // className will go to addon wrapper
          [`${K}`]: !ke && K
        }, w.value);
        le = v("div", {
          class: Re,
          style: ae,
          onClick: E
        }, [ze && v("span", {
          class: `${fe}-prefix`
        }, [me]), le, Q && v("span", {
          class: `${fe}-suffix`
        }, [V])]);
      }
      if (ke) {
        const Re = `${fe}-group`, Ye = `${Re}-addon`, Ne = te ? v("div", {
          class: Ye
        }, [te]) : null, Fe = U ? v("div", {
          class: Ye
        }, [U]) : null, We = Ae(`${fe}-wrapper`, Re, {
          [`${Re}-rtl`]: f.value === "rtl"
        }, w.value), nt = Ae(`${fe}-group-wrapper`, {
          [`${fe}-group-wrapper-sm`]: $.value === "small",
          [`${fe}-group-wrapper-lg`]: $.value === "large",
          [`${fe}-group-wrapper-rtl`]: f.value === "rtl"
        }, Fa(`${c}-group-wrapper`, u.value, Q), K, w.value);
        le = v("div", {
          class: nt,
          style: ae
        }, [v("div", {
          class: We
        }, [Ne && v(Vp, null, {
          default: () => [v(Xv, null, {
            default: () => [Ne]
          })]
        }), le, Fe && v(Vp, null, {
          default: () => [v(Xv, null, {
            default: () => [Fe]
          })]
        })])]);
      }
      return b(vi(le, {
        style: ae
      }));
    };
  }
}), Do = k(k1, {
  install: (t) => (t.component(k1.name, k1), t)
});
function Ile(t, e, n) {
  var i = n || {}, o = i.noTrailing, r = o === void 0 ? !1 : o, a = i.noLeading, l = a === void 0 ? !1 : a, s = i.debounceMode, u = s === void 0 ? void 0 : s, c, d = !1, f = 0;
  function h() {
    c && clearTimeout(c);
  }
  function p(m) {
    var y = m || {}, b = y.upcomingOnly, w = b === void 0 ? !1 : b;
    h(), d = !w;
  }
  function g() {
    for (var m = arguments.length, y = new Array(m), b = 0; b < m; b++)
      y[b] = arguments[b];
    var w = this, $ = Date.now() - f;
    if (d)
      return;
    function C() {
      f = Date.now(), e.apply(w, y);
    }
    function P() {
      c = void 0;
    }
    !l && u && !c && C(), h(), u === void 0 && $ > t ? l ? (f = Date.now(), r || (c = setTimeout(u ? P : C, t))) : C() : r !== !0 && (c = setTimeout(u ? P : C, u === void 0 ? t - $ : t));
  }
  return g.cancel = p, g;
}
function Mle(t, e, n) {
  var i = {}, o = i.atBegin, r = o === void 0 ? !1 : o;
  return Ile(t, e, {
    debounceMode: r !== !1
  });
}
const Ale = new gn("antSpinMove", {
  to: {
    opacity: 1
  }
}), Rle = new gn("antRotate", {
  to: {
    transform: "rotate(405deg)"
  }
}), Dle = (t) => ({
  [`${t.componentCls}`]: k(k({}, kn(t)), {
    position: "absolute",
    display: "none",
    color: t.colorPrimary,
    textAlign: "center",
    verticalAlign: "middle",
    opacity: 0,
    transition: `transform ${t.motionDurationSlow} ${t.motionEaseInOutCirc}`,
    "&-spinning": {
      position: "static",
      display: "inline-block",
      opacity: 1
    },
    "&-nested-loading": {
      position: "relative",
      [`> div > ${t.componentCls}`]: {
        position: "absolute",
        top: 0,
        insetInlineStart: 0,
        zIndex: 4,
        display: "block",
        width: "100%",
        height: "100%",
        maxHeight: t.contentHeight,
        [`${t.componentCls}-dot`]: {
          position: "absolute",
          top: "50%",
          insetInlineStart: "50%",
          margin: -t.spinDotSize / 2
        },
        [`${t.componentCls}-text`]: {
          position: "absolute",
          top: "50%",
          width: "100%",
          paddingTop: (t.spinDotSize - t.fontSize) / 2 + 2,
          textShadow: `0 1px 2px ${t.colorBgContainer}`
          // FIXME: shadow
        },
        [`&${t.componentCls}-show-text ${t.componentCls}-dot`]: {
          marginTop: -(t.spinDotSize / 2) - 10
        },
        "&-sm": {
          [`${t.componentCls}-dot`]: {
            margin: -t.spinDotSizeSM / 2
          },
          [`${t.componentCls}-text`]: {
            paddingTop: (t.spinDotSizeSM - t.fontSize) / 2 + 2
          },
          [`&${t.componentCls}-show-text ${t.componentCls}-dot`]: {
            marginTop: -(t.spinDotSizeSM / 2) - 10
          }
        },
        "&-lg": {
          [`${t.componentCls}-dot`]: {
            margin: -(t.spinDotSizeLG / 2)
          },
          [`${t.componentCls}-text`]: {
            paddingTop: (t.spinDotSizeLG - t.fontSize) / 2 + 2
          },
          [`&${t.componentCls}-show-text ${t.componentCls}-dot`]: {
            marginTop: -(t.spinDotSizeLG / 2) - 10
          }
        }
      },
      [`${t.componentCls}-container`]: {
        position: "relative",
        transition: `opacity ${t.motionDurationSlow}`,
        "&::after": {
          position: "absolute",
          top: 0,
          insetInlineEnd: 0,
          bottom: 0,
          insetInlineStart: 0,
          zIndex: 10,
          width: "100%",
          height: "100%",
          background: t.colorBgContainer,
          opacity: 0,
          transition: `all ${t.motionDurationSlow}`,
          content: '""',
          pointerEvents: "none"
        }
      },
      [`${t.componentCls}-blur`]: {
        clear: "both",
        opacity: 0.5,
        userSelect: "none",
        pointerEvents: "none",
        "&::after": {
          opacity: 0.4,
          pointerEvents: "auto"
        }
      }
    },
    // tip
    // ------------------------------
    "&-tip": {
      color: t.spinDotDefault
    },
    // dots
    // ------------------------------
    [`${t.componentCls}-dot`]: {
      position: "relative",
      display: "inline-block",
      fontSize: t.spinDotSize,
      width: "1em",
      height: "1em",
      "&-item": {
        position: "absolute",
        display: "block",
        width: (t.spinDotSize - t.marginXXS / 2) / 2,
        height: (t.spinDotSize - t.marginXXS / 2) / 2,
        backgroundColor: t.colorPrimary,
        borderRadius: "100%",
        transform: "scale(0.75)",
        transformOrigin: "50% 50%",
        opacity: 0.3,
        animationName: Ale,
        animationDuration: "1s",
        animationIterationCount: "infinite",
        animationTimingFunction: "linear",
        animationDirection: "alternate",
        "&:nth-child(1)": {
          top: 0,
          insetInlineStart: 0
        },
        "&:nth-child(2)": {
          top: 0,
          insetInlineEnd: 0,
          animationDelay: "0.4s"
        },
        "&:nth-child(3)": {
          insetInlineEnd: 0,
          bottom: 0,
          animationDelay: "0.8s"
        },
        "&:nth-child(4)": {
          bottom: 0,
          insetInlineStart: 0,
          animationDelay: "1.2s"
        }
      },
      "&-spin": {
        transform: "rotate(45deg)",
        animationName: Rle,
        animationDuration: "1.2s",
        animationIterationCount: "infinite",
        animationTimingFunction: "linear"
      }
    },
    // Sizes
    // ------------------------------
    // small
    [`&-sm ${t.componentCls}-dot`]: {
      fontSize: t.spinDotSizeSM,
      i: {
        width: (t.spinDotSizeSM - t.marginXXS / 2) / 2,
        height: (t.spinDotSizeSM - t.marginXXS / 2) / 2
      }
    },
    // large
    [`&-lg ${t.componentCls}-dot`]: {
      fontSize: t.spinDotSizeLG,
      i: {
        width: (t.spinDotSizeLG - t.marginXXS) / 2,
        height: (t.spinDotSizeLG - t.marginXXS) / 2
      }
    },
    [`&${t.componentCls}-show-text ${t.componentCls}-text`]: {
      display: "block"
    }
  })
}), Nle = Vn("Spin", (t) => {
  const e = dn(t, {
    spinDotDefault: t.colorTextDescription,
    spinDotSize: t.controlHeightLG / 2,
    spinDotSizeSM: t.controlHeightLG * 0.35,
    spinDotSizeLG: t.controlHeight
  });
  return [Dle(e)];
}, {
  contentHeight: 400
});
var Lle = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
const zle = () => ({
  prefixCls: String,
  spinning: {
    type: Boolean,
    default: void 0
  },
  size: String,
  wrapperClassName: String,
  tip: ve.any,
  delay: Number,
  indicator: ve.any
});
let bv = null;
function Ble(t, e) {
  return !!t && !!e && !isNaN(Number(e));
}
function Fle(t) {
  const e = t.indicator;
  bv = typeof e == "function" ? e : () => v(e, null, null);
}
const Bo = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ASpin",
  inheritAttrs: !1,
  props: Kn(zle(), {
    size: "default",
    spinning: !0,
    wrapperClassName: ""
  }),
  setup(t, e) {
    let {
      attrs: n,
      slots: i
    } = e;
    const {
      prefixCls: o,
      size: r,
      direction: a
    } = Ht("spin", t), [l, s] = Nle(o), u = Te(t.spinning && !Ble(t.spinning, t.delay));
    let c;
    return _e([() => t.spinning, () => t.delay], () => {
      c?.cancel(), c = Mle(t.delay, () => {
        u.value = t.spinning;
      }), c?.();
    }, {
      immediate: !0,
      flush: "post"
    }), tn(() => {
      c?.cancel();
    }), () => {
      var d, f;
      const {
        class: h
      } = n, p = Lle(n, ["class"]), {
        tip: g = (d = i.tip) === null || d === void 0 ? void 0 : d.call(i)
      } = t, m = (f = i.default) === null || f === void 0 ? void 0 : f.call(i), y = {
        [s.value]: !0,
        [o.value]: !0,
        [`${o.value}-sm`]: r.value === "small",
        [`${o.value}-lg`]: r.value === "large",
        [`${o.value}-spinning`]: u.value,
        [`${o.value}-show-text`]: !!g,
        [`${o.value}-rtl`]: a.value === "rtl",
        [h]: !!h
      };
      function b($) {
        const C = `${$}-dot`;
        let P = ca(i, t, "indicator");
        return P === null ? null : (Array.isArray(P) && (P = P.length === 1 ? P[0] : P), or(P) ? Eu(P, {
          class: C
        }) : bv && or(bv()) ? Eu(bv(), {
          class: C
        }) : v("span", {
          class: `${C} ${$}-dot-spin`
        }, [v("i", {
          class: `${$}-dot-item`
        }, null), v("i", {
          class: `${$}-dot-item`
        }, null), v("i", {
          class: `${$}-dot-item`
        }, null), v("i", {
          class: `${$}-dot-item`
        }, null)]));
      }
      const w = v("div", J(J({}, p), {}, {
        class: y,
        "aria-live": "polite",
        "aria-busy": u.value
      }), [b(o.value), g ? v("div", {
        class: `${o.value}-text`
      }, [g]) : null]);
      if (m && ho(m).length) {
        const $ = {
          [`${o.value}-container`]: !0,
          [`${o.value}-blur`]: u.value
        };
        return l(v("div", {
          class: [`${o.value}-nested-loading`, t.wrapperClassName, s.value]
        }, [u.value && v("div", {
          key: "loading"
        }, [w]), v("div", {
          class: $,
          key: "container"
        }, [m])]));
      }
      return l(w);
    };
  }
});
Bo.setDefaultIndicator = Fle;
Bo.install = function(t) {
  return t.component(Bo.name, Bo), t;
};
var Vle = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M272.9 512l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512zm304 0l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z" } }] }, name: "double-left", theme: "outlined" };
function l_(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(n);
    typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(n).filter(function(o) {
      return Object.getOwnPropertyDescriptor(n, o).enumerable;
    }))), i.forEach(function(o) {
      Qle(t, o, n[o]);
    });
  }
  return t;
}
function Qle(t, e, n) {
  return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
var l0 = function(e, n) {
  var i = l_({}, e, n.attrs);
  return v(bn, l_({}, i, {
    icon: Vle
  }), null);
};
l0.displayName = "DoubleLeftOutlined";
l0.inheritAttrs = !1;
var Hle = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M533.2 492.3L277.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H188c-6.7 0-10.4 7.7-6.3 12.9L447.1 512 181.7 851.1A7.98 7.98 0 00188 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5zm304 0L581.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H492c-6.7 0-10.4 7.7-6.3 12.9L751.1 512 485.7 851.1A7.98 7.98 0 00492 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5z" } }] }, name: "double-right", theme: "outlined" };
function s_(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(n);
    typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(n).filter(function(o) {
      return Object.getOwnPropertyDescriptor(n, o).enumerable;
    }))), i.forEach(function(o) {
      Wle(t, o, n[o]);
    });
  }
  return t;
}
function Wle(t, e, n) {
  return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
var s0 = function(e, n) {
  var i = s_({}, e, n.attrs);
  return v(bn, s_({}, i, {
    icon: Hle
  }), null);
};
s0.displayName = "DoubleRightOutlined";
s0.inheritAttrs = !1;
const jle = Oe({
  name: "MiniSelect",
  compatConfig: {
    MODE: 3
  },
  inheritAttrs: !1,
  props: BC(),
  Option: Dt.Option,
  setup(t, e) {
    let {
      attrs: n,
      slots: i
    } = e;
    return () => {
      const o = k(k(k({}, t), {
        size: "small"
      }), n);
      return v(Dt, o, i);
    };
  }
}), qle = Oe({
  name: "MiddleSelect",
  inheritAttrs: !1,
  props: BC(),
  Option: Dt.Option,
  setup(t, e) {
    let {
      attrs: n,
      slots: i
    } = e;
    return () => {
      const o = k(k(k({}, t), {
        size: "middle"
      }), n);
      return v(Dt, o, i);
    };
  }
}), oc = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "Pager",
  inheritAttrs: !1,
  props: {
    rootPrefixCls: String,
    page: Number,
    active: {
      type: Boolean,
      default: void 0
    },
    last: {
      type: Boolean,
      default: void 0
    },
    locale: ve.object,
    showTitle: {
      type: Boolean,
      default: void 0
    },
    itemRender: {
      type: Function,
      default: () => {
      }
    },
    onClick: {
      type: Function
    },
    onKeypress: {
      type: Function
    }
  },
  eimt: ["click", "keypress"],
  setup(t, e) {
    let {
      emit: n,
      attrs: i
    } = e;
    const o = () => {
      n("click", t.page);
    }, r = (a) => {
      n("keypress", a, o, t.page);
    };
    return () => {
      const {
        showTitle: a,
        page: l,
        itemRender: s
      } = t, {
        class: u,
        style: c
      } = i, d = `${t.rootPrefixCls}-item`, f = Ae(d, `${d}-${t.page}`, {
        [`${d}-active`]: t.active,
        [`${d}-disabled`]: !t.page
      }, u);
      return v("li", {
        onClick: o,
        onKeypress: r,
        title: a ? String(l) : null,
        tabindex: "0",
        class: f,
        style: c
      }, [s({
        page: l,
        type: "page",
        originalElement: v("a", {
          rel: "nofollow"
        }, [l])
      })]);
    };
  }
}), dc = {
  ENTER: 13,
  ARROW_UP: 38,
  ARROW_DOWN: 40
}, Yle = Oe({
  compatConfig: {
    MODE: 3
  },
  props: {
    disabled: {
      type: Boolean,
      default: void 0
    },
    changeSize: Function,
    quickGo: Function,
    selectComponentClass: ve.any,
    current: Number,
    pageSizeOptions: ve.array.def(["10", "20", "50", "100"]),
    pageSize: Number,
    buildOptionText: Function,
    locale: ve.object,
    rootPrefixCls: String,
    selectPrefixCls: String,
    goButton: ve.any
  },
  setup(t) {
    const e = de(""), n = A(() => !e.value || isNaN(e.value) ? void 0 : Number(e.value)), i = (s) => `${s.value} ${t.locale.items_per_page}`, o = (s) => {
      const {
        value: u
      } = s.target;
      e.value !== u && (e.value = u);
    }, r = (s) => {
      const {
        goButton: u,
        quickGo: c,
        rootPrefixCls: d
      } = t;
      if (!(u || e.value === ""))
        if (s.relatedTarget && (s.relatedTarget.className.indexOf(`${d}-item-link`) >= 0 || s.relatedTarget.className.indexOf(`${d}-item`) >= 0)) {
          e.value = "";
          return;
        } else
          c(n.value), e.value = "";
    }, a = (s) => {
      e.value !== "" && (s.keyCode === dc.ENTER || s.type === "click") && (t.quickGo(n.value), e.value = "");
    }, l = A(() => {
      const {
        pageSize: s,
        pageSizeOptions: u
      } = t;
      return u.some((c) => c.toString() === s.toString()) ? u : u.concat([s.toString()]).sort((c, d) => {
        const f = isNaN(Number(c)) ? 0 : Number(c), h = isNaN(Number(d)) ? 0 : Number(d);
        return f - h;
      });
    });
    return () => {
      const {
        rootPrefixCls: s,
        locale: u,
        changeSize: c,
        quickGo: d,
        goButton: f,
        selectComponentClass: h,
        selectPrefixCls: p,
        pageSize: g,
        disabled: m
      } = t, y = `${s}-options`;
      let b = null, w = null, $ = null;
      if (!c && !d)
        return null;
      if (c && h) {
        const C = t.buildOptionText || i, P = l.value.map((O, E) => v(h.Option, {
          key: E,
          value: O
        }, {
          default: () => [C({
            value: O
          })]
        }));
        b = v(h, {
          disabled: m,
          prefixCls: p,
          showSearch: !1,
          class: `${y}-size-changer`,
          optionLabelProp: "children",
          value: (g || l.value[0]).toString(),
          onChange: (O) => c(Number(O)),
          getPopupContainer: (O) => O.parentNode
        }, {
          default: () => [P]
        });
      }
      return d && (f && ($ = typeof f == "boolean" ? v("button", {
        type: "button",
        onClick: a,
        onKeyup: a,
        disabled: m,
        class: `${y}-quick-jumper-button`
      }, [u.jump_to_confirm]) : v("span", {
        onClick: a,
        onKeyup: a
      }, [f])), w = v("div", {
        class: `${y}-quick-jumper`
      }, [u.jump_to, v(fg, {
        disabled: m,
        type: "text",
        value: e.value,
        onInput: o,
        onChange: o,
        onKeyup: a,
        onBlur: r
      }, null), u.page, $])), v("li", {
        class: `${y}`
      }, [b, w]);
    };
  }
}), Kle = {
  // Options.jsx
  items_per_page: "条/页",
  jump_to: "跳至",
  jump_to_confirm: "确定",
  page: "页",
  // Pagination.jsx
  prev_page: "上一页",
  next_page: "下一页",
  prev_5: "向前 5 页",
  next_5: "向后 5 页",
  prev_3: "向前 3 页",
  next_3: "向后 3 页"
};
var Xle = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
function Zle(t) {
  return typeof t == "number" && isFinite(t) && Math.floor(t) === t;
}
function Gle(t) {
  let {
    originalElement: e
  } = t;
  return e;
}
function Jl(t, e, n) {
  const i = typeof t > "u" ? e.statePageSize : t;
  return Math.floor((n.total - 1) / i) + 1;
}
const Ule = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "Pagination",
  mixins: [cg],
  inheritAttrs: !1,
  props: {
    disabled: {
      type: Boolean,
      default: void 0
    },
    prefixCls: ve.string.def("rc-pagination"),
    selectPrefixCls: ve.string.def("rc-select"),
    current: Number,
    defaultCurrent: ve.number.def(1),
    total: ve.number.def(0),
    pageSize: Number,
    defaultPageSize: ve.number.def(10),
    hideOnSinglePage: {
      type: Boolean,
      default: !1
    },
    showSizeChanger: {
      type: Boolean,
      default: void 0
    },
    showLessItems: {
      type: Boolean,
      default: !1
    },
    // showSizeChange: PropTypes.func.def(noop),
    selectComponentClass: ve.any,
    showPrevNextJumpers: {
      type: Boolean,
      default: !0
    },
    showQuickJumper: ve.oneOfType([ve.looseBool, ve.object]).def(!1),
    showTitle: {
      type: Boolean,
      default: !0
    },
    pageSizeOptions: ve.arrayOf(ve.oneOfType([ve.number, ve.string])),
    buildOptionText: Function,
    showTotal: Function,
    simple: {
      type: Boolean,
      default: void 0
    },
    locale: ve.object.def(Kle),
    itemRender: ve.func.def(Gle),
    prevIcon: ve.any,
    nextIcon: ve.any,
    jumpPrevIcon: ve.any,
    jumpNextIcon: ve.any,
    totalBoundaryShowSizeChanger: ve.number.def(50)
  },
  data() {
    const t = this.$props;
    let e = Zv([this.current, this.defaultCurrent]);
    const n = Zv([this.pageSize, this.defaultPageSize]);
    return e = Math.min(e, Jl(n, void 0, t)), {
      stateCurrent: e,
      stateCurrentInputValue: e,
      statePageSize: n
    };
  },
  watch: {
    current(t) {
      this.setState({
        stateCurrent: t,
        stateCurrentInputValue: t
      });
    },
    pageSize(t) {
      const e = {};
      let n = this.stateCurrent;
      const i = Jl(t, this.$data, this.$props);
      n = n > i ? i : n, ls(this, "current") || (e.stateCurrent = n, e.stateCurrentInputValue = n), e.statePageSize = t, this.setState(e);
    },
    stateCurrent(t, e) {
      this.$nextTick(() => {
        if (this.$refs.paginationNode) {
          const n = this.$refs.paginationNode.querySelector(`.${this.prefixCls}-item-${e}`);
          n && document.activeElement === n && n.blur();
        }
      });
    },
    total() {
      const t = {}, e = Jl(this.pageSize, this.$data, this.$props);
      if (ls(this, "current")) {
        const n = Math.min(this.current, e);
        t.stateCurrent = n, t.stateCurrentInputValue = n;
      } else {
        let n = this.stateCurrent;
        n === 0 && e > 0 ? n = 1 : n = Math.min(this.stateCurrent, e), t.stateCurrent = n;
      }
      this.setState(t);
    }
  },
  methods: {
    getJumpPrevPage() {
      return Math.max(1, this.stateCurrent - (this.showLessItems ? 3 : 5));
    },
    getJumpNextPage() {
      return Math.min(Jl(void 0, this.$data, this.$props), this.stateCurrent + (this.showLessItems ? 3 : 5));
    },
    getItemIcon(t, e) {
      const {
        prefixCls: n
      } = this.$props;
      return RD(this, t, this.$props) || v("button", {
        type: "button",
        "aria-label": e,
        class: `${n}-item-link`
      }, null);
    },
    getValidValue(t) {
      const e = t.target.value, n = Jl(void 0, this.$data, this.$props), {
        stateCurrentInputValue: i
      } = this.$data;
      let o;
      return e === "" ? o = e : isNaN(Number(e)) ? o = i : e >= n ? o = n : o = Number(e), o;
    },
    isValid(t) {
      return Zle(t) && t !== this.stateCurrent;
    },
    shouldDisplayQuickJumper() {
      const {
        showQuickJumper: t,
        pageSize: e,
        total: n
      } = this.$props;
      return n <= e ? !1 : t;
    },
    // calculatePage (p) {
    //   let pageSize = p
    //   if (typeof pageSize === 'undefined') {
    //     pageSize = this.statePageSize
    //   }
    //   return Math.floor((this.total - 1) / pageSize) + 1
    // },
    handleKeyDown(t) {
      (t.keyCode === dc.ARROW_UP || t.keyCode === dc.ARROW_DOWN) && t.preventDefault();
    },
    handleKeyUp(t) {
      const e = this.getValidValue(t), n = this.stateCurrentInputValue;
      e !== n && this.setState({
        stateCurrentInputValue: e
      }), t.keyCode === dc.ENTER ? this.handleChange(e) : t.keyCode === dc.ARROW_UP ? this.handleChange(e - 1) : t.keyCode === dc.ARROW_DOWN && this.handleChange(e + 1);
    },
    changePageSize(t) {
      let e = this.stateCurrent;
      const n = e, i = Jl(t, this.$data, this.$props);
      e = e > i ? i : e, i === 0 && (e = this.stateCurrent), typeof t == "number" && (ls(this, "pageSize") || this.setState({
        statePageSize: t
      }), ls(this, "current") || this.setState({
        stateCurrent: e,
        stateCurrentInputValue: e
      })), this.__emit("update:pageSize", t), e !== n && this.__emit("update:current", e), this.__emit("showSizeChange", e, t), this.__emit("change", e, t);
    },
    handleChange(t) {
      const {
        disabled: e
      } = this.$props;
      let n = t;
      if (this.isValid(n) && !e) {
        const i = Jl(void 0, this.$data, this.$props);
        return n > i ? n = i : n < 1 && (n = 1), ls(this, "current") || this.setState({
          stateCurrent: n,
          stateCurrentInputValue: n
        }), this.__emit("update:current", n), this.__emit("change", n, this.statePageSize), n;
      }
      return this.stateCurrent;
    },
    prev() {
      this.hasPrev() && this.handleChange(this.stateCurrent - 1);
    },
    next() {
      this.hasNext() && this.handleChange(this.stateCurrent + 1);
    },
    jumpPrev() {
      this.handleChange(this.getJumpPrevPage());
    },
    jumpNext() {
      this.handleChange(this.getJumpNextPage());
    },
    hasPrev() {
      return this.stateCurrent > 1;
    },
    hasNext() {
      return this.stateCurrent < Jl(void 0, this.$data, this.$props);
    },
    getShowSizeChanger() {
      const {
        showSizeChanger: t,
        total: e,
        totalBoundaryShowSizeChanger: n
      } = this.$props;
      return typeof t < "u" ? t : e > n;
    },
    runIfEnter(t, e) {
      if (t.key === "Enter" || t.charCode === 13) {
        t.preventDefault();
        for (var n = arguments.length, i = new Array(n > 2 ? n - 2 : 0), o = 2; o < n; o++)
          i[o - 2] = arguments[o];
        e(...i);
      }
    },
    runIfEnterPrev(t) {
      this.runIfEnter(t, this.prev);
    },
    runIfEnterNext(t) {
      this.runIfEnter(t, this.next);
    },
    runIfEnterJumpPrev(t) {
      this.runIfEnter(t, this.jumpPrev);
    },
    runIfEnterJumpNext(t) {
      this.runIfEnter(t, this.jumpNext);
    },
    handleGoTO(t) {
      (t.keyCode === dc.ENTER || t.type === "click") && this.handleChange(this.stateCurrentInputValue);
    },
    renderPrev(t) {
      const {
        itemRender: e
      } = this.$props, n = e({
        page: t,
        type: "prev",
        originalElement: this.getItemIcon("prevIcon", "prev page")
      }), i = !this.hasPrev();
      return po(n) ? vi(n, i ? {
        disabled: i
      } : {}) : n;
    },
    renderNext(t) {
      const {
        itemRender: e
      } = this.$props, n = e({
        page: t,
        type: "next",
        originalElement: this.getItemIcon("nextIcon", "next page")
      }), i = !this.hasNext();
      return po(n) ? vi(n, i ? {
        disabled: i
      } : {}) : n;
    }
  },
  render() {
    const {
      prefixCls: t,
      disabled: e,
      hideOnSinglePage: n,
      total: i,
      locale: o,
      showQuickJumper: r,
      showLessItems: a,
      showTitle: l,
      showTotal: s,
      simple: u,
      itemRender: c,
      showPrevNextJumpers: d,
      jumpPrevIcon: f,
      jumpNextIcon: h,
      selectComponentClass: p,
      selectPrefixCls: g,
      pageSizeOptions: m
    } = this.$props, {
      stateCurrent: y,
      statePageSize: b
    } = this, w = ID(this.$attrs).extraAttrs, {
      class: $
    } = w, C = Xle(w, ["class"]);
    if (n === !0 && this.total <= b)
      return null;
    const P = Jl(void 0, this.$data, this.$props), O = [];
    let E = null, _ = null, D = null, M = null, N = null;
    const L = r && r.goButton, j = a ? 1 : 2, B = y - 1 > 0 ? y - 1 : 0, Y = y + 1 < P ? y + 1 : P, Q = this.hasPrev(), G = this.hasNext();
    if (u)
      return L && (typeof L == "boolean" ? N = v("button", {
        type: "button",
        onClick: this.handleGoTO,
        onKeyup: this.handleGoTO
      }, [o.jump_to_confirm]) : N = v("span", {
        onClick: this.handleGoTO,
        onKeyup: this.handleGoTO
      }, [L]), N = v("li", {
        title: l ? `${o.jump_to}${y}/${P}` : null,
        class: `${t}-simple-pager`
      }, [N])), v("ul", J({
        class: Ae(`${t} ${t}-simple`, {
          [`${t}-disabled`]: e
        }, $)
      }, C), [v("li", {
        title: l ? o.prev_page : null,
        onClick: this.prev,
        tabindex: Q ? 0 : null,
        onKeypress: this.runIfEnterPrev,
        class: Ae(`${t}-prev`, {
          [`${t}-disabled`]: !Q
        }),
        "aria-disabled": !Q
      }, [this.renderPrev(B)]), v("li", {
        title: l ? `${y}/${P}` : null,
        class: `${t}-simple-pager`
      }, [v(fg, {
        type: "text",
        value: this.stateCurrentInputValue,
        disabled: e,
        onKeydown: this.handleKeyDown,
        onKeyup: this.handleKeyUp,
        onInput: this.handleKeyUp,
        onChange: this.handleKeyUp,
        size: "3"
      }, null), v("span", {
        class: `${t}-slash`
      }, [Ve("／")]), P]), v("li", {
        title: l ? o.next_page : null,
        onClick: this.next,
        tabindex: G ? 0 : null,
        onKeypress: this.runIfEnterNext,
        class: Ae(`${t}-next`, {
          [`${t}-disabled`]: !G
        }),
        "aria-disabled": !G
      }, [this.renderNext(Y)]), N]);
    if (P <= 3 + j * 2) {
      const ee = {
        locale: o,
        rootPrefixCls: t,
        showTitle: l,
        itemRender: c,
        onClick: this.handleChange,
        onKeypress: this.runIfEnter
      };
      P || O.push(v(oc, J(J({}, ee), {}, {
        key: "noPager",
        page: 1,
        class: `${t}-item-disabled`
      }), null));
      for (let ie = 1; ie <= P; ie += 1) {
        const ae = y === ie;
        O.push(v(oc, J(J({}, ee), {}, {
          key: ie,
          page: ie,
          active: ae
        }), null));
      }
    } else {
      const ee = a ? o.prev_3 : o.prev_5, ie = a ? o.next_3 : o.next_5;
      d && (E = v("li", {
        title: this.showTitle ? ee : null,
        key: "prev",
        onClick: this.jumpPrev,
        tabindex: "0",
        onKeypress: this.runIfEnterJumpPrev,
        class: Ae(`${t}-jump-prev`, {
          [`${t}-jump-prev-custom-icon`]: !!f
        })
      }, [c({
        page: this.getJumpPrevPage(),
        type: "jump-prev",
        originalElement: this.getItemIcon("jumpPrevIcon", "prev page")
      })]), _ = v("li", {
        title: this.showTitle ? ie : null,
        key: "next",
        tabindex: "0",
        onClick: this.jumpNext,
        onKeypress: this.runIfEnterJumpNext,
        class: Ae(`${t}-jump-next`, {
          [`${t}-jump-next-custom-icon`]: !!h
        })
      }, [c({
        page: this.getJumpNextPage(),
        type: "jump-next",
        originalElement: this.getItemIcon("jumpNextIcon", "next page")
      })])), M = v(oc, {
        locale: o,
        last: !0,
        rootPrefixCls: t,
        onClick: this.handleChange,
        onKeypress: this.runIfEnter,
        key: P,
        page: P,
        active: !1,
        showTitle: l,
        itemRender: c
      }, null), D = v(oc, {
        locale: o,
        rootPrefixCls: t,
        onClick: this.handleChange,
        onKeypress: this.runIfEnter,
        key: 1,
        page: 1,
        active: !1,
        showTitle: l,
        itemRender: c
      }, null);
      let ae = Math.max(1, y - j), te = Math.min(y + j, P);
      y - 1 <= j && (te = 1 + j * 2), P - y <= j && (ae = P - j * 2);
      for (let U = ae; U <= te; U += 1) {
        const me = y === U;
        O.push(v(oc, {
          locale: o,
          rootPrefixCls: t,
          onClick: this.handleChange,
          onKeypress: this.runIfEnter,
          key: U,
          page: U,
          active: me,
          showTitle: l,
          itemRender: c
        }, null));
      }
      y - 1 >= j * 2 && y !== 3 && (O[0] = v(oc, {
        locale: o,
        rootPrefixCls: t,
        onClick: this.handleChange,
        onKeypress: this.runIfEnter,
        key: ae,
        page: ae,
        class: `${t}-item-after-jump-prev`,
        active: !1,
        showTitle: this.showTitle,
        itemRender: c
      }, null), O.unshift(E)), P - y >= j * 2 && y !== P - 2 && (O[O.length - 1] = v(oc, {
        locale: o,
        rootPrefixCls: t,
        onClick: this.handleChange,
        onKeypress: this.runIfEnter,
        key: te,
        page: te,
        class: `${t}-item-before-jump-next`,
        active: !1,
        showTitle: this.showTitle,
        itemRender: c
      }, null), O.push(_)), ae !== 1 && O.unshift(D), te !== P && O.push(M);
    }
    let V = null;
    s && (V = v("li", {
      class: `${t}-total-text`
    }, [s(i, [i === 0 ? 0 : (y - 1) * b + 1, y * b > i ? i : y * b])]));
    const H = !Q || !P, q = !G || !P, K = this.buildOptionText || this.$slots.buildOptionText;
    return v("ul", J(J({
      unselectable: "on",
      ref: "paginationNode"
    }, C), {}, {
      class: Ae({
        [`${t}`]: !0,
        [`${t}-disabled`]: e
      }, $)
    }), [V, v("li", {
      title: l ? o.prev_page : null,
      onClick: this.prev,
      tabindex: H ? null : 0,
      onKeypress: this.runIfEnterPrev,
      class: Ae(`${t}-prev`, {
        [`${t}-disabled`]: H
      }),
      "aria-disabled": H
    }, [this.renderPrev(B)]), O, v("li", {
      title: l ? o.next_page : null,
      onClick: this.next,
      tabindex: q ? null : 0,
      onKeypress: this.runIfEnterNext,
      class: Ae(`${t}-next`, {
        [`${t}-disabled`]: q
      }),
      "aria-disabled": q
    }, [this.renderNext(Y)]), v(Yle, {
      disabled: e,
      locale: o,
      rootPrefixCls: t,
      selectComponentClass: p,
      selectPrefixCls: g,
      changeSize: this.getShowSizeChanger() ? this.changePageSize : null,
      current: y,
      pageSize: b,
      pageSizeOptions: m,
      buildOptionText: K || null,
      quickGo: this.shouldDisplayQuickJumper() ? this.handleChange : null,
      goButton: L
    }, null)]);
  }
}), Jle = (t) => {
  const {
    componentCls: e
  } = t;
  return {
    [`${e}-disabled`]: {
      "&, &:hover": {
        cursor: "not-allowed",
        [`${e}-item-link`]: {
          color: t.colorTextDisabled,
          cursor: "not-allowed"
        }
      },
      "&:focus-visible": {
        cursor: "not-allowed",
        [`${e}-item-link`]: {
          color: t.colorTextDisabled,
          cursor: "not-allowed"
        }
      }
    },
    [`&${e}-disabled`]: {
      cursor: "not-allowed",
      [`&${e}-mini`]: {
        [`
          &:hover ${e}-item:not(${e}-item-active),
          &:active ${e}-item:not(${e}-item-active),
          &:hover ${e}-item-link,
          &:active ${e}-item-link
        `]: {
          backgroundColor: "transparent"
        }
      },
      [`${e}-item`]: {
        cursor: "not-allowed",
        "&:hover, &:active": {
          backgroundColor: "transparent"
        },
        a: {
          color: t.colorTextDisabled,
          backgroundColor: "transparent",
          border: "none",
          cursor: "not-allowed"
        },
        "&-active": {
          borderColor: t.colorBorder,
          backgroundColor: t.paginationItemDisabledBgActive,
          "&:hover, &:active": {
            backgroundColor: t.paginationItemDisabledBgActive
          },
          a: {
            color: t.paginationItemDisabledColorActive
          }
        }
      },
      [`${e}-item-link`]: {
        color: t.colorTextDisabled,
        cursor: "not-allowed",
        "&:hover, &:active": {
          backgroundColor: "transparent"
        },
        [`${e}-simple&`]: {
          backgroundColor: "transparent",
          "&:hover, &:active": {
            backgroundColor: "transparent"
          }
        }
      },
      [`${e}-simple-pager`]: {
        color: t.colorTextDisabled
      },
      [`${e}-jump-prev, ${e}-jump-next`]: {
        [`${e}-item-link-icon`]: {
          opacity: 0
        },
        [`${e}-item-ellipsis`]: {
          opacity: 1
        }
      }
    },
    [`&${e}-simple`]: {
      [`${e}-prev, ${e}-next`]: {
        [`&${e}-disabled ${e}-item-link`]: {
          "&:hover, &:active": {
            backgroundColor: "transparent"
          }
        }
      }
    }
  };
}, ese = (t) => {
  const {
    componentCls: e
  } = t;
  return {
    [`&${e}-mini ${e}-total-text, &${e}-mini ${e}-simple-pager`]: {
      height: t.paginationItemSizeSM,
      lineHeight: `${t.paginationItemSizeSM}px`
    },
    [`&${e}-mini ${e}-item`]: {
      minWidth: t.paginationItemSizeSM,
      height: t.paginationItemSizeSM,
      margin: 0,
      lineHeight: `${t.paginationItemSizeSM - 2}px`
    },
    [`&${e}-mini ${e}-item:not(${e}-item-active)`]: {
      backgroundColor: "transparent",
      borderColor: "transparent",
      "&:hover": {
        backgroundColor: t.colorBgTextHover
      },
      "&:active": {
        backgroundColor: t.colorBgTextActive
      }
    },
    [`&${e}-mini ${e}-prev, &${e}-mini ${e}-next`]: {
      minWidth: t.paginationItemSizeSM,
      height: t.paginationItemSizeSM,
      margin: 0,
      lineHeight: `${t.paginationItemSizeSM}px`,
      [`&:hover ${e}-item-link`]: {
        backgroundColor: t.colorBgTextHover
      },
      [`&:active ${e}-item-link`]: {
        backgroundColor: t.colorBgTextActive
      },
      [`&${e}-disabled:hover ${e}-item-link`]: {
        backgroundColor: "transparent"
      }
    },
    [`
    &${e}-mini ${e}-prev ${e}-item-link,
    &${e}-mini ${e}-next ${e}-item-link
    `]: {
      backgroundColor: "transparent",
      borderColor: "transparent",
      "&::after": {
        height: t.paginationItemSizeSM,
        lineHeight: `${t.paginationItemSizeSM}px`
      }
    },
    [`&${e}-mini ${e}-jump-prev, &${e}-mini ${e}-jump-next`]: {
      height: t.paginationItemSizeSM,
      marginInlineEnd: 0,
      lineHeight: `${t.paginationItemSizeSM}px`
    },
    [`&${e}-mini ${e}-options`]: {
      marginInlineStart: t.paginationMiniOptionsMarginInlineStart,
      "&-size-changer": {
        top: t.paginationMiniOptionsSizeChangerTop
      },
      "&-quick-jumper": {
        height: t.paginationItemSizeSM,
        lineHeight: `${t.paginationItemSizeSM}px`,
        input: k(k({}, p$(t)), {
          width: t.paginationMiniQuickJumperInputWidth,
          height: t.controlHeightSM
        })
      }
    }
  };
}, tse = (t) => {
  const {
    componentCls: e
  } = t;
  return {
    [`
    &${e}-simple ${e}-prev,
    &${e}-simple ${e}-next
    `]: {
      height: t.paginationItemSizeSM,
      lineHeight: `${t.paginationItemSizeSM}px`,
      verticalAlign: "top",
      [`${e}-item-link`]: {
        height: t.paginationItemSizeSM,
        backgroundColor: "transparent",
        border: 0,
        "&:hover": {
          backgroundColor: t.colorBgTextHover
        },
        "&:active": {
          backgroundColor: t.colorBgTextActive
        },
        "&::after": {
          height: t.paginationItemSizeSM,
          lineHeight: `${t.paginationItemSizeSM}px`
        }
      }
    },
    [`&${e}-simple ${e}-simple-pager`]: {
      display: "inline-block",
      height: t.paginationItemSizeSM,
      marginInlineEnd: t.marginXS,
      input: {
        boxSizing: "border-box",
        height: "100%",
        marginInlineEnd: t.marginXS,
        padding: `0 ${t.paginationItemPaddingInline}px`,
        textAlign: "center",
        backgroundColor: t.paginationItemInputBg,
        border: `${t.lineWidth}px ${t.lineType} ${t.colorBorder}`,
        borderRadius: t.borderRadius,
        outline: "none",
        transition: `border-color ${t.motionDurationMid}`,
        color: "inherit",
        "&:hover": {
          borderColor: t.colorPrimary
        },
        "&:focus": {
          borderColor: t.colorPrimaryHover,
          boxShadow: `${t.inputOutlineOffset}px 0 ${t.controlOutlineWidth}px ${t.controlOutline}`
        },
        "&[disabled]": {
          color: t.colorTextDisabled,
          backgroundColor: t.colorBgContainerDisabled,
          borderColor: t.colorBorder,
          cursor: "not-allowed"
        }
      }
    }
  };
}, nse = (t) => {
  const {
    componentCls: e
  } = t;
  return {
    [`${e}-jump-prev, ${e}-jump-next`]: {
      outline: 0,
      [`${e}-item-container`]: {
        position: "relative",
        [`${e}-item-link-icon`]: {
          color: t.colorPrimary,
          fontSize: t.fontSizeSM,
          opacity: 0,
          transition: `all ${t.motionDurationMid}`,
          "&-svg": {
            top: 0,
            insetInlineEnd: 0,
            bottom: 0,
            insetInlineStart: 0,
            margin: "auto"
          }
        },
        [`${e}-item-ellipsis`]: {
          position: "absolute",
          top: 0,
          insetInlineEnd: 0,
          bottom: 0,
          insetInlineStart: 0,
          display: "block",
          margin: "auto",
          color: t.colorTextDisabled,
          fontFamily: "Arial, Helvetica, sans-serif",
          letterSpacing: t.paginationEllipsisLetterSpacing,
          textAlign: "center",
          textIndent: t.paginationEllipsisTextIndent,
          opacity: 1,
          transition: `all ${t.motionDurationMid}`
        }
      },
      "&:hover": {
        [`${e}-item-link-icon`]: {
          opacity: 1
        },
        [`${e}-item-ellipsis`]: {
          opacity: 0
        }
      },
      "&:focus-visible": k({
        [`${e}-item-link-icon`]: {
          opacity: 1
        },
        [`${e}-item-ellipsis`]: {
          opacity: 0
        }
      }, _s(t))
    },
    [`
    ${e}-prev,
    ${e}-jump-prev,
    ${e}-jump-next
    `]: {
      marginInlineEnd: t.marginXS
    },
    [`
    ${e}-prev,
    ${e}-next,
    ${e}-jump-prev,
    ${e}-jump-next
    `]: {
      display: "inline-block",
      minWidth: t.paginationItemSize,
      height: t.paginationItemSize,
      color: t.colorText,
      fontFamily: t.paginationFontFamily,
      lineHeight: `${t.paginationItemSize}px`,
      textAlign: "center",
      verticalAlign: "middle",
      listStyle: "none",
      borderRadius: t.borderRadius,
      cursor: "pointer",
      transition: `all ${t.motionDurationMid}`
    },
    [`${e}-prev, ${e}-next`]: {
      fontFamily: "Arial, Helvetica, sans-serif",
      outline: 0,
      button: {
        color: t.colorText,
        cursor: "pointer",
        userSelect: "none"
      },
      [`${e}-item-link`]: {
        display: "block",
        width: "100%",
        height: "100%",
        padding: 0,
        fontSize: t.fontSizeSM,
        textAlign: "center",
        backgroundColor: "transparent",
        border: `${t.lineWidth}px ${t.lineType} transparent`,
        borderRadius: t.borderRadius,
        outline: "none",
        transition: `all ${t.motionDurationMid}`
      },
      [`&:focus-visible ${e}-item-link`]: k({}, _s(t)),
      [`&:hover ${e}-item-link`]: {
        backgroundColor: t.colorBgTextHover
      },
      [`&:active ${e}-item-link`]: {
        backgroundColor: t.colorBgTextActive
      },
      [`&${e}-disabled:hover`]: {
        [`${e}-item-link`]: {
          backgroundColor: "transparent"
        }
      }
    },
    [`${e}-slash`]: {
      marginInlineEnd: t.paginationSlashMarginInlineEnd,
      marginInlineStart: t.paginationSlashMarginInlineStart
    },
    [`${e}-options`]: {
      display: "inline-block",
      marginInlineStart: t.margin,
      verticalAlign: "middle",
      "&-size-changer.-select": {
        display: "inline-block",
        width: "auto"
      },
      "&-quick-jumper": {
        display: "inline-block",
        height: t.controlHeight,
        marginInlineStart: t.marginXS,
        lineHeight: `${t.controlHeight}px`,
        verticalAlign: "top",
        input: k(k({}, dh(t)), {
          width: t.controlHeightLG * 1.25,
          height: t.controlHeight,
          boxSizing: "border-box",
          margin: 0,
          marginInlineStart: t.marginXS,
          marginInlineEnd: t.marginXS
        })
      }
    }
  };
}, ise = (t) => {
  const {
    componentCls: e
  } = t;
  return {
    [`${e}-item`]: k(k({
      display: "inline-block",
      minWidth: t.paginationItemSize,
      height: t.paginationItemSize,
      marginInlineEnd: t.marginXS,
      fontFamily: t.paginationFontFamily,
      lineHeight: `${t.paginationItemSize - 2}px`,
      textAlign: "center",
      verticalAlign: "middle",
      listStyle: "none",
      backgroundColor: "transparent",
      border: `${t.lineWidth}px ${t.lineType} transparent`,
      borderRadius: t.borderRadius,
      outline: 0,
      cursor: "pointer",
      userSelect: "none",
      a: {
        display: "block",
        padding: `0 ${t.paginationItemPaddingInline}px`,
        color: t.colorText,
        transition: "none",
        "&:hover": {
          textDecoration: "none"
        }
      },
      [`&:not(${e}-item-active)`]: {
        "&:hover": {
          transition: `all ${t.motionDurationMid}`,
          backgroundColor: t.colorBgTextHover
        },
        "&:active": {
          backgroundColor: t.colorBgTextActive
        }
      }
    }, Au(t)), {
      "&-active": {
        fontWeight: t.paginationFontWeightActive,
        backgroundColor: t.paginationItemBgActive,
        borderColor: t.colorPrimary,
        a: {
          color: t.colorPrimary
        },
        "&:hover": {
          borderColor: t.colorPrimaryHover
        },
        "&:hover a": {
          color: t.colorPrimaryHover
        }
      }
    })
  };
}, ose = (t) => {
  const {
    componentCls: e
  } = t;
  return {
    [e]: k(k(k(k(k(k(k(k({}, kn(t)), {
      "ul, ol": {
        margin: 0,
        padding: 0,
        listStyle: "none"
      },
      "&::after": {
        display: "block",
        clear: "both",
        height: 0,
        overflow: "hidden",
        visibility: "hidden",
        content: '""'
      },
      [`${e}-total-text`]: {
        display: "inline-block",
        height: t.paginationItemSize,
        marginInlineEnd: t.marginXS,
        lineHeight: `${t.paginationItemSize - 2}px`,
        verticalAlign: "middle"
      }
    }), ise(t)), nse(t)), tse(t)), ese(t)), Jle(t)), {
      // media query style
      [`@media only screen and (max-width: ${t.screenLG}px)`]: {
        [`${e}-item`]: {
          "&-after-jump-prev, &-before-jump-next": {
            display: "none"
          }
        }
      },
      [`@media only screen and (max-width: ${t.screenSM}px)`]: {
        [`${e}-options`]: {
          display: "none"
        }
      }
    }),
    // rtl style
    [`&${t.componentCls}-rtl`]: {
      direction: "rtl"
    }
  };
}, rse = (t) => {
  const {
    componentCls: e
  } = t;
  return {
    [`${e}${e}-disabled`]: {
      "&, &:hover": {
        [`${e}-item-link`]: {
          borderColor: t.colorBorder
        }
      },
      "&:focus-visible": {
        [`${e}-item-link`]: {
          borderColor: t.colorBorder
        }
      },
      [`${e}-item, ${e}-item-link`]: {
        backgroundColor: t.colorBgContainerDisabled,
        borderColor: t.colorBorder,
        [`&:hover:not(${e}-item-active)`]: {
          backgroundColor: t.colorBgContainerDisabled,
          borderColor: t.colorBorder,
          a: {
            color: t.colorTextDisabled
          }
        },
        [`&${e}-item-active`]: {
          backgroundColor: t.paginationItemDisabledBgActive
        }
      },
      [`${e}-prev, ${e}-next`]: {
        "&:hover button": {
          backgroundColor: t.colorBgContainerDisabled,
          borderColor: t.colorBorder,
          color: t.colorTextDisabled
        },
        [`${e}-item-link`]: {
          backgroundColor: t.colorBgContainerDisabled,
          borderColor: t.colorBorder
        }
      }
    },
    [e]: {
      [`${e}-prev, ${e}-next`]: {
        "&:hover button": {
          borderColor: t.colorPrimaryHover,
          backgroundColor: t.paginationItemBg
        },
        [`${e}-item-link`]: {
          backgroundColor: t.paginationItemLinkBg,
          borderColor: t.colorBorder
        },
        [`&:hover ${e}-item-link`]: {
          borderColor: t.colorPrimary,
          backgroundColor: t.paginationItemBg,
          color: t.colorPrimary
        },
        [`&${e}-disabled`]: {
          [`${e}-item-link`]: {
            borderColor: t.colorBorder,
            color: t.colorTextDisabled
          }
        }
      },
      [`${e}-item`]: {
        backgroundColor: t.paginationItemBg,
        border: `${t.lineWidth}px ${t.lineType} ${t.colorBorder}`,
        [`&:hover:not(${e}-item-active)`]: {
          borderColor: t.colorPrimary,
          backgroundColor: t.paginationItemBg,
          a: {
            color: t.colorPrimary
          }
        },
        "&-active": {
          borderColor: t.colorPrimary
        }
      }
    }
  };
}, ase = Vn("Pagination", (t) => {
  const e = dn(t, {
    paginationItemSize: t.controlHeight,
    paginationFontFamily: t.fontFamily,
    paginationItemBg: t.colorBgContainer,
    paginationItemBgActive: t.colorBgContainer,
    paginationFontWeightActive: t.fontWeightStrong,
    paginationItemSizeSM: t.controlHeightSM,
    paginationItemInputBg: t.colorBgContainer,
    paginationMiniOptionsSizeChangerTop: 0,
    paginationItemDisabledBgActive: t.controlItemBgActiveDisabled,
    paginationItemDisabledColorActive: t.colorTextDisabled,
    paginationItemLinkBg: t.colorBgContainer,
    inputOutlineOffset: "0 0",
    paginationMiniOptionsMarginInlineStart: t.marginXXS / 2,
    paginationMiniQuickJumperInputWidth: t.controlHeightLG * 1.1,
    paginationItemPaddingInline: t.marginXXS * 1.5,
    paginationEllipsisLetterSpacing: t.marginXXS / 2,
    paginationSlashMarginInlineStart: t.marginXXS,
    paginationSlashMarginInlineEnd: t.marginSM,
    paginationEllipsisTextIndent: "0.13em"
    // magic for ui experience
  }, Py(t));
  return [ose(e), t.wireframe && rse(e)];
});
var lse = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
const sse = () => ({
  total: Number,
  defaultCurrent: Number,
  disabled: pt(),
  current: Number,
  defaultPageSize: Number,
  pageSize: Number,
  hideOnSinglePage: pt(),
  showSizeChanger: pt(),
  pageSizeOptions: ui(),
  buildOptionText: ot(),
  showQuickJumper: pn([Boolean, Object]),
  showTotal: ot(),
  size: yn(),
  simple: pt(),
  locale: Object,
  prefixCls: String,
  selectPrefixCls: String,
  totalBoundaryShowSizeChanger: Number,
  selectComponentClass: String,
  itemRender: ot(),
  role: String,
  responsive: Boolean,
  showLessItems: pt(),
  onChange: ot(),
  onShowSizeChange: ot(),
  "onUpdate:current": ot(),
  "onUpdate:pageSize": ot()
}), use = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "APagination",
  inheritAttrs: !1,
  props: sse(),
  // emits: ['change', 'showSizeChange', 'update:current', 'update:pageSize'],
  setup(t, e) {
    let {
      slots: n,
      attrs: i
    } = e;
    const {
      prefixCls: o,
      configProvider: r,
      direction: a,
      size: l
    } = Ht("pagination", t), [s, u] = ase(o), c = A(() => r.getPrefixCls("select", t.selectPrefixCls)), d = b3(), [f] = Bu("Pagination", QD, on(t, "locale")), h = (p) => {
      const g = v("span", {
        class: `${p}-item-ellipsis`
      }, [Ve("•••")]), m = v("button", {
        class: `${p}-item-link`,
        type: "button",
        tabindex: -1
      }, [a.value === "rtl" ? v(Yc, null, null) : v(o0, null, null)]), y = v("button", {
        class: `${p}-item-link`,
        type: "button",
        tabindex: -1
      }, [a.value === "rtl" ? v(o0, null, null) : v(Yc, null, null)]), b = v("a", {
        rel: "nofollow",
        class: `${p}-item-link`
      }, [v("div", {
        class: `${p}-item-container`
      }, [a.value === "rtl" ? v(s0, {
        class: `${p}-item-link-icon`
      }, null) : v(l0, {
        class: `${p}-item-link-icon`
      }, null), g])]), w = v("a", {
        rel: "nofollow",
        class: `${p}-item-link`
      }, [v("div", {
        class: `${p}-item-container`
      }, [a.value === "rtl" ? v(l0, {
        class: `${p}-item-link-icon`
      }, null) : v(s0, {
        class: `${p}-item-link-icon`
      }, null), g])]);
      return {
        prevIcon: m,
        nextIcon: y,
        jumpPrevIcon: b,
        jumpNextIcon: w
      };
    };
    return () => {
      var p;
      const {
        itemRender: g = n.itemRender,
        buildOptionText: m = n.buildOptionText,
        selectComponentClass: y,
        responsive: b
      } = t, w = lse(t, ["itemRender", "buildOptionText", "selectComponentClass", "responsive"]), $ = l.value === "small" || !!(!((p = d.value) === null || p === void 0) && p.xs && !l.value && b), C = k(k(k(k(k({}, w), h(o.value)), {
        prefixCls: o.value,
        selectPrefixCls: c.value,
        selectComponentClass: y || ($ ? jle : qle),
        locale: f.value,
        buildOptionText: m
      }), i), {
        class: Ae({
          [`${o.value}-mini`]: $,
          [`${o.value}-rtl`]: a.value === "rtl"
        }, i.class, u.value),
        itemRender: g
      });
      return s(v(Ule, C, null));
    };
  }
}), cse = ya(use);
var dse = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
let eS;
const fse = (t) => {
  eS = {
    x: t.pageX,
    y: t.pageY
  }, setTimeout(() => eS = null, 100);
};
Y5() && So(document.documentElement, "click", fse, !0);
const hse = () => ({
  prefixCls: String,
  /** @deprecated Please use `open` instead. */
  visible: {
    type: Boolean,
    default: void 0
  },
  open: {
    type: Boolean,
    default: void 0
  },
  confirmLoading: {
    type: Boolean,
    default: void 0
  },
  title: ve.any,
  closable: {
    type: Boolean,
    default: void 0
  },
  closeIcon: ve.any,
  onOk: Function,
  onCancel: Function,
  "onUpdate:visible": Function,
  "onUpdate:open": Function,
  onChange: Function,
  afterClose: Function,
  centered: {
    type: Boolean,
    default: void 0
  },
  width: [String, Number],
  footer: ve.any,
  okText: ve.any,
  okType: String,
  cancelText: ve.any,
  icon: ve.any,
  maskClosable: {
    type: Boolean,
    default: void 0
  },
  forceRender: {
    type: Boolean,
    default: void 0
  },
  okButtonProps: Vt(),
  cancelButtonProps: Vt(),
  destroyOnClose: {
    type: Boolean,
    default: void 0
  },
  wrapClassName: String,
  maskTransitionName: String,
  transitionName: String,
  getContainer: {
    type: [String, Function, Boolean, Object],
    default: void 0
  },
  zIndex: Number,
  bodyStyle: Vt(),
  maskStyle: Vt(),
  mask: {
    type: Boolean,
    default: void 0
  },
  keyboard: {
    type: Boolean,
    default: void 0
  },
  wrapProps: Object,
  focusTriggerAfterClose: {
    type: Boolean,
    default: void 0
  },
  modalRender: Function,
  mousePosition: Vt()
}), No = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "AModal",
  inheritAttrs: !1,
  props: Kn(hse(), {
    width: 520,
    confirmLoading: !1,
    okType: "primary"
  }),
  setup(t, e) {
    let {
      emit: n,
      slots: i,
      attrs: o
    } = e;
    const [r] = Bu("Modal"), {
      prefixCls: a,
      rootPrefixCls: l,
      direction: s,
      getPopupContainer: u
    } = Ht("modal", t), [c, d] = mle(a);
    eo(t.visible === void 0, "Modal", "`visible` will be removed in next major version, please use `open` instead.");
    const f = (g) => {
      n("update:visible", !1), n("update:open", !1), n("cancel", g), n("change", !1);
    }, h = (g) => {
      n("ok", g);
    }, p = () => {
      var g, m;
      const {
        okText: y = (g = i.okText) === null || g === void 0 ? void 0 : g.call(i),
        okType: b,
        cancelText: w = (m = i.cancelText) === null || m === void 0 ? void 0 : m.call(i),
        confirmLoading: $
      } = t;
      return v(tt, null, [v(en, J({
        onClick: f
      }, t.cancelButtonProps), {
        default: () => [w || r.value.cancelText]
      }), v(en, J(J({}, _3(b)), {}, {
        loading: $,
        onClick: h
      }, t.okButtonProps), {
        default: () => [y || r.value.okText]
      })]);
    };
    return () => {
      var g, m;
      const {
        prefixCls: y,
        visible: b,
        open: w,
        wrapClassName: $,
        centered: C,
        getContainer: P,
        closeIcon: O = (g = i.closeIcon) === null || g === void 0 ? void 0 : g.call(i),
        focusTriggerAfterClose: E = !0
      } = t, _ = dse(t, ["prefixCls", "visible", "open", "wrapClassName", "centered", "getContainer", "closeIcon", "focusTriggerAfterClose"]), D = Ae($, {
        [`${a.value}-centered`]: !!C,
        [`${a.value}-wrap-rtl`]: s.value === "rtl"
      });
      return c(v(cle, J(J(J({}, _), o), {}, {
        rootClassName: d.value,
        class: Ae(d.value, o.class),
        getContainer: P || u?.value,
        prefixCls: a.value,
        wrapClassName: D,
        visible: w ?? b,
        onClose: f,
        focusTriggerAfterClose: E,
        transitionName: Is(l.value, "zoom", t.transitionName),
        maskTransitionName: Is(l.value, "fade", t.maskTransitionName),
        mousePosition: (m = _.mousePosition) !== null && m !== void 0 ? m : eS
      }), k(k({}, i), {
        footer: i.footer || p,
        closeIcon: () => v("span", {
          class: `${a.value}-close-x`
        }, [O || v(Ll, {
          class: `${a.value}-close-icon`
        }, null)])
      })));
    };
  }
}), pse = () => {
  const t = Te(!1);
  return tn(() => {
    t.value = !0;
  }), t;
}, gse = {
  type: {
    type: String
  },
  actionFn: Function,
  close: Function,
  autofocus: Boolean,
  prefixCls: String,
  buttonProps: Vt(),
  emitEvent: Boolean,
  quitOnNullishReturnValue: Boolean
};
function u_(t) {
  return !!(t && t.then);
}
const c_ = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ActionButton",
  props: gse,
  setup(t, e) {
    let {
      slots: n
    } = e;
    const i = Te(!1), o = Te(), r = Te(!1);
    let a;
    const l = pse();
    Lt(() => {
      t.autofocus && (a = setTimeout(() => {
        var d, f;
        return (f = (d = wl(o.value)) === null || d === void 0 ? void 0 : d.focus) === null || f === void 0 ? void 0 : f.call(d);
      }));
    }), tn(() => {
      clearTimeout(a);
    });
    const s = function() {
      for (var d, f = arguments.length, h = new Array(f), p = 0; p < f; p++)
        h[p] = arguments[p];
      (d = t.close) === null || d === void 0 || d.call(t, ...h);
    }, u = (d) => {
      u_(d) && (r.value = !0, d.then(function() {
        l.value || (r.value = !1), s(...arguments), i.value = !1;
      }, (f) => (l.value || (r.value = !1), i.value = !1, Promise.reject(f))));
    }, c = (d) => {
      const {
        actionFn: f
      } = t;
      if (i.value)
        return;
      if (i.value = !0, !f) {
        s();
        return;
      }
      let h;
      if (t.emitEvent) {
        if (h = f(d), t.quitOnNullishReturnValue && !u_(h)) {
          i.value = !1, s(d);
          return;
        }
      } else if (f.length)
        h = f(t.close), i.value = !1;
      else if (h = f(), !h) {
        s();
        return;
      }
      u(h);
    };
    return () => {
      const {
        type: d,
        prefixCls: f,
        buttonProps: h
      } = t;
      return v(en, J(J(J({}, _3(d)), {}, {
        onClick: c,
        loading: r.value,
        prefixCls: f
      }, h), {}, {
        ref: o
      }), n);
    };
  }
});
function Md(t) {
  return typeof t == "function" ? t() : t;
}
const YL = Oe({
  name: "ConfirmDialog",
  inheritAttrs: !1,
  props: ["icon", "onCancel", "onOk", "close", "closable", "zIndex", "afterClose", "visible", "open", "keyboard", "centered", "getContainer", "maskStyle", "okButtonProps", "cancelButtonProps", "okType", "prefixCls", "okCancel", "width", "mask", "maskClosable", "okText", "cancelText", "autoFocusButton", "transitionName", "maskTransitionName", "type", "title", "content", "direction", "rootPrefixCls", "bodyStyle", "closeIcon", "modalRender", "focusTriggerAfterClose", "wrapClassName", "confirmPrefixCls", "footer"],
  setup(t, e) {
    let {
      attrs: n
    } = e;
    const [i] = Bu("Modal");
    return process.env.NODE_ENV !== "production" && eo(t.visible === void 0, "Modal", "`visible` is deprecated, please use `open` instead."), () => {
      const {
        icon: o,
        onCancel: r,
        onOk: a,
        close: l,
        okText: s,
        closable: u = !1,
        zIndex: c,
        afterClose: d,
        keyboard: f,
        centered: h,
        getContainer: p,
        maskStyle: g,
        okButtonProps: m,
        cancelButtonProps: y,
        okCancel: b,
        width: w = 416,
        mask: $ = !0,
        maskClosable: C = !1,
        type: P,
        open: O,
        title: E,
        content: _,
        direction: D,
        closeIcon: M,
        modalRender: N,
        focusTriggerAfterClose: L,
        rootPrefixCls: j,
        bodyStyle: B,
        wrapClassName: Y,
        footer: Q
      } = t;
      let G = o;
      if (!o && o !== null)
        switch (P) {
          case "info":
            G = v(ld, null, null);
            break;
          case "success":
            G = v(Vu, null, null);
            break;
          case "error":
            G = v(Wr, null, null);
            break;
          default:
            G = v(Qu, null, null);
        }
      const V = t.okType || "primary", H = t.prefixCls || "ant-modal", q = `${H}-confirm`, K = n.style || {}, ee = b ?? P === "confirm", ie = t.autoFocusButton === null ? !1 : t.autoFocusButton || "ok", ae = `${H}-confirm`, te = Ae(ae, `${ae}-${t.type}`, {
        [`${ae}-rtl`]: D === "rtl"
      }, n.class), U = i.value, me = ee && v(c_, {
        actionFn: r,
        close: l,
        autofocus: ie === "cancel",
        buttonProps: y,
        prefixCls: `${j}-btn`
      }, {
        default: () => [Md(t.cancelText) || U.cancelText]
      });
      return v(No, {
        prefixCls: H,
        class: te,
        wrapClassName: Ae({
          [`${ae}-centered`]: !!h
        }, Y),
        onCancel: (ce) => l?.({
          triggerCancel: !0
        }, ce),
        open: O,
        title: "",
        footer: "",
        transitionName: Is(j, "zoom", t.transitionName),
        maskTransitionName: Is(j, "fade", t.maskTransitionName),
        mask: $,
        maskClosable: C,
        maskStyle: g,
        style: K,
        bodyStyle: B,
        width: w,
        zIndex: c,
        afterClose: d,
        keyboard: f,
        centered: h,
        getContainer: p,
        closable: u,
        closeIcon: M,
        modalRender: N,
        focusTriggerAfterClose: L
      }, {
        default: () => [v("div", {
          class: `${q}-body-wrapper`
        }, [v("div", {
          class: `${q}-body`
        }, [Md(G), E === void 0 ? null : v("span", {
          class: `${q}-title`
        }, [Md(E)]), v("div", {
          class: `${q}-content`
        }, [Md(_)])]), Q !== void 0 ? Md(Q) : v("div", {
          class: `${q}-btns`
        }, [me, v(c_, {
          type: V,
          actionFn: a,
          close: l,
          autofocus: ie === "ok",
          buttonProps: m,
          prefixCls: `${j}-btn`
        }, {
          default: () => [Md(s) || (ee ? U.okText : U.justOkText)]
        })])])]
      });
    };
  }
}), Tc = [], Cg = (t) => {
  const e = document.createDocumentFragment();
  let n = k(k({}, ii(t, ["parentContext", "appContext"])), {
    close: r,
    open: !0
  }), i = null;
  function o() {
    i && (_u(null, e), i = null);
    for (var u = arguments.length, c = new Array(u), d = 0; d < u; d++)
      c[d] = arguments[d];
    const f = c.some((h) => h && h.triggerCancel);
    t.onCancel && f && t.onCancel(() => {
    }, ...c.slice(1));
    for (let h = 0; h < Tc.length; h++)
      if (Tc[h] === r) {
        Tc.splice(h, 1);
        break;
      }
  }
  function r() {
    for (var u = arguments.length, c = new Array(u), d = 0; d < u; d++)
      c[d] = arguments[d];
    n = k(k({}, n), {
      open: !1,
      afterClose: () => {
        typeof t.afterClose == "function" && t.afterClose(), o.apply(this, c);
      }
    }), n.visible && delete n.visible, a(n);
  }
  function a(u) {
    typeof u == "function" ? n = u(n) : n = k(k({}, n), u), i && EX(i, n, e);
  }
  const l = (u) => {
    const c = Eo, d = c.prefixCls, f = u.prefixCls || `${d}-modal`, h = c.iconPrefixCls, p = Xoe();
    return v(xs, J(J({}, c), {}, {
      prefixCls: d
    }), {
      default: () => [v(YL, J(J({}, u), {}, {
        rootPrefixCls: d,
        prefixCls: f,
        iconPrefixCls: h,
        locale: p,
        cancelText: u.cancelText || p.cancelText
      }), null)]
    });
  };
  function s(u) {
    const c = v(l, k({}, u));
    return c.appContext = t.parentContext || t.appContext || c.appContext, _u(c, e), c;
  }
  return i = s(n), Tc.push(r), {
    destroy: r,
    update: a
  };
};
function KL(t) {
  return k(k({}, t), {
    type: "warning"
  });
}
function XL(t) {
  return k(k({}, t), {
    type: "info"
  });
}
function ZL(t) {
  return k(k({}, t), {
    type: "success"
  });
}
function GL(t) {
  return k(k({}, t), {
    type: "error"
  });
}
function UL(t) {
  return k(k({}, t), {
    type: "confirm"
  });
}
const mse = () => ({
  config: Object,
  afterClose: Function,
  destroyAction: Function,
  open: Boolean
}), vse = Oe({
  name: "HookModal",
  inheritAttrs: !1,
  props: Kn(mse(), {
    config: {
      width: 520,
      okType: "primary"
    }
  }),
  setup(t, e) {
    let {
      expose: n
    } = e;
    var i;
    const o = A(() => t.open), r = A(() => t.config), {
      direction: a,
      getPrefixCls: l
    } = oy(), s = l("modal"), u = l(), c = () => {
      var p, g;
      t?.afterClose(), (g = (p = r.value).afterClose) === null || g === void 0 || g.call(p);
    }, d = function() {
      t.destroyAction(...arguments);
    };
    n({
      destroy: d
    });
    const f = (i = r.value.okCancel) !== null && i !== void 0 ? i : r.value.type === "confirm", [h] = Bu("Modal", ks.Modal);
    return () => v(YL, J(J({
      prefixCls: s,
      rootPrefixCls: u
    }, r.value), {}, {
      close: d,
      open: o.value,
      afterClose: c,
      okText: r.value.okText || (f ? h?.value.okText : h?.value.justOkText),
      direction: r.value.direction || a.value,
      cancelText: r.value.cancelText || h?.value.cancelText
    }), null);
  }
});
let d_ = 0;
const yse = Oe({
  name: "ElementsHolder",
  inheritAttrs: !1,
  setup(t, e) {
    let {
      expose: n
    } = e;
    const i = Te([]);
    return n({
      addModal: (r) => (i.value.push(r), i.value = i.value.slice(), () => {
        i.value = i.value.filter((a) => a !== r);
      })
    }), () => i.value.map((r) => r());
  }
});
function JL() {
  const t = Te(null), e = Te([]);
  _e(e, () => {
    e.value.length && ([...e.value].forEach((a) => {
      a();
    }), e.value = []);
  }, {
    immediate: !0
  });
  const n = (r) => function(l) {
    var s;
    d_ += 1;
    const u = Te(!0), c = Te(null), d = Te(I(l)), f = Te({});
    _e(() => l, (w) => {
      m(k(k({}, wA(w) ? w.value : w), f.value));
    });
    const h = function() {
      u.value = !1;
      for (var w = arguments.length, $ = new Array(w), C = 0; C < w; C++)
        $[C] = arguments[C];
      const P = $.some((O) => O && O.triggerCancel);
      d.value.onCancel && P && d.value.onCancel(() => {
      }, ...$.slice(1));
    };
    let p;
    const g = () => v(vse, {
      key: `modal-${d_}`,
      config: r(d.value),
      ref: c,
      open: u.value,
      destroyAction: h,
      afterClose: () => {
        p?.();
      }
    }, null);
    p = (s = t.value) === null || s === void 0 ? void 0 : s.addModal(g), p && Tc.push(p);
    const m = (w) => {
      d.value = k(k({}, d.value), w);
    };
    return {
      destroy: () => {
        c.value ? h() : e.value = [...e.value, h];
      },
      update: (w) => {
        f.value = w, c.value ? m(w) : e.value = [...e.value, () => m(w)];
      }
    };
  }, i = A(() => ({
    info: n(XL),
    success: n(ZL),
    error: n(GL),
    warning: n(KL),
    confirm: n(UL)
  })), o = Symbol("modalHolderKey");
  return [i.value, () => v(yse, {
    key: o,
    ref: t
  }, null)];
}
function ez(t) {
  return Cg(KL(t));
}
No.useModal = JL;
No.info = function(e) {
  return Cg(XL(e));
};
No.success = function(e) {
  return Cg(ZL(e));
};
No.error = function(e) {
  return Cg(GL(e));
};
No.warning = ez;
No.warn = ez;
No.confirm = function(e) {
  return Cg(UL(e));
};
No.destroyAll = function() {
  for (; Tc.length; ) {
    const e = Tc.pop();
    e && e();
  }
};
No.install = function(t) {
  return t.component(No.name, No), t;
};
const bse = {
  small: 8,
  middle: 16,
  large: 24
}, xse = () => ({
  prefixCls: String,
  size: {
    type: [String, Number, Array]
  },
  direction: ve.oneOf(ja("horizontal", "vertical")).def("horizontal"),
  align: ve.oneOf(ja("start", "end", "center", "baseline")),
  wrap: pt()
});
function Ose(t) {
  return typeof t == "string" ? bse[t] : t || 0;
}
const Pl = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ASpace",
  inheritAttrs: !1,
  props: xse(),
  slots: Object,
  setup(t, e) {
    let {
      slots: n,
      attrs: i
    } = e;
    const {
      prefixCls: o,
      space: r,
      direction: a
    } = Ht("space", t), [l, s] = m3(o), u = X5(), c = A(() => {
      var y, b, w;
      return (w = (y = t.size) !== null && y !== void 0 ? y : (b = r?.value) === null || b === void 0 ? void 0 : b.size) !== null && w !== void 0 ? w : "small";
    }), d = de(), f = de();
    _e(c, () => {
      [d.value, f.value] = (Array.isArray(c.value) ? c.value : [c.value, c.value]).map((y) => Ose(y));
    }, {
      immediate: !0
    });
    const h = A(() => t.align === void 0 && t.direction === "horizontal" ? "center" : t.align), p = A(() => Ae(o.value, s.value, `${o.value}-${t.direction}`, {
      [`${o.value}-rtl`]: a.value === "rtl",
      [`${o.value}-align-${h.value}`]: h.value
    })), g = A(() => a.value === "rtl" ? "marginLeft" : "marginRight"), m = A(() => {
      const y = {};
      return u.value && (y.columnGap = `${d.value}px`, y.rowGap = `${f.value}px`), k(k({}, y), t.wrap && {
        flexWrap: "wrap",
        marginBottom: `${-f.value}px`
      });
    });
    return () => {
      var y, b;
      const {
        wrap: w,
        direction: $ = "horizontal"
      } = t, C = (y = n.default) === null || y === void 0 ? void 0 : y.call(n), P = ho(C), O = P.length;
      if (O === 0)
        return null;
      const E = (b = n.split) === null || b === void 0 ? void 0 : b.call(n), _ = `${o.value}-item`, D = d.value, M = O - 1;
      return v("div", J(J({}, i), {}, {
        class: [p.value, i.class],
        style: [m.value, i.style]
      }), [P.map((N, L) => {
        let j = C.indexOf(N);
        j === -1 && (j = `$$space-${L}`);
        let B = {};
        return u.value || ($ === "vertical" ? L < M && (B = {
          marginBottom: `${D / (E ? 2 : 1)}px`
        }) : B = k(k({}, L < M && {
          [g.value]: `${D / (E ? 2 : 1)}px`
        }), w && {
          paddingBottom: `${f.value}px`
        })), l(v(tt, {
          key: j
        }, [v("div", {
          class: _,
          style: B
        }, [N]), L < M && E && v("span", {
          class: `${_}-split`,
          style: B
        }, [E])]));
      })]);
    };
  }
});
Pl.Compact = vO;
Pl.install = function(t) {
  return t.component(Pl.name, Pl), t.component(vO.name, vO), t;
};
const Sse = ya(G5), z$ = (t, e) => {
  let {
    attrs: n
  } = e;
  const {
    included: i,
    vertical: o,
    style: r,
    class: a
  } = n;
  let {
    length: l,
    offset: s,
    reverse: u
  } = n;
  l < 0 && (u = !u, l = Math.abs(l), s = 100 - s);
  const c = o ? {
    [u ? "top" : "bottom"]: `${s}%`,
    [u ? "bottom" : "top"]: "auto",
    height: `${l}%`
  } : {
    [u ? "right" : "left"]: `${s}%`,
    [u ? "left" : "right"]: "auto",
    width: `${l}%`
  }, d = k(k({}, r), c);
  return i ? v("div", {
    class: a,
    style: d
  }, null) : null;
};
z$.inheritAttrs = !1;
const wse = (t, e, n, i, o, r) => {
  eo(n ? i > 0 : !0, "Slider", "`Slider[step]` should be a positive number in order to make Slider[dots] work.");
  const a = Object.keys(e).map(parseFloat).sort((l, s) => l - s);
  if (n && i)
    for (let l = o; l <= r; l += i)
      a.indexOf(l) === -1 && a.push(l);
  return a;
}, tz = (t, e) => {
  let {
    attrs: n
  } = e;
  const {
    prefixCls: i,
    vertical: o,
    reverse: r,
    marks: a,
    dots: l,
    step: s,
    included: u,
    lowerBound: c,
    upperBound: d,
    max: f,
    min: h,
    dotStyle: p,
    activeDotStyle: g
  } = n, m = f - h, y = wse(o, a, l, s, h, f).map((b) => {
    const w = `${Math.abs(b - h) / m * 100}%`, $ = !u && b === d || u && b <= d && b >= c;
    let C = o ? k(k({}, p), {
      [r ? "top" : "bottom"]: w
    }) : k(k({}, p), {
      [r ? "right" : "left"]: w
    });
    $ && (C = k(k({}, C), g));
    const P = Ae({
      [`${i}-dot`]: !0,
      [`${i}-dot-active`]: $,
      [`${i}-dot-reverse`]: r
    });
    return v("span", {
      class: P,
      style: C,
      key: b
    }, null);
  });
  return v("div", {
    class: `${i}-step`
  }, [y]);
};
tz.inheritAttrs = !1;
const nz = (t, e) => {
  let {
    attrs: n,
    slots: i
  } = e;
  const {
    class: o,
    vertical: r,
    reverse: a,
    marks: l,
    included: s,
    upperBound: u,
    lowerBound: c,
    max: d,
    min: f,
    onClickLabel: h
  } = n, p = Object.keys(l), g = i.mark, m = d - f, y = p.map(parseFloat).sort((b, w) => b - w).map((b) => {
    const w = typeof l[b] == "function" ? l[b]() : l[b], $ = typeof w == "object" && !po(w);
    let C = $ ? w.label : w;
    if (!C && C !== 0)
      return null;
    g && (C = g({
      point: b,
      label: C
    }));
    const P = !s && b === u || s && b <= u && b >= c, O = Ae({
      [`${o}-text`]: !0,
      [`${o}-text-active`]: P
    }), E = {
      marginBottom: "-50%",
      [a ? "top" : "bottom"]: `${(b - f) / m * 100}%`
    }, _ = {
      transform: `translateX(${a ? "50%" : "-50%"})`,
      msTransform: `translateX(${a ? "50%" : "-50%"})`,
      [a ? "right" : "left"]: `${(b - f) / m * 100}%`
    }, D = r ? E : _, M = $ ? k(k({}, D), w.style) : D, N = {
      [xo ? "onTouchstartPassive" : "onTouchstart"]: (L) => h(L, b)
    };
    return v("span", J({
      class: O,
      style: M,
      key: b,
      onMousedown: (L) => h(L, b)
    }, N), [C]);
  });
  return v("div", {
    class: o
  }, [y]);
};
nz.inheritAttrs = !1;
const iz = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "Handle",
  inheritAttrs: !1,
  props: {
    prefixCls: String,
    vertical: {
      type: Boolean,
      default: void 0
    },
    offset: Number,
    disabled: {
      type: Boolean,
      default: void 0
    },
    min: Number,
    max: Number,
    value: Number,
    tabindex: ve.oneOfType([ve.number, ve.string]),
    reverse: {
      type: Boolean,
      default: void 0
    },
    ariaLabel: String,
    ariaLabelledBy: String,
    ariaValueTextFormatter: Function,
    onMouseenter: {
      type: Function
    },
    onMouseleave: {
      type: Function
    },
    onMousedown: {
      type: Function
    }
  },
  setup(t, e) {
    let {
      attrs: n,
      emit: i,
      expose: o
    } = e;
    const r = Te(!1), a = Te(), l = () => {
      document.activeElement === a.value && (r.value = !0);
    }, s = (m) => {
      r.value = !1, i("blur", m);
    }, u = () => {
      r.value = !1;
    }, c = () => {
      var m;
      (m = a.value) === null || m === void 0 || m.focus();
    }, d = () => {
      var m;
      (m = a.value) === null || m === void 0 || m.blur();
    }, f = () => {
      r.value = !0, c();
    }, h = (m) => {
      m.preventDefault(), c(), i("mousedown", m);
    };
    o({
      focus: c,
      blur: d,
      clickFocus: f,
      ref: a
    });
    let p = null;
    Lt(() => {
      p = So(document, "mouseup", l);
    }), tn(() => {
      p?.remove();
    });
    const g = A(() => {
      const {
        vertical: m,
        offset: y,
        reverse: b
      } = t;
      return m ? {
        [b ? "top" : "bottom"]: `${y}%`,
        [b ? "bottom" : "top"]: "auto",
        transform: b ? null : "translateY(+50%)"
      } : {
        [b ? "right" : "left"]: `${y}%`,
        [b ? "left" : "right"]: "auto",
        transform: `translateX(${b ? "+" : "-"}50%)`
      };
    });
    return () => {
      const {
        prefixCls: m,
        disabled: y,
        min: b,
        max: w,
        value: $,
        tabindex: C,
        ariaLabel: P,
        ariaLabelledBy: O,
        ariaValueTextFormatter: E,
        onMouseenter: _,
        onMouseleave: D
      } = t, M = Ae(n.class, {
        [`${m}-handle-click-focused`]: r.value
      }), N = {
        "aria-valuemin": b,
        "aria-valuemax": w,
        "aria-valuenow": $,
        "aria-disabled": !!y
      }, L = [n.style, g.value];
      let j = C || 0;
      (y || C === null) && (j = null);
      let B;
      E && (B = E($));
      const Y = k(k(k(k({}, n), {
        role: "slider",
        tabindex: j
      }), N), {
        class: M,
        onBlur: s,
        onKeydown: u,
        onMousedown: h,
        onMouseenter: _,
        onMouseleave: D,
        ref: a,
        style: L
      });
      return v("div", J(J({}, Y), {}, {
        "aria-label": P,
        "aria-labelledby": O,
        "aria-valuetext": B
      }), null);
    };
  }
});
function T1(t, e) {
  try {
    return Object.keys(e).some((n) => t.target === e[n].ref);
  } catch {
    return !1;
  }
}
function oz(t, e) {
  let {
    min: n,
    max: i
  } = e;
  return t < n || t > i;
}
function f_(t) {
  return t.touches.length > 1 || t.type.toLowerCase() === "touchend" && t.touches.length > 0;
}
function h_(t, e) {
  let {
    marks: n,
    step: i,
    min: o,
    max: r
  } = e;
  const a = Object.keys(n).map(parseFloat);
  if (i !== null) {
    const s = Math.pow(10, rz(i)), u = Math.floor((r * s - o * s) / (i * s)), c = Math.min((t - o) / i, u), d = Math.round(c) * i + o;
    a.push(d);
  }
  const l = a.map((s) => Math.abs(t - s));
  return a[l.indexOf(Math.min(...l))];
}
function rz(t) {
  const e = t.toString();
  let n = 0;
  return e.indexOf(".") >= 0 && (n = e.length - e.indexOf(".") - 1), n;
}
function p_(t, e) {
  let n = 1;
  return window.visualViewport && (n = +(window.visualViewport.width / document.body.getBoundingClientRect().width).toFixed(2)), (t ? e.clientY : e.pageX) / n;
}
function g_(t, e) {
  let n = 1;
  return window.visualViewport && (n = +(window.visualViewport.width / document.body.getBoundingClientRect().width).toFixed(2)), (t ? e.touches[0].clientY : e.touches[0].pageX) / n;
}
function m_(t, e) {
  const n = e.getBoundingClientRect();
  return t ? n.top + n.height * 0.5 : window.scrollX + n.left + n.width * 0.5;
}
function B$(t, e) {
  let {
    max: n,
    min: i
  } = e;
  return t <= i ? i : t >= n ? n : t;
}
function az(t, e) {
  const {
    step: n
  } = e, i = isFinite(h_(t, e)) ? h_(t, e) : 0;
  return n === null ? i : parseFloat(i.toFixed(rz(n)));
}
function Qf(t) {
  t.stopPropagation(), t.preventDefault();
}
function Cse(t, e, n) {
  const i = {
    increase: (a, l) => a + l,
    decrease: (a, l) => a - l
  }, o = i[t](Object.keys(n.marks).indexOf(JSON.stringify(e)), 1), r = Object.keys(n.marks)[o];
  return n.step ? i[t](e, n.step) : Object.keys(n.marks).length && n.marks[r] ? n.marks[r] : e;
}
function lz(t, e, n) {
  const i = "increase", o = "decrease";
  let r = i;
  switch (t.keyCode) {
    case lt.UP:
      r = e && n ? o : i;
      break;
    case lt.RIGHT:
      r = !e && n ? o : i;
      break;
    case lt.DOWN:
      r = e && n ? i : o;
      break;
    case lt.LEFT:
      r = !e && n ? i : o;
      break;
    case lt.END:
      return (a, l) => l.max;
    case lt.HOME:
      return (a, l) => l.min;
    case lt.PAGE_UP:
      return (a, l) => a + l.step * 2;
    case lt.PAGE_DOWN:
      return (a, l) => a - l.step * 2;
    default:
      return;
  }
  return (a, l) => Cse(r, a, l);
}
var $se = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
function rc() {
}
function sz(t) {
  const e = {
    id: String,
    min: Number,
    max: Number,
    step: Number,
    marks: ve.object,
    included: {
      type: Boolean,
      default: void 0
    },
    prefixCls: String,
    disabled: {
      type: Boolean,
      default: void 0
    },
    handle: Function,
    dots: {
      type: Boolean,
      default: void 0
    },
    vertical: {
      type: Boolean,
      default: void 0
    },
    reverse: {
      type: Boolean,
      default: void 0
    },
    minimumTrackStyle: ve.object,
    maximumTrackStyle: ve.object,
    handleStyle: ve.oneOfType([ve.object, ve.arrayOf(ve.object)]),
    trackStyle: ve.oneOfType([ve.object, ve.arrayOf(ve.object)]),
    railStyle: ve.object,
    dotStyle: ve.object,
    activeDotStyle: ve.object,
    autofocus: {
      type: Boolean,
      default: void 0
    },
    draggableTrack: {
      type: Boolean,
      default: void 0
    }
  };
  return Oe({
    compatConfig: {
      MODE: 3
    },
    name: "CreateSlider",
    mixins: [cg, t],
    inheritAttrs: !1,
    props: Kn(e, {
      prefixCls: "rc-slider",
      min: 0,
      max: 100,
      step: 1,
      marks: {},
      included: !0,
      disabled: !1,
      dots: !1,
      vertical: !1,
      reverse: !1,
      trackStyle: [{}],
      handleStyle: [{}],
      railStyle: {},
      dotStyle: {},
      activeDotStyle: {}
    }),
    emits: ["change", "blur", "focus"],
    data() {
      const {
        step: n,
        max: i,
        min: o
      } = this, r = isFinite(i - o) ? (i - o) % n === 0 : !0;
      return eo(n && Math.floor(n) === n ? r : !0, `Slider[max] - Slider[min] (${i - o}) should be a multiple of Slider[step] (${n})`), this.handlesRefs = {}, {};
    },
    mounted() {
      this.$nextTick(() => {
        this.document = this.sliderRef && this.sliderRef.ownerDocument;
        const {
          autofocus: n,
          disabled: i
        } = this;
        n && !i && this.focus();
      });
    },
    beforeUnmount() {
      this.$nextTick(() => {
        this.removeDocumentEvents();
      });
    },
    methods: {
      defaultHandle(n) {
        var {
          index: i,
          directives: o,
          className: r,
          style: a
        } = n, l = $se(n, ["index", "directives", "className", "style"]);
        if (delete l.dragging, l.value === null)
          return null;
        const s = k(k({}, l), {
          class: r,
          style: a,
          key: i
        });
        return v(iz, s, null);
      },
      onDown(n, i) {
        let o = i;
        const {
          draggableTrack: r,
          vertical: a
        } = this.$props, {
          bounds: l
        } = this.$data, s = r && this.positionGetValue ? this.positionGetValue(o) || [] : [], u = T1(n, this.handlesRefs);
        if (this.dragTrack = r && l.length >= 2 && !u && !s.map((c, d) => {
          const f = d ? !0 : c >= l[d];
          return d === s.length - 1 ? c <= l[d] : f;
        }).some((c) => !c), this.dragTrack)
          this.dragOffset = o, this.startBounds = [...l];
        else {
          if (!u)
            this.dragOffset = 0;
          else {
            const c = m_(a, n.target);
            this.dragOffset = o - c, o = c;
          }
          this.onStart(o);
        }
      },
      onMouseDown(n) {
        if (n.button !== 0)
          return;
        this.removeDocumentEvents();
        const i = this.$props.vertical, o = p_(i, n);
        this.onDown(n, o), this.addDocumentMouseEvents();
      },
      onTouchStart(n) {
        if (f_(n)) return;
        const i = this.vertical, o = g_(i, n);
        this.onDown(n, o), this.addDocumentTouchEvents(), Qf(n);
      },
      onFocus(n) {
        const {
          vertical: i
        } = this;
        if (T1(n, this.handlesRefs) && !this.dragTrack) {
          const o = m_(i, n.target);
          this.dragOffset = 0, this.onStart(o), Qf(n), this.$emit("focus", n);
        }
      },
      onBlur(n) {
        this.dragTrack || this.onEnd(), this.$emit("blur", n);
      },
      onMouseUp() {
        this.handlesRefs[this.prevMovedHandleIndex] && this.handlesRefs[this.prevMovedHandleIndex].clickFocus();
      },
      onMouseMove(n) {
        if (!this.sliderRef) {
          this.onEnd();
          return;
        }
        const i = p_(this.vertical, n);
        this.onMove(n, i - this.dragOffset, this.dragTrack, this.startBounds);
      },
      onTouchMove(n) {
        if (f_(n) || !this.sliderRef) {
          this.onEnd();
          return;
        }
        const i = g_(this.vertical, n);
        this.onMove(n, i - this.dragOffset, this.dragTrack, this.startBounds);
      },
      onKeyDown(n) {
        this.sliderRef && T1(n, this.handlesRefs) && this.onKeyboard(n);
      },
      onClickMarkLabel(n, i) {
        n.stopPropagation(), this.onChange({
          sValue: i
        }), this.setState({
          sValue: i
        }, () => this.onEnd(!0));
      },
      getSliderStart() {
        const n = this.sliderRef, {
          vertical: i,
          reverse: o
        } = this, r = n.getBoundingClientRect();
        return i ? o ? r.bottom : r.top : window.scrollX + (o ? r.right : r.left);
      },
      getSliderLength() {
        const n = this.sliderRef;
        if (!n)
          return 0;
        const i = n.getBoundingClientRect();
        return this.vertical ? i.height : i.width;
      },
      addDocumentTouchEvents() {
        this.onTouchMoveListener = So(this.document, "touchmove", this.onTouchMove), this.onTouchUpListener = So(this.document, "touchend", this.onEnd);
      },
      addDocumentMouseEvents() {
        this.onMouseMoveListener = So(this.document, "mousemove", this.onMouseMove), this.onMouseUpListener = So(this.document, "mouseup", this.onEnd);
      },
      removeDocumentEvents() {
        this.onTouchMoveListener && this.onTouchMoveListener.remove(), this.onTouchUpListener && this.onTouchUpListener.remove(), this.onMouseMoveListener && this.onMouseMoveListener.remove(), this.onMouseUpListener && this.onMouseUpListener.remove();
      },
      focus() {
        var n;
        this.$props.disabled || (n = this.handlesRefs[0]) === null || n === void 0 || n.focus();
      },
      blur() {
        this.$props.disabled || Object.keys(this.handlesRefs).forEach((n) => {
          var i, o;
          (o = (i = this.handlesRefs[n]) === null || i === void 0 ? void 0 : i.blur) === null || o === void 0 || o.call(i);
        });
      },
      calcValue(n) {
        const {
          vertical: i,
          min: o,
          max: r
        } = this, a = Math.abs(Math.max(n, 0) / this.getSliderLength());
        return i ? (1 - a) * (r - o) + o : a * (r - o) + o;
      },
      calcValueByPos(n) {
        const o = (this.reverse ? -1 : 1) * (n - this.getSliderStart());
        return this.trimAlignValue(this.calcValue(o));
      },
      calcOffset(n) {
        const {
          min: i,
          max: o
        } = this, r = (n - i) / (o - i);
        return Math.max(0, r * 100);
      },
      saveSlider(n) {
        this.sliderRef = n;
      },
      saveHandle(n, i) {
        this.handlesRefs[n] = i;
      }
    },
    render() {
      const {
        prefixCls: n,
        marks: i,
        dots: o,
        step: r,
        included: a,
        disabled: l,
        vertical: s,
        reverse: u,
        min: c,
        max: d,
        maximumTrackStyle: f,
        railStyle: h,
        dotStyle: p,
        activeDotStyle: g,
        id: m
      } = this, {
        class: y,
        style: b
      } = this.$attrs, {
        tracks: w,
        handles: $
      } = this.renderSlider(), C = Ae(n, y, {
        [`${n}-with-marks`]: Object.keys(i).length,
        [`${n}-disabled`]: l,
        [`${n}-vertical`]: s,
        [`${n}-horizontal`]: !s
      }), P = {
        vertical: s,
        marks: i,
        included: a,
        lowerBound: this.getLowerBound(),
        upperBound: this.getUpperBound(),
        max: d,
        min: c,
        reverse: u,
        class: `${n}-mark`,
        onClickLabel: l ? rc : this.onClickMarkLabel
      }, O = {
        [xo ? "onTouchstartPassive" : "onTouchstart"]: l ? rc : this.onTouchStart
      };
      return v("div", J(J({
        id: m,
        ref: this.saveSlider,
        tabindex: "-1",
        class: C
      }, O), {}, {
        onMousedown: l ? rc : this.onMouseDown,
        onMouseup: l ? rc : this.onMouseUp,
        onKeydown: l ? rc : this.onKeyDown,
        onFocus: l ? rc : this.onFocus,
        onBlur: l ? rc : this.onBlur,
        style: b
      }), [v("div", {
        class: `${n}-rail`,
        style: k(k({}, f), h)
      }, null), w, v(tz, {
        prefixCls: n,
        vertical: s,
        reverse: u,
        marks: i,
        dots: o,
        step: r,
        included: a,
        lowerBound: this.getLowerBound(),
        upperBound: this.getUpperBound(),
        max: d,
        min: c,
        dotStyle: p,
        activeDotStyle: g
      }, null), $, v(nz, P, {
        mark: this.$slots.mark
      }), AD(this)]);
    }
  });
}
const kse = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "Slider",
  mixins: [cg],
  inheritAttrs: !1,
  props: {
    defaultValue: Number,
    value: Number,
    disabled: {
      type: Boolean,
      default: void 0
    },
    autofocus: {
      type: Boolean,
      default: void 0
    },
    tabindex: ve.oneOfType([ve.number, ve.string]),
    reverse: {
      type: Boolean,
      default: void 0
    },
    min: Number,
    max: Number,
    ariaLabelForHandle: String,
    ariaLabelledByForHandle: String,
    ariaValueTextFormatterForHandle: String,
    startPoint: Number
  },
  emits: ["beforeChange", "afterChange", "change"],
  data() {
    const t = this.defaultValue !== void 0 ? this.defaultValue : this.min, e = this.value !== void 0 ? this.value : t;
    return {
      sValue: this.trimAlignValue(e),
      dragging: !1
    };
  },
  watch: {
    value: {
      handler(t) {
        this.setChangeValue(t);
      },
      deep: !0
    },
    min() {
      const {
        sValue: t
      } = this;
      this.setChangeValue(t);
    },
    max() {
      const {
        sValue: t
      } = this;
      this.setChangeValue(t);
    }
  },
  methods: {
    setChangeValue(t) {
      const e = t !== void 0 ? t : this.sValue, n = this.trimAlignValue(e, this.$props);
      n !== this.sValue && (this.setState({
        sValue: n
      }), oz(e, this.$props) && this.$emit("change", n));
    },
    onChange(t) {
      const e = !ls(this, "value"), n = t.sValue > this.max ? k(k({}, t), {
        sValue: this.max
      }) : t;
      e && this.setState(n);
      const i = n.sValue;
      this.$emit("change", i);
    },
    onStart(t) {
      this.setState({
        dragging: !0
      });
      const {
        sValue: e
      } = this;
      this.$emit("beforeChange", e);
      const n = this.calcValueByPos(t);
      this.startValue = n, this.startPosition = t, n !== e && (this.prevMovedHandleIndex = 0, this.onChange({
        sValue: n
      }));
    },
    onEnd(t) {
      const {
        dragging: e
      } = this;
      this.removeDocumentEvents(), (e || t) && this.$emit("afterChange", this.sValue), this.setState({
        dragging: !1
      });
    },
    onMove(t, e) {
      Qf(t);
      const {
        sValue: n
      } = this, i = this.calcValueByPos(e);
      i !== n && this.onChange({
        sValue: i
      });
    },
    onKeyboard(t) {
      const {
        reverse: e,
        vertical: n
      } = this.$props, i = lz(t, n, e);
      if (i) {
        Qf(t);
        const {
          sValue: o
        } = this, r = i(o, this.$props), a = this.trimAlignValue(r);
        if (a === o) return;
        this.onChange({
          sValue: a
        }), this.$emit("afterChange", a), this.onEnd();
      }
    },
    getLowerBound() {
      const t = this.$props.startPoint || this.$props.min;
      return this.$data.sValue > t ? t : this.$data.sValue;
    },
    getUpperBound() {
      return this.$data.sValue < this.$props.startPoint ? this.$props.startPoint : this.$data.sValue;
    },
    trimAlignValue(t) {
      let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
      if (t === null)
        return null;
      const n = k(k({}, this.$props), e), i = B$(t, n);
      return az(i, n);
    },
    getTrack(t) {
      let {
        prefixCls: e,
        reverse: n,
        vertical: i,
        included: o,
        minimumTrackStyle: r,
        mergedTrackStyle: a,
        length: l,
        offset: s
      } = t;
      return v(z$, {
        class: `${e}-track`,
        vertical: i,
        included: o,
        offset: s,
        reverse: n,
        length: l,
        style: k(k({}, r), a)
      }, null);
    },
    renderSlider() {
      const {
        prefixCls: t,
        vertical: e,
        included: n,
        disabled: i,
        minimumTrackStyle: o,
        trackStyle: r,
        handleStyle: a,
        tabindex: l,
        ariaLabelForHandle: s,
        ariaLabelledByForHandle: u,
        ariaValueTextFormatterForHandle: c,
        min: d,
        max: f,
        startPoint: h,
        reverse: p,
        handle: g,
        defaultHandle: m
      } = this, y = g || m, {
        sValue: b,
        dragging: w
      } = this, $ = this.calcOffset(b), C = y({
        class: `${t}-handle`,
        prefixCls: t,
        vertical: e,
        offset: $,
        value: b,
        dragging: w,
        disabled: i,
        min: d,
        max: f,
        reverse: p,
        index: 0,
        tabindex: l,
        ariaLabel: s,
        ariaLabelledBy: u,
        ariaValueTextFormatter: c,
        style: a[0] || a,
        ref: (E) => this.saveHandle(0, E),
        onFocus: this.onFocus,
        onBlur: this.onBlur
      }), P = h !== void 0 ? this.calcOffset(h) : 0, O = r[0] || r;
      return {
        tracks: this.getTrack({
          prefixCls: t,
          reverse: p,
          vertical: e,
          included: n,
          offset: P,
          minimumTrackStyle: o,
          mergedTrackStyle: O,
          length: $ - P
        }),
        handles: C
      };
    }
  }
}), Tse = sz(kse), Ah = (t) => {
  let {
    value: e,
    handle: n,
    bounds: i,
    props: o
  } = t;
  const {
    allowCross: r,
    pushable: a
  } = o, l = Number(a), s = B$(e, o);
  let u = s;
  return !r && n != null && i !== void 0 && (n > 0 && s <= i[n - 1] + l && (u = i[n - 1] + l), n < i.length - 1 && s >= i[n + 1] - l && (u = i[n + 1] - l)), az(u, o);
}, Pse = {
  defaultValue: ve.arrayOf(ve.number),
  value: ve.arrayOf(ve.number),
  count: Number,
  pushable: WK(ve.oneOfType([ve.looseBool, ve.number])),
  allowCross: {
    type: Boolean,
    default: void 0
  },
  disabled: {
    type: Boolean,
    default: void 0
  },
  reverse: {
    type: Boolean,
    default: void 0
  },
  tabindex: ve.arrayOf(ve.number),
  prefixCls: String,
  min: Number,
  max: Number,
  autofocus: {
    type: Boolean,
    default: void 0
  },
  ariaLabelGroupForHandles: Array,
  ariaLabelledByGroupForHandles: Array,
  ariaValueTextFormatterGroupForHandles: Array,
  draggableTrack: {
    type: Boolean,
    default: void 0
  }
}, Ese = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "Range",
  mixins: [cg],
  inheritAttrs: !1,
  props: Kn(Pse, {
    count: 1,
    allowCross: !0,
    pushable: !1,
    tabindex: [],
    draggableTrack: !1,
    ariaLabelGroupForHandles: [],
    ariaLabelledByGroupForHandles: [],
    ariaValueTextFormatterGroupForHandles: []
  }),
  emits: ["beforeChange", "afterChange", "change"],
  displayName: "Range",
  data() {
    const {
      count: t,
      min: e,
      max: n
    } = this, i = Array(...Array(t + 1)).map(() => e), o = ls(this, "defaultValue") ? this.defaultValue : i;
    let {
      value: r
    } = this;
    r === void 0 && (r = o);
    const a = r.map((s, u) => Ah({
      value: s,
      handle: u,
      props: this.$props
    }));
    return {
      sHandle: null,
      recent: a[0] === n ? 0 : a.length - 1,
      bounds: a
    };
  },
  watch: {
    value: {
      handler(t) {
        const {
          bounds: e
        } = this;
        this.setChangeValue(t || e);
      },
      deep: !0
    },
    min() {
      const {
        value: t
      } = this;
      this.setChangeValue(t || this.bounds);
    },
    max() {
      const {
        value: t
      } = this;
      this.setChangeValue(t || this.bounds);
    }
  },
  methods: {
    setChangeValue(t) {
      const {
        bounds: e
      } = this;
      let n = t.map((i, o) => Ah({
        value: i,
        handle: o,
        bounds: e,
        props: this.$props
      }));
      if (e.length === n.length) {
        if (n.every((i, o) => i === e[o]))
          return null;
      } else
        n = t.map((i, o) => Ah({
          value: i,
          handle: o,
          props: this.$props
        }));
      if (this.setState({
        bounds: n
      }), t.some((i) => oz(i, this.$props))) {
        const i = t.map((o) => B$(o, this.$props));
        this.$emit("change", i);
      }
    },
    onChange(t) {
      if (!ls(this, "value"))
        this.setState(t);
      else {
        const o = {};
        ["sHandle", "recent"].forEach((r) => {
          t[r] !== void 0 && (o[r] = t[r]);
        }), Object.keys(o).length && this.setState(o);
      }
      const i = k(k({}, this.$data), t).bounds;
      this.$emit("change", i);
    },
    positionGetValue(t) {
      const e = this.getValue(), n = this.calcValueByPos(t), i = this.getClosestBound(n), o = this.getBoundNeedMoving(n, i), r = e[o];
      if (n === r) return null;
      const a = [...e];
      return a[o] = n, a;
    },
    onStart(t) {
      const {
        bounds: e
      } = this;
      this.$emit("beforeChange", e);
      const n = this.calcValueByPos(t);
      this.startValue = n, this.startPosition = t;
      const i = this.getClosestBound(n);
      this.prevMovedHandleIndex = this.getBoundNeedMoving(n, i), this.setState({
        sHandle: this.prevMovedHandleIndex,
        recent: this.prevMovedHandleIndex
      });
      const o = e[this.prevMovedHandleIndex];
      if (n === o) return;
      const r = [...e];
      r[this.prevMovedHandleIndex] = n, this.onChange({
        bounds: r
      });
    },
    onEnd(t) {
      const {
        sHandle: e
      } = this;
      this.removeDocumentEvents(), e || (this.dragTrack = !1), (e !== null || t) && this.$emit("afterChange", this.bounds), this.setState({
        sHandle: null
      });
    },
    onMove(t, e, n, i) {
      Qf(t);
      const {
        $data: o,
        $props: r
      } = this, a = r.max || 100, l = r.min || 0;
      if (n) {
        let f = r.vertical ? -e : e;
        f = r.reverse ? -f : f;
        const h = a - Math.max(...i), p = l - Math.min(...i), g = Math.min(Math.max(f / (this.getSliderLength() / 100), p), h), m = i.map((y) => Math.floor(Math.max(Math.min(y + g, a), l)));
        o.bounds.map((y, b) => y === m[b]).some((y) => !y) && this.onChange({
          bounds: m
        });
        return;
      }
      const {
        bounds: s,
        sHandle: u
      } = this, c = this.calcValueByPos(e), d = s[u];
      c !== d && this.moveTo(c);
    },
    onKeyboard(t) {
      const {
        reverse: e,
        vertical: n
      } = this.$props, i = lz(t, n, e);
      if (i) {
        Qf(t);
        const {
          bounds: o,
          sHandle: r
        } = this, a = o[r === null ? this.recent : r], l = i(a, this.$props), s = Ah({
          value: l,
          handle: r,
          bounds: o,
          props: this.$props
        });
        if (s === a) return;
        this.moveTo(s, !0);
      }
    },
    getClosestBound(t) {
      const {
        bounds: e
      } = this;
      let n = 0;
      for (let i = 1; i < e.length - 1; i += 1)
        t >= e[i] && (n = i);
      return Math.abs(e[n + 1] - t) < Math.abs(e[n] - t) && (n += 1), n;
    },
    getBoundNeedMoving(t, e) {
      const {
        bounds: n,
        recent: i
      } = this;
      let o = e;
      const r = n[e + 1] === n[e];
      return r && n[i] === n[e] && (o = i), r && t !== n[e + 1] && (o = t < n[e + 1] ? e : e + 1), o;
    },
    getLowerBound() {
      return this.bounds[0];
    },
    getUpperBound() {
      const {
        bounds: t
      } = this;
      return t[t.length - 1];
    },
    /**
     * Returns an array of possible slider points, taking into account both
     * `marks` and `step`. The result is cached.
     */
    getPoints() {
      const {
        marks: t,
        step: e,
        min: n,
        max: i
      } = this, o = this.internalPointsCache;
      if (!o || o.marks !== t || o.step !== e) {
        const r = k({}, t);
        if (e !== null)
          for (let l = n; l <= i; l += e)
            r[l] = l;
        const a = Object.keys(r).map(parseFloat);
        a.sort((l, s) => l - s), this.internalPointsCache = {
          marks: t,
          step: e,
          points: a
        };
      }
      return this.internalPointsCache.points;
    },
    moveTo(t, e) {
      const n = [...this.bounds], {
        sHandle: i,
        recent: o
      } = this, r = i === null ? o : i;
      n[r] = t;
      let a = r;
      this.$props.pushable !== !1 ? this.pushSurroundingHandles(n, a) : this.$props.allowCross && (n.sort((l, s) => l - s), a = n.indexOf(t)), this.onChange({
        recent: a,
        sHandle: a,
        bounds: n
      }), e && (this.$emit("afterChange", n), this.setState({}, () => {
        this.handlesRefs[a].focus();
      }), this.onEnd());
    },
    pushSurroundingHandles(t, e) {
      const n = t[e], {
        pushable: i
      } = this, o = Number(i);
      let r = 0;
      if (t[e + 1] - n < o && (r = 1), n - t[e - 1] < o && (r = -1), r === 0)
        return;
      const a = e + r, l = r * (t[a] - n);
      this.pushHandle(t, a, r, o - l) || (t[e] = t[a] - r * o);
    },
    pushHandle(t, e, n, i) {
      const o = t[e];
      let r = t[e];
      for (; n * (r - o) < i; ) {
        if (!this.pushHandleOnePoint(t, e, n))
          return t[e] = o, !1;
        r = t[e];
      }
      return !0;
    },
    pushHandleOnePoint(t, e, n) {
      const i = this.getPoints(), r = i.indexOf(t[e]) + n;
      if (r >= i.length || r < 0)
        return !1;
      const a = e + n, l = i[r], {
        pushable: s
      } = this, u = Number(s), c = n * (t[a] - l);
      return this.pushHandle(t, a, n, u - c) ? (t[e] = l, !0) : !1;
    },
    trimAlignValue(t) {
      const {
        sHandle: e,
        bounds: n
      } = this;
      return Ah({
        value: t,
        handle: e,
        bounds: n,
        props: this.$props
      });
    },
    ensureValueNotConflict(t, e, n) {
      let {
        allowCross: i,
        pushable: o
      } = n;
      const r = this.$data || {}, {
        bounds: a
      } = r;
      if (t = t === void 0 ? r.sHandle : t, o = Number(o), !i && t != null && a !== void 0) {
        if (t > 0 && e <= a[t - 1] + o)
          return a[t - 1] + o;
        if (t < a.length - 1 && e >= a[t + 1] - o)
          return a[t + 1] - o;
      }
      return e;
    },
    getTrack(t) {
      let {
        bounds: e,
        prefixCls: n,
        reverse: i,
        vertical: o,
        included: r,
        offsets: a,
        trackStyle: l
      } = t;
      return e.slice(0, -1).map((s, u) => {
        const c = u + 1, d = Ae({
          [`${n}-track`]: !0,
          [`${n}-track-${c}`]: !0
        });
        return v(z$, {
          class: d,
          vertical: o,
          reverse: i,
          included: r,
          offset: a[c - 1],
          length: a[c] - a[c - 1],
          style: l[u],
          key: c
        }, null);
      });
    },
    renderSlider() {
      const {
        sHandle: t,
        bounds: e,
        prefixCls: n,
        vertical: i,
        included: o,
        disabled: r,
        min: a,
        max: l,
        reverse: s,
        handle: u,
        defaultHandle: c,
        trackStyle: d,
        handleStyle: f,
        tabindex: h,
        ariaLabelGroupForHandles: p,
        ariaLabelledByGroupForHandles: g,
        ariaValueTextFormatterGroupForHandles: m
      } = this, y = u || c, b = e.map((C) => this.calcOffset(C)), w = `${n}-handle`, $ = e.map((C, P) => {
        let O = h[P] || 0;
        (r || h[P] === null) && (O = null);
        const E = t === P;
        return y({
          class: Ae({
            [w]: !0,
            [`${w}-${P + 1}`]: !0,
            [`${w}-dragging`]: E
          }),
          prefixCls: n,
          vertical: i,
          dragging: E,
          offset: b[P],
          value: C,
          index: P,
          tabindex: O,
          min: a,
          max: l,
          reverse: s,
          disabled: r,
          style: f[P],
          ref: (_) => this.saveHandle(P, _),
          onFocus: this.onFocus,
          onBlur: this.onBlur,
          ariaLabel: p[P],
          ariaLabelledBy: g[P],
          ariaValueTextFormatter: m[P]
        });
      });
      return {
        tracks: this.getTrack({
          bounds: e,
          prefixCls: n,
          reverse: s,
          vertical: i,
          included: o,
          offsets: b,
          trackStyle: d
        }),
        handles: $
      };
    }
  }
}), _se = sz(Ese), Ise = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "SliderTooltip",
  inheritAttrs: !1,
  props: T3(),
  setup(t, e) {
    let {
      attrs: n,
      slots: i
    } = e;
    const o = de(null), r = de(null);
    function a() {
      Gt.cancel(r.value), r.value = null;
    }
    function l() {
      r.value = Gt(() => {
        var u;
        (u = o.value) === null || u === void 0 || u.forcePopupAlign(), r.value = null;
      });
    }
    const s = () => {
      a(), t.open && l();
    };
    return _e([() => t.open, () => t.title], () => {
      s();
    }, {
      flush: "post",
      immediate: !0
    }), kA(() => {
      s();
    }), tn(() => {
      a();
    }), () => v(zi, J(J({
      ref: o
    }, t), n), i);
  }
}), Mse = (t) => {
  const {
    componentCls: e,
    controlSize: n,
    dotSize: i,
    marginFull: o,
    marginPart: r,
    colorFillContentHover: a
  } = t;
  return {
    [e]: k(k({}, kn(t)), {
      position: "relative",
      height: n,
      margin: `${r}px ${o}px`,
      padding: 0,
      cursor: "pointer",
      touchAction: "none",
      "&-vertical": {
        margin: `${o}px ${r}px`
      },
      [`${e}-rail`]: {
        position: "absolute",
        backgroundColor: t.colorFillTertiary,
        borderRadius: t.borderRadiusXS,
        transition: `background-color ${t.motionDurationMid}`
      },
      [`${e}-track`]: {
        position: "absolute",
        backgroundColor: t.colorPrimaryBorder,
        borderRadius: t.borderRadiusXS,
        transition: `background-color ${t.motionDurationMid}`
      },
      "&:hover": {
        [`${e}-rail`]: {
          backgroundColor: t.colorFillSecondary
        },
        [`${e}-track`]: {
          backgroundColor: t.colorPrimaryBorderHover
        },
        [`${e}-dot`]: {
          borderColor: a
        },
        [`${e}-handle::after`]: {
          boxShadow: `0 0 0 ${t.handleLineWidth}px ${t.colorPrimaryBorderHover}`
        },
        [`${e}-dot-active`]: {
          borderColor: t.colorPrimary
        }
      },
      [`${e}-handle`]: {
        position: "absolute",
        width: t.handleSize,
        height: t.handleSize,
        outline: "none",
        [`${e}-dragging`]: {
          zIndex: 1
        },
        // 扩大选区
        "&::before": {
          content: '""',
          position: "absolute",
          insetInlineStart: -t.handleLineWidth,
          insetBlockStart: -t.handleLineWidth,
          width: t.handleSize + t.handleLineWidth * 2,
          height: t.handleSize + t.handleLineWidth * 2,
          backgroundColor: "transparent"
        },
        "&::after": {
          content: '""',
          position: "absolute",
          insetBlockStart: 0,
          insetInlineStart: 0,
          width: t.handleSize,
          height: t.handleSize,
          backgroundColor: t.colorBgElevated,
          boxShadow: `0 0 0 ${t.handleLineWidth}px ${t.colorPrimaryBorder}`,
          borderRadius: "50%",
          cursor: "pointer",
          transition: `
            inset-inline-start ${t.motionDurationMid},
            inset-block-start ${t.motionDurationMid},
            width ${t.motionDurationMid},
            height ${t.motionDurationMid},
            box-shadow ${t.motionDurationMid}
          `
        },
        "&:hover, &:active, &:focus": {
          "&::before": {
            insetInlineStart: -((t.handleSizeHover - t.handleSize) / 2 + t.handleLineWidthHover),
            insetBlockStart: -((t.handleSizeHover - t.handleSize) / 2 + t.handleLineWidthHover),
            width: t.handleSizeHover + t.handleLineWidthHover * 2,
            height: t.handleSizeHover + t.handleLineWidthHover * 2
          },
          "&::after": {
            boxShadow: `0 0 0 ${t.handleLineWidthHover}px ${t.colorPrimary}`,
            width: t.handleSizeHover,
            height: t.handleSizeHover,
            insetInlineStart: (t.handleSize - t.handleSizeHover) / 2,
            insetBlockStart: (t.handleSize - t.handleSizeHover) / 2
          }
        }
      },
      [`${e}-mark`]: {
        position: "absolute",
        fontSize: t.fontSize
      },
      [`${e}-mark-text`]: {
        position: "absolute",
        display: "inline-block",
        color: t.colorTextDescription,
        textAlign: "center",
        wordBreak: "keep-all",
        cursor: "pointer",
        userSelect: "none",
        "&-active": {
          color: t.colorText
        }
      },
      [`${e}-step`]: {
        position: "absolute",
        background: "transparent",
        pointerEvents: "none"
      },
      [`${e}-dot`]: {
        position: "absolute",
        width: i,
        height: i,
        backgroundColor: t.colorBgElevated,
        border: `${t.handleLineWidth}px solid ${t.colorBorderSecondary}`,
        borderRadius: "50%",
        cursor: "pointer",
        transition: `border-color ${t.motionDurationSlow}`,
        "&-active": {
          borderColor: t.colorPrimaryBorder
        }
      },
      [`&${e}-disabled`]: {
        cursor: "not-allowed",
        [`${e}-rail`]: {
          backgroundColor: `${t.colorFillSecondary} !important`
        },
        [`${e}-track`]: {
          backgroundColor: `${t.colorTextDisabled} !important`
        },
        [`
          ${e}-dot
        `]: {
          backgroundColor: t.colorBgElevated,
          borderColor: t.colorTextDisabled,
          boxShadow: "none",
          cursor: "not-allowed"
        },
        [`${e}-handle::after`]: {
          backgroundColor: t.colorBgElevated,
          cursor: "not-allowed",
          width: t.handleSize,
          height: t.handleSize,
          boxShadow: `0 0 0 ${t.handleLineWidth}px ${new jn(t.colorTextDisabled).onBackground(t.colorBgContainer).toHexString()}`,
          insetInlineStart: 0,
          insetBlockStart: 0
        },
        [`
          ${e}-mark-text,
          ${e}-dot
        `]: {
          cursor: "not-allowed !important"
        }
      }
    })
  };
}, uz = (t, e) => {
  const {
    componentCls: n,
    railSize: i,
    handleSize: o,
    dotSize: r
  } = t, a = e ? "paddingBlock" : "paddingInline", l = e ? "width" : "height", s = e ? "height" : "width", u = e ? "insetBlockStart" : "insetInlineStart", c = e ? "top" : "insetInlineStart";
  return {
    [a]: i,
    [s]: i * 3,
    [`${n}-rail`]: {
      [l]: "100%",
      [s]: i
    },
    [`${n}-track`]: {
      [s]: i
    },
    [`${n}-handle`]: {
      [u]: (i * 3 - o) / 2
    },
    [`${n}-mark`]: {
      // Reset all
      insetInlineStart: 0,
      top: 0,
      [c]: o,
      [l]: "100%"
    },
    [`${n}-step`]: {
      // Reset all
      insetInlineStart: 0,
      top: 0,
      [c]: i,
      [l]: "100%",
      [s]: i
    },
    [`${n}-dot`]: {
      position: "absolute",
      [u]: (i - r) / 2
    }
  };
}, Ase = (t) => {
  const {
    componentCls: e,
    marginPartWithMark: n
  } = t;
  return {
    [`${e}-horizontal`]: k(k({}, uz(t, !0)), {
      [`&${e}-with-marks`]: {
        marginBottom: n
      }
    })
  };
}, Rse = (t) => {
  const {
    componentCls: e
  } = t;
  return {
    [`${e}-vertical`]: k(k({}, uz(t, !1)), {
      height: "100%"
    })
  };
}, Dse = Vn("Slider", (t) => {
  const e = dn(t, {
    marginPart: (t.controlHeight - t.controlSize) / 2,
    marginFull: t.controlSize / 2,
    marginPartWithMark: t.controlHeightLG - t.controlSize
  });
  return [Mse(e), Ase(e), Rse(e)];
}, (t) => {
  const n = t.controlHeightLG / 4, i = t.controlHeightSM / 2, o = t.lineWidth + 1, r = t.lineWidth + 3;
  return {
    controlSize: n,
    railSize: 4,
    handleSize: n,
    handleSizeHover: i,
    dotSize: 8,
    handleLineWidth: o,
    handleLineWidthHover: r
  };
});
var v_ = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
const Nse = (t) => typeof t == "number" ? t.toString() : "", Lse = () => ({
  id: String,
  prefixCls: String,
  tooltipPrefixCls: String,
  range: pn([Boolean, Object]),
  reverse: pt(),
  min: Number,
  max: Number,
  step: pn([Object, Number]),
  marks: Vt(),
  dots: pt(),
  value: pn([Array, Number]),
  defaultValue: pn([Array, Number]),
  included: pt(),
  disabled: pt(),
  vertical: pt(),
  tipFormatter: pn([Function, Object], () => Nse),
  tooltipOpen: pt(),
  /** @deprecated `tooltipVisible` is deprecated. Please use `tooltipOpen` instead. */
  tooltipVisible: pt(),
  tooltipPlacement: yn(),
  getTooltipPopupContainer: ot(),
  autofocus: pt(),
  handleStyle: pn([Array, Object]),
  trackStyle: pn([Array, Object]),
  onChange: ot(),
  onAfterChange: ot(),
  onFocus: ot(),
  onBlur: ot(),
  "onUpdate:value": ot()
}), zse = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ASlider",
  inheritAttrs: !1,
  props: Lse(),
  // emits: ['update:value', 'change', 'afterChange', 'blur'],
  slots: Object,
  setup(t, e) {
    let {
      attrs: n,
      slots: i,
      emit: o,
      expose: r
    } = e;
    process.env.NODE_ENV !== "production" && [["tooltipVisible", "tooltipOpen"]].forEach((O) => {
      let [E, _] = O;
      $n(t.tooltipVisible === void 0, "Slider", `\`${E}\` is deprecated, please use \`${_}\` instead.`);
    });
    const {
      prefixCls: a,
      rootPrefixCls: l,
      direction: s,
      getPopupContainer: u,
      configProvider: c
    } = Ht("slider", t), [d, f] = Dse(a), h = jr(), p = de(), g = de({}), m = (O, E) => {
      g.value[O] = E;
    }, y = A(() => t.tooltipPlacement ? t.tooltipPlacement : t.vertical ? s.value === "rtl" ? "left" : "right" : "top"), b = () => {
      var O;
      (O = p.value) === null || O === void 0 || O.focus();
    }, w = () => {
      var O;
      (O = p.value) === null || O === void 0 || O.blur();
    }, $ = (O) => {
      o("update:value", O), o("change", O), h.onFieldChange();
    }, C = (O) => {
      o("blur", O);
    };
    r({
      focus: b,
      blur: w
    });
    const P = (O) => {
      var {
        tooltipPrefixCls: E
      } = O, _ = O.info, {
        value: D,
        dragging: M,
        index: N
      } = _, L = v_(_, ["value", "dragging", "index"]);
      const {
        tipFormatter: j,
        tooltipOpen: B = t.tooltipVisible,
        getTooltipPopupContainer: Y
      } = t, Q = j ? g.value[N] || M : !1, G = B || B === void 0 && Q;
      return v(Ise, {
        prefixCls: E,
        title: j ? j(D) : "",
        open: G,
        placement: y.value,
        transitionName: `${l.value}-zoom-down`,
        key: N,
        overlayClassName: `${a.value}-tooltip`,
        getPopupContainer: Y || u?.value
      }, {
        default: () => [v(iz, J(J({}, L), {}, {
          value: D,
          onMouseenter: () => m(N, !0),
          onMouseleave: () => m(N, !1)
        }), null)]
      });
    };
    return () => {
      const {
        tooltipPrefixCls: O,
        range: E,
        id: _ = h.id.value
      } = t, D = v_(t, ["tooltipPrefixCls", "range", "id"]), M = c.getPrefixCls("tooltip", O), N = Ae(n.class, {
        [`${a.value}-rtl`]: s.value === "rtl"
      }, f.value);
      s.value === "rtl" && !D.vertical && (D.reverse = !D.reverse);
      let L;
      return typeof E == "object" && (L = E.draggableTrack), d(E ? v(_se, J(J(J({}, n), D), {}, {
        step: D.step,
        draggableTrack: L,
        class: N,
        ref: p,
        handle: (j) => P({
          tooltipPrefixCls: M,
          prefixCls: a.value,
          info: j
        }),
        prefixCls: a.value,
        onChange: $,
        onBlur: C
      }), {
        mark: i.mark
      }) : v(Tse, J(J(J({}, n), D), {}, {
        id: _,
        step: D.step,
        class: N,
        ref: p,
        handle: (j) => P({
          tooltipPrefixCls: M,
          prefixCls: a.value,
          info: j
        }),
        prefixCls: a.value,
        onChange: $,
        onBlur: C
      }), {
        mark: i.mark
      }));
    };
  }
}), vr = ya(zse), Bse = (t) => {
  const {
    componentCls: e
  } = t, n = `${e}-inner`;
  return {
    [e]: {
      [`&${e}-small`]: {
        minWidth: t.switchMinWidthSM,
        height: t.switchHeightSM,
        lineHeight: `${t.switchHeightSM}px`,
        [`${e}-inner`]: {
          paddingInlineStart: t.switchInnerMarginMaxSM,
          paddingInlineEnd: t.switchInnerMarginMinSM,
          [`${n}-checked`]: {
            marginInlineStart: `calc(-100% + ${t.switchPinSizeSM + t.switchPadding * 2}px - ${t.switchInnerMarginMaxSM * 2}px)`,
            marginInlineEnd: `calc(100% - ${t.switchPinSizeSM + t.switchPadding * 2}px + ${t.switchInnerMarginMaxSM * 2}px)`
          },
          [`${n}-unchecked`]: {
            marginTop: -t.switchHeightSM,
            marginInlineStart: 0,
            marginInlineEnd: 0
          }
        },
        [`${e}-handle`]: {
          width: t.switchPinSizeSM,
          height: t.switchPinSizeSM
        },
        [`${e}-loading-icon`]: {
          top: (t.switchPinSizeSM - t.switchLoadingIconSize) / 2,
          fontSize: t.switchLoadingIconSize
        },
        [`&${e}-checked`]: {
          [`${e}-inner`]: {
            paddingInlineStart: t.switchInnerMarginMinSM,
            paddingInlineEnd: t.switchInnerMarginMaxSM,
            [`${n}-checked`]: {
              marginInlineStart: 0,
              marginInlineEnd: 0
            },
            [`${n}-unchecked`]: {
              marginInlineStart: `calc(100% - ${t.switchPinSizeSM + t.switchPadding * 2}px + ${t.switchInnerMarginMaxSM * 2}px)`,
              marginInlineEnd: `calc(-100% + ${t.switchPinSizeSM + t.switchPadding * 2}px - ${t.switchInnerMarginMaxSM * 2}px)`
            }
          },
          [`${e}-handle`]: {
            insetInlineStart: `calc(100% - ${t.switchPinSizeSM + t.switchPadding}px)`
          }
        },
        [`&:not(${e}-disabled):active`]: {
          [`&:not(${e}-checked) ${n}`]: {
            [`${n}-unchecked`]: {
              marginInlineStart: t.marginXXS / 2,
              marginInlineEnd: -t.marginXXS / 2
            }
          },
          [`&${e}-checked ${n}`]: {
            [`${n}-checked`]: {
              marginInlineStart: -t.marginXXS / 2,
              marginInlineEnd: t.marginXXS / 2
            }
          }
        }
      }
    }
  };
}, Fse = (t) => {
  const {
    componentCls: e
  } = t;
  return {
    [e]: {
      [`${e}-loading-icon${t.iconCls}`]: {
        position: "relative",
        top: (t.switchPinSize - t.fontSize) / 2,
        color: t.switchLoadingIconColor,
        verticalAlign: "top"
      },
      [`&${e}-checked ${e}-loading-icon`]: {
        color: t.switchColor
      }
    }
  };
}, Vse = (t) => {
  const {
    componentCls: e
  } = t, n = `${e}-handle`;
  return {
    [e]: {
      [n]: {
        position: "absolute",
        top: t.switchPadding,
        insetInlineStart: t.switchPadding,
        width: t.switchPinSize,
        height: t.switchPinSize,
        transition: `all ${t.switchDuration} ease-in-out`,
        "&::before": {
          position: "absolute",
          top: 0,
          insetInlineEnd: 0,
          bottom: 0,
          insetInlineStart: 0,
          backgroundColor: t.colorWhite,
          borderRadius: t.switchPinSize / 2,
          boxShadow: t.switchHandleShadow,
          transition: `all ${t.switchDuration} ease-in-out`,
          content: '""'
        }
      },
      [`&${e}-checked ${n}`]: {
        insetInlineStart: `calc(100% - ${t.switchPinSize + t.switchPadding}px)`
      },
      [`&:not(${e}-disabled):active`]: {
        [`${n}::before`]: {
          insetInlineEnd: t.switchHandleActiveInset,
          insetInlineStart: 0
        },
        [`&${e}-checked ${n}::before`]: {
          insetInlineEnd: 0,
          insetInlineStart: t.switchHandleActiveInset
        }
      }
    }
  };
}, Qse = (t) => {
  const {
    componentCls: e
  } = t, n = `${e}-inner`;
  return {
    [e]: {
      [n]: {
        display: "block",
        overflow: "hidden",
        borderRadius: 100,
        height: "100%",
        paddingInlineStart: t.switchInnerMarginMax,
        paddingInlineEnd: t.switchInnerMarginMin,
        transition: `padding-inline-start ${t.switchDuration} ease-in-out, padding-inline-end ${t.switchDuration} ease-in-out`,
        [`${n}-checked, ${n}-unchecked`]: {
          display: "block",
          color: t.colorTextLightSolid,
          fontSize: t.fontSizeSM,
          transition: `margin-inline-start ${t.switchDuration} ease-in-out, margin-inline-end ${t.switchDuration} ease-in-out`,
          pointerEvents: "none"
        },
        [`${n}-checked`]: {
          marginInlineStart: `calc(-100% + ${t.switchPinSize + t.switchPadding * 2}px - ${t.switchInnerMarginMax * 2}px)`,
          marginInlineEnd: `calc(100% - ${t.switchPinSize + t.switchPadding * 2}px + ${t.switchInnerMarginMax * 2}px)`
        },
        [`${n}-unchecked`]: {
          marginTop: -t.switchHeight,
          marginInlineStart: 0,
          marginInlineEnd: 0
        }
      },
      [`&${e}-checked ${n}`]: {
        paddingInlineStart: t.switchInnerMarginMin,
        paddingInlineEnd: t.switchInnerMarginMax,
        [`${n}-checked`]: {
          marginInlineStart: 0,
          marginInlineEnd: 0
        },
        [`${n}-unchecked`]: {
          marginInlineStart: `calc(100% - ${t.switchPinSize + t.switchPadding * 2}px + ${t.switchInnerMarginMax * 2}px)`,
          marginInlineEnd: `calc(-100% + ${t.switchPinSize + t.switchPadding * 2}px - ${t.switchInnerMarginMax * 2}px)`
        }
      },
      [`&:not(${e}-disabled):active`]: {
        [`&:not(${e}-checked) ${n}`]: {
          [`${n}-unchecked`]: {
            marginInlineStart: t.switchPadding * 2,
            marginInlineEnd: -t.switchPadding * 2
          }
        },
        [`&${e}-checked ${n}`]: {
          [`${n}-checked`]: {
            marginInlineStart: -t.switchPadding * 2,
            marginInlineEnd: t.switchPadding * 2
          }
        }
      }
    }
  };
}, Hse = (t) => {
  const {
    componentCls: e
  } = t;
  return {
    [e]: k(k(k(k({}, kn(t)), {
      position: "relative",
      display: "inline-block",
      boxSizing: "border-box",
      minWidth: t.switchMinWidth,
      height: t.switchHeight,
      lineHeight: `${t.switchHeight}px`,
      verticalAlign: "middle",
      background: t.colorTextQuaternary,
      border: "0",
      borderRadius: 100,
      cursor: "pointer",
      transition: `all ${t.motionDurationMid}`,
      userSelect: "none",
      [`&:hover:not(${e}-disabled)`]: {
        background: t.colorTextTertiary
      }
    }), Au(t)), {
      [`&${e}-checked`]: {
        background: t.switchColor,
        [`&:hover:not(${e}-disabled)`]: {
          background: t.colorPrimaryHover
        }
      },
      [`&${e}-loading, &${e}-disabled`]: {
        cursor: "not-allowed",
        opacity: t.switchDisabledOpacity,
        "*": {
          boxShadow: "none",
          cursor: "not-allowed"
        }
      },
      // rtl style
      [`&${e}-rtl`]: {
        direction: "rtl"
      }
    })
  };
}, Wse = Vn("Switch", (t) => {
  const e = t.fontSize * t.lineHeight, n = t.controlHeight / 2, i = 2, o = e - i * 2, r = n - i * 2, a = dn(t, {
    switchMinWidth: o * 2 + i * 4,
    switchHeight: e,
    switchDuration: t.motionDurationMid,
    switchColor: t.colorPrimary,
    switchDisabledOpacity: t.opacityLoading,
    switchInnerMarginMin: o / 2,
    switchInnerMarginMax: o + i + i * 2,
    switchPadding: i,
    switchPinSize: o,
    switchBg: t.colorBgContainer,
    switchMinWidthSM: r * 2 + i * 2,
    switchHeightSM: n,
    switchInnerMarginMinSM: r / 2,
    switchInnerMarginMaxSM: r + i + i * 2,
    switchPinSizeSM: r,
    switchHandleShadow: `0 2px 4px 0 ${new jn("#00230b").setAlpha(0.2).toRgbString()}`,
    switchLoadingIconSize: t.fontSizeIcon * 0.75,
    switchLoadingIconColor: `rgba(0, 0, 0, ${t.opacityLoading})`,
    switchHandleActiveInset: "-30%"
  });
  return [
    Hse(a),
    // inner style
    Qse(a),
    // handle style
    Vse(a),
    // loading style
    Fse(a),
    // small style
    Bse(a)
  ];
}), jse = ja("small", "default"), qse = () => ({
  id: String,
  prefixCls: String,
  size: ve.oneOf(jse),
  disabled: {
    type: Boolean,
    default: void 0
  },
  checkedChildren: ve.any,
  unCheckedChildren: ve.any,
  tabindex: ve.oneOfType([ve.string, ve.number]),
  autofocus: {
    type: Boolean,
    default: void 0
  },
  loading: {
    type: Boolean,
    default: void 0
  },
  checked: ve.oneOfType([ve.string, ve.number, ve.looseBool]),
  checkedValue: ve.oneOfType([ve.string, ve.number, ve.looseBool]).def(!0),
  unCheckedValue: ve.oneOfType([ve.string, ve.number, ve.looseBool]).def(!1),
  onChange: {
    type: Function
  },
  onClick: {
    type: Function
  },
  onKeydown: {
    type: Function
  },
  onMouseup: {
    type: Function
  },
  "onUpdate:checked": {
    type: Function
  },
  onBlur: Function,
  onFocus: Function
}), Yse = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ASwitch",
  __ANT_SWITCH: !0,
  inheritAttrs: !1,
  props: qse(),
  slots: Object,
  // emits: ['update:checked', 'mouseup', 'change', 'click', 'keydown', 'blur'],
  setup(t, e) {
    let {
      attrs: n,
      slots: i,
      expose: o,
      emit: r
    } = e;
    const a = jr(), l = qa(), s = A(() => {
      var _;
      return (_ = t.disabled) !== null && _ !== void 0 ? _ : l.value;
    });
    R0(() => {
      eo(!("defaultChecked" in n), "Switch", "'defaultChecked' is deprecated, please use 'v-model:checked'"), eo(!("value" in n), "Switch", "`value` is not validate prop, do you mean `checked`?");
    });
    const u = de(t.checked !== void 0 ? t.checked : n.defaultChecked), c = A(() => u.value === t.checkedValue);
    _e(() => t.checked, () => {
      u.value = t.checked;
    });
    const {
      prefixCls: d,
      direction: f,
      size: h
    } = Ht("switch", t), [p, g] = Wse(d), m = de(), y = () => {
      var _;
      (_ = m.value) === null || _ === void 0 || _.focus();
    };
    o({
      focus: y,
      blur: () => {
        var _;
        (_ = m.value) === null || _ === void 0 || _.blur();
      }
    }), Lt(() => {
      rn(() => {
        t.autofocus && !s.value && m.value.focus();
      });
    });
    const w = (_, D) => {
      s.value || (r("update:checked", _), r("change", _, D), a.onFieldChange());
    }, $ = (_) => {
      r("blur", _);
    }, C = (_) => {
      y();
      const D = c.value ? t.unCheckedValue : t.checkedValue;
      w(D, _), r("click", D, _);
    }, P = (_) => {
      _.keyCode === lt.LEFT ? w(t.unCheckedValue, _) : _.keyCode === lt.RIGHT && w(t.checkedValue, _), r("keydown", _);
    }, O = (_) => {
      var D;
      (D = m.value) === null || D === void 0 || D.blur(), r("mouseup", _);
    }, E = A(() => ({
      [`${d.value}-small`]: h.value === "small",
      [`${d.value}-loading`]: t.loading,
      [`${d.value}-checked`]: c.value,
      [`${d.value}-disabled`]: s.value,
      [d.value]: !0,
      [`${d.value}-rtl`]: f.value === "rtl",
      [g.value]: !0
    }));
    return () => {
      var _;
      return p(v(WC, null, {
        default: () => [v("button", J(J(J({}, ii(t, ["prefixCls", "checkedChildren", "unCheckedChildren", "checked", "autofocus", "checkedValue", "unCheckedValue", "id", "onChange", "onUpdate:checked"])), n), {}, {
          id: (_ = t.id) !== null && _ !== void 0 ? _ : a.id.value,
          onKeydown: P,
          onClick: C,
          onBlur: $,
          onMouseup: O,
          type: "button",
          role: "switch",
          "aria-checked": u.value,
          disabled: s.value || t.loading,
          class: [n.class, E.value],
          ref: m
        }), [v("div", {
          class: `${d.value}-handle`
        }, [t.loading ? v(Ya, {
          class: `${d.value}-loading-icon`
        }, null) : null]), v("span", {
          class: `${d.value}-inner`
        }, [v("span", {
          class: `${d.value}-inner-checked`
        }, [ca(i, t, "checkedChildren")]), v("span", {
          class: `${d.value}-inner-unchecked`
        }, [ca(i, t, "unCheckedChildren")])])])]
      }));
    };
  }
}), ts = ya(Yse), cz = Symbol("TableContextProps"), Kse = (t) => {
  Xt(cz, t);
}, Bl = () => qt(cz, {}), Xse = "RC_TABLE_KEY";
function dz(t) {
  return t == null ? [] : Array.isArray(t) ? t : [t];
}
function fz(t, e) {
  if (!e && typeof e != "number")
    return t;
  const n = dz(e);
  let i = t;
  for (let o = 0; o < n.length; o += 1) {
    if (!i)
      return null;
    const r = n[o];
    i = i[r];
  }
  return i;
}
function zy(t) {
  const e = [], n = {};
  return t.forEach((i) => {
    const {
      key: o,
      dataIndex: r
    } = i || {};
    let a = o || dz(r).join("-") || Xse;
    for (; n[a]; )
      a = `${a}_next`;
    n[a] = !0, e.push(a);
  }), e;
}
function Zse() {
  const t = {};
  function e(r, a) {
    a && Object.keys(a).forEach((l) => {
      const s = a[l];
      s && typeof s == "object" ? (r[l] = r[l] || {}, e(r[l], s)) : r[l] = s;
    });
  }
  for (var n = arguments.length, i = new Array(n), o = 0; o < n; o++)
    i[o] = arguments[o];
  return i.forEach((r) => {
    e(t, r);
  }), t;
}
function tS(t) {
  return t != null;
}
const hz = Symbol("SlotsContextProps"), Gse = (t) => {
  Xt(hz, t);
}, F$ = () => qt(hz, A(() => ({}))), pz = Symbol("ContextProps"), Use = (t) => {
  Xt(pz, t);
}, Jse = () => qt(pz, {
  onResizeColumn: () => {
  }
}), pf = "RC_TABLE_INTERNAL_COL_DEFINE", gz = Symbol("HoverContextProps"), eue = (t) => {
  Xt(gz, t);
}, tue = () => qt(gz, {
  startRow: Te(-1),
  endRow: Te(-1),
  onHover() {
  }
}), nS = Te(!1), nue = () => {
  Lt(() => {
    nS.value = nS.value || vie("position", "sticky");
  });
}, iue = () => nS;
var oue = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
function rue(t, e, n, i) {
  const o = t + e - 1;
  return t <= i && o >= n;
}
function aue(t) {
  return t && typeof t == "object" && !Array.isArray(t) && !or(t);
}
const By = Oe({
  name: "Cell",
  props: ["prefixCls", "record", "index", "renderIndex", "dataIndex", "customRender", "component", "colSpan", "rowSpan", "fixLeft", "fixRight", "firstFixLeft", "lastFixLeft", "firstFixRight", "lastFixRight", "appendNode", "additionalProps", "ellipsis", "align", "rowType", "isSticky", "column", "cellType", "transformCellText"],
  setup(t, e) {
    let {
      slots: n
    } = e;
    const i = F$(), {
      onHover: o,
      startRow: r,
      endRow: a
    } = tue(), l = A(() => {
      var g, m, y, b;
      return (y = (g = t.colSpan) !== null && g !== void 0 ? g : (m = t.additionalProps) === null || m === void 0 ? void 0 : m.colSpan) !== null && y !== void 0 ? y : (b = t.additionalProps) === null || b === void 0 ? void 0 : b.colspan;
    }), s = A(() => {
      var g, m, y, b;
      return (y = (g = t.rowSpan) !== null && g !== void 0 ? g : (m = t.additionalProps) === null || m === void 0 ? void 0 : m.rowSpan) !== null && y !== void 0 ? y : (b = t.additionalProps) === null || b === void 0 ? void 0 : b.rowspan;
    }), u = Pa(() => {
      const {
        index: g
      } = t;
      return rue(g, s.value || 1, r.value, a.value);
    }), c = iue(), d = (g, m) => {
      var y;
      const {
        record: b,
        index: w,
        additionalProps: $
      } = t;
      b && o(w, w + m - 1), (y = $?.onMouseenter) === null || y === void 0 || y.call($, g);
    }, f = (g) => {
      var m;
      const {
        record: y,
        additionalProps: b
      } = t;
      y && o(-1, -1), (m = b?.onMouseleave) === null || m === void 0 || m.call(b, g);
    }, h = (g) => {
      const m = ho(g)[0];
      return or(m) ? m.type === pw ? m.children : Array.isArray(m.children) ? h(m.children) : void 0 : m;
    }, p = Te(null);
    return _e([u, () => t.prefixCls, p], () => {
      const g = wl(p.value);
      g && (u.value ? xO(g, `${t.prefixCls}-cell-row-hover`) : OO(g, `${t.prefixCls}-cell-row-hover`));
    }), () => {
      var g, m, y, b, w, $;
      const {
        prefixCls: C,
        record: P,
        index: O,
        renderIndex: E,
        dataIndex: _,
        customRender: D,
        component: M = "td",
        fixLeft: N,
        fixRight: L,
        firstFixLeft: j,
        lastFixLeft: B,
        firstFixRight: Y,
        lastFixRight: Q,
        appendNode: G = (g = n.appendNode) === null || g === void 0 ? void 0 : g.call(n),
        additionalProps: V = {},
        ellipsis: H,
        align: q,
        rowType: K,
        isSticky: ee,
        column: ie = {},
        cellType: ae
      } = t, te = `${C}-cell`;
      let U, me;
      const ce = (m = n.default) === null || m === void 0 ? void 0 : m.call(n);
      if (tS(ce) || ae === "header")
        me = ce;
      else {
        const Ce = fz(P, _);
        if (me = Ce, D) {
          const $e = D({
            text: Ce,
            value: Ce,
            record: P,
            index: O,
            renderIndex: E,
            column: ie.__originColumn__
          });
          aue($e) ? (process.env.NODE_ENV !== "production" && Nn(!1, "`columns.customRender` return cell props is deprecated with perf issue, please use `customCell` instead."), me = $e.children, U = $e.props) : me = $e;
        }
        if (!(pf in ie) && ae === "body" && i.value.bodyCell && !(!((y = ie.slots) === null || y === void 0) && y.customRender)) {
          const $e = fy(i.value, "bodyCell", {
            text: Ce,
            value: Ce,
            record: P,
            index: O,
            column: ie.__originColumn__
          }, () => {
            const Le = me === void 0 ? Ce : me;
            return [typeof Le == "object" && po(Le) || typeof Le != "object" ? Le : null];
          });
          me = Wi($e);
        }
        t.transformCellText && (me = t.transformCellText({
          text: me,
          record: P,
          index: O,
          column: ie.__originColumn__
        }));
      }
      typeof me == "object" && !Array.isArray(me) && !or(me) && (me = null), H && (B || Y) && (me = v("span", {
        class: `${te}-content`
      }, [me])), Array.isArray(me) && me.length === 1 && (me = me[0]);
      const ue = U || {}, {
        colSpan: fe,
        rowSpan: he,
        style: le,
        class: ke
      } = ue, ze = oue(ue, ["colSpan", "rowSpan", "style", "class"]), Re = (b = fe !== void 0 ? fe : l.value) !== null && b !== void 0 ? b : 1, Ye = (w = he !== void 0 ? he : s.value) !== null && w !== void 0 ? w : 1;
      if (Re === 0 || Ye === 0)
        return null;
      const Ne = {}, Fe = typeof N == "number" && c.value, We = typeof L == "number" && c.value;
      Fe && (Ne.position = "sticky", Ne.left = `${N}px`), We && (Ne.position = "sticky", Ne.right = `${L}px`);
      const nt = {};
      q && (nt.textAlign = q);
      let Qe;
      const Pe = H === !0 ? {
        showTitle: !0
      } : H;
      Pe && (Pe.showTitle || K === "header") && (typeof me == "string" || typeof me == "number" ? Qe = me.toString() : or(me) && (Qe = h([me])));
      const Ze = k(k(k({
        title: Qe
      }, ze), V), {
        colSpan: Re !== 1 ? Re : null,
        rowSpan: Ye !== 1 ? Ye : null,
        class: Ae(te, {
          [`${te}-fix-left`]: Fe && c.value,
          [`${te}-fix-left-first`]: j && c.value,
          [`${te}-fix-left-last`]: B && c.value,
          [`${te}-fix-right`]: We && c.value,
          [`${te}-fix-right-first`]: Y && c.value,
          [`${te}-fix-right-last`]: Q && c.value,
          [`${te}-ellipsis`]: H,
          [`${te}-with-append`]: G,
          [`${te}-fix-sticky`]: (Fe || We) && ee && c.value
        }, V.class, ke),
        onMouseenter: (Ce) => {
          d(Ce, Ye);
        },
        onMouseleave: f,
        style: [V.style, nt, Ne, le]
      });
      return v(M, J(J({}, Ze), {}, {
        ref: p
      }), {
        default: () => [G, me, ($ = n.dragHandle) === null || $ === void 0 ? void 0 : $.call(n)]
      });
    };
  }
});
function V$(t, e, n, i, o) {
  const r = n[t] || {}, a = n[e] || {};
  let l, s;
  r.fixed === "left" ? l = i.left[t] : a.fixed === "right" && (s = i.right[e]);
  let u = !1, c = !1, d = !1, f = !1;
  const h = n[e + 1], p = n[t - 1];
  return o === "rtl" ? l !== void 0 ? f = !(p && p.fixed === "left") : s !== void 0 && (d = !(h && h.fixed === "right")) : l !== void 0 ? u = !(h && h.fixed === "left") : s !== void 0 && (c = !(p && p.fixed === "right")), {
    fixLeft: l,
    fixRight: s,
    lastFixLeft: u,
    firstFixRight: c,
    lastFixRight: d,
    firstFixLeft: f,
    isSticky: i.isSticky
  };
}
const y_ = {
  mouse: {
    move: "mousemove",
    stop: "mouseup"
  },
  touch: {
    move: "touchmove",
    stop: "touchend"
  }
}, b_ = 50, lue = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "DragHandle",
  props: {
    prefixCls: String,
    width: {
      type: Number,
      required: !0
    },
    minWidth: {
      type: Number,
      default: b_
    },
    maxWidth: {
      type: Number,
      default: 1 / 0
    },
    column: {
      type: Object,
      default: void 0
    }
  },
  setup(t) {
    let e = 0, n = {
      remove: () => {
      }
    }, i = {
      remove: () => {
      }
    };
    const o = () => {
      n.remove(), i.remove();
    };
    wo(() => {
      o();
    }), zt(() => {
      $n(!isNaN(t.width), "Table", "width must be a number when use resizable");
    });
    const {
      onResizeColumn: r
    } = Jse(), a = A(() => typeof t.minWidth == "number" && !isNaN(t.minWidth) ? t.minWidth : b_), l = A(() => typeof t.maxWidth == "number" && !isNaN(t.maxWidth) ? t.maxWidth : 1 / 0), s = sr();
    let u = 0;
    const c = Te(!1);
    let d;
    const f = (w) => {
      let $ = 0;
      w.touches ? w.touches.length ? $ = w.touches[0].pageX : $ = w.changedTouches[0].pageX : $ = w.pageX;
      const C = e - $;
      let P = Math.max(u - C, a.value);
      P = Math.min(P, l.value), Gt.cancel(d), d = Gt(() => {
        r(P, t.column.__originColumn__);
      });
    }, h = (w) => {
      f(w);
    }, p = (w) => {
      c.value = !1, f(w), o();
    }, g = (w, $) => {
      c.value = !0, o(), u = s.vnode.el.parentNode.getBoundingClientRect().width, !(w instanceof MouseEvent && w.which !== 1) && (w.stopPropagation && w.stopPropagation(), e = w.touches ? w.touches[0].pageX : w.pageX, n = So(document.documentElement, $.move, h), i = So(document.documentElement, $.stop, p));
    }, m = (w) => {
      w.stopPropagation(), w.preventDefault(), g(w, y_.mouse);
    }, y = (w) => {
      w.stopPropagation(), w.preventDefault(), g(w, y_.touch);
    }, b = (w) => {
      w.stopPropagation(), w.preventDefault();
    };
    return () => {
      const {
        prefixCls: w
      } = t, $ = {
        [xo ? "onTouchstartPassive" : "onTouchstart"]: (C) => y(C)
      };
      return v("div", J(J({
        class: `${w}-resize-handle ${c.value ? "dragging" : ""}`,
        onMousedown: m
      }, $), {}, {
        onClick: b
      }), [v("div", {
        class: `${w}-resize-handle-line`
      }, null)]);
    };
  }
}), sue = Oe({
  name: "HeaderRow",
  props: ["cells", "stickyOffsets", "flattenColumns", "rowComponent", "cellComponent", "index", "customHeaderRow"],
  setup(t) {
    const e = Bl();
    return () => {
      const {
        prefixCls: n,
        direction: i
      } = e, {
        cells: o,
        stickyOffsets: r,
        flattenColumns: a,
        rowComponent: l,
        cellComponent: s,
        customHeaderRow: u,
        index: c
      } = t;
      let d;
      u && (d = u(o.map((h) => h.column), c));
      const f = zy(o.map((h) => h.column));
      return v(l, d, {
        default: () => [o.map((h, p) => {
          const {
            column: g
          } = h, m = V$(h.colStart, h.colEnd, a, r, i);
          let y;
          g && g.customHeaderCell && (y = h.column.customHeaderCell(g));
          const b = g;
          return v(By, J(J(J({}, h), {}, {
            cellType: "header",
            ellipsis: g.ellipsis,
            align: g.align,
            component: s,
            prefixCls: n,
            key: f[p]
          }, m), {}, {
            additionalProps: y,
            rowType: "header",
            column: g
          }), {
            default: () => g.title,
            dragHandle: () => b.resizable ? v(lue, {
              prefixCls: n,
              width: b.width,
              minWidth: b.minWidth,
              maxWidth: b.maxWidth,
              column: b
            }, null) : null
          });
        })]
      });
    };
  }
});
function uue(t) {
  const e = [];
  function n(o, r) {
    let a = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;
    e[a] = e[a] || [];
    let l = r;
    return o.filter(Boolean).map((u) => {
      const c = {
        key: u.key,
        class: Ae(u.className, u.class),
        // children: column.title,
        column: u,
        colStart: l
      };
      let d = 1;
      const f = u.children;
      return f && f.length > 0 && (d = n(f, l, a + 1).reduce((h, p) => h + p, 0), c.hasSubColumns = !0), "colSpan" in u && ({
        colSpan: d
      } = u), "rowSpan" in u && (c.rowSpan = u.rowSpan), c.colSpan = d, c.colEnd = c.colStart + d - 1, e[a].push(c), l += d, d;
    });
  }
  n(t, 0);
  const i = e.length;
  for (let o = 0; o < i; o += 1)
    e[o].forEach((r) => {
      !("rowSpan" in r) && !r.hasSubColumns && (r.rowSpan = i - o);
    });
  return e;
}
const x_ = Oe({
  name: "TableHeader",
  inheritAttrs: !1,
  props: ["columns", "flattenColumns", "stickyOffsets", "customHeaderRow"],
  setup(t) {
    const e = Bl(), n = A(() => uue(t.columns));
    return () => {
      const {
        prefixCls: i,
        getComponent: o
      } = e, {
        stickyOffsets: r,
        flattenColumns: a,
        customHeaderRow: l
      } = t, s = o(["header", "wrapper"], "thead"), u = o(["header", "row"], "tr"), c = o(["header", "cell"], "th");
      return v(s, {
        class: `${i}-thead`
      }, {
        default: () => [n.value.map((d, f) => v(sue, {
          key: f,
          flattenColumns: a,
          cells: d,
          stickyOffsets: r,
          rowComponent: u,
          cellComponent: c,
          customHeaderRow: l,
          index: f
        }, null))]
      });
    };
  }
}), mz = Symbol("ExpandedRowProps"), cue = (t) => {
  Xt(mz, t);
}, due = () => qt(mz, {}), vz = Oe({
  name: "ExpandedRow",
  inheritAttrs: !1,
  props: ["prefixCls", "component", "cellComponent", "expanded", "colSpan", "isEmpty"],
  setup(t, e) {
    let {
      slots: n,
      attrs: i
    } = e;
    const o = Bl(), r = due(), {
      fixHeader: a,
      fixColumn: l,
      componentWidth: s,
      horizonScroll: u
    } = r;
    return () => {
      const {
        prefixCls: c,
        component: d,
        cellComponent: f,
        expanded: h,
        colSpan: p,
        isEmpty: g
      } = t;
      return v(d, {
        class: i.class,
        style: {
          display: h ? null : "none"
        }
      }, {
        default: () => [v(By, {
          component: f,
          prefixCls: c,
          colSpan: p
        }, {
          default: () => {
            var m;
            let y = (m = n.default) === null || m === void 0 ? void 0 : m.call(n);
            return (g ? u.value : l.value) && (y = v("div", {
              style: {
                width: `${s.value - (a.value ? o.scrollbarSize : 0)}px`,
                position: "sticky",
                left: 0,
                overflow: "hidden"
              },
              class: `${c}-expanded-row-fixed`
            }, [y])), y;
          }
        })]
      });
    };
  }
}), fue = Oe({
  name: "MeasureCell",
  props: ["columnKey"],
  setup(t, e) {
    let {
      emit: n
    } = e;
    const i = de();
    return Lt(() => {
      i.value && n("columnResize", t.columnKey, i.value.offsetWidth);
    }), () => v(Mu, {
      onResize: (o) => {
        let {
          offsetWidth: r
        } = o;
        n("columnResize", t.columnKey, r);
      }
    }, {
      default: () => [v("td", {
        ref: i,
        style: {
          padding: 0,
          border: 0,
          height: 0
        }
      }, [v("div", {
        style: {
          height: 0,
          overflow: "hidden"
        }
      }, [Ve(" ")])])]
    });
  }
}), yz = Symbol("BodyContextProps"), hue = (t) => {
  Xt(yz, t);
}, bz = () => qt(yz, {}), pue = Oe({
  name: "BodyRow",
  inheritAttrs: !1,
  props: ["record", "index", "renderIndex", "recordKey", "expandedKeys", "rowComponent", "cellComponent", "customRow", "rowExpandable", "indent", "rowKey", "getRowKey", "childrenColumnName"],
  setup(t, e) {
    let {
      attrs: n
    } = e;
    const i = Bl(), o = bz(), r = Te(!1), a = A(() => t.expandedKeys && t.expandedKeys.has(t.recordKey));
    zt(() => {
      a.value && (r.value = !0);
    });
    const l = A(() => o.expandableType === "row" && (!t.rowExpandable || t.rowExpandable(t.record))), s = A(() => o.expandableType === "nest"), u = A(() => t.childrenColumnName && t.record && t.record[t.childrenColumnName]), c = A(() => l.value || s.value), d = (m, y) => {
      o.onTriggerExpand(m, y);
    }, f = A(() => {
      var m;
      return ((m = t.customRow) === null || m === void 0 ? void 0 : m.call(t, t.record, t.index)) || {};
    }), h = function(m) {
      var y, b;
      o.expandRowByClick && c.value && d(t.record, m);
      for (var w = arguments.length, $ = new Array(w > 1 ? w - 1 : 0), C = 1; C < w; C++)
        $[C - 1] = arguments[C];
      (b = (y = f.value) === null || y === void 0 ? void 0 : y.onClick) === null || b === void 0 || b.call(y, m, ...$);
    }, p = A(() => {
      const {
        record: m,
        index: y,
        indent: b
      } = t, {
        rowClassName: w
      } = o;
      return typeof w == "string" ? w : typeof w == "function" ? w(m, y, b) : "";
    }), g = A(() => zy(o.flattenColumns));
    return () => {
      const {
        class: m,
        style: y
      } = n, {
        record: b,
        index: w,
        rowKey: $,
        indent: C = 0,
        rowComponent: P,
        cellComponent: O
      } = t, {
        prefixCls: E,
        fixedInfoList: _,
        transformCellText: D
      } = i, {
        flattenColumns: M,
        expandedRowClassName: N,
        indentSize: L,
        expandIcon: j,
        expandedRowRender: B,
        expandIconColumnIndex: Y
      } = o, Q = v(P, J(J({}, f.value), {}, {
        "data-row-key": $,
        class: Ae(m, `${E}-row`, `${E}-row-level-${C}`, p.value, f.value.class),
        style: [y, f.value.style],
        onClick: h
      }), {
        default: () => [M.map((V, H) => {
          const {
            customRender: q,
            dataIndex: K,
            className: ee
          } = V, ie = g[H], ae = _[H];
          let te;
          V.customCell && (te = V.customCell(b, w, V));
          const U = H === (Y || 0) && s.value ? v(tt, null, [v("span", {
            style: {
              paddingLeft: `${L * C}px`
            },
            class: `${E}-row-indent indent-level-${C}`
          }, null), j({
            prefixCls: E,
            expanded: a.value,
            expandable: u.value,
            record: b,
            onExpand: d
          })]) : null;
          return v(By, J(J({
            cellType: "body",
            class: ee,
            ellipsis: V.ellipsis,
            align: V.align,
            component: O,
            prefixCls: E,
            key: ie,
            record: b,
            index: w,
            renderIndex: t.renderIndex,
            dataIndex: K,
            customRender: q
          }, ae), {}, {
            additionalProps: te,
            column: V,
            transformCellText: D,
            appendNode: U
          }), null);
        })]
      });
      let G;
      if (l.value && (r.value || a.value)) {
        const V = B({
          record: b,
          index: w,
          indent: C + 1,
          expanded: a.value
        }), H = N && N(b, w, C);
        G = v(vz, {
          expanded: a.value,
          class: Ae(`${E}-expanded-row`, `${E}-expanded-row-level-${C + 1}`, H),
          prefixCls: E,
          component: P,
          cellComponent: O,
          colSpan: M.length,
          isEmpty: !1
        }, {
          default: () => [V]
        });
      }
      return v(tt, null, [Q, G]);
    };
  }
});
function xz(t, e, n, i, o, r) {
  const a = [];
  a.push({
    record: t,
    indent: e,
    index: r
  });
  const l = o(t), s = i?.has(l);
  if (t && Array.isArray(t[n]) && s)
    for (let u = 0; u < t[n].length; u += 1) {
      const c = xz(t[n][u], e + 1, n, i, o, u);
      a.push(...c);
    }
  return a;
}
function gue(t, e, n, i) {
  return A(() => {
    const r = e.value, a = n.value, l = t.value;
    if (a?.size) {
      const s = [];
      for (let u = 0; u < l?.length; u += 1) {
        const c = l[u];
        s.push(...xz(c, 0, r, a, i.value, u));
      }
      return s;
    }
    return l?.map((s, u) => ({
      record: s,
      indent: 0,
      index: u
    }));
  });
}
const Oz = Symbol("ResizeContextProps"), mue = (t) => {
  Xt(Oz, t);
}, vue = () => qt(Oz, {
  onColumnResize: () => {
  }
}), yue = Oe({
  name: "TableBody",
  props: ["data", "getRowKey", "measureColumnWidth", "expandedKeys", "customRow", "rowExpandable", "childrenColumnName"],
  setup(t, e) {
    let {
      slots: n
    } = e;
    const i = vue(), o = Bl(), r = bz(), a = gue(on(t, "data"), on(t, "childrenColumnName"), on(t, "expandedKeys"), on(t, "getRowKey")), l = Te(-1), s = Te(-1);
    let u;
    return eue({
      startRow: l,
      endRow: s,
      onHover: (c, d) => {
        clearTimeout(u), u = setTimeout(() => {
          l.value = c, s.value = d;
        }, 100);
      }
    }), () => {
      var c;
      const {
        data: d,
        getRowKey: f,
        measureColumnWidth: h,
        expandedKeys: p,
        customRow: g,
        rowExpandable: m,
        childrenColumnName: y
      } = t, {
        onColumnResize: b
      } = i, {
        prefixCls: w,
        getComponent: $
      } = o, {
        flattenColumns: C
      } = r, P = $(["body", "wrapper"], "tbody"), O = $(["body", "row"], "tr"), E = $(["body", "cell"], "td");
      let _;
      d.length ? _ = a.value.map((M, N) => {
        const {
          record: L,
          indent: j,
          index: B
        } = M, Y = f(L, N);
        return v(pue, {
          key: Y,
          rowKey: Y,
          record: L,
          recordKey: Y,
          index: N,
          renderIndex: B,
          rowComponent: O,
          cellComponent: E,
          expandedKeys: p,
          customRow: g,
          getRowKey: f,
          rowExpandable: m,
          childrenColumnName: y,
          indent: j
        }, null);
      }) : _ = v(vz, {
        expanded: !0,
        class: `${w}-placeholder`,
        prefixCls: w,
        component: O,
        cellComponent: E,
        colSpan: C.length,
        isEmpty: !0
      }, {
        default: () => [(c = n.emptyNode) === null || c === void 0 ? void 0 : c.call(n)]
      });
      const D = zy(C);
      return v(P, {
        class: `${w}-tbody`
      }, {
        default: () => [h && v("tr", {
          "aria-hidden": "true",
          class: `${w}-measure-row`,
          style: {
            height: 0,
            fontSize: 0
          }
        }, [D.map((M) => v(fue, {
          key: M,
          columnKey: M,
          onColumnResize: b
        }, null))]), _]
      });
    };
  }
}), gl = {};
var bue = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
function iS(t) {
  return t.reduce((e, n) => {
    const {
      fixed: i
    } = n, o = i === !0 ? "left" : i, r = n.children;
    return r && r.length > 0 ? [...e, ...iS(r).map((a) => k({
      fixed: o
    }, a))] : [...e, k(k({}, n), {
      fixed: o
    })];
  }, []);
}
function xue(t) {
  let e = !0;
  for (let i = 0; i < t.length; i += 1) {
    const o = t[i];
    if (e && o.fixed !== "left")
      e = !1;
    else if (!e && o.fixed === "left") {
      Nn(!1, `Index ${i - 1} of \`columns\` missing \`fixed='left'\` prop.`);
      break;
    }
  }
  let n = !0;
  for (let i = t.length - 1; i >= 0; i -= 1) {
    const o = t[i];
    if (n && o.fixed !== "right")
      n = !1;
    else if (!n && o.fixed === "right") {
      Nn(!1, `Index ${i + 1} of \`columns\` missing \`fixed='right'\` prop.`);
      break;
    }
  }
}
function Oue(t) {
  return t.map((e) => {
    const {
      fixed: n
    } = e, i = bue(e, ["fixed"]);
    let o = n;
    return n === "left" ? o = "right" : n === "right" && (o = "left"), k({
      fixed: o
    }, i);
  });
}
function Sue(t, e) {
  let {
    prefixCls: n,
    columns: i,
    // children,
    expandable: o,
    expandedKeys: r,
    getRowKey: a,
    onTriggerExpand: l,
    expandIcon: s,
    rowExpandable: u,
    expandIconColumnIndex: c,
    direction: d,
    expandRowByClick: f,
    expandColumnWidth: h,
    expandFixed: p
  } = t;
  const g = F$(), m = A(() => {
    if (o.value) {
      let w = i.value.slice();
      if (process.env.NODE_ENV !== "production" && c.value >= 0 && Nn(!1, "`expandIconColumnIndex` is deprecated. Please use `Table.EXPAND_COLUMN` in `columns` instead."), !w.includes(gl)) {
        const L = c.value || 0;
        L >= 0 && w.splice(L, 0, gl);
      }
      process.env.NODE_ENV !== "production" && w.filter((L) => L === gl).length > 1 && Nn(!1, "There exist more than one `EXPAND_COLUMN` in `columns`.");
      const $ = w.indexOf(gl);
      w = w.filter((L, j) => L !== gl || j === $);
      const C = i.value[$];
      let P;
      (p.value === "left" || p.value) && !c.value ? P = "left" : (p.value === "right" || p.value) && c.value === i.value.length ? P = "right" : P = C ? C.fixed : null;
      const O = r.value, E = u.value, _ = s.value, D = n.value, M = f.value, N = {
        [pf]: {
          class: `${n.value}-expand-icon-col`,
          columnType: "EXPAND_COLUMN"
        },
        title: fy(g.value, "expandColumnTitle", {}, () => [""]),
        fixed: P,
        class: `${n.value}-row-expand-icon-cell`,
        width: h.value,
        customRender: (L) => {
          let {
            record: j,
            index: B
          } = L;
          const Y = a.value(j, B), Q = O.has(Y), G = E ? E(j) : !0, V = _({
            prefixCls: D,
            expanded: Q,
            expandable: G,
            record: j,
            onExpand: l
          });
          return M ? v("span", {
            onClick: (H) => H.stopPropagation()
          }, [V]) : V;
        }
      };
      return w.map((L) => L === gl ? N : L);
    }
    return process.env.NODE_ENV !== "production" && i.value.includes(gl) && Nn(!1, "`expandable` is not config but there exist `EXPAND_COLUMN` in `columns`."), i.value.filter((w) => w !== gl);
  }), y = A(() => {
    let w = m.value;
    return e.value && (w = e.value(w)), w.length || (w = [{
      customRender: () => null
    }]), w;
  }), b = A(() => d.value === "rtl" ? Oue(iS(y.value)) : iS(y.value));
  return process.env.NODE_ENV !== "production" && zt(() => {
    setTimeout(() => {
      xue(b.value);
    });
  }), [y, b];
}
function Sz(t) {
  const e = Te(t);
  let n;
  const i = Te([]);
  function o(r) {
    i.value.push(r), Gt.cancel(n), n = Gt(() => {
      const a = i.value;
      i.value = [], a.forEach((l) => {
        e.value = l(e.value);
      });
    });
  }
  return tn(() => {
    Gt.cancel(n);
  }), [e, o];
}
function wue(t) {
  const e = de(null), n = de();
  function i() {
    clearTimeout(n.value);
  }
  function o(a) {
    e.value = a, i(), n.value = setTimeout(() => {
      e.value = null, n.value = void 0;
    }, 100);
  }
  function r() {
    return e.value;
  }
  return tn(() => {
    i();
  }), [o, r];
}
function Cue(t, e, n) {
  return A(() => {
    const o = [], r = [];
    let a = 0, l = 0;
    const s = t.value, u = e.value, c = n.value;
    for (let d = 0; d < u; d += 1)
      if (c === "rtl") {
        r[d] = l, l += s[d] || 0;
        const f = u - d - 1;
        o[f] = a, a += s[f] || 0;
      } else {
        o[d] = a, a += s[d] || 0;
        const f = u - d - 1;
        r[f] = l, l += s[f] || 0;
      }
    return {
      left: o,
      right: r
    };
  });
}
var $ue = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
function wz(t) {
  let {
    colWidths: e,
    columns: n,
    columCount: i
  } = t;
  const o = [], r = i || n.length;
  let a = !1;
  for (let l = r - 1; l >= 0; l -= 1) {
    const s = e[l], u = n && n[l], c = u && u[pf];
    if (s || c || a) {
      const d = c || {}, {
        columnType: f
      } = d, h = $ue(d, ["columnType"]);
      o.unshift(v("col", J({
        key: l,
        style: {
          width: typeof s == "number" ? `${s}px` : s
        }
      }, h), null)), a = !0;
    }
  }
  return v("colgroup", null, [o]);
}
function oS(t, e) {
  let {
    slots: n
  } = e;
  var i;
  return v("div", null, [(i = n.default) === null || i === void 0 ? void 0 : i.call(n)]);
}
oS.displayName = "Panel";
let kue = 0;
const Tue = Oe({
  name: "TableSummary",
  props: ["fixed"],
  setup(t, e) {
    let {
      slots: n
    } = e;
    const i = Bl(), o = `table-summary-uni-key-${++kue}`, r = A(() => t.fixed === "" || t.fixed);
    return zt(() => {
      i.summaryCollect(o, r.value);
    }), tn(() => {
      i.summaryCollect(o, !1);
    }), () => {
      var a;
      return (a = n.default) === null || a === void 0 ? void 0 : a.call(n);
    };
  }
}), Pue = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ATableSummaryRow",
  setup(t, e) {
    let {
      slots: n
    } = e;
    return () => {
      var i;
      return v("tr", null, [(i = n.default) === null || i === void 0 ? void 0 : i.call(n)]);
    };
  }
}), Cz = Symbol("SummaryContextProps"), Eue = (t) => {
  Xt(Cz, t);
}, _ue = () => qt(Cz, {}), Iue = Oe({
  name: "ATableSummaryCell",
  props: ["index", "colSpan", "rowSpan", "align"],
  setup(t, e) {
    let {
      attrs: n,
      slots: i
    } = e;
    const o = Bl(), r = _ue();
    return () => {
      const {
        index: a,
        colSpan: l = 1,
        rowSpan: s,
        align: u
      } = t, {
        prefixCls: c,
        direction: d
      } = o, {
        scrollColumnIndex: f,
        stickyOffsets: h,
        flattenColumns: p
      } = r, m = a + l - 1 + 1 === f ? l + 1 : l, y = V$(a, a + m - 1, p, h, d);
      return v(By, J({
        class: n.class,
        index: a,
        component: "td",
        prefixCls: c,
        record: null,
        dataIndex: null,
        align: u,
        colSpan: m,
        rowSpan: s,
        customRender: () => {
          var b;
          return (b = i.default) === null || b === void 0 ? void 0 : b.call(i);
        }
      }, y), null);
    };
  }
}), Sm = Oe({
  name: "TableFooter",
  inheritAttrs: !1,
  props: ["stickyOffsets", "flattenColumns"],
  setup(t, e) {
    let {
      slots: n
    } = e;
    const i = Bl();
    return Eue(Bn({
      stickyOffsets: on(t, "stickyOffsets"),
      flattenColumns: on(t, "flattenColumns"),
      scrollColumnIndex: A(() => {
        const o = t.flattenColumns.length - 1, r = t.flattenColumns[o];
        return r?.scrollbar ? o : null;
      })
    })), () => {
      var o;
      const {
        prefixCls: r
      } = i;
      return v("tfoot", {
        class: `${r}-summary`
      }, [(o = n.default) === null || o === void 0 ? void 0 : o.call(n)]);
    };
  }
}), Mue = Tue;
function Aue(t) {
  let {
    prefixCls: e,
    record: n,
    onExpand: i,
    expanded: o,
    expandable: r
  } = t;
  const a = `${e}-row-expand-icon`;
  if (!r)
    return v("span", {
      class: [a, `${e}-row-spaced`]
    }, null);
  const l = (s) => {
    i(n, s), s.stopPropagation();
  };
  return v("span", {
    class: {
      [a]: !0,
      [`${e}-row-expanded`]: o,
      [`${e}-row-collapsed`]: !o
    },
    onClick: l
  }, null);
}
function Rue(t, e, n) {
  const i = [];
  function o(r) {
    (r || []).forEach((a, l) => {
      i.push(e(a, l)), o(a[n]);
    });
  }
  return o(t), i;
}
const Due = Oe({
  name: "StickyScrollBar",
  inheritAttrs: !1,
  props: ["offsetScroll", "container", "scrollBodyRef", "scrollBodySizeInfo"],
  emits: ["scroll"],
  setup(t, e) {
    let {
      emit: n,
      expose: i
    } = e;
    const o = Bl(), r = Te(0), a = Te(0), l = Te(0);
    zt(() => {
      r.value = t.scrollBodySizeInfo.scrollWidth || 0, a.value = t.scrollBodySizeInfo.clientWidth || 0, l.value = r.value && a.value * (a.value / r.value);
    }, {
      flush: "post"
    });
    const s = Te(), [u, c] = Sz({
      scrollLeft: 0,
      isHiddenScrollBar: !0
    }), d = de({
      delta: 0,
      x: 0
    }), f = Te(!1), h = () => {
      f.value = !1;
    }, p = (O) => {
      d.value = {
        delta: O.pageX - u.value.scrollLeft,
        x: 0
      }, f.value = !0, O.preventDefault();
    }, g = (O) => {
      const {
        buttons: E
      } = O || window?.event;
      if (!f.value || E === 0) {
        f.value && (f.value = !1);
        return;
      }
      let _ = d.value.x + O.pageX - d.value.x - d.value.delta;
      _ <= 0 && (_ = 0), _ + l.value >= a.value && (_ = a.value - l.value), n("scroll", {
        scrollLeft: _ / a.value * (r.value + 2)
      }), d.value.x = O.pageX;
    }, m = () => {
      if (!t.scrollBodyRef.value)
        return;
      const O = i2(t.scrollBodyRef.value).top, E = O + t.scrollBodyRef.value.offsetHeight, _ = t.container === window ? document.documentElement.scrollTop + window.innerHeight : i2(t.container).top + t.container.clientHeight;
      E - qv() <= _ || O >= _ - t.offsetScroll ? c((D) => k(k({}, D), {
        isHiddenScrollBar: !0
      })) : c((D) => k(k({}, D), {
        isHiddenScrollBar: !1
      }));
    };
    i({
      setScrollLeft: (O) => {
        c((E) => k(k({}, E), {
          scrollLeft: O / r.value * a.value || 0
        }));
      }
    });
    let b = null, w = null, $ = null, C = null;
    Lt(() => {
      b = So(document.body, "mouseup", h, !1), w = So(document.body, "mousemove", g, !1), $ = So(window, "resize", m, !1);
    }), kA(() => {
      rn(() => {
        m();
      });
    }), Lt(() => {
      setTimeout(() => {
        _e([l, f], () => {
          m();
        }, {
          immediate: !0,
          flush: "post"
        });
      });
    }), _e(() => t.container, () => {
      C?.remove(), C = So(t.container, "scroll", m, !1);
    }, {
      immediate: !0,
      flush: "post"
    }), tn(() => {
      b?.remove(), w?.remove(), C?.remove(), $?.remove();
    }), _e(() => k({}, u.value), (O, E) => {
      O.isHiddenScrollBar !== E?.isHiddenScrollBar && !O.isHiddenScrollBar && c((_) => {
        const D = t.scrollBodyRef.value;
        return D ? k(k({}, _), {
          scrollLeft: D.scrollLeft / D.scrollWidth * D.clientWidth
        }) : _;
      });
    }, {
      immediate: !0
    });
    const P = qv();
    return () => {
      if (r.value <= a.value || !l.value || u.value.isHiddenScrollBar)
        return null;
      const {
        prefixCls: O
      } = o;
      return v("div", {
        style: {
          height: `${P}px`,
          width: `${a.value}px`,
          bottom: `${t.offsetScroll}px`
        },
        class: `${O}-sticky-scroll`
      }, [v("div", {
        onMousedown: p,
        ref: s,
        class: Ae(`${O}-sticky-scroll-bar`, {
          [`${O}-sticky-scroll-bar-active`]: f.value
        }),
        style: {
          width: `${l.value}px`,
          transform: `translate3d(${u.value.scrollLeft}px, 0, 0)`
        }
      }, null)]);
    };
  }
}), O_ = Or() ? window : null;
function Nue(t, e) {
  return A(() => {
    const {
      offsetHeader: n = 0,
      offsetSummary: i = 0,
      offsetScroll: o = 0,
      getContainer: r = () => O_
    } = typeof t.value == "object" ? t.value : {}, a = r() || O_, l = !!t.value;
    return {
      isSticky: l,
      stickyClassName: l ? `${e.value}-sticky-holder` : "",
      offsetHeader: n,
      offsetSummary: i,
      offsetScroll: o,
      container: a
    };
  });
}
function Lue(t, e) {
  return A(() => {
    const n = [], i = t.value, o = e.value;
    for (let r = 0; r < o; r += 1) {
      const a = i[r];
      if (a !== void 0)
        n[r] = a;
      else
        return null;
    }
    return n;
  });
}
const S_ = Oe({
  name: "FixedHolder",
  inheritAttrs: !1,
  props: ["columns", "flattenColumns", "stickyOffsets", "customHeaderRow", "noData", "maxContentScroll", "colWidths", "columCount", "direction", "fixHeader", "stickyTopOffset", "stickyBottomOffset", "stickyClassName"],
  emits: ["scroll"],
  setup(t, e) {
    let {
      attrs: n,
      slots: i,
      emit: o
    } = e;
    const r = Bl(), a = A(() => r.isSticky && !t.fixHeader ? 0 : r.scrollbarSize), l = de(), s = (g) => {
      const {
        currentTarget: m,
        deltaX: y
      } = g;
      y && (o("scroll", {
        currentTarget: m,
        scrollLeft: m.scrollLeft + y
      }), g.preventDefault());
    }, u = de();
    Lt(() => {
      rn(() => {
        u.value = So(l.value, "wheel", s);
      });
    }), tn(() => {
      var g;
      (g = u.value) === null || g === void 0 || g.remove();
    });
    const c = A(() => t.flattenColumns.every((g) => g.width && g.width !== 0 && g.width !== "0px")), d = de([]), f = de([]);
    zt(() => {
      const g = t.flattenColumns[t.flattenColumns.length - 1], m = {
        fixed: g ? g.fixed : null,
        scrollbar: !0,
        customHeaderCell: () => ({
          class: `${r.prefixCls}-cell-scrollbar`
        })
      };
      d.value = a.value ? [...t.columns, m] : t.columns, f.value = a.value ? [...t.flattenColumns, m] : t.flattenColumns;
    });
    const h = A(() => {
      const {
        stickyOffsets: g,
        direction: m
      } = t, {
        right: y,
        left: b
      } = g;
      return k(k({}, g), {
        left: m === "rtl" ? [...b.map((w) => w + a.value), 0] : b,
        right: m === "rtl" ? y : [...y.map((w) => w + a.value), 0],
        isSticky: r.isSticky
      });
    }), p = Lue(on(t, "colWidths"), on(t, "columCount"));
    return () => {
      var g;
      const {
        noData: m,
        columCount: y,
        stickyTopOffset: b,
        stickyBottomOffset: w,
        stickyClassName: $,
        maxContentScroll: C
      } = t, {
        isSticky: P
      } = r;
      return v("div", {
        style: k({
          overflow: "hidden"
        }, P ? {
          top: `${b}px`,
          bottom: `${w}px`
        } : {}),
        ref: l,
        class: Ae(n.class, {
          [$]: !!$
        })
      }, [v("table", {
        style: {
          tableLayout: "fixed",
          visibility: m || p.value ? null : "hidden"
        }
      }, [(!m || !C || c.value) && v(wz, {
        colWidths: p.value ? [...p.value, a.value] : [],
        columCount: y + 1,
        columns: f.value
      }, null), (g = i.default) === null || g === void 0 ? void 0 : g.call(i, k(k({}, t), {
        stickyOffsets: h.value,
        columns: d.value,
        flattenColumns: f.value
      }))])]);
    };
  }
});
function w_(t) {
  for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
    n[i - 1] = arguments[i];
  return Bn(oB(n.map((o) => [o, on(t, o)])));
}
const zue = [], Bue = {}, rS = "rc-table-internal-hook", Fue = Oe({
  name: "VcTable",
  inheritAttrs: !1,
  props: ["prefixCls", "data", "columns", "rowKey", "tableLayout", "scroll", "rowClassName", "title", "footer", "id", "showHeader", "components", "customRow", "customHeaderRow", "direction", "expandFixed", "expandColumnWidth", "expandedRowKeys", "defaultExpandedRowKeys", "expandedRowRender", "expandRowByClick", "expandIcon", "onExpand", "onExpandedRowsChange", "onUpdate:expandedRowKeys", "defaultExpandAllRows", "indentSize", "expandIconColumnIndex", "expandedRowClassName", "childrenColumnName", "rowExpandable", "sticky", "transformColumns", "internalHooks", "internalRefs", "canExpandable", "onUpdateInternalRefs", "transformCellText"],
  emits: ["expand", "expandedRowsChange", "updateInternalRefs", "update:expandedRowKeys"],
  setup(t, e) {
    let {
      attrs: n,
      slots: i,
      emit: o
    } = e;
    const r = A(() => t.data || zue), a = A(() => !!r.value.length), l = A(() => Zse(t.components, {})), s = ($e, Le) => fz(l.value, $e) || Le, u = A(() => {
      const $e = t.rowKey;
      return typeof $e == "function" ? $e : (Le) => {
        const Ke = Le && Le[$e];
        return process.env.NODE_ENV !== "production" && Nn(Ke !== void 0, "Each record in table should have a unique `key` prop, or set `rowKey` to an unique primary key."), Ke;
      };
    }), c = A(() => t.expandIcon || Aue), d = A(() => t.childrenColumnName || "children"), f = A(() => t.expandedRowRender ? "row" : t.canExpandable || r.value.some(($e) => $e && typeof $e == "object" && $e[d.value]) ? "nest" : !1), h = Te([]);
    zt(() => {
      t.defaultExpandedRowKeys && (h.value = t.defaultExpandedRowKeys), t.defaultExpandAllRows && (h.value = Rue(r.value, u.value, d.value));
    })();
    const g = A(() => new Set(t.expandedRowKeys || h.value || [])), m = ($e) => {
      const Le = u.value($e, r.value.indexOf($e));
      let Ke;
      const qe = g.value.has(Le);
      qe ? (g.value.delete(Le), Ke = [...g.value]) : Ke = [...g.value, Le], h.value = Ke, o("expand", !qe, $e), o("update:expandedRowKeys", Ke), o("expandedRowsChange", Ke);
    };
    process.env.NODE_ENV !== "production" && t.expandedRowRender && r.value.some(($e) => Array.isArray($e?.[d.value])) && Nn(!1, "`expandedRowRender` should not use with nested Table");
    const y = de(0), [b, w] = Sue(k(k({}, _c(t)), {
      // children,
      expandable: A(() => !!t.expandedRowRender),
      expandedKeys: g,
      getRowKey: u,
      onTriggerExpand: m,
      expandIcon: c
    }), A(() => t.internalHooks === rS ? t.transformColumns : null)), $ = A(() => ({
      columns: b.value,
      flattenColumns: w.value
    })), C = de(), P = de(), O = de(), E = de({
      scrollWidth: 0,
      clientWidth: 0
    }), _ = de(), [D, M] = zn(!1), [N, L] = zn(!1), [j, B] = Sz(/* @__PURE__ */ new Map()), Y = A(() => zy(w.value)), Q = A(() => Y.value.map(($e) => j.value.get($e))), G = A(() => w.value.length), V = Cue(Q, G, on(t, "direction")), H = A(() => t.scroll && tS(t.scroll.y)), q = A(() => t.scroll && tS(t.scroll.x) || !!t.expandFixed), K = A(() => q.value && w.value.some(($e) => {
      let {
        fixed: Le
      } = $e;
      return Le;
    })), ee = de(), ie = Nue(on(t, "sticky"), on(t, "prefixCls")), ae = Bn({}), te = A(() => {
      const $e = Object.values(ae)[0];
      return (H.value || ie.value.isSticky) && $e;
    }), U = ($e, Le) => {
      Le ? ae[$e] = Le : delete ae[$e];
    }, me = de({}), ce = de({}), ue = de({});
    zt(() => {
      H.value && (ce.value = {
        overflowY: "scroll",
        maxHeight: yc(t.scroll.y)
      }), q.value && (me.value = {
        overflowX: "auto"
      }, H.value || (ce.value = {
        overflowY: "hidden"
      }), ue.value = {
        width: t.scroll.x === !0 ? "auto" : yc(t.scroll.x),
        minWidth: "100%"
      });
    });
    const fe = ($e, Le) => {
      hy(C.value) && B((Ke) => {
        if (Ke.get($e) !== Le) {
          const qe = new Map(Ke);
          return qe.set($e, Le), qe;
        }
        return Ke;
      });
    }, [he, le] = wue();
    function ke($e, Le) {
      if (!Le)
        return;
      if (typeof Le == "function") {
        Le($e);
        return;
      }
      const Ke = Le.$el || Le;
      Ke.scrollLeft !== $e && (Ke.scrollLeft = $e);
    }
    const ze = ($e) => {
      let {
        currentTarget: Le,
        scrollLeft: Ke
      } = $e;
      var qe;
      const rt = t.direction === "rtl", De = typeof Ke == "number" ? Ke : Le.scrollLeft, Be = Le || Bue;
      if ((!le() || le() === Be) && (he(Be), ke(De, P.value), ke(De, O.value), ke(De, _.value), ke(De, (qe = ee.value) === null || qe === void 0 ? void 0 : qe.setScrollLeft)), Le) {
        const {
          scrollWidth: je,
          clientWidth: at
        } = Le;
        rt ? (M(-De < je - at), L(-De > 0)) : (M(De > 0), L(De < je - at));
      }
    }, Re = () => {
      q.value && O.value ? ze({
        currentTarget: O.value
      }) : (M(!1), L(!1));
    };
    let Ye;
    const Ne = ($e) => {
      $e !== y.value && (Re(), y.value = C.value ? C.value.offsetWidth : $e);
    }, Fe = ($e) => {
      let {
        width: Le
      } = $e;
      if (clearTimeout(Ye), y.value === 0) {
        Ne(Le);
        return;
      }
      Ye = setTimeout(() => {
        Ne(Le);
      }, 100);
    };
    _e([q, () => t.data, () => t.columns], () => {
      q.value && Re();
    }, {
      flush: "post"
    });
    const [We, nt] = zn(0);
    nue(), Lt(() => {
      rn(() => {
        var $e, Le;
        Re(), nt(VX(O.value).width), E.value = {
          scrollWidth: (($e = O.value) === null || $e === void 0 ? void 0 : $e.scrollWidth) || 0,
          clientWidth: ((Le = O.value) === null || Le === void 0 ? void 0 : Le.clientWidth) || 0
        };
      });
    }), Ns(() => {
      rn(() => {
        var $e, Le;
        const Ke = (($e = O.value) === null || $e === void 0 ? void 0 : $e.scrollWidth) || 0, qe = ((Le = O.value) === null || Le === void 0 ? void 0 : Le.clientWidth) || 0;
        (E.value.scrollWidth !== Ke || E.value.clientWidth !== qe) && (E.value = {
          scrollWidth: Ke,
          clientWidth: qe
        });
      });
    }), zt(() => {
      t.internalHooks === rS && t.internalRefs && t.onUpdateInternalRefs({
        body: O.value ? O.value.$el || O.value : null
      });
    }, {
      flush: "post"
    });
    const Qe = A(() => t.tableLayout ? t.tableLayout : K.value ? t.scroll.x === "max-content" ? "auto" : "fixed" : H.value || ie.value.isSticky || w.value.some(($e) => {
      let {
        ellipsis: Le
      } = $e;
      return Le;
    }) ? "fixed" : "auto"), Pe = () => {
      var $e;
      return a.value ? null : (($e = i.emptyText) === null || $e === void 0 ? void 0 : $e.call(i)) || "No Data";
    };
    Kse(Bn(k(k({}, _c(w_(t, "prefixCls", "direction", "transformCellText"))), {
      getComponent: s,
      scrollbarSize: We,
      fixedInfoList: A(() => w.value.map(($e, Le) => V$(Le, Le, w.value, V.value, t.direction))),
      isSticky: A(() => ie.value.isSticky),
      summaryCollect: U
    }))), hue(Bn(k(k({}, _c(w_(t, "rowClassName", "expandedRowClassName", "expandRowByClick", "expandedRowRender", "expandIconColumnIndex", "indentSize"))), {
      columns: b,
      flattenColumns: w,
      tableLayout: Qe,
      expandIcon: c,
      expandableType: f,
      onTriggerExpand: m
    }))), mue({
      onColumnResize: fe
    }), cue({
      componentWidth: y,
      fixHeader: H,
      fixColumn: K,
      horizonScroll: q
    });
    const Ze = () => v(yue, {
      data: r.value,
      measureColumnWidth: H.value || q.value || ie.value.isSticky,
      expandedKeys: g.value,
      rowExpandable: t.rowExpandable,
      getRowKey: u.value,
      customRow: t.customRow,
      childrenColumnName: d.value
    }, {
      emptyNode: Pe
    }), Ce = () => v(wz, {
      colWidths: w.value.map(($e) => {
        let {
          width: Le
        } = $e;
        return Le;
      }),
      columns: w.value
    }, null);
    return () => {
      var $e;
      const {
        prefixCls: Le,
        scroll: Ke,
        tableLayout: qe,
        direction: rt,
        // Additional Part
        title: De = i.title,
        footer: Be = i.footer,
        // Customize
        id: je,
        showHeader: at,
        customHeaderRow: mt
      } = t, {
        isSticky: st,
        offsetHeader: gt,
        offsetSummary: Et,
        offsetScroll: It,
        stickyClassName: _t,
        container: wt
      } = ie.value, Nt = s(["table"], "table"), nn = s(["body"]), sn = ($e = i.summary) === null || $e === void 0 ? void 0 : $e.call(i, {
        pageData: r.value
      });
      let xn = () => null;
      const Pn = {
        colWidths: Q.value,
        columCount: w.value.length,
        stickyOffsets: V.value,
        customHeaderRow: mt,
        fixHeader: H.value,
        scroll: Ke
      };
      if (process.env.NODE_ENV !== "production" && typeof nn == "function" && a.value && !H.value && Nn(!1, "`components.body` with render props is only work on `scroll.y`."), H.value || st) {
        let En = () => null;
        typeof nn == "function" ? (En = () => nn(r.value, {
          scrollbarSize: We.value,
          ref: O,
          onScroll: ze
        }), Pn.colWidths = w.value.map((Ri, zo) => {
          let {
            width: Ue
          } = Ri;
          const yt = zo === b.value.length - 1 ? Ue - We.value : Ue;
          return typeof yt == "number" && !Number.isNaN(yt) ? yt : (Nn(!1, "When use `components.body` with render props. Each column should have a fixed `width` value."), 0);
        })) : En = () => v("div", {
          style: k(k({}, me.value), ce.value),
          onScroll: ze,
          ref: O,
          class: Ae(`${Le}-body`)
        }, [v(Nt, {
          style: k(k({}, ue.value), {
            tableLayout: Qe.value
          })
        }, {
          default: () => [Ce(), Ze(), !te.value && sn && v(Sm, {
            stickyOffsets: V.value,
            flattenColumns: w.value
          }, {
            default: () => [sn]
          })]
        })]);
        const di = k(k(k({
          noData: !r.value.length,
          maxContentScroll: q.value && Ke.x === "max-content"
        }, Pn), $.value), {
          direction: rt,
          stickyClassName: _t,
          onScroll: ze
        });
        xn = () => v(tt, null, [at !== !1 && v(S_, J(J({}, di), {}, {
          stickyTopOffset: gt,
          class: `${Le}-header`,
          ref: P
        }), {
          default: (Ri) => v(tt, null, [v(x_, Ri, null), te.value === "top" && v(Sm, Ri, {
            default: () => [sn]
          })])
        }), En(), te.value && te.value !== "top" && v(S_, J(J({}, di), {}, {
          stickyBottomOffset: Et,
          class: `${Le}-summary`,
          ref: _
        }), {
          default: (Ri) => v(Sm, Ri, {
            default: () => [sn]
          })
        }), st && O.value && v(Due, {
          ref: ee,
          offsetScroll: It,
          scrollBodyRef: O,
          onScroll: ze,
          container: wt,
          scrollBodySizeInfo: E.value
        }, null)]);
      } else
        xn = () => v("div", {
          style: k(k({}, me.value), ce.value),
          class: Ae(`${Le}-content`),
          onScroll: ze,
          ref: O
        }, [v(Nt, {
          style: k(k({}, ue.value), {
            tableLayout: Qe.value
          })
        }, {
          default: () => [Ce(), at !== !1 && v(x_, J(J({}, Pn), $.value), null), Ze(), sn && v(Sm, {
            stickyOffsets: V.value,
            flattenColumns: w.value
          }, {
            default: () => [sn]
          })]
        })]);
      const bt = rd(n, {
        aria: !0,
        data: !0
      }), Xn = () => v("div", J(J({}, bt), {}, {
        class: Ae(Le, {
          [`${Le}-rtl`]: rt === "rtl",
          [`${Le}-ping-left`]: D.value,
          [`${Le}-ping-right`]: N.value,
          [`${Le}-layout-fixed`]: qe === "fixed",
          [`${Le}-fixed-header`]: H.value,
          /** No used but for compatible */
          [`${Le}-fixed-column`]: K.value,
          [`${Le}-scroll-horizontal`]: q.value,
          [`${Le}-has-fix-left`]: w.value[0] && w.value[0].fixed,
          [`${Le}-has-fix-right`]: w.value[G.value - 1] && w.value[G.value - 1].fixed === "right",
          [n.class]: n.class
        }),
        style: n.style,
        id: je,
        ref: C
      }), [De && v(oS, {
        class: `${Le}-title`
      }, {
        default: () => [De(r.value)]
      }), v("div", {
        class: `${Le}-container`
      }, [xn()]), Be && v(oS, {
        class: `${Le}-footer`
      }, {
        default: () => [Be(r.value)]
      })]);
      return q.value ? v(Mu, {
        onResize: Fe
      }, {
        default: Xn
      }) : Xn();
    };
  }
});
function Vue() {
  const t = k({}, arguments.length <= 0 ? void 0 : arguments[0]);
  for (let e = 1; e < arguments.length; e++) {
    const n = e < 0 || arguments.length <= e ? void 0 : arguments[e];
    n && Object.keys(n).forEach((i) => {
      const o = n[i];
      o !== void 0 && (t[i] = o);
    });
  }
  return t;
}
const aS = 10;
function Que(t, e) {
  const n = {
    current: t.current,
    pageSize: t.pageSize
  };
  return Object.keys(e && typeof e == "object" ? e : {}).forEach((o) => {
    const r = t[o];
    typeof r != "function" && (n[o] = r);
  }), n;
}
function Hue(t, e, n) {
  const i = A(() => e.value && typeof e.value == "object" ? e.value : {}), o = A(() => i.value.total || 0), [r, a] = zn(() => ({
    current: "defaultCurrent" in i.value ? i.value.defaultCurrent : 1,
    pageSize: "defaultPageSize" in i.value ? i.value.defaultPageSize : aS
  })), l = A(() => {
    const c = Vue(r.value, i.value, {
      total: o.value > 0 ? o.value : t.value
    }), d = Math.ceil((o.value || t.value) / c.pageSize);
    return c.current > d && (c.current = d || 1), c;
  }), s = (c, d) => {
    e.value !== !1 && a({
      current: c ?? 1,
      pageSize: d || l.value.pageSize
    });
  }, u = (c, d) => {
    var f, h;
    e.value && ((h = (f = i.value).onChange) === null || h === void 0 || h.call(f, c, d)), s(c, d), n(c, d || l.value.pageSize);
  };
  return [A(() => e.value === !1 ? {} : k(k({}, l.value), {
    onChange: u
  })), s];
}
function Wue(t, e, n) {
  const i = Te({});
  _e([t, e, n], () => {
    const r = /* @__PURE__ */ new Map(), a = n.value, l = e.value;
    function s(u) {
      u.forEach((c, d) => {
        const f = a(c, d);
        r.set(f, c), c && typeof c == "object" && l in c && s(c[l] || []);
      });
    }
    s(t.value), i.value = {
      kvMap: r
    };
  }, {
    deep: !0,
    immediate: !0
  });
  function o(r) {
    return i.value.kvMap.get(r);
  }
  return [o];
}
const Ea = {}, lS = "SELECT_ALL", sS = "SELECT_INVERT", uS = "SELECT_NONE", jue = [];
function $z(t, e) {
  let n = [];
  return (e || []).forEach((i) => {
    n.push(i), i && typeof i == "object" && t in i && (n = [...n, ...$z(t, i[t])]);
  }), n;
}
function que(t, e) {
  const n = A(() => {
    const _ = t.value || {}, {
      checkStrictly: D = !0
    } = _;
    return k(k({}, _), {
      checkStrictly: D
    });
  }), [i, o] = er(n.value.selectedRowKeys || n.value.defaultSelectedRowKeys || jue, {
    value: A(() => n.value.selectedRowKeys)
  }), r = Te(/* @__PURE__ */ new Map()), a = (_) => {
    if (n.value.preserveSelectedRowKeys) {
      const D = /* @__PURE__ */ new Map();
      _.forEach((M) => {
        let N = e.getRecordByKey(M);
        !N && r.value.has(M) && (N = r.value.get(M)), D.set(M, N);
      }), r.value = D;
    }
  };
  zt(() => {
    a(i.value);
  });
  const l = A(() => n.value.checkStrictly ? null : x$(e.data.value, {
    externalGetKey: e.getRowKey.value,
    childrenPropName: e.childrenColumnName.value
  }).keyEntities), s = A(() => $z(e.childrenColumnName.value, e.pageData.value)), u = A(() => {
    const _ = /* @__PURE__ */ new Map(), D = e.getRowKey.value, M = n.value.getCheckboxProps;
    return s.value.forEach((N, L) => {
      const j = D(N, L), B = (M ? M(N) : null) || {};
      _.set(j, B), process.env.NODE_ENV !== "production" && ("checked" in B || "defaultChecked" in B) && $n(!1, "Table", "Do not set `checked` or `defaultChecked` in `getCheckboxProps`. Please use `selectedRowKeys` instead.");
    }), _;
  }), {
    maxLevel: c,
    levelEntities: d
  } = q5(l), f = (_) => {
    var D;
    return !!(!((D = u.value.get(e.getRowKey.value(_))) === null || D === void 0) && D.disabled);
  }, h = A(() => {
    if (n.value.checkStrictly)
      return [i.value || [], []];
    const {
      checkedKeys: _,
      halfCheckedKeys: D
    } = ff(i.value, !0, l.value, c.value, d.value, f);
    return [_ || [], D];
  }), p = A(() => h.value[0]), g = A(() => h.value[1]), m = A(() => {
    const _ = n.value.type === "radio" ? p.value.slice(0, 1) : p.value;
    return new Set(_);
  }), y = A(() => n.value.type === "radio" ? /* @__PURE__ */ new Set() : new Set(g.value)), [b, w] = zn(null), $ = (_) => {
    let D, M;
    a(_);
    const {
      preserveSelectedRowKeys: N,
      onChange: L
    } = n.value, {
      getRecordByKey: j
    } = e;
    N ? (D = _, M = _.map((B) => r.value.get(B))) : (D = [], M = [], _.forEach((B) => {
      const Y = j(B);
      Y !== void 0 && (D.push(B), M.push(Y));
    })), o(D), L?.(D, M);
  }, C = (_, D, M, N) => {
    const {
      onSelect: L
    } = n.value, {
      getRecordByKey: j
    } = e || {};
    if (L) {
      const B = M.map((Y) => j(Y));
      L(j(_), D, B, N);
    }
    $(M);
  }, P = A(() => {
    const {
      onSelectInvert: _,
      onSelectNone: D,
      selections: M,
      hideSelectAll: N
    } = n.value, {
      data: L,
      pageData: j,
      getRowKey: B,
      locale: Y
    } = e;
    return !M || N ? null : (M === !0 ? [lS, sS, uS] : M).map((G) => G === lS ? {
      key: "all",
      text: Y.value.selectionAll,
      onSelect() {
        $(L.value.map((V, H) => B.value(V, H)).filter((V) => {
          const H = u.value.get(V);
          return !H?.disabled || m.value.has(V);
        }));
      }
    } : G === sS ? {
      key: "invert",
      text: Y.value.selectInvert,
      onSelect() {
        const V = new Set(m.value);
        j.value.forEach((q, K) => {
          const ee = B.value(q, K), ie = u.value.get(ee);
          ie?.disabled || (V.has(ee) ? V.delete(ee) : V.add(ee));
        });
        const H = Array.from(V);
        _ && ($n(!1, "Table", "`onSelectInvert` will be removed in future. Please use `onChange` instead."), _(H)), $(H);
      }
    } : G === uS ? {
      key: "none",
      text: Y.value.selectNone,
      onSelect() {
        D?.(), $(Array.from(m.value).filter((V) => {
          const H = u.value.get(V);
          return H?.disabled;
        }));
      }
    } : G);
  }), O = A(() => s.value.length);
  return [(_) => {
    var D;
    const {
      onSelectAll: M,
      onSelectMultiple: N,
      columnWidth: L,
      type: j,
      fixed: B,
      renderCell: Y,
      hideSelectAll: Q,
      checkStrictly: G
    } = n.value, {
      prefixCls: V,
      getRecordByKey: H,
      getRowKey: q,
      expandType: K,
      getPopupContainer: ee
    } = e;
    if (!t.value)
      return process.env.NODE_ENV !== "production" && $n(!_.includes(Ea), "Table", "`rowSelection` is not config but `SELECTION_COLUMN` exists in the `columns`."), _.filter((Ne) => Ne !== Ea);
    let ie = _.slice();
    const ae = new Set(m.value), te = s.value.map(q.value).filter((Ne) => !u.value.get(Ne).disabled), U = te.every((Ne) => ae.has(Ne)), me = te.some((Ne) => ae.has(Ne)), ce = () => {
      const Ne = [];
      U ? te.forEach((We) => {
        ae.delete(We), Ne.push(We);
      }) : te.forEach((We) => {
        ae.has(We) || (ae.add(We), Ne.push(We));
      });
      const Fe = Array.from(ae);
      M?.(!U, Fe.map((We) => H(We)), Ne.map((We) => H(We))), $(Fe);
    };
    let ue;
    if (j !== "radio") {
      let Ne;
      if (P.value) {
        const Pe = v(Bi, {
          getPopupContainer: ee.value
        }, {
          default: () => [P.value.map((Ze, Ce) => {
            const {
              key: $e,
              text: Le,
              onSelect: Ke
            } = Ze;
            return v(Bi.Item, {
              key: $e || Ce,
              onClick: () => {
                Ke?.(te);
              }
            }, {
              default: () => [Le]
            });
          })]
        });
        Ne = v("div", {
          class: `${V.value}-selection-extra`
        }, [v(Nr, {
          overlay: Pe,
          getPopupContainer: ee.value
        }, {
          default: () => [v("span", null, [v(hg, null, null)])]
        })]);
      }
      const Fe = s.value.map((Pe, Ze) => {
        const Ce = q.value(Pe, Ze), $e = u.value.get(Ce) || {};
        return k({
          checked: ae.has(Ce)
        }, $e);
      }).filter((Pe) => {
        let {
          disabled: Ze
        } = Pe;
        return Ze;
      }), We = !!Fe.length && Fe.length === O.value, nt = We && Fe.every((Pe) => {
        let {
          checked: Ze
        } = Pe;
        return Ze;
      }), Qe = We && Fe.some((Pe) => {
        let {
          checked: Ze
        } = Pe;
        return Ze;
      });
      ue = !Q && v("div", {
        class: `${V.value}-selection`
      }, [v(fo, {
        checked: We ? nt : !!O.value && U,
        indeterminate: We ? !nt && Qe : !U && me,
        onChange: ce,
        disabled: O.value === 0 || We,
        "aria-label": Ne ? "Custom selection" : "Select all",
        skipGroup: !0
      }, null), Ne]);
    }
    let fe;
    j === "radio" ? fe = (Ne) => {
      let {
        record: Fe,
        index: We
      } = Ne;
      const nt = q.value(Fe, We), Qe = ae.has(nt);
      return {
        node: v(uo, J(J({}, u.value.get(nt)), {}, {
          checked: Qe,
          onClick: (Pe) => Pe.stopPropagation(),
          onChange: (Pe) => {
            ae.has(nt) || C(nt, !0, [nt], Pe.nativeEvent);
          }
        }), null),
        checked: Qe
      };
    } : fe = (Ne) => {
      let {
        record: Fe,
        index: We
      } = Ne;
      var nt;
      const Qe = q.value(Fe, We), Pe = ae.has(Qe), Ze = y.value.has(Qe), Ce = u.value.get(Qe);
      let $e;
      return K.value === "nest" ? ($e = Ze, $n(typeof Ce?.indeterminate != "boolean", "Table", "set `indeterminate` using `rowSelection.getCheckboxProps` is not allowed with tree structured dataSource.")) : $e = (nt = Ce?.indeterminate) !== null && nt !== void 0 ? nt : Ze, {
        node: v(fo, J(J({}, Ce), {}, {
          indeterminate: $e,
          checked: Pe,
          skipGroup: !0,
          onClick: (Le) => Le.stopPropagation(),
          onChange: (Le) => {
            let {
              nativeEvent: Ke
            } = Le;
            const {
              shiftKey: qe
            } = Ke;
            let rt = -1, De = -1;
            if (qe && G) {
              const Be = /* @__PURE__ */ new Set([b.value, Qe]);
              te.some((je, at) => {
                if (Be.has(je))
                  if (rt === -1)
                    rt = at;
                  else
                    return De = at, !0;
                return !1;
              });
            }
            if (De !== -1 && rt !== De && G) {
              const Be = te.slice(rt, De + 1), je = [];
              Pe ? Be.forEach((mt) => {
                ae.has(mt) && (je.push(mt), ae.delete(mt));
              }) : Be.forEach((mt) => {
                ae.has(mt) || (je.push(mt), ae.add(mt));
              });
              const at = Array.from(ae);
              N?.(!Pe, at.map((mt) => H(mt)), je.map((mt) => H(mt))), $(at);
            } else {
              const Be = p.value;
              if (G) {
                const je = Pe ? dl(Be, Qe) : es(Be, Qe);
                C(Qe, !Pe, je, Ke);
              } else {
                const je = ff([...Be, Qe], !0, l.value, c.value, d.value, f), {
                  checkedKeys: at,
                  halfCheckedKeys: mt
                } = je;
                let st = at;
                if (Pe) {
                  const gt = new Set(at);
                  gt.delete(Qe), st = ff(Array.from(gt), {
                    halfCheckedKeys: mt
                  }, l.value, c.value, d.value, f).checkedKeys;
                }
                C(Qe, !Pe, st, Ke);
              }
            }
            w(Qe);
          }
        }), null),
        checked: Pe
      };
    };
    const he = (Ne) => {
      let {
        record: Fe,
        index: We
      } = Ne;
      const {
        node: nt,
        checked: Qe
      } = fe({
        record: Fe,
        index: We
      });
      return Y ? Y(Qe, Fe, We, nt) : nt;
    };
    if (!ie.includes(Ea))
      if (ie.findIndex((Ne) => {
        var Fe;
        return ((Fe = Ne[pf]) === null || Fe === void 0 ? void 0 : Fe.columnType) === "EXPAND_COLUMN";
      }) === 0) {
        const [Ne, ...Fe] = ie;
        ie = [Ne, Ea, ...Fe];
      } else
        ie = [Ea, ...ie];
    const le = ie.indexOf(Ea);
    process.env.NODE_ENV !== "production" && ie.filter((Ne) => Ne === Ea).length > 1 && $n(!1, "Table", "Multiple `SELECTION_COLUMN` exist in `columns`."), ie = ie.filter((Ne, Fe) => Ne !== Ea || Fe === le);
    const ke = ie[le - 1], ze = ie[le + 1];
    let Re = B;
    Re === void 0 && (ze?.fixed !== void 0 ? Re = ze.fixed : ke?.fixed !== void 0 && (Re = ke.fixed)), Re && ke && ((D = ke[pf]) === null || D === void 0 ? void 0 : D.columnType) === "EXPAND_COLUMN" && ke.fixed === void 0 && (ke.fixed = Re);
    const Ye = {
      fixed: Re,
      width: L,
      className: `${V.value}-selection-column`,
      title: n.value.columnTitle || ue,
      customRender: he,
      [pf]: {
        class: `${V.value}-selection-col`
      }
    };
    return ie.map((Ne) => Ne === Ea ? Ye : Ne);
  }, m];
}
var Yue = { icon: { tag: "svg", attrs: { viewBox: "0 0 1024 1024", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z" } }] }, name: "caret-down", theme: "outlined" };
function C_(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(n);
    typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(n).filter(function(o) {
      return Object.getOwnPropertyDescriptor(n, o).enumerable;
    }))), i.forEach(function(o) {
      Kue(t, o, n[o]);
    });
  }
  return t;
}
function Kue(t, e, n) {
  return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
var Q$ = function(e, n) {
  var i = C_({}, e, n.attrs);
  return v(bn, C_({}, i, {
    icon: Yue
  }), null);
};
Q$.displayName = "CaretDownOutlined";
Q$.inheritAttrs = !1;
var Xue = { icon: { tag: "svg", attrs: { viewBox: "0 0 1024 1024", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z" } }] }, name: "caret-up", theme: "outlined" };
function $_(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(n);
    typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(n).filter(function(o) {
      return Object.getOwnPropertyDescriptor(n, o).enumerable;
    }))), i.forEach(function(o) {
      Zue(t, o, n[o]);
    });
  }
  return t;
}
function Zue(t, e, n) {
  return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
var H$ = function(e, n) {
  var i = $_({}, e, n.attrs);
  return v(bn, $_({}, i, {
    icon: Xue
  }), null);
};
H$.displayName = "CaretUpOutlined";
H$.inheritAttrs = !1;
var Gue = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
function Xc(t, e) {
  return "key" in t && t.key !== void 0 && t.key !== null ? t.key : t.dataIndex ? Array.isArray(t.dataIndex) ? t.dataIndex.join(".") : t.dataIndex : e;
}
function $g(t, e) {
  return e ? `${e}-${t}` : `${t}`;
}
function W$(t, e) {
  return typeof t == "function" ? t(e) : t;
}
function kz() {
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
  const e = Wi(t), n = [];
  return e.forEach((i) => {
    var o, r, a, l;
    if (!i)
      return;
    const s = i.key, u = ((o = i.props) === null || o === void 0 ? void 0 : o.style) || {}, c = ((r = i.props) === null || r === void 0 ? void 0 : r.class) || "", d = i.props || {};
    for (const [m, y] of Object.entries(d))
      d[sg(m)] = y;
    const f = i.children || {}, {
      default: h
    } = f, p = Gue(f, ["default"]), g = k(k(k({}, p), d), {
      style: u,
      class: c
    });
    if (s && (g.key = s), !((a = i.type) === null || a === void 0) && a.__ANT_TABLE_COLUMN_GROUP)
      g.children = kz(typeof h == "function" ? h() : h);
    else {
      const m = (l = i.children) === null || l === void 0 ? void 0 : l.default;
      g.customRender = g.customRender || m;
    }
    n.push(g);
  }), n;
}
const xv = "ascend", P1 = "descend";
function u0(t) {
  return typeof t.sorter == "object" && typeof t.sorter.multiple == "number" ? t.sorter.multiple : !1;
}
function k_(t) {
  return typeof t == "function" ? t : t && typeof t == "object" && t.compare ? t.compare : !1;
}
function Uue(t, e) {
  return e ? t[t.indexOf(e) + 1] : t[0];
}
function cS(t, e, n) {
  let i = [];
  function o(r, a) {
    i.push({
      column: r,
      key: Xc(r, a),
      multiplePriority: u0(r),
      sortOrder: r.sortOrder
    });
  }
  return (t || []).forEach((r, a) => {
    const l = $g(a, n);
    r.children ? ("sortOrder" in r && o(r, l), i = [...i, ...cS(r.children, e, l)]) : r.sorter && ("sortOrder" in r ? o(r, l) : e && r.defaultSortOrder && i.push({
      column: r,
      key: Xc(r, l),
      multiplePriority: u0(r),
      sortOrder: r.defaultSortOrder
    }));
  }), i;
}
function Tz(t, e, n, i, o, r, a, l) {
  return (e || []).map((s, u) => {
    const c = $g(u, l);
    let d = s;
    if (d.sorter) {
      const f = d.sortDirections || o, h = d.showSorterTooltip === void 0 ? a : d.showSorterTooltip, p = Xc(d, c), g = n.find((_) => {
        let {
          key: D
        } = _;
        return D === p;
      }), m = g ? g.sortOrder : null, y = Uue(f, m), b = f.includes(xv) && v(H$, {
        class: Ae(`${t}-column-sorter-up`, {
          active: m === xv
        }),
        role: "presentation"
      }, null), w = f.includes(P1) && v(Q$, {
        role: "presentation",
        class: Ae(`${t}-column-sorter-down`, {
          active: m === P1
        })
      }, null), {
        cancelSort: $,
        triggerAsc: C,
        triggerDesc: P
      } = r || {};
      let O = $;
      y === P1 ? O = P : y === xv && (O = C);
      const E = typeof h == "object" ? h : {
        title: O
      };
      d = k(k({}, d), {
        className: Ae(d.className, {
          [`${t}-column-sort`]: m
        }),
        title: (_) => {
          const D = v("div", {
            class: `${t}-column-sorters`
          }, [v("span", {
            class: `${t}-column-title`
          }, [W$(s.title, _)]), v("span", {
            class: Ae(`${t}-column-sorter`, {
              [`${t}-column-sorter-full`]: !!(b && w)
            })
          }, [v("span", {
            class: `${t}-column-sorter-inner`
          }, [b, w])])]);
          return h ? v(zi, E, {
            default: () => [D]
          }) : D;
        },
        customHeaderCell: (_) => {
          const D = s.customHeaderCell && s.customHeaderCell(_) || {}, M = D.onClick, N = D.onKeydown;
          return D.onClick = (L) => {
            i({
              column: s,
              key: p,
              sortOrder: y,
              multiplePriority: u0(s)
            }), M && M(L);
          }, D.onKeydown = (L) => {
            L.keyCode === lt.ENTER && (i({
              column: s,
              key: p,
              sortOrder: y,
              multiplePriority: u0(s)
            }), N?.(L));
          }, m && (D["aria-sort"] = m === "ascend" ? "ascending" : "descending"), D.class = Ae(D.class, `${t}-column-has-sorters`), D.tabindex = 0, D;
        }
      });
    }
    return "children" in d && (d = k(k({}, d), {
      children: Tz(t, d.children, n, i, o, r, a, c)
    })), d;
  });
}
function T_(t) {
  const {
    column: e,
    sortOrder: n
  } = t;
  return {
    column: e,
    order: n,
    field: e.dataIndex,
    columnKey: e.key
  };
}
function P_(t) {
  const e = t.filter((n) => {
    let {
      sortOrder: i
    } = n;
    return i;
  }).map(T_);
  return e.length === 0 && t.length ? k(k({}, T_(t[t.length - 1])), {
    column: void 0
  }) : e.length <= 1 ? e[0] || {} : e;
}
function dS(t, e, n) {
  const i = e.slice().sort((a, l) => l.multiplePriority - a.multiplePriority), o = t.slice(), r = i.filter((a) => {
    let {
      column: {
        sorter: l
      },
      sortOrder: s
    } = a;
    return k_(l) && s;
  });
  return r.length ? o.sort((a, l) => {
    for (let s = 0; s < r.length; s += 1) {
      const u = r[s], {
        column: {
          sorter: c
        },
        sortOrder: d
      } = u, f = k_(c);
      if (f && d) {
        const h = f(a, l, d);
        if (h !== 0)
          return d === xv ? h : -h;
      }
    }
    return 0;
  }).map((a) => {
    const l = a[n];
    return l ? k(k({}, a), {
      [n]: dS(l, e, n)
    }) : a;
  }) : o;
}
function Jue(t) {
  let {
    prefixCls: e,
    mergedColumns: n,
    onSorterChange: i,
    sortDirections: o,
    tableLocale: r,
    showSorterTooltip: a
  } = t;
  const [l, s] = zn(cS(n.value, !0)), u = A(() => {
    let p = !0;
    const g = cS(n.value, !1);
    if (!g.length)
      return l.value;
    const m = [];
    function y(w) {
      p ? m.push(w) : m.push(k(k({}, w), {
        sortOrder: null
      }));
    }
    let b = null;
    return g.forEach((w) => {
      b === null ? (y(w), w.sortOrder && (w.multiplePriority === !1 ? p = !1 : b = !0)) : (b && w.multiplePriority !== !1 || (p = !1), y(w));
    }), m;
  }), c = A(() => {
    const p = u.value.map((g) => {
      let {
        column: m,
        sortOrder: y
      } = g;
      return {
        column: m,
        order: y
      };
    });
    return {
      sortColumns: p,
      // Legacy
      sortColumn: p[0] && p[0].column,
      sortOrder: p[0] && p[0].order
    };
  });
  function d(p) {
    let g;
    p.multiplePriority === !1 || !u.value.length || u.value[0].multiplePriority === !1 ? g = [p] : g = [...u.value.filter((m) => {
      let {
        key: y
      } = m;
      return y !== p.key;
    }), p], s(g), i(P_(g), g);
  }
  const f = (p) => Tz(e.value, p, u.value, d, o.value, r.value, a.value), h = A(() => P_(u.value));
  return [f, u, c, h];
}
var ece = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M349 838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V642H349v196zm531.1-684H143.9c-24.5 0-39.8 26.7-27.5 48l221.3 376h348.8l221.3-376c12.1-21.3-3.2-48-27.7-48z" } }] }, name: "filter", theme: "filled" };
function E_(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(n);
    typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(n).filter(function(o) {
      return Object.getOwnPropertyDescriptor(n, o).enumerable;
    }))), i.forEach(function(o) {
      tce(t, o, n[o]);
    });
  }
  return t;
}
function tce(t, e, n) {
  return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
var j$ = function(e, n) {
  var i = E_({}, e, n.attrs);
  return v(bn, E_({}, i, {
    icon: ece
  }), null);
};
j$.displayName = "FilterFilled";
j$.inheritAttrs = !1;
const nce = (t) => {
  const {
    keyCode: e
  } = t;
  e === lt.ENTER && t.stopPropagation();
}, ice = (t, e) => {
  let {
    slots: n
  } = e;
  var i;
  return v("div", {
    onClick: (o) => o.stopPropagation(),
    onKeydown: nce
  }, [(i = n.default) === null || i === void 0 ? void 0 : i.call(n)]);
}, __ = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "FilterSearch",
  inheritAttrs: !1,
  props: {
    value: yn(),
    onChange: ot(),
    filterSearch: pn([Boolean, Function]),
    tablePrefixCls: yn(),
    locale: Vt()
  },
  setup(t) {
    return () => {
      const {
        value: e,
        onChange: n,
        filterSearch: i,
        tablePrefixCls: o,
        locale: r
      } = t;
      return i ? v("div", {
        class: `${o}-filter-dropdown-search`
      }, [v(jt, {
        placeholder: r.filterSearchPlaceholder,
        onChange: n,
        value: e,
        htmlSize: 1,
        class: `${o}-filter-dropdown-search-input`
      }, {
        prefix: () => v(pg, null, null)
      })]) : null;
    };
  }
});
var I_ = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
const oce = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "MotionTreeNode",
  inheritAttrs: !1,
  props: k(k({}, Q5), {
    active: Boolean,
    motion: Object,
    motionNodes: {
      type: Array
    },
    onMotionStart: Function,
    onMotionEnd: Function,
    motionType: String
  }),
  setup(t, e) {
    let {
      attrs: n,
      slots: i
    } = e;
    const o = Te(!0), r = y$(), a = Te(!1), l = A(() => t.motion ? t.motion : Sy()), s = (u, c) => {
      var d, f, h, p;
      c === "appear" ? (f = (d = l.value) === null || d === void 0 ? void 0 : d.onAfterEnter) === null || f === void 0 || f.call(d, u) : c === "leave" && ((p = (h = l.value) === null || h === void 0 ? void 0 : h.onAfterLeave) === null || p === void 0 || p.call(h, u)), a.value || t.onMotionEnd(), a.value = !0;
    };
    return _e(() => t.motionNodes, () => {
      t.motionNodes && t.motionType === "hide" && o.value && rn(() => {
        o.value = !1;
      });
    }, {
      immediate: !0,
      flush: "post"
    }), Lt(() => {
      t.motionNodes && t.onMotionStart();
    }), tn(() => {
      t.motionNodes && s();
    }), () => {
      const {
        motion: u,
        motionNodes: c,
        motionType: d,
        active: f,
        eventKey: h
      } = t, p = I_(t, ["motion", "motionNodes", "motionType", "active", "eventKey"]);
      return c ? v(zr, J(J({}, l.value), {}, {
        appear: d === "show",
        onAfterAppear: (g) => s(g, "appear"),
        onAfterLeave: (g) => s(g, "leave")
      }), {
        default: () => [fa(v("div", {
          class: `${r.value.prefixCls}-treenode-motion`
        }, [c.map((g) => {
          const m = I_(g.data, []), {
            title: y,
            key: b,
            isStart: w,
            isEnd: $
          } = g;
          return delete m.children, v(DO, J(J({}, m), {}, {
            title: y,
            active: f,
            data: g.data,
            key: b,
            eventKey: b,
            isStart: w,
            isEnd: $
          }), i);
        })]), [[Qa, o.value]])]
      }) : v(DO, J(J({
        class: n.class,
        style: n.style
      }, p), {}, {
        active: f,
        eventKey: h
      }), i);
    };
  }
});
function rce() {
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
  const n = t.length, i = e.length;
  if (Math.abs(n - i) !== 1)
    return {
      add: !1,
      key: null
    };
  function o(r, a) {
    const l = /* @__PURE__ */ new Map();
    r.forEach((u) => {
      l.set(u, !0);
    });
    const s = a.filter((u) => !l.has(u));
    return s.length === 1 ? s[0] : null;
  }
  return n < i ? {
    add: !0,
    key: o(t, e)
  } : {
    add: !1,
    key: o(e, t)
  };
}
function M_(t, e, n) {
  const i = t.findIndex((a) => a.key === n), o = t[i + 1], r = e.findIndex((a) => a.key === n);
  if (o) {
    const a = e.findIndex((l) => l.key === o.key);
    return e.slice(r + 1, a);
  }
  return e.slice(r + 1);
}
var A_ = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
const R_ = {
  width: 0,
  height: 0,
  display: "flex",
  overflow: "hidden",
  opacity: 0,
  border: 0,
  padding: 0,
  margin: 0
}, ace = () => {
}, Zc = `RC_TREE_MOTION_${Math.random()}`, fS = {
  key: Zc
}, Pz = {
  key: Zc,
  level: 0,
  index: 0,
  pos: "0",
  node: fS,
  nodes: [fS]
}, D_ = {
  parent: null,
  children: [],
  pos: Pz.pos,
  data: fS,
  title: null,
  key: Zc,
  /** Hold empty list here since we do not use it */
  isStart: [],
  isEnd: []
};
function N_(t, e, n, i) {
  return e === !1 || !n ? t : t.slice(0, Math.ceil(n / i) + 1);
}
function L_(t) {
  const {
    key: e,
    pos: n
  } = t;
  return Sg(e, n);
}
function lce(t) {
  let e = String(t.key), n = t;
  for (; n.parent; )
    n = n.parent, e = `${n.key} > ${e}`;
  return e;
}
const sce = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "NodeList",
  inheritAttrs: !1,
  props: tie,
  setup(t, e) {
    let {
      expose: n,
      attrs: i
    } = e;
    const o = de(), r = de(), {
      expandedKeys: a,
      flattenNodes: l
    } = V5();
    n({
      scrollTo: (g) => {
        o.value.scrollTo(g);
      },
      getIndentWidth: () => r.value.offsetWidth
    });
    const s = Te(l.value), u = Te([]), c = de(null);
    function d() {
      s.value = l.value, u.value = [], c.value = null, t.onListChangeEnd();
    }
    const f = y$();
    _e([() => a.value.slice(), l], (g, m) => {
      let [y, b] = g, [w, $] = m;
      const C = rce(w, y);
      if (C.key !== null) {
        const {
          virtual: P,
          height: O,
          itemHeight: E
        } = t;
        if (C.add) {
          const _ = $.findIndex((N) => {
            let {
              key: L
            } = N;
            return L === C.key;
          }), D = N_(M_($, b, C.key), P, O, E), M = $.slice();
          M.splice(_ + 1, 0, D_), s.value = M, u.value = D, c.value = "show";
        } else {
          const _ = b.findIndex((N) => {
            let {
              key: L
            } = N;
            return L === C.key;
          }), D = N_(M_(b, $, C.key), P, O, E), M = b.slice();
          M.splice(_ + 1, 0, D_), s.value = M, u.value = D, c.value = "hide";
        }
      } else $ !== b && (s.value = b);
    }), _e(() => f.value.dragging, (g) => {
      g || d();
    });
    const h = A(() => t.motion === void 0 ? s.value : l.value), p = () => {
      t.onActiveChange(null);
    };
    return () => {
      const g = k(k({}, t), i), {
        prefixCls: m,
        selectable: y,
        checkable: b,
        disabled: w,
        motion: $,
        height: C,
        itemHeight: P,
        virtual: O,
        focusable: E,
        activeItem: _,
        focused: D,
        tabindex: M,
        onKeydown: N,
        onFocus: L,
        onBlur: j,
        onListChangeStart: B,
        onListChangeEnd: Y
      } = g, Q = A_(g, ["prefixCls", "selectable", "checkable", "disabled", "motion", "height", "itemHeight", "virtual", "focusable", "activeItem", "focused", "tabindex", "onKeydown", "onFocus", "onBlur", "onListChangeStart", "onListChangeEnd"]);
      return v(tt, null, [D && _ && v("span", {
        style: R_,
        "aria-live": "assertive"
      }, [lce(_)]), v("div", null, [v("input", {
        style: R_,
        disabled: E === !1 || w,
        tabindex: E !== !1 ? M : null,
        onKeydown: N,
        onFocus: L,
        onBlur: j,
        value: "",
        onChange: ace,
        "aria-label": "for screen reader"
      }, null)]), v("div", {
        class: `${m}-treenode`,
        "aria-hidden": !0,
        style: {
          position: "absolute",
          pointerEvents: "none",
          visibility: "hidden",
          height: 0,
          overflow: "hidden"
        }
      }, [v("div", {
        class: `${m}-indent`
      }, [v("div", {
        ref: r,
        class: `${m}-indent-unit`
      }, null)])]), v(o3, J(J({}, ii(Q, ["onActiveChange"])), {}, {
        data: h.value,
        itemKey: L_,
        height: C,
        fullHeight: !1,
        virtual: O,
        itemHeight: P,
        prefixCls: `${m}-list`,
        ref: o,
        onVisibleChange: (G, V) => {
          const H = new Set(G);
          V.filter((K) => !H.has(K)).some((K) => L_(K) === Zc) && d();
        }
      }), {
        default: (G) => {
          const {
            pos: V
          } = G, H = A_(G.data, []), {
            title: q,
            key: K,
            isStart: ee,
            isEnd: ie
          } = G, ae = Sg(K, V);
          return delete H.key, delete H.children, v(oce, J(J({}, H), {}, {
            eventKey: ae,
            title: q,
            active: !!_ && K === _.key,
            data: G.data,
            isStart: ee,
            isEnd: ie,
            motion: $,
            motionNodes: K === Zc ? u.value : null,
            motionType: c.value,
            onMotionStart: B,
            onMotionEnd: d,
            onMousemove: p
          }), null);
        }
      })]);
    };
  }
});
function uce(t) {
  let {
    dropPosition: e,
    dropLevelOffset: n,
    indent: i
  } = t;
  const o = {
    pointerEvents: "none",
    position: "absolute",
    right: 0,
    backgroundColor: "red",
    height: "2px"
  };
  switch (e) {
    case -1:
      o.top = 0, o.left = `${-n * i}px`;
      break;
    case 1:
      o.bottom = 0, o.left = `${-n * i}px`;
      break;
    case 0:
      o.bottom = 0, o.left = `${i}`;
      break;
  }
  return v("div", {
    style: o
  }, null);
}
const cce = 10, dce = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "Tree",
  inheritAttrs: !1,
  props: Kn(H5(), {
    prefixCls: "vc-tree",
    showLine: !1,
    showIcon: !0,
    selectable: !0,
    multiple: !1,
    checkable: !1,
    disabled: !1,
    checkStrictly: !1,
    draggable: !1,
    expandAction: !1,
    defaultExpandParent: !0,
    autoExpandParent: !1,
    defaultExpandAll: !1,
    defaultExpandedKeys: [],
    defaultCheckedKeys: [],
    defaultSelectedKeys: [],
    dropIndicatorRender: uce,
    allowDrop: () => !0
  }),
  setup(t, e) {
    let {
      attrs: n,
      slots: i,
      expose: o
    } = e;
    const r = Te(!1);
    let a = {};
    const l = Te(), s = Te([]), u = Te([]), c = Te([]), d = Te([]), f = Te([]), h = Te([]), p = {}, g = Bn({
      draggingNodeKey: null,
      dragChildrenKeys: [],
      // dropTargetKey is the key of abstract-drop-node
      // the abstract-drop-node is the real drop node when drag and drop
      // not the DOM drag over node
      dropTargetKey: null,
      dropPosition: null,
      dropContainerKey: null,
      dropLevelOffset: null,
      dropTargetPos: null,
      dropAllowed: !0,
      // the abstract-drag-over-node
      // if mouse is on the bottom of top dom node or no the top of the bottom dom node
      // abstract-drag-over-node is the top node
      dragOverNodeKey: null
    }), m = Te([]);
    _e([() => t.treeData, () => t.children], () => {
      m.value = t.treeData !== void 0 ? t.treeData.slice() : LO(rr(t.children));
    }, {
      immediate: !0,
      deep: !0
    });
    const y = Te({}), b = Te(!1), w = Te(null), $ = Te(!1), C = A(() => Iy(t.fieldNames)), P = Te();
    let O = null, E = null, _ = null;
    const D = A(() => ({
      expandedKeysSet: M.value,
      selectedKeysSet: N.value,
      loadedKeysSet: L.value,
      loadingKeysSet: j.value,
      checkedKeysSet: B.value,
      halfCheckedKeysSet: Y.value,
      dragOverNodeKey: g.dragOverNodeKey,
      dropPosition: g.dropPosition,
      keyEntities: y.value
    })), M = A(() => new Set(h.value)), N = A(() => new Set(s.value)), L = A(() => new Set(d.value)), j = A(() => new Set(f.value)), B = A(() => new Set(u.value)), Y = A(() => new Set(c.value));
    zt(() => {
      if (m.value) {
        const De = x$(m.value, {
          fieldNames: C.value
        });
        y.value = k({
          [Zc]: Pz
        }, De.keyEntities);
      }
    });
    let Q = !1;
    _e(
      [() => t.expandedKeys, () => t.autoExpandParent, y],
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      (De, Be) => {
        let [je, at] = De, [mt, st] = Be, gt = h.value;
        if (t.expandedKeys !== void 0 || Q && at !== st)
          gt = t.autoExpandParent || !Q && t.defaultExpandParent ? NO(t.expandedKeys, y.value) : t.expandedKeys;
        else if (!Q && t.defaultExpandAll) {
          const Et = k({}, y.value);
          delete Et[Zc], gt = Object.keys(Et).map((It) => Et[It].key);
        } else !Q && t.defaultExpandedKeys && (gt = t.autoExpandParent || t.defaultExpandParent ? NO(t.defaultExpandedKeys, y.value) : t.defaultExpandedKeys);
        gt && (h.value = gt), Q = !0;
      },
      {
        immediate: !0
      }
    );
    const G = Te([]);
    zt(() => {
      G.value = uie(m.value, h.value, C.value);
    }), zt(() => {
      t.selectable && (t.selectedKeys !== void 0 ? s.value = OE(t.selectedKeys, t) : !Q && t.defaultSelectedKeys && (s.value = OE(t.defaultSelectedKeys, t)));
    });
    const {
      maxLevel: V,
      levelEntities: H
    } = q5(y);
    zt(() => {
      if (t.checkable) {
        let De;
        if (t.checkedKeys !== void 0 ? De = d1(t.checkedKeys) || {} : !Q && t.defaultCheckedKeys ? De = d1(t.defaultCheckedKeys) || {} : m.value && (De = d1(t.checkedKeys) || {
          checkedKeys: u.value,
          halfCheckedKeys: c.value
        }), De) {
          let {
            checkedKeys: Be = [],
            halfCheckedKeys: je = []
          } = De;
          t.checkStrictly || ({
            checkedKeys: Be,
            halfCheckedKeys: je
          } = ff(Be, !0, y.value, V.value, H.value)), u.value = Be, c.value = je;
        }
      }
    }), zt(() => {
      t.loadedKeys && (d.value = t.loadedKeys);
    });
    const q = () => {
      k(g, {
        dragOverNodeKey: null,
        dropPosition: null,
        dropLevelOffset: null,
        dropTargetKey: null,
        dropContainerKey: null,
        dropTargetPos: null,
        dropAllowed: !1
      });
    }, K = (De) => {
      P.value.scrollTo(De);
    };
    _e(() => t.activeKey, () => {
      t.activeKey !== void 0 && (w.value = t.activeKey);
    }, {
      immediate: !0
    }), _e(w, (De) => {
      rn(() => {
        De !== null && K({
          key: De
        });
      });
    }, {
      immediate: !0,
      flush: "post"
    });
    const ee = (De) => {
      t.expandedKeys === void 0 && (h.value = De);
    }, ie = () => {
      g.draggingNodeKey !== null && k(g, {
        draggingNodeKey: null,
        dropPosition: null,
        dropContainerKey: null,
        dropTargetKey: null,
        dropLevelOffset: null,
        dropAllowed: !0,
        dragOverNodeKey: null
      }), O = null, _ = null;
    }, ae = (De, Be) => {
      const {
        onDragend: je
      } = t;
      g.dragOverNodeKey = null, ie(), je?.({
        event: De,
        node: Be.eventData
      }), E = null;
    }, te = (De) => {
      ae(De, null), window.removeEventListener("dragend", te);
    }, U = (De, Be) => {
      const {
        onDragstart: je
      } = t, {
        eventKey: at,
        eventData: mt
      } = Be;
      E = Be, O = {
        x: De.clientX,
        y: De.clientY
      };
      const st = dl(h.value, at);
      g.draggingNodeKey = at, g.dragChildrenKeys = rie(at, y.value), l.value = P.value.getIndentWidth(), ee(st), window.addEventListener("dragend", te), je && je({
        event: De,
        node: mt
      });
    }, me = (De, Be) => {
      const {
        onDragenter: je,
        onExpand: at,
        allowDrop: mt,
        direction: st
      } = t, {
        pos: gt,
        eventKey: Et
      } = Be;
      if (_ !== Et && (_ = Et), !E) {
        q();
        return;
      }
      const {
        dropPosition: It,
        dropLevelOffset: _t,
        dropTargetKey: wt,
        dropContainerKey: Nt,
        dropTargetPos: nn,
        dropAllowed: sn,
        dragOverNodeKey: xn
      } = xE(De, E, Be, l.value, O, mt, G.value, y.value, M.value, st);
      if (
        // don't allow drop inside its children
        g.dragChildrenKeys.indexOf(wt) !== -1 || // don't allow drop when drop is not allowed caculated by calcDropPosition
        !sn
      ) {
        q();
        return;
      }
      if (a || (a = {}), Object.keys(a).forEach((Pn) => {
        clearTimeout(a[Pn]);
      }), E.eventKey !== Be.eventKey && (a[gt] = window.setTimeout(() => {
        if (g.draggingNodeKey === null) return;
        let Pn = h.value.slice();
        const bt = y.value[Be.eventKey];
        bt && (bt.children || []).length && (Pn = es(h.value, Be.eventKey)), ee(Pn), at && at(Pn, {
          node: Be.eventData,
          expanded: !0,
          nativeEvent: De
        });
      }, 800)), E.eventKey === wt && _t === 0) {
        q();
        return;
      }
      k(g, {
        dragOverNodeKey: xn,
        dropPosition: It,
        dropLevelOffset: _t,
        dropTargetKey: wt,
        dropContainerKey: Nt,
        dropTargetPos: nn,
        dropAllowed: sn
      }), je && je({
        event: De,
        node: Be.eventData,
        expandedKeys: h.value
      });
    }, ce = (De, Be) => {
      const {
        onDragover: je,
        allowDrop: at,
        direction: mt
      } = t;
      if (!E)
        return;
      const {
        dropPosition: st,
        dropLevelOffset: gt,
        dropTargetKey: Et,
        dropContainerKey: It,
        dropAllowed: _t,
        dropTargetPos: wt,
        dragOverNodeKey: Nt
      } = xE(De, E, Be, l.value, O, at, G.value, y.value, M.value, mt);
      g.dragChildrenKeys.indexOf(Et) !== -1 || !_t || (E.eventKey === Et && gt === 0 ? g.dropPosition === null && g.dropLevelOffset === null && g.dropTargetKey === null && g.dropContainerKey === null && g.dropTargetPos === null && g.dropAllowed === !1 && g.dragOverNodeKey === null || q() : st === g.dropPosition && gt === g.dropLevelOffset && Et === g.dropTargetKey && It === g.dropContainerKey && wt === g.dropTargetPos && _t === g.dropAllowed && Nt === g.dragOverNodeKey || k(g, {
        dropPosition: st,
        dropLevelOffset: gt,
        dropTargetKey: Et,
        dropContainerKey: It,
        dropTargetPos: wt,
        dropAllowed: _t,
        dragOverNodeKey: Nt
      }), je && je({
        event: De,
        node: Be.eventData
      }));
    }, ue = (De, Be) => {
      _ === Be.eventKey && !De.currentTarget.contains(De.relatedTarget) && (q(), _ = null);
      const {
        onDragleave: je
      } = t;
      je && je({
        event: De,
        node: Be.eventData
      });
    }, fe = function(De, Be) {
      let je = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
      var at;
      const {
        dragChildrenKeys: mt,
        dropPosition: st,
        dropTargetKey: gt,
        dropTargetPos: Et,
        dropAllowed: It
      } = g;
      if (!It) return;
      const {
        onDrop: _t
      } = t;
      if (g.dragOverNodeKey = null, ie(), gt === null) return;
      const wt = k(k({}, hv(gt, rr(D.value))), {
        active: ((at = Le.value) === null || at === void 0 ? void 0 : at.key) === gt,
        data: y.value[gt].node
      }), Nt = mt.indexOf(gt) !== -1;
      Nn(!Nt, "Can not drop to dragNode's children node. Maybe this is a bug of ant-design-vue. Please report an issue.");
      const nn = b$(Et), sn = {
        event: De,
        node: pv(wt),
        dragNode: E ? E.eventData : null,
        dragNodesKeys: [E.eventKey].concat(mt),
        dropToGap: st !== 0,
        dropPosition: st + Number(nn[nn.length - 1])
      };
      je || _t?.(sn), E = null;
    }, he = (De, Be) => {
      const {
        expanded: je,
        key: at
      } = Be, mt = G.value.filter((gt) => gt.key === at)[0], st = pv(k(k({}, hv(at, D.value)), {
        data: mt.data
      }));
      ee(je ? dl(h.value, at) : es(h.value, at)), Pe(De, st);
    }, le = (De, Be) => {
      const {
        onClick: je,
        expandAction: at
      } = t;
      at === "click" && he(De, Be), je && je(De, Be);
    }, ke = (De, Be) => {
      const {
        onDblclick: je,
        expandAction: at
      } = t;
      (at === "doubleclick" || at === "dblclick") && he(De, Be), je && je(De, Be);
    }, ze = (De, Be) => {
      let je = s.value;
      const {
        onSelect: at,
        multiple: mt
      } = t, {
        selected: st
      } = Be, gt = Be[C.value.key], Et = !st;
      Et ? mt ? je = es(je, gt) : je = [gt] : je = dl(je, gt);
      const It = y.value, _t = je.map((wt) => {
        const Nt = It[wt];
        return Nt ? Nt.node : null;
      }).filter((wt) => wt);
      t.selectedKeys === void 0 && (s.value = je), at && at(je, {
        event: "select",
        selected: Et,
        node: Be,
        selectedNodes: _t,
        nativeEvent: De
      });
    }, Re = (De, Be, je) => {
      const {
        checkStrictly: at,
        onCheck: mt
      } = t, st = Be[C.value.key];
      let gt;
      const Et = {
        event: "check",
        node: Be,
        checked: je,
        nativeEvent: De
      }, It = y.value;
      if (at) {
        const _t = je ? es(u.value, st) : dl(u.value, st), wt = dl(c.value, st);
        gt = {
          checked: _t,
          halfChecked: wt
        }, Et.checkedNodes = _t.map((Nt) => It[Nt]).filter((Nt) => Nt).map((Nt) => Nt.node), t.checkedKeys === void 0 && (u.value = _t);
      } else {
        let {
          checkedKeys: _t,
          halfCheckedKeys: wt
        } = ff([...u.value, st], !0, It, V.value, H.value);
        if (!je) {
          const Nt = new Set(_t);
          Nt.delete(st), {
            checkedKeys: _t,
            halfCheckedKeys: wt
          } = ff(Array.from(Nt), {
            halfCheckedKeys: wt
          }, It, V.value, H.value);
        }
        gt = _t, Et.checkedNodes = [], Et.checkedNodesPositions = [], Et.halfCheckedKeys = wt, _t.forEach((Nt) => {
          const nn = It[Nt];
          if (!nn) return;
          const {
            node: sn,
            pos: xn
          } = nn;
          Et.checkedNodes.push(sn), Et.checkedNodesPositions.push({
            node: sn,
            pos: xn
          });
        }), t.checkedKeys === void 0 && (u.value = _t, c.value = wt);
      }
      mt && mt(gt, Et);
    }, Ye = (De) => {
      const Be = De[C.value.key], je = new Promise((at, mt) => {
        const {
          loadData: st,
          onLoad: gt
        } = t;
        if (!st || L.value.has(Be) || j.value.has(Be))
          return null;
        st(De).then(() => {
          const It = es(d.value, Be), _t = dl(f.value, Be);
          gt && gt(It, {
            event: "load",
            node: De
          }), t.loadedKeys === void 0 && (d.value = It), f.value = _t, at();
        }).catch((It) => {
          const _t = dl(f.value, Be);
          if (f.value = _t, p[Be] = (p[Be] || 0) + 1, p[Be] >= cce) {
            Nn(!1, "Retry for `loadData` many times but still failed. No more retry.");
            const wt = es(d.value, Be);
            t.loadedKeys === void 0 && (d.value = wt), at();
          }
          mt(It);
        }), f.value = es(f.value, Be);
      });
      return je.catch(() => {
      }), je;
    }, Ne = (De, Be) => {
      const {
        onMouseenter: je
      } = t;
      je && je({
        event: De,
        node: Be
      });
    }, Fe = (De, Be) => {
      const {
        onMouseleave: je
      } = t;
      je && je({
        event: De,
        node: Be
      });
    }, We = (De, Be) => {
      const {
        onRightClick: je
      } = t;
      je && (De.preventDefault(), je({
        event: De,
        node: Be
      }));
    }, nt = (De) => {
      const {
        onFocus: Be
      } = t;
      b.value = !0, Be && Be(De);
    }, Qe = (De) => {
      const {
        onBlur: Be
      } = t;
      b.value = !1, $e(null), Be && Be(De);
    }, Pe = (De, Be) => {
      let je = h.value;
      const {
        onExpand: at,
        loadData: mt
      } = t, {
        expanded: st
      } = Be, gt = Be[C.value.key];
      if ($.value)
        return;
      const Et = je.indexOf(gt), It = !st;
      if (Nn(st && Et !== -1 || !st && Et === -1, "Expand state not sync with index check"), It ? je = es(je, gt) : je = dl(je, gt), ee(je), at && at(je, {
        node: Be,
        expanded: It,
        nativeEvent: De
      }), It && mt) {
        const _t = Ye(Be);
        _t && _t.then(() => {
        }).catch((wt) => {
          const Nt = dl(h.value, gt);
          ee(Nt), Promise.reject(wt);
        });
      }
    }, Ze = () => {
      $.value = !0;
    }, Ce = () => {
      setTimeout(() => {
        $.value = !1;
      });
    }, $e = (De) => {
      const {
        onActiveChange: Be
      } = t;
      w.value !== De && (t.activeKey !== void 0 && (w.value = De), De !== null && K({
        key: De
      }), Be && Be(De));
    }, Le = A(() => w.value === null ? null : G.value.find((De) => {
      let {
        key: Be
      } = De;
      return Be === w.value;
    }) || null), Ke = (De) => {
      let Be = G.value.findIndex((at) => {
        let {
          key: mt
        } = at;
        return mt === w.value;
      });
      Be === -1 && De < 0 && (Be = G.value.length), Be = (Be + De + G.value.length) % G.value.length;
      const je = G.value[Be];
      if (je) {
        const {
          key: at
        } = je;
        $e(at);
      } else
        $e(null);
    }, qe = A(() => pv(k(k({}, hv(w.value, D.value)), {
      data: Le.value.data,
      active: !0
    }))), rt = (De) => {
      const {
        onKeydown: Be,
        checkable: je,
        selectable: at
      } = t;
      switch (De.which) {
        case lt.UP: {
          Ke(-1), De.preventDefault();
          break;
        }
        case lt.DOWN: {
          Ke(1), De.preventDefault();
          break;
        }
      }
      const mt = Le.value;
      if (mt && mt.data) {
        const st = mt.data.isLeaf === !1 || !!(mt.data.children || []).length, gt = qe.value;
        switch (De.which) {
          // >>> Expand
          case lt.LEFT: {
            st && M.value.has(w.value) ? Pe({}, gt) : mt.parent && $e(mt.parent.key), De.preventDefault();
            break;
          }
          case lt.RIGHT: {
            st && !M.value.has(w.value) ? Pe({}, gt) : mt.children && mt.children.length && $e(mt.children[0].key), De.preventDefault();
            break;
          }
          // Selection
          case lt.ENTER:
          case lt.SPACE: {
            je && !gt.disabled && gt.checkable !== !1 && !gt.disableCheckbox ? Re({}, gt, !B.value.has(w.value)) : !je && at && !gt.disabled && gt.selectable !== !1 && ze({}, gt);
            break;
          }
        }
      }
      Be && Be(De);
    };
    return o({
      onNodeExpand: Pe,
      scrollTo: K,
      onKeydown: rt,
      selectedKeys: A(() => s.value),
      checkedKeys: A(() => u.value),
      halfCheckedKeys: A(() => c.value),
      loadedKeys: A(() => d.value),
      loadingKeys: A(() => f.value),
      expandedKeys: A(() => h.value)
    }), wo(() => {
      window.removeEventListener("dragend", te), r.value = !0;
    }), Jne({
      expandedKeys: h,
      selectedKeys: s,
      loadedKeys: d,
      loadingKeys: f,
      checkedKeys: u,
      halfCheckedKeys: c,
      expandedKeysSet: M,
      selectedKeysSet: N,
      loadedKeysSet: L,
      loadingKeysSet: j,
      checkedKeysSet: B,
      halfCheckedKeysSet: Y,
      flattenNodes: G
    }), () => {
      const {
        // focused,
        // flattenNodes,
        // keyEntities,
        draggingNodeKey: De,
        // activeKey,
        dropLevelOffset: Be,
        dropContainerKey: je,
        dropTargetKey: at,
        dropPosition: mt,
        dragOverNodeKey: st
        // indent,
      } = g, {
        prefixCls: gt,
        showLine: Et,
        focusable: It,
        tabindex: _t = 0,
        selectable: wt,
        showIcon: Nt,
        icon: nn = i.icon,
        switcherIcon: sn,
        draggable: xn,
        checkable: Pn,
        checkStrictly: bt,
        disabled: Xn,
        motion: En,
        loadData: di,
        filterTreeNode: Ri,
        height: zo,
        itemHeight: Ue,
        virtual: yt,
        dropIndicatorRender: xt,
        onContextmenu: fn,
        onScroll: Oi,
        direction: yi,
        rootClassName: io,
        rootStyle: Ln
      } = t, {
        class: Bt,
        style: Fi
      } = n, vo = rd(k(k({}, t), n), {
        aria: !0,
        data: !0
      });
      let Sn;
      return xn ? typeof xn == "object" ? Sn = xn : typeof xn == "function" ? Sn = {
        nodeDraggable: xn
      } : Sn = {} : Sn = !1, v(Une, {
        value: {
          prefixCls: gt,
          selectable: wt,
          showIcon: Nt,
          icon: nn,
          switcherIcon: sn,
          draggable: Sn,
          draggingNodeKey: De,
          checkable: Pn,
          customCheckable: i.checkable,
          checkStrictly: bt,
          disabled: Xn,
          keyEntities: y.value,
          dropLevelOffset: Be,
          dropContainerKey: je,
          dropTargetKey: at,
          dropPosition: mt,
          dragOverNodeKey: st,
          dragging: De !== null,
          indent: l.value,
          direction: yi,
          dropIndicatorRender: xt,
          loadData: di,
          filterTreeNode: Ri,
          onNodeClick: le,
          onNodeDoubleClick: ke,
          onNodeExpand: Pe,
          onNodeSelect: ze,
          onNodeCheck: Re,
          onNodeLoad: Ye,
          onNodeMouseEnter: Ne,
          onNodeMouseLeave: Fe,
          onNodeContextMenu: We,
          onNodeDragStart: U,
          onNodeDragEnter: me,
          onNodeDragOver: ce,
          onNodeDragLeave: ue,
          onNodeDragEnd: ae,
          onNodeDrop: fe,
          slots: i
        }
      }, {
        default: () => [v("div", {
          role: "tree",
          class: Ae(gt, Bt, io, {
            [`${gt}-show-line`]: Et,
            [`${gt}-focused`]: b.value,
            [`${gt}-active-focused`]: w.value !== null
          }),
          style: Ln
        }, [v(sce, J({
          ref: P,
          prefixCls: gt,
          style: Fi,
          disabled: Xn,
          selectable: wt,
          checkable: !!Pn,
          motion: En,
          height: zo,
          itemHeight: Ue,
          virtual: yt,
          focusable: It,
          focused: b.value,
          tabindex: _t,
          activeItem: Le.value,
          onFocus: nt,
          onBlur: Qe,
          onKeydown: rt,
          onActiveChange: $e,
          onListChangeStart: Ze,
          onListChangeEnd: Ce,
          onContextmenu: fn,
          onScroll: Oi
        }, vo), null)])]
      });
    };
  }
});
var fce = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z" } }] }, name: "file", theme: "outlined" };
function z_(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(n);
    typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(n).filter(function(o) {
      return Object.getOwnPropertyDescriptor(n, o).enumerable;
    }))), i.forEach(function(o) {
      hce(t, o, n[o]);
    });
  }
  return t;
}
function hce(t, e, n) {
  return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
var Fy = function(e, n) {
  var i = z_({}, e, n.attrs);
  return v(bn, z_({}, i, {
    icon: fce
  }), null);
};
Fy.displayName = "FileOutlined";
Fy.inheritAttrs = !1;
var pce = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z" } }, { tag: "path", attrs: { d: "M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z" } }] }, name: "minus-square", theme: "outlined" };
function B_(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(n);
    typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(n).filter(function(o) {
      return Object.getOwnPropertyDescriptor(n, o).enumerable;
    }))), i.forEach(function(o) {
      gce(t, o, n[o]);
    });
  }
  return t;
}
function gce(t, e, n) {
  return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
var q$ = function(e, n) {
  var i = B_({}, e, n.attrs);
  return v(bn, B_({}, i, {
    icon: pce
  }), null);
};
q$.displayName = "MinusSquareOutlined";
q$.inheritAttrs = !1;
var mce = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z" } }, { tag: "path", attrs: { d: "M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z" } }] }, name: "plus-square", theme: "outlined" };
function F_(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(n);
    typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(n).filter(function(o) {
      return Object.getOwnPropertyDescriptor(n, o).enumerable;
    }))), i.forEach(function(o) {
      vce(t, o, n[o]);
    });
  }
  return t;
}
function vce(t, e, n) {
  return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
var Y$ = function(e, n) {
  var i = F_({}, e, n.attrs);
  return v(bn, F_({}, i, {
    icon: mce
  }), null);
};
Y$.displayName = "PlusSquareOutlined";
Y$.inheritAttrs = !1;
var yce = { icon: { tag: "svg", attrs: { viewBox: "0 0 1024 1024", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z" } }] }, name: "caret-down", theme: "filled" };
function V_(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(n);
    typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(n).filter(function(o) {
      return Object.getOwnPropertyDescriptor(n, o).enumerable;
    }))), i.forEach(function(o) {
      bce(t, o, n[o]);
    });
  }
  return t;
}
function bce(t, e, n) {
  return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
var K$ = function(e, n) {
  var i = V_({}, e, n.attrs);
  return v(bn, V_({}, i, {
    icon: yce
  }), null);
};
K$.displayName = "CaretDownFilled";
K$.inheritAttrs = !1;
function xce(t, e, n, i, o) {
  const {
    isLeaf: r,
    expanded: a,
    loading: l
  } = n;
  let s = e;
  if (l)
    return v(Ya, {
      class: `${t}-switcher-loading-icon`
    }, null);
  let u;
  o && typeof o == "object" && (u = o.showLeafIcon);
  let c = null;
  const d = `${t}-switcher-icon`;
  return r ? o ? u && i ? i(n) : (typeof o == "object" && !u ? c = v("span", {
    class: `${t}-switcher-leaf-line`
  }, null) : c = v(Fy, {
    class: `${t}-switcher-line-icon`
  }, null), c) : null : (c = v(K$, {
    class: d
  }, null), o && (c = a ? v(q$, {
    class: `${t}-switcher-line-icon`
  }, null) : v(Y$, {
    class: `${t}-switcher-line-icon`
  }, null)), typeof e == "function" ? s = e(k(k({}, n), {
    defaultIcon: c,
    switcherCls: d
  })) : po(s) && (s = Eu(s, {
    class: d
  })), s || c);
}
const Q_ = 4;
function Oce(t) {
  const {
    dropPosition: e,
    dropLevelOffset: n,
    prefixCls: i,
    indent: o,
    direction: r = "ltr"
  } = t, a = r === "ltr" ? "left" : "right", l = r === "ltr" ? "right" : "left", s = {
    [a]: `${-n * o + Q_}px`,
    [l]: 0
  };
  switch (e) {
    case -1:
      s.top = "-3px";
      break;
    case 1:
      s.bottom = "-3px";
      break;
    default:
      s.bottom = "-3px", s[a] = `${o + Q_}px`;
      break;
  }
  return v("div", {
    style: s,
    class: `${i}-drop-indicator`
  }, null);
}
const Sce = new gn("ant-tree-node-fx-do-not-use", {
  "0%": {
    opacity: 0
  },
  "100%": {
    opacity: 1
  }
}), wce = (t, e) => ({
  [`.${t}-switcher-icon`]: {
    display: "inline-block",
    fontSize: 10,
    verticalAlign: "baseline",
    svg: {
      transition: `transform ${e.motionDurationSlow}`
    }
  }
}), Cce = (t, e) => ({
  [`.${t}-drop-indicator`]: {
    position: "absolute",
    // it should displayed over the following node
    zIndex: 1,
    height: 2,
    backgroundColor: e.colorPrimary,
    borderRadius: 1,
    pointerEvents: "none",
    "&:after": {
      position: "absolute",
      top: -3,
      insetInlineStart: -6,
      width: 8,
      height: 8,
      backgroundColor: "transparent",
      border: `${e.lineWidthBold}px solid ${e.colorPrimary}`,
      borderRadius: "50%",
      content: '""'
    }
  }
}), $ce = (t, e) => {
  const {
    treeCls: n,
    treeNodeCls: i,
    treeNodePadding: o,
    treeTitleHeight: r
  } = e, a = (r - e.fontSizeLG) / 2, l = e.paddingXS;
  return {
    [n]: k(k({}, kn(e)), {
      background: e.colorBgContainer,
      borderRadius: e.borderRadius,
      transition: `background-color ${e.motionDurationSlow}`,
      [`&${n}-rtl`]: {
        // >>> Switcher
        [`${n}-switcher`]: {
          "&_close": {
            [`${n}-switcher-icon`]: {
              svg: {
                transform: "rotate(90deg)"
              }
            }
          }
        }
      },
      [`&-focused:not(:hover):not(${n}-active-focused)`]: k({}, _s(e)),
      // =================== Virtual List ===================
      [`${n}-list-holder-inner`]: {
        alignItems: "flex-start"
      },
      [`&${n}-block-node`]: {
        [`${n}-list-holder-inner`]: {
          alignItems: "stretch",
          // >>> Title
          [`${n}-node-content-wrapper`]: {
            flex: "auto"
          },
          // >>> Drag
          [`${i}.dragging`]: {
            position: "relative",
            "&:after": {
              position: "absolute",
              top: 0,
              insetInlineEnd: 0,
              bottom: o,
              insetInlineStart: 0,
              border: `1px solid ${e.colorPrimary}`,
              opacity: 0,
              animationName: Sce,
              animationDuration: e.motionDurationSlow,
              animationPlayState: "running",
              animationFillMode: "forwards",
              content: '""',
              pointerEvents: "none"
            }
          }
        }
      },
      // ===================== TreeNode =====================
      [`${i}`]: {
        display: "flex",
        alignItems: "flex-start",
        padding: `0 0 ${o}px 0`,
        outline: "none",
        "&-rtl": {
          direction: "rtl"
        },
        // Disabled
        "&-disabled": {
          // >>> Title
          [`${n}-node-content-wrapper`]: {
            color: e.colorTextDisabled,
            cursor: "not-allowed",
            "&:hover": {
              background: "transparent"
            }
          }
        },
        [`&-active ${n}-node-content-wrapper`]: k({}, _s(e)),
        [`&:not(${i}-disabled).filter-node ${n}-title`]: {
          color: "inherit",
          fontWeight: 500
        },
        "&-draggable": {
          [`${n}-draggable-icon`]: {
            width: r,
            lineHeight: `${r}px`,
            textAlign: "center",
            visibility: "visible",
            opacity: 0.2,
            transition: `opacity ${e.motionDurationSlow}`,
            [`${i}:hover &`]: {
              opacity: 0.45
            }
          },
          [`&${i}-disabled`]: {
            [`${n}-draggable-icon`]: {
              visibility: "hidden"
            }
          }
        }
      },
      // >>> Indent
      [`${n}-indent`]: {
        alignSelf: "stretch",
        whiteSpace: "nowrap",
        userSelect: "none",
        "&-unit": {
          display: "inline-block",
          width: r
        }
      },
      // >>> Drag Handler
      [`${n}-draggable-icon`]: {
        visibility: "hidden"
      },
      // >>> Switcher
      [`${n}-switcher`]: k(k({}, wce(t, e)), {
        position: "relative",
        flex: "none",
        alignSelf: "stretch",
        width: r,
        margin: 0,
        lineHeight: `${r}px`,
        textAlign: "center",
        cursor: "pointer",
        userSelect: "none",
        "&-noop": {
          cursor: "default"
        },
        "&_close": {
          [`${n}-switcher-icon`]: {
            svg: {
              transform: "rotate(-90deg)"
            }
          }
        },
        "&-loading-icon": {
          color: e.colorPrimary
        },
        "&-leaf-line": {
          position: "relative",
          zIndex: 1,
          display: "inline-block",
          width: "100%",
          height: "100%",
          // https://github.com/ant-design/ant-design/issues/31884
          "&:before": {
            position: "absolute",
            top: 0,
            insetInlineEnd: r / 2,
            bottom: -o,
            marginInlineStart: -1,
            borderInlineEnd: `1px solid ${e.colorBorder}`,
            content: '""'
          },
          "&:after": {
            position: "absolute",
            width: r / 2 * 0.8,
            height: r / 2,
            borderBottom: `1px solid ${e.colorBorder}`,
            content: '""'
          }
        }
      }),
      // >>> Checkbox
      [`${n}-checkbox`]: {
        top: "initial",
        marginInlineEnd: l,
        marginBlockStart: a
      },
      // >>> Title
      // add `${treeCls}-checkbox + span` to cover checkbox `${checkboxCls} + span`
      [`${n}-node-content-wrapper, ${n}-checkbox + span`]: {
        position: "relative",
        zIndex: "auto",
        minHeight: r,
        margin: 0,
        padding: `0 ${e.paddingXS / 2}px`,
        color: "inherit",
        lineHeight: `${r}px`,
        background: "transparent",
        borderRadius: e.borderRadius,
        cursor: "pointer",
        transition: `all ${e.motionDurationMid}, border 0s, line-height 0s, box-shadow 0s`,
        "&:hover": {
          backgroundColor: e.controlItemBgHover
        },
        [`&${n}-node-selected`]: {
          backgroundColor: e.controlItemBgActive
        },
        // Icon
        [`${n}-iconEle`]: {
          display: "inline-block",
          width: r,
          height: r,
          lineHeight: `${r}px`,
          textAlign: "center",
          verticalAlign: "top",
          "&:empty": {
            display: "none"
          }
        }
      },
      // https://github.com/ant-design/ant-design/issues/28217
      [`${n}-unselectable ${n}-node-content-wrapper:hover`]: {
        backgroundColor: "transparent"
      },
      // ==================== Draggable =====================
      [`${n}-node-content-wrapper`]: k({
        lineHeight: `${r}px`,
        userSelect: "none"
      }, Cce(t, e)),
      [`${i}.drop-container`]: {
        "> [draggable]": {
          boxShadow: `0 0 0 2px ${e.colorPrimary}`
        }
      },
      // ==================== Show Line =====================
      "&-show-line": {
        // ================ Indent lines ================
        [`${n}-indent`]: {
          "&-unit": {
            position: "relative",
            height: "100%",
            "&:before": {
              position: "absolute",
              top: 0,
              insetInlineEnd: r / 2,
              bottom: -o,
              borderInlineEnd: `1px solid ${e.colorBorder}`,
              content: '""'
            },
            "&-end": {
              "&:before": {
                display: "none"
              }
            }
          }
        },
        // ============== Cover Background ==============
        [`${n}-switcher`]: {
          background: "transparent",
          "&-line-icon": {
            // https://github.com/ant-design/ant-design/issues/32813
            verticalAlign: "-0.15em"
          }
        }
      },
      [`${i}-leaf-last`]: {
        [`${n}-switcher`]: {
          "&-leaf-line": {
            "&:before": {
              top: "auto !important",
              bottom: "auto !important",
              height: `${r / 2}px !important`
            }
          }
        }
      }
    })
  };
}, kce = (t) => {
  const {
    treeCls: e,
    treeNodeCls: n,
    treeNodePadding: i
  } = t;
  return {
    [`${e}${e}-directory`]: {
      // ================== TreeNode ==================
      [n]: {
        position: "relative",
        // Hover color
        "&:before": {
          position: "absolute",
          top: 0,
          insetInlineEnd: 0,
          bottom: i,
          insetInlineStart: 0,
          transition: `background-color ${t.motionDurationMid}`,
          content: '""',
          pointerEvents: "none"
        },
        "&:hover": {
          "&:before": {
            background: t.controlItemBgHover
          }
        },
        // Elements
        "> *": {
          zIndex: 1
        },
        // >>> Switcher
        [`${e}-switcher`]: {
          transition: `color ${t.motionDurationMid}`
        },
        // >>> Title
        [`${e}-node-content-wrapper`]: {
          borderRadius: 0,
          userSelect: "none",
          "&:hover": {
            background: "transparent"
          },
          [`&${e}-node-selected`]: {
            color: t.colorTextLightSolid,
            background: "transparent"
          }
        },
        // ============= Selected =============
        "&-selected": {
          "\n            &:hover::before,\n            &::before\n          ": {
            background: t.colorPrimary
          },
          // >>> Switcher
          [`${e}-switcher`]: {
            color: t.colorTextLightSolid
          },
          // >>> Title
          [`${e}-node-content-wrapper`]: {
            color: t.colorTextLightSolid,
            background: "transparent"
          }
        }
      }
    }
  };
}, Tce = (t, e) => {
  const n = `.${t}`, i = `${n}-treenode`, o = e.paddingXS / 2, r = e.controlHeightSM, a = dn(e, {
    treeCls: n,
    treeNodeCls: i,
    treeNodePadding: o,
    treeTitleHeight: r
  });
  return [
    // Basic
    $ce(t, a),
    // Directory
    kce(a)
  ];
}, Pce = Vn("Tree", (t, e) => {
  let {
    prefixCls: n
  } = e;
  return [{
    [t.componentCls]: sL(`${n}-checkbox`, t)
  }, Tce(n, t), Oy(t)];
}), Ez = () => {
  const t = H5();
  return k(k({}, t), {
    showLine: pn([Boolean, Object]),
    /** 是否支持多选 */
    multiple: pt(),
    /** 是否自动展开父节点 */
    autoExpandParent: pt(),
    /** checkable状态下节点选择完全受控（父子节点选中状态不再关联）*/
    checkStrictly: pt(),
    /** 是否支持选中 */
    checkable: pt(),
    /** 是否禁用树 */
    disabled: pt(),
    /** 默认展开所有树节点 */
    defaultExpandAll: pt(),
    /** 默认展开对应树节点 */
    defaultExpandParent: pt(),
    /** 默认展开指定的树节点 */
    defaultExpandedKeys: ui(),
    /** （受控）展开指定的树节点 */
    expandedKeys: ui(),
    /** （受控）选中复选框的树节点 */
    checkedKeys: pn([Array, Object]),
    /** 默认选中复选框的树节点 */
    defaultCheckedKeys: ui(),
    /** （受控）设置选中的树节点 */
    selectedKeys: ui(),
    /** 默认选中的树节点 */
    defaultSelectedKeys: ui(),
    selectable: pt(),
    loadedKeys: ui(),
    draggable: pt(),
    showIcon: pt(),
    icon: ot(),
    switcherIcon: ve.any,
    prefixCls: String,
    /**
     * @default{title,key,children}
     * deprecated, please use `fieldNames` instead
     * 替换treeNode中 title,key,children字段为treeData中对应的字段
     */
    replaceFields: Vt(),
    blockNode: pt(),
    openAnimation: ve.any,
    onDoubleclick: t.onDblclick,
    "onUpdate:selectedKeys": ot(),
    "onUpdate:checkedKeys": ot(),
    "onUpdate:expandedKeys": ot()
  });
}, Ov = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ATree",
  inheritAttrs: !1,
  props: Kn(Ez(), {
    checkable: !1,
    selectable: !0,
    showIcon: !1,
    blockNode: !1
  }),
  slots: Object,
  setup(t, e) {
    let {
      attrs: n,
      expose: i,
      emit: o,
      slots: r
    } = e;
    Nn(!(t.treeData === void 0 && r.default), "`children` of Tree is deprecated. Please use `treeData` instead.");
    const {
      prefixCls: a,
      direction: l,
      virtual: s
    } = Ht("tree", t), [u, c] = Pce(a), d = de();
    i({
      treeRef: d,
      onNodeExpand: function() {
        var m;
        (m = d.value) === null || m === void 0 || m.onNodeExpand(...arguments);
      },
      scrollTo: (m) => {
        var y;
        (y = d.value) === null || y === void 0 || y.scrollTo(m);
      },
      selectedKeys: A(() => {
        var m;
        return (m = d.value) === null || m === void 0 ? void 0 : m.selectedKeys;
      }),
      checkedKeys: A(() => {
        var m;
        return (m = d.value) === null || m === void 0 ? void 0 : m.checkedKeys;
      }),
      halfCheckedKeys: A(() => {
        var m;
        return (m = d.value) === null || m === void 0 ? void 0 : m.halfCheckedKeys;
      }),
      loadedKeys: A(() => {
        var m;
        return (m = d.value) === null || m === void 0 ? void 0 : m.loadedKeys;
      }),
      loadingKeys: A(() => {
        var m;
        return (m = d.value) === null || m === void 0 ? void 0 : m.loadingKeys;
      }),
      expandedKeys: A(() => {
        var m;
        return (m = d.value) === null || m === void 0 ? void 0 : m.expandedKeys;
      })
    }), zt(() => {
      $n(t.replaceFields === void 0, "Tree", "`replaceFields` is deprecated, please use fieldNames instead");
    });
    const h = (m, y) => {
      o("update:checkedKeys", m), o("check", m, y);
    }, p = (m, y) => {
      o("update:expandedKeys", m), o("expand", m, y);
    }, g = (m, y) => {
      o("update:selectedKeys", m), o("select", m, y);
    };
    return () => {
      const {
        showIcon: m,
        showLine: y,
        switcherIcon: b = r.switcherIcon,
        icon: w = r.icon,
        blockNode: $,
        checkable: C,
        selectable: P,
        fieldNames: O = t.replaceFields,
        motion: E = t.openAnimation,
        itemHeight: _ = 28,
        onDoubleclick: D,
        onDblclick: M
      } = t, N = k(k(k({}, n), ii(t, ["onUpdate:checkedKeys", "onUpdate:expandedKeys", "onUpdate:selectedKeys", "onDoubleclick"])), {
        showLine: !!y,
        dropIndicatorRender: Oce,
        fieldNames: O,
        icon: w,
        itemHeight: _
      }), L = r.default ? ho(r.default()) : void 0;
      return u(v(dce, J(J({}, N), {}, {
        virtual: s.value,
        motion: E,
        ref: d,
        prefixCls: a.value,
        class: Ae({
          [`${a.value}-icon-hide`]: !m,
          [`${a.value}-block-node`]: $,
          [`${a.value}-unselectable`]: !P,
          [`${a.value}-rtl`]: l.value === "rtl"
        }, n.class, c.value),
        direction: l.value,
        checkable: C,
        selectable: P,
        switcherIcon: (j) => xce(a.value, b, j, r.leafIcon, y),
        onCheck: h,
        onExpand: p,
        onSelect: g,
        onDblclick: M || D,
        children: L
      }), k(k({}, r), {
        checkable: () => v("span", {
          class: `${a.value}-checkbox-inner`
        }, null)
      })));
    };
  }
});
var Ece = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z" } }] }, name: "folder-open", theme: "outlined" };
function H_(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(n);
    typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(n).filter(function(o) {
      return Object.getOwnPropertyDescriptor(n, o).enumerable;
    }))), i.forEach(function(o) {
      _ce(t, o, n[o]);
    });
  }
  return t;
}
function _ce(t, e, n) {
  return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
var X$ = function(e, n) {
  var i = H_({}, e, n.attrs);
  return v(bn, H_({}, i, {
    icon: Ece
  }), null);
};
X$.displayName = "FolderOpenOutlined";
X$.inheritAttrs = !1;
var Ice = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z" } }] }, name: "folder", theme: "outlined" };
function W_(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(n);
    typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(n).filter(function(o) {
      return Object.getOwnPropertyDescriptor(n, o).enumerable;
    }))), i.forEach(function(o) {
      Mce(t, o, n[o]);
    });
  }
  return t;
}
function Mce(t, e, n) {
  return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
var Z$ = function(e, n) {
  var i = W_({}, e, n.attrs);
  return v(bn, W_({}, i, {
    icon: Ice
  }), null);
};
Z$.displayName = "FolderOutlined";
Z$.inheritAttrs = !1;
var os;
(function(t) {
  t[t.None = 0] = "None", t[t.Start = 1] = "Start", t[t.End = 2] = "End";
})(os || (os = {}));
function G$(t, e, n) {
  function i(o) {
    const r = o[e.key], a = o[e.children];
    n(r, o) !== !1 && G$(a || [], e, n);
  }
  t.forEach(i);
}
function Ace(t) {
  let {
    treeData: e,
    expandedKeys: n,
    startKey: i,
    endKey: o,
    fieldNames: r = {
      title: "title",
      key: "key",
      children: "children"
    }
  } = t;
  const a = [];
  let l = os.None;
  if (i && i === o)
    return [i];
  if (!i || !o)
    return [];
  function s(u) {
    return u === i || u === o;
  }
  return G$(e, r, (u) => {
    if (l === os.End)
      return !1;
    if (s(u)) {
      if (a.push(u), l === os.None)
        l = os.Start;
      else if (l === os.Start)
        return l = os.End, !1;
    } else l === os.Start && a.push(u);
    return n.includes(u);
  }), a;
}
function E1(t, e, n) {
  const i = [...e], o = [];
  return G$(t, n, (r, a) => {
    const l = i.indexOf(r);
    return l !== -1 && (o.push(a), i.splice(l, 1)), !!i.length;
  }), o;
}
var Rce = function(t, e) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
    e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
  return n;
};
const Dce = () => k(k({}, Ez()), {
  expandAction: pn([Boolean, String])
});
function Nce(t) {
  const {
    isLeaf: e,
    expanded: n
  } = t;
  return e ? v(Fy, null, null) : n ? v(X$, null, null) : v(Z$, null, null);
}
const _1 = Oe({
  compatConfig: {
    MODE: 3
  },
  name: "ADirectoryTree",
  inheritAttrs: !1,
  props: Kn(Dce(), {
    showIcon: !0,
    expandAction: "click"
  }),
  slots: Object,
  // emits: [
  //   'update:selectedKeys',
  //   'update:checkedKeys',
  //   'update:expandedKeys',
  //   'expand',
  //   'select',
  //   'check',
  //   'doubleclick',
  //   'dblclick',
  //   'click',
  // ],
  setup(t, e) {
    let {
      attrs: n,
      slots: i,
      emit: o,
      expose: r
    } = e;
    var a;
    const l = de(t.treeData || LO(ho((a = i.default) === null || a === void 0 ? void 0 : a.call(i))));
    _e(() => t.treeData, () => {
      l.value = t.treeData;
    }), Ns(() => {
      rn(() => {
        var _;
        t.treeData === void 0 && i.default && (l.value = LO(ho((_ = i.default) === null || _ === void 0 ? void 0 : _.call(i))));
      });
    });
    const s = de(), u = de(), c = A(() => Iy(t.fieldNames)), d = de();
    r({
      scrollTo: (_) => {
        var D;
        (D = d.value) === null || D === void 0 || D.scrollTo(_);
      },
      selectedKeys: A(() => {
        var _;
        return (_ = d.value) === null || _ === void 0 ? void 0 : _.selectedKeys;
      }),
      checkedKeys: A(() => {
        var _;
        return (_ = d.value) === null || _ === void 0 ? void 0 : _.checkedKeys;
      }),
      halfCheckedKeys: A(() => {
        var _;
        return (_ = d.value) === null || _ === void 0 ? void 0 : _.halfCheckedKeys;
      }),
      loadedKeys: A(() => {
        var _;
        return (_ = d.value) === null || _ === void 0 ? void 0 : _.loadedKeys;
      }),
      loadingKeys: A(() => {
        var _;
        return (_ = d.value) === null || _ === void 0 ? void 0 : _.loadingKeys;
      }),
      expandedKeys: A(() => {
        var _;
        return (_ = d.value) === null || _ === void 0 ? void 0 : _.expandedKeys;
      })
    });
    const h = () => {
      const {
        keyEntities: _
      } = x$(l.value, {
        fieldNames: c.value
      });
      let D;
      return t.defaultExpandAll ? D = Object.keys(_) : t.defaultExpandParent ? D = NO(t.expandedKeys || t.defaultExpandedKeys || [], _) : D = t.expandedKeys || t.defaultExpandedKeys, D;
    }, p = de(t.selectedKeys || t.defaultSelectedKeys || []), g = de(h());
    _e(() => t.selectedKeys, () => {
      t.selectedKeys !== void 0 && (p.value = t.selectedKeys);
    }, {
      immediate: !0
    }), _e(() => t.expandedKeys, () => {
      t.expandedKeys !== void 0 && (g.value = t.expandedKeys);
    }, {
      immediate: !0
    });
    const y = _A((_, D) => {
      const {
        isLeaf: M
      } = D;
      M || _.shiftKey || _.metaKey || _.ctrlKey || d.value.onNodeExpand(_, D);
    }, 200, {
      leading: !0
    }), b = (_, D) => {
      t.expandedKeys === void 0 && (g.value = _), o("update:expandedKeys", _), o("expand", _, D);
    }, w = (_, D) => {
      const {
        expandAction: M
      } = t;
      M === "click" && y(_, D), o("click", _, D);
    }, $ = (_, D) => {
      const {
        expandAction: M
      } = t;
      (M === "dblclick" || M === "doubleclick") && y(_, D), o("doubleclick", _, D), o("dblclick", _, D);
    }, C = (_, D) => {
      const {
        multiple: M
      } = t, {
        node: N,
        nativeEvent: L
      } = D, j = N[c.value.key], B = k(k({}, D), {
        selected: !0
      }), Y = L?.ctrlKey || L?.metaKey, Q = L?.shiftKey;
      let G;
      M && Y ? (G = _, s.value = j, u.value = G, B.selectedNodes = E1(l.value, G, c.value)) : M && Q ? (G = Array.from(/* @__PURE__ */ new Set([...u.value || [], ...Ace({
        treeData: l.value,
        expandedKeys: g.value,
        startKey: j,
        endKey: s.value,
        fieldNames: c.value
      })])), B.selectedNodes = E1(l.value, G, c.value)) : (G = [j], s.value = j, u.value = G, B.selectedNodes = E1(l.value, G, c.value)), o("update:selectedKeys", G), o("select", G, B), t.selectedKeys === void 0 && (p.value = G);
    }, P = (_, D) => {
      o("update:checkedKeys", _), o("check", _, D);
    }, {
      prefixCls: O,
      direction: E
    } = Ht("tree", t);
    return () => {
      const _ = Ae(`${O.value}-directory`, {
        [`${O.value}-directory-rtl`]: E.value === "rtl"
      }, n.class), {
        icon: D = i.icon,
        blockNode: M = !0
      } = t, N = Rce(t, ["icon", "blockNode"]);
      return v(Ov, J(J(J({}, n), {}, {
        icon: D || Nce,
        ref: d,
        blockNode: M
      }, N), {}, {
        prefixCls: O.value,
        class: _,
        expandedKeys: g.value,
        selectedKeys: p.value,
        onSelect: C,
        onClick: w,
        onDblclick: $,
        onExpand: b,
        onCheck: P
      }), i);
    };
  }
}), I1 = DO, Lce = k(Ov, {
  DirectoryTree: _1,
  TreeNode: I1,
  install: (t) => (t.component(Ov.name, Ov), t.component(I1.name, I1), t.component(_1.name, _1), t)
});
function j_(t, e) {
  let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
  const i = /* @__PURE__ */ new Set();
  function o(r, a) {
    let l = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1;
    const s = i.has(r);
    if (pr(!s, "Warning: There may be circular references"), s)
      return !1;
    if (r === a)
      return !0;
    if (n && l > 1)
      return !1;
    i.add(r);
    const u = l + 1;
    if (Array.isArray(r)) {
      if (!Array.isArray(a) || r.length !== a.length)
        return !1;
      for (let c = 0; c < r.length; c++)
        if (!o(r[c], a[c], u))
          return !1;
      return !0;
    }
    if (r && a && typeof r == "object" && typeof a == "object") {
      const c = Object.keys(r);
      return c.length !== Object.keys(a).length ? !1 : c.every((d) => o(r[d], a[d], u));
    }
    return !1;
  }
  return o(t, e);
}
const {
  SubMenu: zce,
  Item: Bce
} = Bi;
function Fce(t) {
  return t.some((e) => {
    let {
      children: n
    } = e;
    return n && n.length > 0;
  });
}
function _z(t, e) {
  return typeof e == "string" || typeof e == "number" ? e?.toString().toLowerCase().includes(t.trim().toLowerCase()) : !1;
}
function Iz(t) {
  let {
    filters: e,
    prefixCls: n,
    filteredKeys: i,
    filterMultiple: o,
    searchValue: r,
    filterSearch: a
  } = t;
  return e.map((l, s) => {
    const u = String(l.value);
    if (l.children)
      return v(zce, {
        key: u || s,
        title: l.text,
        popupClassName: `${n}-dropdown-submenu`
      }, {
        default: () => [Iz({
          filters: l.children,
          prefixCls: n,
          filteredKeys: i,
          filterMultiple: o,
          searchValue: r,
          filterSearch: a
        })]
      });
    const c = o ? fo : uo, d = v(Bce, {
      key: l.value !== void 0 ? u : s
    }, {
      default: () => [v(c, {
        checked: i.includes(u)
      }, null), v("span", null, [l.text])]
    });
    return r.trim() ? typeof a == "function" ? a(r, l) ? d : void 0 : _z(r, l.text) ? d : void 0 : d;
  });
}
const Vce = Oe({
  name: "FilterDropdown",
  props: ["tablePrefixCls", "prefixCls", "dropdownPrefixCls", "column", "filterState", "filterMultiple", "filterMode", "filterSearch", "columnKey", "triggerFilter", "locale", "getPopupContainer"],
  setup(t, e) {
    let {
      slots: n
    } = e;
    const i = F$(), o = A(() => {
      var K;
      return (K = t.filterMode) !== null && K !== void 0 ? K : "menu";
    }), r = A(() => {
      var K;
      return (K = t.filterSearch) !== null && K !== void 0 ? K : !1;
    }), a = A(() => t.column.filterDropdownOpen || t.column.filterDropdownVisible), l = A(() => t.column.onFilterDropdownOpenChange || t.column.onFilterDropdownVisibleChange);
    process.env.NODE_ENV !== "production" && [["filterDropdownVisible", "filterDropdownOpen", t.column.filterDropdownVisible], ["onFilterDropdownVisibleChange", "onFilterDropdownOpenChange", t.column.onFilterDropdownVisibleChange]].forEach((K) => {
      let [ee, ie, ae] = K;
      $n(ae == null, "Table", `\`${ee}\` is deprecated. Please use \`${ie}\` instead.`);
    });
    const s = Te(!1), u = A(() => {
      var K;
      return !!(t.filterState && (!((K = t.filterState.filteredKeys) === null || K === void 0) && K.length || t.filterState.forceFiltered));
    }), c = A(() => {
      var K;
      return Vy((K = t.column) === null || K === void 0 ? void 0 : K.filters);
    }), d = A(() => {
      const {
        filterDropdown: K,
        slots: ee = {},
        customFilterDropdown: ie
      } = t.column;
      return K || ee.filterDropdown && i.value[ee.filterDropdown] || ie && i.value.customFilterDropdown;
    }), f = A(() => {
      const {
        filterIcon: K,
        slots: ee = {}
      } = t.column;
      return K || ee.filterIcon && i.value[ee.filterIcon] || i.value.customFilterIcon;
    }), h = (K) => {
      var ee;
      s.value = K, (ee = l.value) === null || ee === void 0 || ee.call(l, K);
    }, p = A(() => typeof a.value == "boolean" ? a.value : s.value), g = A(() => {
      var K;
      return (K = t.filterState) === null || K === void 0 ? void 0 : K.filteredKeys;
    }), m = Te([]), y = (K) => {
      let {
        selectedKeys: ee
      } = K;
      m.value = ee;
    }, b = (K, ee) => {
      let {
        node: ie,
        checked: ae
      } = ee;
      t.filterMultiple ? y({
        selectedKeys: K
      }) : y({
        selectedKeys: ae && ie.key ? [ie.key] : []
      });
    };
    _e(g, () => {
      s.value && y({
        selectedKeys: g.value || []
      });
    }, {
      immediate: !0
    });
    const w = Te([]), $ = Te(), C = (K) => {
      $.value = setTimeout(() => {
        w.value = K;
      });
    }, P = () => {
      clearTimeout($.value);
    };
    tn(() => {
      clearTimeout($.value);
    });
    const O = Te(""), E = (K) => {
      const {
        value: ee
      } = K.target;
      O.value = ee;
    };
    _e(s, () => {
      s.value || (O.value = "");
    });
    const _ = (K) => {
      const {
        column: ee,
        columnKey: ie,
        filterState: ae
      } = t, te = K && K.length ? K : null;
      if (te === null && (!ae || !ae.filteredKeys) || j_(te, ae?.filteredKeys, !0))
        return null;
      t.triggerFilter({
        column: ee,
        key: ie,
        filteredKeys: te
      });
    }, D = () => {
      h(!1), _(m.value);
    }, M = function() {
      let {
        confirm: K,
        closeDropdown: ee
      } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
        confirm: !1,
        closeDropdown: !1
      };
      K && _([]), ee && h(!1), O.value = "", t.column.filterResetToDefaultFilteredValue ? m.value = (t.column.defaultFilteredValue || []).map((ie) => String(ie)) : m.value = [];
    }, N = function() {
      let {
        closeDropdown: K
      } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
        closeDropdown: !0
      };
      K && h(!1), _(m.value);
    }, L = (K) => {
      K && g.value !== void 0 && (m.value = g.value || []), h(K), !K && !d.value && D();
    }, {
      direction: j
    } = Ht("", t), B = (K) => {
      if (K.target.checked) {
        const ee = c.value;
        m.value = ee;
      } else
        m.value = [];
    }, Y = (K) => {
      let {
        filters: ee
      } = K;
      return (ee || []).map((ie, ae) => {
        const te = String(ie.value), U = {
          title: ie.text,
          key: ie.value !== void 0 ? te : ae
        };
        return ie.children && (U.children = Y({
          filters: ie.children
        })), U;
      });
    }, Q = (K) => {
      var ee;
      return k(k({}, K), {
        text: K.title,
        value: K.key,
        children: ((ee = K.children) === null || ee === void 0 ? void 0 : ee.map((ie) => Q(ie))) || []
      });
    }, G = A(() => Y({
      filters: t.column.filters
    })), V = A(() => Ae({
      [`${t.dropdownPrefixCls}-menu-without-submenu`]: !Fce(t.column.filters || [])
    })), H = () => {
      const K = m.value, {
        column: ee,
        locale: ie,
        tablePrefixCls: ae,
        filterMultiple: te,
        dropdownPrefixCls: U,
        getPopupContainer: me,
        prefixCls: ce
      } = t;
      return (ee.filters || []).length === 0 ? v(xc, {
        image: xc.PRESENTED_IMAGE_SIMPLE,
        description: ie.filterEmptyText,
        imageStyle: {
          height: 24
        },
        style: {
          margin: 0,
          padding: "16px 0"
        }
      }, null) : o.value === "tree" ? v(tt, null, [v(__, {
        filterSearch: r.value,
        value: O.value,
        onChange: E,
        tablePrefixCls: ae,
        locale: ie
      }, null), v("div", {
        class: `${ae}-filter-dropdown-tree`
      }, [te ? v(fo, {
        class: `${ae}-filter-dropdown-checkall`,
        onChange: B,
        checked: K.length === c.value.length,
        indeterminate: K.length > 0 && K.length < c.value.length
      }, {
        default: () => [ie.filterCheckall]
      }) : null, v(Lce, {
        checkable: !0,
        selectable: !1,
        blockNode: !0,
        multiple: te,
        checkStrictly: !te,
        class: `${U}-menu`,
        onCheck: b,
        checkedKeys: K,
        selectedKeys: K,
        showIcon: !1,
        treeData: G.value,
        autoExpandParent: !0,
        defaultExpandAll: !0,
        filterTreeNode: O.value.trim() ? (ue) => typeof r.value == "function" ? r.value(O.value, Q(ue)) : _z(O.value, ue.title) : void 0
      }, null)])]) : v(tt, null, [v(__, {
        filterSearch: r.value,
        value: O.value,
        onChange: E,
        tablePrefixCls: ae,
        locale: ie
      }, null), v(Bi, {
        multiple: te,
        prefixCls: `${U}-menu`,
        class: V.value,
        onClick: P,
        onSelect: y,
        onDeselect: y,
        selectedKeys: K,
        getPopupContainer: me,
        openKeys: w.value,
        onOpenChange: C
      }, {
        default: () => Iz({
          filters: ee.filters || [],
          filterSearch: r.value,
          prefixCls: ce,
          filteredKeys: m.value,
          filterMultiple: te,
          searchValue: O.value
        })
      })]);
    }, q = A(() => {
      const K = m.value;
      return t.column.filterResetToDefaultFilteredValue ? j_((t.column.defaultFilteredValue || []).map((ee) => String(ee)), K, !0) : K.length === 0;
    });
    return () => {
      var K;
      const {
        tablePrefixCls: ee,
        prefixCls: ie,
        column: ae,
        dropdownPrefixCls: te,
        locale: U,
        getPopupContainer: me
      } = t;
      let ce;
      typeof d.value == "function" ? ce = d.value({
        prefixCls: `${te}-custom`,
        setSelectedKeys: (he) => y({
          selectedKeys: he
        }),
        selectedKeys: m.value,
        confirm: N,
        clearFilters: M,
        filters: ae.filters,
        visible: p.value,
        column: ae.__originColumn__,
        close: () => {
          h(!1);
        }
      }) : d.value ? ce = d.value : ce = v(tt, null, [H(), v("div", {
        class: `${ie}-dropdown-btns`
      }, [v(en, {
        type: "link",
        size: "small",
        disabled: q.value,
        onClick: () => M()
      }, {
        default: () => [U.filterReset]
      }), v(en, {
        type: "primary",
        size: "small",
        onClick: D
      }, {
        default: () => [U.filterConfirm]
      })])]);
      const ue = v(ice, {
        class: `${ie}-dropdown`
      }, {
        default: () => [ce]
      });
      let fe;
      return typeof f.value == "function" ? fe = f.value({
        filtered: u.value,
        column: ae.__originColumn__
      }) : f.value ? fe = f.value : fe = v(j$, null, null), v("div", {
        class: `${ie}-column`
      }, [v("span", {
        class: `${ee}-column-title`
      }, [(K = n.default) === null || K === void 0 ? void 0 : K.call(n)]), v(Nr, {
        overlay: ue,
        trigger: ["click"],
        open: p.value,
        onOpenChange: L,
        getPopupContainer: me,
        placement: j.value === "rtl" ? "bottomLeft" : "bottomRight"
      }, {
        default: () => [v("span", {
          role: "button",
          tabindex: -1,
          class: Ae(`${ie}-trigger`, {
            active: u.value
          }),
          onClick: (he) => {
            he.stopPropagation();
          }
        }, [fe])]
      })]);
    };
  }
});
function hS(t, e, n) {
  let i = [];
  return (t || []).forEach((o, r) => {
    var a, l;
    const s = $g(r, n), u = o.filterDropdown || ((a = o?.slots) === null || a === void 0 ? void 0 : a.filterDropdown) || o.customFilterDropdown;
    if (o.filters || u || "onFilter" in o)
      if ("filteredValue" in o) {
        let c = o.filteredValue;
        u || (c = (l = c?.map(String)) !== null && l !== void 0 ? l : c), i.push({
          column: o,
          key: Xc(o, s),
          filteredKeys: c,
          forceFiltered: o.filtered
        });
      } else
        i.push({
          column: o,
          key: Xc(o, s),
          filteredKeys: e && o.defaultFilteredValue ? o.defaultFilteredValue : void 0,
          forceFiltered: o.filtered
        });
    "children" in o && (i = [...i, ...hS(o.children, e, s)]);
  }), i;
}
function Mz(t, e, n, i, o, r, a, l) {
  return n.map((s, u) => {
    var c;
    const d = $g(u, l), {
      filterMultiple: f = !0,
      filterMode: h,
      filterSearch: p
    } = s;
    let g = s;
    const m = s.filterDropdown || ((c = s?.slots) === null || c === void 0 ? void 0 : c.filterDropdown) || s.customFilterDropdown;
    if (g.filters || m) {
      const y = Xc(g, d), b = i.find((w) => {
        let {
          key: $
        } = w;
        return y === $;
      });
      g = k(k({}, g), {
        title: (w) => v(Vce, {
          tablePrefixCls: t,
          prefixCls: `${t}-filter`,
          dropdownPrefixCls: e,
          column: g,
          columnKey: y,
          filterState: b,
          filterMultiple: f,
          filterMode: h,
          filterSearch: p,
          triggerFilter: r,
          locale: o,
          getPopupContainer: a
        }, {
          default: () => [W$(s.title, w)]
        })
      });
    }
    return "children" in g && (g = k(k({}, g), {
      children: Mz(t, e, g.children, i, o, r, a, d)
    })), g;
  });
}
function Vy(t) {
  let e = [];
  return (t || []).forEach((n) => {
    let {
      value: i,
      children: o
    } = n;
    e.push(i), o && (e = [...e, ...Vy(o)]);
  }), e;
}
function q_(t) {
  const e = {};
  return t.forEach((n) => {
    let {
      key: i,
      filteredKeys: o,
      column: r
    } = n;
    var a;
    const l = r.filterDropdown || ((a = r?.slots) === null || a === void 0 ? void 0 : a.filterDropdown) || r.customFilterDropdown, {
      filters: s
    } = r;
    if (l)
      e[i] = o || null;
    else if (Array.isArray(o)) {
      const u = Vy(s);
      e[i] = u.filter((c) => o.includes(String(c)));
    } else
      e[i] = null;
  }), e;
}
function Y_(t, e) {
  return e.reduce((n, i) => {
    const {
      column: {
        onFilter: o,
        filters: r
      },
      filteredKeys: a
    } = i;
    return o && a && a.length ? n.filter((l) => a.some((s) => {
      const u = Vy(r), c = u.findIndex((f) => String(f) === String(s)), d = c !== -1 ? u[c] : s;
      return o(d, l);
    })) : n;
  }, t);
}
function Az(t) {
  return t.flatMap((e) => "children" in e ? [e, ...Az(e.children || [])] : [e]);
}
function Qce(t) {
  let {
    prefixCls: e,
    dropdownPrefixCls: n,
    mergedColumns: i,
    locale: o,
    onFilterChange: r,
    getPopupContainer: a
  } = t;
  const l = A(() => Az(i.value)), [s, u] = zn(hS(l.value, !0)), c = A(() => {
    const p = hS(l.value, !1);
    if (p.length === 0)
      return p;
    let g = !0, m = !0;
    if (p.forEach((y) => {
      let {
        filteredKeys: b
      } = y;
      b !== void 0 ? g = !1 : m = !1;
    }), g) {
      const y = (l.value || []).map((b, w) => Xc(b, $g(w)));
      return s.value.filter((b) => {
        let {
          key: w
        } = b;
        return y.includes(w);
      }).map((b) => {
        const w = l.value[y.findIndex(($) => $ === b.key)];
        return k(k({}, b), {
          column: k(k({}, b.column), w),
          forceFiltered: w.filtered
        });
      });
    }
    return $n(m, "Table", "Columns should all contain `filteredValue` or not contain `filteredValue`."), p;
  }), d = A(() => q_(c.value)), f = (p) => {
    const g = c.value.filter((m) => {
      let {
        key: y
      } = m;
      return y !== p.key;
    });
    g.push(p), u(g), r(q_(g), g);
  };
  return [(p) => Mz(e.value, n.value, p, c.value, o.value, f, a.value), c, d];
}
function Rz(t, e) {
  return t.map((n) => {
    const i = k({}, n);
    return i.title = W$(i.title, e), "children" in i && (i.children = Rz(i.children, e)), i;
  });
}
function Hce(t) {
  return [(n) => Rz(n, t.value)];
}
function Wce(t) {
  return function(n) {
    let {
      prefixCls: i,
      onExpand: o,
      record: r,
      expanded: a,
      expandable: l
    } = n;
    const s = `${i}-row-expand-icon`;
    return v("button", {
      type: "button",
      onClick: (u) => {
        o(r, u), u.stopPropagation();
      },
      class: Ae(s, {
        [`${s}-spaced`]: !l,
        [`${s}-expanded`]: l && a,
        [`${s}-collapsed`]: l && !a
      }),
      "aria-label": a ? t.collapse : t.expand,
      "aria-expanded": a
    }, null);
  };
}
function Dz(t, e) {
  const n = e.value;
  return t.map((i) => {
    var o;
    if (i === Ea || i === gl) return i;
    const r = k({}, i), {
      slots: a = {}
    } = r;
    return r.__originColumn__ = i, $n(!("slots" in r), "Table", "`column.slots` is deprecated. Please use `v-slot:headerCell` `v-slot:bodyCell` instead."), Object.keys(a).forEach((l) => {
      const s = a[l];
      r[l] === void 0 && n[s] && (r[l] = n[s]);
    }), e.value.headerCell && !(!((o = i.slots) === null || o === void 0) && o.title) && (r.title = fy(e.value, "headerCell", {
      title: i.title,
      column: i
    }, () => [i.title])), "children" in r && Array.isArray(r.children) && (r.children = Dz(r.children, e)), r;
  });
}
function jce(t) {
  return [(n) => Dz(n, t)];
}
const qce = (t) => {
  const {
    componentCls: e
  } = t, n = `${t.lineWidth}px ${t.lineType} ${t.tableBorderColor}`, i = (o, r, a) => ({
    [`&${e}-${o}`]: {
      [`> ${e}-container`]: {
        [`> ${e}-content, > ${e}-body`]: {
          "> table > tbody > tr > td": {
            [`> ${e}-expanded-row-fixed`]: {
              margin: `-${r}px -${a + t.lineWidth}px`
            }
          }
        }
      }
    }
  });
  return {
    [`${e}-wrapper`]: {
      [`${e}${e}-bordered`]: k(k(k({
        // ============================ Title =============================
        [`> ${e}-title`]: {
          border: n,
          borderBottom: 0
        },
        // ============================ Content ============================
        [`> ${e}-container`]: {
          borderInlineStart: n,
          [`
            > ${e}-content,
            > ${e}-header,
            > ${e}-body,
            > ${e}-summary
          `]: {
            "> table": {
              // ============================= Cell =============================
              "\n                > thead > tr > th,\n                > tbody > tr > td,\n                > tfoot > tr > th,\n                > tfoot > tr > td\n              ": {
                borderInlineEnd: n
              },
              // ============================ Header ============================
              "> thead": {
                "> tr:not(:last-child) > th": {
                  borderBottom: n
                },
                "> tr > th::before": {
                  backgroundColor: "transparent !important"
                }
              },
              // Fixed right should provides additional border
              "\n                > thead > tr,\n                > tbody > tr,\n                > tfoot > tr\n              ": {
                [`> ${e}-cell-fix-right-first::after`]: {
                  borderInlineEnd: n
                }
              },
              // ========================== Expandable ==========================
              "> tbody > tr > td": {
                [`> ${e}-expanded-row-fixed`]: {
                  margin: `-${t.tablePaddingVertical}px -${t.tablePaddingHorizontal + t.lineWidth}px`,
                  "&::after": {
                    position: "absolute",
                    top: 0,
                    insetInlineEnd: t.lineWidth,
                    bottom: 0,
                    borderInlineEnd: n,
                    content: '""'
                  }
                }
              }
            }
          },
          [`
            > ${e}-content,
            > ${e}-header
          `]: {
            "> table": {
              borderTop: n
            }
          }
        },
        // ============================ Scroll ============================
        [`&${e}-scroll-horizontal`]: {
          [`> ${e}-container > ${e}-body`]: {
            "> table > tbody": {
              [`
                > tr${e}-expanded-row,
                > tr${e}-placeholder
              `]: {
                "> td": {
                  borderInlineEnd: 0
                }
              }
            }
          }
        }
      }, i("middle", t.tablePaddingVerticalMiddle, t.tablePaddingHorizontalMiddle)), i("small", t.tablePaddingVerticalSmall, t.tablePaddingHorizontalSmall)), {
        // ============================ Footer ============================
        [`> ${e}-footer`]: {
          border: n,
          borderTop: 0
        }
      }),
      // ============================ Nested ============================
      [`${e}-cell`]: {
        [`${e}-container:first-child`]: {
          // :first-child to avoid the case when bordered and title is set
          borderTop: 0
        },
        // https://github.com/ant-design/ant-design/issues/35577
        "&-scrollbar:not([rowspan])": {
          boxShadow: `0 ${t.lineWidth}px 0 ${t.lineWidth}px ${t.tableHeaderBg}`
        }
      }
    }
  };
}, Yce = (t) => {
  const {
    componentCls: e
  } = t;
  return {
    [`${e}-wrapper`]: {
      [`${e}-cell-ellipsis`]: k(k({}, Ps), {
        wordBreak: "keep-all",
        // Fixed first or last should special process
        [`
          &${e}-cell-fix-left-last,
          &${e}-cell-fix-right-first
        `]: {
          overflow: "visible",
          [`${e}-cell-content`]: {
            display: "block",
            overflow: "hidden",
            textOverflow: "ellipsis"
          }
        },
        [`${e}-column-title`]: {
          overflow: "hidden",
          textOverflow: "ellipsis",
          wordBreak: "keep-all"
        }
      })
    }
  };
}, Kce = (t) => {
  const {
    componentCls: e
  } = t;
  return {
    [`${e}-wrapper`]: {
      [`${e}-tbody > tr${e}-placeholder`]: {
        textAlign: "center",
        color: t.colorTextDisabled,
        "&:hover > td": {
          background: t.colorBgContainer
        }
      }
    }
  };
}, Xce = (t) => {
  const {
    componentCls: e,
    antCls: n,
    controlInteractiveSize: i,
    motionDurationSlow: o,
    lineWidth: r,
    paddingXS: a,
    lineType: l,
    tableBorderColor: s,
    tableExpandIconBg: u,
    tableExpandColumnWidth: c,
    borderRadius: d,
    fontSize: f,
    fontSizeSM: h,
    lineHeight: p,
    tablePaddingVertical: g,
    tablePaddingHorizontal: m,
    tableExpandedRowBg: y,
    paddingXXS: b
  } = t, w = i / 2 - r, $ = w * 2 + r * 3, C = `${r}px ${l} ${s}`, P = b - r;
  return {
    [`${e}-wrapper`]: {
      [`${e}-expand-icon-col`]: {
        width: c
      },
      [`${e}-row-expand-icon-cell`]: {
        textAlign: "center",
        [`${e}-row-expand-icon`]: {
          display: "inline-flex",
          float: "none",
          verticalAlign: "sub"
        }
      },
      [`${e}-row-indent`]: {
        height: 1,
        float: "left"
      },
      [`${e}-row-expand-icon`]: k(k({}, rK(t)), {
        position: "relative",
        float: "left",
        boxSizing: "border-box",
        width: $,
        height: $,
        padding: 0,
        color: "inherit",
        lineHeight: `${$}px`,
        background: u,
        border: C,
        borderRadius: d,
        transform: `scale(${i / $})`,
        transition: `all ${o}`,
        userSelect: "none",
        "&:focus, &:hover, &:active": {
          borderColor: "currentcolor"
        },
        "&::before, &::after": {
          position: "absolute",
          background: "currentcolor",
          transition: `transform ${o} ease-out`,
          content: '""'
        },
        "&::before": {
          top: w,
          insetInlineEnd: P,
          insetInlineStart: P,
          height: r
        },
        "&::after": {
          top: P,
          bottom: P,
          insetInlineStart: w,
          width: r,
          transform: "rotate(90deg)"
        },
        // Motion effect
        "&-collapsed::before": {
          transform: "rotate(-180deg)"
        },
        "&-collapsed::after": {
          transform: "rotate(0deg)"
        },
        "&-spaced": {
          "&::before, &::after": {
            display: "none",
            content: "none"
          },
          background: "transparent",
          border: 0,
          visibility: "hidden"
        }
      }),
      [`${e}-row-indent + ${e}-row-expand-icon`]: {
        marginTop: (f * p - r * 3) / 2 - Math.ceil((h * 1.4 - r * 3) / 2),
        marginInlineEnd: a
      },
      [`tr${e}-expanded-row`]: {
        "&, &:hover": {
          "> td": {
            background: y
          }
        },
        // https://github.com/ant-design/ant-design/issues/25573
        [`${n}-descriptions-view`]: {
          display: "flex",
          table: {
            flex: "auto",
            width: "auto"
          }
        }
      },
      // With fixed
      [`${e}-expanded-row-fixed`]: {
        position: "relative",
        margin: `-${g}px -${m}px`,
        padding: `${g}px ${m}px`
      }
    }
  };
}, Zce = (t) => {
  const {
    componentCls: e,
    antCls: n,
    iconCls: i,
    tableFilterDropdownWidth: o,
    tableFilterDropdownSearchWidth: r,
    paddingXXS: a,
    paddingXS: l,
    colorText: s,
    lineWidth: u,
    lineType: c,
    tableBorderColor: d,
    tableHeaderIconColor: f,
    fontSizeSM: h,
    tablePaddingHorizontal: p,
    borderRadius: g,
    motionDurationSlow: m,
    colorTextDescription: y,
    colorPrimary: b,
    tableHeaderFilterActiveBg: w,
    colorTextDisabled: $,
    tableFilterDropdownBg: C,
    tableFilterDropdownHeight: P,
    controlItemBgHover: O,
    controlItemBgActive: E,
    boxShadowSecondary: _
  } = t, D = `${n}-dropdown`, M = `${e}-filter-dropdown`, N = `${n}-tree`, L = `${u}px ${c} ${d}`;
  return [
    {
      [`${e}-wrapper`]: {
        [`${e}-filter-column`]: {
          display: "flex",
          justifyContent: "space-between"
        },
        [`${e}-filter-trigger`]: {
          position: "relative",
          display: "flex",
          alignItems: "center",
          marginBlock: -a,
          marginInline: `${a}px ${-p / 2}px`,
          padding: `0 ${a}px`,
          color: f,
          fontSize: h,
          borderRadius: g,
          cursor: "pointer",
          transition: `all ${m}`,
          "&:hover": {
            color: y,
            background: w
          },
          "&.active": {
            color: b
          }
        }
      }
    },
    {
      // Dropdown
      [`${n}-dropdown`]: {
        [M]: k(k({}, kn(t)), {
          minWidth: o,
          backgroundColor: C,
          borderRadius: g,
          boxShadow: _,
          // Reset menu
          [`${D}-menu`]: {
            // https://github.com/ant-design/ant-design/issues/4916
            // https://github.com/ant-design/ant-design/issues/19542
            maxHeight: P,
            overflowX: "hidden",
            border: 0,
            boxShadow: "none",
            "&:empty::after": {
              display: "block",
              padding: `${l}px 0`,
              color: $,
              fontSize: h,
              textAlign: "center",
              content: '"Not Found"'
            }
          },
          [`${M}-tree`]: {
            paddingBlock: `${l}px 0`,
            paddingInline: l,
            [N]: {
              padding: 0
            },
            [`${N}-treenode ${N}-node-content-wrapper:hover`]: {
              backgroundColor: O
            },
            [`${N}-treenode-checkbox-checked ${N}-node-content-wrapper`]: {
              "&, &:hover": {
                backgroundColor: E
              }
            }
          },
          [`${M}-search`]: {
            padding: l,
            borderBottom: L,
            "&-input": {
              input: {
                minWidth: r
              },
              [i]: {
                color: $
              }
            }
          },
          [`${M}-checkall`]: {
            width: "100%",
            marginBottom: a,
            marginInlineStart: a
          },
          // Operation
          [`${M}-btns`]: {
            display: "flex",
            justifyContent: "space-between",
            padding: `${l - u}px ${l}px`,
            overflow: "hidden",
            backgroundColor: "inherit",
            borderTop: L
          }
        })
      }
    },
    // Dropdown Menu & SubMenu
    {
      // submenu of table filter dropdown
      [`${n}-dropdown ${M}, ${M}-submenu`]: {
        // Checkbox
        [`${n}-checkbox-wrapper + span`]: {
          paddingInlineStart: l,
          color: s
        },
        "> ul": {
          maxHeight: "calc(100vh - 130px)",
          overflowX: "hidden",
          overflowY: "auto"
        }
      }
    }
  ];
}, Gce = (t) => {
  const {
    componentCls: e,
    lineWidth: n,
    colorSplit: i,
    motionDurationSlow: o,
    zIndexTableFixed: r,
    tableBg: a,
    zIndexTableSticky: l
  } = t, s = i;
  return {
    [`${e}-wrapper`]: {
      [`
        ${e}-cell-fix-left,
        ${e}-cell-fix-right
      `]: {
        position: "sticky !important",
        zIndex: r,
        background: a
      },
      [`
        ${e}-cell-fix-left-first::after,
        ${e}-cell-fix-left-last::after
      `]: {
        position: "absolute",
        top: 0,
        right: {
          _skip_check_: !0,
          value: 0
        },
        bottom: -n,
        width: 30,
        transform: "translateX(100%)",
        transition: `box-shadow ${o}`,
        content: '""',
        pointerEvents: "none"
      },
      [`${e}-cell-fix-left-all::after`]: {
        display: "none"
      },
      [`
        ${e}-cell-fix-right-first::after,
        ${e}-cell-fix-right-last::after
      `]: {
        position: "absolute",
        top: 0,
        bottom: -n,
        left: {
          _skip_check_: !0,
          value: 0
        },
        width: 30,
        transform: "translateX(-100%)",
        transition: `box-shadow ${o}`,
        content: '""',
        pointerEvents: "none"
      },
      [`${e}-container`]: {
        "&::before, &::after": {
          position: "absolute",
          top: 0,
          bottom: 0,
          zIndex: l + 1,
          width: 30,
          transition: `box-shadow ${o}`,
          content: '""',
          pointerEvents: "none"
        },
        "&::before": {
          insetInlineStart: 0
        },
        "&::after": {
          insetInlineEnd: 0
        }
      },
      [`${e}-ping-left`]: {
        [`&:not(${e}-has-fix-left) ${e}-container`]: {
          position: "relative",
          "&::before": {
            boxShadow: `inset 10px 0 8px -8px ${s}`
          }
        },
        [`
          ${e}-cell-fix-left-first::after,
          ${e}-cell-fix-left-last::after
        `]: {
          boxShadow: `inset 10px 0 8px -8px ${s}`
        },
        [`${e}-cell-fix-left-last::before`]: {
          backgroundColor: "transparent !important"
        }
      },
      [`${e}-ping-right`]: {
        [`&:not(${e}-has-fix-right) ${e}-container`]: {
          position: "relative",
          "&::after": {
            boxShadow: `inset -10px 0 8px -8px ${s}`
          }
        },
        [`
          ${e}-cell-fix-right-first::after,
          ${e}-cell-fix-right-last::after
        `]: {
          boxShadow: `inset -10px 0 8px -8px ${s}`
        }
      }
    }
  };
}, Uce = (t) => {
  const {
    componentCls: e,
    antCls: n
  } = t;
  return {
    [`${e}-wrapper`]: {
      // ========================== Pagination ==========================
      [`${e}-pagination${n}-pagination`]: {
        margin: `${t.margin}px 0`
      },
      [`${e}-pagination`]: {
        display: "flex",
        flexWrap: "wrap",
        rowGap: t.paddingXS,
        "> *": {
          flex: "none"
        },
        "&-left": {
          justifyContent: "flex-start"
        },
        "&-center": {
          justifyContent: "center"
        },
        "&-right": {
          justifyContent: "flex-end"
        }
      }
    }
  };
}, Jce = (t) => {
  const {
    componentCls: e,
    tableRadius: n
  } = t;
  return {
    [`${e}-wrapper`]: {
      [e]: {
        // https://github.com/ant-design/ant-design/issues/39115#issuecomment-1362314574
        [`${e}-title, ${e}-header`]: {
          borderRadius: `${n}px ${n}px 0 0`
        },
        [`${e}-title + ${e}-container`]: {
          borderStartStartRadius: 0,
          borderStartEndRadius: 0,
          table: {
            borderRadius: 0,
            "> thead > tr:first-child": {
              "th:first-child": {
                borderRadius: 0
              },
              "th:last-child": {
                borderRadius: 0
              }
            }
          }
        },
        "&-container": {
          borderStartStartRadius: n,
          borderStartEndRadius: n,
          "table > thead > tr:first-child": {
            "> *:first-child": {
              borderStartStartRadius: n
            },
            "> *:last-child": {
              borderStartEndRadius: n
            }
          }
        },
        "&-footer": {
          borderRadius: `0 0 ${n}px ${n}px`
        }
      }
    }
  };
}, ede = (t) => {
  const {
    componentCls: e
  } = t;
  return {
    [`${e}-wrapper-rtl`]: {
      direction: "rtl",
      table: {
        direction: "rtl"
      },
      [`${e}-pagination-left`]: {
        justifyContent: "flex-end"
      },
      [`${e}-pagination-right`]: {
        justifyContent: "flex-start"
      },
      [`${e}-row-expand-icon`]: {
        "&::after": {
          transform: "rotate(-90deg)"
        },
        "&-collapsed::before": {
          transform: "rotate(180deg)"
        },
        "&-collapsed::after": {
          transform: "rotate(0deg)"
        }
      }
    }
  };
}, tde = (t) => {
  const {
    componentCls: e,
    antCls: n,
    iconCls: i,
    fontSizeIcon: o,
    paddingXS: r,
    tableHeaderIconColor: a,
    tableHeaderIconColorHover: l
  } = t;
  return {
    [`${e}-wrapper`]: {
      // ========================== Selections ==========================
      [`${e}-selection-col`]: {
        width: t.tableSelectionColumnWidth
      },
      [`${e}-bordered ${e}-selection-col`]: {
        width: t.tableSelectionColumnWidth + r * 2
      },
      [`
        table tr th${e}-selection-column,
        table tr td${e}-selection-column
      `]: {
        paddingInlineEnd: t.paddingXS,
        paddingInlineStart: t.paddingXS,
        textAlign: "center",
        [`${n}-radio-wrapper`]: {
          marginInlineEnd: 0
        }
      },
      [`table tr th${e}-selection-column${e}-cell-fix-left`]: {
        zIndex: t.zIndexTableFixed + 1
      },
      [`table tr th${e}-selection-column::after`]: {
        backgroundColor: "transparent !important"
      },
      [`${e}-selection`]: {
        position: "relative",
        display: "inline-flex",
        flexDirection: "column"
      },
      [`${e}-selection-extra`]: {
        position: "absolute",
        top: 0,
        zIndex: 1,
        cursor: "pointer",
        transition: `all ${t.motionDurationSlow}`,
        marginInlineStart: "100%",
        paddingInlineStart: `${t.tablePaddingHorizontal / 4}px`,
        [i]: {
          color: a,
          fontSize: o,
          verticalAlign: "baseline",
          "&:hover": {
            color: l
          }
        }
      }
    }
  };
}, nde = (t) => {
  const {
    componentCls: e
  } = t, n = (i, o, r, a) => ({
    [`${e}${e}-${i}`]: {
      fontSize: a,
      [`
        ${e}-title,
        ${e}-footer,
        ${e}-thead > tr > th,
        ${e}-tbody > tr > td,
        tfoot > tr > th,
        tfoot > tr > td
      `]: {
        padding: `${o}px ${r}px`
      },
      [`${e}-filter-trigger`]: {
        marginInlineEnd: `-${r / 2}px`
      },
      [`${e}-expanded-row-fixed`]: {
        margin: `-${o}px -${r}px`
      },
      [`${e}-tbody`]: {
        // ========================= Nest Table ===========================
        [`${e}-wrapper:only-child ${e}`]: {
          marginBlock: `-${o}px`,
          marginInline: `${t.tableExpandColumnWidth - r}px -${r}px`
        }
      },
      // https://github.com/ant-design/ant-design/issues/35167
      [`${e}-selection-column`]: {
        paddingInlineStart: `${r / 4}px`
      }
    }
  });
  return {
    [`${e}-wrapper`]: k(k({}, n("middle", t.tablePaddingVerticalMiddle, t.tablePaddingHorizontalMiddle, t.tableFontSizeMiddle)), n("small", t.tablePaddingVerticalSmall, t.tablePaddingHorizontalSmall, t.tableFontSizeSmall))
  };
}, ide = (t) => {
  const {
    componentCls: e
  } = t;
  return {
    [`${e}-wrapper ${e}-resize-handle`]: {
      position: "absolute",
      top: 0,
      height: "100% !important",
      bottom: 0,
      left: " auto !important",
      right: " -8px",
      cursor: "col-resize",
      touchAction: "none",
      userSelect: "auto",
      width: "16px",
      zIndex: 1,
      "&-line": {
        display: "block",
        width: "1px",
        marginLeft: "7px",
        height: "100% !important",
        backgroundColor: t.colorPrimary,
        opacity: 0
      },
      "&:hover &-line": {
        opacity: 1
      }
    },
    [`${e}-wrapper  ${e}-resize-handle.dragging`]: {
      overflow: "hidden",
      [`${e}-resize-handle-line`]: {
        opacity: 1
      },
      "&:before": {
        position: "absolute",
        top: 0,
        bottom: 0,
        content: '" "',
        width: "200vw",
        transform: "translateX(-50%)",
        opacity: 0
      }
    }
  };
}, ode = (t) => {
  const {
    componentCls: e,
    marginXXS: n,
    fontSizeIcon: i,
    tableHeaderIconColor: o,
    tableHeaderIconColorHover: r
  } = t;
  return {
    [`${e}-wrapper`]: {
      [`${e}-thead th${e}-column-has-sorters`]: {
        outline: "none",
        cursor: "pointer",
        transition: `all ${t.motionDurationSlow}`,
        "&:hover": {
          background: t.tableHeaderSortHoverBg,
          "&::before": {
            backgroundColor: "transparent !important"
          }
        },
        "&:focus-visible": {
          color: t.colorPrimary
        },
        // https://github.com/ant-design/ant-design/issues/30969
        [`
          &${e}-cell-fix-left:hover,
          &${e}-cell-fix-right:hover
        `]: {
          background: t.tableFixedHeaderSortActiveBg
        }
      },
      [`${e}-thead th${e}-column-sort`]: {
        background: t.tableHeaderSortBg,
        "&::before": {
          backgroundColor: "transparent !important"
        }
      },
      [`td${e}-column-sort`]: {
        background: t.tableBodySortBg
      },
      [`${e}-column-title`]: {
        position: "relative",
        zIndex: 1,
        flex: 1
      },
      [`${e}-column-sorters`]: {
        display: "flex",
        flex: "auto",
        alignItems: "center",
        justifyContent: "space-between",
        "&::after": {
          position: "absolute",
          inset: 0,
          width: "100%",
          height: "100%",
          content: '""'
        }
      },
      [`${e}-column-sorter`]: {
        marginInlineStart: n,
        color: o,
        fontSize: 0,
        transition: `color ${t.motionDurationSlow}`,
        "&-inner": {
          display: "inline-flex",
          flexDirection: "column",
          alignItems: "center"
        },
        "&-up, &-down": {
          fontSize: i,
          "&.active": {
            color: t.colorPrimary
          }
        },
        [`${e}-column-sorter-up + ${e}-column-sorter-down`]: {
          marginTop: "-0.3em"
        }
      },
      [`${e}-column-sorters:hover ${e}-column-sorter`]: {
        color: r
      }
    }
  };
}, rde = (t) => {
  const {
    componentCls: e,
    opacityLoading: n,
    tableScrollThumbBg: i,
    tableScrollThumbBgHover: o,
    tableScrollThumbSize: r,
    tableScrollBg: a,
    zIndexTableSticky: l
  } = t, s = `${t.lineWidth}px ${t.lineType} ${t.tableBorderColor}`;
  return {
    [`${e}-wrapper`]: {
      [`${e}-sticky`]: {
        "&-holder": {
          position: "sticky",
          zIndex: l,
          background: t.colorBgContainer
        },
        "&-scroll": {
          position: "sticky",
          bottom: 0,
          height: `${r}px !important`,
          zIndex: l,
          display: "flex",
          alignItems: "center",
          background: a,
          borderTop: s,
          opacity: n,
          "&:hover": {
            transformOrigin: "center bottom"
          },
          // fake scrollbar style of sticky
          "&-bar": {
            height: r,
            backgroundColor: i,
            borderRadius: 100,
            transition: `all ${t.motionDurationSlow}, transform none`,
            position: "absolute",
            bottom: 0,
            "&:hover, &-active": {
              backgroundColor: o
            }
          }
        }
      }
    }
  };
}, K_ = (t) => {
  const {
    componentCls: e,
    lineWidth: n,
    tableBorderColor: i
  } = t, o = `${n}px ${t.lineType} ${i}`;
  return {
    [`${e}-wrapper`]: {
      [`${e}-summary`]: {
        position: "relative",
        zIndex: t.zIndexTableFixed,
        background: t.tableBg,
        "> tr": {
          "> th, > td": {
            borderBottom: o
          }
        }
      },
      [`div${e}-summary`]: {
        boxShadow: `0 -${n}px 0 ${i}`
      }
    }
  };
}, ade = (t) => {
  const {
    componentCls: e,
    fontWeightStrong: n,
    tablePaddingVertical: i,
    tablePaddingHorizontal: o,
    lineWidth: r,
    lineType: a,
    tableBorderColor: l,
    tableFontSize: s,
    tableBg: u,
    tableRadius: c,
    tableHeaderTextColor: d,
    motionDurationMid: f,
    tableHeaderBg: h,
    tableHeaderCellSplitColor: p,
    tableRowHoverBg: g,
    tableSelectedRowBg: m,
    tableSelectedRowHoverBg: y,
    tableFooterTextColor: b,
    tableFooterBg: w,
    paddingContentVerticalLG: $
  } = t, C = `${r}px ${a} ${l}`;
  return {
    [`${e}-wrapper`]: k(k({
      clear: "both",
      maxWidth: "100%"
    }, Es()), {
      [e]: k(k({}, kn(t)), {
        fontSize: s,
        background: u,
        borderRadius: `${c}px ${c}px 0 0`
      }),
      // https://github.com/ant-design/ant-design/issues/17611
      table: {
        width: "100%",
        textAlign: "start",
        borderRadius: `${c}px ${c}px 0 0`,
        borderCollapse: "separate",
        borderSpacing: 0
      },
      // ============================= Cell =============================
      [`
          ${e}-thead > tr > th,
          ${e}-tbody > tr > td,
          tfoot > tr > th,
          tfoot > tr > td
        `]: {
        position: "relative",
        padding: `${$}px ${o}px`,
        overflowWrap: "break-word"
      },
      // ============================ Title =============================
      [`${e}-title`]: {
        padding: `${i}px ${o}px`
      },
      // ============================ Header ============================
      [`${e}-thead`]: {
        "\n          > tr > th,\n          > tr > td\n        ": {
          position: "relative",
          color: d,
          fontWeight: n,
          textAlign: "start",
          background: h,
          borderBottom: C,
          transition: `background ${f} ease`,
          "&[colspan]:not([colspan='1'])": {
            textAlign: "center"
          },
          [`&:not(:last-child):not(${e}-selection-column):not(${e}-row-expand-icon-cell):not([colspan])::before`]: {
            position: "absolute",
            top: "50%",
            insetInlineEnd: 0,
            width: 1,
            height: "1.6em",
            backgroundColor: p,
            transform: "translateY(-50%)",
            transition: `background-color ${f}`,
            content: '""'
          }
        },
        "> tr:not(:last-child) > th[colspan]": {
          borderBottom: 0
        }
      },
      // ============================ Body ============================
      // Borderless Table has unique hover style, which would be implemented with `borderTop`.
      [`${e}:not(${e}-bordered)`]: {
        [`${e}-tbody`]: {
          "> tr": {
            "> td": {
              borderTop: C,
              borderBottom: "transparent"
            },
            "&:last-child > td": {
              borderBottom: C
            },
            [`&:first-child > td,
              &${e}-measure-row + tr > td`]: {
              borderTop: "none",
              borderTopColor: "transparent"
            }
          }
        }
      },
      // Bordered Table remains simple `borderBottom`.
      // Ref issue: https://github.com/ant-design/ant-design/issues/38724
      [`${e}${e}-bordered`]: {
        [`${e}-tbody`]: {
          "> tr": {
            "> td": {
              borderBottom: C
            }
          }
        }
      },
      [`${e}-tbody`]: {
        "> tr": {
          "> td": {
            transition: `background ${f}, border-color ${f}`,
            // ========================= Nest Table ===========================
            [`
              > ${e}-wrapper:only-child,
              > ${e}-expanded-row-fixed > ${e}-wrapper:only-child
            `]: {
              [e]: {
                marginBlock: `-${i}px`,
                marginInline: `${t.tableExpandColumnWidth - o}px -${o}px`,
                [`${e}-tbody > tr:last-child > td`]: {
                  borderBottom: 0,
                  "&:first-child, &:last-child": {
                    borderRadius: 0
                  }
                }
              }
            }
          },
          [`
            &${e}-row:hover > td,
            > td${e}-cell-row-hover
          `]: {
            background: g
          },
          [`&${e}-row-selected`]: {
            "> td": {
              background: m
            },
            "&:hover > td": {
              background: y
            }
          }
        }
      },
      // ============================ Footer ============================
      [`${e}-footer`]: {
        padding: `${i}px ${o}px`,
        color: b,
        background: w
      }
    })
  };
}, lde = Vn("Table", (t) => {
  const {
    controlItemBgActive: e,
    controlItemBgActiveHover: n,
    colorTextPlaceholder: i,
    colorTextHeading: o,
    colorSplit: r,
    colorBorderSecondary: a,
    fontSize: l,
    padding: s,
    paddingXS: u,
    paddingSM: c,
    controlHeight: d,
    colorFillAlter: f,
    colorIcon: h,
    colorIconHover: p,
    opacityLoading: g,
    colorBgContainer: m,
    borderRadiusLG: y,
    colorFillContent: b,
    colorFillSecondary: w,
    controlInteractiveSize: $
  } = t, C = new jn(h), P = new jn(p), O = e, E = 2, _ = new jn(w).onBackground(m).toHexString(), D = new jn(b).onBackground(m).toHexString(), M = new jn(f).onBackground(m).toHexString(), N = dn(t, {
    tableFontSize: l,
    tableBg: m,
    tableRadius: y,
    tablePaddingVertical: s,
    tablePaddingHorizontal: s,
    tablePaddingVerticalMiddle: c,
    tablePaddingHorizontalMiddle: u,
    tablePaddingVerticalSmall: u,
    tablePaddingHorizontalSmall: u,
    tableBorderColor: a,
    tableHeaderTextColor: o,
    tableHeaderBg: M,
    tableFooterTextColor: o,
    tableFooterBg: M,
    tableHeaderCellSplitColor: a,
    tableHeaderSortBg: _,
    tableHeaderSortHoverBg: D,
    tableHeaderIconColor: C.clone().setAlpha(C.getAlpha() * g).toRgbString(),
    tableHeaderIconColorHover: P.clone().setAlpha(P.getAlpha() * g).toRgbString(),
    tableBodySortBg: M,
    tableFixedHeaderSortActiveBg: _,
    tableHeaderFilterActiveBg: b,
    tableFilterDropdownBg: m,
    tableRowHoverBg: M,
    tableSelectedRowBg: O,
    tableSelectedRowHoverBg: n,
    zIndexTableFixed: E,
    zIndexTableSticky: E + 1,
    tableFontSizeMiddle: l,
    tableFontSizeSmall: l,
    tableSelectionColumnWidth: d,
    tableExpandIconBg: m,
    tableExpandColumnWidth: $ + 2 * t.padding,
    tableExpandedRowBg: f,
    // Dropdown
    tableFilterDropdownWidth: 120,
    tableFilterDropdownHeight: 264,
    tableFilterDropdownSearchWidth: 140,
    // Virtual Scroll Bar
    tableScrollThumbSize: 8,
    tableScrollThumbBg: i,
    tableScrollThumbBgHover: o,
    tableScrollBg: r
  });
  return [ade(N), Uce(N), K_(N), ode(N), Zce(N), qce(N), Jce(N), Xce(N), K_(N), Kce(N), tde(N), Gce(N), rde(N), Yce(N), nde(N), ide(N), ede(N)];
}), sde = [], Nz = () => ({
  prefixCls: yn(),
  columns: ui(),
  rowKey: pn([String, Function]),
  tableLayout: yn(),
  rowClassName: pn([String, Function]),
  title: ot(),
  footer: ot(),
  id: yn(),
  showHeader: pt(),
  components: Vt(),
  customRow: ot(),
  customHeaderRow: ot(),
  direction: yn(),
  expandFixed: pn([Boolean, String]),
  expandColumnWidth: Number,
  expandedRowKeys: ui(),
  defaultExpandedRowKeys: ui(),
  expandedRowRender: ot(),
  expandRowByClick: pt(),
  expandIcon: ot(),
  onExpand: ot(),
  onExpandedRowsChange: ot(),
  "onUpdate:expandedRowKeys": ot(),
  defaultExpandAllRows: pt(),
  indentSize: Number,
  /** @deprecated Please use `EXPAND_COLUMN` in `columns` directly */
  expandIconColumnIndex: Number,
  showExpandColumn: pt(),
  expandedRowClassName: ot(),
  childrenColumnName: yn(),
  rowExpandable: ot(),
  sticky: pn([Boolean, Object]),
  dropdownPrefixCls: String,
  dataSource: ui(),
  pagination: pn([Boolean, Object]),
  loading: pn([Boolean, Object]),
  size: yn(),
  bordered: pt(),
  locale: Vt(),
  onChange: ot(),
  onResizeColumn: ot(),
  rowSelection: Vt(),
  getPopupContainer: ot(),
  scroll: Vt(),
  sortDirections: ui(),
  showSorterTooltip: pn([Boolean, Object], !0),
  transformCellText: ot()
}), ude = Oe({
  name: "InternalTable",
  inheritAttrs: !1,
  props: Kn(k(k({}, Nz()), {
    contextSlots: Vt()
  }), {
    rowKey: "key"
  }),
  setup(t, e) {
    let {
      attrs: n,
      slots: i,
      expose: o,
      emit: r
    } = e;
    $n(!(typeof t.rowKey == "function" && t.rowKey.length > 1), "Table", "`index` parameter of `rowKey` function is deprecated. There is no guarantee that it will work as expected."), Gse(A(() => t.contextSlots)), Use({
      onResizeColumn: (Re, Ye) => {
        r("resizeColumn", Re, Ye);
      }
    });
    const a = b3(), l = A(() => {
      const Re = new Set(Object.keys(a.value).filter((Ye) => a.value[Ye]));
      return t.columns.filter((Ye) => !Ye.responsive || Ye.responsive.some((Ne) => Re.has(Ne)));
    }), {
      size: s,
      renderEmpty: u,
      direction: c,
      prefixCls: d,
      configProvider: f
    } = Ht("table", t), [h, p] = lde(d), g = A(() => {
      var Re;
      return t.transformCellText || ((Re = f.transformCellText) === null || Re === void 0 ? void 0 : Re.value);
    }), [m] = Bu("Table", ks.Table, on(t, "locale")), y = A(() => t.dataSource || sde), b = A(() => f.getPrefixCls("dropdown", t.dropdownPrefixCls)), w = A(() => t.childrenColumnName || "children"), $ = A(() => y.value.some((Re) => Re?.[w.value]) ? "nest" : t.expandedRowRender ? "row" : null), C = Bn({
      body: null
    }), P = (Re) => {
      k(C, Re);
    }, O = A(() => typeof t.rowKey == "function" ? t.rowKey : (Re) => Re?.[t.rowKey]), [E] = Wue(y, w, O), _ = {}, D = function(Re, Ye) {
      let Ne = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
      const {
        pagination: Fe,
        scroll: We,
        onChange: nt
      } = t, Qe = k(k({}, _), Re);
      Ne && (_.resetPagination(), Qe.pagination.current && (Qe.pagination.current = 1), Fe && Fe.onChange && Fe.onChange(1, Qe.pagination.pageSize)), We && We.scrollToFirstRowOnChange !== !1 && C.body && wK(0, {
        getContainer: () => C.body
      }), nt?.(Qe.pagination, Qe.filters, Qe.sorter, {
        currentDataSource: Y_(dS(y.value, Qe.sorterStates, w.value), Qe.filterStates),
        action: Ye
      });
    }, M = (Re, Ye) => {
      D({
        sorter: Re,
        sorterStates: Ye
      }, "sort", !1);
    }, [N, L, j, B] = Jue({
      prefixCls: d,
      mergedColumns: l,
      onSorterChange: M,
      sortDirections: A(() => t.sortDirections || ["ascend", "descend"]),
      tableLocale: m,
      showSorterTooltip: on(t, "showSorterTooltip")
    }), Y = A(() => dS(y.value, L.value, w.value)), Q = (Re, Ye) => {
      D({
        filters: Re,
        filterStates: Ye
      }, "filter", !0);
    }, [G, V, H] = Qce({
      prefixCls: d,
      locale: m,
      dropdownPrefixCls: b,
      mergedColumns: l,
      onFilterChange: Q,
      getPopupContainer: on(t, "getPopupContainer")
    }), q = A(() => Y_(Y.value, V.value)), [K] = jce(on(t, "contextSlots")), ee = A(() => {
      const Re = {}, Ye = H.value;
      return Object.keys(Ye).forEach((Ne) => {
        Ye[Ne] !== null && (Re[Ne] = Ye[Ne]);
      }), k(k({}, j.value), {
        filters: Re
      });
    }), [ie] = Hce(ee), ae = (Re, Ye) => {
      D({
        pagination: k(k({}, _.pagination), {
          current: Re,
          pageSize: Ye
        })
      }, "paginate");
    }, [te, U] = Hue(A(() => q.value.length), on(t, "pagination"), ae);
    zt(() => {
      _.sorter = B.value, _.sorterStates = L.value, _.filters = H.value, _.filterStates = V.value, _.pagination = t.pagination === !1 ? {} : Que(te.value, t.pagination), _.resetPagination = U;
    });
    const me = A(() => {
      if (t.pagination === !1 || !te.value.pageSize)
        return q.value;
      const {
        current: Re = 1,
        total: Ye,
        pageSize: Ne = aS
      } = te.value;
      return $n(Re > 0, "Table", "`current` should be positive number."), q.value.length < Ye ? q.value.length > Ne ? q.value.slice((Re - 1) * Ne, Re * Ne) : q.value : q.value.slice((Re - 1) * Ne, Re * Ne);
    });
    zt(() => {
      rn(() => {
        const {
          total: Re,
          pageSize: Ye = aS
        } = te.value;
        q.value.length < Re && q.value.length > Ye && $n(!1, "Table", "`dataSource` length is less than `pagination.total` but large than `pagination.pageSize`. Please make sure your config correct data with async mode.");
      });
    }, {
      flush: "post"
    });
    const ce = A(() => t.showExpandColumn === !1 ? -1 : $.value === "nest" && t.expandIconColumnIndex === void 0 ? t.rowSelection ? 1 : 0 : t.expandIconColumnIndex > 0 && t.rowSelection ? t.expandIconColumnIndex - 1 : t.expandIconColumnIndex), ue = de();
    _e(() => t.rowSelection, () => {
      ue.value = t.rowSelection ? k({}, t.rowSelection) : t.rowSelection;
    }, {
      deep: !0,
      immediate: !0
    });
    const [fe, he] = que(ue, {
      prefixCls: d,
      data: q,
      pageData: me,
      getRowKey: O,
      getRecordByKey: E,
      expandType: $,
      childrenColumnName: w,
      locale: m,
      getPopupContainer: A(() => t.getPopupContainer)
    }), le = (Re, Ye, Ne) => {
      let Fe;
      const {
        rowClassName: We
      } = t;
      return typeof We == "function" ? Fe = Ae(We(Re, Ye, Ne)) : Fe = Ae(We), Ae({
        [`${d.value}-row-selected`]: he.value.has(O.value(Re, Ye))
      }, Fe);
    };
    o({
      selectedKeySet: he
    });
    const ke = A(() => typeof t.indentSize == "number" ? t.indentSize : 15), ze = (Re) => ie(fe(G(N(K(Re)))));
    return () => {
      var Re;
      const {
        expandIcon: Ye = i.expandIcon || Wce(m.value),
        pagination: Ne,
        loading: Fe,
        bordered: We
      } = t;
      let nt, Qe;
      if (Ne !== !1 && (!((Re = te.value) === null || Re === void 0) && Re.total)) {
        let $e;
        te.value.size ? $e = te.value.size : $e = s.value === "small" || s.value === "middle" ? "small" : void 0;
        const Le = (rt) => v(cse, J(J({}, te.value), {}, {
          class: [`${d.value}-pagination ${d.value}-pagination-${rt}`, te.value.class],
          size: $e
        }), null), Ke = c.value === "rtl" ? "left" : "right", {
          position: qe
        } = te.value;
        if (qe !== null && Array.isArray(qe)) {
          const rt = qe.find((je) => je.includes("top")), De = qe.find((je) => je.includes("bottom")), Be = qe.every((je) => `${je}` == "none");
          !rt && !De && !Be && (Qe = Le(Ke)), rt && (nt = Le(rt.toLowerCase().replace("top", ""))), De && (Qe = Le(De.toLowerCase().replace("bottom", "")));
        } else
          Qe = Le(Ke);
      }
      let Pe;
      typeof Fe == "boolean" ? Pe = {
        spinning: Fe
      } : typeof Fe == "object" && (Pe = k({
        spinning: !0
      }, Fe));
      const Ze = Ae(`${d.value}-wrapper`, {
        [`${d.value}-wrapper-rtl`]: c.value === "rtl"
      }, n.class, p.value), Ce = ii(t, ["columns"]);
      return h(v("div", {
        class: Ze,
        style: n.style
      }, [v(Bo, J({
        spinning: !1
      }, Pe), {
        default: () => [nt, v(Fue, J(J(J({}, n), Ce), {}, {
          expandedRowKeys: t.expandedRowKeys,
          defaultExpandedRowKeys: t.defaultExpandedRowKeys,
          expandIconColumnIndex: ce.value,
          indentSize: ke.value,
          expandIcon: Ye,
          columns: l.value,
          direction: c.value,
          prefixCls: d.value,
          class: Ae({
            [`${d.value}-middle`]: s.value === "middle",
            [`${d.value}-small`]: s.value === "small",
            [`${d.value}-bordered`]: We,
            [`${d.value}-empty`]: y.value.length === 0
          }),
          data: me.value,
          rowKey: O.value,
          rowClassName: le,
          internalHooks: rS,
          internalRefs: C,
          onUpdateInternalRefs: P,
          transformColumns: ze,
          transformCellText: g.value
        }), k(k({}, i), {
          emptyText: () => {
            var $e, Le;
            return (($e = i.emptyText) === null || $e === void 0 ? void 0 : $e.call(i)) || ((Le = t.locale) === null || Le === void 0 ? void 0 : Le.emptyText) || u("Table");
          }
        })), Qe]
      })]));
    };
  }
}), M1 = Oe({
  name: "ATable",
  inheritAttrs: !1,
  props: Kn(Nz(), {
    rowKey: "key"
  }),
  slots: Object,
  setup(t, e) {
    let {
      attrs: n,
      slots: i,
      expose: o
    } = e;
    const r = de();
    return o({
      table: r
    }), () => {
      var a;
      const l = t.columns || kz((a = i.default) === null || a === void 0 ? void 0 : a.call(i));
      return v(ude, J(J(J({
        ref: r
      }, n), t), {}, {
        columns: l || [],
        expandedRowRender: i.expandedRowRender || t.expandedRowRender,
        contextSlots: k({}, i)
      }), i);
    };
  }
}), A1 = Oe({
  name: "ATableColumn",
  slots: Object,
  render() {
    return null;
  }
}), R1 = Oe({
  name: "ATableColumnGroup",
  slots: Object,
  __ANT_TABLE_COLUMN_GROUP: !0,
  render() {
    return null;
  }
}), pS = Pue, gS = Iue, D1 = k(Mue, {
  Cell: gS,
  Row: pS,
  name: "ATableSummary"
}), cde = k(M1, {
  SELECTION_ALL: lS,
  SELECTION_INVERT: sS,
  SELECTION_NONE: uS,
  SELECTION_COLUMN: Ea,
  EXPAND_COLUMN: gl,
  Column: A1,
  ColumnGroup: R1,
  Summary: D1,
  install: (t) => (t.component(D1.name, D1), t.component(gS.name, gS), t.component(pS.name, pS), t.component(M1.name, M1), t.component(A1.name, A1), t.component(R1.name, R1), t)
}), Lz = Symbol("appConfigContext"), dde = (t) => Xt(Lz, t), fde = () => qt(Lz, {}), zz = Symbol("appContext"), hde = (t) => Xt(zz, t), pde = Bn({
  message: {},
  notification: {},
  modal: {}
}), gde = () => qt(zz, pde), mde = (t) => {
  const {
    componentCls: e,
    colorText: n,
    fontSize: i,
    lineHeight: o,
    fontFamily: r
  } = t;
  return {
    [e]: {
      color: n,
      fontSize: i,
      lineHeight: o,
      fontFamily: r
    }
  };
}, vde = Vn("App", (t) => [mde(t)]), yde = () => ({
  rootClassName: String,
  message: Vt(),
  notification: Vt()
}), bde = () => gde(), fp = Oe({
  name: "AApp",
  props: Kn(yde(), {}),
  setup(t, e) {
    let {
      slots: n
    } = e;
    const {
      prefixCls: i
    } = Ht("app", t), [o, r] = vde(i), a = A(() => Ae(r.value, i.value, t.rootClassName)), l = fde(), s = A(() => ({
      message: k(k({}, l.message), t.message),
      notification: k(k({}, l.notification), t.notification)
    }));
    dde(s.value);
    const [u, c] = hL(s.value.message), [d, f] = kL(s.value.notification), [h, p] = JL(), g = A(() => ({
      message: u,
      notification: d,
      modal: h
    }));
    return hde(g.value), () => {
      var m;
      return o(v("div", {
        class: a.value
      }, [p(), c(), f(), (m = n.default) === null || m === void 0 ? void 0 : m.call(n)]));
    };
  }
});
fp.useApp = bde;
fp.install = function(t) {
  t.component(fp.name, fp);
};
const su = (t, e) => new jn(t).setAlpha(e).toRgbString(), Ad = (t, e) => new jn(t).lighten(e).toHexString(), xde = (t) => {
  const e = Ts(t, {
    theme: "dark"
  });
  return {
    1: e[0],
    2: e[1],
    3: e[2],
    4: e[3],
    5: e[6],
    6: e[5],
    7: e[4],
    8: e[6],
    9: e[5],
    10: e[4]
    // 8: colors[9],
    // 9: colors[8],
    // 10: colors[7],
  };
}, Ode = (t, e) => {
  const n = t || "#000", i = e || "#fff";
  return {
    colorBgBase: n,
    colorTextBase: i,
    colorText: su(i, 0.85),
    colorTextSecondary: su(i, 0.65),
    colorTextTertiary: su(i, 0.45),
    colorTextQuaternary: su(i, 0.25),
    colorFill: su(i, 0.18),
    colorFillSecondary: su(i, 0.12),
    colorFillTertiary: su(i, 0.08),
    colorFillQuaternary: su(i, 0.04),
    colorBgElevated: Ad(n, 12),
    colorBgContainer: Ad(n, 8),
    colorBgLayout: Ad(n, 0),
    colorBgSpotlight: Ad(n, 26),
    colorBorder: Ad(n, 26),
    colorBorderSecondary: Ad(n, 19)
  };
}, Sde = (t, e) => {
  const n = Object.keys(sC).map((o) => {
    const r = Ts(t[o], {
      theme: "dark"
    });
    return new Array(10).fill(1).reduce((a, l, s) => (a[`${o}-${s + 1}`] = r[s], a), {});
  }).reduce((o, r) => (o = k(k({}, o), r), o), {}), i = e ?? uC(t);
  return k(k(k({}, i), n), mN(t, {
    generateColorPalettes: xde,
    generateNeutralColorPalettes: Ode
  }));
}, X_ = {
  /** Default seedToken */
  defaultSeed: dC.token,
  defaultAlgorithm: uC,
  darkAlgorithm: Sde
}, wde = typeof window < "u";
var Z_;
wde && ((Z_ = window?.navigator) != null && Z_.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
function _r(t) {
  return t == null;
}
function Bz() {
}
const Cde = Object.freeze({
  aliceblue: "f0f8ff",
  antiquewhite: "faebd7",
  aqua: "0ff",
  aquamarine: "7fffd4",
  azure: "f0ffff",
  beige: "f5f5dc",
  bisque: "ffe4c4",
  black: "000",
  blanchedalmond: "ffebcd",
  blue: "00f",
  blueviolet: "8a2be2",
  brown: "a52a2a",
  burlywood: "deb887",
  burntsienna: "ea7e5d",
  cadetblue: "5f9ea0",
  chartreuse: "7fff00",
  chocolate: "d2691e",
  coral: "ff7f50",
  cornflowerblue: "6495ed",
  cornsilk: "fff8dc",
  crimson: "dc143c",
  cyan: "0ff",
  darkblue: "00008b",
  darkcyan: "008b8b",
  darkgoldenrod: "b8860b",
  darkgray: "a9a9a9",
  darkgreen: "006400",
  darkgrey: "a9a9a9",
  darkkhaki: "bdb76b",
  darkmagenta: "8b008b",
  darkolivegreen: "556b2f",
  darkorange: "ff8c00",
  darkorchid: "9932cc",
  darkred: "8b0000",
  darksalmon: "e9967a",
  darkseagreen: "8fbc8f",
  darkslateblue: "483d8b",
  darkslategray: "2f4f4f",
  darkslategrey: "2f4f4f",
  darkturquoise: "00ced1",
  darkviolet: "9400d3",
  deeppink: "ff1493",
  deepskyblue: "00bfff",
  dimgray: "696969",
  dimgrey: "696969",
  dodgerblue: "1e90ff",
  firebrick: "b22222",
  floralwhite: "fffaf0",
  forestgreen: "228b22",
  fuchsia: "f0f",
  gainsboro: "dcdcdc",
  ghostwhite: "f8f8ff",
  gold: "ffd700",
  goldenrod: "daa520",
  gray: "808080",
  green: "008000",
  greenyellow: "adff2f",
  grey: "808080",
  honeydew: "f0fff0",
  hotpink: "ff69b4",
  indianred: "cd5c5c",
  indigo: "4b0082",
  ivory: "fffff0",
  khaki: "f0e68c",
  lavender: "e6e6fa",
  lavenderblush: "fff0f5",
  lawngreen: "7cfc00",
  lemonchiffon: "fffacd",
  lightblue: "add8e6",
  lightcoral: "f08080",
  lightcyan: "e0ffff",
  lightgoldenrodyellow: "fafad2",
  lightgray: "d3d3d3",
  lightgreen: "90ee90",
  lightgrey: "d3d3d3",
  lightpink: "ffb6c1",
  lightsalmon: "ffa07a",
  lightseagreen: "20b2aa",
  lightskyblue: "87cefa",
  lightslategray: "789",
  lightslategrey: "789",
  lightsteelblue: "b0c4de",
  lightyellow: "ffffe0",
  lime: "0f0",
  limegreen: "32cd32",
  linen: "faf0e6",
  magenta: "f0f",
  maroon: "800000",
  mediumaquamarine: "66cdaa",
  mediumblue: "0000cd",
  mediumorchid: "ba55d3",
  mediumpurple: "9370db",
  mediumseagreen: "3cb371",
  mediumslateblue: "7b68ee",
  mediumspringgreen: "00fa9a",
  mediumturquoise: "48d1cc",
  mediumvioletred: "c71585",
  midnightblue: "191970",
  mintcream: "f5fffa",
  mistyrose: "ffe4e1",
  moccasin: "ffe4b5",
  navajowhite: "ffdead",
  navy: "000080",
  oldlace: "fdf5e6",
  olive: "808000",
  olivedrab: "6b8e23",
  orange: "ffa500",
  orangered: "ff4500",
  orchid: "da70d6",
  palegoldenrod: "eee8aa",
  palegreen: "98fb98",
  paleturquoise: "afeeee",
  palevioletred: "db7093",
  papayawhip: "ffefd5",
  peachpuff: "ffdab9",
  peru: "cd853f",
  pink: "ffc0cb",
  plum: "dda0dd",
  powderblue: "b0e0e6",
  purple: "800080",
  rebeccapurple: "663399",
  red: "f00",
  rosybrown: "bc8f8f",
  royalblue: "4169e1",
  saddlebrown: "8b4513",
  salmon: "fa8072",
  sandybrown: "f4a460",
  seagreen: "2e8b57",
  seashell: "fff5ee",
  sienna: "a0522d",
  silver: "c0c0c0",
  skyblue: "87ceeb",
  slateblue: "6a5acd",
  slategray: "708090",
  slategrey: "708090",
  snow: "fffafa",
  springgreen: "00ff7f",
  steelblue: "4682b4",
  tan: "d2b48c",
  teal: "008080",
  thistle: "d8bfd8",
  tomato: "ff6347",
  turquoise: "40e0d0",
  violet: "ee82ee",
  wheat: "f5deb3",
  white: "fff",
  whitesmoke: "f5f5f5",
  yellow: "ff0",
  yellowgreen: "9acd32"
});
Object.freeze(new Set(Object.keys(Cde)));
function $de() {
  const t = /* @__PURE__ */ new Map();
  return {
    on(e, n) {
      const i = t.get(e);
      i?.add(n) || t.set(e, /* @__PURE__ */ new Set([n]));
    },
    off(e, n) {
      const i = t.get(e);
      i && i.delete(n);
    },
    clear(e) {
      const n = t.get(e);
      n && n.clear();
    },
    clearAll() {
      t.clear();
    },
    emit(e, ...n) {
      const i = t.get(e);
      i && i.forEach((o) => {
        o(...n);
      });
    }
  };
}
function G_(t, e = 16) {
  if (typeof t != "function")
    return Bz;
  const n = (...r) => {
    t(...r);
  };
  if (e <= 0)
    return Fz(n);
  let i = 0, o;
  return function(...r) {
    const a = Date.now(), l = a - i;
    clearTimeout(o), l >= e ? (i = a, n(...r)) : o = setTimeout(
      () => {
        i = Date.now(), n(...r);
      },
      Math.max(0, e - l)
    );
  };
}
function kde(t, e = 100) {
  if (typeof t != "function")
    return Bz;
  const n = (...o) => {
    t(...o);
  };
  if (e <= 0)
    return Fz(n);
  let i;
  return function(...o) {
    clearTimeout(i), i = setTimeout(() => {
      n(...o);
    }, e);
  };
}
function Fz(t) {
  if (typeof t != "function")
    return t;
  let e = !1, n, i;
  return function(...o) {
    return n = o, e || (e = !0, i = Promise.resolve().then(() => (e = !1, i = void 0, t(...n)))), i;
  };
}
const hp = /* @__PURE__ */ new Set(), Vz = /* @__PURE__ */ new WeakMap();
function Tde() {
  hp.forEach((t) => {
    t(...Vz.get(t));
  }), hp.clear();
}
function Yo(t, ...e) {
  if (typeof t != "function")
    return t;
  Vz.set(t, e), !hp.has(t) && (hp.add(t), hp.size === 1 && Promise.resolve().then(Tde));
}
const Qz = Symbol("LAYOUT_KEY"), Hz = Symbol("EMITTER_KEY");
function Pde(t) {
  let e = 0, n;
  for (let i = 0, o = t.length; i < o; i++)
    n = t[i].y + t[i].h, n > e && (e = n);
  return e;
}
function mS(t) {
  const e = Array(t.length);
  for (let n = 0, i = t.length; n < i; n++)
    e[n] = Ede(t[n]);
  return e;
}
function Ede(t) {
  return { ...t };
}
function Wz(t, e) {
  return !(t === e || t.x + t.w <= e.x || t.x >= e.x + e.w || t.y + t.h <= e.y || t.y >= e.y + e.h);
}
function Qd(t, e, n) {
  const i = qz(t), o = Yz(t), r = Array(t.length);
  for (let a = 0, l = o.length; a < l; a++) {
    let s = o[a];
    s.static || (s = _de(i, s, e, n), i.push(s)), r[t.findIndex((u) => u.i === s.i)] = s, s.moved = !1;
  }
  return r;
}
function _de(t, e, n, i) {
  if (n)
    for (; e.y > 0 && !pp(t, e); )
      e.y--;
  else if (i) {
    const r = i[e.i].y;
    for (; e.y > r && !pp(t, e); )
      e.y--;
  }
  let o;
  for (; o = pp(t, e); )
    e.y = o.y + o.h;
  return e;
}
function Ide(t, e) {
  const n = qz(t);
  for (let i = 0, o = t.length; i < o; i++) {
    const r = t[i];
    if (r.x + r.w > e.cols && (r.x = e.cols - r.w), r.x < 0 && (r.x = 0, r.w = e.cols), !r.static) n.push(r);
    else
      for (; pp(n, r); )
        r.y++;
  }
  return t;
}
function U_(t, e) {
  for (let n = 0, i = t.length; n < i; n++)
    if (t[n].i === e) return t[n];
}
function pp(t, e) {
  for (let n = 0, i = t.length; n < i; n++)
    if (Wz(t[n], e)) return t[n];
}
function jz(t, e) {
  return t.filter((n) => Wz(n, e));
}
function qz(t) {
  return t.filter((e) => e.static);
}
function vS(t, e, n, i, o = !1, r = !1) {
  if (e.static) return t;
  const a = e.x, l = e.y, s = i && e.y > i;
  typeof n == "number" && (e.x = n), typeof i == "number" && (e.y = i), e.moved = !0;
  let u = Yz(t);
  s && (u = u.reverse());
  const c = jz(u, e);
  if (r && c.length)
    return e.x = a, e.y = l, e.moved = !1, t;
  for (let d = 0, f = c.length; d < f; d++) {
    const h = c[d];
    h.moved || e.y > h.y && e.y - h.y > h.h / 4 || (h.static ? t = J_(t, h, e, o) : t = J_(t, e, h, o));
  }
  return t;
}
function J_(t, e, n, i) {
  if (i) {
    const o = {
      x: n.x,
      y: n.y,
      w: n.w,
      h: n.h
    };
    if (o.y = Math.max(e.y - n.h, 0), !pp(t, o))
      return vS(t, n, void 0, o.y, !1);
  }
  return vS(t, n, void 0, n.y + 1, !1);
}
function Mde(t, e, n, i) {
  const o = "translate3d(" + e + "px," + t + "px, 0)";
  return {
    transform: o,
    WebkitTransform: o,
    MozTransform: o,
    msTransform: o,
    OTransform: o,
    width: n + "px",
    height: i + "px",
    position: "absolute"
  };
}
function Ade(t, e, n, i) {
  const o = "translate3d(" + e * -1 + "px," + t + "px, 0)";
  return {
    transform: o,
    WebkitTransform: o,
    MozTransform: o,
    msTransform: o,
    OTransform: o,
    width: n + "px",
    height: i + "px",
    position: "absolute"
  };
}
function Rde(t, e, n, i) {
  return {
    top: t + "px",
    left: e + "px",
    width: n + "px",
    height: i + "px",
    position: "absolute"
  };
}
function Dde(t, e, n, i) {
  return {
    top: t + "px",
    right: e + "px",
    width: n + "px",
    height: i + "px",
    position: "absolute"
  };
}
function Yz(t) {
  return Array.from(t).sort(function(e, n) {
    return e.y === n.y && e.x === n.x ? 0 : e.y > n.y || e.y === n.y && e.x > n.x ? 1 : -1;
  });
}
function Nde(t, e) {
  e = e || "Layout";
  const n = ["x", "y", "w", "h"], i = [];
  if (!Array.isArray(t)) throw new Error(e + " must be an array!");
  for (let o = 0, r = t.length; o < r; o++) {
    const a = t[o];
    for (let l = 0; l < n.length; l++)
      if (typeof a[n[l]] != "number")
        throw new Error(
          "VueGridLayout: " + e + "[" + o + "]." + n[l] + " must be a number!"
        );
    if (a.i === void 0 || a.i === null)
      throw new Error("VueGridLayout: " + e + "[" + o + "].i cannot be null!");
    if (typeof a.i != "number" && typeof a.i != "string")
      throw new Error("VueGridLayout: " + e + "[" + o + "].i must be a string or number!");
    if (i.indexOf(a.i) >= 0)
      throw new Error("VueGridLayout: " + e + "[" + o + "].i must be unique!");
    if (i.push(a.i), a.static !== void 0 && typeof a.static != "boolean")
      throw new Error("VueGridLayout: " + e + "[" + o + "].static must be a boolean!");
  }
}
function Lde(t, e = "vgl") {
  const n = () => `${e}-${t}`;
  return {
    b: n,
    be: (i) => `${n()}__${i}`,
    bm: (i) => `${n()}--${i}`,
    bem: (i, o) => `${n()}__${i}--${o}`
  };
}
function eI(t) {
  return zde(t);
}
function zde(t) {
  var e;
  const n = ((e = t.target) == null ? void 0 : e.offsetParent) || document.body, i = t.offsetParent === document.body ? { left: 0, top: 0 } : n.getBoundingClientRect(), o = t.clientX + n.scrollLeft - i.left, r = t.clientY + n.scrollTop - i.top;
  return { x: o, y: r };
}
function tI(t, e, n, i) {
  return Bde(t) ? {
    deltaX: n - t,
    deltaY: i - e,
    lastX: t,
    lastY: e,
    x: n,
    y: i
  } : {
    deltaX: 0,
    deltaY: 0,
    lastX: n,
    lastY: i,
    x: n,
    y: i
  };
}
function Bde(t) {
  return typeof t == "number" && !Number.isNaN(t);
}
function Fde(t, e) {
  const n = Xz(t);
  let i = n[0];
  for (let o = 1, r = n.length; o < r; o++) {
    const a = n[o];
    e > t[a] && (i = a);
  }
  return i;
}
function Kz(t, e) {
  if (!e[t])
    throw new Error(
      "ResponsiveGridLayout: `cols` entry for breakpoint " + t + " is missing!"
    );
  return e[t];
}
function Vde(t, e, n, i, o, r, a) {
  if (e[i]) return mS(e[i]);
  let l = t;
  const s = Xz(n), u = s.slice(s.indexOf(i));
  for (let c = 0, d = u.length; c < d; c++) {
    const f = u[c];
    if (e[f]) {
      l = e[f];
      break;
    }
  }
  return l = mS(l || []), Qd(Ide(l, { cols: r }), a);
}
function Xz(t) {
  return Object.keys(t).sort((e, n) => t[e] - t[n]);
}
let Qde = "auto";
function Hde() {
  return typeof document < "u";
}
function nI() {
  return Hde() ? typeof document.dir < "u" ? document.dir : document.getElementsByTagName("html")[0].getAttribute("dir") : Qde;
}
var Xh = { exports: {} }, Wde = Xh.exports, iI;
function jde() {
  return iI || (iI = 1, (function(t, e) {
    (function(n, i) {
      t.exports = i();
    })(Wde, (function() {
      function n(x, S) {
        var T = Object.keys(x);
        if (Object.getOwnPropertySymbols) {
          var R = Object.getOwnPropertySymbols(x);
          S && (R = R.filter((function(z) {
            return Object.getOwnPropertyDescriptor(x, z).enumerable;
          }))), T.push.apply(T, R);
        }
        return T;
      }
      function i(x) {
        for (var S = 1; S < arguments.length; S++) {
          var T = arguments[S] != null ? arguments[S] : {};
          S % 2 ? n(Object(T), !0).forEach((function(R) {
            s(x, R, T[R]);
          })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(x, Object.getOwnPropertyDescriptors(T)) : n(Object(T)).forEach((function(R) {
            Object.defineProperty(x, R, Object.getOwnPropertyDescriptor(T, R));
          }));
        }
        return x;
      }
      function o(x) {
        return o = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(S) {
          return typeof S;
        } : function(S) {
          return S && typeof Symbol == "function" && S.constructor === Symbol && S !== Symbol.prototype ? "symbol" : typeof S;
        }, o(x);
      }
      function r(x, S) {
        if (!(x instanceof S)) throw new TypeError("Cannot call a class as a function");
      }
      function a(x, S) {
        for (var T = 0; T < S.length; T++) {
          var R = S[T];
          R.enumerable = R.enumerable || !1, R.configurable = !0, "value" in R && (R.writable = !0), Object.defineProperty(x, g(R.key), R);
        }
      }
      function l(x, S, T) {
        return S && a(x.prototype, S), Object.defineProperty(x, "prototype", { writable: !1 }), x;
      }
      function s(x, S, T) {
        return (S = g(S)) in x ? Object.defineProperty(x, S, { value: T, enumerable: !0, configurable: !0, writable: !0 }) : x[S] = T, x;
      }
      function u(x, S) {
        if (typeof S != "function" && S !== null) throw new TypeError("Super expression must either be null or a function");
        x.prototype = Object.create(S && S.prototype, { constructor: { value: x, writable: !0, configurable: !0 } }), Object.defineProperty(x, "prototype", { writable: !1 }), S && d(x, S);
      }
      function c(x) {
        return c = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(S) {
          return S.__proto__ || Object.getPrototypeOf(S);
        }, c(x);
      }
      function d(x, S) {
        return d = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(T, R) {
          return T.__proto__ = R, T;
        }, d(x, S);
      }
      function f(x) {
        if (x === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        return x;
      }
      function h(x) {
        var S = (function() {
          if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
          if (typeof Proxy == "function") return !0;
          try {
            return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {
            }))), !0;
          } catch {
            return !1;
          }
        })();
        return function() {
          var T, R = c(x);
          if (S) {
            var z = c(this).constructor;
            T = Reflect.construct(R, arguments, z);
          } else T = R.apply(this, arguments);
          return (function(W, Z) {
            if (Z && (typeof Z == "object" || typeof Z == "function")) return Z;
            if (Z !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
            return f(W);
          })(this, T);
        };
      }
      function p() {
        return p = typeof Reflect < "u" && Reflect.get ? Reflect.get.bind() : function(x, S, T) {
          var R = (function(W, Z) {
            for (; !Object.prototype.hasOwnProperty.call(W, Z) && (W = c(W)) !== null; ) ;
            return W;
          })(x, S);
          if (R) {
            var z = Object.getOwnPropertyDescriptor(R, S);
            return z.get ? z.get.call(arguments.length < 3 ? x : T) : z.value;
          }
        }, p.apply(this, arguments);
      }
      function g(x) {
        var S = (function(T, R) {
          if (typeof T != "object" || T === null) return T;
          var z = T[Symbol.toPrimitive];
          if (z !== void 0) {
            var W = z.call(T, R);
            if (typeof W != "object") return W;
            throw new TypeError("@@toPrimitive must return a primitive value.");
          }
          return String(T);
        })(x, "string");
        return typeof S == "symbol" ? S : S + "";
      }
      var m = function(x) {
        return !(!x || !x.Window) && x instanceof x.Window;
      }, y = void 0, b = void 0;
      function w(x) {
        y = x;
        var S = x.document.createTextNode("");
        S.ownerDocument !== x.document && typeof x.wrap == "function" && x.wrap(S) === S && (x = x.wrap(x)), b = x;
      }
      function $(x) {
        return m(x) ? x : (x.ownerDocument || x).defaultView || b.window;
      }
      typeof window < "u" && window && w(window);
      var C = function(x) {
        return !!x && o(x) === "object";
      }, P = function(x) {
        return typeof x == "function";
      }, O = { window: function(x) {
        return x === b || m(x);
      }, docFrag: function(x) {
        return C(x) && x.nodeType === 11;
      }, object: C, func: P, number: function(x) {
        return typeof x == "number";
      }, bool: function(x) {
        return typeof x == "boolean";
      }, string: function(x) {
        return typeof x == "string";
      }, element: function(x) {
        if (!x || o(x) !== "object") return !1;
        var S = $(x) || b;
        return /object|function/.test(typeof Element > "u" ? "undefined" : o(Element)) ? x instanceof Element || x instanceof S.Element : x.nodeType === 1 && typeof x.nodeName == "string";
      }, plainObject: function(x) {
        return C(x) && !!x.constructor && /function Object\b/.test(x.constructor.toString());
      }, array: function(x) {
        return C(x) && x.length !== void 0 && P(x.splice);
      } };
      function E(x) {
        var S = x.interaction;
        if (S.prepared.name === "drag") {
          var T = S.prepared.axis;
          T === "x" ? (S.coords.cur.page.y = S.coords.start.page.y, S.coords.cur.client.y = S.coords.start.client.y, S.coords.velocity.client.y = 0, S.coords.velocity.page.y = 0) : T === "y" && (S.coords.cur.page.x = S.coords.start.page.x, S.coords.cur.client.x = S.coords.start.client.x, S.coords.velocity.client.x = 0, S.coords.velocity.page.x = 0);
        }
      }
      function _(x) {
        var S = x.iEvent, T = x.interaction;
        if (T.prepared.name === "drag") {
          var R = T.prepared.axis;
          if (R === "x" || R === "y") {
            var z = R === "x" ? "y" : "x";
            S.page[z] = T.coords.start.page[z], S.client[z] = T.coords.start.client[z], S.delta[z] = 0;
          }
        }
      }
      var D = { id: "actions/drag", install: function(x) {
        var S = x.actions, T = x.Interactable, R = x.defaults;
        T.prototype.draggable = D.draggable, S.map.drag = D, S.methodDict.drag = "draggable", R.actions.drag = D.defaults;
      }, listeners: { "interactions:before-action-move": E, "interactions:action-resume": E, "interactions:action-move": _, "auto-start:check": function(x) {
        var S = x.interaction, T = x.interactable, R = x.buttons, z = T.options.drag;
        if (z && z.enabled && (!S.pointerIsDown || !/mouse|pointer/.test(S.pointerType) || (R & T.options.drag.mouseButtons) != 0)) return x.action = { name: "drag", axis: z.lockAxis === "start" ? z.startAxis : z.lockAxis }, !1;
      } }, draggable: function(x) {
        return O.object(x) ? (this.options.drag.enabled = x.enabled !== !1, this.setPerAction("drag", x), this.setOnEvents("drag", x), /^(xy|x|y|start)$/.test(x.lockAxis) && (this.options.drag.lockAxis = x.lockAxis), /^(xy|x|y)$/.test(x.startAxis) && (this.options.drag.startAxis = x.startAxis), this) : O.bool(x) ? (this.options.drag.enabled = x, this) : this.options.drag;
      }, beforeMove: E, move: _, defaults: { startAxis: "xy", lockAxis: "xy" }, getCursor: function() {
        return "move";
      }, filterEventType: function(x) {
        return x.search("drag") === 0;
      } }, M = D, N = { init: function(x) {
        var S = x;
        N.document = S.document, N.DocumentFragment = S.DocumentFragment || L, N.SVGElement = S.SVGElement || L, N.SVGSVGElement = S.SVGSVGElement || L, N.SVGElementInstance = S.SVGElementInstance || L, N.Element = S.Element || L, N.HTMLElement = S.HTMLElement || N.Element, N.Event = S.Event, N.Touch = S.Touch || L, N.PointerEvent = S.PointerEvent || S.MSPointerEvent;
      }, document: null, DocumentFragment: null, SVGElement: null, SVGSVGElement: null, SVGElementInstance: null, Element: null, HTMLElement: null, Event: null, Touch: null, PointerEvent: null };
      function L() {
      }
      var j = N, B = { init: function(x) {
        var S = j.Element, T = x.navigator || {};
        B.supportsTouch = "ontouchstart" in x || O.func(x.DocumentTouch) && j.document instanceof x.DocumentTouch, B.supportsPointerEvent = T.pointerEnabled !== !1 && !!j.PointerEvent, B.isIOS = /iP(hone|od|ad)/.test(T.platform), B.isIOS7 = /iP(hone|od|ad)/.test(T.platform) && /OS 7[^\d]/.test(T.appVersion), B.isIe9 = /MSIE 9/.test(T.userAgent), B.isOperaMobile = T.appName === "Opera" && B.supportsTouch && /Presto/.test(T.userAgent), B.prefixedMatchesSelector = "matches" in S.prototype ? "matches" : "webkitMatchesSelector" in S.prototype ? "webkitMatchesSelector" : "mozMatchesSelector" in S.prototype ? "mozMatchesSelector" : "oMatchesSelector" in S.prototype ? "oMatchesSelector" : "msMatchesSelector", B.pEventTypes = B.supportsPointerEvent ? j.PointerEvent === x.MSPointerEvent ? { up: "MSPointerUp", down: "MSPointerDown", over: "mouseover", out: "mouseout", move: "MSPointerMove", cancel: "MSPointerCancel" } : { up: "pointerup", down: "pointerdown", over: "pointerover", out: "pointerout", move: "pointermove", cancel: "pointercancel" } : null, B.wheelEvent = j.document && "onmousewheel" in j.document ? "mousewheel" : "wheel";
      }, supportsTouch: null, supportsPointerEvent: null, isIOS7: null, isIOS: null, isIe9: null, isOperaMobile: null, prefixedMatchesSelector: null, pEventTypes: null, wheelEvent: null }, Y = B;
      function Q(x, S) {
        if (x.contains) return x.contains(S);
        for (; S; ) {
          if (S === x) return !0;
          S = S.parentNode;
        }
        return !1;
      }
      function G(x, S) {
        for (; O.element(x); ) {
          if (H(x, S)) return x;
          x = V(x);
        }
        return null;
      }
      function V(x) {
        var S = x.parentNode;
        if (O.docFrag(S)) {
          for (; (S = S.host) && O.docFrag(S); ) ;
          return S;
        }
        return S;
      }
      function H(x, S) {
        return b !== y && (S = S.replace(/\/deep\//g, " ")), x[Y.prefixedMatchesSelector](S);
      }
      var q = function(x) {
        return x.parentNode || x.host;
      };
      function K(x, S) {
        for (var T, R = [], z = x; (T = q(z)) && z !== S && T !== z.ownerDocument; ) R.unshift(z), z = T;
        return R;
      }
      function ee(x, S, T) {
        for (; O.element(x); ) {
          if (H(x, S)) return !0;
          if ((x = V(x)) === T) return H(x, S);
        }
        return !1;
      }
      function ie(x) {
        return x.correspondingUseElement || x;
      }
      function ae(x) {
        var S = x instanceof j.SVGElement ? x.getBoundingClientRect() : x.getClientRects()[0];
        return S && { left: S.left, right: S.right, top: S.top, bottom: S.bottom, width: S.width || S.right - S.left, height: S.height || S.bottom - S.top };
      }
      function te(x) {
        var S, T = ae(x);
        if (!Y.isIOS7 && T) {
          var R = { x: (S = (S = $(x)) || b).scrollX || S.document.documentElement.scrollLeft, y: S.scrollY || S.document.documentElement.scrollTop };
          T.left += R.x, T.right += R.x, T.top += R.y, T.bottom += R.y;
        }
        return T;
      }
      function U(x) {
        for (var S = []; x; ) S.push(x), x = V(x);
        return S;
      }
      function me(x) {
        return !!O.string(x) && (j.document.querySelector(x), !0);
      }
      function ce(x, S) {
        for (var T in S) x[T] = S[T];
        return x;
      }
      function ue(x, S, T) {
        return x === "parent" ? V(T) : x === "self" ? S.getRect(T) : G(T, x);
      }
      function fe(x, S, T, R) {
        var z = x;
        return O.string(z) ? z = ue(z, S, T) : O.func(z) && (z = z.apply(void 0, R)), O.element(z) && (z = te(z)), z;
      }
      function he(x) {
        return x && { x: "x" in x ? x.x : x.left, y: "y" in x ? x.y : x.top };
      }
      function le(x) {
        return !x || "x" in x && "y" in x || ((x = ce({}, x)).x = x.left || 0, x.y = x.top || 0, x.width = x.width || (x.right || 0) - x.x, x.height = x.height || (x.bottom || 0) - x.y), x;
      }
      function ke(x, S, T) {
        x.left && (S.left += T.x), x.right && (S.right += T.x), x.top && (S.top += T.y), x.bottom && (S.bottom += T.y), S.width = S.right - S.left, S.height = S.bottom - S.top;
      }
      function ze(x, S, T) {
        var R = T && x.options[T];
        return he(fe(R && R.origin || x.options.origin, x, S, [x && S])) || { x: 0, y: 0 };
      }
      function Re(x, S) {
        var T = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : function(pe) {
          return !0;
        }, R = arguments.length > 3 ? arguments[3] : void 0;
        if (R = R || {}, O.string(x) && x.search(" ") !== -1 && (x = Ye(x)), O.array(x)) return x.forEach((function(pe) {
          return Re(pe, S, T, R);
        })), R;
        if (O.object(x) && (S = x, x = ""), O.func(S) && T(x)) R[x] = R[x] || [], R[x].push(S);
        else if (O.array(S)) for (var z = 0, W = S; z < W.length; z++) {
          var Z = W[z];
          Re(x, Z, T, R);
        }
        else if (O.object(S)) for (var ne in S)
          Re(Ye(ne).map((function(pe) {
            return "".concat(x).concat(pe);
          })), S[ne], T, R);
        return R;
      }
      function Ye(x) {
        return x.trim().split(/ +/);
      }
      var Ne = function(x, S) {
        return Math.sqrt(x * x + S * S);
      }, Fe = ["webkit", "moz"];
      function We(x, S) {
        x.__set || (x.__set = {});
        var T = function(z) {
          if (Fe.some((function(W) {
            return z.indexOf(W) === 0;
          }))) return 1;
          typeof x[z] != "function" && z !== "__set" && Object.defineProperty(x, z, { get: function() {
            return z in x.__set ? x.__set[z] : x.__set[z] = S[z];
          }, set: function(W) {
            x.__set[z] = W;
          }, configurable: !0 });
        };
        for (var R in S) T(R);
        return x;
      }
      function nt(x, S) {
        x.page = x.page || {}, x.page.x = S.page.x, x.page.y = S.page.y, x.client = x.client || {}, x.client.x = S.client.x, x.client.y = S.client.y, x.timeStamp = S.timeStamp;
      }
      function Qe(x) {
        x.page.x = 0, x.page.y = 0, x.client.x = 0, x.client.y = 0;
      }
      function Pe(x) {
        return x instanceof j.Event || x instanceof j.Touch;
      }
      function Ze(x, S, T) {
        return x = x || "page", (T = T || {}).x = S[x + "X"], T.y = S[x + "Y"], T;
      }
      function Ce(x, S) {
        return S = S || { x: 0, y: 0 }, Y.isOperaMobile && Pe(x) ? (Ze("screen", x, S), S.x += window.scrollX, S.y += window.scrollY) : Ze("page", x, S), S;
      }
      function $e(x) {
        return O.number(x.pointerId) ? x.pointerId : x.identifier;
      }
      function Le(x, S, T) {
        var R = S.length > 1 ? qe(S) : S[0];
        Ce(R, x.page), (function(z, W) {
          W = W || {}, Y.isOperaMobile && Pe(z) ? Ze("screen", z, W) : Ze("client", z, W);
        })(R, x.client), x.timeStamp = T;
      }
      function Ke(x) {
        var S = [];
        return O.array(x) ? (S[0] = x[0], S[1] = x[1]) : x.type === "touchend" ? x.touches.length === 1 ? (S[0] = x.touches[0], S[1] = x.changedTouches[0]) : x.touches.length === 0 && (S[0] = x.changedTouches[0], S[1] = x.changedTouches[1]) : (S[0] = x.touches[0], S[1] = x.touches[1]), S;
      }
      function qe(x) {
        for (var S = { pageX: 0, pageY: 0, clientX: 0, clientY: 0, screenX: 0, screenY: 0 }, T = 0; T < x.length; T++) {
          var R = x[T];
          for (var z in S) S[z] += R[z];
        }
        for (var W in S) S[W] /= x.length;
        return S;
      }
      function rt(x) {
        if (!x.length) return null;
        var S = Ke(x), T = Math.min(S[0].pageX, S[1].pageX), R = Math.min(S[0].pageY, S[1].pageY), z = Math.max(S[0].pageX, S[1].pageX), W = Math.max(S[0].pageY, S[1].pageY);
        return { x: T, y: R, left: T, top: R, right: z, bottom: W, width: z - T, height: W - R };
      }
      function De(x, S) {
        var T = S + "X", R = S + "Y", z = Ke(x), W = z[0][T] - z[1][T], Z = z[0][R] - z[1][R];
        return Ne(W, Z);
      }
      function Be(x, S) {
        var T = S + "X", R = S + "Y", z = Ke(x), W = z[1][T] - z[0][T], Z = z[1][R] - z[0][R];
        return 180 * Math.atan2(Z, W) / Math.PI;
      }
      function je(x) {
        return O.string(x.pointerType) ? x.pointerType : O.number(x.pointerType) ? [void 0, void 0, "touch", "pen", "mouse"][x.pointerType] : /touch/.test(x.type || "") || x instanceof j.Touch ? "touch" : "mouse";
      }
      function at(x) {
        var S = O.func(x.composedPath) ? x.composedPath() : x.path;
        return [ie(S ? S[0] : x.target), ie(x.currentTarget)];
      }
      var mt = (function() {
        function x(S) {
          r(this, x), this.immediatePropagationStopped = !1, this.propagationStopped = !1, this._interaction = S;
        }
        return l(x, [{ key: "preventDefault", value: function() {
        } }, { key: "stopPropagation", value: function() {
          this.propagationStopped = !0;
        } }, { key: "stopImmediatePropagation", value: function() {
          this.immediatePropagationStopped = this.propagationStopped = !0;
        } }]), x;
      })();
      Object.defineProperty(mt.prototype, "interaction", { get: function() {
        return this._interaction._proxy;
      }, set: function() {
      } });
      var st = function(x, S) {
        for (var T = 0; T < S.length; T++) {
          var R = S[T];
          x.push(R);
        }
        return x;
      }, gt = function(x) {
        return st([], x);
      }, Et = function(x, S) {
        for (var T = 0; T < x.length; T++) if (S(x[T], T, x)) return T;
        return -1;
      }, It = function(x, S) {
        return x[Et(x, S)];
      }, _t = (function(x) {
        u(T, x);
        var S = h(T);
        function T(R, z, W) {
          var Z;
          r(this, T), (Z = S.call(this, z._interaction)).dropzone = void 0, Z.dragEvent = void 0, Z.relatedTarget = void 0, Z.draggable = void 0, Z.propagationStopped = !1, Z.immediatePropagationStopped = !1;
          var ne = W === "dragleave" ? R.prev : R.cur, pe = ne.element, we = ne.dropzone;
          return Z.type = W, Z.target = pe, Z.currentTarget = pe, Z.dropzone = we, Z.dragEvent = z, Z.relatedTarget = z.target, Z.draggable = z.interactable, Z.timeStamp = z.timeStamp, Z;
        }
        return l(T, [{ key: "reject", value: function() {
          var R = this, z = this._interaction.dropState;
          if (this.type === "dropactivate" || this.dropzone && z.cur.dropzone === this.dropzone && z.cur.element === this.target) if (z.prev.dropzone = this.dropzone, z.prev.element = this.target, z.rejected = !0, z.events.enter = null, this.stopImmediatePropagation(), this.type === "dropactivate") {
            var W = z.activeDrops, Z = Et(W, (function(pe) {
              var we = pe.dropzone, ge = pe.element;
              return we === R.dropzone && ge === R.target;
            }));
            z.activeDrops.splice(Z, 1);
            var ne = new T(z, this.dragEvent, "dropdeactivate");
            ne.dropzone = this.dropzone, ne.target = this.target, this.dropzone.fire(ne);
          } else this.dropzone.fire(new T(z, this.dragEvent, "dragleave"));
        } }, { key: "preventDefault", value: function() {
        } }, { key: "stopPropagation", value: function() {
          this.propagationStopped = !0;
        } }, { key: "stopImmediatePropagation", value: function() {
          this.immediatePropagationStopped = this.propagationStopped = !0;
        } }]), T;
      })(mt);
      function wt(x, S) {
        for (var T = 0, R = x.slice(); T < R.length; T++) {
          var z = R[T], W = z.dropzone, Z = z.element;
          S.dropzone = W, S.target = Z, W.fire(S), S.propagationStopped = S.immediatePropagationStopped = !1;
        }
      }
      function Nt(x, S) {
        for (var T = (function(W, Z) {
          for (var ne = [], pe = 0, we = W.interactables.list; pe < we.length; pe++) {
            var ge = we[pe];
            if (ge.options.drop.enabled) {
              var Ee = ge.options.drop.accept;
              if (!(O.element(Ee) && Ee !== Z || O.string(Ee) && !H(Z, Ee) || O.func(Ee) && !Ee({ dropzone: ge, draggableElement: Z }))) for (var Me = 0, Xe = ge.getAllElements(); Me < Xe.length; Me++) {
                var Je = Xe[Me];
                Je !== Z && ne.push({ dropzone: ge, element: Je, rect: ge.getRect(Je) });
              }
            }
          }
          return ne;
        })(x, S), R = 0; R < T.length; R++) {
          var z = T[R];
          z.rect = z.dropzone.getRect(z.element);
        }
        return T;
      }
      function nn(x, S, T) {
        for (var R = x.dropState, z = x.interactable, W = x.element, Z = [], ne = 0, pe = R.activeDrops; ne < pe.length; ne++) {
          var we = pe[ne], ge = we.dropzone, Ee = we.element, Me = we.rect, Xe = ge.dropCheck(S, T, z, W, Ee, Me);
          Z.push(Xe ? Ee : null);
        }
        var Je = (function(it) {
          for (var ct, ft, $t, Wt = [], ln = 0; ln < it.length; ln++) {
            var Ft = it[ln], Ut = it[ct];
            if (Ft && ln !== ct) if (Ut) {
              var Un = q(Ft), Dn = q(Ut);
              if (Un !== Ft.ownerDocument) if (Dn !== Ft.ownerDocument) if (Un !== Dn) {
                Wt = Wt.length ? Wt : K(Ut);
                var oi = void 0;
                if (Ut instanceof j.HTMLElement && Ft instanceof j.SVGElement && !(Ft instanceof j.SVGSVGElement)) {
                  if (Ft === Dn) continue;
                  oi = Ft.ownerSVGElement;
                } else oi = Ft;
                for (var hi = K(oi, Ut.ownerDocument), Ni = 0; hi[Ni] && hi[Ni] === Wt[Ni]; ) Ni++;
                var Ca = [hi[Ni - 1], hi[Ni], Wt[Ni]];
                if (Ca[0]) for (var cr = Ca[0].lastChild; cr; ) {
                  if (cr === Ca[1]) {
                    ct = ln, Wt = hi;
                    break;
                  }
                  if (cr === Ca[2]) break;
                  cr = cr.previousSibling;
                }
              } else $t = Ut, (parseInt($(ft = Ft).getComputedStyle(ft).zIndex, 10) || 0) >= (parseInt($($t).getComputedStyle($t).zIndex, 10) || 0) && (ct = ln);
              else ct = ln;
            } else ct = ln;
          }
          return ct;
        })(Z);
        return R.activeDrops[Je] || null;
      }
      function sn(x, S, T) {
        var R = x.dropState, z = { enter: null, leave: null, activate: null, deactivate: null, move: null, drop: null };
        return T.type === "dragstart" && (z.activate = new _t(R, T, "dropactivate"), z.activate.target = null, z.activate.dropzone = null), T.type === "dragend" && (z.deactivate = new _t(R, T, "dropdeactivate"), z.deactivate.target = null, z.deactivate.dropzone = null), R.rejected || (R.cur.element !== R.prev.element && (R.prev.dropzone && (z.leave = new _t(R, T, "dragleave"), T.dragLeave = z.leave.target = R.prev.element, T.prevDropzone = z.leave.dropzone = R.prev.dropzone), R.cur.dropzone && (z.enter = new _t(R, T, "dragenter"), T.dragEnter = R.cur.element, T.dropzone = R.cur.dropzone)), T.type === "dragend" && R.cur.dropzone && (z.drop = new _t(R, T, "drop"), T.dropzone = R.cur.dropzone, T.relatedTarget = R.cur.element), T.type === "dragmove" && R.cur.dropzone && (z.move = new _t(R, T, "dropmove"), T.dropzone = R.cur.dropzone)), z;
      }
      function xn(x, S) {
        var T = x.dropState, R = T.activeDrops, z = T.cur, W = T.prev;
        S.leave && W.dropzone.fire(S.leave), S.enter && z.dropzone.fire(S.enter), S.move && z.dropzone.fire(S.move), S.drop && z.dropzone.fire(S.drop), S.deactivate && wt(R, S.deactivate), T.prev.dropzone = z.dropzone, T.prev.element = z.element;
      }
      function Pn(x, S) {
        var T = x.interaction, R = x.iEvent, z = x.event;
        if (R.type === "dragmove" || R.type === "dragend") {
          var W = T.dropState;
          S.dynamicDrop && (W.activeDrops = Nt(S, T.element));
          var Z = R, ne = nn(T, Z, z);
          W.rejected = W.rejected && !!ne && ne.dropzone === W.cur.dropzone && ne.element === W.cur.element, W.cur.dropzone = ne && ne.dropzone, W.cur.element = ne && ne.element, W.events = sn(T, 0, Z);
        }
      }
      var bt = { id: "actions/drop", install: function(x) {
        var S = x.actions, T = x.interactStatic, R = x.Interactable, z = x.defaults;
        x.usePlugin(M), R.prototype.dropzone = function(W) {
          return (function(Z, ne) {
            if (O.object(ne)) {
              if (Z.options.drop.enabled = ne.enabled !== !1, ne.listeners) {
                var pe = Re(ne.listeners), we = Object.keys(pe).reduce((function(Ee, Me) {
                  return Ee[/^(enter|leave)/.test(Me) ? "drag".concat(Me) : /^(activate|deactivate|move)/.test(Me) ? "drop".concat(Me) : Me] = pe[Me], Ee;
                }), {}), ge = Z.options.drop.listeners;
                ge && Z.off(ge), Z.on(we), Z.options.drop.listeners = we;
              }
              return O.func(ne.ondrop) && Z.on("drop", ne.ondrop), O.func(ne.ondropactivate) && Z.on("dropactivate", ne.ondropactivate), O.func(ne.ondropdeactivate) && Z.on("dropdeactivate", ne.ondropdeactivate), O.func(ne.ondragenter) && Z.on("dragenter", ne.ondragenter), O.func(ne.ondragleave) && Z.on("dragleave", ne.ondragleave), O.func(ne.ondropmove) && Z.on("dropmove", ne.ondropmove), /^(pointer|center)$/.test(ne.overlap) ? Z.options.drop.overlap = ne.overlap : O.number(ne.overlap) && (Z.options.drop.overlap = Math.max(Math.min(1, ne.overlap), 0)), "accept" in ne && (Z.options.drop.accept = ne.accept), "checker" in ne && (Z.options.drop.checker = ne.checker), Z;
            }
            return O.bool(ne) ? (Z.options.drop.enabled = ne, Z) : Z.options.drop;
          })(this, W);
        }, R.prototype.dropCheck = function(W, Z, ne, pe, we, ge) {
          return (function(Ee, Me, Xe, Je, it, ct, ft) {
            var $t = !1;
            if (!(ft = ft || Ee.getRect(ct))) return !!Ee.options.drop.checker && Ee.options.drop.checker(Me, Xe, $t, Ee, ct, Je, it);
            var Wt = Ee.options.drop.overlap;
            if (Wt === "pointer") {
              var ln = ze(Je, it, "drag"), Ft = Ce(Me);
              Ft.x += ln.x, Ft.y += ln.y;
              var Ut = Ft.x > ft.left && Ft.x < ft.right, Un = Ft.y > ft.top && Ft.y < ft.bottom;
              $t = Ut && Un;
            }
            var Dn = Je.getRect(it);
            if (Dn && Wt === "center") {
              var oi = Dn.left + Dn.width / 2, hi = Dn.top + Dn.height / 2;
              $t = oi >= ft.left && oi <= ft.right && hi >= ft.top && hi <= ft.bottom;
            }
            return Dn && O.number(Wt) && ($t = Math.max(0, Math.min(ft.right, Dn.right) - Math.max(ft.left, Dn.left)) * Math.max(0, Math.min(ft.bottom, Dn.bottom) - Math.max(ft.top, Dn.top)) / (Dn.width * Dn.height) >= Wt), Ee.options.drop.checker && ($t = Ee.options.drop.checker(Me, Xe, $t, Ee, ct, Je, it)), $t;
          })(this, W, Z, ne, pe, we, ge);
        }, T.dynamicDrop = function(W) {
          return O.bool(W) ? (x.dynamicDrop = W, T) : x.dynamicDrop;
        }, ce(S.phaselessTypes, { dragenter: !0, dragleave: !0, dropactivate: !0, dropdeactivate: !0, dropmove: !0, drop: !0 }), S.methodDict.drop = "dropzone", x.dynamicDrop = !1, z.actions.drop = bt.defaults;
      }, listeners: { "interactions:before-action-start": function(x) {
        var S = x.interaction;
        S.prepared.name === "drag" && (S.dropState = { cur: { dropzone: null, element: null }, prev: { dropzone: null, element: null }, rejected: null, events: null, activeDrops: [] });
      }, "interactions:after-action-start": function(x, S) {
        var T = x.interaction, R = (x.event, x.iEvent);
        if (T.prepared.name === "drag") {
          var z = T.dropState;
          z.activeDrops = [], z.events = {}, z.activeDrops = Nt(S, T.element), z.events = sn(T, 0, R), z.events.activate && (wt(z.activeDrops, z.events.activate), S.fire("actions/drop:start", { interaction: T, dragEvent: R }));
        }
      }, "interactions:action-move": Pn, "interactions:after-action-move": function(x, S) {
        var T = x.interaction, R = x.iEvent;
        if (T.prepared.name === "drag") {
          var z = T.dropState;
          xn(T, z.events), S.fire("actions/drop:move", { interaction: T, dragEvent: R }), z.events = {};
        }
      }, "interactions:action-end": function(x, S) {
        if (x.interaction.prepared.name === "drag") {
          var T = x.interaction, R = x.iEvent;
          Pn(x, S), xn(T, T.dropState.events), S.fire("actions/drop:end", { interaction: T, dragEvent: R });
        }
      }, "interactions:stop": function(x) {
        var S = x.interaction;
        if (S.prepared.name === "drag") {
          var T = S.dropState;
          T && (T.activeDrops = null, T.events = null, T.cur.dropzone = null, T.cur.element = null, T.prev.dropzone = null, T.prev.element = null, T.rejected = !1);
        }
      } }, getActiveDrops: Nt, getDrop: nn, getDropEvents: sn, fireDropEvents: xn, filterEventType: function(x) {
        return x.search("drag") === 0 || x.search("drop") === 0;
      }, defaults: { enabled: !1, accept: null, overlap: "pointer" } }, Xn = bt;
      function En(x) {
        var S = x.interaction, T = x.iEvent, R = x.phase;
        if (S.prepared.name === "gesture") {
          var z = S.pointers.map((function(we) {
            return we.pointer;
          })), W = R === "start", Z = R === "end", ne = S.interactable.options.deltaSource;
          if (T.touches = [z[0], z[1]], W) T.distance = De(z, ne), T.box = rt(z), T.scale = 1, T.ds = 0, T.angle = Be(z, ne), T.da = 0, S.gesture.startDistance = T.distance, S.gesture.startAngle = T.angle;
          else if (Z || S.pointers.length < 2) {
            var pe = S.prevEvent;
            T.distance = pe.distance, T.box = pe.box, T.scale = pe.scale, T.ds = 0, T.angle = pe.angle, T.da = 0;
          } else T.distance = De(z, ne), T.box = rt(z), T.scale = T.distance / S.gesture.startDistance, T.angle = Be(z, ne), T.ds = T.scale - S.gesture.scale, T.da = T.angle - S.gesture.angle;
          S.gesture.distance = T.distance, S.gesture.angle = T.angle, O.number(T.scale) && T.scale !== 1 / 0 && !isNaN(T.scale) && (S.gesture.scale = T.scale);
        }
      }
      var di = { id: "actions/gesture", before: ["actions/drag", "actions/resize"], install: function(x) {
        var S = x.actions, T = x.Interactable, R = x.defaults;
        T.prototype.gesturable = function(z) {
          return O.object(z) ? (this.options.gesture.enabled = z.enabled !== !1, this.setPerAction("gesture", z), this.setOnEvents("gesture", z), this) : O.bool(z) ? (this.options.gesture.enabled = z, this) : this.options.gesture;
        }, S.map.gesture = di, S.methodDict.gesture = "gesturable", R.actions.gesture = di.defaults;
      }, listeners: { "interactions:action-start": En, "interactions:action-move": En, "interactions:action-end": En, "interactions:new": function(x) {
        x.interaction.gesture = { angle: 0, distance: 0, scale: 1, startAngle: 0, startDistance: 0 };
      }, "auto-start:check": function(x) {
        if (!(x.interaction.pointers.length < 2)) {
          var S = x.interactable.options.gesture;
          if (S && S.enabled) return x.action = { name: "gesture" }, !1;
        }
      } }, defaults: {}, getCursor: function() {
        return "";
      }, filterEventType: function(x) {
        return x.search("gesture") === 0;
      } }, Ri = di;
      function zo(x, S, T, R, z, W, Z) {
        if (!S) return !1;
        if (S === !0) {
          var ne = O.number(W.width) ? W.width : W.right - W.left, pe = O.number(W.height) ? W.height : W.bottom - W.top;
          if (Z = Math.min(Z, Math.abs((x === "left" || x === "right" ? ne : pe) / 2)), ne < 0 && (x === "left" ? x = "right" : x === "right" && (x = "left")), pe < 0 && (x === "top" ? x = "bottom" : x === "bottom" && (x = "top")), x === "left") {
            var we = ne >= 0 ? W.left : W.right;
            return T.x < we + Z;
          }
          if (x === "top") {
            var ge = pe >= 0 ? W.top : W.bottom;
            return T.y < ge + Z;
          }
          if (x === "right") return T.x > (ne >= 0 ? W.right : W.left) - Z;
          if (x === "bottom") return T.y > (pe >= 0 ? W.bottom : W.top) - Z;
        }
        return !!O.element(R) && (O.element(S) ? S === R : ee(R, S, z));
      }
      function Ue(x) {
        var S = x.iEvent, T = x.interaction;
        if (T.prepared.name === "resize" && T.resizeAxes) {
          var R = S;
          T.interactable.options.resize.square ? (T.resizeAxes === "y" ? R.delta.x = R.delta.y : R.delta.y = R.delta.x, R.axes = "xy") : (R.axes = T.resizeAxes, T.resizeAxes === "x" ? R.delta.y = 0 : T.resizeAxes === "y" && (R.delta.x = 0));
        }
      }
      var yt, xt, fn = { id: "actions/resize", before: ["actions/drag"], install: function(x) {
        var S = x.actions, T = x.browser, R = x.Interactable, z = x.defaults;
        fn.cursors = (function(W) {
          return W.isIe9 ? { x: "e-resize", y: "s-resize", xy: "se-resize", top: "n-resize", left: "w-resize", bottom: "s-resize", right: "e-resize", topleft: "se-resize", bottomright: "se-resize", topright: "ne-resize", bottomleft: "ne-resize" } : { x: "ew-resize", y: "ns-resize", xy: "nwse-resize", top: "ns-resize", left: "ew-resize", bottom: "ns-resize", right: "ew-resize", topleft: "nwse-resize", bottomright: "nwse-resize", topright: "nesw-resize", bottomleft: "nesw-resize" };
        })(T), fn.defaultMargin = T.supportsTouch || T.supportsPointerEvent ? 20 : 10, R.prototype.resizable = function(W) {
          return (function(Z, ne, pe) {
            return O.object(ne) ? (Z.options.resize.enabled = ne.enabled !== !1, Z.setPerAction("resize", ne), Z.setOnEvents("resize", ne), O.string(ne.axis) && /^x$|^y$|^xy$/.test(ne.axis) ? Z.options.resize.axis = ne.axis : ne.axis === null && (Z.options.resize.axis = pe.defaults.actions.resize.axis), O.bool(ne.preserveAspectRatio) ? Z.options.resize.preserveAspectRatio = ne.preserveAspectRatio : O.bool(ne.square) && (Z.options.resize.square = ne.square), Z) : O.bool(ne) ? (Z.options.resize.enabled = ne, Z) : Z.options.resize;
          })(this, W, x);
        }, S.map.resize = fn, S.methodDict.resize = "resizable", z.actions.resize = fn.defaults;
      }, listeners: { "interactions:new": function(x) {
        x.interaction.resizeAxes = "xy";
      }, "interactions:action-start": function(x) {
        (function(S) {
          var T = S.iEvent, R = S.interaction;
          if (R.prepared.name === "resize" && R.prepared.edges) {
            var z = T, W = R.rect;
            R._rects = { start: ce({}, W), corrected: ce({}, W), previous: ce({}, W), delta: { left: 0, right: 0, width: 0, top: 0, bottom: 0, height: 0 } }, z.edges = R.prepared.edges, z.rect = R._rects.corrected, z.deltaRect = R._rects.delta;
          }
        })(x), Ue(x);
      }, "interactions:action-move": function(x) {
        (function(S) {
          var T = S.iEvent, R = S.interaction;
          if (R.prepared.name === "resize" && R.prepared.edges) {
            var z = T, W = R.interactable.options.resize.invert, Z = W === "reposition" || W === "negate", ne = R.rect, pe = R._rects, we = pe.start, ge = pe.corrected, Ee = pe.delta, Me = pe.previous;
            if (ce(Me, ge), Z) {
              if (ce(ge, ne), W === "reposition") {
                if (ge.top > ge.bottom) {
                  var Xe = ge.top;
                  ge.top = ge.bottom, ge.bottom = Xe;
                }
                if (ge.left > ge.right) {
                  var Je = ge.left;
                  ge.left = ge.right, ge.right = Je;
                }
              }
            } else ge.top = Math.min(ne.top, we.bottom), ge.bottom = Math.max(ne.bottom, we.top), ge.left = Math.min(ne.left, we.right), ge.right = Math.max(ne.right, we.left);
            for (var it in ge.width = ge.right - ge.left, ge.height = ge.bottom - ge.top, ge) Ee[it] = ge[it] - Me[it];
            z.edges = R.prepared.edges, z.rect = ge, z.deltaRect = Ee;
          }
        })(x), Ue(x);
      }, "interactions:action-end": function(x) {
        var S = x.iEvent, T = x.interaction;
        if (T.prepared.name === "resize" && T.prepared.edges) {
          var R = S;
          R.edges = T.prepared.edges, R.rect = T._rects.corrected, R.deltaRect = T._rects.delta;
        }
      }, "auto-start:check": function(x) {
        var S = x.interaction, T = x.interactable, R = x.element, z = x.rect, W = x.buttons;
        if (z) {
          var Z = ce({}, S.coords.cur.page), ne = T.options.resize;
          if (ne && ne.enabled && (!S.pointerIsDown || !/mouse|pointer/.test(S.pointerType) || (W & ne.mouseButtons) != 0)) {
            if (O.object(ne.edges)) {
              var pe = { left: !1, right: !1, top: !1, bottom: !1 };
              for (var we in pe) pe[we] = zo(we, ne.edges[we], Z, S._latestPointer.eventTarget, R, z, ne.margin || fn.defaultMargin);
              pe.left = pe.left && !pe.right, pe.top = pe.top && !pe.bottom, (pe.left || pe.right || pe.top || pe.bottom) && (x.action = { name: "resize", edges: pe });
            } else {
              var ge = ne.axis !== "y" && Z.x > z.right - fn.defaultMargin, Ee = ne.axis !== "x" && Z.y > z.bottom - fn.defaultMargin;
              (ge || Ee) && (x.action = { name: "resize", axes: (ge ? "x" : "") + (Ee ? "y" : "") });
            }
            return !x.action && void 0;
          }
        }
      } }, defaults: { square: !1, preserveAspectRatio: !1, axis: "xy", margin: NaN, edges: null, invert: "none" }, cursors: null, getCursor: function(x) {
        var S = x.edges, T = x.axis, R = x.name, z = fn.cursors, W = null;
        if (T) W = z[R + T];
        else if (S) {
          for (var Z = "", ne = 0, pe = ["top", "bottom", "left", "right"]; ne < pe.length; ne++) {
            var we = pe[ne];
            S[we] && (Z += we);
          }
          W = z[Z];
        }
        return W;
      }, filterEventType: function(x) {
        return x.search("resize") === 0;
      }, defaultMargin: null }, Oi = fn, yi = { id: "actions", install: function(x) {
        x.usePlugin(Ri), x.usePlugin(Oi), x.usePlugin(M), x.usePlugin(Xn);
      } }, io = 0, Ln = { request: function(x) {
        return yt(x);
      }, cancel: function(x) {
        return xt(x);
      }, init: function(x) {
        if (yt = x.requestAnimationFrame, xt = x.cancelAnimationFrame, !yt) for (var S = ["ms", "moz", "webkit", "o"], T = 0; T < S.length; T++) {
          var R = S[T];
          yt = x["".concat(R, "RequestAnimationFrame")], xt = x["".concat(R, "CancelAnimationFrame")] || x["".concat(R, "CancelRequestAnimationFrame")];
        }
        yt = yt && yt.bind(x), xt = xt && xt.bind(x), yt || (yt = function(z) {
          var W = Date.now(), Z = Math.max(0, 16 - (W - io)), ne = x.setTimeout((function() {
            z(W + Z);
          }), Z);
          return io = W + Z, ne;
        }, xt = function(z) {
          return clearTimeout(z);
        });
      } }, Bt = { defaults: { enabled: !1, margin: 60, container: null, speed: 300 }, now: Date.now, interaction: null, i: 0, x: 0, y: 0, isScrolling: !1, prevTime: 0, margin: 0, speed: 0, start: function(x) {
        Bt.isScrolling = !0, Ln.cancel(Bt.i), x.autoScroll = Bt, Bt.interaction = x, Bt.prevTime = Bt.now(), Bt.i = Ln.request(Bt.scroll);
      }, stop: function() {
        Bt.isScrolling = !1, Bt.interaction && (Bt.interaction.autoScroll = null), Ln.cancel(Bt.i);
      }, scroll: function() {
        var x = Bt.interaction, S = x.interactable, T = x.element, R = x.prepared.name, z = S.options[R].autoScroll, W = Fi(z.container, S, T), Z = Bt.now(), ne = (Z - Bt.prevTime) / 1e3, pe = z.speed * ne;
        if (pe >= 1) {
          var we = { x: Bt.x * pe, y: Bt.y * pe };
          if (we.x || we.y) {
            var ge = vo(W);
            O.window(W) ? W.scrollBy(we.x, we.y) : W && (W.scrollLeft += we.x, W.scrollTop += we.y);
            var Ee = vo(W), Me = { x: Ee.x - ge.x, y: Ee.y - ge.y };
            (Me.x || Me.y) && S.fire({ type: "autoscroll", target: T, interactable: S, delta: Me, interaction: x, container: W });
          }
          Bt.prevTime = Z;
        }
        Bt.isScrolling && (Ln.cancel(Bt.i), Bt.i = Ln.request(Bt.scroll));
      }, check: function(x, S) {
        var T;
        return (T = x.options[S].autoScroll) == null ? void 0 : T.enabled;
      }, onInteractionMove: function(x) {
        var S = x.interaction, T = x.pointer;
        if (S.interacting() && Bt.check(S.interactable, S.prepared.name)) if (S.simulation) Bt.x = Bt.y = 0;
        else {
          var R, z, W, Z, ne = S.interactable, pe = S.element, we = S.prepared.name, ge = ne.options[we].autoScroll, Ee = Fi(ge.container, ne, pe);
          if (O.window(Ee)) Z = T.clientX < Bt.margin, R = T.clientY < Bt.margin, z = T.clientX > Ee.innerWidth - Bt.margin, W = T.clientY > Ee.innerHeight - Bt.margin;
          else {
            var Me = ae(Ee);
            Z = T.clientX < Me.left + Bt.margin, R = T.clientY < Me.top + Bt.margin, z = T.clientX > Me.right - Bt.margin, W = T.clientY > Me.bottom - Bt.margin;
          }
          Bt.x = z ? 1 : Z ? -1 : 0, Bt.y = W ? 1 : R ? -1 : 0, Bt.isScrolling || (Bt.margin = ge.margin, Bt.speed = ge.speed, Bt.start(S));
        }
      } };
      function Fi(x, S, T) {
        return (O.string(x) ? ue(x, S, T) : x) || $(T);
      }
      function vo(x) {
        return O.window(x) && (x = window.document.body), { x: x.scrollLeft, y: x.scrollTop };
      }
      var Sn = { id: "auto-scroll", install: function(x) {
        var S = x.defaults, T = x.actions;
        x.autoScroll = Bt, Bt.now = function() {
          return x.now();
        }, T.phaselessTypes.autoscroll = !0, S.perAction.autoScroll = Bt.defaults;
      }, listeners: { "interactions:new": function(x) {
        x.interaction.autoScroll = null;
      }, "interactions:destroy": function(x) {
        x.interaction.autoScroll = null, Bt.stop(), Bt.interaction && (Bt.interaction = null);
      }, "interactions:stop": Bt.stop, "interactions:action-move": function(x) {
        return Bt.onInteractionMove(x);
      } } }, Zn = Sn;
      function wn(x, S) {
        var T = !1;
        return function() {
          return T || (b.console.warn(S), T = !0), x.apply(this, arguments);
        };
      }
      function Gn(x, S) {
        return x.name = S.name, x.axis = S.axis, x.edges = S.edges, x;
      }
      function Ho(x) {
        return O.bool(x) ? (this.options.styleCursor = x, this) : x === null ? (delete this.options.styleCursor, this) : this.options.styleCursor;
      }
      function Si(x) {
        return O.func(x) ? (this.options.actionChecker = x, this) : x === null ? (delete this.options.actionChecker, this) : this.options.actionChecker;
      }
      var ur = { id: "auto-start/interactableMethods", install: function(x) {
        var S = x.Interactable;
        S.prototype.getAction = function(T, R, z, W) {
          var Z = (function(ne, pe, we, ge, Ee) {
            var Me = ne.getRect(ge), Xe = pe.buttons || { 0: 1, 1: 4, 3: 8, 4: 16 }[pe.button], Je = { action: null, interactable: ne, interaction: we, element: ge, rect: Me, buttons: Xe };
            return Ee.fire("auto-start:check", Je), Je.action;
          })(this, R, z, W, x);
          return this.options.actionChecker ? this.options.actionChecker(T, R, Z, this, W, z) : Z;
        }, S.prototype.ignoreFrom = wn((function(T) {
          return this._backCompatOption("ignoreFrom", T);
        }), "Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue})."), S.prototype.allowFrom = wn((function(T) {
          return this._backCompatOption("allowFrom", T);
        }), "Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."), S.prototype.actionChecker = Si, S.prototype.styleCursor = Ho;
      } };
      function $o(x, S, T, R, z) {
        return S.testIgnoreAllow(S.options[x.name], T, R) && S.options[x.name].enabled && Za(S, T, x, z) ? x : null;
      }
      function Fl(x, S, T, R, z, W, Z) {
        for (var ne = 0, pe = R.length; ne < pe; ne++) {
          var we = R[ne], ge = z[ne], Ee = we.getAction(S, T, x, ge);
          if (Ee) {
            var Me = $o(Ee, we, ge, W, Z);
            if (Me) return { action: Me, interactable: we, element: ge };
          }
        }
        return { action: null, interactable: null, element: null };
      }
      function Vl(x, S, T, R, z) {
        var W = [], Z = [], ne = R;
        function pe(ge) {
          W.push(ge), Z.push(ne);
        }
        for (; O.element(ne); ) {
          W = [], Z = [], z.interactables.forEachMatch(ne, pe);
          var we = Fl(x, S, T, W, Z, R, z);
          if (we.action && !we.interactable.options[we.action.name].manualStart) return we;
          ne = V(ne);
        }
        return { action: null, interactable: null, element: null };
      }
      function ba(x, S, T) {
        var R = S.action, z = S.interactable, W = S.element;
        R = R || { name: null }, x.interactable = z, x.element = W, Gn(x.prepared, R), x.rect = z && R.name ? z.getRect(W) : null, Ws(x, T), T.fire("autoStart:prepared", { interaction: x });
      }
      function Za(x, S, T, R) {
        var z = x.options, W = z[T.name].max, Z = z[T.name].maxPerElement, ne = R.autoStart.maxInteractions, pe = 0, we = 0, ge = 0;
        if (!(W && Z && ne)) return !1;
        for (var Ee = 0, Me = R.interactions.list; Ee < Me.length; Ee++) {
          var Xe = Me[Ee], Je = Xe.prepared.name;
          if (Xe.interacting() && (++pe >= ne || Xe.interactable === x && ((we += Je === T.name ? 1 : 0) >= W || Xe.element === S && (ge++, Je === T.name && ge >= Z))))
            return !1;
        }
        return ne > 0;
      }
      function Hs(x, S) {
        return O.number(x) ? (S.autoStart.maxInteractions = x, this) : S.autoStart.maxInteractions;
      }
      function Ga(x, S, T) {
        var R = T.autoStart.cursorElement;
        R && R !== x && (R.style.cursor = ""), x.ownerDocument.documentElement.style.cursor = S, x.style.cursor = S, T.autoStart.cursorElement = S ? x : null;
      }
      function Ws(x, S) {
        var T = x.interactable, R = x.element, z = x.prepared;
        if (x.pointerType === "mouse" && T && T.options.styleCursor) {
          var W = "";
          if (z.name) {
            var Z = T.options[z.name].cursorChecker;
            W = O.func(Z) ? Z(z, T, R, x._interacting) : S.actions.map[z.name].getCursor(z);
          }
          Ga(x.element, W || "", S);
        } else S.autoStart.cursorElement && Ga(S.autoStart.cursorElement, "", S);
      }
      var xa = { id: "auto-start/base", before: ["actions"], install: function(x) {
        var S = x.interactStatic, T = x.defaults;
        x.usePlugin(ur), T.base.actionChecker = null, T.base.styleCursor = !0, ce(T.perAction, { manualStart: !1, max: 1 / 0, maxPerElement: 1, allowFrom: null, ignoreFrom: null, mouseButtons: 1 }), S.maxInteractions = function(R) {
          return Hs(R, x);
        }, x.autoStart = { maxInteractions: 1 / 0, withinInteractionLimit: Za, cursorElement: null };
      }, listeners: { "interactions:down": function(x, S) {
        var T = x.interaction, R = x.pointer, z = x.event, W = x.eventTarget;
        T.interacting() || ba(T, Vl(T, R, z, W, S), S);
      }, "interactions:move": function(x, S) {
        (function(T, R) {
          var z = T.interaction, W = T.pointer, Z = T.event, ne = T.eventTarget;
          z.pointerType !== "mouse" || z.pointerIsDown || z.interacting() || ba(z, Vl(z, W, Z, ne, R), R);
        })(x, S), (function(T, R) {
          var z = T.interaction;
          if (z.pointerIsDown && !z.interacting() && z.pointerWasMoved && z.prepared.name) {
            R.fire("autoStart:before-start", T);
            var W = z.interactable, Z = z.prepared.name;
            Z && W && (W.options[Z].manualStart || !Za(W, z.element, z.prepared, R) ? z.stop() : (z.start(z.prepared, W, z.element), Ws(z, R)));
          }
        })(x, S);
      }, "interactions:stop": function(x, S) {
        var T = x.interaction, R = T.interactable;
        R && R.options.styleCursor && Ga(T.element, "", S);
      } }, maxInteractions: Hs, withinInteractionLimit: Za, validateAction: $o }, Ua = xa, Wu = { id: "auto-start/dragAxis", listeners: { "autoStart:before-start": function(x, S) {
        var T = x.interaction, R = x.eventTarget, z = x.dx, W = x.dy;
        if (T.prepared.name === "drag") {
          var Z = Math.abs(z), ne = Math.abs(W), pe = T.interactable.options.drag, we = pe.startAxis, ge = Z > ne ? "x" : Z < ne ? "y" : "xy";
          if (T.prepared.axis = pe.lockAxis === "start" ? ge[0] : pe.lockAxis, ge !== "xy" && we !== "xy" && we !== ge) {
            T.prepared.name = null;
            for (var Ee = R, Me = function(Je) {
              if (Je !== T.interactable) {
                var it = T.interactable.options.drag;
                if (!it.manualStart && Je.testIgnoreAllow(it, Ee, R)) {
                  var ct = Je.getAction(T.downPointer, T.downEvent, T, Ee);
                  if (ct && ct.name === "drag" && (function(ft, $t) {
                    if (!$t) return !1;
                    var Wt = $t.options.drag.startAxis;
                    return ft === "xy" || Wt === "xy" || Wt === ft;
                  })(ge, Je) && Ua.validateAction(ct, Je, Ee, R, S)) return Je;
                }
              }
            }; O.element(Ee); ) {
              var Xe = S.interactables.forEachMatch(Ee, Me);
              if (Xe) {
                T.prepared.name = "drag", T.interactable = Xe, T.element = Ee;
                break;
              }
              Ee = V(Ee);
            }
          }
        }
      } } };
      function Wo(x) {
        var S = x.prepared && x.prepared.name;
        if (!S) return null;
        var T = x.interactable.options;
        return T[S].hold || T[S].delay;
      }
      var hd = { id: "auto-start/hold", install: function(x) {
        var S = x.defaults;
        x.usePlugin(Ua), S.perAction.hold = 0, S.perAction.delay = 0;
      }, listeners: { "interactions:new": function(x) {
        x.interaction.autoStartHoldTimer = null;
      }, "autoStart:prepared": function(x) {
        var S = x.interaction, T = Wo(S);
        T > 0 && (S.autoStartHoldTimer = setTimeout((function() {
          S.start(S.prepared, S.interactable, S.element);
        }), T));
      }, "interactions:move": function(x) {
        var S = x.interaction, T = x.duplicate;
        S.autoStartHoldTimer && S.pointerWasMoved && !T && (clearTimeout(S.autoStartHoldTimer), S.autoStartHoldTimer = null);
      }, "autoStart:before-start": function(x) {
        var S = x.interaction;
        Wo(S) > 0 && (S.prepared.name = null);
      } }, getHoldDuration: Wo }, ju = hd, js = { id: "auto-start", install: function(x) {
        x.usePlugin(Ua), x.usePlugin(ju), x.usePlugin(Wu);
      } }, qu = function(x) {
        return /^(always|never|auto)$/.test(x) ? (this.options.preventDefault = x, this) : O.bool(x) ? (this.options.preventDefault = x ? "always" : "never", this) : this.options.preventDefault;
      };
      function Yu(x) {
        var S = x.interaction, T = x.event;
        S.interactable && S.interactable.checkAndPreventDefault(T);
      }
      var qs = { id: "core/interactablePreventDefault", install: function(x) {
        var S = x.Interactable;
        S.prototype.preventDefault = qu, S.prototype.checkAndPreventDefault = function(T) {
          return (function(R, z, W) {
            var Z = R.options.preventDefault;
            if (Z !== "never") if (Z !== "always") {
              if (z.events.supportsPassive && /^touch(start|move)$/.test(W.type)) {
                var ne = $(W.target).document, pe = z.getDocOptions(ne);
                if (!pe || !pe.events || pe.events.passive !== !1) return;
              }
              /^(mouse|pointer|touch)*(down|start)/i.test(W.type) || O.element(W.target) && H(W.target, "input,select,textarea,[contenteditable=true],[contenteditable=true] *") || W.preventDefault();
            } else W.preventDefault();
          })(this, x, T);
        }, x.interactions.docEvents.push({ type: "dragstart", listener: function(T) {
          for (var R = 0, z = x.interactions.list; R < z.length; R++) {
            var W = z[R];
            if (W.element && (W.element === T.target || Q(W.element, T.target))) return void W.interactable.checkAndPreventDefault(T);
          }
        } });
      }, listeners: ["down", "move", "up", "cancel"].reduce((function(x, S) {
        return x["interactions:".concat(S)] = Yu, x;
      }), {}) };
      function Ys(x, S) {
        if (S.phaselessTypes[x]) return !0;
        for (var T in S.map) if (x.indexOf(T) === 0 && x.substr(T.length) in S.phases) return !0;
        return !1;
      }
      function Pi(x) {
        var S = {};
        for (var T in x) {
          var R = x[T];
          O.plainObject(R) ? S[T] = Pi(R) : O.array(R) ? S[T] = gt(R) : S[T] = R;
        }
        return S;
      }
      var jo = (function() {
        function x(S) {
          r(this, x), this.states = [], this.startOffset = { left: 0, right: 0, top: 0, bottom: 0 }, this.startDelta = void 0, this.result = void 0, this.endResult = void 0, this.startEdges = void 0, this.edges = void 0, this.interaction = void 0, this.interaction = S, this.result = Ql(), this.edges = { left: !1, right: !1, top: !1, bottom: !1 };
        }
        return l(x, [{ key: "start", value: function(S, T) {
          var R, z, W = S.phase, Z = this.interaction, ne = (function(we) {
            var ge = we.interactable.options[we.prepared.name], Ee = ge.modifiers;
            return Ee && Ee.length ? Ee : ["snap", "snapSize", "snapEdges", "restrict", "restrictEdges", "restrictSize"].map((function(Me) {
              var Xe = ge[Me];
              return Xe && Xe.enabled && { options: Xe, methods: Xe._methods };
            })).filter((function(Me) {
              return !!Me;
            }));
          })(Z);
          this.prepareStates(ne), this.startEdges = ce({}, Z.edges), this.edges = ce({}, this.startEdges), this.startOffset = (R = Z.rect, z = T, R ? { left: z.x - R.left, top: z.y - R.top, right: R.right - z.x, bottom: R.bottom - z.y } : { left: 0, top: 0, right: 0, bottom: 0 }), this.startDelta = { x: 0, y: 0 };
          var pe = this.fillArg({ phase: W, pageCoords: T, preEnd: !1 });
          return this.result = Ql(), this.startAll(pe), this.result = this.setAll(pe);
        } }, { key: "fillArg", value: function(S) {
          var T = this.interaction;
          return S.interaction = T, S.interactable = T.interactable, S.element = T.element, S.rect || (S.rect = T.rect), S.edges || (S.edges = this.startEdges), S.startOffset = this.startOffset, S;
        } }, { key: "startAll", value: function(S) {
          for (var T = 0, R = this.states; T < R.length; T++) {
            var z = R[T];
            z.methods.start && (S.state = z, z.methods.start(S));
          }
        } }, { key: "setAll", value: function(S) {
          var T = S.phase, R = S.preEnd, z = S.skipModifiers, W = S.rect, Z = S.edges;
          S.coords = ce({}, S.pageCoords), S.rect = ce({}, W), S.edges = ce({}, Z);
          for (var ne = z ? this.states.slice(z) : this.states, pe = Ql(S.coords, S.rect), we = 0; we < ne.length; we++) {
            var ge, Ee = ne[we], Me = Ee.options, Xe = ce({}, S.coords), Je = null;
            (ge = Ee.methods) != null && ge.set && this.shouldDo(Me, R, T) && (S.state = Ee, Je = Ee.methods.set(S), ke(S.edges, S.rect, { x: S.coords.x - Xe.x, y: S.coords.y - Xe.y })), pe.eventProps.push(Je);
          }
          ce(this.edges, S.edges), pe.delta.x = S.coords.x - S.pageCoords.x, pe.delta.y = S.coords.y - S.pageCoords.y, pe.rectDelta.left = S.rect.left - W.left, pe.rectDelta.right = S.rect.right - W.right, pe.rectDelta.top = S.rect.top - W.top, pe.rectDelta.bottom = S.rect.bottom - W.bottom;
          var it = this.result.coords, ct = this.result.rect;
          if (it && ct) {
            var ft = pe.rect.left !== ct.left || pe.rect.right !== ct.right || pe.rect.top !== ct.top || pe.rect.bottom !== ct.bottom;
            pe.changed = ft || it.x !== pe.coords.x || it.y !== pe.coords.y;
          }
          return pe;
        } }, { key: "applyToInteraction", value: function(S) {
          var T = this.interaction, R = S.phase, z = T.coords.cur, W = T.coords.start, Z = this.result, ne = this.startDelta, pe = Z.delta;
          R === "start" && ce(this.startDelta, Z.delta);
          for (var we = 0, ge = [[W, ne], [z, pe]]; we < ge.length; we++) {
            var Ee = ge[we], Me = Ee[0], Xe = Ee[1];
            Me.page.x += Xe.x, Me.page.y += Xe.y, Me.client.x += Xe.x, Me.client.y += Xe.y;
          }
          var Je = this.result.rectDelta, it = S.rect || T.rect;
          it.left += Je.left, it.right += Je.right, it.top += Je.top, it.bottom += Je.bottom, it.width = it.right - it.left, it.height = it.bottom - it.top;
        } }, { key: "setAndApply", value: function(S) {
          var T = this.interaction, R = S.phase, z = S.preEnd, W = S.skipModifiers, Z = this.setAll(this.fillArg({ preEnd: z, phase: R, pageCoords: S.modifiedCoords || T.coords.cur.page }));
          if (this.result = Z, !Z.changed && (!W || W < this.states.length) && T.interacting()) return !1;
          if (S.modifiedCoords) {
            var ne = T.coords.cur.page, pe = { x: S.modifiedCoords.x - ne.x, y: S.modifiedCoords.y - ne.y };
            Z.coords.x += pe.x, Z.coords.y += pe.y, Z.delta.x += pe.x, Z.delta.y += pe.y;
          }
          this.applyToInteraction(S);
        } }, { key: "beforeEnd", value: function(S) {
          var T = S.interaction, R = S.event, z = this.states;
          if (z && z.length) {
            for (var W = !1, Z = 0; Z < z.length; Z++) {
              var ne = z[Z];
              S.state = ne;
              var pe = ne.options, we = ne.methods, ge = we.beforeEnd && we.beforeEnd(S);
              if (ge) return this.endResult = ge, !1;
              W = W || !W && this.shouldDo(pe, !0, S.phase, !0);
            }
            W && T.move({ event: R, preEnd: !0 });
          }
        } }, { key: "stop", value: function(S) {
          var T = S.interaction;
          if (this.states && this.states.length) {
            var R = ce({ states: this.states, interactable: T.interactable, element: T.element, rect: null }, S);
            this.fillArg(R);
            for (var z = 0, W = this.states; z < W.length; z++) {
              var Z = W[z];
              R.state = Z, Z.methods.stop && Z.methods.stop(R);
            }
            this.states = null, this.endResult = null;
          }
        } }, { key: "prepareStates", value: function(S) {
          this.states = [];
          for (var T = 0; T < S.length; T++) {
            var R = S[T], z = R.options, W = R.methods, Z = R.name;
            this.states.push({ options: z, methods: W, index: T, name: Z });
          }
          return this.states;
        } }, { key: "restoreInteractionCoords", value: function(S) {
          var T = S.interaction, R = T.coords, z = T.rect, W = T.modification;
          if (W.result) {
            for (var Z = W.startDelta, ne = W.result, pe = ne.delta, we = ne.rectDelta, ge = 0, Ee = [[R.start, Z], [R.cur, pe]]; ge < Ee.length; ge++) {
              var Me = Ee[ge], Xe = Me[0], Je = Me[1];
              Xe.page.x -= Je.x, Xe.page.y -= Je.y, Xe.client.x -= Je.x, Xe.client.y -= Je.y;
            }
            z.left -= we.left, z.right -= we.right, z.top -= we.top, z.bottom -= we.bottom;
          }
        } }, { key: "shouldDo", value: function(S, T, R, z) {
          return !(!S || S.enabled === !1 || z && !S.endOnly || S.endOnly && !T || R === "start" && !S.setStart);
        } }, { key: "copyFrom", value: function(S) {
          this.startOffset = S.startOffset, this.startDelta = S.startDelta, this.startEdges = S.startEdges, this.edges = S.edges, this.states = S.states.map((function(T) {
            return Pi(T);
          })), this.result = Ql(ce({}, S.result.coords), ce({}, S.result.rect));
        } }, { key: "destroy", value: function() {
          for (var S in this) this[S] = null;
        } }]), x;
      })();
      function Ql(x, S) {
        return { rect: S, coords: x, delta: { x: 0, y: 0 }, rectDelta: { left: 0, right: 0, top: 0, bottom: 0 }, eventProps: [], changed: !0 };
      }
      function qo(x, S) {
        var T = x.defaults, R = { start: x.start, set: x.set, beforeEnd: x.beforeEnd, stop: x.stop }, z = function(W) {
          var Z = W || {};
          for (var ne in Z.enabled = Z.enabled !== !1, T) ne in Z || (Z[ne] = T[ne]);
          var pe = { options: Z, methods: R, name: S, enable: function() {
            return Z.enabled = !0, pe;
          }, disable: function() {
            return Z.enabled = !1, pe;
          } };
          return pe;
        };
        return S && typeof S == "string" && (z._defaults = T, z._methods = R), z;
      }
      function yo(x) {
        var S = x.iEvent, T = x.interaction.modification.result;
        T && (S.modifiers = T.eventProps);
      }
      var Ks = { id: "modifiers/base", before: ["actions"], install: function(x) {
        x.defaults.perAction.modifiers = [];
      }, listeners: { "interactions:new": function(x) {
        var S = x.interaction;
        S.modification = new jo(S);
      }, "interactions:before-action-start": function(x) {
        var S = x.interaction, T = x.interaction.modification;
        T.start(x, S.coords.start.page), S.edges = T.edges, T.applyToInteraction(x);
      }, "interactions:before-action-move": function(x) {
        var S = x.interaction, T = S.modification, R = T.setAndApply(x);
        return S.edges = T.edges, R;
      }, "interactions:before-action-end": function(x) {
        var S = x.interaction, T = S.modification, R = T.beforeEnd(x);
        return S.edges = T.startEdges, R;
      }, "interactions:action-start": yo, "interactions:action-move": yo, "interactions:action-end": yo, "interactions:after-action-start": function(x) {
        return x.interaction.modification.restoreInteractionCoords(x);
      }, "interactions:after-action-move": function(x) {
        return x.interaction.modification.restoreInteractionCoords(x);
      }, "interactions:stop": function(x) {
        return x.interaction.modification.stop(x);
      } } }, Xs = Ks, Zs = { base: { preventDefault: "auto", deltaSource: "page" }, perAction: { enabled: !1, origin: { x: 0, y: 0 } }, actions: {} }, Ja = (function(x) {
        u(T, x);
        var S = h(T);
        function T(R, z, W, Z, ne, pe, we) {
          var ge;
          r(this, T), (ge = S.call(this, R)).relatedTarget = null, ge.screenX = void 0, ge.screenY = void 0, ge.button = void 0, ge.buttons = void 0, ge.ctrlKey = void 0, ge.shiftKey = void 0, ge.altKey = void 0, ge.metaKey = void 0, ge.page = void 0, ge.client = void 0, ge.delta = void 0, ge.rect = void 0, ge.x0 = void 0, ge.y0 = void 0, ge.t0 = void 0, ge.dt = void 0, ge.duration = void 0, ge.clientX0 = void 0, ge.clientY0 = void 0, ge.velocity = void 0, ge.speed = void 0, ge.swipe = void 0, ge.axes = void 0, ge.preEnd = void 0, ne = ne || R.element;
          var Ee = R.interactable, Me = (Ee && Ee.options || Zs).deltaSource, Xe = ze(Ee, ne, W), Je = Z === "start", it = Z === "end", ct = Je ? f(ge) : R.prevEvent, ft = Je ? R.coords.start : it ? { page: ct.page, client: ct.client, timeStamp: R.coords.cur.timeStamp } : R.coords.cur;
          return ge.page = ce({}, ft.page), ge.client = ce({}, ft.client), ge.rect = ce({}, R.rect), ge.timeStamp = ft.timeStamp, it || (ge.page.x -= Xe.x, ge.page.y -= Xe.y, ge.client.x -= Xe.x, ge.client.y -= Xe.y), ge.ctrlKey = z.ctrlKey, ge.altKey = z.altKey, ge.shiftKey = z.shiftKey, ge.metaKey = z.metaKey, ge.button = z.button, ge.buttons = z.buttons, ge.target = ne, ge.currentTarget = ne, ge.preEnd = pe, ge.type = we || W + (Z || ""), ge.interactable = Ee, ge.t0 = Je ? R.pointers[R.pointers.length - 1].downTime : ct.t0, ge.x0 = R.coords.start.page.x - Xe.x, ge.y0 = R.coords.start.page.y - Xe.y, ge.clientX0 = R.coords.start.client.x - Xe.x, ge.clientY0 = R.coords.start.client.y - Xe.y, ge.delta = Je || it ? { x: 0, y: 0 } : { x: ge[Me].x - ct[Me].x, y: ge[Me].y - ct[Me].y }, ge.dt = R.coords.delta.timeStamp, ge.duration = ge.timeStamp - ge.t0, ge.velocity = ce({}, R.coords.velocity[Me]), ge.speed = Ne(ge.velocity.x, ge.velocity.y), ge.swipe = it || Z === "inertiastart" ? ge.getSwipe() : null, ge;
        }
        return l(T, [{ key: "getSwipe", value: function() {
          var R = this._interaction;
          if (R.prevEvent.speed < 600 || this.timeStamp - R.prevEvent.timeStamp > 150) return null;
          var z = 180 * Math.atan2(R.prevEvent.velocityY, R.prevEvent.velocityX) / Math.PI;
          z < 0 && (z += 360);
          var W = 112.5 <= z && z < 247.5, Z = 202.5 <= z && z < 337.5;
          return { up: Z, down: !Z && 22.5 <= z && z < 157.5, left: W, right: !W && (292.5 <= z || z < 67.5), angle: z, speed: R.prevEvent.speed, velocity: { x: R.prevEvent.velocityX, y: R.prevEvent.velocityY } };
        } }, { key: "preventDefault", value: function() {
        } }, { key: "stopImmediatePropagation", value: function() {
          this.immediatePropagationStopped = this.propagationStopped = !0;
        } }, { key: "stopPropagation", value: function() {
          this.propagationStopped = !0;
        } }]), T;
      })(mt);
      Object.defineProperties(Ja.prototype, { pageX: { get: function() {
        return this.page.x;
      }, set: function(x) {
        this.page.x = x;
      } }, pageY: { get: function() {
        return this.page.y;
      }, set: function(x) {
        this.page.y = x;
      } }, clientX: { get: function() {
        return this.client.x;
      }, set: function(x) {
        this.client.x = x;
      } }, clientY: { get: function() {
        return this.client.y;
      }, set: function(x) {
        this.client.y = x;
      } }, dx: { get: function() {
        return this.delta.x;
      }, set: function(x) {
        this.delta.x = x;
      } }, dy: { get: function() {
        return this.delta.y;
      }, set: function(x) {
        this.delta.y = x;
      } }, velocityX: { get: function() {
        return this.velocity.x;
      }, set: function(x) {
        this.velocity.x = x;
      } }, velocityY: { get: function() {
        return this.velocity.y;
      }, set: function(x) {
        this.velocity.y = x;
      } } });
      var pd = l((function x(S, T, R, z, W) {
        r(this, x), this.id = void 0, this.pointer = void 0, this.event = void 0, this.downTime = void 0, this.downTarget = void 0, this.id = S, this.pointer = T, this.event = R, this.downTime = z, this.downTarget = W;
      })), Ku = (function(x) {
        return x.interactable = "", x.element = "", x.prepared = "", x.pointerIsDown = "", x.pointerWasMoved = "", x._proxy = "", x;
      })({}), Dg = (function(x) {
        return x.start = "", x.move = "", x.end = "", x.stop = "", x.interacting = "", x;
      })({}), Gs = 0, gd = (function() {
        function x(S) {
          var T = this, R = S.pointerType, z = S.scopeFire;
          r(this, x), this.interactable = null, this.element = null, this.rect = null, this._rects = void 0, this.edges = null, this._scopeFire = void 0, this.prepared = { name: null, axis: null, edges: null }, this.pointerType = void 0, this.pointers = [], this.downEvent = null, this.downPointer = {}, this._latestPointer = { pointer: null, event: null, eventTarget: null }, this.prevEvent = null, this.pointerIsDown = !1, this.pointerWasMoved = !1, this._interacting = !1, this._ending = !1, this._stopped = !0, this._proxy = void 0, this.simulation = null, this.doMove = wn((function(ge) {
            this.move(ge);
          }), "The interaction.doMove() method has been renamed to interaction.move()"), this.coords = { start: { page: { x: 0, y: 0 }, client: { x: 0, y: 0 }, timeStamp: 0 }, prev: { page: { x: 0, y: 0 }, client: { x: 0, y: 0 }, timeStamp: 0 }, cur: { page: { x: 0, y: 0 }, client: { x: 0, y: 0 }, timeStamp: 0 }, delta: { page: { x: 0, y: 0 }, client: { x: 0, y: 0 }, timeStamp: 0 }, velocity: { page: { x: 0, y: 0 }, client: { x: 0, y: 0 }, timeStamp: 0 } }, this._id = Gs++, this._scopeFire = z, this.pointerType = R;
          var W = this;
          this._proxy = {};
          var Z = function(ge) {
            Object.defineProperty(T._proxy, ge, { get: function() {
              return W[ge];
            } });
          };
          for (var ne in Ku) Z(ne);
          var pe = function(ge) {
            Object.defineProperty(T._proxy, ge, { value: function() {
              return W[ge].apply(W, arguments);
            } });
          };
          for (var we in Dg) pe(we);
          this._scopeFire("interactions:new", { interaction: this });
        }
        return l(x, [{ key: "pointerMoveTolerance", get: function() {
          return 1;
        } }, { key: "pointerDown", value: function(S, T, R) {
          var z = this.updatePointer(S, T, R, !0), W = this.pointers[z];
          this._scopeFire("interactions:down", { pointer: S, event: T, eventTarget: R, pointerIndex: z, pointerInfo: W, type: "down", interaction: this });
        } }, { key: "start", value: function(S, T, R) {
          return !(this.interacting() || !this.pointerIsDown || this.pointers.length < (S.name === "gesture" ? 2 : 1) || !T.options[S.name].enabled) && (Gn(this.prepared, S), this.interactable = T, this.element = R, this.rect = T.getRect(R), this.edges = this.prepared.edges ? ce({}, this.prepared.edges) : { left: !0, right: !0, top: !0, bottom: !0 }, this._stopped = !1, this._interacting = this._doPhase({ interaction: this, event: this.downEvent, phase: "start" }) && !this._stopped, this._interacting);
        } }, { key: "pointerMove", value: function(S, T, R) {
          this.simulation || this.modification && this.modification.endResult || this.updatePointer(S, T, R, !1);
          var z, W, Z = this.coords.cur.page.x === this.coords.prev.page.x && this.coords.cur.page.y === this.coords.prev.page.y && this.coords.cur.client.x === this.coords.prev.client.x && this.coords.cur.client.y === this.coords.prev.client.y;
          this.pointerIsDown && !this.pointerWasMoved && (z = this.coords.cur.client.x - this.coords.start.client.x, W = this.coords.cur.client.y - this.coords.start.client.y, this.pointerWasMoved = Ne(z, W) > this.pointerMoveTolerance);
          var ne, pe, we, ge = this.getPointerIndex(S), Ee = { pointer: S, pointerIndex: ge, pointerInfo: this.pointers[ge], event: T, type: "move", eventTarget: R, dx: z, dy: W, duplicate: Z, interaction: this };
          Z || (ne = this.coords.velocity, pe = this.coords.delta, we = Math.max(pe.timeStamp / 1e3, 1e-3), ne.page.x = pe.page.x / we, ne.page.y = pe.page.y / we, ne.client.x = pe.client.x / we, ne.client.y = pe.client.y / we, ne.timeStamp = we), this._scopeFire("interactions:move", Ee), Z || this.simulation || (this.interacting() && (Ee.type = null, this.move(Ee)), this.pointerWasMoved && nt(this.coords.prev, this.coords.cur));
        } }, { key: "move", value: function(S) {
          S && S.event || Qe(this.coords.delta), (S = ce({ pointer: this._latestPointer.pointer, event: this._latestPointer.event, eventTarget: this._latestPointer.eventTarget, interaction: this }, S || {})).phase = "move", this._doPhase(S);
        } }, { key: "pointerUp", value: function(S, T, R, z) {
          var W = this.getPointerIndex(S);
          W === -1 && (W = this.updatePointer(S, T, R, !1));
          var Z = /cancel$/i.test(T.type) ? "cancel" : "up";
          this._scopeFire("interactions:".concat(Z), { pointer: S, pointerIndex: W, pointerInfo: this.pointers[W], event: T, eventTarget: R, type: Z, curEventTarget: z, interaction: this }), this.simulation || this.end(T), this.removePointer(S, T);
        } }, { key: "documentBlur", value: function(S) {
          this.end(S), this._scopeFire("interactions:blur", { event: S, type: "blur", interaction: this });
        } }, { key: "end", value: function(S) {
          var T;
          this._ending = !0, S = S || this._latestPointer.event, this.interacting() && (T = this._doPhase({ event: S, interaction: this, phase: "end" })), this._ending = !1, T === !0 && this.stop();
        } }, { key: "currentAction", value: function() {
          return this._interacting ? this.prepared.name : null;
        } }, { key: "interacting", value: function() {
          return this._interacting;
        } }, { key: "stop", value: function() {
          this._scopeFire("interactions:stop", { interaction: this }), this.interactable = this.element = null, this._interacting = !1, this._stopped = !0, this.prepared.name = this.prevEvent = null;
        } }, { key: "getPointerIndex", value: function(S) {
          var T = $e(S);
          return this.pointerType === "mouse" || this.pointerType === "pen" ? this.pointers.length - 1 : Et(this.pointers, (function(R) {
            return R.id === T;
          }));
        } }, { key: "getPointerInfo", value: function(S) {
          return this.pointers[this.getPointerIndex(S)];
        } }, { key: "updatePointer", value: function(S, T, R, z) {
          var W, Z, ne, pe = $e(S), we = this.getPointerIndex(S), ge = this.pointers[we];
          return z = z !== !1 && (z || /(down|start)$/i.test(T.type)), ge ? ge.pointer = S : (ge = new pd(pe, S, T, null, null), we = this.pointers.length, this.pointers.push(ge)), Le(this.coords.cur, this.pointers.map((function(Ee) {
            return Ee.pointer;
          })), this._now()), W = this.coords.delta, Z = this.coords.prev, ne = this.coords.cur, W.page.x = ne.page.x - Z.page.x, W.page.y = ne.page.y - Z.page.y, W.client.x = ne.client.x - Z.client.x, W.client.y = ne.client.y - Z.client.y, W.timeStamp = ne.timeStamp - Z.timeStamp, z && (this.pointerIsDown = !0, ge.downTime = this.coords.cur.timeStamp, ge.downTarget = R, We(this.downPointer, S), this.interacting() || (nt(this.coords.start, this.coords.cur), nt(this.coords.prev, this.coords.cur), this.downEvent = T, this.pointerWasMoved = !1)), this._updateLatestPointer(S, T, R), this._scopeFire("interactions:update-pointer", { pointer: S, event: T, eventTarget: R, down: z, pointerInfo: ge, pointerIndex: we, interaction: this }), we;
        } }, { key: "removePointer", value: function(S, T) {
          var R = this.getPointerIndex(S);
          if (R !== -1) {
            var z = this.pointers[R];
            this._scopeFire("interactions:remove-pointer", { pointer: S, event: T, eventTarget: null, pointerIndex: R, pointerInfo: z, interaction: this }), this.pointers.splice(R, 1), this.pointerIsDown = !1;
          }
        } }, { key: "_updateLatestPointer", value: function(S, T, R) {
          this._latestPointer.pointer = S, this._latestPointer.event = T, this._latestPointer.eventTarget = R;
        } }, { key: "destroy", value: function() {
          this._latestPointer.pointer = null, this._latestPointer.event = null, this._latestPointer.eventTarget = null;
        } }, { key: "_createPreparedEvent", value: function(S, T, R, z) {
          return new Ja(this, S, this.prepared.name, T, this.element, R, z);
        } }, { key: "_fireEvent", value: function(S) {
          var T;
          (T = this.interactable) == null || T.fire(S), (!this.prevEvent || S.timeStamp >= this.prevEvent.timeStamp) && (this.prevEvent = S);
        } }, { key: "_doPhase", value: function(S) {
          var T = S.event, R = S.phase, z = S.preEnd, W = S.type, Z = this.rect;
          if (Z && R === "move" && (ke(this.edges, Z, this.coords.delta[this.interactable.options.deltaSource]), Z.width = Z.right - Z.left, Z.height = Z.bottom - Z.top), this._scopeFire("interactions:before-action-".concat(R), S) === !1) return !1;
          var ne = S.iEvent = this._createPreparedEvent(T, R, z, W);
          return this._scopeFire("interactions:action-".concat(R), S), R === "start" && (this.prevEvent = ne), this._fireEvent(ne), this._scopeFire("interactions:after-action-".concat(R), S), !0;
        } }, { key: "_now", value: function() {
          return Date.now();
        } }]), x;
      })();
      function md(x) {
        Us(x.interaction);
      }
      function Us(x) {
        if (!(function(T) {
          return !(!T.offset.pending.x && !T.offset.pending.y);
        })(x)) return !1;
        var S = x.offset.pending;
        return el(x.coords.cur, S), el(x.coords.delta, S), ke(x.edges, x.rect, S), S.x = 0, S.y = 0, !0;
      }
      function ob(x) {
        var S = x.x, T = x.y;
        this.offset.pending.x += S, this.offset.pending.y += T, this.offset.total.x += S, this.offset.total.y += T;
      }
      function el(x, S) {
        var T = x.page, R = x.client, z = S.x, W = S.y;
        T.x += z, T.y += W, R.x += z, R.y += W;
      }
      Dg.offsetBy = "";
      var rb = { id: "offset", before: ["modifiers", "pointer-events", "actions", "inertia"], install: function(x) {
        x.Interaction.prototype.offsetBy = ob;
      }, listeners: { "interactions:new": function(x) {
        x.interaction.offset = { total: { x: 0, y: 0 }, pending: { x: 0, y: 0 } };
      }, "interactions:update-pointer": function(x) {
        return (function(S) {
          S.pointerIsDown && (el(S.coords.cur, S.offset.total), S.offset.pending.x = 0, S.offset.pending.y = 0);
        })(x.interaction);
      }, "interactions:before-action-start": md, "interactions:before-action-move": md, "interactions:before-action-end": function(x) {
        var S = x.interaction;
        if (Us(S)) return S.move({ offset: !0 }), S.end(), !1;
      }, "interactions:stop": function(x) {
        var S = x.interaction;
        S.offset.total.x = 0, S.offset.total.y = 0, S.offset.pending.x = 0, S.offset.pending.y = 0;
      } } }, mh = rb, vh = (function() {
        function x(S) {
          r(this, x), this.active = !1, this.isModified = !1, this.smoothEnd = !1, this.allowResume = !1, this.modification = void 0, this.modifierCount = 0, this.modifierArg = void 0, this.startCoords = void 0, this.t0 = 0, this.v0 = 0, this.te = 0, this.targetOffset = void 0, this.modifiedOffset = void 0, this.currentOffset = void 0, this.lambda_v0 = 0, this.one_ve_v0 = 0, this.timeout = void 0, this.interaction = void 0, this.interaction = S;
        }
        return l(x, [{ key: "start", value: function(S) {
          var T = this.interaction, R = Js(T);
          if (!R || !R.enabled) return !1;
          var z = T.coords.velocity.client, W = Ne(z.x, z.y), Z = this.modification || (this.modification = new jo(T));
          if (Z.copyFrom(T.modification), this.t0 = T._now(), this.allowResume = R.allowResume, this.v0 = W, this.currentOffset = { x: 0, y: 0 }, this.startCoords = T.coords.cur.page, this.modifierArg = Z.fillArg({ pageCoords: this.startCoords, preEnd: !0, phase: "inertiastart" }), this.t0 - T.coords.cur.timeStamp < 50 && W > R.minSpeed && W > R.endSpeed) this.startInertia();
          else {
            if (Z.result = Z.setAll(this.modifierArg), !Z.result.changed) return !1;
            this.startSmoothEnd();
          }
          return T.modification.result.rect = null, T.offsetBy(this.targetOffset), T._doPhase({ interaction: T, event: S, phase: "inertiastart" }), T.offsetBy({ x: -this.targetOffset.x, y: -this.targetOffset.y }), T.modification.result.rect = null, this.active = !0, T.simulation = this, !0;
        } }, { key: "startInertia", value: function() {
          var S = this, T = this.interaction.coords.velocity.client, R = Js(this.interaction), z = R.resistance, W = -Math.log(R.endSpeed / this.v0) / z;
          this.targetOffset = { x: (T.x - W) / z, y: (T.y - W) / z }, this.te = W, this.lambda_v0 = z / this.v0, this.one_ve_v0 = 1 - R.endSpeed / this.v0;
          var Z = this.modification, ne = this.modifierArg;
          ne.pageCoords = { x: this.startCoords.x + this.targetOffset.x, y: this.startCoords.y + this.targetOffset.y }, Z.result = Z.setAll(ne), Z.result.changed && (this.isModified = !0, this.modifiedOffset = { x: this.targetOffset.x + Z.result.delta.x, y: this.targetOffset.y + Z.result.delta.y }), this.onNextFrame((function() {
            return S.inertiaTick();
          }));
        } }, { key: "startSmoothEnd", value: function() {
          var S = this;
          this.smoothEnd = !0, this.isModified = !0, this.targetOffset = { x: this.modification.result.delta.x, y: this.modification.result.delta.y }, this.onNextFrame((function() {
            return S.smoothEndTick();
          }));
        } }, { key: "onNextFrame", value: function(S) {
          var T = this;
          this.timeout = Ln.request((function() {
            T.active && S();
          }));
        } }, { key: "inertiaTick", value: function() {
          var S, T, R, z, W, Z, ne, pe = this, we = this.interaction, ge = Js(we).resistance, Ee = (we._now() - this.t0) / 1e3;
          if (Ee < this.te) {
            var Me, Xe = 1 - (Math.exp(-ge * Ee) - this.lambda_v0) / this.one_ve_v0;
            this.isModified ? (S = 0, T = 0, R = this.targetOffset.x, z = this.targetOffset.y, W = this.modifiedOffset.x, Z = this.modifiedOffset.y, Me = { x: Hl(ne = Xe, S, R, W), y: Hl(ne, T, z, Z) }) : Me = { x: this.targetOffset.x * Xe, y: this.targetOffset.y * Xe };
            var Je = { x: Me.x - this.currentOffset.x, y: Me.y - this.currentOffset.y };
            this.currentOffset.x += Je.x, this.currentOffset.y += Je.y, we.offsetBy(Je), we.move(), this.onNextFrame((function() {
              return pe.inertiaTick();
            }));
          } else we.offsetBy({ x: this.modifiedOffset.x - this.currentOffset.x, y: this.modifiedOffset.y - this.currentOffset.y }), this.end();
        } }, { key: "smoothEndTick", value: function() {
          var S = this, T = this.interaction, R = T._now() - this.t0, z = Js(T).smoothEndDuration;
          if (R < z) {
            var W = { x: Wl(R, 0, this.targetOffset.x, z), y: Wl(R, 0, this.targetOffset.y, z) }, Z = { x: W.x - this.currentOffset.x, y: W.y - this.currentOffset.y };
            this.currentOffset.x += Z.x, this.currentOffset.y += Z.y, T.offsetBy(Z), T.move({ skipModifiers: this.modifierCount }), this.onNextFrame((function() {
              return S.smoothEndTick();
            }));
          } else T.offsetBy({ x: this.targetOffset.x - this.currentOffset.x, y: this.targetOffset.y - this.currentOffset.y }), this.end();
        } }, { key: "resume", value: function(S) {
          var T = S.pointer, R = S.event, z = S.eventTarget, W = this.interaction;
          W.offsetBy({ x: -this.currentOffset.x, y: -this.currentOffset.y }), W.updatePointer(T, R, z, !0), W._doPhase({ interaction: W, event: R, phase: "resume" }), nt(W.coords.prev, W.coords.cur), this.stop();
        } }, { key: "end", value: function() {
          this.interaction.move(), this.interaction.end(), this.stop();
        } }, { key: "stop", value: function() {
          this.active = this.smoothEnd = !1, this.interaction.simulation = null, Ln.cancel(this.timeout);
        } }]), x;
      })();
      function Js(x) {
        var S = x.interactable, T = x.prepared;
        return S && S.options && T.name && S.options[T.name].inertia;
      }
      var yh = { id: "inertia", before: ["modifiers", "actions"], install: function(x) {
        var S = x.defaults;
        x.usePlugin(mh), x.usePlugin(Xs), x.actions.phases.inertiastart = !0, x.actions.phases.resume = !0, S.perAction.inertia = { enabled: !1, resistance: 10, minSpeed: 100, endSpeed: 10, allowResume: !0, smoothEndDuration: 300 };
      }, listeners: { "interactions:new": function(x) {
        var S = x.interaction;
        S.inertia = new vh(S);
      }, "interactions:before-action-end": function(x) {
        var S = x.interaction, T = x.event;
        return (!S._interacting || S.simulation || !S.inertia.start(T)) && null;
      }, "interactions:down": function(x) {
        var S = x.interaction, T = x.eventTarget, R = S.inertia;
        if (R.active) for (var z = T; O.element(z); ) {
          if (z === S.element) {
            R.resume(x);
            break;
          }
          z = V(z);
        }
      }, "interactions:stop": function(x) {
        var S = x.interaction.inertia;
        S.active && S.stop();
      }, "interactions:before-action-resume": function(x) {
        var S = x.interaction.modification;
        S.stop(x), S.start(x, x.interaction.coords.cur.page), S.applyToInteraction(x);
      }, "interactions:before-action-inertiastart": function(x) {
        return x.interaction.modification.setAndApply(x);
      }, "interactions:action-resume": yo, "interactions:action-inertiastart": yo, "interactions:after-action-inertiastart": function(x) {
        return x.interaction.modification.restoreInteractionCoords(x);
      }, "interactions:after-action-resume": function(x) {
        return x.interaction.modification.restoreInteractionCoords(x);
      } } };
      function Hl(x, S, T, R) {
        var z = 1 - x;
        return z * z * S + 2 * z * x * T + x * x * R;
      }
      function Wl(x, S, T, R) {
        return -T * (x /= R) * (x - 2) + S;
      }
      var Ng = yh;
      function bh(x, S) {
        for (var T = 0; T < S.length; T++) {
          var R = S[T];
          if (x.immediatePropagationStopped) break;
          R(x);
        }
      }
      var jl = (function() {
        function x(S) {
          r(this, x), this.options = void 0, this.types = {}, this.propagationStopped = !1, this.immediatePropagationStopped = !1, this.global = void 0, this.options = ce({}, S || {});
        }
        return l(x, [{ key: "fire", value: function(S) {
          var T, R = this.global;
          (T = this.types[S.type]) && bh(S, T), !S.propagationStopped && R && (T = R[S.type]) && bh(S, T);
        } }, { key: "on", value: function(S, T) {
          var R = Re(S, T);
          for (S in R) this.types[S] = st(this.types[S] || [], R[S]);
        } }, { key: "off", value: function(S, T) {
          var R = Re(S, T);
          for (S in R) {
            var z = this.types[S];
            if (z && z.length) for (var W = 0, Z = R[S]; W < Z.length; W++) {
              var ne = Z[W], pe = z.indexOf(ne);
              pe !== -1 && z.splice(pe, 1);
            }
          }
        } }, { key: "getRect", value: function(S) {
          return null;
        } }]), x;
      })(), eu = (function() {
        function x(S) {
          r(this, x), this.currentTarget = void 0, this.originalEvent = void 0, this.type = void 0, this.originalEvent = S, We(this, S);
        }
        return l(x, [{ key: "preventOriginalDefault", value: function() {
          this.originalEvent.preventDefault();
        } }, { key: "stopPropagation", value: function() {
          this.originalEvent.stopPropagation();
        } }, { key: "stopImmediatePropagation", value: function() {
          this.originalEvent.stopImmediatePropagation();
        } }]), x;
      })();
      function tu(x) {
        return O.object(x) ? { capture: !!x.capture, passive: !!x.passive } : { capture: !!x, passive: !1 };
      }
      function Xu(x, S) {
        return x === S || (typeof x == "boolean" ? !!S.capture === x && !S.passive : !!x.capture == !!S.capture && !!x.passive == !!S.passive);
      }
      var fi = { id: "events", install: function(x) {
        var S, T = [], R = {}, z = [], W = { add: Z, remove: ne, addDelegate: function(ge, Ee, Me, Xe, Je) {
          var it = tu(Je);
          if (!R[Me]) {
            R[Me] = [];
            for (var ct = 0; ct < z.length; ct++) {
              var ft = z[ct];
              Z(ft, Me, pe), Z(ft, Me, we, !0);
            }
          }
          var $t = R[Me], Wt = It($t, (function(ln) {
            return ln.selector === ge && ln.context === Ee;
          }));
          Wt || (Wt = { selector: ge, context: Ee, listeners: [] }, $t.push(Wt)), Wt.listeners.push({ func: Xe, options: it });
        }, removeDelegate: function(ge, Ee, Me, Xe, Je) {
          var it, ct = tu(Je), ft = R[Me], $t = !1;
          if (ft)
            for (it = ft.length - 1; it >= 0; it--) {
              var Wt = ft[it];
              if (Wt.selector === ge && Wt.context === Ee) {
                for (var ln = Wt.listeners, Ft = ln.length - 1; Ft >= 0; Ft--) {
                  var Ut = ln[Ft];
                  if (Ut.func === Xe && Xu(Ut.options, ct)) {
                    ln.splice(Ft, 1), ln.length || (ft.splice(it, 1), ne(Ee, Me, pe), ne(Ee, Me, we, !0)), $t = !0;
                    break;
                  }
                }
                if ($t) break;
              }
            }
        }, delegateListener: pe, delegateUseCapture: we, delegatedEvents: R, documents: z, targets: T, supportsOptions: !1, supportsPassive: !1 };
        function Z(ge, Ee, Me, Xe) {
          if (ge.addEventListener) {
            var Je = tu(Xe), it = It(T, (function(ct) {
              return ct.eventTarget === ge;
            }));
            it || (it = { eventTarget: ge, events: {} }, T.push(it)), it.events[Ee] || (it.events[Ee] = []), It(it.events[Ee], (function(ct) {
              return ct.func === Me && Xu(ct.options, Je);
            })) || (ge.addEventListener(Ee, Me, W.supportsOptions ? Je : Je.capture), it.events[Ee].push({ func: Me, options: Je }));
          }
        }
        function ne(ge, Ee, Me, Xe) {
          if (ge.addEventListener && ge.removeEventListener) {
            var Je = Et(T, (function(Un) {
              return Un.eventTarget === ge;
            })), it = T[Je];
            if (it && it.events) if (Ee !== "all") {
              var ct = !1, ft = it.events[Ee];
              if (ft) {
                if (Me === "all") {
                  for (var $t = ft.length - 1; $t >= 0; $t--) {
                    var Wt = ft[$t];
                    ne(ge, Ee, Wt.func, Wt.options);
                  }
                  return;
                }
                for (var ln = tu(Xe), Ft = 0; Ft < ft.length; Ft++) {
                  var Ut = ft[Ft];
                  if (Ut.func === Me && Xu(Ut.options, ln)) {
                    ge.removeEventListener(Ee, Me, W.supportsOptions ? ln : ln.capture), ft.splice(Ft, 1), ft.length === 0 && (delete it.events[Ee], ct = !0);
                    break;
                  }
                }
              }
              ct && !Object.keys(it.events).length && T.splice(Je, 1);
            } else for (Ee in it.events) it.events.hasOwnProperty(Ee) && ne(ge, Ee, "all");
          }
        }
        function pe(ge, Ee) {
          for (var Me = tu(Ee), Xe = new eu(ge), Je = R[ge.type], it = at(ge)[0], ct = it; O.element(ct); ) {
            for (var ft = 0; ft < Je.length; ft++) {
              var $t = Je[ft], Wt = $t.selector, ln = $t.context;
              if (H(ct, Wt) && Q(ln, it) && Q(ln, ct)) {
                var Ft = $t.listeners;
                Xe.currentTarget = ct;
                for (var Ut = 0; Ut < Ft.length; Ut++) {
                  var Un = Ft[Ut];
                  Xu(Un.options, Me) && Un.func(Xe);
                }
              }
            }
            ct = V(ct);
          }
        }
        function we(ge) {
          return pe(ge, !0);
        }
        return (S = x.document) == null || S.createElement("div").addEventListener("test", null, { get capture() {
          return W.supportsOptions = !0;
        }, get passive() {
          return W.supportsPassive = !0;
        } }), x.events = W, W;
      } }, li = { methodOrder: ["simulationResume", "mouseOrPen", "hasPointer", "idle"], search: function(x) {
        for (var S = 0, T = li.methodOrder; S < T.length; S++) {
          var R = T[S], z = li[R](x);
          if (z) return z;
        }
        return null;
      }, simulationResume: function(x) {
        var S = x.pointerType, T = x.eventType, R = x.eventTarget, z = x.scope;
        if (!/down|start/i.test(T)) return null;
        for (var W = 0, Z = z.interactions.list; W < Z.length; W++) {
          var ne = Z[W], pe = R;
          if (ne.simulation && ne.simulation.allowResume && ne.pointerType === S) for (; pe; ) {
            if (pe === ne.element) return ne;
            pe = V(pe);
          }
        }
        return null;
      }, mouseOrPen: function(x) {
        var S, T = x.pointerId, R = x.pointerType, z = x.eventType, W = x.scope;
        if (R !== "mouse" && R !== "pen") return null;
        for (var Z = 0, ne = W.interactions.list; Z < ne.length; Z++) {
          var pe = ne[Z];
          if (pe.pointerType === R) {
            if (pe.simulation && !Oa(pe, T)) continue;
            if (pe.interacting()) return pe;
            S || (S = pe);
          }
        }
        if (S) return S;
        for (var we = 0, ge = W.interactions.list; we < ge.length; we++) {
          var Ee = ge[we];
          if (!(Ee.pointerType !== R || /down/i.test(z) && Ee.simulation)) return Ee;
        }
        return null;
      }, hasPointer: function(x) {
        for (var S = x.pointerId, T = 0, R = x.scope.interactions.list; T < R.length; T++) {
          var z = R[T];
          if (Oa(z, S)) return z;
        }
        return null;
      }, idle: function(x) {
        for (var S = x.pointerType, T = 0, R = x.scope.interactions.list; T < R.length; T++) {
          var z = R[T];
          if (z.pointers.length === 1) {
            var W = z.interactable;
            if (W && (!W.options.gesture || !W.options.gesture.enabled)) continue;
          } else if (z.pointers.length >= 2) continue;
          if (!z.interacting() && S === z.pointerType) return z;
        }
        return null;
      } };
      function Oa(x, S) {
        return x.pointers.some((function(T) {
          return T.id === S;
        }));
      }
      var oo = li, Vi = ["pointerDown", "pointerMove", "pointerUp", "updatePointer", "removePointer", "windowBlur"];
      function Yi(x, S) {
        return function(T) {
          var R = S.interactions.list, z = je(T), W = at(T), Z = W[0], ne = W[1], pe = [];
          if (/^touch/.test(T.type)) {
            S.prevTouchTime = S.now();
            for (var we = 0, ge = T.changedTouches; we < ge.length; we++) {
              var Ee = ge[we], Me = { pointer: Ee, pointerId: $e(Ee), pointerType: z, eventType: T.type, eventTarget: Z, curEventTarget: ne, scope: S }, Xe = si(Me);
              pe.push([Me.pointer, Me.eventTarget, Me.curEventTarget, Xe]);
            }
          } else {
            var Je = !1;
            if (!Y.supportsPointerEvent && /mouse/.test(T.type)) {
              for (var it = 0; it < R.length && !Je; it++) Je = R[it].pointerType !== "mouse" && R[it].pointerIsDown;
              Je = Je || S.now() - S.prevTouchTime < 500 || T.timeStamp === 0;
            }
            if (!Je) {
              var ct = { pointer: T, pointerId: $e(T), pointerType: z, eventType: T.type, curEventTarget: ne, eventTarget: Z, scope: S }, ft = si(ct);
              pe.push([ct.pointer, ct.eventTarget, ct.curEventTarget, ft]);
            }
          }
          for (var $t = 0; $t < pe.length; $t++) {
            var Wt = pe[$t], ln = Wt[0], Ft = Wt[1], Ut = Wt[2];
            Wt[3][x](ln, T, Ft, Ut);
          }
        };
      }
      function si(x) {
        var S = x.pointerType, T = x.scope, R = { interaction: oo.search(x), searchDetails: x };
        return T.fire("interactions:find", R), R.interaction || T.interactions.new({ pointerType: S });
      }
      function tl(x, S) {
        var T = x.doc, R = x.scope, z = x.options, W = R.interactions.docEvents, Z = R.events, ne = Z[S];
        for (var pe in R.browser.isIOS && !z.events && (z.events = { passive: !1 }), Z.delegatedEvents) ne(T, pe, Z.delegateListener), ne(T, pe, Z.delegateUseCapture, !0);
        for (var we = z && z.events, ge = 0; ge < W.length; ge++) {
          var Ee = W[ge];
          ne(T, Ee.type, Ee.listener, we);
        }
      }
      var vd = { id: "core/interactions", install: function(x) {
        for (var S = {}, T = 0; T < Vi.length; T++) {
          var R = Vi[T];
          S[R] = Yi(R, x);
        }
        var z, W = Y.pEventTypes;
        function Z() {
          for (var ne = 0, pe = x.interactions.list; ne < pe.length; ne++) {
            var we = pe[ne];
            if (we.pointerIsDown && we.pointerType === "touch" && !we._interacting) for (var ge = function() {
              var Xe = Me[Ee];
              x.documents.some((function(Je) {
                return Q(Je.doc, Xe.downTarget);
              })) || we.removePointer(Xe.pointer, Xe.event);
            }, Ee = 0, Me = we.pointers; Ee < Me.length; Ee++) ge();
          }
        }
        (z = j.PointerEvent ? [{ type: W.down, listener: Z }, { type: W.down, listener: S.pointerDown }, { type: W.move, listener: S.pointerMove }, { type: W.up, listener: S.pointerUp }, { type: W.cancel, listener: S.pointerUp }] : [{ type: "mousedown", listener: S.pointerDown }, { type: "mousemove", listener: S.pointerMove }, { type: "mouseup", listener: S.pointerUp }, { type: "touchstart", listener: Z }, { type: "touchstart", listener: S.pointerDown }, { type: "touchmove", listener: S.pointerMove }, { type: "touchend", listener: S.pointerUp }, { type: "touchcancel", listener: S.pointerUp }]).push({ type: "blur", listener: function(ne) {
          for (var pe = 0, we = x.interactions.list; pe < we.length; pe++)
            we[pe].documentBlur(ne);
        } }), x.prevTouchTime = 0, x.Interaction = (function(ne) {
          u(we, ne);
          var pe = h(we);
          function we() {
            return r(this, we), pe.apply(this, arguments);
          }
          return l(we, [{ key: "pointerMoveTolerance", get: function() {
            return x.interactions.pointerMoveTolerance;
          }, set: function(ge) {
            x.interactions.pointerMoveTolerance = ge;
          } }, { key: "_now", value: function() {
            return x.now();
          } }]), we;
        })(gd), x.interactions = { list: [], new: function(ne) {
          ne.scopeFire = function(we, ge) {
            return x.fire(we, ge);
          };
          var pe = new x.Interaction(ne);
          return x.interactions.list.push(pe), pe;
        }, listeners: S, docEvents: z, pointerMoveTolerance: 1 }, x.usePlugin(qs);
      }, listeners: { "scope:add-document": function(x) {
        return tl(x, "add");
      }, "scope:remove-document": function(x) {
        return tl(x, "remove");
      }, "interactable:unset": function(x, S) {
        for (var T = x.interactable, R = S.interactions.list.length - 1; R >= 0; R--) {
          var z = S.interactions.list[R];
          z.interactable === T && (z.stop(), S.fire("interactions:destroy", { interaction: z }), z.destroy(), S.interactions.list.length > 2 && S.interactions.list.splice(R, 1));
        }
      } }, onDocSignal: tl, doOnInteractions: Yi, methodNames: Vi }, ab = vd, ko = (function(x) {
        return x[x.On = 0] = "On", x[x.Off = 1] = "Off", x;
      })(ko || {}), qr = (function() {
        function x(S, T, R, z) {
          r(this, x), this.target = void 0, this.options = void 0, this._actions = void 0, this.events = new jl(), this._context = void 0, this._win = void 0, this._doc = void 0, this._scopeEvents = void 0, this._actions = T.actions, this.target = S, this._context = T.context || R, this._win = $(me(S) ? this._context : S), this._doc = this._win.document, this._scopeEvents = z, this.set(T);
        }
        return l(x, [{ key: "_defaults", get: function() {
          return { base: {}, perAction: {}, actions: {} };
        } }, { key: "setOnEvents", value: function(S, T) {
          return O.func(T.onstart) && this.on("".concat(S, "start"), T.onstart), O.func(T.onmove) && this.on("".concat(S, "move"), T.onmove), O.func(T.onend) && this.on("".concat(S, "end"), T.onend), O.func(T.oninertiastart) && this.on("".concat(S, "inertiastart"), T.oninertiastart), this;
        } }, { key: "updatePerActionListeners", value: function(S, T, R) {
          var z, W = this, Z = (z = this._actions.map[S]) == null ? void 0 : z.filterEventType, ne = function(pe) {
            return (Z == null || Z(pe)) && Ys(pe, W._actions);
          };
          (O.array(T) || O.object(T)) && this._onOff(ko.Off, S, T, void 0, ne), (O.array(R) || O.object(R)) && this._onOff(ko.On, S, R, void 0, ne);
        } }, { key: "setPerAction", value: function(S, T) {
          var R = this._defaults;
          for (var z in T) {
            var W = z, Z = this.options[S], ne = T[W];
            W === "listeners" && this.updatePerActionListeners(S, Z.listeners, ne), O.array(ne) ? Z[W] = gt(ne) : O.plainObject(ne) ? (Z[W] = ce(Z[W] || {}, Pi(ne)), O.object(R.perAction[W]) && "enabled" in R.perAction[W] && (Z[W].enabled = ne.enabled !== !1)) : O.bool(ne) && O.object(R.perAction[W]) ? Z[W].enabled = ne : Z[W] = ne;
          }
        } }, { key: "getRect", value: function(S) {
          return S = S || (O.element(this.target) ? this.target : null), O.string(this.target) && (S = S || this._context.querySelector(this.target)), te(S);
        } }, { key: "rectChecker", value: function(S) {
          var T = this;
          return O.func(S) ? (this.getRect = function(R) {
            var z = ce({}, S.apply(T, R));
            return "width" in z || (z.width = z.right - z.left, z.height = z.bottom - z.top), z;
          }, this) : S === null ? (delete this.getRect, this) : this.getRect;
        } }, { key: "_backCompatOption", value: function(S, T) {
          if (me(T) || O.object(T)) {
            for (var R in this.options[S] = T, this._actions.map) this.options[R][S] = T;
            return this;
          }
          return this.options[S];
        } }, { key: "origin", value: function(S) {
          return this._backCompatOption("origin", S);
        } }, { key: "deltaSource", value: function(S) {
          return S === "page" || S === "client" ? (this.options.deltaSource = S, this) : this.options.deltaSource;
        } }, { key: "getAllElements", value: function() {
          var S = this.target;
          return O.string(S) ? Array.from(this._context.querySelectorAll(S)) : O.func(S) && S.getAllElements ? S.getAllElements() : O.element(S) ? [S] : [];
        } }, { key: "context", value: function() {
          return this._context;
        } }, { key: "inContext", value: function(S) {
          return this._context === S.ownerDocument || Q(this._context, S);
        } }, { key: "testIgnoreAllow", value: function(S, T, R) {
          return !this.testIgnore(S.ignoreFrom, T, R) && this.testAllow(S.allowFrom, T, R);
        } }, { key: "testAllow", value: function(S, T, R) {
          return !S || !!O.element(R) && (O.string(S) ? ee(R, S, T) : !!O.element(S) && Q(S, R));
        } }, { key: "testIgnore", value: function(S, T, R) {
          return !(!S || !O.element(R)) && (O.string(S) ? ee(R, S, T) : !!O.element(S) && Q(S, R));
        } }, { key: "fire", value: function(S) {
          return this.events.fire(S), this;
        } }, { key: "_onOff", value: function(S, T, R, z, W) {
          O.object(T) && !O.array(T) && (z = R, R = null);
          var Z = Re(T, R, W);
          for (var ne in Z) {
            ne === "wheel" && (ne = Y.wheelEvent);
            for (var pe = 0, we = Z[ne]; pe < we.length; pe++) {
              var ge = we[pe];
              Ys(ne, this._actions) ? this.events[S === ko.On ? "on" : "off"](ne, ge) : O.string(this.target) ? this._scopeEvents[S === ko.On ? "addDelegate" : "removeDelegate"](this.target, this._context, ne, ge, z) : this._scopeEvents[S === ko.On ? "add" : "remove"](this.target, ne, ge, z);
            }
          }
          return this;
        } }, { key: "on", value: function(S, T, R) {
          return this._onOff(ko.On, S, T, R);
        } }, { key: "off", value: function(S, T, R) {
          return this._onOff(ko.Off, S, T, R);
        } }, { key: "set", value: function(S) {
          var T = this._defaults;
          for (var R in O.object(S) || (S = {}), this.options = Pi(T.base), this._actions.methodDict) {
            var z = R, W = this._actions.methodDict[z];
            this.options[z] = {}, this.setPerAction(z, ce(ce({}, T.perAction), T.actions[z])), this[W](S[z]);
          }
          for (var Z in S) Z !== "getRect" ? O.func(this[Z]) && this[Z](S[Z]) : this.rectChecker(S.getRect);
          return this;
        } }, { key: "unset", value: function() {
          if (O.string(this.target)) for (var S in this._scopeEvents.delegatedEvents) for (var T = this._scopeEvents.delegatedEvents[S], R = T.length - 1; R >= 0; R--) {
            var z = T[R], W = z.selector, Z = z.context, ne = z.listeners;
            W === this.target && Z === this._context && T.splice(R, 1);
            for (var pe = ne.length - 1; pe >= 0; pe--) this._scopeEvents.removeDelegate(this.target, this._context, S, ne[pe][0], ne[pe][1]);
          }
          else this._scopeEvents.remove(this.target, "all");
        } }]), x;
      })(), lb = (function() {
        function x(S) {
          var T = this;
          r(this, x), this.list = [], this.selectorMap = {}, this.scope = void 0, this.scope = S, S.addListeners({ "interactable:unset": function(R) {
            var z = R.interactable, W = z.target, Z = O.string(W) ? T.selectorMap[W] : W[T.scope.id], ne = Et(Z, (function(pe) {
              return pe === z;
            }));
            Z.splice(ne, 1);
          } });
        }
        return l(x, [{ key: "new", value: function(S, T) {
          T = ce(T || {}, { actions: this.scope.actions });
          var R = new this.scope.Interactable(S, T, this.scope.document, this.scope.events);
          return this.scope.addDocument(R._doc), this.list.push(R), O.string(S) ? (this.selectorMap[S] || (this.selectorMap[S] = []), this.selectorMap[S].push(R)) : (R.target[this.scope.id] || Object.defineProperty(S, this.scope.id, { value: [], configurable: !0 }), S[this.scope.id].push(R)), this.scope.fire("interactable:new", { target: S, options: T, interactable: R, win: this.scope._win }), R;
        } }, { key: "getExisting", value: function(S, T) {
          var R = T && T.context || this.scope.document, z = O.string(S), W = z ? this.selectorMap[S] : S[this.scope.id];
          if (W) return It(W, (function(Z) {
            return Z._context === R && (z || Z.inContext(S));
          }));
        } }, { key: "forEachMatch", value: function(S, T) {
          for (var R = 0, z = this.list; R < z.length; R++) {
            var W = z[R], Z = void 0;
            if ((O.string(W.target) ? O.element(S) && H(S, W.target) : S === W.target) && W.inContext(S) && (Z = T(W)), Z !== void 0) return Z;
          }
        } }]), x;
      })(), sb = (function() {
        function x() {
          var S = this;
          r(this, x), this.id = "__interact_scope_".concat(Math.floor(100 * Math.random())), this.isInitialized = !1, this.listenerMaps = [], this.browser = Y, this.defaults = Pi(Zs), this.Eventable = jl, this.actions = { map: {}, phases: { start: !0, move: !0, end: !0 }, methodDict: {}, phaselessTypes: {} }, this.interactStatic = (function(R) {
            var z = function W(Z, ne) {
              var pe = R.interactables.getExisting(Z, ne);
              return pe || ((pe = R.interactables.new(Z, ne)).events.global = W.globalEvents), pe;
            };
            return z.getPointerAverage = qe, z.getTouchBBox = rt, z.getTouchDistance = De, z.getTouchAngle = Be, z.getElementRect = te, z.getElementClientRect = ae, z.matchesSelector = H, z.closest = G, z.globalEvents = {}, z.version = "1.10.27", z.scope = R, z.use = function(W, Z) {
              return this.scope.usePlugin(W, Z), this;
            }, z.isSet = function(W, Z) {
              return !!this.scope.interactables.get(W, Z && Z.context);
            }, z.on = wn((function(W, Z, ne) {
              if (O.string(W) && W.search(" ") !== -1 && (W = W.trim().split(/ +/)), O.array(W)) {
                for (var pe = 0, we = W; pe < we.length; pe++) {
                  var ge = we[pe];
                  this.on(ge, Z, ne);
                }
                return this;
              }
              if (O.object(W)) {
                for (var Ee in W) this.on(Ee, W[Ee], Z);
                return this;
              }
              return Ys(W, this.scope.actions) ? this.globalEvents[W] ? this.globalEvents[W].push(Z) : this.globalEvents[W] = [Z] : this.scope.events.add(this.scope.document, W, Z, { options: ne }), this;
            }), "The interact.on() method is being deprecated"), z.off = wn((function(W, Z, ne) {
              if (O.string(W) && W.search(" ") !== -1 && (W = W.trim().split(/ +/)), O.array(W)) {
                for (var pe = 0, we = W; pe < we.length; pe++) {
                  var ge = we[pe];
                  this.off(ge, Z, ne);
                }
                return this;
              }
              if (O.object(W)) {
                for (var Ee in W) this.off(Ee, W[Ee], Z);
                return this;
              }
              var Me;
              return Ys(W, this.scope.actions) ? W in this.globalEvents && (Me = this.globalEvents[W].indexOf(Z)) !== -1 && this.globalEvents[W].splice(Me, 1) : this.scope.events.remove(this.scope.document, W, Z, ne), this;
            }), "The interact.off() method is being deprecated"), z.debug = function() {
              return this.scope;
            }, z.supportsTouch = function() {
              return Y.supportsTouch;
            }, z.supportsPointerEvent = function() {
              return Y.supportsPointerEvent;
            }, z.stop = function() {
              for (var W = 0, Z = this.scope.interactions.list; W < Z.length; W++) Z[W].stop();
              return this;
            }, z.pointerMoveTolerance = function(W) {
              return O.number(W) ? (this.scope.interactions.pointerMoveTolerance = W, this) : this.scope.interactions.pointerMoveTolerance;
            }, z.addDocument = function(W, Z) {
              this.scope.addDocument(W, Z);
            }, z.removeDocument = function(W) {
              this.scope.removeDocument(W);
            }, z;
          })(this), this.InteractEvent = Ja, this.Interactable = void 0, this.interactables = new lb(this), this._win = void 0, this.document = void 0, this.window = void 0, this.documents = [], this._plugins = { list: [], map: {} }, this.onWindowUnload = function(R) {
            return S.removeDocument(R.target);
          };
          var T = this;
          this.Interactable = (function(R) {
            u(W, R);
            var z = h(W);
            function W() {
              return r(this, W), z.apply(this, arguments);
            }
            return l(W, [{ key: "_defaults", get: function() {
              return T.defaults;
            } }, { key: "set", value: function(Z) {
              return p(c(W.prototype), "set", this).call(this, Z), T.fire("interactable:set", { options: Z, interactable: this }), this;
            } }, { key: "unset", value: function() {
              p(c(W.prototype), "unset", this).call(this);
              var Z = T.interactables.list.indexOf(this);
              Z < 0 || (T.interactables.list.splice(Z, 1), T.fire("interactable:unset", { interactable: this }));
            } }]), W;
          })(qr);
        }
        return l(x, [{ key: "addListeners", value: function(S, T) {
          this.listenerMaps.push({ id: T, map: S });
        } }, { key: "fire", value: function(S, T) {
          for (var R = 0, z = this.listenerMaps; R < z.length; R++) {
            var W = z[R].map[S];
            if (W && W(T, this, S) === !1) return !1;
          }
        } }, { key: "init", value: function(S) {
          return this.isInitialized ? this : (function(T, R) {
            return T.isInitialized = !0, O.window(R) && w(R), j.init(R), Y.init(R), Ln.init(R), T.window = R, T.document = R.document, T.usePlugin(ab), T.usePlugin(fi), T;
          })(this, S);
        } }, { key: "pluginIsInstalled", value: function(S) {
          var T = S.id;
          return T ? !!this._plugins.map[T] : this._plugins.list.indexOf(S) !== -1;
        } }, { key: "usePlugin", value: function(S, T) {
          if (!this.isInitialized) return this;
          if (this.pluginIsInstalled(S)) return this;
          if (S.id && (this._plugins.map[S.id] = S), this._plugins.list.push(S), S.install && S.install(this, T), S.listeners && S.before) {
            for (var R = 0, z = this.listenerMaps.length, W = S.before.reduce((function(ne, pe) {
              return ne[pe] = !0, ne[Lg(pe)] = !0, ne;
            }), {}); R < z; R++) {
              var Z = this.listenerMaps[R].id;
              if (Z && (W[Z] || W[Lg(Z)])) break;
            }
            this.listenerMaps.splice(R, 0, { id: S.id, map: S.listeners });
          } else S.listeners && this.listenerMaps.push({ id: S.id, map: S.listeners });
          return this;
        } }, { key: "addDocument", value: function(S, T) {
          if (this.getDocIndex(S) !== -1) return !1;
          var R = $(S);
          T = T ? ce({}, T) : {}, this.documents.push({ doc: S, options: T }), this.events.documents.push(S), S !== this.document && this.events.add(R, "unload", this.onWindowUnload), this.fire("scope:add-document", { doc: S, window: R, scope: this, options: T });
        } }, { key: "removeDocument", value: function(S) {
          var T = this.getDocIndex(S), R = $(S), z = this.documents[T].options;
          this.events.remove(R, "unload", this.onWindowUnload), this.documents.splice(T, 1), this.events.documents.splice(T, 1), this.fire("scope:remove-document", { doc: S, window: R, scope: this, options: z });
        } }, { key: "getDocIndex", value: function(S) {
          for (var T = 0; T < this.documents.length; T++) if (this.documents[T].doc === S) return T;
          return -1;
        } }, { key: "getDocOptions", value: function(S) {
          var T = this.getDocIndex(S);
          return T === -1 ? null : this.documents[T].options;
        } }, { key: "now", value: function() {
          return (this.window.Date || Date).now();
        } }]), x;
      })();
      function Lg(x) {
        return x && x.replace(/\/.*$/, "");
      }
      var zg = new sb(), wi = zg.interactStatic, nl = typeof globalThis < "u" ? globalThis : window;
      zg.init(nl);
      var ql = Object.freeze({ __proto__: null, edgeTarget: function() {
      }, elements: function() {
      }, grid: function(x) {
        var S = [["x", "y"], ["left", "top"], ["right", "bottom"], ["width", "height"]].filter((function(R) {
          var z = R[0], W = R[1];
          return z in x || W in x;
        })), T = function(R, z) {
          for (var W = x.range, Z = x.limits, ne = Z === void 0 ? { left: -1 / 0, right: 1 / 0, top: -1 / 0, bottom: 1 / 0 } : Z, pe = x.offset, we = pe === void 0 ? { x: 0, y: 0 } : pe, ge = { range: W, grid: x, x: null, y: null }, Ee = 0; Ee < S.length; Ee++) {
            var Me = S[Ee], Xe = Me[0], Je = Me[1], it = Math.round((R - we.x) / x[Xe]), ct = Math.round((z - we.y) / x[Je]);
            ge[Xe] = Math.max(ne.left, Math.min(ne.right, it * x[Xe] + we.x)), ge[Je] = Math.max(ne.top, Math.min(ne.bottom, ct * x[Je] + we.y));
          }
          return ge;
        };
        return T.grid = x, T.coordFields = S, T;
      } }), nu = { id: "snappers", install: function(x) {
        var S = x.interactStatic;
        S.snappers = ce(S.snappers || {}, ql), S.createSnapGrid = S.snappers.grid;
      } }, ub = nu, Yr = { start: function(x) {
        var S = x.state, T = x.rect, R = x.edges, z = x.pageCoords, W = S.options, Z = W.ratio, ne = W.enabled, pe = S.options, we = pe.equalDelta, ge = pe.modifiers;
        Z === "preserve" && (Z = T.width / T.height), S.startCoords = ce({}, z), S.startRect = ce({}, T), S.ratio = Z, S.equalDelta = we;
        var Ee = S.linkedEdges = { top: R.top || R.left && !R.bottom, left: R.left || R.top && !R.right, bottom: R.bottom || R.right && !R.top, right: R.right || R.bottom && !R.left };
        if (S.xIsPrimaryAxis = !(!R.left && !R.right), S.equalDelta) {
          var Me = (Ee.left ? 1 : -1) * (Ee.top ? 1 : -1);
          S.edgeSign = { x: Me, y: Me };
        } else S.edgeSign = { x: Ee.left ? -1 : 1, y: Ee.top ? -1 : 1 };
        if (ne !== !1 && ce(R, Ee), ge != null && ge.length) {
          var Xe = new jo(x.interaction);
          Xe.copyFrom(x.interaction.modification), Xe.prepareStates(ge), S.subModification = Xe, Xe.startAll(i({}, x));
        }
      }, set: function(x) {
        var S = x.state, T = x.rect, R = x.coords, z = S.linkedEdges, W = ce({}, R), Z = S.equalDelta ? cb : Bg;
        if (ce(x.edges, z), Z(S, S.xIsPrimaryAxis, R, T), !S.subModification) return null;
        var ne = ce({}, T);
        ke(z, ne, { x: R.x - W.x, y: R.y - W.y });
        var pe = S.subModification.setAll(i(i({}, x), {}, { rect: ne, edges: z, pageCoords: R, prevCoords: R, prevRect: ne })), we = pe.delta;
        return pe.changed && (Z(S, Math.abs(we.x) > Math.abs(we.y), pe.coords, pe.rect), ce(R, pe.coords)), pe.eventProps;
      }, defaults: { ratio: "preserve", equalDelta: !1, modifiers: [], enabled: !1 } };
      function cb(x, S, T) {
        var R = x.startCoords, z = x.edgeSign;
        S ? T.y = R.y + (T.x - R.x) * z.y : T.x = R.x + (T.y - R.y) * z.x;
      }
      function Bg(x, S, T, R) {
        var z = x.startRect, W = x.startCoords, Z = x.ratio, ne = x.edgeSign;
        if (S) {
          var pe = R.width / Z;
          T.y = W.y + (pe - z.height) * ne.y;
        } else {
          var we = R.height * Z;
          T.x = W.x + (we - z.width) * ne.x;
        }
      }
      var Fg = qo(Yr, "aspectRatio"), iu = function() {
      };
      iu._defaults = {};
      var il = iu;
      function Yl(x, S, T) {
        return O.func(x) ? fe(x, S.interactable, S.element, [T.x, T.y, S]) : fe(x, S.interactable, S.element);
      }
      var ou = { start: function(x) {
        var S = x.rect, T = x.startOffset, R = x.state, z = x.interaction, W = x.pageCoords, Z = R.options, ne = Z.elementRect, pe = ce({ left: 0, top: 0, right: 0, bottom: 0 }, Z.offset || {});
        if (S && ne) {
          var we = Yl(Z.restriction, z, W);
          if (we) {
            var ge = we.right - we.left - S.width, Ee = we.bottom - we.top - S.height;
            ge < 0 && (pe.left += ge, pe.right += ge), Ee < 0 && (pe.top += Ee, pe.bottom += Ee);
          }
          pe.left += T.left - S.width * ne.left, pe.top += T.top - S.height * ne.top, pe.right += T.right - S.width * (1 - ne.right), pe.bottom += T.bottom - S.height * (1 - ne.bottom);
        }
        R.offset = pe;
      }, set: function(x) {
        var S = x.coords, T = x.interaction, R = x.state, z = R.options, W = R.offset, Z = Yl(z.restriction, T, S);
        if (Z) {
          var ne = (function(pe) {
            return !pe || "left" in pe && "top" in pe || ((pe = ce({}, pe)).left = pe.x || 0, pe.top = pe.y || 0, pe.right = pe.right || pe.left + pe.width, pe.bottom = pe.bottom || pe.top + pe.height), pe;
          })(Z);
          S.x = Math.max(Math.min(ne.right - W.right, S.x), ne.left + W.left), S.y = Math.max(Math.min(ne.bottom - W.bottom, S.y), ne.top + W.top);
        }
      }, defaults: { restriction: null, elementRect: null, offset: null, endOnly: !1, enabled: !1 } }, db = qo(ou, "restrict"), ol = { top: 1 / 0, left: 1 / 0, bottom: -1 / 0, right: -1 / 0 }, Sa = { top: -1 / 0, left: -1 / 0, bottom: 1 / 0, right: 1 / 0 };
      function ru(x, S) {
        for (var T = 0, R = ["top", "left", "bottom", "right"]; T < R.length; T++) {
          var z = R[T];
          z in x || (x[z] = S[z]);
        }
        return x;
      }
      var au = { noInner: ol, noOuter: Sa, start: function(x) {
        var S, T = x.interaction, R = x.startOffset, z = x.state, W = z.options;
        W && (S = he(Yl(W.offset, T, T.coords.start.page))), S = S || { x: 0, y: 0 }, z.offset = { top: S.y + R.top, left: S.x + R.left, bottom: S.y - R.bottom, right: S.x - R.right };
      }, set: function(x) {
        var S = x.coords, T = x.edges, R = x.interaction, z = x.state, W = z.offset, Z = z.options;
        if (T) {
          var ne = ce({}, S), pe = Yl(Z.inner, R, ne) || {}, we = Yl(Z.outer, R, ne) || {};
          ru(pe, ol), ru(we, Sa), T.top ? S.y = Math.min(Math.max(we.top + W.top, ne.y), pe.top + W.top) : T.bottom && (S.y = Math.max(Math.min(we.bottom + W.bottom, ne.y), pe.bottom + W.bottom)), T.left ? S.x = Math.min(Math.max(we.left + W.left, ne.x), pe.left + W.left) : T.right && (S.x = Math.max(Math.min(we.right + W.right, ne.x), pe.right + W.right));
        }
      }, defaults: { inner: null, outer: null, offset: null, endOnly: !1, enabled: !1 } }, xh = qo(au, "restrictEdges"), Oh = ce({ get elementRect() {
        return { top: 0, left: 0, bottom: 1, right: 1 };
      }, set elementRect(x) {
      } }, ou.defaults), yd = qo({ start: ou.start, set: ou.set, defaults: Oh }, "restrictRect"), Vg = { width: -1 / 0, height: -1 / 0 }, Qg = { width: 1 / 0, height: 1 / 0 }, Hg = qo({ start: function(x) {
        return au.start(x);
      }, set: function(x) {
        var S = x.interaction, T = x.state, R = x.rect, z = x.edges, W = T.options;
        if (z) {
          var Z = le(Yl(W.min, S, x.coords)) || Vg, ne = le(Yl(W.max, S, x.coords)) || Qg;
          T.options = { endOnly: W.endOnly, inner: ce({}, au.noInner), outer: ce({}, au.noOuter) }, z.top ? (T.options.inner.top = R.bottom - Z.height, T.options.outer.top = R.bottom - ne.height) : z.bottom && (T.options.inner.bottom = R.top + Z.height, T.options.outer.bottom = R.top + ne.height), z.left ? (T.options.inner.left = R.right - Z.width, T.options.outer.left = R.right - ne.width) : z.right && (T.options.inner.right = R.left + Z.width, T.options.outer.right = R.left + ne.width), au.set(x), T.options = W;
        }
      }, defaults: { min: null, max: null, endOnly: !1, enabled: !1 } }, "restrictSize"), bd = { start: function(x) {
        var S, T = x.interaction, R = x.interactable, z = x.element, W = x.rect, Z = x.state, ne = x.startOffset, pe = Z.options, we = pe.offsetWithOrigin ? (function(Me) {
          var Xe = Me.interaction.element, Je = he(fe(Me.state.options.origin, null, null, [Xe])), it = Je || ze(Me.interactable, Xe, Me.interaction.prepared.name);
          return it;
        })(x) : { x: 0, y: 0 };
        if (pe.offset === "startCoords") S = { x: T.coords.start.page.x, y: T.coords.start.page.y };
        else {
          var ge = fe(pe.offset, R, z, [T]);
          (S = he(ge) || { x: 0, y: 0 }).x += we.x, S.y += we.y;
        }
        var Ee = pe.relativePoints;
        Z.offsets = W && Ee && Ee.length ? Ee.map((function(Me, Xe) {
          return { index: Xe, relativePoint: Me, x: ne.left - W.width * Me.x + S.x, y: ne.top - W.height * Me.y + S.y };
        })) : [{ index: 0, relativePoint: null, x: S.x, y: S.y }];
      }, set: function(x) {
        var S = x.interaction, T = x.coords, R = x.state, z = R.options, W = R.offsets, Z = ze(S.interactable, S.element, S.prepared.name), ne = ce({}, T), pe = [];
        z.offsetWithOrigin || (ne.x -= Z.x, ne.y -= Z.y);
        for (var we = 0, ge = W; we < ge.length; we++) for (var Ee = ge[we], Me = ne.x - Ee.x, Xe = ne.y - Ee.y, Je = 0, it = z.targets.length; Je < it; Je++) {
          var ct = z.targets[Je], ft = void 0;
          (ft = O.func(ct) ? ct(Me, Xe, S._proxy, Ee, Je) : ct) && pe.push({ x: (O.number(ft.x) ? ft.x : Me) + Ee.x, y: (O.number(ft.y) ? ft.y : Xe) + Ee.y, range: O.number(ft.range) ? ft.range : z.range, source: ct, index: Je, offset: Ee });
        }
        for (var $t = { target: null, inRange: !1, distance: 0, range: 0, delta: { x: 0, y: 0 } }, Wt = 0; Wt < pe.length; Wt++) {
          var ln = pe[Wt], Ft = ln.range, Ut = ln.x - ne.x, Un = ln.y - ne.y, Dn = Ne(Ut, Un), oi = Dn <= Ft;
          Ft === 1 / 0 && $t.inRange && $t.range !== 1 / 0 && (oi = !1), $t.target && !(oi ? $t.inRange && Ft !== 1 / 0 ? Dn / Ft < $t.distance / $t.range : Ft === 1 / 0 && $t.range !== 1 / 0 || Dn < $t.distance : !$t.inRange && Dn < $t.distance) || ($t.target = ln, $t.distance = Dn, $t.range = Ft, $t.inRange = oi, $t.delta.x = Ut, $t.delta.y = Un);
        }
        return $t.inRange && (T.x = $t.target.x, T.y = $t.target.y), R.closest = $t, $t;
      }, defaults: { range: 1 / 0, targets: null, offset: null, offsetWithOrigin: !0, origin: null, relativePoints: null, endOnly: !1, enabled: !1 } }, Wg = qo(bd, "snap"), Zu = { start: function(x) {
        var S = x.state, T = x.edges, R = S.options;
        if (!T) return null;
        x.state = { options: { targets: null, relativePoints: [{ x: T.left ? 0 : 1, y: T.top ? 0 : 1 }], offset: R.offset || "self", origin: { x: 0, y: 0 }, range: R.range } }, S.targetFields = S.targetFields || [["width", "height"], ["x", "y"]], bd.start(x), S.offsets = x.state.offsets, x.state = S;
      }, set: function(x) {
        var S = x.interaction, T = x.state, R = x.coords, z = T.options, W = T.offsets, Z = { x: R.x - W[0].x, y: R.y - W[0].y };
        T.options = ce({}, z), T.options.targets = [];
        for (var ne = 0, pe = z.targets || []; ne < pe.length; ne++) {
          var we = pe[ne], ge = void 0;
          if (ge = O.func(we) ? we(Z.x, Z.y, S) : we) {
            for (var Ee = 0, Me = T.targetFields; Ee < Me.length; Ee++) {
              var Xe = Me[Ee], Je = Xe[0], it = Xe[1];
              if (Je in ge || it in ge) {
                ge.x = ge[Je], ge.y = ge[it];
                break;
              }
            }
            T.options.targets.push(ge);
          }
        }
        var ct = bd.set(x);
        return T.options = z, ct;
      }, defaults: { range: 1 / 0, targets: null, offset: null, endOnly: !1, enabled: !1 } }, fb = qo(Zu, "snapSize"), xd = { aspectRatio: Fg, restrictEdges: xh, restrict: db, restrictRect: yd, restrictSize: Hg, snapEdges: qo({ start: function(x) {
        var S = x.edges;
        return S ? (x.state.targetFields = x.state.targetFields || [[S.left ? "left" : "right", S.top ? "top" : "bottom"]], Zu.start(x)) : null;
      }, set: Zu.set, defaults: ce(Pi(Zu.defaults), { targets: void 0, range: void 0, offset: { x: 0, y: 0 } }) }, "snapEdges"), snap: Wg, snapSize: fb, spring: il, avoid: il, transform: il, rubberband: il }, jg = { id: "modifiers", install: function(x) {
        var S = x.interactStatic;
        for (var T in x.usePlugin(Xs), x.usePlugin(ub), S.modifiers = xd, xd) {
          var R = xd[T], z = R._defaults, W = R._methods;
          z._methods = W, x.defaults.perAction[T] = z;
        }
      } }, lu = jg, Gu = (function(x) {
        u(T, x);
        var S = h(T);
        function T(R, z, W, Z, ne, pe) {
          var we;
          if (r(this, T), We(f(we = S.call(this, ne)), W), W !== z && We(f(we), z), we.timeStamp = pe, we.originalEvent = W, we.type = R, we.pointerId = $e(z), we.pointerType = je(z), we.target = Z, we.currentTarget = null, R === "tap") {
            var ge = ne.getPointerIndex(z);
            we.dt = we.timeStamp - ne.pointers[ge].downTime;
            var Ee = we.timeStamp - ne.tapTime;
            we.double = !!ne.prevTap && ne.prevTap.type !== "doubletap" && ne.prevTap.target === we.target && Ee < 500;
          } else R === "doubletap" && (we.dt = z.timeStamp - ne.tapTime, we.double = !0);
          return we;
        }
        return l(T, [{ key: "_subtractOrigin", value: function(R) {
          var z = R.x, W = R.y;
          return this.pageX -= z, this.pageY -= W, this.clientX -= z, this.clientY -= W, this;
        } }, { key: "_addOrigin", value: function(R) {
          var z = R.x, W = R.y;
          return this.pageX += z, this.pageY += W, this.clientX += z, this.clientY += W, this;
        } }, { key: "preventDefault", value: function() {
          this.originalEvent.preventDefault();
        } }]), T;
      })(mt), Ei = { id: "pointer-events/base", before: ["inertia", "modifiers", "auto-start", "actions"], install: function(x) {
        x.pointerEvents = Ei, x.defaults.actions.pointerEvents = Ei.defaults, ce(x.actions.phaselessTypes, Ei.types);
      }, listeners: { "interactions:new": function(x) {
        var S = x.interaction;
        S.prevTap = null, S.tapTime = 0;
      }, "interactions:update-pointer": function(x) {
        var S = x.down, T = x.pointerInfo;
        !S && T.hold || (T.hold = { duration: 1 / 0, timeout: null });
      }, "interactions:move": function(x, S) {
        var T = x.interaction, R = x.pointer, z = x.event, W = x.eventTarget;
        x.duplicate || T.pointerIsDown && !T.pointerWasMoved || (T.pointerIsDown && Od(x), wa({ interaction: T, pointer: R, event: z, eventTarget: W, type: "move" }, S));
      }, "interactions:down": function(x, S) {
        (function(T, R) {
          for (var z = T.interaction, W = T.pointer, Z = T.event, ne = T.eventTarget, pe = T.pointerIndex, we = z.pointers[pe].hold, ge = U(ne), Ee = { interaction: z, pointer: W, event: Z, eventTarget: ne, type: "hold", targets: [], path: ge, node: null }, Me = 0; Me < ge.length; Me++) {
            var Xe = ge[Me];
            Ee.node = Xe, R.fire("pointerEvents:collect-targets", Ee);
          }
          if (Ee.targets.length) {
            for (var Je = 1 / 0, it = 0, ct = Ee.targets; it < ct.length; it++) {
              var ft = ct[it].eventable.options.holdDuration;
              ft < Je && (Je = ft);
            }
            we.duration = Je, we.timeout = setTimeout((function() {
              wa({ interaction: z, eventTarget: ne, pointer: W, event: Z, type: "hold" }, R);
            }), Je);
          }
        })(x, S), wa(x, S);
      }, "interactions:up": function(x, S) {
        Od(x), wa(x, S), (function(T, R) {
          var z = T.interaction, W = T.pointer, Z = T.event, ne = T.eventTarget;
          z.pointerWasMoved || wa({ interaction: z, eventTarget: ne, pointer: W, event: Z, type: "tap" }, R);
        })(x, S);
      }, "interactions:cancel": function(x, S) {
        Od(x), wa(x, S);
      } }, PointerEvent: Gu, fire: wa, collectEventTargets: Di, defaults: { holdDuration: 600, ignoreFrom: null, allowFrom: null, origin: { x: 0, y: 0 } }, types: { down: !0, move: !0, up: !0, cancel: !0, tap: !0, doubletap: !0, hold: !0 } };
      function wa(x, S) {
        var T = x.interaction, R = x.pointer, z = x.event, W = x.eventTarget, Z = x.type, ne = x.targets, pe = ne === void 0 ? Di(x, S) : ne, we = new Gu(Z, R, z, W, T, S.now());
        S.fire("pointerEvents:new", { pointerEvent: we });
        for (var ge = { interaction: T, pointer: R, event: z, eventTarget: W, targets: pe, type: Z, pointerEvent: we }, Ee = 0; Ee < pe.length; Ee++) {
          var Me = pe[Ee];
          for (var Xe in Me.props || {}) we[Xe] = Me.props[Xe];
          var Je = ze(Me.eventable, Me.node);
          if (we._subtractOrigin(Je), we.eventable = Me.eventable, we.currentTarget = Me.node, Me.eventable.fire(we), we._addOrigin(Je), we.immediatePropagationStopped || we.propagationStopped && Ee + 1 < pe.length && pe[Ee + 1].node !== we.currentTarget) break;
        }
        if (S.fire("pointerEvents:fired", ge), Z === "tap") {
          var it = we.double ? wa({ interaction: T, pointer: R, event: z, eventTarget: W, type: "doubletap" }, S) : we;
          T.prevTap = it, T.tapTime = it.timeStamp;
        }
        return we;
      }
      function Di(x, S) {
        var T = x.interaction, R = x.pointer, z = x.event, W = x.eventTarget, Z = x.type, ne = T.getPointerIndex(R), pe = T.pointers[ne];
        if (Z === "tap" && (T.pointerWasMoved || !pe || pe.downTarget !== W)) return [];
        for (var we = U(W), ge = { interaction: T, pointer: R, event: z, eventTarget: W, type: Z, path: we, targets: [], node: null }, Ee = 0; Ee < we.length; Ee++) {
          var Me = we[Ee];
          ge.node = Me, S.fire("pointerEvents:collect-targets", ge);
        }
        return Z === "hold" && (ge.targets = ge.targets.filter((function(Xe) {
          var Je, it;
          return Xe.eventable.options.holdDuration === ((Je = T.pointers[ne]) == null || (it = Je.hold) == null ? void 0 : it.duration);
        }))), ge.targets;
      }
      function Od(x) {
        var S = x.interaction, T = x.pointerIndex, R = S.pointers[T].hold;
        R && R.timeout && (clearTimeout(R.timeout), R.timeout = null);
      }
      var Sh = Object.freeze({ __proto__: null, default: Ei });
      function Uu(x) {
        var S = x.interaction;
        S.holdIntervalHandle && (clearInterval(S.holdIntervalHandle), S.holdIntervalHandle = null);
      }
      var hb = { id: "pointer-events/holdRepeat", install: function(x) {
        x.usePlugin(Ei);
        var S = x.pointerEvents;
        S.defaults.holdRepeatInterval = 0, S.types.holdrepeat = x.actions.phaselessTypes.holdrepeat = !0;
      }, listeners: ["move", "up", "cancel", "endall"].reduce((function(x, S) {
        return x["pointerEvents:".concat(S)] = Uu, x;
      }), { "pointerEvents:new": function(x) {
        var S = x.pointerEvent;
        S.type === "hold" && (S.count = (S.count || 0) + 1);
      }, "pointerEvents:fired": function(x, S) {
        var T = x.interaction, R = x.pointerEvent, z = x.eventTarget, W = x.targets;
        if (R.type === "hold" && W.length) {
          var Z = W[0].eventable.options.holdRepeatInterval;
          Z <= 0 || (T.holdIntervalHandle = setTimeout((function() {
            S.pointerEvents.fire({ interaction: T, eventTarget: z, type: "hold", pointer: R, event: R }, S);
          }), Z));
        }
      } }) }, pb = hb, wh = { id: "pointer-events/interactableTargets", install: function(x) {
        var S = x.Interactable;
        S.prototype.pointerEvents = function(R) {
          return ce(this.events.options, R), this;
        };
        var T = S.prototype._backCompatOption;
        S.prototype._backCompatOption = function(R, z) {
          var W = T.call(this, R, z);
          return W === this && (this.events.options[R] = z), W;
        };
      }, listeners: { "pointerEvents:collect-targets": function(x, S) {
        var T = x.targets, R = x.node, z = x.type, W = x.eventTarget;
        S.interactables.forEachMatch(R, (function(Z) {
          var ne = Z.events, pe = ne.options;
          ne.types[z] && ne.types[z].length && Z.testIgnoreAllow(pe, R, W) && T.push({ node: R, eventable: ne, props: { interactable: Z } });
        }));
      }, "interactable:new": function(x) {
        var S = x.interactable;
        S.events.getRect = function(T) {
          return S.getRect(T);
        };
      }, "interactable:set": function(x, S) {
        var T = x.interactable, R = x.options;
        ce(T.events.options, S.pointerEvents.defaults), ce(T.events.options, R.pointerEvents || {});
      } } }, X = wh, oe = { id: "pointer-events", install: function(x) {
        x.usePlugin(Sh), x.usePlugin(pb), x.usePlugin(X);
      } }, xe = oe, Se = { id: "reflow", install: function(x) {
        var S = x.Interactable;
        x.actions.phases.reflow = !0, S.prototype.reflow = function(T) {
          return (function(R, z, W) {
            for (var Z = R.getAllElements(), ne = W.window.Promise, pe = ne ? [] : null, we = function() {
              var Ee = Z[ge], Me = R.getRect(Ee);
              if (!Me) return 1;
              var Xe, Je = It(W.interactions.list, (function(ft) {
                return ft.interacting() && ft.interactable === R && ft.element === Ee && ft.prepared.name === z.name;
              }));
              if (Je) Je.move(), pe && (Xe = Je._reflowPromise || new ne((function(ft) {
                Je._reflowResolve = ft;
              })));
              else {
                var it = le(Me), ct = /* @__PURE__ */ (function(ft) {
                  return { coords: ft, get page() {
                    return this.coords.page;
                  }, get client() {
                    return this.coords.client;
                  }, get timeStamp() {
                    return this.coords.timeStamp;
                  }, get pageX() {
                    return this.coords.page.x;
                  }, get pageY() {
                    return this.coords.page.y;
                  }, get clientX() {
                    return this.coords.client.x;
                  }, get clientY() {
                    return this.coords.client.y;
                  }, get pointerId() {
                    return this.coords.pointerId;
                  }, get target() {
                    return this.coords.target;
                  }, get type() {
                    return this.coords.type;
                  }, get pointerType() {
                    return this.coords.pointerType;
                  }, get buttons() {
                    return this.coords.buttons;
                  }, preventDefault: function() {
                  } };
                })({ page: { x: it.x, y: it.y }, client: { x: it.x, y: it.y }, timeStamp: W.now() });
                Xe = (function(ft, $t, Wt, ln, Ft) {
                  var Ut = ft.interactions.new({ pointerType: "reflow" }), Un = { interaction: Ut, event: Ft, pointer: Ft, eventTarget: Wt, phase: "reflow" };
                  Ut.interactable = $t, Ut.element = Wt, Ut.prevEvent = Ft, Ut.updatePointer(Ft, Ft, Wt, !0), Qe(Ut.coords.delta), Gn(Ut.prepared, ln), Ut._doPhase(Un);
                  var Dn = ft.window, oi = Dn.Promise, hi = oi ? new oi((function(Ni) {
                    Ut._reflowResolve = Ni;
                  })) : void 0;
                  return Ut._reflowPromise = hi, Ut.start(ln, $t, Wt), Ut._interacting ? (Ut.move(Un), Ut.end(Ft)) : (Ut.stop(), Ut._reflowResolve()), Ut.removePointer(Ft, Ft), hi;
                })(W, R, Ee, z, ct);
              }
              pe && pe.push(Xe);
            }, ge = 0; ge < Z.length && !we(); ge++) ;
            return pe && ne.all(pe).then((function() {
              return R;
            }));
          })(this, T, x);
        };
      }, listeners: { "interactions:stop": function(x, S) {
        var T = x.interaction;
        T.pointerType === "reflow" && (T._reflowResolve && T._reflowResolve(), (function(R, z) {
          R.splice(R.indexOf(z), 1);
        })(S.interactions.list, T));
      } } }, Ie = Se;
      if (wi.use(qs), wi.use(mh), wi.use(xe), wi.use(Ng), wi.use(lu), wi.use(js), wi.use(yi), wi.use(Zn), wi.use(Ie), wi.default = wi, o(t) === "object" && t) try {
        t.exports = wi;
      } catch {
      }
      return wi.default = wi, wi;
    }));
  })(Xh, Xh.exports)), Xh.exports;
}
var qde = /* @__PURE__ */ jde();
const oI = /* @__PURE__ */ NQ(qde), rI = /* @__PURE__ */ Oe({
  __name: "grid-item",
  props: {
    isDraggable: { type: Boolean, default: void 0 },
    isResizable: { type: Boolean, default: void 0 },
    isBounded: { type: Boolean, default: void 0 },
    static: { type: Boolean, default: !1 },
    minH: { default: 1 },
    minW: { default: 1 },
    maxH: { default: 1 / 0 },
    maxW: { default: 1 / 0 },
    x: {},
    y: {},
    w: {},
    h: {},
    i: {},
    dragIgnoreFrom: { default: "a, button" },
    dragAllowFrom: { default: void 0 },
    resizeIgnoreFrom: { default: "a, button" },
    preserveAspectRatio: { type: Boolean, default: !1 },
    dragOption: { default: () => ({}) },
    resizeOption: { default: () => ({}) }
  },
  emits: ["container-resized", "resize", "resized", "move", "moved"],
  setup(t, { expose: e, emit: n }) {
    const i = t, o = n, r = qt(Qz), a = qt(Hz);
    if (!r)
      throw new Error("[grid-layout-plus]: missing layout store, GridItem must under a GridLayout.");
    const l = Te(null), s = Bn({
      cols: 1,
      containerWidth: 100,
      rowHeight: 30,
      margin: [10, 10],
      maxRows: 1 / 0,
      draggable: void 0,
      resizable: void 0,
      bounded: void 0,
      transformScale: 1,
      useCssTransforms: !0,
      useStyleCursor: !0,
      isDragging: !1,
      dragging: {
        top: -1,
        left: -1
      },
      isResizing: !1,
      resizing: {
        width: -1,
        height: -1
      },
      style: {},
      rtl: !1
    });
    let u = !1, c = !1, d = NaN, f = NaN, h = NaN, p = NaN, g = -1, m = -1, y = -1, b = -1, w = i.x, $ = i.y, C = i.w, P = i.h;
    const O = de(), E = Bn({
      i: on(i, "i"),
      state: s,
      wrapper: O,
      calcXY: fe
    });
    function _(Pe) {
      Re(Pe);
    }
    function D() {
      Ye();
    }
    function M(Pe) {
      _r(i.isDraggable) && (s.draggable = Pe);
    }
    function N(Pe) {
      _r(i.isResizable) && (s.resizable = Pe);
    }
    function L(Pe) {
      _r(i.isBounded) && (s.bounded = Pe);
    }
    function j(Pe) {
      s.transformScale = Pe;
    }
    function B(Pe) {
      s.rowHeight = Pe;
    }
    function Y(Pe) {
      s.maxRows = Pe;
    }
    function Q() {
      s.rtl = nI() === "rtl", Ye();
    }
    function G(Pe) {
      s.cols = Math.floor(Pe);
    }
    r.increaseItem(E), R0(() => {
      s.rtl = nI() === "rtl";
    }), Lt(() => {
      r.responsive && r.lastBreakpoint ? s.cols = Kz(r.lastBreakpoint, r.cols) : s.cols = r.colNum, s.rowHeight = r.rowHeight, s.containerWidth = r.width !== null ? r.width : 100, s.margin = r.margin !== void 0 ? r.margin.map(Number) : [10, 10], s.maxRows = r.maxRows, _r(i.isDraggable) ? s.draggable = r.isDraggable : s.draggable = i.isDraggable, _r(i.isResizable) ? s.resizable = r.isResizable : s.resizable = i.isResizable, _r(i.isBounded) ? s.bounded = r.isBounded : s.bounded = i.isBounded, s.transformScale = r.transformScale, s.useCssTransforms = r.useCssTransforms, s.useStyleCursor = r.useStyleCursor, zt(() => {
        w = i.x, $ = i.y, P = i.h, C = i.w, Yo(te);
      }), a.on("updateWidth", _), a.on("compact", D), a.on("setDraggable", M), a.on("setResizable", N), a.on("setBounded", L), a.on("setTransformScale", j), a.on("setRowHeight", B), a.on("setMaxRows", Y), a.on("directionchange", Q), a.on("setColNum", G);
    }), tn(() => {
      a.off("updateWidth", _), a.off("compact", D), a.off("setDraggable", M), a.off("setResizable", N), a.off("setBounded", L), a.off("setTransformScale", j), a.off("setRowHeight", B), a.off("setMaxRows", Y), a.off("directionchange", Q), a.off("setColNum", G), l.value && (l.value.unset(), l.value = null), r.decreaseItem(E);
    }), e({ state: s, wrapper: O });
    const V = typeof navigator < "u" ? navigator.userAgent.toLowerCase().includes("android") : !1, H = A(() => s.resizable && !i.static), q = A(() => r.isMirrored ? !s.rtl : s.rtl), K = A(() => (s.draggable || s.resizable) && !i.static), ee = Lde("item"), ie = A(() => ({
      [ee.b()]: !0,
      [ee.bm("resizable")]: H.value,
      [ee.bm("static")]: i.static,
      [ee.bm("resizing")]: s.isResizing,
      [ee.bm("dragging")]: s.isDragging,
      [ee.bm("transform")]: s.useCssTransforms,
      [ee.bm("rtl")]: q.value,
      [ee.bm("no-touch")]: V && K.value
    })), ae = A(() => [ee.be("resizer"), q.value && ee.bem("resizer", "rtl")].filter(Boolean));
    _e(
      () => i.isDraggable,
      (Pe) => {
        s.draggable = Pe;
      }
    ), _e(
      () => i.static,
      () => {
        Yo(We), Yo(Qe);
      }
    ), _e(
      () => s.draggable,
      () => {
        Yo(We);
      }
    ), _e(
      () => i.isResizable,
      (Pe) => {
        s.resizable = Pe;
      }
    ), _e(
      () => i.isBounded,
      (Pe) => {
        s.bounded = Pe;
      }
    ), _e(
      () => s.resizable,
      () => {
        Yo(Qe);
      }
    ), _e(
      () => s.rowHeight,
      () => {
        Yo(te), Yo(U);
      }
    ), _e([() => s.cols, () => s.containerWidth], () => {
      Yo(Qe), Yo(te), Yo(U);
    }), _e([() => i.minH, () => i.maxH, () => i.minW, () => i.maxW], () => {
      Yo(Qe);
    }), _e(q, () => {
      Yo(Qe), Yo(te);
    }), _e([() => r.margin, () => r.margin[0], () => r.margin[1]], () => {
      const Pe = r.margin;
      !Pe || Pe[0] === s.margin[0] && Pe[1] === s.margin[1] || (s.margin = Pe.map(Number), Yo(te), Yo(U));
    });
    function te() {
      i.x + i.w > s.cols ? (w = 0, C = i.w > s.cols ? s.cols : i.w) : (w = i.x, C = i.w);
      const Pe = ue(w, $, C, P);
      s.isDragging && (Pe.top = s.dragging.top, q.value ? Pe.right = s.dragging.left : Pe.left = s.dragging.left), s.isResizing && (Pe.width = s.resizing.width, Pe.height = s.resizing.height);
      let Ze;
      s.useCssTransforms ? q.value ? Ze = Ade(Pe.top, Pe.right, Pe.width, Pe.height) : Ze = Mde(Pe.top, Pe.left, Pe.width, Pe.height) : q.value ? Ze = Dde(Pe.top, Pe.right, Pe.width, Pe.height) : Ze = Rde(Pe.top, Pe.left, Pe.width, Pe.height), s.style = Ze;
    }
    function U() {
      const Pe = {};
      for (const Ze of ["width", "height"]) {
        const Ce = s.style[Ze].match(/^(\d+)px$/);
        if (!Ce)
          return;
        Pe[Ze] = Ce[1];
      }
      o("container-resized", i.i, i.h, i.w, Pe.height, Pe.width);
    }
    function me(Pe) {
      if (i.static) return;
      const Ze = Pe.type;
      if (Ze === "resizestart" && s.isResizing || Ze !== "resizestart" && !s.isResizing)
        return;
      const Ce = eI(Pe);
      if (_r(Ce)) return;
      const { x: $e, y: Le } = Ce, Ke = { width: 0, height: 0 };
      let qe;
      switch (Ze) {
        case "resizestart": {
          Qe(), g = C, m = P, qe = ue(w, $, C, P), Ke.width = qe.width, Ke.height = qe.height, s.resizing = Ke, s.isResizing = !0;
          break;
        }
        case "resizemove": {
          !Pe.edges.right && !Pe.edges.left && (h = $e), !Pe.edges.top && !Pe.edges.bottom && (p = Le);
          const rt = tI(h, p, $e, Le);
          q.value ? Ke.width = s.resizing.width - rt.deltaX / s.transformScale : Ke.width = s.resizing.width + rt.deltaX / s.transformScale, Ke.height = s.resizing.height + rt.deltaY / s.transformScale, s.resizing = Ke;
          break;
        }
        case "resizeend": {
          qe = ue(w, $, C, P), Ke.width = qe.width, Ke.height = qe.height, s.resizing = { width: -1, height: -1 }, s.isResizing = !1;
          break;
        }
      }
      qe = ze(Ke.height, Ke.width), qe.w < i.minW && (qe.w = i.minW), qe.w > i.maxW && (qe.w = i.maxW), qe.h < i.minH && (qe.h = i.minH), qe.h > i.maxH && (qe.h = i.maxH), qe.h < 1 && (qe.h = 1), qe.w < 1 && (qe.w = 1), h = $e, p = Le, (C !== qe.w || P !== qe.h) && o("resize", i.i, qe.h, qe.w, Ke.height, Ke.width), Pe.type === "resizeend" && (g !== C || m !== P) && o("resized", i.i, qe.h, qe.w, Ke.height, Ke.width), a.emit("resizeEvent", Pe.type, i.i, w, $, qe.h, qe.w);
    }
    function ce(Pe) {
      if (i.static || s.isResizing) return;
      const Ze = Pe.type;
      if (Ze === "dragstart" && s.isDragging || Ze !== "dragstart" && !s.isDragging)
        return;
      const Ce = eI(Pe);
      if (_r(Ce)) return;
      const { x: $e, y: Le } = Ce, Ke = Pe.target;
      if (!Ke.offsetParent) return;
      const qe = { top: 0, left: 0 };
      switch (Ze) {
        case "dragstart": {
          y = w, b = $;
          const De = Ke.offsetParent.getBoundingClientRect(), Be = Ke.getBoundingClientRect(), je = Be.left / s.transformScale, at = De.left / s.transformScale, mt = Be.right / s.transformScale, st = De.right / s.transformScale, gt = Be.top / s.transformScale, Et = De.top / s.transformScale;
          q.value ? qe.left = (mt - st) * -1 : qe.left = je - at, qe.top = gt - Et, s.dragging = qe, s.isDragging = !0;
          break;
        }
        case "dragmove": {
          const De = tI(d, f, $e, Le);
          if (q.value ? qe.left = s.dragging.left - De.deltaX / s.transformScale : qe.left = s.dragging.left + De.deltaX / s.transformScale, qe.top = s.dragging.top + De.deltaY / s.transformScale, s.bounded) {
            const Be = Ke.offsetParent.clientHeight - le(i.h, s.rowHeight, s.margin[1]);
            qe.top = ke(qe.top, 0, Be);
            const je = he(), at = s.containerWidth - le(i.w, je, s.margin[0]);
            qe.left = ke(qe.left, 0, at);
          }
          s.dragging = qe;
          break;
        }
        case "dragend": {
          const De = Ke.offsetParent.getBoundingClientRect(), Be = Ke.getBoundingClientRect(), je = Be.left / s.transformScale, at = De.left / s.transformScale, mt = Be.right / s.transformScale, st = De.right / s.transformScale, gt = Be.top / s.transformScale, Et = De.top / s.transformScale;
          q.value ? qe.left = (mt - st) * -1 : qe.left = je - at, qe.top = gt - Et, s.dragging = { top: -1, left: -1 }, s.isDragging = !1;
          break;
        }
      }
      let rt;
      q.value, rt = fe(qe.top, qe.left), d = $e, f = Le, (w !== rt.x || $ !== rt.y) && o("move", i.i, rt.x, rt.y), Pe.type === "dragend" && (y !== w || b !== $) && o("moved", i.i, rt.x, rt.y), a.emit("dragEvent", Pe.type, i.i, rt.x, rt.y, P, C);
    }
    function ue(Pe, Ze, Ce, $e) {
      const Le = he();
      let Ke;
      return q.value ? Ke = {
        right: Math.round(Le * Pe + (Pe + 1) * s.margin[0]),
        top: Math.round(s.rowHeight * Ze + (Ze + 1) * s.margin[1]),
        // 0 * Infinity === NaN, which causes problems with resize constraints;
        // Fix this if it occurs.
        // Note we do it here rather than later because Math.round(Infinity) causes depot
        width: Ce === 1 / 0 ? Ce : Math.round(Le * Ce + Math.max(0, Ce - 1) * s.margin[0]),
        height: $e === 1 / 0 ? $e : Math.round(s.rowHeight * $e + Math.max(0, $e - 1) * s.margin[1])
      } : Ke = {
        left: Math.round(Le * Pe + (Pe + 1) * s.margin[0]),
        top: Math.round(s.rowHeight * Ze + (Ze + 1) * s.margin[1]),
        // 0 * Infinity === NaN, which causes problems with resize constraints;
        // Fix this if it occurs.
        // Note we do it here rather than later because Math.round(Infinity) causes depot
        width: Ce === 1 / 0 ? Ce : Math.round(Le * Ce + Math.max(0, Ce - 1) * s.margin[0]),
        height: $e === 1 / 0 ? $e : Math.round(s.rowHeight * $e + Math.max(0, $e - 1) * s.margin[1])
      }, Ke;
    }
    function fe(Pe, Ze) {
      const Ce = he();
      let $e = Math.round((Ze - s.margin[0]) / (Ce + s.margin[0])), Le = Math.round((Pe - s.margin[1]) / (s.rowHeight + s.margin[1]));
      return $e = Math.max(Math.min($e, s.cols - C), 0), Le = Math.max(Math.min(Le, s.maxRows - P), 0), { x: $e, y: Le };
    }
    function he() {
      return (s.containerWidth - s.margin[0] * (s.cols + 1)) / s.cols;
    }
    function le(Pe, Ze, Ce) {
      return Number.isFinite(Pe) ? Math.round(Ze * Pe + Math.max(0, Pe - 1) * Ce) : Pe;
    }
    function ke(Pe, Ze, Ce) {
      return Math.max(Math.min(Pe, Ce), Ze);
    }
    function ze(Pe, Ze, Ce = !1) {
      const $e = he();
      let Le = Math.round((Ze + s.margin[0]) / ($e + s.margin[0])), Ke = 0;
      return Ce ? Ke = Math.ceil((Pe + s.margin[1]) / (s.rowHeight + s.margin[1])) : Ke = Math.round((Pe + s.margin[1]) / (s.rowHeight + s.margin[1])), Le = Math.max(Math.min(Le, s.cols - w), 0), Ke = Math.max(Math.min(Ke, s.maxRows - $), 0), { w: Le, h: Ke };
    }
    function Re(Pe, Ze) {
      s.containerWidth = Pe;
    }
    function Ye() {
      te();
    }
    function Ne() {
      !l.value && O.value && (l.value = oI(O.value), s.useStyleCursor || l.value.styleCursor(!1));
    }
    const Fe = G_(ce);
    function We() {
      if (Ne(), !!l.value)
        if (s.draggable && !i.static) {
          const Pe = {
            ignoreFrom: i.dragIgnoreFrom,
            allowFrom: i.dragAllowFrom,
            ...i.dragOption
          };
          l.value.draggable(Pe), u || (u = !0, l.value.on("dragstart dragmove dragend", (Ze) => {
            Ze.type === "dragmove" ? Fe(Ze) : ce(Ze);
          }));
        } else
          l.value.draggable({ enabled: !1 });
    }
    const nt = G_(me);
    function Qe() {
      if (Ne(), !!l.value)
        if (s.resizable && !i.static) {
          const Pe = ue(0, 0, i.maxW, i.maxH), Ze = ue(0, 0, i.minW, i.minH), Ce = {
            edges: {
              left: q.value ? `.${ae.value[0]}` : !1,
              right: q.value ? !1 : `.${ae.value[0]}`,
              bottom: `.${ae.value[0]}`,
              top: !1
            },
            ignoreFrom: i.resizeIgnoreFrom,
            restrictSize: {
              min: {
                height: Ze.height * s.transformScale,
                width: Ze.width * s.transformScale
              },
              max: {
                height: Pe.height * s.transformScale,
                width: Pe.width * s.transformScale
              }
            },
            ...i.resizeOption
          };
          i.preserveAspectRatio && (Ce.modifiers = [oI.modifiers.aspectRatio({ ratio: "preserve" })]), l.value.resizable(Ce), c || (c = !0, l.value.on("resizestart resizemove resizeend", ($e) => {
            $e.type === "resizemove" ? nt($e) : me($e);
          }));
        } else
          l.value.resizable({ enabled: !1 });
    }
    return (Pe, Ze) => (re(), be("section", {
      ref_key: "wrapper",
      ref: O,
      class: Tt(ie.value),
      style: Yt(s.style)
    }, [
      _o(Pe.$slots, "default"),
      H.value ? (re(), be("span", {
        key: 0,
        class: Tt(ae.value)
      }, null, 2)) : et("", !0)
    ], 6));
  }
}), cd = typeof window < "u";
var aI;
cd && (aI = window?.navigator) != null && aI.userAgent && /iP(ad|hone|od)/.test(window.navigator.userAgent);
function lI(t) {
  return t != null;
}
function sI() {
}
const Yde = Object.freeze({
  aliceblue: "f0f8ff",
  antiquewhite: "faebd7",
  aqua: "0ff",
  aquamarine: "7fffd4",
  azure: "f0ffff",
  beige: "f5f5dc",
  bisque: "ffe4c4",
  black: "000",
  blanchedalmond: "ffebcd",
  blue: "00f",
  blueviolet: "8a2be2",
  brown: "a52a2a",
  burlywood: "deb887",
  burntsienna: "ea7e5d",
  cadetblue: "5f9ea0",
  chartreuse: "7fff00",
  chocolate: "d2691e",
  coral: "ff7f50",
  cornflowerblue: "6495ed",
  cornsilk: "fff8dc",
  crimson: "dc143c",
  cyan: "0ff",
  darkblue: "00008b",
  darkcyan: "008b8b",
  darkgoldenrod: "b8860b",
  darkgray: "a9a9a9",
  darkgreen: "006400",
  darkgrey: "a9a9a9",
  darkkhaki: "bdb76b",
  darkmagenta: "8b008b",
  darkolivegreen: "556b2f",
  darkorange: "ff8c00",
  darkorchid: "9932cc",
  darkred: "8b0000",
  darksalmon: "e9967a",
  darkseagreen: "8fbc8f",
  darkslateblue: "483d8b",
  darkslategray: "2f4f4f",
  darkslategrey: "2f4f4f",
  darkturquoise: "00ced1",
  darkviolet: "9400d3",
  deeppink: "ff1493",
  deepskyblue: "00bfff",
  dimgray: "696969",
  dimgrey: "696969",
  dodgerblue: "1e90ff",
  firebrick: "b22222",
  floralwhite: "fffaf0",
  forestgreen: "228b22",
  fuchsia: "f0f",
  gainsboro: "dcdcdc",
  ghostwhite: "f8f8ff",
  gold: "ffd700",
  goldenrod: "daa520",
  gray: "808080",
  green: "008000",
  greenyellow: "adff2f",
  grey: "808080",
  honeydew: "f0fff0",
  hotpink: "ff69b4",
  indianred: "cd5c5c",
  indigo: "4b0082",
  ivory: "fffff0",
  khaki: "f0e68c",
  lavender: "e6e6fa",
  lavenderblush: "fff0f5",
  lawngreen: "7cfc00",
  lemonchiffon: "fffacd",
  lightblue: "add8e6",
  lightcoral: "f08080",
  lightcyan: "e0ffff",
  lightgoldenrodyellow: "fafad2",
  lightgray: "d3d3d3",
  lightgreen: "90ee90",
  lightgrey: "d3d3d3",
  lightpink: "ffb6c1",
  lightsalmon: "ffa07a",
  lightseagreen: "20b2aa",
  lightskyblue: "87cefa",
  lightslategray: "789",
  lightslategrey: "789",
  lightsteelblue: "b0c4de",
  lightyellow: "ffffe0",
  lime: "0f0",
  limegreen: "32cd32",
  linen: "faf0e6",
  magenta: "f0f",
  maroon: "800000",
  mediumaquamarine: "66cdaa",
  mediumblue: "0000cd",
  mediumorchid: "ba55d3",
  mediumpurple: "9370db",
  mediumseagreen: "3cb371",
  mediumslateblue: "7b68ee",
  mediumspringgreen: "00fa9a",
  mediumturquoise: "48d1cc",
  mediumvioletred: "c71585",
  midnightblue: "191970",
  mintcream: "f5fffa",
  mistyrose: "ffe4e1",
  moccasin: "ffe4b5",
  navajowhite: "ffdead",
  navy: "000080",
  oldlace: "fdf5e6",
  olive: "808000",
  olivedrab: "6b8e23",
  orange: "ffa500",
  orangered: "ff4500",
  orchid: "da70d6",
  palegoldenrod: "eee8aa",
  palegreen: "98fb98",
  paleturquoise: "afeeee",
  palevioletred: "db7093",
  papayawhip: "ffefd5",
  peachpuff: "ffdab9",
  peru: "cd853f",
  pink: "ffc0cb",
  plum: "dda0dd",
  powderblue: "b0e0e6",
  purple: "800080",
  rebeccapurple: "663399",
  red: "f00",
  rosybrown: "bc8f8f",
  royalblue: "4169e1",
  saddlebrown: "8b4513",
  salmon: "fa8072",
  sandybrown: "f4a460",
  seagreen: "2e8b57",
  seashell: "fff5ee",
  sienna: "a0522d",
  silver: "c0c0c0",
  skyblue: "87ceeb",
  slateblue: "6a5acd",
  slategray: "708090",
  slategrey: "708090",
  snow: "fffafa",
  springgreen: "00ff7f",
  steelblue: "4682b4",
  tan: "d2b48c",
  teal: "008080",
  thistle: "d8bfd8",
  tomato: "ff6347",
  turquoise: "40e0d0",
  violet: "ee82ee",
  wheat: "f5deb3",
  white: "fff",
  whitesmoke: "f5f5f5",
  yellow: "ff0",
  yellowgreen: "9acd32"
});
Object.freeze(new Set(Object.keys(Yde)));
const Kde = cd && ("ontouchstart" in window || Xde() > 0), uI = Kde ? "pointerdown" : "click";
function Xde() {
  return typeof navigator < "u" && (navigator.maxTouchPoints || navigator.msMaxTouchPoints) || 0;
}
function Zde(t, e, n = window.Event) {
  const { type: i, bubbles: o = !1, cancelable: r = !1, ...a } = e;
  if (!lI(i) || i === "") return !1;
  let l;
  return lI(n) ? l = new n(i, { bubbles: o, cancelable: r }) : (l = document.createEvent("HTMLEvents"), l.initEvent(i, o, r)), Object.assign(l, a), t.dispatchEvent(l);
}
const Gde = "clickoutside", Ude = /* @__PURE__ */ new Set();
let N1 = null;
function Jde(t, e) {
  return t instanceof Node ? e === t || e.contains(t) || !!e.__transferElement && (e.__transferElement === t || e.__transferElement.contains(t)) : !1;
}
cd && (uI === "click" && document.addEventListener(
  "pointerdown",
  (t) => {
    N1 = t.target;
  },
  !0
), document.addEventListener(
  uI,
  (t) => {
    const e = N1;
    N1 = null, Ude.forEach((n) => {
      if (e && Jde(e, n))
        return;
      const i = t.target, o = t.composedPath && t.composedPath();
      n !== i && (o ? !o.includes(n) : !n.contains(i)) && (!n.__transferElement || n.__transferElement !== i && !n.__transferElement.contains(i)) && Zde(n, { type: Gde });
    });
  },
  !0
));
const efe = [
  [
    "requestFullscreen",
    "exitFullscreen",
    "fullscreenElement",
    "fullscreenEnabled",
    "fullscreenchange",
    "fullscreenerror"
  ],
  // New WebKit
  [
    "webkitRequestFullscreen",
    "webkitExitFullscreen",
    "webkitFullscreenElement",
    "webkitFullscreenEnabled",
    "webkitfullscreenchange",
    "webkitfullscreenerror"
  ],
  // Old WebKit
  [
    "webkitRequestFullScreen",
    "webkitCancelFullScreen",
    "webkitCurrentFullScreenElement",
    "webkitCancelFullScreen",
    "webkitfullscreenchange",
    "webkitfullscreenerror"
  ],
  [
    "mozRequestFullScreen",
    "mozCancelFullScreen",
    "mozFullScreenElement",
    "mozFullScreenEnabled",
    "mozfullscreenchange",
    "mozfullscreenerror"
  ],
  [
    "msRequestFullscreen",
    "msExitFullscreen",
    "msFullscreenElement",
    "msFullscreenEnabled",
    "MSFullscreenChange",
    "MSFullscreenError"
  ]
];
let Sv;
if (cd) {
  for (const t of efe)
    if (t[1] in document) {
      Sv = t;
      break;
    }
}
A(() => !1);
const tfe = /* @__PURE__ */ new Set(), nfe = /* @__PURE__ */ new WeakMap();
if (cd && Sv) {
  const t = Sv[2], e = Sv[4];
  document.addEventListener(
    e,
    () => {
      if (tfe.forEach((n) => {
        n.value = !1;
      }), document[t]) {
        const n = nfe.get(document[t]);
        n && (n.value = !0);
      }
    },
    !1
  );
}
const Zz = /* @__PURE__ */ new Map();
Zz.set("x", 0);
Zz.set("y", 0);
var Nc = [], ife = function() {
  return Nc.some(function(t) {
    return t.activeTargets.length > 0;
  });
}, ofe = function() {
  return Nc.some(function(t) {
    return t.skippedTargets.length > 0;
  });
}, cI = "ResizeObserver loop completed with undelivered notifications.", rfe = function() {
  var t;
  typeof ErrorEvent == "function" ? t = new ErrorEvent("error", {
    message: cI
  }) : (t = document.createEvent("Event"), t.initEvent("error", !1, !1), t.message = cI), window.dispatchEvent(t);
}, jp;
(function(t) {
  t.BORDER_BOX = "border-box", t.CONTENT_BOX = "content-box", t.DEVICE_PIXEL_CONTENT_BOX = "device-pixel-content-box";
})(jp || (jp = {}));
var Lc = function(t) {
  return Object.freeze(t);
}, afe = /* @__PURE__ */ (function() {
  function t(e, n) {
    this.inlineSize = e, this.blockSize = n, Lc(this);
  }
  return t;
})(), Gz = (function() {
  function t(e, n, i, o) {
    return this.x = e, this.y = n, this.width = i, this.height = o, this.top = this.y, this.left = this.x, this.bottom = this.top + this.height, this.right = this.left + this.width, Lc(this);
  }
  return t.prototype.toJSON = function() {
    var e = this, n = e.x, i = e.y, o = e.top, r = e.right, a = e.bottom, l = e.left, s = e.width, u = e.height;
    return { x: n, y: i, top: o, right: r, bottom: a, left: l, width: s, height: u };
  }, t.fromRect = function(e) {
    return new t(e.x, e.y, e.width, e.height);
  }, t;
})(), U$ = function(t) {
  return t instanceof SVGElement && "getBBox" in t;
}, Uz = function(t) {
  if (U$(t)) {
    var e = t.getBBox(), n = e.width, i = e.height;
    return !n && !i;
  }
  var o = t, r = o.offsetWidth, a = o.offsetHeight;
  return !(r || a || t.getClientRects().length);
}, dI = function(t) {
  var e;
  if (t instanceof Element)
    return !0;
  var n = (e = t?.ownerDocument) === null || e === void 0 ? void 0 : e.defaultView;
  return !!(n && t instanceof n.Element);
}, lfe = function(t) {
  switch (t.tagName) {
    case "INPUT":
      if (t.type !== "image")
        break;
    case "VIDEO":
    case "AUDIO":
    case "EMBED":
    case "OBJECT":
    case "CANVAS":
    case "IFRAME":
    case "IMG":
      return !0;
  }
  return !1;
}, gp = typeof window < "u" ? window : {}, wm = /* @__PURE__ */ new WeakMap(), fI = /auto|scroll/, sfe = /^tb|vertical/, ufe = /msie|trident/i.test(gp.navigator && gp.navigator.userAgent), al = function(t) {
  return parseFloat(t || "0");
}, gf = function(t, e, n) {
  return t === void 0 && (t = 0), e === void 0 && (e = 0), n === void 0 && (n = !1), new afe((n ? e : t) || 0, (n ? t : e) || 0);
}, hI = Lc({
  devicePixelContentBoxSize: gf(),
  borderBoxSize: gf(),
  contentBoxSize: gf(),
  contentRect: new Gz(0, 0, 0, 0)
}), Jz = function(t, e) {
  if (e === void 0 && (e = !1), wm.has(t) && !e)
    return wm.get(t);
  if (Uz(t))
    return wm.set(t, hI), hI;
  var n = getComputedStyle(t), i = U$(t) && t.ownerSVGElement && t.getBBox(), o = !ufe && n.boxSizing === "border-box", r = sfe.test(n.writingMode || ""), a = !i && fI.test(n.overflowY || ""), l = !i && fI.test(n.overflowX || ""), s = i ? 0 : al(n.paddingTop), u = i ? 0 : al(n.paddingRight), c = i ? 0 : al(n.paddingBottom), d = i ? 0 : al(n.paddingLeft), f = i ? 0 : al(n.borderTopWidth), h = i ? 0 : al(n.borderRightWidth), p = i ? 0 : al(n.borderBottomWidth), g = i ? 0 : al(n.borderLeftWidth), m = d + u, y = s + c, b = g + h, w = f + p, $ = l ? t.offsetHeight - w - t.clientHeight : 0, C = a ? t.offsetWidth - b - t.clientWidth : 0, P = o ? m + b : 0, O = o ? y + w : 0, E = i ? i.width : al(n.width) - P - C, _ = i ? i.height : al(n.height) - O - $, D = E + m + C + b, M = _ + y + $ + w, N = Lc({
    devicePixelContentBoxSize: gf(Math.round(E * devicePixelRatio), Math.round(_ * devicePixelRatio), r),
    borderBoxSize: gf(D, M, r),
    contentBoxSize: gf(E, _, r),
    contentRect: new Gz(d, s, E, _)
  });
  return wm.set(t, N), N;
}, e4 = function(t, e, n) {
  var i = Jz(t, n), o = i.borderBoxSize, r = i.contentBoxSize, a = i.devicePixelContentBoxSize;
  switch (e) {
    case jp.DEVICE_PIXEL_CONTENT_BOX:
      return a;
    case jp.BORDER_BOX:
      return o;
    default:
      return r;
  }
}, cfe = /* @__PURE__ */ (function() {
  function t(e) {
    var n = Jz(e);
    this.target = e, this.contentRect = n.contentRect, this.borderBoxSize = Lc([n.borderBoxSize]), this.contentBoxSize = Lc([n.contentBoxSize]), this.devicePixelContentBoxSize = Lc([n.devicePixelContentBoxSize]);
  }
  return t;
})(), t4 = function(t) {
  if (Uz(t))
    return 1 / 0;
  for (var e = 0, n = t.parentNode; n; )
    e += 1, n = n.parentNode;
  return e;
}, dfe = function() {
  var t = 1 / 0, e = [];
  Nc.forEach(function(r) {
    if (r.activeTargets.length !== 0) {
      var a = [];
      r.activeTargets.forEach(function(l) {
        var s = new cfe(l.target), u = t4(l.target);
        a.push(s), l.lastReportedSize = e4(l.target, l.observedBox), u < t && (t = u);
      }), e.push(function() {
        r.callback.call(r.observer, a, r.observer);
      }), r.activeTargets.splice(0, r.activeTargets.length);
    }
  });
  for (var n = 0, i = e; n < i.length; n++) {
    var o = i[n];
    o();
  }
  return t;
}, pI = function(t) {
  Nc.forEach(function(e) {
    e.activeTargets.splice(0, e.activeTargets.length), e.skippedTargets.splice(0, e.skippedTargets.length), e.observationTargets.forEach(function(n) {
      n.isActive() && (t4(n.target) > t ? e.activeTargets.push(n) : e.skippedTargets.push(n));
    });
  });
}, ffe = function() {
  var t = 0;
  for (pI(t); ife(); )
    t = dfe(), pI(t);
  return ofe() && rfe(), t > 0;
}, L1, n4 = [], hfe = function() {
  return n4.splice(0).forEach(function(t) {
    return t();
  });
}, pfe = function(t) {
  if (!L1) {
    var e = 0, n = document.createTextNode(""), i = { characterData: !0 };
    new MutationObserver(function() {
      return hfe();
    }).observe(n, i), L1 = function() {
      n.textContent = "".concat(e ? e-- : e++);
    };
  }
  n4.push(t), L1();
}, gfe = function(t) {
  pfe(function() {
    requestAnimationFrame(t);
  });
}, wv = 0, mfe = function() {
  return !!wv;
}, vfe = 250, yfe = { attributes: !0, characterData: !0, childList: !0, subtree: !0 }, gI = [
  "resize",
  "load",
  "transitionend",
  "animationend",
  "animationstart",
  "animationiteration",
  "keyup",
  "keydown",
  "mouseup",
  "mousedown",
  "mouseover",
  "mouseout",
  "blur",
  "focus"
], mI = function(t) {
  return t === void 0 && (t = 0), Date.now() + t;
}, z1 = !1, bfe = (function() {
  function t() {
    var e = this;
    this.stopped = !0, this.listener = function() {
      return e.schedule();
    };
  }
  return t.prototype.run = function(e) {
    var n = this;
    if (e === void 0 && (e = vfe), !z1) {
      z1 = !0;
      var i = mI(e);
      gfe(function() {
        var o = !1;
        try {
          o = ffe();
        } finally {
          if (z1 = !1, e = i - mI(), !mfe())
            return;
          o ? n.run(1e3) : e > 0 ? n.run(e) : n.start();
        }
      });
    }
  }, t.prototype.schedule = function() {
    this.stop(), this.run();
  }, t.prototype.observe = function() {
    var e = this, n = function() {
      return e.observer && e.observer.observe(document.body, yfe);
    };
    document.body ? n() : gp.addEventListener("DOMContentLoaded", n);
  }, t.prototype.start = function() {
    var e = this;
    this.stopped && (this.stopped = !1, this.observer = new MutationObserver(this.listener), this.observe(), gI.forEach(function(n) {
      return gp.addEventListener(n, e.listener, !0);
    }));
  }, t.prototype.stop = function() {
    var e = this;
    this.stopped || (this.observer && this.observer.disconnect(), gI.forEach(function(n) {
      return gp.removeEventListener(n, e.listener, !0);
    }), this.stopped = !0);
  }, t;
})(), yS = new bfe(), vI = function(t) {
  !wv && t > 0 && yS.start(), wv += t, !wv && yS.stop();
}, xfe = function(t) {
  return !U$(t) && !lfe(t) && getComputedStyle(t).display === "inline";
}, Ofe = (function() {
  function t(e, n) {
    this.target = e, this.observedBox = n || jp.CONTENT_BOX, this.lastReportedSize = {
      inlineSize: 0,
      blockSize: 0
    };
  }
  return t.prototype.isActive = function() {
    var e = e4(this.target, this.observedBox, !0);
    return xfe(this.target) && (this.lastReportedSize = e), this.lastReportedSize.inlineSize !== e.inlineSize || this.lastReportedSize.blockSize !== e.blockSize;
  }, t;
})(), Sfe = /* @__PURE__ */ (function() {
  function t(e, n) {
    this.activeTargets = [], this.skippedTargets = [], this.observationTargets = [], this.observer = e, this.callback = n;
  }
  return t;
})(), Cm = /* @__PURE__ */ new WeakMap(), yI = function(t, e) {
  for (var n = 0; n < t.length; n += 1)
    if (t[n].target === e)
      return n;
  return -1;
}, $m = (function() {
  function t() {
  }
  return t.connect = function(e, n) {
    var i = new Sfe(e, n);
    Cm.set(e, i);
  }, t.observe = function(e, n, i) {
    var o = Cm.get(e), r = o.observationTargets.length === 0;
    yI(o.observationTargets, n) < 0 && (r && Nc.push(o), o.observationTargets.push(new Ofe(n, i && i.box)), vI(1), yS.schedule());
  }, t.unobserve = function(e, n) {
    var i = Cm.get(e), o = yI(i.observationTargets, n), r = i.observationTargets.length === 1;
    o >= 0 && (r && Nc.splice(Nc.indexOf(i), 1), i.observationTargets.splice(o, 1), vI(-1));
  }, t.disconnect = function(e) {
    var n = this, i = Cm.get(e);
    i.observationTargets.slice().forEach(function(o) {
      return n.unobserve(e, o.target);
    }), i.activeTargets.splice(0, i.activeTargets.length);
  }, t;
})(), wfe = (function() {
  function t(e) {
    if (arguments.length === 0)
      throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");
    if (typeof e != "function")
      throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");
    $m.connect(this, e);
  }
  return t.prototype.observe = function(e, n) {
    if (arguments.length === 0)
      throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");
    if (!dI(e))
      throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");
    $m.observe(this, e, n);
  }, t.prototype.unobserve = function(e) {
    if (arguments.length === 0)
      throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");
    if (!dI(e))
      throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");
    $m.unobserve(this, e);
  }, t.prototype.disconnect = function() {
    $m.disconnect(this);
  }, t.toString = function() {
    return "function ResizeObserver () { [polyfill code] }";
  }, t;
})();
const c0 = /* @__PURE__ */ new WeakMap();
function Cfe(t) {
  var e;
  for (let n = 0, i = t.length; n < i; ++n) {
    const o = t[n], r = c0.get(o.target);
    if (typeof r == "function") {
      const { inlineSize: a, blockSize: l } = ((e = o.borderBoxSize) == null ? void 0 : e[0]) ?? {}, { offsetWidth: s, offsetHeight: u } = o.target;
      r(
        Object.assign(o, {
          offsetWidth: s,
          offsetHeight: u,
          width: a ?? s,
          height: l ?? u
        })
      );
    }
  }
}
const i4 = new (cd && window.ResizeObserver || wfe)(
  Cfe
);
function bI(t, e) {
  c0.set(t, e), i4.observe(t);
}
function xI(t) {
  c0.has(t) && (i4.unobserve(t), c0.delete(t));
}
function $fe(t = {}) {
  let e = sI;
  const n = _e(
    () => I(t.target),
    (o) => {
      e(), !(!o || typeof t.onResize != "function") && (bI(o, t.onResize), e = () => {
        xI(o), e = sI;
      });
    },
    { immediate: !0 }
  ), i = () => {
    n(), e();
  };
  return CA() && $A(i), {
    /**
     * @deprecated Will be removed in next major version, please directly use `observeResize` from imports.
     */
    observeResize: bI,
    /**
     * @deprecated Will be removed in next major version, please directly use `unobserveResize` from imports.
     */
    unobserveResize: xI,
    unobserve: i
  };
}
const kfe = de(!1);
A(() => kfe.value);
const OI = "__theme_style__", B1 = "__theme_observer__", SI = Bn(/* @__PURE__ */ new Map()), wI = /* @__PURE__ */ new Map();
_e(SI, () => {
  if (!cd) return;
  wI.clear();
  const t = document.head.querySelector(`#${OI}`);
  t && document.head.removeChild(t);
  const e = document.createElement("style");
  let n = `.${B1} { width: 1px }`, i = 1;
  for (const [o, [r, a]] of SI.entries())
    n += ` html.${r} .${B1}, .${a} .${B1} { width: ${++i}px }`, wI.set(i, o);
  e.textContent = n, e.id = OI, document.head.appendChild(e);
});
const Tfe = /* @__PURE__ */ Oe({
  __name: "grid-layout",
  props: {
    autoSize: { type: Boolean, default: !0 },
    colNum: { default: 12 },
    rowHeight: { default: 150 },
    maxRows: { default: 1 / 0 },
    margin: { default: () => [10, 10] },
    isDraggable: { type: Boolean, default: !0 },
    isResizable: { type: Boolean, default: !0 },
    isMirrored: { type: Boolean, default: !1 },
    isBounded: { type: Boolean, default: !1 },
    useCssTransforms: { type: Boolean, default: !0 },
    verticalCompact: { type: Boolean, default: !0 },
    restoreOnDrag: { type: Boolean, default: !1 },
    layout: {},
    responsive: { type: Boolean, default: !1 },
    responsiveLayouts: { default: () => ({}) },
    transformScale: { default: 1 },
    breakpoints: { default: () => ({ lg: 1200, md: 996, sm: 768, xs: 480, xxs: 0 }) },
    cols: { default: () => ({ lg: 12, md: 10, sm: 6, xs: 4, xxs: 2 }) },
    preventCollision: { type: Boolean, default: !1 },
    useStyleCursor: { type: Boolean, default: !0 }
  },
  emits: [
    "layout-before-mount",
    "layout-mounted",
    "layout-updated",
    "breakpoint-changed",
    "update:layout",
    "layout-ready"
  ],
  setup(t, { expose: e, emit: n }) {
    const i = t, o = n, r = Bn({
      width: -1,
      mergedStyle: {},
      lastLayoutLength: 0,
      isDragging: !1,
      placeholder: {
        x: 0,
        y: 0,
        w: 0,
        h: 0,
        i: ""
      },
      layouts: {},
      // array to store all layouts from different breakpoints
      lastBreakpoint: null,
      // store last active breakpoint
      originalLayout: null
      // store original Layout
    }), a = /* @__PURE__ */ new Map(), l = de(i.layout), s = de(), { observeResize: u, unobserveResize: c } = $fe(), d = $de();
    d.on("resizeEvent", f), d.on("dragEvent", h), R0(() => {
      o("layout-before-mount", l.value);
    }), Lt(() => {
      o("layout-mounted", l.value), rn(() => {
        Nde(l.value), r.originalLayout = l.value, rn(() => {
          _(), s.value && u(s.value, kde(w, 16)), Qd(l.value, i.verticalCompact), o("layout-updated", l.value), b(), w();
        });
      });
    }), tn(() => {
      d.clearAll(), s.value && c(s.value);
    });
    function f(M, N, L, j, B, Y) {
      O(M, N, L, j, B, Y);
    }
    function h(M, N, L, j, B, Y) {
      P(M, N, L, j, B, Y);
    }
    _e(
      () => r.width,
      (M, N) => {
        rn(() => {
          d.emit("updateWidth", M), N === -1 && rn(() => {
            o("layout-ready", l.value);
          }), b();
        });
      }
    ), _e(
      () => [i.layout, i.layout.length],
      () => {
        l.value = i.layout, y();
      }
    ), _e(
      () => i.colNum,
      (M) => {
        d.emit("setColNum", M);
      }
    ), _e(
      () => i.rowHeight,
      (M) => {
        d.emit("setRowHeight", M);
      }
    ), _e(
      () => i.isDraggable,
      (M) => {
        d.emit("setDraggable", M);
      }
    ), _e(
      () => i.isResizable,
      (M) => {
        d.emit("setResizable", M);
      }
    ), _e(
      () => i.isBounded,
      (M) => {
        d.emit("setBounded", M);
      }
    ), _e(
      () => i.transformScale,
      (M) => {
        d.emit("setTransformScale", M);
      }
    ), _e(
      () => i.responsive,
      (M) => {
        M || (o("update:layout", r.originalLayout), d.emit("setColNum", i.colNum)), w();
      }
    ), _e(
      () => i.maxRows,
      (M) => {
        d.emit("setMaxRows", M);
      }
    ), _e([() => i.margin, () => i.margin[1]], b), Xt(
      Qz,
      Bn({
        ..._c(i),
        ..._c(r),
        increaseItem: p,
        decreaseItem: g
      })
    ), Xt(Hz, d), e({ state: r, getItem: m, resizeEvent: O, dragEvent: P, layoutUpdate: y });
    function p(M) {
      a.set(M.i, M);
    }
    function g(M) {
      a.delete(M.i);
    }
    function m(M) {
      return a.get(M);
    }
    function y() {
      if (!_r(l.value) && !_r(r.originalLayout)) {
        if (l.value.length !== r.originalLayout.length) {
          const M = D(l.value, r.originalLayout);
          if (M.length > 0)
            if (l.value.length > r.originalLayout.length)
              r.originalLayout = r.originalLayout.concat(M);
            else {
              const N = new Set(M.map((L) => L.i));
              r.originalLayout = r.originalLayout.filter((L) => !N.has(L.i));
            }
          r.lastLayoutLength = l.value.length, _();
        }
        Qd(l.value, i.verticalCompact), d.emit("updateWidth", r.width), b(), o("layout-updated", l.value);
      }
    }
    function b() {
      r.mergedStyle = {
        height: $()
      };
    }
    function w() {
      s.value && (r.width = s.value.offsetWidth), d.emit("resizeEvent");
    }
    function $() {
      if (!i.autoSize) return;
      const M = parseFloat(i.margin[1]);
      return Pde(l.value) * (i.rowHeight + M) + M + "px";
    }
    let C;
    function P(M, N, L, j, B, Y) {
      let Q = U_(l.value, N);
      _r(Q) && (Q = { h: 0, w: 0, x: 0, y: 0, i: "" }), M === "dragstart" && !i.verticalCompact && (C = l.value.reduce(
        (G, { i: V, x: H, y: q }) => ({
          ...G,
          [V]: { x: H, y: q }
        }),
        {}
      )), M === "dragmove" || M === "dragstart" ? (r.placeholder.i = N, r.placeholder.x = Q.x, r.placeholder.y = Q.y, r.placeholder.w = Y, r.placeholder.h = B, rn(() => {
        r.isDragging = !0;
      }), d.emit("updateWidth", r.width)) : rn(() => {
        r.isDragging = !1;
      }), l.value = vS(l.value, Q, L, j, !0, i.preventCollision), i.restoreOnDrag ? (Q.static = !0, Qd(l.value, i.verticalCompact, C), Q.static = !1) : Qd(l.value, i.verticalCompact), d.emit("compact"), b(), M === "dragend" && (C = void 0, o("layout-updated", l.value));
    }
    function O(M, N, L, j, B, Y) {
      let Q = U_(l.value, N);
      _r(Q) && (Q = { h: 0, w: 0, x: 0, y: 0, i: "" });
      let G;
      if (i.preventCollision) {
        const V = jz(l.value, { ...Q, w: Y, h: B }).filter(
          (H) => H.i !== Q.i
        );
        if (G = V.length > 0, G) {
          let H = 1 / 0, q = 1 / 0;
          V.forEach((K) => {
            K.x > Q.x && (H = Math.min(H, K.x)), K.y > Q.y && (q = Math.min(q, K.y));
          }), Number.isFinite(H) && (Q.w = H - Q.x), Number.isFinite(q) && (Q.h = q - Q.y);
        }
      }
      G || (Q.w = Y, Q.h = B), M === "resizestart" || M === "resizemove" ? (r.placeholder.i = N, r.placeholder.x = L, r.placeholder.y = j, r.placeholder.w = Q.w, r.placeholder.h = Q.h, rn(() => {
        r.isDragging = !0;
      }), d.emit("updateWidth", r.width)) : M && rn(() => {
        r.isDragging = !1;
      }), i.responsive && E(), Qd(l.value, i.verticalCompact), d.emit("compact"), b(), M === "resizeend" && o("layout-updated", l.value);
    }
    function E() {
      const M = Fde(i.breakpoints, r.width);
      if (M === r.lastBreakpoint)
        return;
      const N = Kz(M, i.cols);
      !_r(r.lastBreakpoint) && !r.layouts[r.lastBreakpoint] && (r.layouts[r.lastBreakpoint] = mS(l.value));
      const L = Vde(
        r.originalLayout,
        r.layouts,
        i.breakpoints,
        M,
        r.lastBreakpoint,
        N,
        i.verticalCompact
      );
      r.layouts[M] = L, r.lastBreakpoint !== M && o("breakpoint-changed", M, L), l.value = L, o("update:layout", L), r.lastBreakpoint = M, d.emit("setColNum", N);
    }
    function _() {
      r.layouts = Object.assign({}, i.responsiveLayouts);
    }
    function D(M, N) {
      const L = new Set(N.map((Q) => Q.i)), j = new Set(M.map((Q) => Q.i)), B = M.filter((Q) => !L.has(Q.i)), Y = N.filter((Q) => !j.has(Q.i));
      return B.concat(Y);
    }
    return (M, N) => (re(), be("div", {
      ref_key: "wrapper",
      ref: s,
      class: "vgl-layout",
      style: Yt(r.mergedStyle)
    }, [
      M.$slots.default ? _o(M.$slots, "default", { key: 0 }) : (re(!0), be(tt, { key: 1 }, Jt(l.value, (L) => (re(), ut(rI, J8({
        key: L.i,
        ref_for: !0
      }, L), {
        default: ye(() => [
          _o(M.$slots, "item", { item: L })
        ]),
        _: 2
      }, 1040))), 128)),
      fa(v(rI, {
        class: "vgl-item--placeholder",
        x: r.placeholder.x,
        y: r.placeholder.y,
        w: r.placeholder.w,
        h: r.placeholder.h,
        i: r.placeholder.i
      }, null, 8, ["x", "y", "w", "h", "i"]), [
        [Qa, r.isDragging]
      ])
    ], 4));
  }
});
(function() {
  try {
    if (typeof document < "u") {
      var t = document.createElement("style");
      t.appendChild(document.createTextNode('.vgl-layout{--vgl-placeholder-bg: red;--vgl-placeholder-opacity: 20%;--vgl-placeholder-z-index: 2;--vgl-item-resizing-z-index: 3;--vgl-item-resizing-opacity: 60%;--vgl-item-dragging-z-index: 3;--vgl-item-dragging-opacity: 100%;--vgl-resizer-size: 10px;--vgl-resizer-border-color: #444;--vgl-resizer-border-width: 2px;position:relative;box-sizing:border-box;transition:height .2s ease}.vgl-item{position:absolute;box-sizing:border-box;transition:.2s ease;transition-property:left,top,right}.vgl-item--placeholder{z-index:var(--vgl-placeholder-z-index, 2);-webkit-user-select:none;-moz-user-select:none;user-select:none;background-color:var(--vgl-placeholder-bg, red);opacity:var(--vgl-placeholder-opacity, 20%);transition-duration:.1s}.vgl-item--no-touch{touch-action:none}.vgl-item--transform{right:auto;left:0;transition-property:transform}.vgl-item--transform.vgl-item--rtl{right:0;left:auto}.vgl-item--resizing{z-index:var(--vgl-item-resizing-z-index, 3);-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--vgl-item-resizing-opacity, 60%)}.vgl-item--dragging{z-index:var(--vgl-item-dragging-z-index, 3);-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--vgl-item-dragging-opacity, 100%);transition:none}.vgl-item__resizer{position:absolute;right:0;bottom:0;box-sizing:border-box;width:var(--vgl-resizer-size);height:var(--vgl-resizer-size);cursor:se-resize}.vgl-item__resizer:before{position:absolute;top:0;right:3px;bottom:3px;left:0;content:"";border:0 solid var(--vgl-resizer-border-color);border-right-width:var(--vgl-resizer-border-width);border-bottom-width:var(--vgl-resizer-border-width)}.vgl-item__resizer--rtl{right:auto;left:0;cursor:sw-resize}.vgl-item__resizer--rtl:before{top:0;right:0;bottom:3px;left:3px;border-right-width:0;border-bottom-width:var(--vgl-resizer-border-width);border-left-width:var(--vgl-resizer-border-width)}')), document.head.appendChild(t);
    }
  } catch (e) {
    console.error("vite-plugin-css-injected-by-js", e);
  }
})();
function o4(t = {}) {
  let e = 0;
  return document.querySelectorAll("body *").forEach((n) => {
    if (t.exclude && (n === t.exclude || t.exclude.contains(n)))
      return;
    const i = window.getComputedStyle(n);
    if (i.position === "static")
      return;
    const o = Number.parseInt(i.zIndex, 10);
    !Number.isNaN(o) && o > e && (e = o);
  }), e;
}
const Pfe = {
  class: "px-12px py-15px",
  style: { "border-bottom": "1px solid var(--ant-color-border-secondary)" }
}, Efe = {
  class: "flex items-center justify-between px-4 py-3 w-full",
  style: { "border-top": "1px solid var(--ant-color-border-secondary)" }
}, J$ = /* @__PURE__ */ Oe({
  __name: "AppOverlay",
  props: {
    open: { type: Boolean },
    title: {},
    mode: { default: "modal" },
    width: { default: 520 },
    bodyHeight: {},
    footer: { type: Boolean, default: !0 },
    headerBorder: { type: Boolean, default: !0 },
    footerBorder: { type: Boolean, default: !0 },
    destroyOnClose: { type: Boolean, default: !1 },
    mask: { type: Boolean, default: !0 }
  },
  emits: ["close"],
  setup(t, { emit: e }) {
    const n = t, i = e, o = _l(), r = A(() => o.isDark ? "#141414" : "#ffffff"), a = A(() => o.isDark ? "#303030" : "#e8e8e8"), l = de(1e3);
    _e(() => n.open, (d) => {
      d && (l.value = Math.max(o4(), 1e3));
    });
    const s = A(() => ({
      wrapper: { padding: 0 },
      content: { padding: 0, background: r.value },
      header: {
        padding: "10px 16px",
        margin: 0,
        background: r.value,
        ...n.headerBorder ? { borderBottom: `1px solid ${a.value}` } : {}
      },
      body: {
        padding: 0,
        background: r.value,
        display: "flex",
        flexDirection: "column",
        ...n.bodyHeight != null ? { height: n.bodyHeight } : {}
      },
      footer: {
        margin: 0,
        padding: "10px 16px",
        ...n.footerBorder ? { borderTop: `1px solid ${a.value}` } : {}
      }
    })), u = de();
    function c() {
      return u.value ?? document.body;
    }
    return (d, f) => t.mode === "modal" ? (re(), ut(I(No), {
      key: 0,
      "mask-style": { background: "rgba(0, 0, 0, 0.2" },
      open: t.open,
      width: t.width,
      "z-index": l.value,
      styles: s.value,
      "destroy-on-close": t.destroyOnClose,
      footer: t.footer ? void 0 : null,
      class: "no-content-padding-modal",
      "body-style": { padding: 0, display: "flex", height: t.bodyHeight, flexDirection: "column" },
      onCancel: f[0] || (f[0] = (h) => i("close"))
    }, bx({
      default: ye(() => [
        F("div", {
          ref_key: "popupContainerRef",
          ref: u,
          style: { position: "relative", flex: "1", "min-height": "0", display: "flex", "flex-direction": "column" }
        }, [
          v(I(xs), { "get-popup-container": c }, {
            default: ye(() => [
              _o(d.$slots, "default")
            ]),
            _: 3
          })
        ], 512)
      ]),
      _: 2
    }, [
      d.$slots.title || t.title ? {
        name: "title",
        fn: ye(() => [
          F("div", Pfe, [
            _o(d.$slots, "title", {}, () => [
              Ve(se(t.title), 1)
            ])
          ])
        ]),
        key: "0"
      } : void 0,
      d.$slots.footer ? {
        name: "footer",
        fn: ye(() => [
          F("div", Efe, [
            _o(d.$slots, "footer")
          ])
        ]),
        key: "1"
      } : void 0
    ]), 1032, ["open", "width", "z-index", "styles", "destroy-on-close", "footer", "body-style"])) : (re(), ut(I(Iae), {
      key: 1,
      open: t.open,
      title: t.title,
      width: t.width,
      "z-index": l.value,
      mask: t.mask,
      "root-style": { zIndex: l.value },
      placement: "right",
      "mask-style": { background: "rgba(0, 0, 0, 0.2)" },
      "body-style": { padding: 0, background: r.value, display: "flex", flexDirection: "column", flex: 1, minHeight: 0 },
      "header-style": { padding: "10px 16px", background: r.value, ...t.headerBorder ? { borderBottom: `1px solid ${a.value}` } : {} },
      "footer-style": { padding: "10px 16px", ...t.footerBorder ? { borderTop: `1px solid ${a.value}` } : {} },
      "destroy-on-close": t.destroyOnClose,
      onClose: f[1] || (f[1] = (h) => i("close"))
    }, bx({
      default: ye(() => [
        F("div", {
          ref_key: "popupContainerRef",
          ref: u,
          style: { position: "relative", flex: "1", "min-height": "0", display: "flex", "flex-direction": "column" }
        }, [
          v(I(xs), { "get-popup-container": c }, {
            default: ye(() => [
              _o(d.$slots, "default")
            ]),
            _: 3
          })
        ], 512)
      ]),
      _: 2
    }, [
      d.$slots.title ? {
        name: "title",
        fn: ye(() => [
          _o(d.$slots, "title")
        ]),
        key: "0"
      } : void 0,
      d.$slots.footer && t.footer ? {
        name: "footer",
        fn: ye(() => [
          _o(d.$slots, "footer")
        ]),
        key: "1"
      } : void 0
    ]), 1032, ["open", "title", "width", "z-index", "mask", "root-style", "body-style", "header-style", "footer-style", "destroy-on-close"]));
  }
});
function r4(t, e, n = 1e3, i) {
  const o = de(null), r = de(!1), a = de(null), { config: l } = Uf(), s = Hc(), u = A(() => s.resolveAll()), c = A(() => {
    const p = t();
    return [
      JSON.stringify(p.map((g) => g.dataSource)),
      JSON.stringify(u.value),
      i?.() ?? 0
    ].join("|");
  });
  let d = !1;
  async function f() {
    const p = t().filter(($) => $.enabled !== !1);
    if (p.length === 0) {
      o.value = null, r.value = !1;
      return;
    }
    const g = e(), m = Math.max(
      Math.ceil((g.to - g.from) / n),
      1e3
    ), y = { from: g.from, to: g.to }, b = l.value.datasourceConfig ?? [], w = new Map(b.map(($) => [$.uid, $]));
    d = !1, r.value = !0, a.value = null;
    try {
      const $ = [];
      for (const C of p) {
        const P = C.dataSource, O = Dv(P.type);
        if (!O)
          continue;
        const E = "datasourceId" in P ? w.get(P.datasourceId ?? "") : void 0, _ = await O.query({
          requestId: C.id,
          range: y,
          intervalMs: m,
          maxDataPoints: n,
          targets: [P],
          scopedVars: u.value,
          _dsCfg: E,
          _variableStates: s.variables
        });
        $.push(..._.data);
      }
      d || (o.value = { data: $, state: "Done" }, a.value = null);
    } catch ($) {
      d || (a.value = $?.message ?? String($));
    } finally {
      d || (r.value = !1);
    }
  }
  _e(c, f, { immediate: !0 }), _e(
    () => {
      const p = e();
      return `${p.from}|${p.to}`;
    },
    f
  );
  function h() {
    d = !0;
  }
  return { response: o, loading: r, error: a, abort: h };
}
const a4 = Symbol("panelEditor");
function _fe(t) {
  Xt(a4, t);
}
function fh() {
  const t = qt(a4);
  if (!t)
    throw new Error("usePanelEditor must be used within a PanelEditorProvider");
  return t;
}
function Ife(t, e, { signal: n, edges: i } = {}) {
  let o, r = null;
  const a = i != null && i.includes("leading"), l = i == null || i.includes("trailing"), s = () => {
    r !== null && (t.apply(o, r), o = void 0, r = null);
  }, u = () => {
    l && s(), h();
  };
  let c = null;
  const d = () => {
    c != null && clearTimeout(c), c = setTimeout(() => {
      c = null, u();
    }, e);
  }, f = () => {
    c !== null && (clearTimeout(c), c = null);
  }, h = () => {
    f(), o = void 0, r = null;
  }, p = () => {
    s();
  }, g = function(...m) {
    if (n?.aborted)
      return;
    o = this, r = m;
    const y = c == null;
    d(), a && y && s();
  };
  return g.schedule = d, g.cancel = h, g.flush = p, n?.addEventListener("abort", h, { once: !0 }), g;
}
function Mfe() {
}
function _a(t, e, n) {
  return n == null ? Math.min(t, e) : Math.min(Math.max(t, e), n);
}
function CI(t) {
  return Object.getOwnPropertySymbols(t).filter((e) => Object.prototype.propertyIsEnumerable.call(t, e));
}
function $I(t) {
  return t == null ? t === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(t);
}
const Afe = "[object RegExp]", Rfe = "[object String]", Dfe = "[object Number]", Nfe = "[object Boolean]", kI = "[object Arguments]", Lfe = "[object Symbol]", zfe = "[object Date]", Bfe = "[object Map]", Ffe = "[object Set]", Vfe = "[object Array]", Qfe = "[object Function]", Hfe = "[object ArrayBuffer]", F1 = "[object Object]", Wfe = "[object Error]", jfe = "[object DataView]", qfe = "[object Uint8Array]", Yfe = "[object Uint8ClampedArray]", Kfe = "[object Uint16Array]", Xfe = "[object Uint32Array]", Zfe = "[object BigUint64Array]", Gfe = "[object Int8Array]", Ufe = "[object Int16Array]", Jfe = "[object Int32Array]", ehe = "[object BigInt64Array]", the = "[object Float32Array]", nhe = "[object Float64Array]";
function TI(t) {
  if (!t || typeof t != "object")
    return !1;
  const e = Object.getPrototypeOf(t);
  return e === null || e === Object.prototype || Object.getPrototypeOf(e) === null ? Object.prototype.toString.call(t) === "[object Object]" : !1;
}
function ihe(t, e) {
  return t === e || Number.isNaN(t) && Number.isNaN(e);
}
function ohe(t, e, n) {
  return Zh(t, e, void 0, void 0, void 0, void 0, n);
}
function Zh(t, e, n, i, o, r, a) {
  const l = a(t, e, n, i, o, r);
  if (l !== void 0)
    return l;
  if (typeof t == typeof e)
    switch (typeof t) {
      case "bigint":
      case "string":
      case "boolean":
      case "symbol":
      case "undefined":
        return t === e;
      case "number":
        return t === e || Object.is(t, e);
      case "function":
        return t === e;
      case "object":
        return mp(t, e, r, a);
    }
  return mp(t, e, r, a);
}
function mp(t, e, n, i) {
  if (Object.is(t, e))
    return !0;
  let o = $I(t), r = $I(e);
  if (o === kI && (o = F1), r === kI && (r = F1), o !== r)
    return !1;
  switch (o) {
    case Rfe:
      return t.toString() === e.toString();
    case Dfe: {
      const s = t.valueOf(), u = e.valueOf();
      return ihe(s, u);
    }
    case Nfe:
    case zfe:
    case Lfe:
      return Object.is(t.valueOf(), e.valueOf());
    case Afe:
      return t.source === e.source && t.flags === e.flags;
    case Qfe:
      return t === e;
  }
  n = n ?? /* @__PURE__ */ new Map();
  const a = n.get(t), l = n.get(e);
  if (a != null && l != null)
    return a === e;
  n.set(t, e), n.set(e, t);
  try {
    switch (o) {
      case Bfe: {
        if (t.size !== e.size)
          return !1;
        for (const [s, u] of t.entries())
          if (!e.has(s) || !Zh(u, e.get(s), s, t, e, n, i))
            return !1;
        return !0;
      }
      case Ffe: {
        if (t.size !== e.size)
          return !1;
        const s = Array.from(t.values()), u = Array.from(e.values());
        for (let c = 0; c < s.length; c++) {
          const d = s[c], f = u.findIndex((h) => Zh(d, h, void 0, t, e, n, i));
          if (f === -1)
            return !1;
          u.splice(f, 1);
        }
        return !0;
      }
      case Vfe:
      case qfe:
      case Yfe:
      case Kfe:
      case Xfe:
      case Zfe:
      case Gfe:
      case Ufe:
      case Jfe:
      case ehe:
      case the:
      case nhe: {
        if (typeof Buffer < "u" && Buffer.isBuffer(t) !== Buffer.isBuffer(e) || t.length !== e.length)
          return !1;
        for (let s = 0; s < t.length; s++)
          if (!Zh(t[s], e[s], s, t, e, n, i))
            return !1;
        return !0;
      }
      case Hfe:
        return t.byteLength !== e.byteLength ? !1 : mp(new Uint8Array(t), new Uint8Array(e), n, i);
      case jfe:
        return t.byteLength !== e.byteLength || t.byteOffset !== e.byteOffset ? !1 : mp(new Uint8Array(t), new Uint8Array(e), n, i);
      case Wfe:
        return t.name === e.name && t.message === e.message;
      case F1: {
        if (!(mp(t.constructor, e.constructor, n, i) || TI(t) && TI(e)))
          return !1;
        const s = [...Object.keys(t), ...CI(t)], u = [...Object.keys(e), ...CI(e)];
        if (s.length !== u.length)
          return !1;
        for (let c = 0; c < s.length; c++) {
          const d = s[c], f = t[d];
          if (!Object.hasOwn(e, d))
            return !1;
          const h = e[d];
          if (!Zh(f, h, d, t, e, n, i))
            return !1;
        }
        return !0;
      }
      default:
        return !1;
    }
  } finally {
    n.delete(t), n.delete(e);
  }
}
function rhe(t, e) {
  return ohe(t, e, Mfe);
}
const ahe = "_splitView_pzp7c_6", lhe = "_sashContainer_pzp7c_13", she = "_sash_pzp7c_13", uhe = "_splitViewContainer_pzp7c_24", che = "_splitViewView_pzp7c_31", dhe = "_vertical_pzp7c_37", fhe = "_horizontal_pzp7c_41", hhe = "_separatorBorder_pzp7c_45", pu = {
  splitView: ahe,
  sashContainer: lhe,
  sash: she,
  splitViewContainer: uhe,
  splitViewView: che,
  vertical: dhe,
  horizontal: fhe,
  separatorBorder: hhe
};
let l4 = !1, s4 = !1, Rh;
typeof navigator == "object" && (Rh = navigator.userAgent, s4 = Rh.includes("Macintosh"), l4 = (Rh.includes("Macintosh") || Rh.includes("iPad") || Rh.includes("iPhone")) && !!navigator.maxTouchPoints && navigator.maxTouchPoints > 0);
const u4 = l4, phe = s4;
let ghe = class {
  _size;
  getSize() {
    return this._size;
  }
  setSize(e) {
    this._size = e;
  }
};
function km(t, e) {
  const n = t.length, i = n - e.length;
  return i >= 0 && t.slice(i, n) === e;
}
function mhe(t) {
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
}
var PI = { exports: {} }, EI;
function vhe() {
  return EI || (EI = 1, (function(t) {
    var e = Object.prototype.hasOwnProperty, n = "~";
    function i() {
    }
    Object.create && (i.prototype = /* @__PURE__ */ Object.create(null), new i().__proto__ || (n = !1));
    function o(s, u, c) {
      this.fn = s, this.context = u, this.once = c || !1;
    }
    function r(s, u, c, d, f) {
      if (typeof c != "function")
        throw new TypeError("The listener must be a function");
      var h = new o(c, d || s, f), p = n ? n + u : u;
      return s._events[p] ? s._events[p].fn ? s._events[p] = [s._events[p], h] : s._events[p].push(h) : (s._events[p] = h, s._eventsCount++), s;
    }
    function a(s, u) {
      --s._eventsCount === 0 ? s._events = new i() : delete s._events[u];
    }
    function l() {
      this._events = new i(), this._eventsCount = 0;
    }
    l.prototype.eventNames = function() {
      var s = [], u, c;
      if (this._eventsCount === 0) return s;
      for (c in u = this._events)
        e.call(u, c) && s.push(n ? c.slice(1) : c);
      return Object.getOwnPropertySymbols ? s.concat(Object.getOwnPropertySymbols(u)) : s;
    }, l.prototype.listeners = function(s) {
      var u = n ? n + s : s, c = this._events[u];
      if (!c) return [];
      if (c.fn) return [c.fn];
      for (var d = 0, f = c.length, h = new Array(f); d < f; d++)
        h[d] = c[d].fn;
      return h;
    }, l.prototype.listenerCount = function(s) {
      var u = n ? n + s : s, c = this._events[u];
      return c ? c.fn ? 1 : c.length : 0;
    }, l.prototype.emit = function(s, u, c, d, f, h) {
      var p = n ? n + s : s;
      if (!this._events[p]) return !1;
      var g = this._events[p], m = arguments.length, y, b;
      if (g.fn) {
        switch (g.once && this.removeListener(s, g.fn, void 0, !0), m) {
          case 1:
            return g.fn.call(g.context), !0;
          case 2:
            return g.fn.call(g.context, u), !0;
          case 3:
            return g.fn.call(g.context, u, c), !0;
          case 4:
            return g.fn.call(g.context, u, c, d), !0;
          case 5:
            return g.fn.call(g.context, u, c, d, f), !0;
          case 6:
            return g.fn.call(g.context, u, c, d, f, h), !0;
        }
        for (b = 1, y = new Array(m - 1); b < m; b++)
          y[b - 1] = arguments[b];
        g.fn.apply(g.context, y);
      } else {
        var w = g.length, $;
        for (b = 0; b < w; b++)
          switch (g[b].once && this.removeListener(s, g[b].fn, void 0, !0), m) {
            case 1:
              g[b].fn.call(g[b].context);
              break;
            case 2:
              g[b].fn.call(g[b].context, u);
              break;
            case 3:
              g[b].fn.call(g[b].context, u, c);
              break;
            case 4:
              g[b].fn.call(g[b].context, u, c, d);
              break;
            default:
              if (!y) for ($ = 1, y = new Array(m - 1); $ < m; $++)
                y[$ - 1] = arguments[$];
              g[b].fn.apply(g[b].context, y);
          }
      }
      return !0;
    }, l.prototype.on = function(s, u, c) {
      return r(this, s, u, c, !1);
    }, l.prototype.once = function(s, u, c) {
      return r(this, s, u, c, !0);
    }, l.prototype.removeListener = function(s, u, c, d) {
      var f = n ? n + s : s;
      if (!this._events[f]) return this;
      if (!u)
        return a(this, f), this;
      var h = this._events[f];
      if (h.fn)
        h.fn === u && (!d || h.once) && (!c || h.context === c) && a(this, f);
      else {
        for (var p = 0, g = [], m = h.length; p < m; p++)
          (h[p].fn !== u || d && !h[p].once || c && h[p].context !== c) && g.push(h[p]);
        g.length ? this._events[f] = g.length === 1 ? g[0] : g : a(this, f);
      }
      return this;
    }, l.prototype.removeAllListeners = function(s) {
      var u;
      return s ? (u = n ? n + s : s, this._events[u] && a(this, u)) : (this._events = new i(), this._eventsCount = 0), this;
    }, l.prototype.off = l.prototype.removeListener, l.prototype.addListener = l.prototype.on, l.prefixed = n, l.EventEmitter = l, t.exports = l;
  })(PI)), PI.exports;
}
var yhe = vhe();
const ek = /* @__PURE__ */ mhe(yhe);
function _I(t, e) {
  const n = t.indexOf(e);
  n !== -1 && (t.splice(n, 1), t.unshift(e));
}
function V1(t, e) {
  const n = t.indexOf(e);
  n !== -1 && (t.splice(n, 1), t.push(e));
}
function Ur(t, e, n = 1) {
  const i = Math.max(0, Math.ceil((e - t) / n)), o = Array.from({ length: i });
  let r = -1;
  for (; ++r < i; )
    o[r] = t + r * n;
  return o;
}
const bhe = "_sash_j5cmb_7", xhe = "_disabled_j5cmb_15", Ohe = "_mac_j5cmb_19", She = "_vertical_j5cmb_19", whe = "_minimum_j5cmb_23", Che = "_maximum_j5cmb_27", $he = "_horizontal_j5cmb_31", khe = "_hover_j5cmb_126", The = "_active_j5cmb_127", Ko = {
  sash: bhe,
  disabled: xhe,
  mac: Ohe,
  vertical: She,
  minimum: whe,
  maximum: Che,
  horizontal: $he,
  hover: khe,
  active: The
};
var Ma = /* @__PURE__ */ ((t) => (t[t.Vertical = 0] = "Vertical", t[t.Horizontal = 1] = "Horizontal", t))(Ma || {}), fc = /* @__PURE__ */ ((t) => (t[t.Disabled = 0] = "Disabled", t[t.Minimum = 1] = "Minimum", t[t.Maximum = 2] = "Maximum", t[t.Enabled = 3] = "Enabled", t))(fc || {});
let c4 = u4 ? 20 : 8;
const d4 = new ek();
function Phe(t) {
  c4 = t, d4.emit("onDidChangeGlobalSize", t);
}
let II = class extends ek {
  el;
  layoutProvider;
  orientation;
  size;
  hoverDelay = 300;
  hoverDelayerFunc = (e) => e.classList.add("sash-hover", Ko.hover);
  hoverDelayer = Ife(
    this.hoverDelayerFunc,
    this.hoverDelay
  );
  _state = 3;
  get state() {
    return this._state;
  }
  /**
   * The state of a sash defines whether it can be interacted with by the user
   * as well as what mouse cursor to use, when hovered.
   */
  set state(e) {
    this._state !== e && (this.el.classList.toggle(
      Ko.disabled,
      e === 0
      /* Disabled */
    ), this.el.classList.toggle(
      "sash-disabled",
      e === 0
      /* Disabled */
    ), this.el.classList.toggle(
      Ko.minimum,
      e === 1
      /* Minimum */
    ), this.el.classList.toggle(
      "sash-minimum",
      e === 1
      /* Minimum */
    ), this.el.classList.toggle(
      Ko.maximum,
      e === 2
      /* Maximum */
    ), this.el.classList.toggle(
      "sash-maximum",
      e === 2
      /* Maximum */
    ), this._state = e, this.emit("enablementChange", e));
  }
  constructor(e, n, i) {
    super(), this.el = document.createElement("div"), this.el.classList.add("sash", Ko.sash), this.el.dataset.testid = "sash", e.append(this.el), phe && this.el.classList.add("sash-mac", Ko.mac), this.el.addEventListener("pointerdown", this.onPointerStart), this.el.addEventListener("dblclick", this.onPointerDoublePress), this.el.addEventListener("mouseenter", this.onMouseEnter), this.el.addEventListener("mouseleave", this.onMouseLeave), typeof i.size == "number" ? (this.size = i.size, i.orientation === 0 ? this.el.style.width = `${this.size}px` : this.el.style.height = `${this.size}px`) : (this.size = c4, d4.on("onDidChangeGlobalSize", (o) => {
      this.size = o, this.layout();
    })), this.layoutProvider = n, this.orientation = i.orientation ?? 0, this.orientation === 1 ? (this.el.classList.add("sash-horizontal", Ko.horizontal), this.el.classList.remove("sash-vertical", Ko.vertical)) : (this.el.classList.remove("sash-horizontal", Ko.horizontal), this.el.classList.add("sash-vertical", Ko.vertical)), i.skipInitialLayout || this.layout();
  }
  onPointerStart = (e) => {
    const n = e.pageX, i = e.pageY, o = {
      startX: n,
      currentX: n,
      startY: i,
      currentY: i
    };
    this.el.classList.add("sash-active", Ko.active), this.emit("start", o), this.el.setPointerCapture(e.pointerId);
    const r = (l) => {
      l.preventDefault();
      const s = {
        startX: n,
        currentX: l.pageX,
        startY: i,
        currentY: l.pageY
      };
      this.emit("change", s);
    }, a = (l) => {
      l.preventDefault(), this.el.classList.remove("sash-active", Ko.active), this.hoverDelayer.cancel(), this.emit("end"), this.el.releasePointerCapture(l.pointerId), globalThis.removeEventListener("pointermove", r), globalThis.removeEventListener("pointerup", a);
    };
    globalThis.addEventListener("pointermove", r), globalThis.addEventListener("pointerup", a);
  };
  onPointerDoublePress = () => {
    this.emit("reset");
  };
  onMouseEnter = () => {
    this.el.classList.contains(Ko.active) ? (this.hoverDelayer.cancel(), this.el.classList.add("sash-hover", Ko.hover)) : this.hoverDelayer(this.el);
  };
  onMouseLeave = () => {
    this.hoverDelayer.cancel(), this.el.classList.remove("sash-hover", Ko.hover);
  };
  /**
   * Layout the sash. The sash will size and position itself
   * based on its provided {@link SashLayoutProvider layout provider}.
   */
  layout() {
    if (this.orientation === 0) {
      const e = this.layoutProvider;
      this.el.style.left = `${e.getVerticalSashLeft(this) - this.size / 2}px`, e.getVerticalSashTop && (this.el.style.top = `${e.getVerticalSashTop(this)}px`), e.getVerticalSashHeight && (this.el.style.height = `${e.getVerticalSashHeight(this)}px`);
    } else {
      const e = this.layoutProvider;
      this.el.style.top = `${e.getHorizontalSashTop(this) - this.size / 2}px`, e.getHorizontalSashLeft && (this.el.style.left = `${e.getHorizontalSashLeft(this)}px`), e.getHorizontalSashWidth && (this.el.style.width = `${e.getHorizontalSashWidth(this)}px`);
    }
  }
  dispose() {
    this.el.removeEventListener("pointerdown", this.onPointerStart), this.el.removeEventListener("dblclick", this.onPointerDoublePress), this.el.removeEventListener("mouseenter", this.onMouseEnter), this.el.removeEventListener("mouseleave", this.onMouseLeave), this.el.remove();
  }
};
const f4 = {
  /**
   * When adding or removing views, distribute the delta space among
   * all other views.
   */
  Distribute: { type: "distribute" },
  /**
   * When adding or removing views, split the delta space with another
   * specific view, indexed by the provided `index`.
   */
  Split: (t) => ({ type: "split", index: t }),
  /**
   * When adding or removing views, assume the view is invisible.
   */
  Invisible: (t) => ({ type: "invisible", cachedVisibleSize: t })
};
var d0 = /* @__PURE__ */ ((t) => (t[t.Normal = 0] = "Normal", t[t.Low = 1] = "Low", t[t.High = 2] = "High", t))(d0 || {});
let h4 = class {
  container;
  view;
  _size;
  _cachedVisibleSize = void 0;
  constructor(e, n, i) {
    this.container = e, this.view = n, this.container.classList.add("split-view-view", pu.splitViewView), this.container.dataset.testid = "split-view-view", typeof i == "number" ? (this._size = i, this._cachedVisibleSize = void 0, e.classList.add("split-view-view-visible")) : (this._size = 0, this._cachedVisibleSize = i.cachedVisibleSize);
  }
  set size(e) {
    this._size = e;
  }
  get size() {
    return this._size;
  }
  get priority() {
    return this.view.priority;
  }
  get snap() {
    return !!this.view.snap;
  }
  get visible() {
    return this._cachedVisibleSize === void 0;
  }
  setVisible(e, n) {
    e !== this.visible && (e ? (this.size = _a(
      this._cachedVisibleSize ?? 0,
      this.view.minimumSize,
      this.view.maximumSize
    ), this._cachedVisibleSize = void 0) : (this._cachedVisibleSize = typeof n == "number" ? n : this.size, this.size = 0), this.container.classList.toggle("split-view-view-visible", e), this.view.setVisible && this.view.setVisible(e));
  }
  get minimumSize() {
    return this.visible ? this.view.minimumSize : 0;
  }
  get maximumSize() {
    return this.visible ? this.view.maximumSize : 0;
  }
  get cachedVisibleSize() {
    return this._cachedVisibleSize;
  }
}, Ehe = class extends h4 {
  layout(e) {
    if (!this.visible) {
      this.container.style.height = "0px", this.container.style.top = `${e}px`, this.container.style.left = "0px", this.container.style.width = "100%";
      return;
    }
    this.container.style.top = `${e}px`, this.container.style.height = `${this.size}px`, this.container.style.left = "0px", this.container.style.width = "100%", this.view.layout(this.size, e);
  }
}, _he = class extends h4 {
  layout(e) {
    if (!this.visible) {
      this.container.style.width = "0px", this.container.style.left = `${e}px`, this.container.style.top = "0px", this.container.style.height = "100%";
      return;
    }
    this.container.style.left = `${e}px`, this.container.style.width = `${this.size}px`, this.container.style.top = "0px", this.container.style.height = "100%", this.view.layout(this.size, e);
  }
}, Ihe = class extends ek {
  onDidChange;
  onDidDragStart;
  onDidDragEnd;
  _orientation;
  get orientation() {
    return this._orientation;
  }
  set orientation(e) {
    this._orientation = e;
  }
  sashContainer;
  size = 0;
  contentSize = 0;
  proportions = void 0;
  viewItems = [];
  sashItems = [];
  sashDragState;
  _proportionalLayout;
  get proportionalLayout() {
    return this._proportionalLayout;
  }
  set proportionalLayout(e) {
    this._proportionalLayout = e;
  }
  getSashOrthogonalSize;
  _startSnappingEnabled = !0;
  get startSnappingEnabled() {
    return this._startSnappingEnabled;
  }
  set startSnappingEnabled(e) {
    this._startSnappingEnabled !== e && (this._startSnappingEnabled = e, this.updateSashEnablement());
  }
  _endSnappingEnabled = !0;
  get endSnappingEnabled() {
    return this._endSnappingEnabled;
  }
  set endSnappingEnabled(e) {
    this._endSnappingEnabled !== e && (this._endSnappingEnabled = e, this.updateSashEnablement());
  }
  /** Create a new {@link SplitView} instance. */
  constructor(e, n = {}, i, o, r) {
    if (super(), this._orientation = n.orientation ?? Ma.Vertical, this._proportionalLayout = n.proportionalLayout ?? !0, this.getSashOrthogonalSize = n.getSashOrthogonalSize, i && (this.onDidChange = i), o && (this.onDidDragStart = o), r && (this.onDidDragEnd = r), this.sashContainer = document.createElement("div"), this.sashContainer.classList.add("sash-container", pu.sashContainer), e.prepend(this.sashContainer), n.descriptor) {
      this.size = n.descriptor.size;
      for (const [a, l] of n.descriptor.views.entries()) {
        const s = l.size, u = l.container, c = l.view;
        this.addView(u, c, s, a, !0);
      }
      this.contentSize = this.viewItems.reduce((a, l) => a + l.size, 0), this.saveProportions();
    }
  }
  addView(e, n, i, o = this.viewItems.length, r) {
    let a;
    typeof i == "number" ? a = i : i.type === "split" ? a = this.getViewSize(i.index) / 2 : i.type === "invisible" ? a = { cachedVisibleSize: i.cachedVisibleSize } : a = n.minimumSize;
    const l = this.orientation === Ma.Vertical ? new Ehe(e, n, a) : new _he(e, n, a);
    if (this.viewItems.splice(o, 0, l), this.viewItems.length > 1) {
      const s = this.orientation === Ma.Vertical ? new II(
        this.sashContainer,
        {
          getHorizontalSashTop: (d) => this.getSashPosition(d),
          getHorizontalSashWidth: this.getSashOrthogonalSize
        },
        { orientation: Ma.Horizontal }
      ) : new II(
        this.sashContainer,
        {
          getVerticalSashLeft: (d) => this.getSashPosition(d),
          getVerticalSashHeight: this.getSashOrthogonalSize
        },
        { orientation: Ma.Vertical }
      ), u = this.orientation === Ma.Vertical ? (d) => ({
        sash: s,
        start: d.startY,
        current: d.currentY
      }) : (d) => ({
        sash: s,
        start: d.startX,
        current: d.currentX
      });
      s.on("start", (d) => {
        this.emit("sashDragStart"), this.onSashStart(u(d));
        const f = this.viewItems.map((h) => h.size);
        this.onDidDragStart?.(f);
      }), s.on("change", (d) => this.onSashChange(u(d))), s.on("end", () => {
        this.emit("sashDragEnd");
        let d = this.sashItems.findIndex((h) => h.sash === s);
        if (d === -1) {
          const h = s.el;
          h && (d = this.sashItems.findIndex((p) => p.sash.el === h));
        }
        this.onSashEnd(d);
        const f = this.viewItems.map((h) => h.size);
        this.onDidDragEnd?.(f);
      }), s.on("reset", () => {
        let d = this.sashItems.findIndex((m) => m.sash === s);
        if (d === -1) {
          const m = s.el;
          m && (d = this.sashItems.findIndex((y) => y.sash.el === m));
        }
        const f = Ur(d, -1, -1), h = Ur(d + 1, this.viewItems.length), p = this.findFirstSnapIndex(f), g = this.findFirstSnapIndex(h);
        typeof p == "number" && !this.viewItems[p].visible || typeof g == "number" && !this.viewItems[g].visible || this.emit("sashreset", d);
      });
      const c = { sash: s };
      this.sashItems.splice(o - 1, 0, c);
    }
    r || this.relayout(), !r && typeof i != "number" && i.type === "distribute" && this.distributeViewSizes();
  }
  removeView(e, n) {
    if (e < 0 || e >= this.viewItems.length)
      throw new Error("Index out of bounds");
    const i = this.viewItems.splice(e, 1)[0].view;
    if (this.viewItems.length > 0) {
      const o = Math.max(e - 1, 0);
      this.sashItems.splice(o, 1)[0].sash.dispose();
    }
    return this.relayout(), n && n.type === "distribute" && this.distributeViewSizes(), i;
  }
  moveView(e, n, i) {
    const o = this.getViewCachedVisibleSize(n), r = o === void 0 ? this.getViewSize(n) : f4.Invisible(o), a = this.removeView(n);
    this.addView(e, a, r, i);
  }
  getViewCachedVisibleSize(e) {
    if (e < 0 || e >= this.viewItems.length)
      throw new Error("Index out of bounds");
    return this.viewItems[e].cachedVisibleSize;
  }
  layout(e = this.size) {
    if (this.viewItems.length === 0)
      return;
    const n = Math.max(this.size, this.contentSize);
    if (this.size = e, this.proportions)
      for (let i = 0; i < this.viewItems.length; i++) {
        const o = this.viewItems[i];
        o && this.proportions[i] !== void 0 && (o.size = _a(
          Math.round(this.proportions[i] * e),
          o.minimumSize,
          o.maximumSize
        ));
      }
    else {
      const i = Ur(0, this.viewItems.length), o = i.filter(
        (a) => this.viewItems[a] && this.viewItems[a].priority === 1
        /* Low */
      ), r = i.filter(
        (a) => this.viewItems[a] && this.viewItems[a].priority === 2
        /* High */
      );
      this.resize(
        this.viewItems.length - 1,
        e - n,
        void 0,
        o,
        r
      );
    }
    this.distributeEmptySpace(), this.layoutViews();
  }
  resizeView(e, n) {
    if (e < 0 || e >= this.viewItems.length)
      return;
    const i = Ur(0, this.viewItems.length).filter((l) => l !== e), o = [
      ...i.filter(
        (l) => this.viewItems[l].priority === 1
        /* Low */
      ),
      e
    ], r = i.filter(
      (l) => this.viewItems[l].priority === 2
      /* High */
    ), a = this.viewItems[e];
    n = Math.round(n), n = _a(n, a.minimumSize, Math.min(a.maximumSize, this.size)), a.size = n, this.relayout(o, r);
  }
  resizeViews(e) {
    for (let [n, i] of e.entries()) {
      const o = this.viewItems[n];
      i = Math.round(i), i = _a(
        i,
        o.minimumSize,
        Math.min(o.maximumSize, this.size)
      ), o.size = i;
    }
    this.contentSize = this.viewItems.reduce((n, i) => n + i.size, 0), this.saveProportions(), this.layout(this.size);
  }
  getViewSize(e) {
    return e < 0 || e >= this.viewItems.length ? -1 : this.viewItems[e].size;
  }
  isViewVisible(e) {
    if (e < 0 || e >= this.viewItems.length)
      throw new Error("Index out of bounds");
    return this.viewItems[e].visible;
  }
  setViewVisible(e, n) {
    if (e < 0 || e >= this.viewItems.length)
      throw new Error("Index out of bounds");
    this.viewItems[e].setVisible(n), this.emit("sashchange", e), this.distributeEmptySpace(), this.layoutViews(), this.saveProportions();
  }
  distributeViewSizes() {
    const e = [];
    let n = 0;
    for (const l of this.viewItems)
      l.maximumSize - l.minimumSize > 0 && (e.push(l), n += l.size);
    const i = Math.floor(n / e.length);
    for (const l of e)
      l.size = _a(i, l.minimumSize, l.maximumSize);
    const o = Ur(0, this.viewItems.length), r = o.filter(
      (l) => this.viewItems[l].priority === 1
      /* Low */
    ), a = o.filter(
      (l) => this.viewItems[l].priority === 2
      /* High */
    );
    this.relayout(r, a);
  }
  dispose() {
    for (const e of this.sashItems) e.sash.dispose();
    this.sashItems = [], this.viewItems = [], this.sashContainer && this.sashContainer.parentElement && this.sashContainer.remove();
  }
  onSashStart({ sash: e, start: n, current: i }) {
    let o = this.sashItems.findIndex((p) => p.sash === e);
    if (o === -1) {
      const p = e.el;
      p && (o = this.sashItems.findIndex((g) => g.sash.el === p));
    }
    const r = this.viewItems.map((p) => p.size), a = Ur(o, -1, -1), l = Ur(o + 1, this.viewItems.length), s = this.getMinDelta(a, l, r), u = this.getMaxDelta(a, l, r);
    let c, d;
    const f = this.findFirstSnapIndex(a), h = this.findFirstSnapIndex(l);
    if (typeof f == "number") {
      const p = this.viewItems[f], g = Math.floor(p.minimumSize / 2);
      c = {
        index: f,
        limitDelta: p.visible ? s - g : s + g,
        size: p.size
      };
    }
    if (typeof h == "number") {
      const p = this.viewItems[h], g = Math.floor(p.minimumSize / 2);
      d = {
        index: h,
        limitDelta: p.visible ? u + g : u - g,
        size: p.size
      };
    }
    this.sashDragState = {
      index: o,
      start: n,
      current: i,
      sizes: r,
      minDelta: s,
      maxDelta: u,
      snapBefore: c,
      snapAfter: d
    };
  }
  onSashChange({ current: e }) {
    const { index: n, start: i, sizes: o, minDelta: r, maxDelta: a, snapBefore: l, snapAfter: s } = this.sashDragState, u = e - i;
    this.resize(n, u, o, void 0, void 0, r, a, l, s), this.distributeEmptySpace(), this.layoutViews();
  }
  onSashEnd(e) {
    this.emit("sashchange", e), this.sashDragState = void 0, this.saveProportions();
    const n = this.viewItems.map((i) => i.size);
    this.onDidChange?.(n);
  }
  getMinDelta(e, n, i) {
    const o = e.reduce(
      (a, l) => a + (this.viewItems[l].minimumSize - i[l]),
      0
    ), r = n.reduce(
      (a, l) => a + (i[l] - this.viewItems[l].maximumSize),
      0
    );
    return Math.max(o, r);
  }
  getMaxDelta(e, n, i) {
    const o = e.reduce(
      (a, l) => a + (this.viewItems[l].maximumSize - i[l]),
      0
    ), r = n.reduce(
      (a, l) => a + (i[l] - this.viewItems[l].minimumSize),
      0
    );
    return Math.min(r, o);
  }
  resize(e, n, i, o, r, a = Number.NEGATIVE_INFINITY, l = Number.POSITIVE_INFINITY, s, u) {
    if (e < 0 || e >= this.viewItems.length || this.viewItems.length === 0)
      return 0;
    const c = Ur(e, -1, -1), d = Ur(e + 1, this.viewItems.length);
    if (r)
      for (const E of r)
        _I(c, E), _I(d, E);
    if (o)
      for (const E of o)
        V1(c, E), V1(d, E);
    const f = i ?? this.viewItems.map((E) => E?.size || 0), h = c.map((E) => this.viewItems[E]), p = c.map((E) => f[E]), g = d.map((E) => this.viewItems[E]), m = d.map((E) => f[E]), y = c.reduce(
      (E, _) => E + (this.viewItems[_].minimumSize - f[_]),
      0
    ), b = c.reduce(
      (E, _) => E + (this.viewItems[_].maximumSize - f[_]),
      0
    ), w = d.length === 0 ? Number.POSITIVE_INFINITY : d.reduce(
      (E, _) => E + (f[_] - this.viewItems[_].minimumSize),
      0
    ), $ = d.length === 0 ? Number.NEGATIVE_INFINITY : d.reduce(
      (E, _) => E + (f[_] - this.viewItems[_].maximumSize),
      0
    ), C = Math.max(y, $, a), P = Math.min(w, b, l);
    let O = !1;
    if (s) {
      const E = this.viewItems[s.index], _ = n >= s.limitDelta;
      O = _ !== E.visible, E.setVisible(_, s.size);
    }
    if (!O && u) {
      const E = this.viewItems[u.index], _ = n < u.limitDelta;
      O = _ !== E.visible, E.setVisible(_, u.size);
    }
    if (O)
      return this.resize(
        e,
        n,
        i,
        o,
        r,
        a,
        l
      );
    n = _a(n, C, P);
    for (let E = 0, _ = n; E < h.length; E++) {
      const D = h[E];
      if (!D)
        continue;
      const M = _a(
        p[E] + _,
        D.minimumSize,
        D.maximumSize
      ), N = M - p[E];
      _ -= N, D.size = M;
    }
    for (let E = 0, _ = n; E < g.length; E++) {
      const D = g[E];
      if (!D)
        continue;
      const M = _a(
        m[E] - _,
        D.minimumSize,
        D.maximumSize
      ), N = M - m[E];
      _ += N, D.size = M;
    }
    return n;
  }
  distributeEmptySpace(e) {
    if (this.viewItems.length === 0)
      return;
    const n = this.viewItems.reduce((u, c) => u + c.size, 0);
    let i = this.size - n;
    const o = Ur(0, this.viewItems.length), r = [], a = o.filter(
      (u) => this.viewItems[u].priority === 1
      /* Low */
    ), l = o.filter(
      (u) => this.viewItems[u].priority === 0
      /* Normal */
    ), s = o.filter(
      (u) => this.viewItems[u].priority === 2
      /* High */
    );
    r.push(
      ...s,
      ...l,
      ...a
    ), typeof e == "number" && V1(r, e);
    for (let u = 0; i !== 0 && u < r.length; u++) {
      const c = this.viewItems[r[u]];
      if (!c)
        continue;
      const d = _a(
        c.size + i,
        c.minimumSize,
        c.maximumSize
      ), f = d - c.size;
      i -= f, c.size = d;
    }
    this.contentSize = this.viewItems.reduce((u, c) => u + c.size, 0);
  }
  layoutViews() {
    this.contentSize = this.viewItems.reduce((n, i) => n + i.size, 0);
    let e = 0;
    for (const n of this.viewItems)
      n && (n.layout(e), e += n.size);
    for (const n of this.sashItems) n.sash.layout();
    this.updateSashEnablement();
  }
  saveProportions() {
    this.proportionalLayout && this.contentSize > 0 && (this.proportions = this.viewItems.map((e) => e.size / this.contentSize));
  }
  relayout(e, n) {
    const i = this.viewItems.reduce((o, r) => o + r.size, 0);
    this.resize(
      this.viewItems.length - 1,
      this.size - i,
      void 0,
      e,
      n,
      Number.NEGATIVE_INFINITY,
      Number.POSITIVE_INFINITY
    ), this.distributeEmptySpace(), this.layoutViews(), this.saveProportions();
  }
  getSashPosition(e) {
    let n = -1;
    for (let o = 0; o < this.sashItems.length; o++)
      if (this.sashItems[o].sash === e) {
        n = o;
        break;
      }
    if (n === -1) {
      const o = e.el || e;
      if (o) {
        for (let r = 0; r < this.sashItems.length; r++)
          if ((this.sashItems[r].sash.el || this.sashItems[r].sash) === o) {
            n = r;
            break;
          }
      }
    }
    if (n === -1)
      return 0;
    let i = 0;
    for (let o = 0; o <= n; o++)
      this.viewItems[o] && (i += this.viewItems[o].size);
    return i;
  }
  findFirstSnapIndex(e) {
    for (const n of e) {
      const i = this.viewItems[n];
      if (i.visible && i.snap)
        return n;
    }
    for (const n of e) {
      const i = this.viewItems[n];
      if (i.visible && i.maximumSize - i.minimumSize > 0)
        return;
      if (!i.visible && i.snap)
        return n;
    }
  }
  updateSashEnablement() {
    let e = !1;
    const n = this.viewItems.map(
      (s) => e = s.size - s.minimumSize > 0 || e
    );
    e = !1;
    const i = this.viewItems.map(
      (s) => e = s.maximumSize - s.size > 0 || e
    ), o = [...this.viewItems].toReversed();
    e = !1;
    const r = o.map((s) => e = s.size - s.minimumSize > 0 || e).toReversed();
    e = !1;
    const a = o.map((s) => e = s.maximumSize - s.size > 0 || e).toReversed();
    let l = 0;
    for (let s = 0; s < this.sashItems.length; s++) {
      const { sash: u } = this.sashItems[s], c = this.viewItems[s];
      l += c.size;
      const d = !(n[s] && a[s + 1]), f = !(i[s] && r[s + 1]);
      if (d && f) {
        const h = Ur(s, -1, -1), p = Ur(s + 1, this.viewItems.length), g = this.findFirstSnapIndex(h), m = this.findFirstSnapIndex(p), y = typeof g == "number" && !this.viewItems[g].visible, b = typeof m == "number" && !this.viewItems[m].visible;
        y && r[s] && (l > 0 || this.startSnappingEnabled) ? u.state = fc.Minimum : b && n[s] && (l < this.contentSize || this.endSnappingEnabled) ? u.state = fc.Maximum : u.state = fc.Disabled;
      } else d && !f ? u.state = fc.Minimum : !d && f ? u.state = fc.Maximum : u.state = fc.Enabled;
    }
  }
}, Rd = class {
  size;
  constructor(e) {
    this.size = e;
  }
  getPreferredSize() {
    return this.size;
  }
}, MI = class {
  proportion;
  layoutService;
  constructor(e, n) {
    this.proportion = e, this.layoutService = n;
  }
  getPreferredSize() {
    return this.proportion * this.layoutService.getSize();
  }
}, Tm = class {
  getPreferredSize() {
  }
}, AI = class {
  minimumSize = 0;
  maximumSize = Number.POSITIVE_INFINITY;
  element;
  priority;
  snap;
  layoutService;
  layoutStrategy;
  get preferredSize() {
    return this.layoutStrategy.getPreferredSize();
  }
  set preferredSize(e) {
    if (typeof e == "number")
      this.layoutStrategy = new Rd(e);
    else if (typeof e == "string") {
      const n = e.trim();
      if (km(n, "%")) {
        const i = Number(n.slice(0, -1)) / 100;
        this.layoutStrategy = new MI(
          i,
          this.layoutService
        );
      } else if (km(n, "px")) {
        const i = Number(n.slice(0, -2));
        this.layoutStrategy = new Rd(i);
      } else if (typeof Number.parseFloat(n) == "number") {
        const i = Number.parseFloat(n);
        this.layoutStrategy = new Rd(i);
      } else
        this.layoutStrategy = new Tm();
    } else
      this.layoutStrategy = new Tm();
  }
  constructor(e, n) {
    if (this.layoutService = e, this.element = n.element, this.snap = typeof n.snap == "boolean" ? n.snap : !1, this.minimumSize = this.snap ? 0 : typeof n.minimumSize == "number" ? n.minimumSize : 30, this.maximumSize = typeof n.maximumSize == "number" ? n.maximumSize : Number.POSITIVE_INFINITY, typeof n.preferredSize == "number")
      this.layoutStrategy = new Rd(n.preferredSize);
    else if (typeof n.preferredSize == "string") {
      const i = n.preferredSize.trim();
      if (km(i, "%")) {
        const o = Number(i.slice(0, -1)) / 100;
        this.layoutStrategy = new MI(
          o,
          this.layoutService
        );
      } else if (km(i, "px")) {
        const o = Number(i.slice(0, -2));
        this.layoutStrategy = new Rd(o);
      } else if (typeof Number.parseFloat(i) == "number") {
        const o = Number.parseFloat(i);
        this.layoutStrategy = new Rd(o);
      } else
        this.layoutStrategy = new Tm();
    } else
      this.layoutStrategy = new Tm();
    this.priority = n.priority ?? d0.Normal;
  }
  layout(e) {
  }
};
function Mhe(t) {
  const e = _a(t, 4, 20), n = _a(t, 1, 8);
  document.documentElement.style.setProperty("--sash-size", `${e}px`), document.documentElement.style.setProperty(
    "--sash-hover-size",
    `${n}px`
  ), Phe(e);
}
const Ahe = ["id"], Rhe = /* @__PURE__ */ Oe({
  __name: "Allotment",
  props: {
    className: { default: "" },
    defaultSizes: {},
    id: {},
    maxSize: { default: 1 / 0 },
    minSize: { default: 30 },
    proportionalLayout: { type: Boolean, default: !0 },
    separator: { type: Boolean, default: !0 },
    snap: { type: Boolean, default: !1 },
    sizes: {},
    vertical: { type: Boolean, default: !1 }
  },
  emits: ["change", "reset", "visibleChange", "dragStart", "dragEnd"],
  setup(t, { expose: e, emit: n }) {
    const i = t, o = n, r = de(), a = de(), l = de(!1), s = de(null), u = Bn(/* @__PURE__ */ new Map()), c = Bn(/* @__PURE__ */ new Map()), d = de(new ghe()), f = de([]), h = de([]), p = de(null), g = eB();
    Xt("allotment", {
      registerPane: (O, E, _) => {
        u.set(O, E), c.set(O, _), l.value && rn(() => {
          C();
        });
      },
      unregisterPane: (O) => {
        u.delete(O), c.delete(O);
      },
      registerNonPane: (O, E) => {
        u.set(O, E), c.set(O, {});
      }
    });
    const m = A(() => {
      const O = g.default?.({}) || [], E = (_) => {
        const D = [];
        for (const M of _)
          Array.isArray(M.children) ? D.push(...E(M.children)) : M.type && D.push(M);
        return D;
      };
      return E(O);
    });
    function y(O) {
      const E = f.value?.[O];
      return typeof E?.preferredSize != "number" ? !1 : (s.value?.resizeView(O, Math.round(E.preferredSize)), !0);
    }
    function b() {
      if (o("reset"), !!s.value) {
        s.value.distributeViewSizes();
        for (let O = 0; O < f.value.length; O++)
          y(O);
      }
    }
    function w(O) {
      s.value?.resizeViews(O);
    }
    e({
      reset: b,
      resize: w
    });
    function $() {
      if (!r.value)
        return;
      let O = !0;
      i.defaultSizes && u.size !== i.defaultSizes.length && (O = !1, console.warn(
        `Expected ${i.defaultSizes.length} children based on defaultSizes but found ${u.size}`
      ));
      const E = i.vertical ? r.value.clientHeight : r.value.clientWidth;
      d.value.setSize(E);
      let _ = i.defaultSizes;
      if (!i.defaultSizes && u.size > 0) {
        const M = Math.floor(E / u.size);
        _ = Array.from({ length: u.size }, () => M), _[_.length - 1] += E - M * u.size, O = !0, h.value = m.value.map(
          (N) => N.key
        );
      } else if (i.defaultSizes) {
        const M = i.defaultSizes.reduce((N, L) => N + L, 0);
        if (E > 0 && M > 0 && Math.abs(E - M) > 1) {
          const N = E / M;
          _ = i.defaultSizes.map((L) => Math.round(L * N));
        }
        h.value = m.value.map(
          (N) => N.key
        );
      }
      f.value = [];
      const D = {
        orientation: i.vertical ? Ma.Vertical : Ma.Horizontal,
        proportionalLayout: i.proportionalLayout,
        ...O && _ && {
          descriptor: {
            size: _.reduce((M, N) => M + N, 0),
            views: _.map((M, N) => {
              const L = [...u.keys()][N], j = c.get(L), B = new AI(d.value, {
                element: document.createElement("div"),
                minimumSize: j?.minSize ?? i.minSize,
                maximumSize: j?.maxSize ?? i.maxSize,
                priority: j?.priority ?? d0.Normal,
                ...j?.preferredSize && {
                  preferredSize: j?.preferredSize
                },
                snap: j?.snap ?? i.snap
              });
              return f.value.push(B), {
                container: [...u.values()][N],
                size: M,
                view: B
              };
            })
          }
        }
      };
      if (s.value = new Ihe(
        r.value,
        D,
        (M) => o("change", M),
        (M) => o("dragStart", M),
        (M) => o("dragEnd", M)
      ), s.value.on("sashDragStart", () => {
        r.value?.classList.add("split-view-sash-dragging");
      }), s.value.on("sashDragEnd", () => {
        r.value?.classList.remove("split-view-sash-dragging");
      }), s.value.on("sashchange", (M) => {
        if (s.value) {
          const N = m.value.map((L) => L.key);
          for (const [L, j] of N.entries()) {
            const B = c.get(j);
            B?.visible !== void 0 && B.visible !== s.value.isViewVisible(L) && o("visibleChange", L, s.value.isViewVisible(L));
          }
        }
      }), s.value?.on("sashreset", (M) => {
        o("reset"), !y(M) && (y(M + 1) || s.value?.distributeViewSizes());
      }), E > 0) {
        s.value.layout(E);
        for (let M = 0; M < f.value.length; M++)
          y(M);
      }
    }
    function C() {
      if (!l.value || !s.value)
        return;
      const O = m.value.map((N) => N.key), E = [...h.value], _ = O.filter((N) => !h.value.includes(N)), D = O.filter((N) => h.value.includes(N)), M = h.value.map((N, L) => ({ key: N, index: L, shouldExit: !O.includes(N) }));
      for (let N = M.length - 1; N >= 0; N--)
        M[N].shouldExit && (s.value.removeView(M[N].index), E.splice(M[N].index, 1), f.value.splice(M[N].index, 1));
      for (const N of _) {
        const L = c.get(N), j = new AI(d.value, {
          element: document.createElement("div"),
          minimumSize: L?.minSize ?? i.minSize,
          maximumSize: L?.maxSize ?? i.maxSize,
          priority: L?.priority ?? d0.Normal,
          ...L?.preferredSize && {
            preferredSize: L?.preferredSize
          },
          snap: L?.snap ?? i.snap
        }), B = O.indexOf(N);
        s.value.addView(
          u.get(N),
          j,
          f4.Distribute,
          B
        ), E.splice(B, 0, N), f.value.splice(B, 0, j);
      }
      for (; !rhe(O, E); )
        for (const [N, L] of O.entries()) {
          const j = E.indexOf(L);
          if (j !== N) {
            s.value.moveView(
              u.get(L),
              j,
              N
            );
            const B = E[j];
            E.splice(j, 1), E.splice(N, 0, B);
            const Y = f.value[j];
            f.value.splice(j, 1), f.value.splice(N, 0, Y);
            break;
          }
        }
      for (const N of [..._, ...D]) {
        const L = c.get(N), j = O.indexOf(N);
        if (L) {
          L.visible !== void 0 && s.value.isViewVisible(j) !== L.visible && s.value.setViewVisible(j, L.visible), L.preferredSize !== void 0 && f.value[j].preferredSize !== L.preferredSize && (f.value[j].preferredSize = L.preferredSize, y(j));
          let B = !1;
          L.minSize !== void 0 && f.value[j].minimumSize !== L.minSize && (f.value[j].minimumSize = L.minSize, B = !0), L.maxSize !== void 0 && f.value[j].maximumSize !== L.maxSize && (f.value[j].maximumSize = L.maxSize, B = !0), B && s.value.layout();
        }
      }
      (_.length > 0 || M.some((N) => N.shouldExit)) && (h.value = O);
    }
    function P() {
      r.value && (p.value = new ResizeObserver(() => {
        if (r.value) {
          const O = i.vertical ? r.value.clientHeight : r.value.clientWidth;
          O > 0 && (s.value?.layout(O), d.value.setSize(O), l.value || (l.value = !0));
        }
      }), p.value.observe(r.value));
    }
    return Lt(() => {
      u4 && Mhe(20), rn(() => {
        $(), P(), setTimeout(() => {
          if (r.value && s.value) {
            const O = i.vertical ? r.value.clientHeight : r.value.clientWidth;
            O > 0 && s.value.layout(O);
          }
        }, 50);
      });
    }), _e(m, () => {
      rn(() => {
        C();
      });
    }, { deep: !0 }), _e(() => i.vertical, (O) => {
      s.value && (s.value.orientation = O ? Ma.Vertical : Ma.Horizontal, s.value.layout());
    }), _e(() => i.proportionalLayout, (O) => {
      s.value && (s.value.proportionalLayout = O);
    }), wo(() => {
      p.value?.disconnect(), s.value?.dispose();
    }), (O, E) => (re(), be("div", {
      id: O.id,
      ref_key: "containerRef",
      ref: r,
      class: Tt(["split-view", [
        O.vertical ? "split-view-vertical" : "split-view-horizontal",
        { "split-view-separator-border": O.separator },
        I(pu).splitView,
        O.vertical ? I(pu).vertical : I(pu).horizontal,
        { [I(pu).separatorBorder]: O.separator },
        O.className
      ]])
    }, [
      F("div", {
        ref_key: "splitViewContainerRef",
        ref: a,
        class: Tt(["split-view-container", [I(pu).splitViewContainer]])
      }, [
        _o(O.$slots, "default", {}, void 0, !0)
      ], 2)
    ], 10, Ahe));
  }
}), Dhe = (t, e) => {
  const n = t.__vccOpts || t;
  for (const [i, o] of e)
    n[i] = o;
  return n;
}, RI = /* @__PURE__ */ Dhe(Rhe, [["__scopeId", "data-v-e77a1ca4"]]), Pm = /* @__PURE__ */ Oe({
  __name: "Pane",
  props: {
    className: { default: "" },
    maxSize: {},
    minSize: {},
    snap: { type: Boolean, default: !1 },
    preferredSize: {},
    priority: {},
    visible: { type: Boolean, default: !0 }
  },
  setup(t, { expose: e }) {
    const n = t, i = de(), o = sr(), r = qt("allotment");
    function a() {
      return o?.vnode.key || `pane-${Math.random().toString(36).slice(2, 11)}`;
    }
    const l = a();
    return Lt(() => {
      r && i.value && r.registerPane(l, i.value, {
        minSize: n.minSize,
        maxSize: n.maxSize,
        preferredSize: n.preferredSize,
        priority: n.priority,
        snap: n.snap,
        visible: n.visible
      });
    }), _e(() => n, (s) => {
      r && i.value && r.registerPane(l, i.value, {
        minSize: s.minSize,
        maxSize: s.maxSize,
        preferredSize: s.preferredSize,
        priority: s.priority,
        snap: s.snap,
        visible: s.visible
      });
    }, { deep: !0 }), wo(() => {
      r && r.unregisterPane(l);
    }), e({
      element: i
    }), (s, u) => (re(), be("div", {
      ref_key: "paneRef",
      ref: i,
      class: Tt(["split-view-view", [
        s.visible && "split-view-view-visible",
        I(pu).splitViewView,
        s.className
      ]])
    }, [
      _o(s.$slots, "default")
    ], 2));
  }
}), Nhe = { class: "flex flex-col gap-3" }, Lhe = { class: "text-xs text-secondary mb-1" }, zhe = { class: "text-xs text-secondary mb-1" }, Bhe = { class: "text-xs text-secondary mb-1" }, Fhe = { class: "text-xs text-secondary mb-1" }, Vhe = { class: "text-xs text-secondary mb-1" }, Qhe = { class: "text-xs text-secondary mb-1" }, Hhe = ["value"], Whe = { class: "text-xs text-secondary mb-1" }, jhe = { class: "text-xs text-secondary mb-1" }, qhe = { class: "text-xs text-secondary mb-1" }, Yhe = { class: "text-xs text-secondary mb-1" }, Khe = { class: "text-xs text-secondary mb-1" }, Xhe = { class: "text-xs text-secondary mb-1" }, Zhe = ["value"], Ghe = { class: "text-xs text-secondary mb-1" }, Uhe = { class: "text-xs text-secondary mb-1" }, Jhe = { key: 0 }, epe = { class: "text-xs text-secondary mb-1" }, tpe = ["value"], npe = { class: "text-xs text-secondary mb-1" }, ipe = /* @__PURE__ */ Oe({
  __name: "AxesSection",
  props: {
    panel: {},
    onChange: { type: Function },
    numericFieldNames: {},
    allFieldNames: {}
  },
  setup(t) {
    const { t: e } = On();
    return (n, i) => {
      const o = Rn("a-radio-button"), r = Rn("a-radio-group"), a = Rn("a-switch");
      return re(), be("div", Nhe, [
        F("div", null, [
          F("div", Lhe, se(I(e)("config.field.axisPlacement")), 1),
          v(r, {
            size: "small",
            value: t.panel.axisPlacement ?? "left",
            onChange: i[0] || (i[0] = (l) => t.onChange({ axisPlacement: l.target.value }))
          }, {
            default: ye(() => [
              v(o, { value: "left" }, {
                default: ye(() => [
                  Ve(se(I(e)("config.axis.placement.left")), 1)
                ]),
                _: 1
              }),
              v(o, { value: "right" }, {
                default: ye(() => [
                  Ve(se(I(e)("config.axis.placement.right")), 1)
                ]),
                _: 1
              }),
              v(o, { value: "hidden" }, {
                default: ye(() => [
                  Ve(se(I(e)("config.axis.placement.hidden")), 1)
                ]),
                _: 1
              })
            ]),
            _: 1
          }, 8, ["value"])
        ]),
        F("div", null, [
          F("div", zhe, se(I(e)("config.field.axisLabel")), 1),
          v(I(jt), {
            size: "small",
            value: t.panel.axisLabel ?? "",
            placeholder: I(e)("config.axis.label.placeholder"),
            onChange: i[1] || (i[1] = (l) => t.onChange({ axisLabel: l.target.value }))
          }, null, 8, ["value", "placeholder"])
        ]),
        F("div", null, [
          F("div", Bhe, se(I(e)("config.field.axisName")), 1),
          v(I(jt), {
            size: "small",
            value: t.panel.axisName ?? "",
            placeholder: I(e)("config.axis.name.placeholder"),
            onChange: i[2] || (i[2] = (l) => t.onChange({ axisName: l.target.value }))
          }, null, 8, ["value", "placeholder"])
        ]),
        F("div", null, [
          F("div", Fhe, se(I(e)("config.field.axisWidth")), 1),
          v(I(Do), {
            size: "small",
            value: t.panel.axisWidth ?? void 0,
            min: 20,
            max: 300,
            style: { width: "100%" },
            onChange: i[3] || (i[3] = (l) => t.onChange({ axisWidth: l }))
          }, null, 8, ["value"])
        ]),
        F("div", null, [
          F("div", Vhe, se(I(e)("config.field.showGridLines")), 1),
          v(r, {
            size: "small",
            value: t.panel.showGridLines ?? "all",
            onChange: i[4] || (i[4] = (l) => t.onChange({ showGridLines: l.target.value }))
          }, {
            default: ye(() => [
              v(o, { value: "all" }, {
                default: ye(() => [
                  Ve(se(I(e)("config.axis.grid.all")), 1)
                ]),
                _: 1
              }),
              v(o, { value: "x" }, {
                default: ye(() => [
                  Ve(se(I(e)("config.axis.grid.x")), 1)
                ]),
                _: 1
              }),
              v(o, { value: "y" }, {
                default: ye(() => [
                  Ve(se(I(e)("config.axis.grid.y")), 1)
                ]),
                _: 1
              }),
              v(o, { value: "hidden" }, {
                default: ye(() => [
                  Ve(se(I(e)("config.axis.grid.hidden")), 1)
                ]),
                _: 1
              })
            ]),
            _: 1
          }, 8, ["value"])
        ]),
        F("div", null, [
          F("div", Qhe, se(I(e)("config.field.gridColor")), 1),
          F("input", {
            type: "color",
            value: t.panel.gridColor ?? "#e8e8e8",
            onInput: i[5] || (i[5] = (l) => t.onChange({ gridColor: l.target.value }))
          }, null, 40, Hhe)
        ]),
        F("div", null, [
          F("div", Whe, se(I(e)("config.field.scaleDistribution")), 1),
          v(r, {
            size: "small",
            value: t.panel.scaleDistribution ?? "linear",
            onChange: i[6] || (i[6] = (l) => t.onChange({ scaleDistribution: l.target.value }))
          }, {
            default: ye(() => [
              v(o, { value: "linear" }, {
                default: ye(() => [
                  Ve(se(I(e)("config.axis.scale.linear")), 1)
                ]),
                _: 1
              }),
              v(o, { value: "logarithmic" }, {
                default: ye(() => [
                  Ve(se(I(e)("config.axis.scale.logarithmic")), 1)
                ]),
                _: 1
              })
            ]),
            _: 1
          }, 8, ["value"])
        ]),
        F("div", null, [
          F("div", jhe, se(I(e)("config.field.softMin")), 1),
          v(I(Do), {
            size: "small",
            value: t.panel.softMin ?? void 0,
            style: { width: "100%" },
            onChange: i[7] || (i[7] = (l) => t.onChange({ softMin: l }))
          }, null, 8, ["value"])
        ]),
        F("div", null, [
          F("div", qhe, se(I(e)("config.field.softMax")), 1),
          v(I(Do), {
            size: "small",
            value: t.panel.softMax ?? void 0,
            style: { width: "100%" },
            onChange: i[8] || (i[8] = (l) => t.onChange({ softMax: l }))
          }, null, 8, ["value"])
        ]),
        F("div", null, [
          F("div", Yhe, se(I(e)("config.field.centeredZero")), 1),
          v(a, {
            size: "small",
            checked: t.panel.centeredZero,
            onChange: i[9] || (i[9] = (l) => t.onChange({ centeredZero: l }))
          }, null, 8, ["checked"])
        ]),
        F("div", null, [
          F("div", Khe, se(I(e)("config.field.axisLine")), 1),
          v(r, {
            size: "small",
            value: t.panel.axisLabel ?? "all",
            onChange: i[10] || (i[10] = (l) => t.onChange({ axisLabel: l.target.value }))
          }, {
            default: ye(() => [
              v(o, { value: "all" }, {
                default: ye(() => [
                  Ve(se(I(e)("config.axis.grid.all")), 1)
                ]),
                _: 1
              }),
              v(o, { value: "x" }, {
                default: ye(() => [...i[16] || (i[16] = [
                  Ve(" X ", -1)
                ])]),
                _: 1
              }),
              v(o, { value: "y" }, {
                default: ye(() => [...i[17] || (i[17] = [
                  Ve(" Y ", -1)
                ])]),
                _: 1
              }),
              v(o, { value: "hidden" }, {
                default: ye(() => [
                  Ve(se(I(e)("config.axis.grid.hidden")), 1)
                ]),
                _: 1
              })
            ]),
            _: 1
          }, 8, ["value"])
        ]),
        F("div", null, [
          F("div", Xhe, se(I(e)("config.field.axisLineColor")), 1),
          F("input", {
            type: "color",
            value: t.panel.axisLabelColor ?? "#666666",
            onInput: i[11] || (i[11] = (l) => t.onChange({ axisLabelColor: l.target.value }))
          }, null, 40, Zhe)
        ]),
        F("div", null, [
          F("div", Ghe, se(I(e)("config.field.axisTickShow")), 1),
          v(r, {
            size: "small",
            value: t.panel.axisTick ?? "hidden",
            onChange: i[12] || (i[12] = (l) => t.onChange({ axisTick: l.target.value }))
          }, {
            default: ye(() => [
              v(o, { value: "all" }, {
                default: ye(() => [
                  Ve(se(I(e)("config.axis.grid.all")), 1)
                ]),
                _: 1
              }),
              v(o, { value: "x" }, {
                default: ye(() => [...i[18] || (i[18] = [
                  Ve(" X ", -1)
                ])]),
                _: 1
              }),
              v(o, { value: "y" }, {
                default: ye(() => [...i[19] || (i[19] = [
                  Ve(" Y ", -1)
                ])]),
                _: 1
              }),
              v(o, { value: "hidden" }, {
                default: ye(() => [
                  Ve(se(I(e)("config.axis.grid.hidden")), 1)
                ]),
                _: 1
              })
            ]),
            _: 1
          }, 8, ["value"])
        ]),
        F("div", null, [
          F("div", Uhe, se(I(e)("config.field.axisBorder")), 1),
          v(r, {
            size: "small",
            value: t.panel.axisBorder ?? "hidden",
            onChange: i[13] || (i[13] = (l) => t.onChange({ axisBorder: l.target.value }))
          }, {
            default: ye(() => [
              v(o, { value: "all" }, {
                default: ye(() => [
                  Ve(se(I(e)("config.axis.grid.all")), 1)
                ]),
                _: 1
              }),
              v(o, { value: "x" }, {
                default: ye(() => [...i[20] || (i[20] = [
                  Ve(" X ", -1)
                ])]),
                _: 1
              }),
              v(o, { value: "y" }, {
                default: ye(() => [...i[21] || (i[21] = [
                  Ve(" Y ", -1)
                ])]),
                _: 1
              }),
              v(o, { value: "hidden" }, {
                default: ye(() => [
                  Ve(se(I(e)("config.axis.grid.hidden")), 1)
                ]),
                _: 1
              })
            ]),
            _: 1
          }, 8, ["value"])
        ]),
        t.panel.axisBorder && t.panel.axisBorder !== "hidden" ? (re(), be("div", Jhe, [
          F("div", epe, se(I(e)("config.field.axisBorderColor")), 1),
          F("input", {
            type: "color",
            value: t.panel.axisBorderColor ?? "#cccccc",
            onInput: i[14] || (i[14] = (l) => t.onChange({ axisBorderColor: l.target.value }))
          }, null, 40, tpe)
        ])) : et("", !0),
        F("div", null, [
          F("div", npe, se(I(e)("config.field.logScale")), 1),
          v(a, {
            size: "small",
            checked: t.panel.scaleDistribution === "logarithmic",
            onChange: i[15] || (i[15] = (l) => t.onChange({ scaleDistribution: l ? "logarithmic" : "linear" }))
          }, null, 8, ["checked"])
        ])
      ]);
    };
  }
}), ope = { class: "flex flex-col gap-3" }, rpe = { class: "text-xs text-secondary mb-1" }, ape = { class: "text-xs text-secondary mb-1" }, lpe = { class: "text-xs text-secondary mb-1" }, spe = { class: "text-xs text-secondary mb-1" }, upe = { class: "text-xs text-secondary mb-1" }, cpe = { class: "text-xs text-secondary mb-1" }, dpe = { class: "text-xs text-secondary mb-1" }, fpe = /* @__PURE__ */ Oe({
  __name: "BarStyleSection",
  props: {
    panel: {},
    onChange: { type: Function },
    numericFieldNames: {},
    allFieldNames: {}
  },
  setup(t) {
    const { t: e } = On();
    return (n, i) => {
      const o = Rn("a-radio-button"), r = Rn("a-radio-group"), a = Rn("a-switch"), l = Rn("a-input-number");
      return re(), be("div", ope, [
        F("div", null, [
          F("div", rpe, se(I(e)("config.field.barShowValues")), 1),
          v(r, {
            size: "small",
            value: t.panel.barShowValues ?? "auto",
            onChange: i[0] || (i[0] = (s) => t.onChange({ barShowValues: s.target.value }))
          }, {
            default: ye(() => [
              v(o, { value: "auto" }, {
                default: ye(() => [
                  Ve(se(I(e)("config.showValues.auto")), 1)
                ]),
                _: 1
              }),
              v(o, { value: "always" }, {
                default: ye(() => [
                  Ve(se(I(e)("config.showValues.always")), 1)
                ]),
                _: 1
              }),
              v(o, { value: "never" }, {
                default: ye(() => [
                  Ve(se(I(e)("config.showValues.never")), 1)
                ]),
                _: 1
              })
            ]),
            _: 1
          }, 8, ["value"])
        ]),
        F("div", null, [
          F("div", ape, se(I(e)("config.field.barGroupWidth")), 1),
          v(I(vr), {
            min: 0.1,
            max: 1,
            step: 0.05,
            value: t.panel.barGroupWidth ?? 0.7,
            onChange: i[1] || (i[1] = (s) => t.onChange({ barGroupWidth: s }))
          }, null, 8, ["value"])
        ]),
        F("div", null, [
          F("div", lpe, se(I(e)("config.field.barWidth")), 1),
          v(I(vr), {
            min: 0.1,
            max: 1,
            step: 0.05,
            value: t.panel.barWidth ?? 1,
            onChange: i[2] || (i[2] = (s) => t.onChange({ barWidth: s }))
          }, null, 8, ["value"])
        ]),
        F("div", null, [
          F("div", spe, se(I(e)("config.field.stacked")), 1),
          v(a, {
            size: "small",
            checked: t.panel.stacked,
            onChange: i[3] || (i[3] = (s) => t.onChange({ stacked: s }))
          }, null, 8, ["checked"])
        ]),
        F("div", null, [
          F("div", upe, se(I(e)("config.field.lineWidth")), 1),
          v(l, {
            size: "small",
            min: 0,
            max: 10,
            value: t.panel.lineWidth,
            style: { width: "100%" },
            onChange: i[4] || (i[4] = (s) => t.onChange({ lineWidth: s ?? 1 }))
          }, null, 8, ["value"])
        ]),
        F("div", null, [
          F("div", cpe, se(I(e)("config.field.fillOpacity")), 1),
          v(I(vr), {
            min: 0,
            max: 100,
            value: t.panel.fillOpacity,
            onChange: i[5] || (i[5] = (s) => t.onChange({ fillOpacity: s }))
          }, null, 8, ["value"])
        ]),
        F("div", null, [
          F("div", dpe, se(I(e)("config.field.xTickRotation")), 1),
          v(a, {
            size: "small",
            checked: t.panel.barXTickRotation ?? !1,
            onChange: i[6] || (i[6] = (s) => t.onChange({ barXTickRotation: s }))
          }, null, 8, ["checked"])
        ])
      ]);
    };
  }
}), hpe = { class: "flex flex-col gap-3" }, ppe = { class: "text-xs text-secondary mb-1" }, gpe = { class: "text-xs text-secondary mb-1" }, mpe = { class: "text-xs text-secondary mb-1" }, vpe = ["value"], ype = { class: "text-xs text-secondary mb-1" }, bpe = { class: "text-xs text-secondary mb-1" }, xpe = { class: "text-xs text-secondary mb-1" }, Ope = { class: "text-xs text-secondary mb-1" }, Spe = { class: "text-xs text-secondary mb-1" }, wpe = { key: 0 }, Cpe = { class: "text-xs text-secondary mb-1" }, $pe = ["value"], kpe = { class: "text-xs text-secondary mb-1" }, Tpe = { class: "text-xs text-secondary mb-1" }, Ppe = { class: "text-xs text-secondary mb-1" }, Epe = { class: "text-xs text-secondary mb-1" }, _pe = { class: "text-xs text-secondary mb-1" }, Ipe = { class: "text-xs text-secondary mb-1" }, Mpe = /* @__PURE__ */ Oe({
  __name: "GaugeStyleSection",
  props: {
    panel: {},
    onChange: { type: Function },
    numericFieldNames: {},
    allFieldNames: {}
  },
  setup(t) {
    const { t: e } = On();
    return (n, i) => {
      const o = Rn("a-switch"), r = Rn("a-radio-button"), a = Rn("a-radio-group");
      return re(), be("div", hpe, [
        F("div", null, [
          F("div", ppe, se(I(e)("config.gauge.fillWidth")), 1),
          v(I(vr), {
            min: 1,
            max: 100,
            value: t.panel.gaugeFillWidth ?? I(pi).fillWidth,
            onChange: i[0] || (i[0] = (l) => t.onChange({ gaugeFillWidth: l }))
          }, null, 8, ["value"])
        ]),
        F("div", null, [
          F("div", gpe, se(I(e)("config.gauge.trackWidth")), 1),
          v(I(vr), {
            min: 1,
            max: 100,
            value: t.panel.gaugeTrackWidth ?? I(pi).trackWidth,
            onChange: i[1] || (i[1] = (l) => t.onChange({ gaugeTrackWidth: l }))
          }, null, 8, ["value"])
        ]),
        F("div", null, [
          F("div", mpe, se(I(e)("config.gauge.trackColor")), 1),
          F("input", {
            type: "color",
            value: t.panel.gaugeTrackColor ?? "#222222",
            onInput: i[2] || (i[2] = (l) => t.onChange({ gaugeTrackColor: l.target.value }))
          }, null, 40, vpe)
        ]),
        F("div", null, [
          F("div", ype, se(I(e)("config.gauge.arcSweep")), 1),
          v(I(vr), {
            min: 30,
            max: 360,
            value: t.panel.sweepAngle ?? I(pi).sweepAngle,
            onChange: i[3] || (i[3] = (l) => t.onChange({ sweepAngle: l }))
          }, null, 8, ["value"])
        ]),
        F("div", null, [
          F("div", bpe, se(I(e)("config.gauge.paddingX")), 1),
          v(I(vr), {
            min: 0,
            max: 0.5,
            step: 0.01,
            value: t.panel.gaugePaddingX ?? 0.05,
            onChange: i[4] || (i[4] = (l) => t.onChange({ gaugePaddingX: l }))
          }, null, 8, ["value"])
        ]),
        F("div", null, [
          F("div", xpe, se(I(e)("config.gauge.paddingY")), 1),
          v(I(vr), {
            min: 0,
            max: 0.5,
            step: 0.01,
            value: t.panel.gaugePaddingY ?? 0.1,
            onChange: i[5] || (i[5] = (l) => t.onChange({ gaugePaddingY: l }))
          }, null, 8, ["value"])
        ]),
        F("div", null, [
          F("div", Ope, se(I(e)("config.gauge.capRound")), 1),
          v(o, {
            size: "small",
            checked: t.panel.gaugeCapRound ?? I(pi).capRound,
            onChange: i[6] || (i[6] = (l) => t.onChange({ gaugeCapRound: l }))
          }, null, 8, ["checked"])
        ]),
        F("div", null, [
          F("div", Spe, se(I(e)("config.gauge.valueVisible")), 1),
          v(o, {
            size: "small",
            checked: t.panel.gaugeValueVisible ?? I(pi).valueVisible,
            onChange: i[7] || (i[7] = (l) => t.onChange({ gaugeValueVisible: l }))
          }, null, 8, ["checked"])
        ]),
        t.panel.gaugeValueVisible !== !1 ? (re(), be("div", wpe, [
          F("div", Cpe, se(I(e)("config.gauge.valueColor")), 1),
          F("input", {
            type: "color",
            value: t.panel.gaugeValueColor ?? "#ffffff",
            onInput: i[8] || (i[8] = (l) => t.onChange({ gaugeValueColor: l.target.value }))
          }, null, 40, $pe)
        ])) : et("", !0),
        F("div", null, [
          F("div", kpe, se(I(e)("config.gauge.valueSize")), 1),
          v(I(Do), {
            size: "small",
            min: 8,
            max: 80,
            value: t.panel.gaugeValueSize ?? I(pi).valueSize,
            suffix: "px",
            style: { width: "100%" },
            onChange: i[9] || (i[9] = (l) => t.onChange({ gaugeValueSize: l ?? I(pi).valueSize }))
          }, null, 8, ["value"])
        ]),
        F("div", null, [
          F("div", Tpe, se(I(e)("config.gauge.valueOffsetY")), 1),
          v(I(Do), {
            size: "small",
            min: -50,
            max: 50,
            value: t.panel.gaugeValueOffsetY ?? I(pi).valueOffsetY,
            suffix: "px",
            style: { width: "100%" },
            onChange: i[10] || (i[10] = (l) => t.onChange({ gaugeValueOffsetY: l ?? I(pi).valueOffsetY }))
          }, null, 8, ["value"])
        ]),
        F("div", null, [
          F("div", Ppe, se(I(e)("config.gauge.colorFromScheme")), 1),
          v(o, {
            size: "small",
            checked: t.panel.gaugeColorFromScheme ?? !1,
            onChange: i[11] || (i[11] = (l) => t.onChange({ gaugeColorFromScheme: l }))
          }, null, 8, ["checked"])
        ]),
        F("div", null, [
          F("div", Epe, se(I(e)("config.gauge.thresholdDisplay")), 1),
          v(a, {
            size: "small",
            value: t.panel.gaugeThresholdDisplay ?? I(pi).thresholdDisplay,
            onChange: i[12] || (i[12] = (l) => t.onChange({ gaugeThresholdDisplay: l.target.value }))
          }, {
            default: ye(() => [
              v(r, { value: "none" }, {
                default: ye(() => [
                  Ve(se(I(e)("config.gauge.thresholdDisplayNone")), 1)
                ]),
                _: 1
              }),
              v(r, { value: "marker" }, {
                default: ye(() => [
                  Ve(se(I(e)("config.gauge.thresholdDisplayMarker")), 1)
                ]),
                _: 1
              }),
              v(r, { value: "track" }, {
                default: ye(() => [
                  Ve(se(I(e)("config.gauge.thresholdDisplayTrack")), 1)
                ]),
                _: 1
              })
            ]),
            _: 1
          }, 8, ["value"])
        ]),
        F("div", null, [
          F("div", _pe, se(I(e)("config.gauge.thresholdLabelDisplay")), 1),
          v(a, {
            size: "small",
            value: t.panel.gaugeThresholdLabelDisplay ?? "none",
            onChange: i[13] || (i[13] = (l) => t.onChange({ gaugeThresholdLabelDisplay: l.target.value }))
          }, {
            default: ye(() => [
              v(r, { value: "none" }, {
                default: ye(() => [
                  Ve(se(I(e)("config.gauge.thresholdLabelNone")), 1)
                ]),
                _: 1
              }),
              v(r, { value: "label" }, {
                default: ye(() => [
                  Ve(se(I(e)("config.gauge.thresholdLabelLabel")), 1)
                ]),
                _: 1
              }),
              v(r, { value: "value" }, {
                default: ye(() => [
                  Ve(se(I(e)("config.gauge.thresholdLabelValue")), 1)
                ]),
                _: 1
              }),
              v(r, { value: "both" }, {
                default: ye(() => [
                  Ve(se(I(e)("config.gauge.thresholdLabelBoth")), 1)
                ]),
                _: 1
              })
            ]),
            _: 1
          }, 8, ["value"])
        ]),
        F("div", null, [
          F("div", Ipe, se(I(e)("config.gauge.orientation")), 1),
          v(a, {
            size: "small",
            value: t.panel.gaugeOrientation ?? I(pi).orientation,
            onChange: i[14] || (i[14] = (l) => t.onChange({ gaugeOrientation: l.target.value }))
          }, {
            default: ye(() => [
              v(r, { value: "auto" }, {
                default: ye(() => [
                  Ve(se(I(e)("config.gauge.orientationAuto")), 1)
                ]),
                _: 1
              }),
              v(r, { value: "horizontal" }, {
                default: ye(() => [
                  Ve(se(I(e)("config.gauge.orientationHorizontal")), 1)
                ]),
                _: 1
              }),
              v(r, { value: "vertical" }, {
                default: ye(() => [
                  Ve(se(I(e)("config.gauge.orientationVertical")), 1)
                ]),
                _: 1
              })
            ]),
            _: 1
          }, 8, ["value"])
        ])
      ]);
    };
  }
}), St = {
  // Actions
  edit: "i-carbon:edit",
  delete: "i-carbon:trash-can",
  clone: "i-carbon:stickies ",
  plus: "i-carbon:add-large",
  save: "i-mdi-content-save",
  cancel: "i-mdi-cancel",
  refresh: "i-carbon:renew",
  download: "i-carbon:download",
  upload: "i-carbon:upload",
  export: "i-carbon:export",
  import: "i-carbon:document-import",
  search: "i-mdi-magnify",
  settings: "i-carbon:settings",
  config: "i-carbon:settings-adjust",
  link: "i-mdi-link",
  // Navigation
  fullscreen: "i-carbon:center-to-fit",
  chevronDown: "i-carbon:chevron-down",
  chevronRight: "i-carbon:chevron-right",
  dotsVertical: "i-mdi-dots-vertical",
  dragVertical: "i-carbon:draggable",
  closeCircle: "i-mdi-close-circle",
  chevronLeft: "i-carbon:chevron-left",
  // Info
  info: "i-carbon:information",
  // view
  view: "i-carbon:view",
  viewOff: "i-carbon:view-off",
  // Theme
  sun: "i-mdi-white-balance-sunny",
  moon: "i-mdi-weather-night",
  // Panel types
  chartLine: "i-mdi-chart-line",
  chartBar: "i-mdi-chart-bar",
  chartArea: "i-mdi-chart-areaspline",
  chartPie: "i-mdi-chart-pie",
  stat: "i-mdi-format-list-numbered",
  gauge: "i-mdi-alarm-panel",
  table: "i-mdi-table",
  databaseOff: "i-mdi-database-off"
}, Ape = { class: "inline-flex gap-0.5 items-center" }, Rpe = /* @__PURE__ */ Oe({
  __name: "PaletteSwatches",
  props: {
    colors: {}
  },
  setup(t) {
    return (e, n) => (re(), be("span", Ape, [
      (re(!0), be(tt, null, Jt(t.colors, (i, o) => (re(), be("span", {
        key: `${i}-${o}`,
        class: "inline-block rounded-sm flex-shrink-0",
        style: Yt({ width: "12px", height: "12px", background: i })
      }, null, 4))), 128))
    ]));
  }
}), Dpe = [
  { value: "classic", colors: ku.slice(0, 8) },
  { value: "tableau10", colors: Jr.tableau10.slice(0, 8) },
  { value: "grafana-classic", colors: Jr["grafana-classic"].slice(0, 8) },
  { value: "green-yellow-red", colors: Jr["green-yellow-red"] },
  { value: "red-yellow-green", colors: Jr["red-yellow-green"] },
  { value: "blue-yellow-red", colors: Jr["blue-yellow-red"] },
  { value: "blue-purple", colors: Jr["blue-purple"] },
  { value: "yellow-blue", colors: Jr["yellow-blue"] },
  { value: "blues", colors: Jr.blues },
  { value: "reds", colors: Jr.reds },
  { value: "GrYlRd", colors: Jr.GrYlRd },
  { value: "purple-orange", colors: Jr["purple-orange"] },
  { value: "fixed", colors: [] },
  { value: "thresholds", colors: [] }
], Npe = { class: "flex flex-col gap-3" }, Lpe = { class: "text-xs text-secondary mb-1" }, zpe = { class: "text-xs text-secondary mb-1" }, Bpe = { class: "text-xs text-secondary mb-1" }, Fpe = { class: "inline-flex items-center gap-1.5" }, Vpe = { key: 0 }, Qpe = { class: "text-xs text-secondary mb-1" }, Hpe = ["value"], Wpe = { key: 1 }, jpe = { class: "text-xs text-secondary mb-1" }, qpe = { class: "text-xs text-secondary mb-1" }, Ype = { class: "flex gap-1 items-center" }, Kpe = { class: "flex items-center gap-1" }, Xpe = { class: "text-xs text-secondary" }, DI = /* @__PURE__ */ Oe({
  __name: "GeneralSection",
  props: {
    panel: {},
    onChange: { type: Function },
    numericFieldNames: {},
    allFieldNames: {}
  },
  setup(t) {
    const e = t, { t: n } = On(), i = Dpe.map((l) => ({
      value: l.value,
      label: n(`config.scheme.${l.value}`),
      colors: l.colors
    }));
    function o() {
      const l = [...e.panel.links ?? [], { title: "", url: "", newTab: !0 }];
      e.onChange({ links: l });
    }
    function r(l) {
      const s = (e.panel.links ?? []).filter((u, c) => c !== l);
      e.onChange({ links: s });
    }
    function a(l, s) {
      const u = (e.panel.links ?? []).map((c, d) => d === l ? { ...c, ...s } : c);
      e.onChange({ links: u });
    }
    return (l, s) => {
      const u = Rn("a-switch");
      return re(), be("div", Npe, [
        F("div", null, [
          F("div", Lpe, se(I(n)("config.field.title")), 1),
          v(I(jt), {
            size: "small",
            value: t.panel.title,
            onChange: s[0] || (s[0] = (c) => t.onChange({ title: c.target.value }))
          }, null, 8, ["value"])
        ]),
        F("div", null, [
          F("div", zpe, se(I(n)("config.field.description")), 1),
          v(I(jt), {
            size: "small",
            value: t.panel.description,
            onChange: s[1] || (s[1] = (c) => t.onChange({ description: c.target.value }))
          }, null, 8, ["value"])
        ]),
        F("div", null, [
          F("div", Bpe, se(I(n)("config.field.colorScheme")), 1),
          v(I(Dt), {
            size: "small",
            value: t.panel.colorScheme ?? "classic",
            "option-label-prop": "children",
            style: { width: "100%" },
            onChange: s[2] || (s[2] = (c) => t.onChange({ colorScheme: c }))
          }, {
            default: ye(() => [
              (re(!0), be(tt, null, Jt(I(i), (c) => (re(), ut(I(Dt).Option, {
                key: c.value,
                value: c.value
              }, {
                default: ye(() => [
                  F("span", Fpe, [
                    c.colors.length ? (re(), ut(Rpe, {
                      key: 0,
                      colors: c.colors
                    }, null, 8, ["colors"])) : et("", !0),
                    F("span", null, se(c.label), 1)
                  ])
                ]),
                _: 2
              }, 1032, ["value"]))), 128))
            ]),
            _: 1
          }, 8, ["value"])
        ]),
        t.panel.colorScheme === "fixed" ? (re(), be("div", Vpe, [
          F("div", Qpe, se(I(n)("config.field.colorSingle")), 1),
          F("input", {
            type: "color",
            value: t.panel.colorSingleValue ?? "#4096ff",
            onInput: s[3] || (s[3] = (c) => t.onChange({ colorSingleValue: c.target.value }))
          }, null, 40, Hpe)
        ])) : et("", !0),
        t.panel.colorScheme && t.panel.colorScheme !== "fixed" && t.panel.colorScheme !== "thresholds" ? (re(), be("div", Wpe, [
          F("div", jpe, se(I(n)("config.field.colorDistribution")), 1),
          v(I(Dt), {
            size: "small",
            value: t.panel.colorDistribution ?? "sequential",
            options: [
              { value: "sequential", label: I(n)("config.colorDist.sequential") },
              { value: "distributed", label: I(n)("config.colorDist.distributed") }
            ],
            style: { width: "100%" },
            onChange: s[4] || (s[4] = (c) => t.onChange({ colorDistribution: c }))
          }, null, 8, ["value", "options"])
        ])) : et("", !0),
        F("div", null, [
          F("div", qpe, se(I(n)("config.section.links", { n: (t.panel.links ?? []).length })), 1),
          (re(!0), be(tt, null, Jt(t.panel.links ?? [], (c, d) => (re(), be("div", {
            key: d,
            class: "mb-2 flex flex-col gap-1"
          }, [
            F("div", Ype, [
              v(I(jt), {
                size: "small",
                value: c.title,
                placeholder: "Title",
                style: { flex: "1" },
                onChange: (f) => a(d, { title: f.target.value })
              }, null, 8, ["value", "onChange"]),
              v(I(en), {
                type: "text",
                danger: "",
                size: "small",
                onClick: (f) => r(d)
              }, {
                default: ye(() => [
                  F("span", {
                    class: Tt(I(St).delete)
                  }, null, 2)
                ]),
                _: 1
              }, 8, ["onClick"])
            ]),
            v(I(jt), {
              size: "small",
              value: c.url,
              placeholder: "https://",
              onChange: (f) => a(d, { url: f.target.value })
            }, null, 8, ["value", "onChange"]),
            F("div", Kpe, [
              v(u, {
                size: "small",
                checked: c.newTab,
                onChange: (f) => a(d, { newTab: f })
              }, null, 8, ["checked", "onChange"]),
              F("span", Xpe, se(I(n)("config.link.newTab")), 1)
            ])
          ]))), 128)),
          v(I(en), {
            type: "dashed",
            size: "small",
            block: "",
            onClick: o
          }, {
            default: ye(() => [
              F("span", {
                class: Tt([I(St).plus, "mr-1"])
              }, null, 2),
              Ve(se(I(n)("config.link.add")), 1)
            ]),
            _: 1
          })
        ])
      ]);
    };
  }
}), Zpe = { class: "flex flex-col gap-3" }, Gpe = { class: "text-xs text-secondary mb-1" }, Upe = { class: "text-xs text-secondary mb-1" }, Jpe = { class: "text-xs text-secondary mb-1" }, ege = { class: "text-xs text-secondary mb-1" }, tge = { class: "text-xs text-secondary mb-1" }, nge = { class: "text-xs text-secondary mb-1" }, ige = /* @__PURE__ */ Oe({
  __name: "HistogramStyleSection",
  props: {
    panel: {},
    onChange: { type: Function },
    numericFieldNames: {},
    allFieldNames: {}
  },
  setup(t) {
    const { t: e } = On();
    return (n, i) => {
      const o = Rn("a-input-number"), r = Rn("a-switch");
      return re(), be("div", Zpe, [
        F("div", null, [
          F("div", Gpe, se(I(e)("config.field.histBucketCount")), 1),
          v(o, {
            size: "small",
            min: 1,
            max: 500,
            value: t.panel.histBucketCount ?? 30,
            style: { width: "100%" },
            onChange: i[0] || (i[0] = (a) => t.onChange({ histBucketCount: a ?? 30 }))
          }, null, 8, ["value"])
        ]),
        F("div", null, [
          F("div", Upe, se(I(e)("config.field.histBucketSize")), 1),
          v(o, {
            size: "small",
            min: 0,
            value: t.panel.histBucketSize,
            placeholder: I(e)("config.hist.bucketSizePlaceholder"),
            style: { width: "100%" },
            onChange: i[1] || (i[1] = (a) => t.onChange({ histBucketSize: a }))
          }, null, 8, ["value", "placeholder"])
        ]),
        F("div", null, [
          F("div", Jpe, se(I(e)("config.field.histBucketOffset")), 1),
          v(o, {
            size: "small",
            min: 0,
            value: t.panel.histBucketOffset ?? 0,
            style: { width: "100%" },
            onChange: i[2] || (i[2] = (a) => t.onChange({ histBucketOffset: a ?? 0 }))
          }, null, 8, ["value"])
        ]),
        F("div", null, [
          F("div", ege, se(I(e)("config.field.histCombineSeries")), 1),
          v(r, {
            size: "small",
            checked: t.panel.histCombineSeries ?? !1,
            onChange: i[3] || (i[3] = (a) => t.onChange({ histCombineSeries: a }))
          }, null, 8, ["checked"])
        ]),
        F("div", null, [
          F("div", tge, se(I(e)("config.field.lineWidth")), 1),
          v(o, {
            size: "small",
            min: 0,
            max: 10,
            value: t.panel.lineWidth,
            style: { width: "100%" },
            onChange: i[4] || (i[4] = (a) => t.onChange({ lineWidth: a ?? 1 }))
          }, null, 8, ["value"])
        ]),
        F("div", null, [
          F("div", nge, se(I(e)("config.field.fillOpacity")), 1),
          v(I(vr), {
            min: 0,
            max: 100,
            value: t.panel.fillOpacity,
            onChange: i[5] || (i[5] = (a) => t.onChange({ fillOpacity: a }))
          }, null, 8, ["value"])
        ])
      ]);
    };
  }
}), oge = { class: "flex flex-col gap-3" }, rge = { class: "override-rule-header" }, age = { class: "override-props" }, lge = /* @__PURE__ */ Oe({
  __name: "OverridesSection",
  props: {
    panel: {},
    onChange: { type: Function },
    numericFieldNames: {},
    allFieldNames: {}
  },
  setup(t) {
    const e = t, { t: n } = On(), i = [
      { value: "byName", label: "Field name" },
      { value: "byType", label: "Field type" },
      { value: "byRegexp", label: "Field name by regex" }
    ], o = [
      { value: "displayName", label: "Display name" },
      { value: "unit", label: "Unit" },
      { value: "decimals", label: "Decimals" },
      { value: "color", label: "Color" },
      { value: "thresholds", label: "Thresholds" },
      { value: "min", label: "Min" },
      { value: "max", label: "Max" },
      { value: "noValue", label: "No value" }
    ], r = A(() => e.panel.fieldConfigOverrides ?? []);
    function a() {
      const f = {
        id: crypto.randomUUID(),
        matcher: { id: "byName", options: "" },
        properties: []
      };
      e.onChange({ fieldConfigOverrides: [...r.value, f] });
    }
    function l(f) {
      e.onChange({
        fieldConfigOverrides: r.value.filter((h) => h.id !== f)
      });
    }
    function s(f, h) {
      e.onChange({
        fieldConfigOverrides: r.value.map(
          (p) => p.id === f ? { ...p, matcher: { ...p.matcher, ...h } } : p
        )
      });
    }
    function u(f) {
      e.onChange({
        fieldConfigOverrides: r.value.map(
          (h) => h.id === f ? { ...h, properties: [...h.properties, { id: "displayName", value: "" }] } : h
        )
      });
    }
    function c(f, h, p) {
      e.onChange({
        fieldConfigOverrides: r.value.map(
          (g) => g.id === f ? {
            ...g,
            properties: g.properties.map(
              (m, y) => y === h ? { ...m, ...p } : m
            )
          } : g
        )
      });
    }
    function d(f, h) {
      e.onChange({
        fieldConfigOverrides: r.value.map(
          (p) => p.id === f ? { ...p, properties: p.properties.filter((g, m) => m !== h) } : p
        )
      });
    }
    return (f, h) => (re(), be("div", oge, [
      (re(!0), be(tt, null, Jt(r.value, (p) => (re(), be("div", {
        key: p.id,
        class: "override-rule"
      }, [
        F("div", rge, [
          v(I(Dt), {
            size: "small",
            value: p.matcher.id,
            options: i,
            style: { flex: "1" },
            onChange: (g) => s(p.id, { id: g })
          }, null, 8, ["value", "onChange"]),
          v(I(jt), {
            size: "small",
            value: p.matcher.options ?? "",
            placeholder: I(n)("editor.overrides.matcherValue"),
            style: { flex: "1" },
            onChange: (g) => s(p.id, { options: g.target.value })
          }, null, 8, ["value", "placeholder", "onChange"]),
          v(I(en), {
            type: "text",
            danger: "",
            size: "small",
            onClick: (g) => l(p.id)
          }, {
            default: ye(() => [
              F("span", {
                class: Tt(I(St).delete)
              }, null, 2)
            ]),
            _: 1
          }, 8, ["onClick"])
        ]),
        F("div", age, [
          (re(!0), be(tt, null, Jt(p.properties, (g, m) => (re(), be("div", {
            key: m,
            class: "override-prop-row"
          }, [
            v(I(Dt), {
              size: "small",
              value: g.id,
              options: o,
              style: { width: "140px" },
              onChange: (y) => c(p.id, m, { id: y })
            }, null, 8, ["value", "onChange"]),
            v(I(jt), {
              size: "small",
              value: String(g.value ?? ""),
              placeholder: I(n)("editor.overrides.propValue"),
              style: { flex: "1" },
              onChange: (y) => c(p.id, m, { value: y.target.value })
            }, null, 8, ["value", "placeholder", "onChange"]),
            v(I(en), {
              type: "text",
              danger: "",
              size: "small",
              onClick: (y) => d(p.id, m)
            }, {
              default: ye(() => [
                F("span", {
                  class: Tt(I(St).closeCircle)
                }, null, 2)
              ]),
              _: 1
            }, 8, ["onClick"])
          ]))), 128)),
          v(I(en), {
            type: "dashed",
            size: "small",
            style: { width: "100%", "margin-top": "4px" },
            onClick: (g) => u(p.id)
          }, {
            default: ye(() => [
              F("span", {
                class: Tt([I(St).plus, "mr-1"])
              }, null, 2),
              Ve(" " + se(I(n)("editor.overrides.addProperty")), 1)
            ]),
            _: 1
          }, 8, ["onClick"])
        ])
      ]))), 128)),
      v(I(en), {
        type: "dashed",
        size: "small",
        style: { width: "100%" },
        onClick: a
      }, {
        default: ye(() => [
          F("span", {
            class: Tt([I(St).plus, "mr-1"])
          }, null, 2),
          Ve(" " + se(I(n)("editor.overrides.addOverride")), 1)
        ]),
        _: 1
      })
    ]));
  }
}), Co = (t, e) => {
  const n = t.__vccOpts || t;
  for (const [i, o] of e)
    n[i] = o;
  return n;
}, NI = /* @__PURE__ */ Co(lge, [["__scopeId", "data-v-2396374b"]]), sge = { class: "flex flex-col gap-3" }, uge = { class: "text-xs text-secondary mb-1" }, cge = { class: "text-xs text-secondary mb-1" }, dge = { class: "text-xs text-secondary mb-1" }, fge = { class: "flex flex-col gap-1" }, hge = { class: "text-xs" }, pge = { class: "text-xs text-secondary mb-1" }, gge = { key: 0 }, mge = { class: "text-xs text-secondary mb-1" }, vge = { class: "text-xs text-secondary mb-1" }, yge = { class: "text-xs text-secondary mb-1" }, bge = { class: "flex flex-col gap-1" }, xge = { class: "text-xs" }, Oge = /* @__PURE__ */ Oe({
  __name: "PieStyleSection",
  props: {
    panel: {},
    onChange: { type: Function },
    numericFieldNames: {},
    allFieldNames: {}
  },
  setup(t) {
    const e = t, { t: n } = On(), i = A(() => e.panel.pieLabels ?? []), o = A(() => e.panel.legendValues ?? []);
    function r(l, s) {
      const u = s ? [...i.value, l] : i.value.filter((c) => c !== l);
      e.onChange({ pieLabels: u });
    }
    function a(l, s) {
      const u = s ? [...o.value, l] : o.value.filter((c) => c !== l);
      e.onChange({ legendValues: u });
    }
    return (l, s) => {
      const u = Rn("a-radio-button"), c = Rn("a-radio-group"), d = Rn("a-checkbox");
      return re(), be("div", sge, [
        F("div", null, [
          F("div", uge, se(I(n)("config.field.pieType")), 1),
          v(c, {
            size: "small",
            value: t.panel.pieType ?? "pie",
            onChange: s[0] || (s[0] = (f) => t.onChange({ pieType: f.target.value }))
          }, {
            default: ye(() => [
              v(u, { value: "pie" }, {
                default: ye(() => [
                  Ve(se(I(n)("config.pieType.pie")), 1)
                ]),
                _: 1
              }),
              v(u, { value: "donut" }, {
                default: ye(() => [
                  Ve(se(I(n)("config.pieType.donut")), 1)
                ]),
                _: 1
              })
            ]),
            _: 1
          }, 8, ["value"])
        ]),
        F("div", null, [
          F("div", cge, se(I(n)("config.field.pieSliceSorting")), 1),
          v(c, {
            size: "small",
            value: t.panel.pieSliceSorting ?? "desc",
            onChange: s[1] || (s[1] = (f) => t.onChange({ pieSliceSorting: f.target.value }))
          }, {
            default: ye(() => [
              v(u, { value: "desc" }, {
                default: ye(() => [
                  Ve(se(I(n)("config.sort.desc")), 1)
                ]),
                _: 1
              }),
              v(u, { value: "asc" }, {
                default: ye(() => [
                  Ve(se(I(n)("config.sort.asc")), 1)
                ]),
                _: 1
              }),
              v(u, { value: "none" }, {
                default: ye(() => [
                  Ve(se(I(n)("config.sort.none")), 1)
                ]),
                _: 1
              })
            ]),
            _: 1
          }, 8, ["value"])
        ]),
        F("div", null, [
          F("div", dge, se(I(n)("config.field.pieLabels")), 1),
          F("div", fge, [
            (re(), be(tt, null, Jt(["name", "percent", "value"], (f) => F("label", {
              key: f,
              class: "flex items-center gap-1"
            }, [
              v(d, {
                checked: i.value.includes(f),
                onChange: (h) => r(f, h.target.checked)
              }, null, 8, ["checked", "onChange"]),
              F("span", hge, se(I(n)(`config.pieLabel.${f}`)), 1)
            ])), 64))
          ])
        ]),
        F("div", null, [
          F("div", pge, se(I(n)("config.field.pieShow")), 1),
          v(c, {
            size: "small",
            value: t.panel.pieShow ?? "calculate",
            onChange: s[2] || (s[2] = (f) => t.onChange({ pieShow: f.target.value }))
          }, {
            default: ye(() => [
              v(u, { value: "calculate" }, {
                default: ye(() => [
                  Ve(se(I(n)("config.pieShow.calculate")), 1)
                ]),
                _: 1
              }),
              v(u, { value: "all" }, {
                default: ye(() => [
                  Ve(se(I(n)("config.pieShow.all")), 1)
                ]),
                _: 1
              })
            ]),
            _: 1
          }, 8, ["value"])
        ]),
        (t.panel.pieShow ?? "calculate") === "calculate" ? (re(), be("div", gge, [
          F("div", mge, se(I(n)("config.field.reducer")), 1),
          v(I(Dt), {
            size: "small",
            value: t.panel.pieCalculation ?? "lastNotNull",
            options: [
              { value: "lastNotNull", label: I(n)("config.reducer.lastNotNull") },
              { value: "last", label: I(n)("config.reducer.last") },
              { value: "mean", label: I(n)("config.reducer.mean") },
              { value: "min", label: I(n)("config.reducer.min") },
              { value: "max", label: I(n)("config.reducer.max") },
              { value: "sum", label: I(n)("config.reducer.sum") }
            ],
            style: { width: "100%" },
            onChange: s[3] || (s[3] = (f) => t.onChange({ pieCalculation: f }))
          }, null, 8, ["value", "options"])
        ])) : et("", !0),
        F("div", null, [
          F("div", vge, se(I(n)("config.field.legendMode")), 1),
          v(c, {
            size: "small",
            value: t.panel.legendMode ?? "list",
            onChange: s[4] || (s[4] = (f) => t.onChange({ legendMode: f.target.value }))
          }, {
            default: ye(() => [
              v(u, { value: "list" }, {
                default: ye(() => [
                  Ve(se(I(n)("config.legendMode.list")), 1)
                ]),
                _: 1
              }),
              v(u, { value: "table" }, {
                default: ye(() => [
                  Ve(se(I(n)("config.legendMode.table")), 1)
                ]),
                _: 1
              })
            ]),
            _: 1
          }, 8, ["value"])
        ]),
        F("div", null, [
          F("div", yge, se(I(n)("config.field.legendValues")), 1),
          F("div", bge, [
            (re(), be(tt, null, Jt(["min", "max", "mean", "sum", "last"], (f) => F("label", {
              key: f,
              class: "flex items-center gap-1"
            }, [
              v(d, {
                checked: o.value.includes(f),
                onChange: (h) => a(f, h.target.checked)
              }, null, 8, ["checked", "onChange"]),
              F("span", xge, se(I(n)(`config.legendValue.${f}`)), 1)
            ])), 64))
          ])
        ])
      ]);
    };
  }
}), Sge = { class: "flex flex-col gap-3" }, wge = { class: "text-xs text-secondary mb-1" }, Cge = { class: "text-xs text-secondary mb-1" }, $ge = { class: "text-xs text-secondary mb-1" }, kge = { class: "text-xs text-secondary mb-1" }, Tge = /* @__PURE__ */ Oe({
  __name: "StatStyleSection",
  props: {
    panel: {},
    onChange: { type: Function },
    numericFieldNames: {},
    allFieldNames: {}
  },
  setup(t) {
    const { t: e } = On();
    return (n, i) => {
      const o = Rn("a-switch");
      return re(), be("div", Sge, [
        F("div", null, [
          F("div", wge, se(I(e)("config.field.orientation")), 1),
          v(I(Dt), {
            size: "small",
            value: t.panel.statOrientation ?? "vertical",
            options: [
              { value: "vertical", label: I(e)("config.orientation.vertical") },
              { value: "horizontal", label: I(e)("config.orientation.horizontal") }
            ],
            style: { width: "100%" },
            onChange: i[0] || (i[0] = (r) => t.onChange({ statOrientation: r }))
          }, null, 8, ["value", "options"])
        ]),
        F("div", null, [
          F("div", Cge, se(I(e)("config.field.textMode")), 1),
          v(I(Dt), {
            size: "small",
            value: t.panel.statTextMode ?? "value_and_name",
            options: [
              { value: "value_and_name", label: I(e)("config.textMode.valueAndName") },
              { value: "value", label: I(e)("config.textMode.value") },
              { value: "name", label: I(e)("config.textMode.name") },
              { value: "none", label: I(e)("config.textMode.none") }
            ],
            style: { width: "100%" },
            onChange: i[1] || (i[1] = (r) => t.onChange({ statTextMode: r }))
          }, null, 8, ["value", "options"])
        ]),
        F("div", null, [
          F("div", $ge, se(I(e)("config.field.colorMode")), 1),
          v(I(Dt), {
            size: "small",
            value: t.panel.statColorMode ?? "value",
            options: [
              { value: "value", label: I(e)("config.colorMode.value") },
              { value: "background_solid", label: I(e)("config.colorMode.backgroundSolid") },
              { value: "background", label: I(e)("config.colorMode.background") }
            ],
            style: { width: "100%" },
            onChange: i[2] || (i[2] = (r) => t.onChange({ statColorMode: r }))
          }, null, 8, ["value", "options"])
        ]),
        F("div", null, [
          F("div", kge, se(I(e)("config.field.percentChange")), 1),
          v(o, {
            size: "small",
            checked: t.panel.showPercentChange ?? !1,
            onChange: i[3] || (i[3] = (r) => t.onChange({ showPercentChange: r }))
          }, null, 8, ["checked"])
        ])
      ]);
    };
  }
}), Pge = { class: "flex flex-col gap-3" }, Ege = { key: 0 }, _ge = { class: "text-xs text-secondary mb-1" }, Ige = { key: 1 }, Mge = { class: "text-xs text-secondary mb-1" }, Age = { key: 2 }, Rge = { class: "text-xs text-secondary mb-1" }, Dge = { key: 3 }, Nge = { class: "text-xs text-secondary mb-1" }, Lge = { class: "text-xs text-secondary mb-1" }, zge = { class: "text-xs text-secondary mb-1" }, Bge = { class: "text-xs text-secondary mb-1" }, Fge = { class: "flex items-center gap-2" }, Vge = { class: "text-xs text-secondary mb-1" }, Qge = { class: "flex items-center gap-2" }, Hge = { key: 5 }, Wge = { class: "text-xs text-secondary mb-1" }, jge = { key: 6 }, qge = { class: "text-xs text-secondary mb-1" }, Yge = { class: "text-xs text-secondary mb-1" }, Kge = { key: 7 }, Xge = { class: "text-xs text-secondary mb-1" }, Zge = /* @__PURE__ */ Oe({
  __name: "StyleSection",
  props: {
    panel: {},
    onChange: { type: Function },
    numericFieldNames: {},
    allFieldNames: {}
  },
  setup(t) {
    const e = t, { t: n } = On(), i = e.panel.type === "timeseries", o = e.panel.drawStyle ?? "lines", r = o === "lines", a = o === "points", l = e.panel.showPointsMode ?? "auto", s = e.panel.spanNulls ?? !1, u = e.panel.insertNulls ?? !1;
    return (c, d) => {
      const f = Rn("a-radio-button"), h = Rn("a-radio-group"), p = Rn("a-input-number"), g = Rn("a-switch");
      return re(), be("div", Pge, [
        i ? (re(), be("div", Ege, [
          F("div", _ge, se(I(n)("config.field.drawStyle")), 1),
          v(h, {
            size: "small",
            value: t.panel.drawStyle ?? "lines",
            onChange: d[0] || (d[0] = (m) => t.onChange({ drawStyle: m.target.value }))
          }, {
            default: ye(() => [
              v(f, { value: "lines" }, {
                default: ye(() => [
                  Ve(se(I(n)("config.drawStyle.lines")), 1)
                ]),
                _: 1
              }),
              v(f, { value: "bars" }, {
                default: ye(() => [
                  Ve(se(I(n)("config.drawStyle.bars")), 1)
                ]),
                _: 1
              }),
              v(f, { value: "points" }, {
                default: ye(() => [
                  Ve(se(I(n)("config.drawStyle.points")), 1)
                ]),
                _: 1
              })
            ]),
            _: 1
          }, 8, ["value"])
        ])) : et("", !0),
        a ? et("", !0) : (re(), be("div", Ige, [
          F("div", Mge, se(I(n)("config.field.lineWidth")), 1),
          v(I(vr), {
            min: 0.5,
            max: 4,
            step: 0.5,
            value: t.panel.lineWidth,
            onChange: d[1] || (d[1] = (m) => t.onChange({ lineWidth: m }))
          }, null, 8, ["value"])
        ])),
        a ? et("", !0) : (re(), be("div", Age, [
          F("div", Rge, se(I(n)("config.field.fillOpacity")), 1),
          v(I(vr), {
            min: 0,
            max: 100,
            value: t.panel.fillOpacity,
            onChange: d[2] || (d[2] = (m) => t.onChange({ fillOpacity: m }))
          }, null, 8, ["value"])
        ])),
        a ? et("", !0) : (re(), be("div", Dge, [
          F("div", Nge, se(I(n)("config.field.gradientMode")), 1),
          v(h, {
            size: "small",
            value: t.panel.gradientMode ?? "none",
            onChange: d[3] || (d[3] = (m) => t.onChange({ gradientMode: m.target.value }))
          }, {
            default: ye(() => [
              v(f, { value: "none" }, {
                default: ye(() => [
                  Ve(se(I(n)("config.gradient.none")), 1)
                ]),
                _: 1
              }),
              v(f, { value: "opacity" }, {
                default: ye(() => [
                  Ve(se(I(n)("config.gradient.opacity")), 1)
                ]),
                _: 1
              }),
              v(f, { value: "hue" }, {
                default: ye(() => [
                  Ve(se(I(n)("config.gradient.hue")), 1)
                ]),
                _: 1
              }),
              v(f, { value: "scheme" }, {
                default: ye(() => [
                  Ve(se(I(n)("config.gradient.scheme")), 1)
                ]),
                _: 1
              })
            ]),
            _: 1
          }, 8, ["value"])
        ])),
        i && r ? (re(), be(tt, { key: 4 }, [
          F("div", null, [
            F("div", Lge, se(I(n)("config.field.interpolation")), 1),
            v(h, {
              size: "small",
              value: t.panel.lineInterpolation,
              onChange: d[4] || (d[4] = (m) => t.onChange({ lineInterpolation: m.target.value }))
            }, {
              default: ye(() => [
                v(f, { value: "linear" }, {
                  default: ye(() => [
                    Ve(se(I(n)("config.interp.linear")), 1)
                  ]),
                  _: 1
                }),
                v(f, { value: "smooth" }, {
                  default: ye(() => [
                    Ve(se(I(n)("config.interp.smooth")), 1)
                  ]),
                  _: 1
                }),
                v(f, { value: "step" }, {
                  default: ye(() => [
                    Ve(se(I(n)("config.interp.step")), 1)
                  ]),
                  _: 1
                })
              ]),
              _: 1
            }, 8, ["value"])
          ]),
          F("div", null, [
            F("div", zge, se(I(n)("config.field.lineStyle")), 1),
            v(h, {
              size: "small",
              value: t.panel.lineStyle,
              onChange: d[5] || (d[5] = (m) => t.onChange({ lineStyle: m.target.value }))
            }, {
              default: ye(() => [
                v(f, { value: "solid" }, {
                  default: ye(() => [
                    Ve(se(I(n)("config.linestyle.solid")), 1)
                  ]),
                  _: 1
                }),
                v(f, { value: "dashed" }, {
                  default: ye(() => [
                    Ve(se(I(n)("config.linestyle.dashed")), 1)
                  ]),
                  _: 1
                }),
                v(f, { value: "dotted" }, {
                  default: ye(() => [
                    Ve(se(I(n)("config.linestyle.dotted")), 1)
                  ]),
                  _: 1
                })
              ]),
              _: 1
            }, 8, ["value"])
          ]),
          F("div", null, [
            F("div", Bge, se(I(n)("config.field.spanNulls")), 1),
            F("div", Fge, [
              v(h, {
                size: "small",
                value: I(s) === !0 ? "always" : typeof I(s) == "number" ? "threshold" : "never",
                onChange: d[6] || (d[6] = (m) => {
                  m.target.value === "never" ? t.onChange({ spanNulls: !1 }) : m.target.value === "always" ? t.onChange({ spanNulls: !0 }) : t.onChange({ spanNulls: 3600 });
                })
              }, {
                default: ye(() => [
                  v(f, { value: "never" }, {
                    default: ye(() => [
                      Ve(se(I(n)("config.nulls.never")), 1)
                    ]),
                    _: 1
                  }),
                  v(f, { value: "always" }, {
                    default: ye(() => [
                      Ve(se(I(n)("config.nulls.always")), 1)
                    ]),
                    _: 1
                  }),
                  v(f, { value: "threshold" }, {
                    default: ye(() => [
                      Ve(se(I(n)("config.nulls.threshold")), 1)
                    ]),
                    _: 1
                  })
                ]),
                _: 1
              }, 8, ["value"]),
              typeof I(s) == "number" ? (re(), ut(p, {
                key: 0,
                size: "small",
                min: 1,
                value: I(s),
                suffix: "s",
                style: { width: "90px" },
                onChange: d[7] || (d[7] = (m) => t.onChange({ spanNulls: m ?? 3600 }))
              }, null, 8, ["value"])) : et("", !0)
            ])
          ]),
          F("div", null, [
            F("div", Vge, se(I(n)("config.field.insertNulls")), 1),
            F("div", Qge, [
              v(h, {
                size: "small",
                value: typeof I(u) == "number" ? "threshold" : "never",
                onChange: d[8] || (d[8] = (m) => {
                  m.target.value === "never" ? t.onChange({ insertNulls: !1 }) : t.onChange({ insertNulls: 3600 });
                })
              }, {
                default: ye(() => [
                  v(f, { value: "never" }, {
                    default: ye(() => [
                      Ve(se(I(n)("config.nulls.never")), 1)
                    ]),
                    _: 1
                  }),
                  v(f, { value: "threshold" }, {
                    default: ye(() => [
                      Ve(se(I(n)("config.nulls.threshold")), 1)
                    ]),
                    _: 1
                  })
                ]),
                _: 1
              }, 8, ["value"]),
              typeof I(u) == "number" ? (re(), ut(p, {
                key: 0,
                size: "small",
                min: 1,
                value: I(u),
                suffix: "s",
                style: { width: "90px" },
                onChange: d[9] || (d[9] = (m) => t.onChange({ insertNulls: m ?? 3600 }))
              }, null, 8, ["value"])) : et("", !0)
            ])
          ])
        ], 64)) : et("", !0),
        i && !a ? (re(), be("div", Hge, [
          F("div", Wge, se(I(n)("config.field.showPoints")), 1),
          v(h, {
            size: "small",
            value: I(l),
            onChange: d[10] || (d[10] = (m) => t.onChange({ showPointsMode: m.target.value, showPoints: m.target.value === "always" }))
          }, {
            default: ye(() => [
              v(f, { value: "auto" }, {
                default: ye(() => [
                  Ve(se(I(n)("config.points.auto")), 1)
                ]),
                _: 1
              }),
              v(f, { value: "always" }, {
                default: ye(() => [
                  Ve(se(I(n)("config.points.always")), 1)
                ]),
                _: 1
              }),
              v(f, { value: "never" }, {
                default: ye(() => [
                  Ve(se(I(n)("config.points.never")), 1)
                ]),
                _: 1
              })
            ]),
            _: 1
          }, 8, ["value"])
        ])) : et("", !0),
        i ? (re(), be("div", jge, [
          F("div", qge, se(I(n)("config.field.stackSeries")), 1),
          v(h, {
            size: "small",
            value: t.panel.stackingMode ?? "none",
            onChange: d[11] || (d[11] = (m) => t.onChange({ stackingMode: m.target.value }))
          }, {
            default: ye(() => [
              v(f, { value: "none" }, {
                default: ye(() => [
                  Ve(se(I(n)("config.stack.none")), 1)
                ]),
                _: 1
              }),
              v(f, { value: "normal" }, {
                default: ye(() => [
                  Ve(se(I(n)("config.stack.normal")), 1)
                ]),
                _: 1
              }),
              v(f, { value: "percent" }, {
                default: ye(() => [
                  Ve(se(I(n)("config.stack.percent")), 1)
                ]),
                _: 1
              })
            ]),
            _: 1
          }, 8, ["value"])
        ])) : et("", !0),
        F("div", null, [
          F("div", Yge, se(I(n)("config.field.legendPosition")), 1),
          v(h, {
            size: "small",
            value: t.panel.legendPosition,
            onChange: d[12] || (d[12] = (m) => t.onChange({ legendPosition: m.target.value }))
          }, {
            default: ye(() => [
              v(f, { value: "bottom" }, {
                default: ye(() => [
                  Ve(se(I(n)("config.legend.bottom")), 1)
                ]),
                _: 1
              }),
              v(f, { value: "right" }, {
                default: ye(() => [
                  Ve(se(I(n)("config.legend.right")), 1)
                ]),
                _: 1
              }),
              v(f, { value: "hidden" }, {
                default: ye(() => [
                  Ve(se(I(n)("config.legend.hidden")), 1)
                ]),
                _: 1
              })
            ]),
            _: 1
          }, 8, ["value"])
        ]),
        t.panel.type === "bar" ? (re(), be("div", Kge, [
          F("div", Xge, se(I(n)("config.field.stacked")), 1),
          v(g, {
            size: "small",
            checked: t.panel.stacked,
            onChange: d[13] || (d[13] = (m) => t.onChange({ stacked: m }))
          }, null, 8, ["checked"])
        ])) : et("", !0)
      ]);
    };
  }
}), Gge = { class: "flex flex-col gap-3" }, Uge = { class: "text-xs text-secondary mb-1" }, Jge = { class: "text-xs text-secondary mb-1" }, eme = { class: "text-xs text-secondary mb-1" }, tme = { class: "text-xs text-secondary mb-1" }, nme = { class: "text-xs text-secondary mb-1" }, ime = { class: "text-xs text-secondary mb-1" }, ome = { key: 0 }, rme = { class: "text-xs text-secondary mb-1" }, ame = { class: "text-xs text-secondary mb-1" }, lme = { key: 1 }, sme = { class: "text-xs text-secondary mb-1" }, ume = { key: 2 }, cme = { class: "text-xs text-secondary mb-1" }, dme = /* @__PURE__ */ Oe({
  __name: "TableStyleSection",
  props: {
    panel: {},
    onChange: { type: Function },
    numericFieldNames: {},
    allFieldNames: {}
  },
  setup(t) {
    const e = t, { t: n } = On();
    function i(o) {
      e.onChange({ tableFooterReducers: o ? [o] : [] });
    }
    return (o, r) => {
      const a = Rn("a-switch"), l = Rn("a-radio-button"), s = Rn("a-radio-group");
      return re(), be("div", Gge, [
        F("div", null, [
          F("div", Uge, se(I(n)("config.field.tableShowHeader")), 1),
          v(a, {
            size: "small",
            checked: t.panel.tableShowHeader ?? !0,
            onChange: r[0] || (r[0] = (u) => t.onChange({ tableShowHeader: u }))
          }, null, 8, ["checked"])
        ]),
        F("div", null, [
          F("div", Jge, se(I(n)("config.field.tableCellHeight")), 1),
          v(s, {
            size: "small",
            value: t.panel.tableCellHeight ?? "medium",
            onChange: r[1] || (r[1] = (u) => t.onChange({ tableCellHeight: u.target.value }))
          }, {
            default: ye(() => [
              v(l, { value: "small" }, {
                default: ye(() => [
                  Ve(se(I(n)("config.tableHeight.small")), 1)
                ]),
                _: 1
              }),
              v(l, { value: "medium" }, {
                default: ye(() => [
                  Ve(se(I(n)("config.tableHeight.medium")), 1)
                ]),
                _: 1
              }),
              v(l, { value: "large" }, {
                default: ye(() => [
                  Ve(se(I(n)("config.tableHeight.large")), 1)
                ]),
                _: 1
              })
            ]),
            _: 1
          }, 8, ["value"])
        ]),
        F("div", null, [
          F("div", eme, se(I(n)("config.field.tableFrozenColumns")), 1),
          v(I(Do), {
            size: "small",
            min: 0,
            max: 10,
            value: t.panel.tableFrozenColumns ?? 0,
            style: { width: "100%" },
            onChange: r[2] || (r[2] = (u) => t.onChange({ tableFrozenColumns: u ?? 0 }))
          }, null, 8, ["value"])
        ]),
        F("div", null, [
          F("div", tme, se(I(n)("config.field.tableColumnFilter")), 1),
          v(a, {
            size: "small",
            checked: t.panel.tableColumnFilter ?? !1,
            onChange: r[3] || (r[3] = (u) => t.onChange({ tableColumnFilter: u }))
          }, null, 8, ["checked"])
        ]),
        F("div", null, [
          F("div", nme, se(I(n)("config.field.tableWrapText")), 1),
          v(a, {
            size: "small",
            checked: t.panel.tableWrapText ?? !1,
            onChange: r[4] || (r[4] = (u) => t.onChange({ tableWrapText: u }))
          }, null, 8, ["checked"])
        ]),
        F("div", null, [
          F("div", ime, se(I(n)("config.field.tableEnablePagination")), 1),
          v(a, {
            size: "small",
            checked: t.panel.tableEnablePagination ?? !1,
            onChange: r[5] || (r[5] = (u) => t.onChange({ tableEnablePagination: u }))
          }, null, 8, ["checked"])
        ]),
        t.panel.tableEnablePagination ? (re(), be("div", ome, [
          F("div", rme, se(I(n)("config.field.tablePageSize")), 1),
          v(I(Do), {
            size: "small",
            min: 5,
            max: 500,
            value: t.panel.tablePageSize ?? 20,
            style: { width: "100%" },
            onChange: r[6] || (r[6] = (u) => t.onChange({ tablePageSize: u ?? 20 }))
          }, null, 8, ["value"])
        ])) : et("", !0),
        F("div", null, [
          F("div", ame, se(I(n)("config.field.tableFooterEnabled")), 1),
          v(a, {
            size: "small",
            checked: t.panel.tableFooterEnabled ?? !1,
            onChange: r[7] || (r[7] = (u) => t.onChange({ tableFooterEnabled: u }))
          }, null, 8, ["checked"])
        ]),
        t.panel.tableFooterEnabled ? (re(), be("div", lme, [
          F("div", sme, se(I(n)("config.field.tableFooterReducers")), 1),
          v(I(Dt), {
            size: "small",
            value: t.panel.tableFooterReducers?.[0],
            options: [
              { value: "min", label: I(n)("config.reducer.min") },
              { value: "max", label: I(n)("config.reducer.max") },
              { value: "mean", label: I(n)("config.reducer.mean") },
              { value: "sum", label: I(n)("config.reducer.sum") },
              { value: "count", label: I(n)("config.reducer.count") }
            ],
            "allow-clear": "",
            style: { width: "100%" },
            onChange: r[8] || (r[8] = (u) => i(u))
          }, null, 8, ["value", "options"])
        ])) : et("", !0),
        t.panel.tableFooterEnabled && t.panel.tableFooterReducers?.[0] ? (re(), be("div", ume, [
          F("div", cme, se(I(n)("config.field.tableFooterFields")), 1),
          v(I(Dt), {
            size: "small",
            mode: "multiple",
            "allow-clear": "",
            placeholder: I(n)("config.field.tableFooterFieldsPlaceholder"),
            value: t.panel.tableFooterFields ?? [],
            options: (t.numericFieldNames ?? []).map((u) => ({ value: u, label: u })),
            style: { width: "100%" },
            onChange: r[9] || (r[9] = (u) => t.onChange({ tableFooterFields: u.length > 0 ? u : void 0 }))
          }, null, 8, ["placeholder", "value", "options"])
        ])) : et("", !0)
      ]);
    };
  }
}), fme = { class: "flex flex-col gap-1" }, hme = { class: "mb-2" }, pme = { class: "text-xs text-secondary mb-1" }, gme = ["value", "onInput"], mme = { class: "flex items-center gap-1.5 mb-1" }, vme = ["value"], yme = { class: "text-xs text-secondary flex-1" }, bme = /* @__PURE__ */ Oe({
  __name: "ThresholdsEditor",
  props: {
    panel: {},
    onChange: { type: Function },
    numericFieldNames: {},
    allFieldNames: {}
  },
  setup(t) {
    const e = t, { t: n } = On(), i = ["#52c41a", "#faad14", "#ff4d4f", "#1677ff", "#722ed1", "#13c2c2", "#fa8c16"], o = de(e.panel.thresholdMode ?? "absolute"), r = A(() => o.value === "percentage"), a = A(() => [...e.panel.thresholds].sort((f, h) => h.value - f.value));
    function l() {
      const f = [e.panel.thresholdBaseColor, ...e.panel.thresholds.map((h) => h.color)];
      return i.find((h) => !f.includes(h)) ?? "#cccccc";
    }
    function s() {
      const f = e.panel.thresholds.length > 0 ? Math.max(...e.panel.thresholds.map((m) => m.value)) : 0, p = { value: r.value ? Math.min(100, f + 20) : f + 10, color: l(), label: "" }, g = [...e.panel.thresholds, p].sort((m, y) => m.value - y.value);
      e.onChange({ thresholds: g });
    }
    function u(f) {
      e.onChange({ thresholds: e.panel.thresholds.filter((h) => h.value !== f) });
    }
    function c(f, h) {
      const p = e.panel.thresholds.map((g) => g.value === f ? { ...g, ...h } : g).sort((g, m) => g.value - m.value);
      e.onChange({ thresholds: p });
    }
    function d(f) {
      o.value = f, e.onChange({ thresholdMode: f });
    }
    return (f, h) => {
      const p = Rn("a-input");
      return re(), be("div", fme, [
        F("div", hme, [
          F("div", pme, se(I(n)("config.threshold.mode")), 1),
          v(I(uo).Group, {
            size: "small",
            value: o.value,
            onChange: h[0] || (h[0] = (g) => d(g.target.value))
          }, {
            default: ye(() => [
              v(I(uo).Button, { value: "absolute" }, {
                default: ye(() => [
                  Ve(se(I(n)("config.threshold.modeAbsolute")), 1)
                ]),
                _: 1
              }),
              v(I(uo).Button, { value: "percentage" }, {
                default: ye(() => [
                  Ve(se(I(n)("config.threshold.modePercentage")), 1)
                ]),
                _: 1
              })
            ]),
            _: 1
          }, 8, ["value"])
        ]),
        (re(!0), be(tt, null, Jt(a.value, (g) => (re(), be("div", {
          key: g.value,
          class: "flex items-center gap-1.5 mb-1"
        }, [
          F("input", {
            type: "color",
            class: "w-7 h-7 border border-gray-300 rounded cursor-pointer",
            value: g.color,
            onInput: (m) => c(g.value, { color: m.target.value })
          }, null, 40, gme),
          v(I(Do), {
            size: "small",
            value: g.value,
            min: r.value ? 0 : void 0,
            max: r.value ? 100 : void 0,
            style: { width: "80px" },
            onChange: (m) => c(g.value, { value: m ?? 0 })
          }, null, 8, ["value", "min", "max", "onChange"]),
          v(p, {
            size: "small",
            value: g.label,
            placeholder: "Label",
            style: { flex: "1" },
            onChange: (m) => c(g.value, { label: m.target.value })
          }, null, 8, ["value", "onChange"]),
          v(I(en), {
            type: "text",
            danger: "",
            size: "small",
            onClick: (m) => u(g.value)
          }, {
            default: ye(() => [
              F("span", {
                class: Tt(I(St).delete)
              }, null, 2)
            ]),
            _: 1
          }, 8, ["onClick"])
        ]))), 128)),
        F("div", mme, [
          F("input", {
            type: "color",
            class: "w-7 h-7 border border-gray-300 rounded cursor-pointer",
            value: t.panel.thresholdBaseColor,
            onInput: h[1] || (h[1] = (g) => t.onChange({ thresholdBaseColor: g.target.value }))
          }, null, 40, vme),
          F("span", yme, se(I(n)("config.threshold.base")), 1)
        ]),
        v(I(en), {
          type: "dashed",
          size: "small",
          block: "",
          onClick: s
        }, {
          default: ye(() => [
            F("span", {
              class: Tt([I(St).plus, "mr-1"])
            }, null, 2),
            Ve(" " + se(I(n)("config.threshold.add")), 1)
          ]),
          _: 1
        })
      ]);
    };
  }
}), xme = { class: "flex flex-col gap-3" }, Ome = { class: "text-xs text-secondary mb-1" }, Sme = { key: 0 }, wme = { class: "text-xs text-secondary mb-1" }, Cme = { key: 1 }, $me = { class: "text-xs text-secondary mb-1" }, kme = { class: "text-xs text-secondary mb-1" }, Tme = /* @__PURE__ */ Oe({
  __name: "TooltipSection",
  props: {
    panel: {},
    onChange: { type: Function },
    numericFieldNames: {},
    allFieldNames: {}
  },
  setup(t) {
    const { t: e } = On();
    return (n, i) => {
      const o = Rn("a-radio-button"), r = Rn("a-radio-group"), a = Rn("a-switch");
      return re(), be("div", xme, [
        F("div", null, [
          F("div", Ome, se(I(e)("config.field.tooltipMode")), 1),
          v(r, {
            size: "small",
            value: t.panel.tooltipMode ?? "multi",
            onChange: i[0] || (i[0] = (l) => t.onChange({ tooltipMode: l.target.value }))
          }, {
            default: ye(() => [
              v(o, { value: "single" }, {
                default: ye(() => [
                  Ve(se(I(e)("config.tooltip.single")), 1)
                ]),
                _: 1
              }),
              v(o, { value: "multi" }, {
                default: ye(() => [
                  Ve(se(I(e)("config.tooltip.multi")), 1)
                ]),
                _: 1
              }),
              v(o, { value: "none" }, {
                default: ye(() => [
                  Ve(se(I(e)("config.tooltip.none")), 1)
                ]),
                _: 1
              })
            ]),
            _: 1
          }, 8, ["value"])
        ]),
        (t.panel.tooltipMode ?? "multi") === "multi" ? (re(), be("div", Sme, [
          F("div", wme, se(I(e)("config.field.tooltipSort")), 1),
          v(r, {
            size: "small",
            value: t.panel.tooltipSort ?? "none",
            onChange: i[1] || (i[1] = (l) => t.onChange({ tooltipSort: l.target.value }))
          }, {
            default: ye(() => [
              v(o, { value: "none" }, {
                default: ye(() => [
                  Ve(se(I(e)("config.tooltip.sortNone")), 1)
                ]),
                _: 1
              }),
              v(o, { value: "asc" }, {
                default: ye(() => [
                  Ve(se(I(e)("config.tooltip.sortAsc")), 1)
                ]),
                _: 1
              }),
              v(o, { value: "desc" }, {
                default: ye(() => [
                  Ve(se(I(e)("config.tooltip.sortDesc")), 1)
                ]),
                _: 1
              })
            ]),
            _: 1
          }, 8, ["value"])
        ])) : et("", !0),
        (t.panel.tooltipMode ?? "multi") === "multi" ? (re(), be("div", Cme, [
          F("div", $me, se(I(e)("config.field.tooltipMaxHeight")), 1),
          v(I(Do), {
            size: "small",
            min: 50,
            max: 800,
            value: t.panel.tooltipMaxHeight ?? 600,
            suffix: "px",
            style: { width: "100%" },
            onChange: i[2] || (i[2] = (l) => t.onChange({ tooltipMaxHeight: l ?? 600 }))
          }, null, 8, ["value"])
        ])) : et("", !0),
        F("div", null, [
          F("div", kme, se(I(e)("config.field.axisPointer")), 1),
          v(a, {
            size: "small",
            checked: t.panel.showAxisPointer ?? !0,
            onChange: i[3] || (i[3] = (l) => t.onChange({ showAxisPointer: l }))
          }, null, 8, ["checked"])
        ])
      ]);
    };
  }
}), Pme = { class: "flex items-center gap-2" }, Eme = /* @__PURE__ */ Oe({
  __name: "SliderInput",
  props: {
    value: {},
    min: {},
    max: {},
    step: { default: 1 },
    shiftMultiplier: { default: 10 },
    unit: {},
    placeholder: {},
    allowClear: { type: Boolean, default: !1 }
  },
  emits: ["change"],
  setup(t, { emit: e }) {
    const n = t, i = e, { t: o } = On();
    function r(h) {
      return Math.min(n.max, Math.max(n.min, h));
    }
    const a = A(() => n.value ?? n.min), l = A(() => n.placeholder ?? o("common.auto")), s = A(() => {
      const h = n.value !== void 0 ? n.unit ? `${n.value}${n.unit}` : String(n.value) : l.value;
      try {
        const p = document.createElement("canvas").getContext("2d");
        return p ? (p.font = "14px system-ui, -apple-system, sans-serif", `${Math.ceil(p.measureText(h).width) + 24}px`) : "6ch";
      } catch {
        return "6ch";
      }
    });
    function u(h) {
      typeof h == "number" && i("change", r(h));
    }
    function c(h) {
      h != null && i("change", r(Number(h)));
    }
    function d() {
      i("change", void 0);
    }
    function f(h) {
      const p = h.shiftKey, g = n.step * (p ? n.shiftMultiplier : 1);
      h.key === "ArrowRight" || h.key === "ArrowUp" ? (h.preventDefault(), i("change", r(a.value + g))) : (h.key === "ArrowLeft" || h.key === "ArrowDown") && (h.preventDefault(), i("change", r(a.value - g)));
    }
    return (h, p) => (re(), be("div", Pme, [
      v(I(vr), {
        min: t.min,
        max: t.max,
        step: t.step,
        value: a.value,
        style: { flex: "1" },
        "tooltip-formatter": t.unit ? ((g) => `${g}${t.unit}`) : void 0,
        onChange: u
      }, null, 8, ["min", "max", "step", "value", "tooltip-formatter"]),
      v(I(Pl).Compact, { size: "small" }, {
        default: ye(() => [
          v(I(Do), {
            size: "small",
            controls: !1,
            min: t.min,
            max: t.max,
            step: t.step,
            value: t.value ?? void 0,
            placeholder: l.value,
            style: Yt({ width: s.value }),
            suffix: t.unit && t.value !== void 0 ? t.unit : void 0,
            onKeydown: f,
            onChange: c
          }, null, 8, ["min", "max", "step", "value", "placeholder", "style", "suffix"]),
          t.allowClear && t.value !== void 0 ? (re(), ut(I(en), {
            key: 0,
            onClick: d
          }, {
            default: ye(() => [
              F("span", {
                class: Tt([I(St).closeCircle, "text-xs text-gray-400 cursor-pointer"])
              }, null, 2)
            ]),
            _: 1
          })) : et("", !0)
        ]),
        _: 1
      })
    ]));
  }
}), _me = { class: "flex flex-col gap-3" }, Ime = { key: 0 }, Mme = { class: "text-xs text-secondary mb-1" }, Ame = { class: "text-xs text-secondary mb-1" }, Rme = { class: "text-xs text-secondary mb-1" }, Dme = { key: 1 }, Nme = { class: "text-xs text-secondary mb-1" }, Lme = { key: 2 }, zme = { class: "text-xs text-secondary mb-1" }, Bme = /* @__PURE__ */ Oe({
  __name: "ValueSection",
  props: {
    panel: {},
    onChange: { type: Function },
    numericFieldNames: {},
    allFieldNames: {}
  },
  setup(t) {
    const e = t, { t: n } = On(), o = ["", "ms", "s", "bytes", "percent", "percentunit", "reqps", "ops", "bps", "Bps"].map((s) => ({
      value: s,
      label: n(s ? `config.unit.${s}` : "config.unit.none")
    })), r = [
      { value: "lastNotNull", label: n("config.reducer.lastNotNull") },
      { value: "last", label: n("config.reducer.last") },
      { value: "firstNotNull", label: n("config.reducer.firstNotNull") },
      { value: "first", label: n("config.reducer.first") },
      { value: "mean", label: n("config.reducer.mean") },
      { value: "min", label: n("config.reducer.min") },
      { value: "max", label: n("config.reducer.max") },
      { value: "sum", label: n("config.reducer.sum") },
      { value: "count", label: n("config.reducer.count") }
    ], a = e.panel.type === "gauge", l = e.panel.type !== "timeseries";
    return (s, u) => (re(), be("div", _me, [
      l ? (re(), be("div", Ime, [
        F("div", Mme, se(I(n)("config.field.reducer")), 1),
        v(I(Dt), {
          size: "small",
          value: t.panel.statReducer ?? "lastNotNull",
          options: r,
          style: { width: "100%" },
          onChange: u[0] || (u[0] = (c) => t.onChange({ statReducer: c }))
        }, null, 8, ["value"])
      ])) : et("", !0),
      F("div", null, [
        F("div", Ame, se(I(n)("config.field.unit")), 1),
        v(I(Dt), {
          size: "small",
          value: t.panel.unit || "",
          options: I(o),
          style: { width: "100%" },
          onChange: u[1] || (u[1] = (c) => t.onChange({ unit: c }))
        }, null, 8, ["value", "options"])
      ]),
      F("div", null, [
        F("div", Rme, se(I(n)("config.field.decimals")), 1),
        v(Eme, {
          min: 0,
          max: 15,
          step: 1,
          value: t.panel.decimals,
          "allow-clear": !0,
          onChange: u[2] || (u[2] = (c) => t.onChange({ decimals: c }))
        }, null, 8, ["value"])
      ]),
      a ? (re(), be("div", Dme, [
        F("div", Nme, se(I(n)("config.field.min")), 1),
        v(I(Do), {
          size: "small",
          value: t.panel.min,
          style: { width: "100%" },
          onChange: u[3] || (u[3] = (c) => t.onChange({ min: c ?? 0 }))
        }, null, 8, ["value"])
      ])) : et("", !0),
      a ? (re(), be("div", Lme, [
        F("div", zme, se(I(n)("config.field.max")), 1),
        v(I(Do), {
          size: "small",
          value: t.panel.max,
          style: { width: "100%" },
          onChange: u[4] || (u[4] = (c) => t.onChange({ max: c ?? 100 }))
        }, null, 8, ["value"])
      ])) : et("", !0)
    ]));
  }
}), Fme = { class: "h-full flex flex-col overflow-hidden" }, Vme = {
  class: "flex-shrink-0 px-2 bg-primary/10 py-1",
  style: { "border-bottom": "1px solid #eee" }
}, Qme = { class: "flex-1 overflow-y-auto" }, Hme = /* @__PURE__ */ Oe({
  __name: "OptionsPane",
  setup(t) {
    const e = [
      "timeseries",
      "bar",
      "histogram",
      "stat",
      "gauge",
      "table",
      "pie"
    ], { t: n } = On(), { panel: i, onChange: o, numericFieldNames: r, allFieldNames: a } = fh(), l = A(
      () => e.map((h) => ({
        value: h,
        label: n(`config.type.${h}`)
      }))
    ), s = de(""), u = {
      general: DI,
      style: Zge,
      tooltip: Tme,
      axes: ipe,
      value: Bme,
      // timeseries / bar / histogram
      "bar-style": fpe,
      "histogram-style": ige,
      // stat
      "stat-style": Tge,
      // gauge
      "gauge-style": Mpe,
      // pie
      "pie-style": Oge,
      // table
      "table-style": dme,
      // overrides
      overrides: NI
    }, c = A(() => {
      const p = (pH(i.value.type)?.optionCategories ?? []).map((g) => ({
        key: g.key,
        label: n(g.labelKey),
        component: u[g.key] ?? DI
      }));
      return p.push({
        key: "thresholds",
        label: n("config.section.thresholds", { n: i.value.thresholds.length }),
        component: bme
      }), p.push({
        key: "overrides",
        label: n("config.section.overrides"),
        component: NI
      }), p;
    }), d = A(() => {
      if (!s.value.trim())
        return c.value;
      const h = s.value.toLowerCase();
      return c.value.filter(
        (p) => typeof p.label == "string" && p.label.toLowerCase().includes(h)
      );
    }), f = de(["general"]);
    return (h, p) => (re(), be("div", Fme, [
      F("div", Vme, [
        v(I(Dt), {
          class: "text-primary",
          bordered: !1,
          value: I(i).type,
          size: "small",
          variant: "filled",
          options: l.value,
          "onUpdate:value": p[0] || (p[0] = (g) => I(o)({ type: g }))
        }, null, 8, ["value", "options"])
      ]),
      F("div", Qme, [
        v(I(Tu), {
          "active-key": f.value,
          "onUpdate:activeKey": p[1] || (p[1] = (g) => f.value = g),
          bordered: !1,
          accordion: "",
          size: "small"
        }, {
          default: ye(() => [
            (re(!0), be(tt, null, Jt(d.value, (g) => (re(), ut(I(Tu).Panel, {
              key: g.key,
              header: g.label
            }, {
              default: ye(() => [
                (re(), ut(TA(g.component), {
                  panel: I(i),
                  "on-change": I(o),
                  "numeric-field-names": I(r),
                  "all-field-names": I(a)
                }, null, 40, ["panel", "on-change", "numeric-field-names", "all-field-names"]))
              ]),
              _: 2
            }, 1032, ["header"]))), 128))
          ]),
          _: 1
        }, 8, ["active-key"])
      ])
    ]));
  }
}), p4 = /* @__PURE__ */ Oe({
  __name: "PanelLinksIcon",
  props: {
    links: {},
    iconColor: {}
  },
  setup(t) {
    const e = t;
    function n(o) {
      o.url && window.open(o.url, o.newTab ? "_blank" : "_self", "noopener,noreferrer");
    }
    const i = A(() => e.links.filter((o) => o.url));
    return (o, r) => i.value.length === 0 ? (re(), be(tt, { key: 0 }, [], 64)) : i.value.length === 1 ? (re(), ut(I(zi), {
      key: 1,
      title: i.value[0].title || i.value[0].url,
      placement: "bottom"
    }, {
      default: ye(() => [
        F("span", {
          class: Tt([I(St).link, "flex-shrink-0 cursor-pointer text-xs"]),
          style: Yt({ color: t.iconColor }),
          onClick: r[0] || (r[0] = la((a) => n(i.value[0]), ["stop"]))
        }, null, 6)
      ]),
      _: 1
    }, 8, ["title"])) : (re(), ut(I(Nr), {
      key: 2,
      trigger: ["hover", "click"],
      placement: "bottomLeft"
    }, {
      overlay: ye(() => [
        v(I(Bi), null, {
          default: ye(() => [
            (re(!0), be(tt, null, Jt(i.value, (a, l) => (re(), ut(I(Bi).Item, {
              key: l,
              onClick: (s) => n(a)
            }, {
              default: ye(() => [
                Ve(se(a.title || a.url), 1)
              ]),
              _: 2
            }, 1032, ["onClick"]))), 128))
          ]),
          _: 1
        })
      ]),
      default: ye(() => [
        F("span", {
          class: Tt([I(St).link, "flex-shrink-0 cursor-pointer text-xs"]),
          style: Yt({ color: t.iconColor }),
          onClick: r[1] || (r[1] = la(() => {
          }, ["stop"]))
        }, null, 6)
      ]),
      _: 1
    }));
  }
}), Wme = {
  key: 0,
  class: "legend-search-container"
}, jme = ["value"], qme = { class: "legend-table-wrap" }, Yme = { class: "legend-table" }, Kme = ["data-legend-item-id"], Xme = { class: "legend-table-td legend-table-name-col" }, Zme = ["data-legend-tooltip"], Gme = { class: "legend-label" }, Ume = {
  key: 0,
  class: "legend-search-container"
}, Jme = ["value"], eve = {
  key: 1,
  class: "legend-empty-state"
}, tve = { class: "virtuoso-grid-list" }, nve = ["data-legend-item-id"], ive = ["data-legend-tooltip"], ove = { class: "legend-label" }, rve = {
  key: 0,
  class: "legend-item-values"
}, ave = { class: "legend-item-value-key" }, lve = { class: "legend-item-value-num" }, sve = ["data-legend-tooltip", "onClick"], uve = {
  key: 0,
  width: "12",
  height: "12",
  viewBox: "0 0 24 24",
  fill: "none",
  stroke: "currentColor",
  "stroke-width": "2"
}, cve = {
  key: 1,
  width: "12",
  height: "12",
  viewBox: "0 0 24 24",
  fill: "none",
  stroke: "currentColor",
  "stroke-width": "2"
}, dve = /* @__PURE__ */ Oe({
  __name: "ChartLegend",
  props: {
    items: {},
    uPlotInstance: {},
    position: { default: "bottom" },
    mode: { default: "list" },
    unit: {},
    decimals: {},
    averageLegendWidth: { default: 40 },
    values: { default: () => [] },
    data: {}
  },
  setup(t) {
    const e = t, n = de(null), i = de(""), o = de(null), r = de(!1), a = de(), l = de({});
    function s(_) {
      const D = {};
      _.series.forEach((M, N) => {
        N !== 0 && (D[N] = M.show ?? !0);
      }), l.value = { ...D };
    }
    function u(_, D, M) {
      !D || typeof M.show != "boolean" || (l.value = { ...l.value, [D]: M.show });
    }
    _e(
      () => e.uPlotInstance,
      (_, D) => {
        if (D && (D.hooks.setSeries = (D.hooks.setSeries ?? []).filter(
          (M) => M.__legendSync !== !0
        )), _) {
          s(_);
          const M = (N, L, j) => u(N, L, j);
          M.__legendSync = !0, _.hooks.setSeries = [..._.hooks.setSeries ?? [], M];
        } else
          l.value = {};
      },
      { immediate: !0 }
    );
    const c = {
      last: "Last *",
      first: "First *",
      min: "Min",
      max: "Max",
      mean: "Avg",
      sum: "Sum"
    };
    function d(_) {
      const D = _.filter(
        (N) => N != null && !Number.isNaN(N)
      );
      if (D.length === 0)
        return { last: null, first: null, min: null, max: null, mean: null, sum: null };
      const M = D.reduce((N, L) => N + L, 0);
      return {
        last: D[D.length - 1],
        first: D[0],
        min: Math.min(...D),
        max: Math.max(...D),
        mean: M / D.length,
        sum: M
      };
    }
    function f(_, D) {
      return _ === null ? "—" : Math.abs(_) >= 1e6 ? D !== void 0 ? `${(_ / 1e6).toFixed(D)}M` : `${_ / 1e6}M` : Math.abs(_) >= 1e3 ? D !== void 0 ? `${(_ / 1e3).toFixed(D)}K` : `${_ / 1e3}K` : D !== void 0 ? _.toFixed(D) : String(_);
    }
    const h = A(
      () => Object.values(e.items).map((_) => ({
        ..._,
        show: l.value[_.seriesIndex] ?? _.show ?? !0
      }))
    ), p = A(() => {
      if (e.position !== "right" || !i.value.trim())
        return h.value;
      const _ = i.value.trim().toLowerCase();
      return h.value.filter((D) => D.label?.toLowerCase().includes(_));
    }), g = A(() => e.position !== "right" || !i.value.trim() ? !1 : p.value.length === 0), m = A(() => {
      if (!e.data || e.values.length === 0)
        return {};
      const _ = {};
      return h.value.forEach((D) => {
        const M = e.data[D.seriesIndex];
        _[D.seriesIndex] = d(M ?? []);
      }), _;
    }), { onToggleSeriesOnOff: y, onToggleSeriesVisibility: b } = {
      onToggleSeriesOnOff(_) {
        const D = e.uPlotInstance;
        if (!D)
          return;
        const M = D.series[_];
        M && D.setSeries(_, { show: !M.show });
      },
      onToggleSeriesVisibility(_) {
        const D = e.uPlotInstance;
        if (!D)
          return;
        const M = n.value === _;
        D.series.forEach((N, L) => {
          L !== 0 && D.setSeries(L, { show: M || L === _ });
        }), n.value = M ? null : _;
      }
    };
    function w(_) {
      const D = _.target.closest("[data-legend-item-id]");
      if (!D)
        return null;
      const M = Number(D.dataset.legendItemId);
      return Number.isNaN(M) ? null : M;
    }
    function $(_) {
      const D = w(_);
      if (D === null)
        return;
      if (!!_.target.dataset.isLegendMarker) {
        y(D);
        return;
      }
      b(D);
    }
    async function C(_, D) {
      try {
        await navigator.clipboard.writeText(D), o.value = _, setTimeout(() => {
          o.value = null;
        }, 2e3);
      } catch {
      }
    }
    function P(_) {
      const D = _.target;
      i.value = D.value;
    }
    function O() {
      if (!a.value || e.position !== "bottom") {
        r.value = !1;
        return;
      }
      const D = a.value.clientWidth;
      if (D === 0)
        return;
      const M = h.value.length * (e.averageLegendWidth + 16);
      r.value = Math.ceil(M / D) <= 1;
    }
    let E = null;
    return Lt(() => {
      O(), a.value && e.position === "bottom" && (E = new ResizeObserver(O), E.observe(a.value));
    }), wo(() => {
      E && E.disconnect();
    }), _e([() => e.averageLegendWidth, () => h.value.length, () => e.position], () => {
      O();
    }), (_, D) => t.mode === "table" && t.values.length > 0 ? (re(), be("div", {
      key: 0,
      ref_key: "legendContainerRef",
      ref: a,
      class: "legend-container legend-table-mode",
      onClick: $
    }, [
      t.position === "right" ? (re(), be("div", Wme, [
        F("input", {
          type: "text",
          placeholder: "Search...",
          value: i.value,
          class: "legend-search-input",
          onInput: P
        }, null, 40, jme)
      ])) : et("", !0),
      F("div", qme, [
        F("table", Yme, [
          F("thead", null, [
            F("tr", null, [
              D[0] || (D[0] = F("th", { class: "legend-table-th legend-table-name-col" }, " Name ", -1)),
              (re(!0), be(tt, null, Jt(t.values, (M) => (re(), be("th", {
                key: M,
                class: "legend-table-th legend-table-val-col"
              }, se(c[M]), 1))), 128))
            ])
          ]),
          F("tbody", null, [
            (re(!0), be(tt, null, Jt(p.value, (M) => (re(), be("tr", {
              key: M.seriesIndex,
              "data-legend-item-id": M.seriesIndex,
              class: Tt(["legend-table-row", [
                M.show ? "" : "legend-item-off",
                n.value === M.seriesIndex ? "legend-item-focused" : ""
              ]])
            }, [
              F("td", Xme, [
                F("div", {
                  class: "legend-item-label-trigger",
                  "data-legend-tooltip": M.label
                }, [
                  F("div", {
                    class: "legend-marker",
                    style: Yt({ borderColor: M.color }),
                    "data-is-legend-marker": !0
                  }, null, 4),
                  F("span", Gme, se(M.label), 1)
                ], 8, Zme)
              ]),
              (re(!0), be(tt, null, Jt(t.values, (N) => (re(), be("td", {
                key: N,
                class: "legend-table-td legend-table-val-col"
              }, se(m.value[M.seriesIndex] ? f(m.value[M.seriesIndex][N], t.decimals) : "—"), 1))), 128))
            ], 10, Kme))), 128))
          ])
        ])
      ])
    ], 512)) : (re(), be("div", {
      key: 1,
      ref_key: "legendContainerRef",
      ref: a,
      class: Tt(["legend-container", [t.position === "bottom" ? "legend-container-bottom" : ""]]),
      style: Yt({ "--legend-average-width": `${t.averageLegendWidth + 16}px` }),
      onClick: $
    }, [
      t.position === "right" ? (re(), be("div", Ume, [
        F("input", {
          type: "text",
          placeholder: "Search...",
          value: i.value,
          class: "legend-search-input",
          onInput: P
        }, null, 40, Jme)
      ])) : et("", !0),
      g.value ? (re(), be("div", eve, ' No series found matching "' + se(i.value) + '" ', 1)) : (re(), be("div", {
        key: 2,
        class: Tt(["legend-virtuoso-container", [
          `legend-virtuoso-container-${t.position}`,
          r.value ? "legend-virtuoso-container-single-row" : ""
        ]])
      }, [
        F("div", tve, [
          (re(!0), be(tt, null, Jt(p.value, (M) => (re(), be("div", {
            key: M.seriesIndex,
            class: "virtuoso-grid-item"
          }, [
            F("div", {
              "data-legend-item-id": M.seriesIndex,
              class: Tt(["legend-item", [
                `legend-item-${t.position}`,
                M.show ? "" : "legend-item-off",
                n.value === M.seriesIndex ? "legend-item-focused" : ""
              ]])
            }, [
              F("div", {
                class: "legend-item-label-trigger",
                "data-legend-tooltip": M.label
              }, [
                F("div", {
                  class: "legend-marker",
                  style: Yt({ borderColor: M.color }),
                  "data-is-legend-marker": !0
                }, null, 4),
                F("span", ove, se(M.label), 1)
              ], 8, ive),
              m.value[M.seriesIndex] && t.values.length > 0 ? (re(), be("span", rve, [
                (re(!0), be(tt, null, Jt(t.values, (N) => (re(), be("span", {
                  key: N,
                  class: "legend-item-value-badge"
                }, [
                  F("span", ave, se(c[N]) + ":", 1),
                  F("span", lve, se(f(m.value[M.seriesIndex][N], t.decimals)), 1)
                ]))), 128))
              ])) : et("", !0),
              F("button", {
                type: "button",
                class: "legend-copy-button",
                "data-legend-tooltip": o.value === M.seriesIndex ? "Copied" : "Copy",
                onClick: la((N) => C(M.seriesIndex, M.label ?? ""), ["stop"])
              }, [
                o.value === M.seriesIndex ? (re(), be("svg", uve, [...D[1] || (D[1] = [
                  F("path", { d: "M20 6L9 17l-5-5" }, null, -1)
                ])])) : (re(), be("svg", cve, [...D[2] || (D[2] = [
                  F("rect", {
                    x: "9",
                    y: "9",
                    width: "13",
                    height: "13",
                    rx: "2",
                    ry: "2"
                  }, null, -1),
                  F("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" }, null, -1)
                ])]))
              ], 8, sve)
            ], 10, nve)
          ]))), 128))
        ])
      ], 2))
    ], 6));
  }
}), g4 = /* @__PURE__ */ Co(dve, [["__scopeId", "data-v-85a1707f"]]), fve = { class: "footer" }, hve = {
  key: 0,
  class: "hint"
}, pve = { class: "kbd active" }, gve = {
  key: 1,
  class: "hint-list"
}, mve = {
  class: "hint",
  "data-active": "false"
}, vve = { class: "kbd" }, yve = /* @__PURE__ */ Oe({
  __name: "TooltipFooter",
  props: {
    isPinned: { type: Boolean },
    pinKey: { default: "P" }
  },
  emits: ["dismiss"],
  setup(t, { emit: e }) {
    const n = e;
    return (i, o) => (re(), be("div", fve, [
      F("div", null, [
        t.isPinned ? (re(), be("div", hve, [
          o[1] || (o[1] = F("span", null, "按", -1)),
          F("kbd", pve, se(t.pinKey), 1),
          o[2] || (o[2] = F("span", null, "或", -1)),
          o[3] || (o[3] = F("kbd", { class: "kbd active" }, "Esc", -1)),
          o[4] || (o[4] = F("span", null, "取消固定", -1))
        ])) : (re(), be("div", gve, [
          F("div", mve, [
            o[5] || (o[5] = F("span", null, "按", -1)),
            F("kbd", vve, se(t.pinKey), 1),
            o[6] || (o[6] = F("span", null, "固定提示框", -1))
          ])
        ]))
      ]),
      t.isPinned ? (re(), be("button", {
        key: 0,
        class: "unpin-btn",
        onClick: o[0] || (o[0] = (r) => n("dismiss"))
      }, [...o[7] || (o[7] = [
        F("svg", {
          width: "10",
          height: "10",
          viewBox: "0 0 24 24",
          fill: "none",
          stroke: "currentColor",
          "stroke-width": "2"
        }, [
          F("path", { d: "M18 6L6 18" }),
          F("path", { d: "M6 6l12 12" })
        ], -1),
        F("span", null, "取消固定", -1)
      ])])) : et("", !0)
    ]));
  }
}), bve = /* @__PURE__ */ Co(yve, [["__scopeId", "data-v-75c52e2f"]]), xve = ["data-is-active"], Ove = { class: "tooltip-item-label" }, Sve = /* @__PURE__ */ Oe({
  __name: "TooltipItem",
  props: {
    item: {},
    isItemActive: { type: Boolean }
  },
  setup(t) {
    return (e, n) => (re(), be("div", {
      class: "tooltip-item",
      "data-is-active": t.isItemActive
    }, [
      F("div", {
        class: "tooltip-item-marker",
        style: Yt({ borderColor: t.item.color })
      }, null, 4),
      F("div", {
        class: "tooltip-item-content",
        style: Yt({ color: t.item.color })
      }, [
        F("span", Ove, se(t.item.label), 1),
        F("span", {
          class: "tooltip-item-separator",
          style: Yt({ borderColor: t.item.color })
        }, null, 4),
        F("span", null, se(t.item.tooltipValue), 1)
      ], 4)
    ], 8, xve));
  }
}), m4 = /* @__PURE__ */ Co(Sve, [["__scopeId", "data-v-3b1d92d5"]]), wve = { class: "header-container" }, Cve = {
  key: 0,
  class: "header-row"
}, $ve = {
  key: 0,
  class: "header-status"
}, kve = {
  key: 1,
  class: "header-pinned-item"
}, Tve = /* @__PURE__ */ Oe({
  __name: "TooltipHeader",
  props: {
    uPlotInstance: {},
    showTooltipHeader: { type: Boolean },
    isPinned: { type: Boolean },
    activeItem: {},
    headerTitle: {}
  },
  setup(t) {
    return (e, n) => (re(), be("div", wve, [
      t.showTooltipHeader && t.headerTitle ? (re(), be("div", Cve, [
        F("span", null, se(t.headerTitle), 1),
        t.isPinned ? (re(), be("div", $ve, [...n[0] || (n[0] = [
          F("svg", {
            width: "12",
            height: "12",
            viewBox: "0 0 24 24",
            fill: "none",
            stroke: "currentColor",
            "stroke-width": "2"
          }, [
            F("path", { d: "M12 2v4" }),
            F("path", { d: "M19 10h-7l-5 5v7h10v-7l-5-5z" })
          ], -1),
          F("span", null, "已固定", -1)
        ])])) : et("", !0)
      ])) : et("", !0),
      t.activeItem ? (re(), be("div", kve, [
        v(m4, {
          item: t.activeItem,
          "is-item-active": !0
        }, null, 8, ["item"])
      ])) : et("", !0)
    ]));
  }
}), Pve = /* @__PURE__ */ Co(Tve, [["__scopeId", "data-v-efb4cf97"]]), Eve = /* @__PURE__ */ Oe({
  __name: "TooltipList",
  props: {
    content: {},
    maxHeight: { default: 300 }
  },
  setup(t) {
    return (e, n) => (re(), be("div", {
      class: "tooltip-list",
      style: Yt({ maxHeight: `${t.maxHeight}px`, overflowY: "auto" })
    }, [
      (re(!0), be(tt, null, Jt(t.content, (i) => (re(), ut(m4, {
        key: i.label,
        item: i,
        "is-item-active": !1
      }, null, 8, ["item"]))), 128))
    ], 4));
  }
}), _ve = /* @__PURE__ */ Co(Eve, [["__scopeId", "data-v-fa17493a"]]), Ive = {
  key: 1,
  class: "tooltip-divider"
}, Mve = /* @__PURE__ */ Oe({
  __name: "Tooltip",
  props: {
    uPlotInstance: {},
    content: {},
    headerTitle: {},
    isPinned: { type: Boolean },
    canPinTooltip: { type: Boolean, default: !0 },
    showTooltipHeader: { type: Boolean, default: !0 },
    tooltipMaxHeight: { default: 300 }
  },
  emits: ["dismiss"],
  setup(t, { emit: e }) {
    const n = t, i = e, o = A(() => n.content.find((s) => s.isActive) ?? null), r = A(() => n.showTooltipHeader || o.value != null), a = A(() => n.content.length > 1), l = A(() => a.value && r.value);
    return (s, u) => (re(), be("div", {
      class: Tt(["tooltip-container", { pinned: t.isPinned }])
    }, [
      r.value ? (re(), ut(Pve, {
        key: 0,
        "u-plot-instance": t.uPlotInstance,
        "show-tooltip-header": t.showTooltipHeader,
        "is-pinned": t.isPinned,
        "active-item": o.value,
        "header-title": t.headerTitle
      }, null, 8, ["u-plot-instance", "show-tooltip-header", "is-pinned", "active-item", "header-title"])) : et("", !0),
      l.value ? (re(), be("span", Ive)) : et("", !0),
      a.value ? (re(), ut(_ve, {
        key: 2,
        content: t.content,
        "max-height": t.tooltipMaxHeight
      }, null, 8, ["content", "max-height"])) : et("", !0),
      t.canPinTooltip ? (re(), ut(bve, {
        key: 3,
        "is-pinned": t.isPinned,
        style: Yt({ pointerEvents: t.isPinned ? "auto" : "none" }),
        onDismiss: u[0] || (u[0] = (c) => i("dismiss"))
      }, null, 8, ["is-pinned", "style"])) : et("", !0)
    ], 2));
  }
}), Ave = /* @__PURE__ */ Co(Mve, [["__scopeId", "data-v-4b92f289"]]), Dd = 14, v4 = /* @__PURE__ */ Oe({
  __name: "ChartTooltip",
  props: {
    uPlotInstance: {},
    unit: { default: "" },
    decimals: {},
    canPinTooltip: { type: Boolean, default: !0 },
    tooltipMode: { default: "multi" },
    tooltipSort: { default: "none" },
    showTooltipHeader: { type: Boolean, default: !0 },
    tooltipMaxHeight: { default: 300 }
  },
  setup(t) {
    const e = t, n = de(), i = de(!1), o = de(!1), r = de(""), a = de([]), l = de(1), s = {
      hoverActive: !1,
      pinned: !1,
      focusedSeriesIndex: null,
      seriesIndexes: [],
      mouseWithinPlot: !1,
      windowWidth: window.innerWidth - 16,
      windowHeight: window.innerHeight - 16,
      tooltipW: 0,
      tooltipH: 0,
      // offset state with memory — mirrors React's horizontalOffset/verticalOffset
      horizontalOffset: 0,
      verticalOffset: 0,
      cursorDrivenBySync: !1
    };
    let u = null;
    function c() {
      u === null && (u = requestAnimationFrame(() => {
        u = null, w();
      }));
    }
    function d(Y, Q, G) {
      return typeof Y == "function" ? String(Y(Q, G)) : typeof Y == "string" ? Y : "#cccccc";
    }
    function f(Y, Q, G) {
      const V = G !== void 0 ? Y.toFixed(G) : String(Math.round(Y * 1e3) / 1e3);
      return Q ? `${V} ${Q}` : V;
    }
    function h(Y) {
      if (e.tooltipMode === "none")
        return [];
      const Q = Y.cursor.idx, G = [];
      for (let V = 1; V < Y.series.length; V++) {
        const H = Y.series[V];
        if (!H?.show)
          continue;
        let q = s.seriesIndexes[V] ?? null;
        if (e.tooltipMode === "single") {
          if (V !== s.focusedSeriesIndex)
            continue;
          q = Q ?? q;
        } else
          q = q ?? Q ?? null;
        if (q === null)
          continue;
        const K = Y.data[V]?.[q];
        K == null || !Number.isFinite(K) || G.push({
          label: String(H.label ?? `Series ${V}`),
          value: K,
          tooltipValue: f(K, e.unit, e.decimals),
          color: d(H.stroke, Y, V),
          isActive: V === s.focusedSeriesIndex
        });
      }
      return e.tooltipSort === "asc" && G.sort((V, H) => V.value - H.value), e.tooltipSort === "desc" && G.sort((V, H) => H.value - V.value), G;
    }
    function p(Y) {
      if (!e.showTooltipHeader)
        return "";
      const Q = Y.cursor.idx;
      if (Q == null)
        return "";
      const G = Y.data[0]?.[Q];
      return G == null ? "" : Y.scales.x?.time ? new Date(G * 1e3).toLocaleString() : String(G);
    }
    function g(Y, Q, G) {
      const V = G + Dd;
      return Y !== 0 ? Q + V < s.windowWidth || Q - V < 0 ? 0 : Y !== -V ? -V : Y : Q + V > s.windowWidth && Q - V >= 0 ? -V : 0;
    }
    function m(Y, Q, G) {
      const V = G + Dd;
      return Y !== 0 ? Q + V < s.windowHeight || Q - V < 0 ? 0 : Y !== -V ? -V : Y : Q + V > s.windowHeight && Q - V >= 0 ? -V : 0;
    }
    function y(Y, Q, G, V) {
      const H = Y + (G === 0 ? Dd : -Dd), q = Q + (V === 0 ? Dd : -Dd);
      return `translateX(${H}px) ${G === 0 ? "" : "translateX(-100%)"} translateY(${q}px) ${V === 0 ? "" : "translateY(-100%)"}`;
    }
    function b(Y) {
      if (s.cursorDrivenBySync = Y.cursor.event == null, s.pinned || !s.hoverActive)
        return;
      const Q = n.value, { left: G = -1, top: V = -1 } = Y.cursor;
      if (G < 0 || V < 0)
        return;
      const H = Y.rect.left + G, q = Y.rect.top + V, K = Q ? Q.offsetWidth : s.tooltipW, ee = Q ? Q.offsetHeight : s.tooltipH;
      s.tooltipW = K, s.tooltipH = ee, s.horizontalOffset = g(s.horizontalOffset, H, K), s.verticalOffset = m(s.verticalOffset, q, ee);
      const ie = y(H, q, s.horizontalOffset, s.verticalOffset);
      Q && (Q.style.transform = ie);
    }
    function w() {
      const Y = e.uPlotInstance;
      if (!Y || !s.hoverActive && !s.pinned) {
        i.value = !1;
        return;
      }
      const Q = h(Y);
      if (Q.length === 0) {
        s.pinned || (i.value = !1);
        return;
      }
      if (a.value = Q, r.value = p(Y), o.value = s.pinned, l.value = o4({ exclude: n.value }) + 1, !s.pinned) {
        const G = n.value, { left: V = -1, top: H = -1 } = Y.cursor;
        if (G && V >= 0 && H >= 0) {
          const q = Y.rect.left + V, K = Y.rect.top + H;
          G.style.transform = y(q, K, s.horizontalOffset, s.verticalOffset);
        }
      }
      i.value = !0;
    }
    function $(Y) {
      if (s.pinned)
        return;
      const Q = Y.cursor.idxs;
      if (!Q)
        return;
      const G = s.cursorDrivenBySync;
      s.cursorDrivenBySync = Y.cursor.event == null, s.seriesIndexes = [...Q];
      const V = s.seriesIndexes.some((K, ee) => ee > 0 && K != null), H = s.hoverActive;
      s.hoverActive = s.cursorDrivenBySync ? V : s.focusedSeriesIndex != null, (s.hoverActive !== H || s.cursorDrivenBySync !== G) && c();
    }
    function C(Y, Q, G) {
      !("focus" in G) || s.pinned || (s.focusedSeriesIndex = Q ?? null, s.cursorDrivenBySync = Y.cursor.event == null, s.hoverActive = s.focusedSeriesIndex != null, c());
    }
    function P() {
      const Y = e.uPlotInstance;
      !Y || !s.hoverActive || (s.pinned = !0, Y.cursor._lock = !0, o.value = !0, document.addEventListener("mousedown", E, !0));
    }
    function O() {
      const Y = e.uPlotInstance;
      s.pinned = !1, s.hoverActive = !1, Y && (Y.cursor._lock = !1), o.value = !1, i.value = !1, document.removeEventListener("mousedown", E, !0);
    }
    function E(Y) {
      n.value && !n.value.contains(Y.target) && O();
    }
    function _(Y) {
      if (Y.key === "Escape") {
        s.pinned && O();
        return;
      }
      Y.key.toLowerCase() === "p" && s.mouseWithinPlot && (s.pinned ? O() : P());
    }
    function D() {
      s.mouseWithinPlot = !0;
    }
    function M() {
      s.mouseWithinPlot = !1;
    }
    function N() {
      s.windowWidth = window.innerWidth - 16, s.windowHeight = window.innerHeight - 16, s.pinned || (s.hoverActive = !1);
    }
    let L = [];
    function j(Y) {
      const Q = (H) => $(H), G = (H, q, K) => C(H, q, K), V = (H) => b(H);
      Y.hooks.setLegend = [...Y.hooks.setLegend ?? [], Q], Y.hooks.setSeries = [...Y.hooks.setSeries ?? [], G], Y.hooks.setCursor = [...Y.hooks.setCursor ?? [], V], Y.root.addEventListener("mouseenter", D), Y.root.addEventListener("mouseleave", M), L = [
        () => {
          Y.hooks.setLegend = (Y.hooks.setLegend ?? []).filter(
            (H) => H !== Q
          ), Y.hooks.setSeries = (Y.hooks.setSeries ?? []).filter(
            (H) => H !== G
          ), Y.hooks.setCursor = (Y.hooks.setCursor ?? []).filter(
            (H) => H !== V
          ), Y.root.removeEventListener("mouseenter", D), Y.root.removeEventListener("mouseleave", M);
        }
      ];
    }
    function B() {
      L.forEach((Y) => Y()), L = [], document.removeEventListener("mousedown", E, !0), s.hoverActive = !1, s.pinned = !1, s.focusedSeriesIndex = null, s.horizontalOffset = 0, s.verticalOffset = 0, s.cursorDrivenBySync = !1, i.value = !1, o.value = !1, u !== null && (cancelAnimationFrame(u), u = null);
    }
    return _e(
      () => e.uPlotInstance,
      (Y, Q) => {
        Q && B(), Y && j(Y);
      },
      { immediate: !0 }
    ), Lt(() => {
      document.addEventListener("keydown", _, !0), window.addEventListener("resize", N);
    }), wo(() => {
      B(), document.removeEventListener("keydown", _, !0), window.removeEventListener("resize", N);
    }), (Y, Q) => (re(), ut(D0, { to: "body" }, [
      fa(F("div", {
        ref_key: "containerRef",
        ref: n,
        style: Yt([{ position: "fixed", top: "0", left: "0", "pointer-events": "none" }, { zIndex: l.value }])
      }, [
        t.uPlotInstance ? (re(), ut(Ave, {
          key: 0,
          "u-plot-instance": t.uPlotInstance,
          content: a.value,
          "header-title": r.value,
          "is-pinned": o.value,
          "can-pin-tooltip": t.canPinTooltip,
          "show-tooltip-header": t.showTooltipHeader,
          "tooltip-max-height": t.tooltipMaxHeight,
          onDismiss: O
        }, null, 8, ["u-plot-instance", "content", "header-title", "is-pinned", "can-pin-tooltip", "show-tooltip-header", "tooltip-max-height"])) : et("", !0)
      ], 4), [
        [Qa, i.value && t.tooltipMode !== "none"]
      ])
    ]));
  }
}), y4 = Symbol("plotContext");
function Rve() {
  const t = de(null), e = de(""), n = de(!1);
  let i;
  function o(c) {
    t.value = c.uPlotInstance, c.id !== void 0 && (e.value = c.id), c.shouldSaveSelectionPreference !== void 0 && (n.value = c.shouldSaveSelectionPreference), i = void 0;
  }
  function r() {
    const c = t.value;
    if (!c || !e.value)
      return;
    const d = c.series.map((f) => ({
      label: f.label ?? "",
      show: f.show ?? !0
    }));
    AH(e.value, d);
  }
  function a(c) {
    const d = t.value;
    if (!d)
      return;
    const f = i === c;
    i = f ? void 0 : c, d.batch(() => {
      d.series.forEach((h, p) => {
        p !== 0 && d.setSeries(p, {
          show: f || p === c
        });
      }), e.value && n.value && r();
    });
  }
  function l(c) {
    const d = t.value;
    if (!d)
      return;
    const f = d.series[c];
    f && (d.setSeries(c, { show: !f.show }), e.value && n.value && r());
  }
  function s(c) {
    const d = t.value;
    d && d.batch(() => {
      d.series.forEach((f, h) => {
        h !== 0 && d.setSeries(h, {
          show: c === null || h === c
        });
      });
    });
  }
  const u = {
    uPlotInstance: t,
    id: e,
    shouldSaveSelectionPreference: n,
    setPlotContextInitialState: o,
    onToggleSeriesVisibility: a,
    onToggleSeriesOnOff: l,
    onFocusSeries: s,
    syncSeriesVisibilityToLocalStorage: r
  };
  return Xt(y4, u), u;
}
function yTe() {
  const t = qt(y4);
  if (!t)
    throw new Error("usePlotContext must be used within a PlotContextProvider");
  return t;
}
const Dve = { style: { position: "relative", overflow: "hidden" } }, b4 = /* @__PURE__ */ Oe({
  __name: "UPlotChart",
  props: {
    config: {},
    data: {},
    width: {},
    height: {},
    plotRef: {},
    onDestroy: {}
  },
  emits: ["plotReady"],
  setup(t, { expose: e, emit: n }) {
    const i = t, o = n, { setPlotContextInitialState: r } = Rve(), a = de(), l = de(null), s = de(""), u = de(""), c = de(0), d = de(0);
    function f() {
      l.value && (i.onDestroy && i.onDestroy(l.value), l.value.destroy(), l.value = null, r({ uPlotInstance: null }), i.plotRef && i.plotRef(null));
    }
    function h(C) {
      if (C === null || typeof C != "object")
        return C;
      const P = rr(C);
      if (P instanceof Date)
        return new Date(P.getTime());
      if (P instanceof RegExp)
        return new RegExp(P.source, P.flags);
      if (typeof P == "function")
        return P;
      if (Array.isArray(P)) {
        const E = [];
        for (let _ = 0; _ < P.length; _++)
          E.push(h(rr(P[_])));
        return E;
      }
      const O = {};
      for (const E in P)
        Object.prototype.hasOwnProperty.call(P, E) && (O[E] = h(rr(P[E])));
      return O;
    }
    function p() {
      if (f(), !a.value || i.width === 0 || i.height === 0)
        return;
      const C = i.config.getConfig(), O = h({
        ...C,
        width: Math.floor(i.width),
        height: Math.floor(i.height),
        series: C.series ?? []
      }), E = m(i.data, i.config), _ = new Ji(O, E, a.value);
      i.plotRef && i.plotRef(_), r({
        uPlotInstance: _,
        id: i.config.getId(),
        shouldSaveSelectionPreference: i.config.getShouldSaveSelectionPreference()
      }), l.value = _, o("plotReady", _), s.value = JSON.stringify(i.config.getConfig()), u.value = JSON.stringify(i.data), c.value = i.width, d.value = i.height;
    }
    function g(C) {
      return JSON.parse(JSON.stringify(C));
    }
    function m(C, P) {
      const O = g(C), E = P.getSeriesSpanGapsOptions();
      return E.length > 0 ? UW(O, E) : O;
    }
    function y() {
      return i.width === c.value && i.height === d.value;
    }
    function b() {
      return JSON.stringify(i.data) === u.value;
    }
    function w() {
      return JSON.stringify(i.config.getConfig()) === s.value;
    }
    const $ = A(() => !!(i.data && i.data[0] && i.data[0].length === 0));
    return _e($, (C) => {
      C && f();
    }), zt((C) => {
      if (C(() => {
        f(), s.value = "", u.value = "", c.value = 0, d.value = 0;
      }), !a.value || i.width === 0 || i.height === 0)
        return;
      if (!s.value) {
        p();
        return;
      }
      const P = !!l.value && (!a.value || l.value.root.parentElement !== a.value);
      if (!y() && l.value && !P && l.value.setSize({
        width: Math.floor(i.width),
        height: Math.floor(i.height)
      }), !w() || P)
        p();
      else if (!b() && l.value) {
        const O = m(i.data, i.config);
        l.value.setData(O);
      }
    }), tn(() => {
      f();
    }), e({ plotInstance: l }), (C, P) => (re(), be("div", Dve, [
      $.value ? (re(), be("div", {
        key: 0,
        class: "flex flex-col items-center justify-center not-found",
        style: Yt({
          width: `${t.width}px`,
          height: `${t.height}px`
        })
      }, [
        F("div", {
          class: Tt([I(St).chartLine, "mb-2"]),
          style: { "font-size": "48px" }
        }, null, 2),
        P[0] || (P[0] = F("div", { class: "text-gray-400 text-sm" }, " No Data ", -1))
      ], 4)) : (re(), be("div", {
        key: 1,
        ref_key: "containerRef",
        ref: a,
        class: "w-full h-full"
      }, null, 512)),
      _o(C.$slots, "default")
    ]));
  }
}), Nve = {
  key: 0,
  class: "flex items-center justify-center h-full text-gray-400 select-none"
}, x4 = /* @__PURE__ */ Oe({
  __name: "AgChart",
  props: {
    data: {},
    unit: {},
    decimals: {},
    colorScheme: {},
    colorSingleValue: {},
    colorDistribution: {},
    thresholds: {},
    thresholdBaseColor: {},
    fillOpacity: { default: 10 },
    lineWidth: { default: 1.5 },
    lineInterpolation: { default: "linear" },
    lineStyle: { default: "solid" },
    drawStyle: { default: "lines" },
    gradientMode: { default: "none" },
    spanNulls: { type: [Boolean, Number], default: !1 },
    showPoints: { type: Boolean, default: !1 },
    showPointsMode: { default: "auto" },
    stackingMode: { default: "none" },
    legendPosition: { default: "bottom" },
    legendMode: { default: "list" },
    legendValues: { default: () => [] },
    syncKey: {},
    panelId: {},
    tooltipMode: { default: "multi" },
    tooltipSort: { default: "none" },
    tooltipMaxHeight: {},
    showAxisPointer: { type: Boolean, default: !0 },
    softMin: {},
    softMax: {},
    axisPlacement: { default: "left" },
    axisName: {},
    axisWidth: {},
    showGridLines: { default: "all" },
    gridColor: {},
    axisLabel: { default: "all" },
    axisLabelColor: {},
    axisTick: { default: "hidden" },
    axisTickColor: {},
    axisBorder: { default: "hidden" },
    axisBorderColor: {},
    scaleDistribution: { default: "linear" },
    centeredZero: { type: Boolean, default: !1 },
    xAxisTime: { type: Boolean, default: !0 },
    barGroupWidth: {},
    barWidth: {}
  },
  setup(t) {
    const e = t, n = de(), i = de({ width: 0, height: 0 });
    let o = null;
    function r(m) {
      o = new ResizeObserver((y) => {
        const b = y[0];
        if (b) {
          const { width: w, height: $ } = b.contentRect;
          setTimeout(() => {
            i.value = { width: Math.floor(w), height: Math.floor($) };
          }, 300);
        }
      }), o.observe(m), requestAnimationFrame(() => {
        const { width: y, height: b } = m.getBoundingClientRect();
        i.value = { width: Math.floor(y), height: Math.floor(b) };
      });
    }
    Lt(() => {
      n.value && r(n.value);
    }), _e(n, (m) => {
      o?.disconnect(), m && r(m);
    }), tn(() => {
      o?.disconnect();
    });
    const a = A(() => {
      const m = new SD({ id: e.panelId ?? "chart" }), y = e.scaleDistribution ?? "linear", b = e.stackingMode !== "none";
      m.addScale({ scaleKey: "x", time: e.xAxisTime }), m.addScale({
        scaleKey: "y",
        distribution: y === "logarithmic" ? Mc.Logarithmic : y === "symlog" ? Mc.Symlog : Mc.Linear,
        softMin: b && e.stackingMode === "percent" ? 0 : e.softMin ?? void 0,
        softMax: b && e.stackingMode === "percent" ? 100 : e.softMax ?? void 0,
        ...e.centeredZero ? {
          range: (ue, fe, he) => {
            const le = Math.max(Math.abs(fe), Math.abs(he));
            return [-le, le];
          }
        } : {}
      });
      const w = e.gridColor ?? "#E8E9EA", $ = e.showGridLines === "all" || e.showGridLines === "x", C = e.showGridLines === "all" || e.showGridLines === "y", P = e.axisLabel === "all" || e.axisLabel === "x", O = e.axisLabel === "all" || e.axisLabel === "y", E = P ? e.axisLabelColor ?? "#666666" : "transparent", _ = O ? e.axisLabelColor ?? "#666666" : "transparent", D = e.axisTick === "all" || e.axisTick === "x", M = e.axisTick === "all" || e.axisTick === "y", N = D ? e.axisTickColor ?? "#666666" : "transparent", L = M ? e.axisTickColor ?? "#666666" : "transparent", j = e.axisBorder === "all" || e.axisBorder === "x", B = e.axisBorder === "all" || e.axisBorder === "y", Y = e.axisBorderColor ?? "#666666";
      m.addAxis({
        scaleKey: "x",
        side: 2,
        size: 28,
        stroke: E,
        grid: { show: $, stroke: w },
        ticks: { show: D, stroke: N, width: 0.5 },
        border: { show: j, stroke: Y }
      });
      const Q = e.axisPlacement === "right" ? 1 : 3, G = e.axisPlacement !== "hidden", V = (() => {
        if (e.axisWidth !== void 0 && e.axisWidth !== null)
          return e.axisWidth;
        const ue = e.data.series.reduce((ze, Re) => ze.concat(Re.values.filter((Ye) => Ye !== null && Number.isFinite(Ye))), []);
        if (ue.length === 0)
          return 56;
        const fe = ue.reduce((ze, Re) => Math.max(ze, Math.abs(Re)), 0), he = e.decimals === void 0 || e.decimals === null ? void 0 : e.decimals <= 15 ? e.decimals : 15, ke = ((ze) => {
          if (Math.abs(ze) >= 1e6) {
            const Ye = he !== void 0 ? (ze / 1e6).toFixed(he) : String(ze / 1e6);
            return e.unit ? `${Ye}M ${e.unit}` : `${Ye}M`;
          }
          if (Math.abs(ze) >= 1e3) {
            const Ye = he !== void 0 ? (ze / 1e3).toFixed(he) : String(ze / 1e3);
            return e.unit ? `${Ye}K ${e.unit}` : `${Ye}K`;
          }
          const Re = he !== void 0 ? ze.toFixed(he) : String(Math.round(ze * 100) / 100);
          return e.unit ? `${Re} ${e.unit}` : Re;
        })(fe);
        try {
          const ze = document.createElement("canvas").getContext("2d");
          if (!ze)
            return 56;
          ze.font = "12px system-ui, sans-serif";
          const Re = ze.measureText(ke).width;
          return Math.ceil(Re) + 14;
        } catch {
          return 56;
        }
      })(), H = e.decimals === void 0 || e.decimals === null ? void 0 : e.decimals <= 15 ? e.decimals : 15;
      m.addAxis({
        scaleKey: "y",
        side: Q,
        show: G,
        label: e.axisName || void 0,
        size: V,
        stroke: _,
        grid: { show: C, stroke: w },
        ticks: { show: M, stroke: L, width: 0.5 },
        border: { show: B, stroke: Y },
        isDarkMode: !0,
        yAxisUnit: e.unit,
        decimalPrecision: H,
        isLogScale: y === "logarithmic" || y === "symlog"
      });
      const q = MR(
        e.colorScheme,
        e.data.series.length,
        e.colorDistribution ?? "sequential",
        e.colorSingleValue
      ), K = e.drawStyle === "bars", ee = e.drawStyle === "points", ie = e.data.series.length, ae = e.barGroupWidth ?? 0.7, te = e.barWidth ?? (e.stackingMode !== "none" ? 1 : 1 / Math.max(ie, 1)), U = K ? ae * te : void 0, me = ee || e.showPointsMode === "always" ? !0 : e.showPointsMode === "never" ? !1 : e.showPoints, ce = b ? "none" : e.fillOpacity > 0 ? e.gradientMode !== "none" ? "gradient" : "solid" : "none";
      if (e.data.series.forEach((ue, fe) => {
        const he = q[fe] ?? ku[fe % ku.length];
        m.addSeries({
          scaleKey: "y",
          label: ue.label,
          drawStyle: K ? "bars" : ee ? "points" : "lines",
          lineColor: he,
          lineWidth: e.lineWidth,
          lineInterpolation: e.lineInterpolation,
          lineStyle: e.lineStyle,
          fillColor: he,
          fillOpacity: e.fillOpacity,
          fillMode: ce,
          showPoints: me,
          pointSize: me ? 4 : 0,
          spanGaps: e.spanNulls ?? !1,
          ...U !== void 0 ? { barWidthFactor: U } : {}
        });
      }), b && e.data.series.length > 0 && e.fillOpacity > 0) {
        const ue = q.length > 0 ? q : [...ku], fe = Math.round(Math.min(e.fillOpacity, 100) / 100 * 255).toString(16).padStart?.(2, "0") || Math.round(Math.min(e.fillOpacity, 100) / 100 * 255).toString(16), he = e.data.series.map((le, ke) => ({
          series: [ke + 1, ke],
          fill: `${ue[ke % ue.length]}${fe}`
        }));
        he.length > 0 && (he[0] = { series: [1, 0], fill: `${ue[0]}${fe}` }), m.setBands(he);
      }
      return e.syncKey && m.setCursor({ sync: { key: e.syncKey, setSeries: !0 } }), e.showAxisPointer || m.setCursor({ x: !1, y: !1 }), m.setCursor({
        drag: { setScale: !0 },
        points: {
          one: !0,
          size: (ue, fe) => (ue.series[fe]?.points?.size ?? 0) * 3,
          width: (ue, fe, he) => he / 4,
          stroke: (ue, fe) => {
            const he = ue.series[fe]?.points, le = typeof he?.stroke == "function" ? he.stroke : void 0;
            return `${le !== void 0 ? le(ue, fe) : typeof he?.stroke == "string" ? he.stroke : ""}90`;
          },
          fill: "#fff"
        },
        focus: {
          prox: 30
        },
        hover: {
          prox: 30,
          bias: 0
        }
      }), m;
    }), l = A(() => {
      const m = e.data?.timestamps ?? [], y = JSON.parse(JSON.stringify(m));
      if (y.length === 0 || !e.data)
        return [[]];
      const b = e.data.series.map((w) => JSON.parse(JSON.stringify(w.values.map(($) => $ ?? 0))));
      if (e.stackingMode !== "none" && e.data.series.length > 0) {
        const w = y.length, $ = Array.from({ length: w }, () => 0), C = [];
        for (const P of e.data.series) {
          const O = Array.from({ length: w });
          for (let E = 0; E < w; E++) {
            if (e.stackingMode === "percent") {
              let _ = 0;
              for (const D of e.data.series)
                _ += D.values[E] ?? 0;
              $[E] = $[E] + (P.values[E] ?? 0) / (_ || 1) * 100;
            } else
              $[E] = $[E] + (P.values[E] ?? 0);
            O[E] = $[E];
          }
          C.push(O);
        }
        return [y, ...C];
      }
      return [y, ...b];
    }), s = A(() => !e.data || e.data.timestamps.length === 0 || e.data.series.length === 0), u = de(null);
    function c(m) {
      u.value = m;
    }
    const d = A(() => e.decimals === void 0 || e.decimals === null ? void 0 : e.decimals <= 15 ? e.decimals : 15), f = A(() => e.legendPosition === "right"), h = A(() => e.legendPosition !== "hidden" && e.data.series.length > 0), p = A(() => f.value && h.value ? Math.max(i.value.width - 160, 100) : i.value.width), g = A(() => Math.max(i.value.height, 50));
    return (m, y) => (re(), be("div", {
      class: Tt(["w-full h-full flex overflow-hidden relative", f.value ? "flex-row" : "flex-col"])
    }, [
      s.value ? (re(), be("div", Nve, [...y[0] || (y[0] = [
        F("span", { class: "text-xs" }, "No data", -1)
      ])])) : et("", !0),
      F("div", {
        ref_key: "chartAreaRef",
        ref: n,
        class: "flex-1 min-h-0 min-w-0 relative overflow-hidden"
      }, [
        v(b4, {
          config: a.value,
          data: l.value,
          width: p.value,
          height: g.value,
          onPlotReady: c
        }, {
          default: ye(() => [
            v(v4, {
              "u-plot-instance": u.value,
              unit: e.unit,
              decimals: d.value,
              "can-pin-tooltip": !0,
              "tooltip-mode": e.tooltipMode,
              "tooltip-sort": e.tooltipSort,
              "tooltip-max-height": e.tooltipMaxHeight
            }, null, 8, ["u-plot-instance", "unit", "decimals", "tooltip-mode", "tooltip-sort", "tooltip-max-height"])
          ]),
          _: 1
        }, 8, ["config", "data", "width", "height"])
      ], 512),
      h.value ? (re(), be("div", {
        key: 1,
        style: Yt(
          f.value ? { width: "160px", flexShrink: 0, height: "100%", padding: "4px 8px", overflow: "auto", zIndex: 10, position: "relative", pointerEvents: "auto" } : { flexShrink: 0, padding: "2px 4px", overflow: "auto", maxHeight: "140px", zIndex: 10, position: "relative", pointerEvents: "auto" }
        )
      }, [
        v(g4, {
          items: a.value.getLegendItems(),
          "u-plot-instance": u.value,
          position: f.value ? "right" : "bottom",
          mode: e.legendMode ?? "list",
          values: e.legendValues ?? [],
          data: l.value,
          decimals: d.value,
          unit: e.unit
        }, null, 8, ["items", "u-plot-instance", "position", "mode", "values", "data", "decimals", "unit"])
      ], 4)) : et("", !0)
    ], 2));
  }
}), Lve = /* @__PURE__ */ Oe({
  __name: "BarPanel",
  props: {
    data: {},
    stacked: { type: Boolean, default: !1 },
    colorScheme: {},
    colorSingleValue: {},
    colorDistribution: {},
    barWidth: {},
    barGroupWidth: { default: 0.7 },
    showValues: { default: "auto" },
    unit: {},
    decimals: { default: 0 },
    legendPosition: { default: "bottom" },
    legendMode: { default: "list" },
    legendValues: { default: () => [] },
    tooltipMode: { default: "multi" },
    tooltipSort: { default: "none" }
  },
  setup(t) {
    return (e, n) => (re(), ut(x4, {
      data: t.data,
      "draw-style": "bars",
      "stacking-mode": t.stacked ? "normal" : "none",
      "color-scheme": t.colorScheme,
      "color-single-value": t.colorSingleValue,
      "color-distribution": t.colorDistribution,
      unit: t.unit,
      decimals: t.decimals,
      "fill-opacity": 80,
      "bar-group-width": t.barGroupWidth,
      "bar-width": t.barWidth,
      "legend-position": t.legendPosition,
      "legend-mode": t.legendMode,
      "legend-values": t.legendValues,
      "tooltip-mode": t.tooltipMode,
      "tooltip-sort": t.tooltipSort
    }, null, 8, ["data", "stacking-mode", "color-scheme", "color-single-value", "color-distribution", "unit", "decimals", "bar-group-width", "bar-width", "legend-position", "legend-mode", "legend-values", "tooltip-mode", "tooltip-sort"]));
  }
}), zve = {
  key: 0,
  style: { "text-align": "center", "font-size": "11px", color: "#888", padding: "2px 4px 4px", overflow: "hidden", "text-overflow": "ellipsis", "white-space": "nowrap" }
}, Q1 = 2, Bve = /* @__PURE__ */ Oe({
  __name: "GaugePanel",
  props: {
    series: {},
    value: { default: 0 },
    title: {},
    min: { default: pi.min },
    max: { default: pi.max },
    unit: {},
    thresholds: {},
    thresholdBaseColor: {},
    capRound: { type: Boolean, default: pi.capRound },
    trackWidth: { default: pi.trackWidth },
    fillWidth: { default: pi.fillWidth },
    trackColor: { default: pi.trackColor },
    sweepAngle: { default: pi.sweepAngle },
    valueColor: { default: pi.valueColor },
    valueSize: { default: pi.valueSize },
    valueVisible: { type: Boolean, default: pi.valueVisible },
    paddingX: { default: pi.paddingX },
    paddingY: { default: pi.paddingY },
    activeColorOverride: {},
    thresholdDisplay: { default: pi.thresholdDisplay },
    thresholdLabelDisplay: { default: pi.thresholdLabelDisplay },
    valueOffsetY: { default: pi.valueOffsetY },
    orientation: { default: pi.orientation }
  },
  setup(t) {
    const e = t, n = de(), i = de({ w: 0, h: 0 });
    let o = null;
    function r(b, w, $ = 2) {
      const C = b.toFixed($);
      return w === "percent" ? `${C}%` : w === "bytes" ? b >= 1024 * 1024 ? `${(b / 1024 / 1024).toFixed(1)} MB` : b >= 1024 ? `${(b / 1024).toFixed(1)} KB` : `${b} B` : w ? `${C} ${w}` : C;
    }
    function a(b, w, $) {
      const C = [...$].sort((O, E) => O.value - E.value);
      let P = w;
      for (const O of C)
        b >= O.value && (P = O.color);
      return P;
    }
    function l(b, w) {
      const $ = b.match(/^#([0-9a-f]{6})([0-9a-f]{2})?$/i);
      if ($) {
        const P = Number.parseInt($[1].slice(0, 2), 16), O = Number.parseInt($[1].slice(2, 4), 16), E = Number.parseInt($[1].slice(4, 6), 16);
        return `rgba(${P},${O},${E},${w})`;
      }
      const C = b.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i);
      return C ? `rgba(${C[1]},${C[2]},${C[3]},${w})` : b;
    }
    function s(b, w, $, C, P, O, E, _, D, M, N, L, j, B, Y, Q, G, V, H, q, K, ee) {
      const ie = b.getContext("2d");
      if (!ie)
        return;
      const ae = window.devicePixelRatio || 1, te = b.clientWidth, U = b.clientHeight;
      if (te === 0 || U === 0)
        return;
      b.width = te * ae, b.height = U * ae, ie.scale(ae, ae), ie.clearRect(0, 0, te, U);
      const me = L * Math.PI / 180, ce = (L + j) * Math.PI / 180;
      let ue, fe, he, le;
      if (j >= 360)
        ue = -1, fe = 1, he = -1, le = 1;
      else {
        ue = Math.cos(me), fe = Math.cos(me), he = Math.sin(me), le = Math.sin(me);
        const wt = (nn) => {
          ue = Math.min(ue, Math.cos(nn)), fe = Math.max(fe, Math.cos(nn)), he = Math.min(he, Math.sin(nn)), le = Math.max(le, Math.sin(nn));
        };
        wt(ce);
        const Nt = [0, 90, 180, 270, 360, 450, 540].map((nn) => nn * Math.PI / 180);
        for (const nn of Nt) {
          const sn = (Xn) => (Xn % (2 * Math.PI) + 2 * Math.PI) % (2 * Math.PI), xn = sn(me), Pn = sn(ce), bt = sn(nn);
          (xn <= Pn ? bt >= xn && bt <= Pn : bt >= xn || bt <= Pn) && wt(nn);
        }
      }
      const ke = fe - ue, ze = le - he, Re = Math.min(te, U), Ye = Re / 300, Ne = G * Ye, Fe = V * Ye, We = Math.max(0, te - 2 * Ne), nt = Math.max(0, U - 2 * Fe), Qe = Ne, Pe = Fe, Ze = D * Ye, Ce = M * Ye, $e = q === "marker", Le = q === "track", Ke = $e ? Math.max(2, Re * 0.04) : 0, qe = $e ? Math.max(Ze, Ce) / 2 + 2 + Ke : Math.max(Ze, Ce) / 2, rt = Math.min((We - qe * 2) / ke, (nt - qe * 2) / ze);
      if (rt < 10)
        return;
      const De = Qe + We / 2 - (ue + fe) / 2 * rt, Be = Pe + nt / 2 - (he + le) / 2 * rt, je = C - $ || 1, at = Math.max($, Math.min(C, w)), mt = (at - $) / je, st = me + mt * (ce - me), gt = H ?? a(at, E, O), Et = _ ? "round" : "butt";
      ie.beginPath(), ie.arc(De, Be, rt, me, ce), ie.strokeStyle = N, ie.lineWidth = Ze, ie.lineCap = Et, ie.stroke();
      const It = [...O].sort((wt, Nt) => wt.value - Nt.value), _t = [];
      if (It.length === 0)
        _t.push({ from: $, to: C, color: E });
      else {
        _t.push({ from: $, to: It[0].value, color: E });
        for (let wt = 0; wt < It.length; wt++)
          _t.push({ from: It[wt].value, to: wt + 1 < It.length ? It[wt + 1].value : C, color: It[wt].color });
      }
      if (Le) {
        const wt = (ce - me) / (2 * Math.PI), Nt = ie.createConicGradient(me, De, Be);
        for (const nn of _t) {
          const sn = Math.min(1, (Math.max($, nn.from) - $) / je * wt), xn = Math.min(1, (Math.min(C, nn.to) - $) / je * wt);
          Nt.addColorStop(sn, l(nn.color, 0.25)), Nt.addColorStop(xn, l(nn.color, 0.25));
        }
        Nt.addColorStop(1, l(_t[0].color, 0.25)), ie.beginPath(), ie.arc(De, Be, rt, me, ce), ie.strokeStyle = Nt, ie.lineWidth = Ze, ie.lineCap = Et, ie.stroke();
      }
      if (mt > 0 && (ie.beginPath(), ie.arc(De, Be, rt, me, st), ie.strokeStyle = gt, ie.lineWidth = Ce, ie.lineCap = Et, ie.stroke()), $e && _t.length > 0) {
        const wt = rt + Math.max(Ze, Ce) / 2 + Ke / 2 + 2, Nt = (ce - me) / (2 * Math.PI), nn = ie.createConicGradient(me, De, Be);
        for (const sn of _t) {
          const xn = Math.min(1, (Math.max($, sn.from) - $) / je * Nt), Pn = Math.min(1, (Math.min(C, sn.to) - $) / je * Nt);
          nn.addColorStop(xn, sn.color), nn.addColorStop(Pn, sn.color);
        }
        nn.addColorStop(1, _t[0].color), ie.beginPath(), ie.arc(De, Be, wt, me, ce), ie.strokeStyle = nn, ie.lineWidth = Ke, ie.lineCap = Et, ie.stroke();
      }
      if (ee !== "none" && O.length > 0) {
        const wt = Math.max(8, 11 * Ye), Nt = rt + Math.max(Ze, Ce) / 2 + ($e ? Ke + 4 : 4) + wt * 0.6, nn = C - $ || 1;
        ie.font = `${wt}px system-ui, sans-serif`, ie.textBaseline = "middle";
        for (const sn of O) {
          const xn = (sn.value - $) / nn;
          if (xn < 0 || xn > 1)
            continue;
          const Pn = me + xn * (ce - me), bt = De + Math.cos(Pn) * Nt, Xn = Be + Math.sin(Pn) * Nt, En = bt - De;
          if (ie.textAlign = En > 1 ? "left" : En < -1 ? "right" : "center", ie.fillStyle = sn.color, ee === "label" || ee === "both") {
            const di = sn.label || String(sn.value);
            ee === "both" ? (ie.fillText(di, bt, Xn - wt * 0.6), ie.fillText(r(sn.value, P, 1), bt, Xn + wt * 0.6)) : ie.fillText(di, bt, Xn);
          } else
            ie.fillText(r(sn.value, P, 1), bt, Xn);
        }
      }
      if (Q) {
        const wt = Math.max(4, Y * Ye), Nt = r(at, P, 2), nn = Be + he * rt - Ce / 2, sn = Be + le * rt + Ce / 2, xn = (nn + sn) / 2;
        ie.textAlign = "center", ie.textBaseline = "middle", ie.fillStyle = B, ie.font = `600 ${wt}px system-ui, sans-serif`, ie.fillText(Nt, De, xn + K * Ye);
      }
    }
    function u(b, w, $) {
      const C = Math.ceil(Math.sqrt($ * b / w));
      return Math.floor(C * w / b) * C < $ ? w / Math.ceil(C * w / b) : b / C;
    }
    function c(b, w, $, C) {
      const P = Math.max(u(b, w, C), u(w, b, C));
      let O = Math.max(1, Math.floor(b / P));
      const E = Math.ceil(C / O);
      return O = Math.ceil(C / E), { xCount: O, yCount: E, cellW: b / O - $ + $ / O, cellH: w / E - $ + $ / E };
    }
    const d = A(
      () => e.series && e.series.length > 0 ? e.series : [{ label: e.title ?? "", value: e.value ?? 0, activeColorOverride: e.activeColorOverride }]
    ), f = A(() => d.value.length), h = A(() => e.thresholds && e.thresholds.length > 0 ? e.thresholds : []), p = A(() => e.thresholdBaseColor ?? "#52c41a"), g = A(() => {
      const b = i.value.w, w = i.value.h;
      return b <= 0 || w <= 0 ? { xCount: 1, yCount: 1, cellW: 0, cellH: 0 } : e.orientation === "horizontal" ? { xCount: f.value, yCount: 1, cellW: (b - Q1 * (f.value - 1)) / f.value, cellH: w } : e.orientation === "vertical" ? { xCount: 1, yCount: f.value, cellW: b, cellH: (w - Q1 * (f.value - 1)) / f.value } : c(b, w, Q1, f.value);
    });
    Lt(() => {
      n.value && (o = new ResizeObserver((b) => {
        const w = b[0].contentRect;
        i.value = { w: w.width, h: w.height };
      }), o.observe(n.value));
    }), wo(() => {
      o?.disconnect();
    });
    const m = de({});
    function y() {
      rn(() => {
        for (let b = 0; b < d.value.length; b++) {
          const w = m.value[b];
          if (!w)
            continue;
          const $ = d.value[b];
          s(
            w,
            $.value,
            e.min,
            e.max,
            e.unit,
            h.value,
            p.value,
            e.capRound,
            e.trackWidth,
            e.fillWidth,
            e.trackColor,
            270 - e.sweepAngle / 2,
            e.sweepAngle,
            e.valueColor,
            e.valueSize,
            e.valueVisible,
            e.paddingX,
            e.paddingY,
            $.activeColorOverride ?? e.activeColorOverride,
            e.thresholdDisplay,
            e.valueOffsetY,
            e.thresholdLabelDisplay
          );
        }
      });
    }
    return _e(() => [
      d.value,
      e.min,
      e.max,
      e.unit,
      e.thresholds,
      e.thresholdBaseColor,
      e.capRound,
      e.trackWidth,
      e.fillWidth,
      e.trackColor,
      e.sweepAngle,
      e.valueColor,
      e.valueSize,
      e.valueVisible,
      e.paddingX,
      e.paddingY,
      e.thresholdDisplay,
      e.valueOffsetY,
      e.thresholdLabelDisplay,
      i.value
    ], y, { deep: !0, immediate: !0 }), (b, w) => (re(), be("div", {
      ref_key: "containerRef",
      ref: n,
      style: Yt([{ width: "100%", height: "100%", display: "grid", gap: "2px" }, {
        gridTemplateColumns: `repeat(${g.value.xCount}, 1fr)`,
        gridTemplateRows: `repeat(${g.value.yCount}, 1fr)`
      }])
    }, [
      (re(!0), be(tt, null, Jt(d.value, ($, C) => (re(), be("div", {
        key: `${$.label}-${C}`,
        style: { width: "100%", height: "100%", display: "flex", "flex-direction": "column", overflow: "hidden" }
      }, [
        F("canvas", {
          ref_for: !0,
          ref: (P) => {
            P && (m.value[C] = P);
          },
          style: { flex: "1", width: "100%", height: "0", display: "block", "min-height": "0" }
        }, null, 512),
        f.value > 1 && $.label ? (re(), be("div", zve, se($.label), 1)) : et("", !0)
      ]))), 128))
    ], 4));
  }
}), Fve = { class: "w-full h-full flex flex-col overflow-hidden" }, Vve = {
  key: 0,
  style: { "flex-shrink": "0", padding: "2px 4px", overflow: "auto", "max-height": "140px" }
}, Qve = /* @__PURE__ */ Oe({
  __name: "HistogramPanel",
  props: {
    seriesValues: {},
    seriesLabels: {},
    bucketSize: {},
    bucketCount: {},
    bucketOffset: {},
    combineSeries: { type: Boolean, default: !1 },
    colorScheme: {},
    colorSingleValue: {},
    colorDistribution: {},
    lineWidth: { default: 1 },
    fillOpacity: { default: 80 },
    tooltipMode: { default: "multi" },
    tooltipSort: { default: "none" },
    unit: { default: "" }
  },
  setup(t) {
    const e = t;
    function n(f, h) {
      const p = f.filter((_) => Number.isFinite(_));
      if (p.length === 0)
        return { bucketStarts: [], counts: [] };
      const g = p.reduce((_, D) => Math.min(_, D), 1 / 0), m = p.reduce((_, D) => Math.max(_, D), -1 / 0), y = m - g || 1, b = h.bucketOffset ?? 0, w = h.bucketCount ?? 30, $ = h.bucketSize ?? y / w, C = Math.floor((g - b) / $) * $ + b, P = [], O = [];
      let E = C;
      for (; E <= m; )
        P.push(E), O.push(0), E += $;
      for (const _ of p) {
        const D = Math.floor((_ - C) / $), M = Math.min(D, O.length - 1);
        M >= 0 && O[M]++;
      }
      return { bucketStarts: P, counts: O };
    }
    const i = A(() => {
      const f = { bucketSize: e.bucketSize, bucketCount: e.bucketCount, bucketOffset: e.bucketOffset };
      if (e.combineSeries || e.seriesValues.length === 0) {
        const { bucketStarts: m, counts: y } = n(e.seriesValues.flat(), f);
        return { bucketStarts: m, countSeries: [y], labels: ["combined"] };
      }
      const { bucketStarts: h } = n(e.seriesValues.flat(), f), p = h.length > 1 ? h[1] - h[0] : void 0, g = e.seriesValues.map((m) => {
        const { counts: y } = n(m, { ...f, bucketSize: p });
        return Array.from({ length: h.length }, (b, w) => y[w] ?? 0);
      });
      return { bucketStarts: h, countSeries: g, labels: e.seriesLabels };
    }), o = A(() => {
      const { countSeries: f, labels: h } = i.value, p = new SD({ id: "histogram" });
      p.addScale({ scaleKey: "x", time: !1 }), p.addScale({ scaleKey: "y", auto: !0 }), p.addAxis({
        scaleKey: "x",
        side: 2,
        stroke: "#666",
        grid: { show: !1 },
        isTimeAxis: !1
      }), p.addAxis({
        scaleKey: "y",
        side: 3,
        stroke: "#666",
        grid: { show: !0, stroke: "rgba(128,128,128,0.15)", width: 1 },
        size: 50,
        isDarkMode: !0,
        yAxisUnit: e.unit
      });
      const g = MR(
        e.colorScheme,
        f.length,
        e.colorDistribution ?? "sequential",
        e.colorSingleValue
      ), m = {};
      h.forEach((b, w) => {
        m[b] = g[w % g.length];
      });
      const y = Math.round(e.fillOpacity / 100 * 255).toString(16).padStart(2, "0");
      return f.forEach((b, w) => {
        const $ = g[w % g.length];
        p.addSeries({
          scaleKey: "y",
          label: h[w] ?? `series-${w + 1}`,
          drawStyle: bl.Histogram,
          lineColor: $,
          lineWidth: e.lineWidth,
          fillColor: `${$}${y}`,
          fillOpacity: e.fillOpacity,
          fillMode: tp.Solid,
          colorMapping: m,
          isDarkMode: !0
        });
      }), p;
    }), r = A(() => {
      const { bucketStarts: f, countSeries: h } = i.value;
      return [f, ...h];
    }), a = de(), l = de({ width: 0, height: 0 }), s = de(null);
    let u = null;
    Lt(() => {
      const f = a.value;
      f && (u = new ResizeObserver((h) => {
        const { width: p, height: g } = h[0].contentRect;
        p > 0 && g > 0 && (l.value = { width: Math.floor(p), height: Math.floor(g) });
      }), u.observe(f), requestAnimationFrame(() => {
        const { width: h, height: p } = f.getBoundingClientRect();
        h > 0 && p > 0 && (l.value = { width: Math.floor(h), height: Math.floor(p) });
      }));
    }), tn(() => u?.disconnect());
    const c = A(
      () => !e.combineSeries && i.value.countSeries.length > 1
    ), d = A(() => Math.max(l.value.height, 50));
    return (f, h) => (re(), be("div", Fve, [
      F("div", {
        ref_key: "chartAreaRef",
        ref: a,
        class: "flex-1 min-h-0 min-w-0 relative overflow-hidden"
      }, [
        l.value.width > 0 && l.value.height > 0 ? (re(), ut(b4, {
          key: 0,
          config: o.value,
          data: r.value,
          width: l.value.width,
          height: d.value,
          onPlotReady: h[0] || (h[0] = (p) => s.value = p)
        }, {
          default: ye(() => [
            v(v4, {
              "u-plot-instance": s.value,
              unit: t.unit,
              "can-pin-tooltip": !0,
              "tooltip-mode": t.tooltipMode,
              "tooltip-sort": t.tooltipSort
            }, null, 8, ["u-plot-instance", "unit", "tooltip-mode", "tooltip-sort"])
          ]),
          _: 1
        }, 8, ["config", "data", "width", "height"])) : et("", !0)
      ], 512),
      c.value ? (re(), be("div", Vve, [
        v(g4, {
          items: o.value.getLegendItems(),
          "u-plot-instance": s.value,
          position: "bottom",
          mode: "list",
          values: [],
          data: r.value,
          unit: t.unit
        }, null, 8, ["items", "u-plot-instance", "data", "unit"])
      ])) : et("", !0)
    ]));
  }
}), Hve = ["width", "height"], Wve = ["d", "fill", "stroke", "opacity", "onMousemove"], jve = ["x", "y"], qve = ["onClick"], Yve = { style: { width: "100%", "border-collapse": "collapse" } }, Kve = ["onClick"], Xve = { class: "flex items-center gap-1" }, Zve = {
  class: "overflow-hidden text-ellipsis whitespace-nowrap",
  style: { "max-width": "80px" }
}, Gve = { class: "flex items-center gap-1.5" }, Uve = /* @__PURE__ */ Oe({
  __name: "PiePanel",
  props: {
    slices: {},
    pieType: { default: "pie" },
    pieLabels: { default: () => [] },
    unit: {},
    decimals: { default: 2 },
    legendPosition: { default: "bottom" },
    legendMode: { default: "list" },
    legendValues: { default: () => [] },
    tooltipMode: { default: "single" },
    tooltipSort: { default: "none" }
  },
  setup(t) {
    const e = t, n = _l(), i = de(), o = de({ width: 0, height: 0 });
    let r = null;
    Lt(() => {
      if (!i.value)
        return;
      r = new ResizeObserver((q) => {
        const { width: K, height: ee } = q[0].contentRect;
        o.value = { width: Math.floor(K), height: Math.floor(ee) };
      }), r.observe(i.value);
      const { width: V, height: H } = i.value.getBoundingClientRect();
      o.value = { width: Math.floor(V), height: Math.floor(H) };
    }), tn(() => {
      r?.disconnect();
    });
    const a = A(() => n.isDark), l = A(() => a.value ? "#d9d9d9" : "#141414"), s = A(() => a.value ? "#8c8c8c" : "#595959"), u = A(() => a.value ? "rgba(255,255,255,0.08)" : "rgba(0,0,0,0.08)"), c = A(() => a.value ? "rgba(0,0,0,0.6)" : "rgba(255,255,255,0.8)"), d = A(() => {
      const V = e.legendValues.length > 0;
      return e.legendMode === "table" ? V ? 120 + e.legendValues.length * 64 : 160 : 140;
    }), f = A(
      () => e.legendPosition === "bottom" ? e.legendMode === "table" ? Math.min(e.slices.length * 24 + 28, 120) : 28 : 0
    ), h = A(() => e.legendPosition === "right" ? d.value : 0), p = A(() => Math.max(o.value.width - h.value, 10)), g = A(() => Math.max(o.value.height - f.value, 10)), m = A(() => p.value / 2), y = A(() => g.value / 2), b = A(() => Math.min(m.value, y.value) * 0.85), w = A(() => e.pieType === "donut" ? b.value * 0.55 : 0), $ = de(null), C = de({ x: 0, y: 0 }), P = de(/* @__PURE__ */ new Set()), O = A(() => e.slices.filter((V) => !P.value.has(V.label))), E = A(() => O.value.reduce((V, H) => V + H.value, 0));
    function _(V, H, q, K) {
      const ee = (K - 90) * Math.PI / 180;
      return { x: V + q * Math.cos(ee), y: H + q * Math.sin(ee) };
    }
    function D(V, H, q, K, ee, ie) {
      const ae = Math.min(ie - ee, 359.9999), te = ae > 180 ? 1 : 0, U = _(V, H, q, ee), me = _(V, H, q, ee + ae);
      if (K <= 0)
        return [
          `M ${V} ${H}`,
          `L ${U.x} ${U.y}`,
          `A ${q} ${q} 0 ${te} 1 ${me.x} ${me.y}`,
          "Z"
        ].join(" ");
      const ce = _(V, H, K, ee + ae), ue = _(V, H, K, ee);
      return [
        `M ${U.x} ${U.y}`,
        `A ${q} ${q} 0 ${te} 1 ${me.x} ${me.y}`,
        `L ${ce.x} ${ce.y}`,
        `A ${K} ${K} 0 ${te} 0 ${ue.x} ${ue.y}`,
        "Z"
      ].join(" ");
    }
    const M = A(() => {
      const V = E.value;
      if (V === 0 || o.value.width === 0)
        return [];
      let H = 0;
      return O.value.map((q) => {
        const K = q.value / V * 360, ee = q.value / V * 100, ie = H;
        H += K;
        const ae = H, te = ie + K / 2, U = (b.value + w.value) / 2 || b.value * 0.65, me = _(m.value, y.value, U, te), ce = D(m.value, y.value, b.value, w.value, ie, ae);
        return { ...q, angle: K, pct: ee, startAngle: ie, endAngle: ae, midAngle: te, labelPos: me, path: ce };
      });
    });
    function N(V) {
      const H = V.toFixed(e.decimals);
      return e.unit ? `${H} ${e.unit}` : H;
    }
    function L(V, H) {
      return V.rawValues && V.rawValues.length > 0 ? Qh(V.rawValues, H) : V.value;
    }
    function j(V) {
      const H = new Set(P.value);
      if (H.has(V))
        H.delete(V);
      else {
        if (e.slices.filter((K) => !H.has(K.label)).length <= 1)
          return;
        H.add(V);
      }
      P.value = H;
    }
    function B(V, H) {
      $.value = H;
      const q = i.value?.getBoundingClientRect();
      q && (C.value = { x: V.clientX - q.left, y: V.clientY - q.top });
    }
    function Y() {
      $.value = null;
    }
    const Q = A(() => {
      if (!$.value || e.tooltipMode === "none")
        return [];
      const V = E.value;
      if (e.tooltipMode === "single") {
        const q = O.value.find((K) => K.label === $.value);
        return q ? [{ ...q, percent: V > 0 ? q.value / V * 100 : 0 }] : [];
      }
      let H = O.value.map((q) => ({ ...q, percent: V > 0 ? q.value / V * 100 : 0 }));
      return e.tooltipSort === "desc" && (H = [...H].sort((q, K) => K.value - q.value)), e.tooltipSort === "asc" && (H = [...H].sort((q, K) => q.value - K.value)), H;
    }), G = A(() => {
      const V = e.tooltipMode === "multi" ? 180 : 140, H = e.tooltipMode === "multi" ? Q.value.length * 22 + 32 : 72, q = Math.min(C.value.x + 14, o.value.width - V - 4), K = Math.min(C.value.y - 8, o.value.height - H - 4);
      return { left: Math.max(4, q), top: Math.max(4, K) };
    });
    return (V, H) => (re(), be("div", {
      ref_key: "containerRef",
      ref: i,
      class: "w-full h-full relative overflow-hidden",
      style: Yt({
        display: "flex",
        flexDirection: t.legendPosition === "bottom" ? "column" : "row"
      })
    }, [
      o.value.width > 0 ? (re(), be("svg", {
        key: 0,
        width: p.value,
        height: g.value,
        style: { "flex-shrink": "0" }
      }, [
        (re(!0), be(tt, null, Jt(M.value, (q) => (re(), be("g", {
          key: q.label
        }, [
          q.angle > 0.3 ? (re(), be("path", {
            key: 0,
            d: q.path,
            fill: q.color,
            stroke: c.value,
            "stroke-width": "1.5",
            opacity: $.value && $.value !== q.label ? 0.6 : 1,
            style: { cursor: "pointer", transition: "opacity 0.15s" },
            onMousemove: (K) => B(K, q.label),
            onMouseleave: Y
          }, null, 40, Wve)) : et("", !0),
          t.pieLabels.length > 0 && q.angle > 20 ? (re(), be("text", {
            key: 1,
            x: q.labelPos.x,
            y: q.labelPos.y,
            "text-anchor": "middle",
            "dominant-baseline": "middle",
            fill: "#fff",
            "font-size": "11",
            style: { "pointer-events": "none", "user-select": "none", "text-shadow": "0 1px 2px rgba(0,0,0,0.6)" }
          }, se([
            t.pieLabels.includes("name") ? q.label : null,
            t.pieLabels.includes("percent") ? `${q.pct.toFixed(1)}%` : null,
            t.pieLabels.includes("value") ? N(q.value) : null
          ].filter(Boolean).join(" ")), 9, jve)) : et("", !0)
        ]))), 128))
      ], 8, Hve)) : et("", !0),
      t.legendPosition !== "hidden" && t.legendMode === "list" ? (re(), be("div", {
        key: 1,
        style: Yt({
          display: "flex",
          flexDirection: t.legendPosition === "bottom" ? "row" : "column",
          flexWrap: "wrap",
          alignItems: t.legendPosition === "bottom" ? "center" : "flex-start",
          justifyContent: t.legendPosition === "bottom" ? "center" : "flex-start",
          gap: "4px 12px",
          padding: t.legendPosition === "right" ? "8px 4px" : "2px 8px",
          overflowY: t.legendPosition === "right" ? "auto" : "hidden",
          width: t.legendPosition === "right" ? `${h.value}px` : void 0,
          height: t.legendPosition === "bottom" ? `${f.value}px` : void 0
        })
      }, [
        (re(!0), be(tt, null, Jt(t.slices, (q) => (re(), be("div", {
          key: q.label,
          class: "flex items-center gap-1 text-xs whitespace-nowrap cursor-pointer select-none",
          style: Yt({
            color: l.value,
            opacity: P.value.has(q.label) ? 0.35 : 1,
            textDecoration: P.value.has(q.label) ? "line-through" : "none"
          }),
          onClick: (K) => j(q.label)
        }, [
          F("span", {
            class: "inline-block w-2 h-2 rounded-sm flex-shrink-0",
            style: Yt({ background: q.color })
          }, null, 4),
          F("span", null, se(q.label), 1),
          t.legendValues.length > 0 ? (re(), be("span", {
            key: 0,
            class: "ml-1",
            style: Yt({ color: s.value })
          }, se(t.legendValues.map((K) => N(L(q, K))).join(" / ")), 5)) : et("", !0)
        ], 12, qve))), 128))
      ], 4)) : et("", !0),
      t.legendPosition !== "hidden" && t.legendMode === "table" ? (re(), be("div", {
        key: 2,
        style: Yt({
          width: t.legendPosition === "right" ? `${h.value}px` : void 0,
          height: t.legendPosition === "bottom" ? `${f.value}px` : void 0,
          overflowY: "auto",
          flexShrink: 0,
          fontSize: "11px"
        })
      }, [
        F("table", Yve, [
          F("thead", null, [
            F("tr", null, [
              F("th", {
                style: Yt({ textAlign: "left", padding: "2px 6px", color: s.value, fontWeight: 500, borderBottom: `1px solid ${u.value}` })
              }, " Name ", 4),
              F("th", {
                style: Yt({ textAlign: "right", padding: "2px 6px", color: s.value, fontWeight: 500, borderBottom: `1px solid ${u.value}` })
              }, " Value ", 4),
              (re(!0), be(tt, null, Jt(t.legendValues, (q) => (re(), be("th", {
                key: q,
                style: Yt({ textAlign: "right", padding: "2px 6px", color: s.value, fontWeight: 500, borderBottom: `1px solid ${u.value}`, minWidth: "56px" })
              }, se(q.charAt(0).toUpperCase() + q.slice(1)), 5))), 128))
            ])
          ]),
          F("tbody", null, [
            (re(!0), be(tt, null, Jt(t.slices, (q) => (re(), be("tr", {
              key: q.label,
              class: "cursor-pointer select-none",
              style: Yt({ opacity: P.value.has(q.label) ? 0.35 : 1 }),
              onClick: (K) => j(q.label)
            }, [
              F("td", {
                style: Yt({ padding: "2px 6px", color: l.value })
              }, [
                F("div", Xve, [
                  F("span", {
                    class: "inline-block w-2 h-2 rounded-sm flex-shrink-0",
                    style: Yt({ background: q.color })
                  }, null, 4),
                  F("span", Zve, se(q.label), 1)
                ])
              ], 4),
              F("td", {
                style: Yt({ textAlign: "right", padding: "2px 6px", color: l.value, fontVariantNumeric: "tabular-nums" })
              }, se(N(q.value)), 5),
              (re(!0), be(tt, null, Jt(t.legendValues, (K) => (re(), be("td", {
                key: K,
                style: Yt({ textAlign: "right", padding: "2px 6px", color: s.value, fontVariantNumeric: "tabular-nums" })
              }, se(N(L(q, K))), 5))), 128))
            ], 12, Kve))), 128))
          ])
        ])
      ], 4)) : et("", !0),
      $.value && t.tooltipMode !== "none" && Q.value.length > 0 ? (re(), be("div", {
        key: 3,
        class: "absolute z-50 pointer-events-none rounded shadow-lg text-xs",
        style: Yt({
          left: `${G.value.left}px`,
          top: `${G.value.top}px`,
          background: a.value ? "#1f1f1f" : "#fff",
          border: a.value ? "1px solid #333" : "1px solid #e8e8e8",
          minWidth: "140px"
        })
      }, [
        F("div", {
          class: "px-2 pt-1.5 pb-0 text-xs font-medium",
          style: Yt({ color: a.value ? "#d9d9d9" : "#141414" })
        }, se(t.tooltipMode === "multi" ? `${N(E.value)} total` : Q.value[0]?.label), 5),
        F("div", {
          class: "border-t my-1",
          style: Yt({ borderColor: a.value ? "#333" : "#e8e8e8" })
        }, null, 4),
        (re(!0), be(tt, null, Jt(Q.value, (q) => (re(), be("div", {
          key: q.label,
          class: "px-2 py-0.5 flex items-center justify-between gap-2"
        }, [
          F("div", Gve, [
            F("span", {
              class: "inline-block w-2 h-2 rounded-sm",
              style: Yt({ background: q.color })
            }, null, 4),
            F("span", {
              style: Yt({ color: a.value ? "#d9d9d9" : "#141414" })
            }, se(t.tooltipMode === "multi" ? q.label : `${q.percent.toFixed(1)}%`), 5)
          ]),
          F("span", {
            class: "font-mono",
            style: Yt({ color: q.color })
          }, se(N(q.value)), 5)
        ]))), 128))
      ], 4)) : et("", !0)
    ], 4));
  }
}), Em = 36, ac = 1.2, LI = 1, Jve = /* @__PURE__ */ Oe({
  __name: "StatPanel",
  props: {
    title: {},
    unit: {},
    series: {},
    trend: {},
    thresholds: {},
    thresholdBaseColor: {},
    orientation: {},
    textMode: {},
    colorMode: {}
  },
  setup(t) {
    const e = t, n = _l(), i = de(), o = de({ w: 0, h: 0 });
    let r = null;
    const a = ["#1677ff", "#52c41a", "#fa8c16", "#f5222d", "#722ed1", "#13c2c2", "#eb2f96", "#faad14"];
    function l($) {
      return $ >= 1e6 ? `${($ / 1e6).toFixed(1)}M` : $ >= 1e3 ? `${($ / 1e3).toFixed(1)}K` : $ % 1 === 0 ? String($) : $.toFixed(1);
    }
    function s($, C, P, O) {
      const E = P ?? O ?? a[0];
      if (C && C.length > 0) {
        let _ = E;
        for (const D of C)
          $ >= D.value && (_ = D.color);
        return _;
      }
      return E;
    }
    function u($, C) {
      if ($.startsWith("rgb("))
        return $.replace("rgb(", "rgba(").replace(")", `, ${C})`);
      if ($.startsWith("rgba("))
        return $.replace(/,\s*[\d.]+\)$/, `, ${C})`);
      const P = $.replace("#", ""), O = P.length === 3 ? P.split("").map((M) => M + M).join("") : P.slice(0, 6), E = Number.parseInt(O.slice(0, 2), 16), _ = Number.parseInt(O.slice(2, 4), 16), D = Number.parseInt(O.slice(4, 6), 16);
      return `rgba(${E}, ${_}, ${D}, ${C})`;
    }
    function c($, C, P) {
      switch (C) {
        case "background_solid":
          return Qt($).toString();
        case "background": {
          const O = P ? 1 : -0.7, E = Qt($).darken(15 * O).spin(8).toRgbString(), _ = Qt($).darken(5 * O).spin(-8).toRgbString();
          return `linear-gradient(120deg, ${E}, ${_})`;
        }
        default:
          return "transparent";
      }
    }
    function d($) {
      return Qt($).isLight() ? "#1a1a1a" : "#ffffff";
    }
    function f($, C, P) {
      if ($ === 0 || C === 0)
        return { isWide: !1, showSparkline: !1, valueFontSize: 24, titleFontSize: 12, chartHeight: 0, padding: 8 };
      const O = C > 100 ? 12 : 8, E = $ - O * 2, _ = C - O * 2, D = $ / C > 2.5, M = P && (D ? C > 50 : C > 100), N = Math.max(10, Math.min(13, _ * (D ? 0.22 : 0.18)));
      let L, j = 0;
      if (D)
        L = M ? Math.min(_ * 0.62, E * 0.42, Em) : Math.min(_ * 0.7, E * 0.38, Em), M && (j = C * 0.5);
      else {
        const B = N * ac;
        L = Math.min(M ? (_ - B) * 0.65 : (_ - B) * 0.85, E * 0.9, Em), M && (j = Math.max(0, Math.min(C - N * ac - L * ac - O, C * 0.5)));
      }
      return {
        isWide: D,
        showSparkline: M,
        valueFontSize: Math.max(11, L),
        titleFontSize: N,
        chartHeight: j,
        padding: O
      };
    }
    function h($, C, P) {
      const O = Math.ceil(Math.sqrt(P * $ / C));
      return Math.floor(O * C / $) * O < P ? C / Math.ceil(O * C / $) : $ / O;
    }
    function p($, C, P, O) {
      const E = Math.max(h($, C, O), h(C, $, O));
      let _ = Math.max(1, Math.floor($ / E));
      const D = Math.ceil(O / _);
      return _ = Math.ceil(O / D), {
        xCount: _,
        yCount: D,
        cellW: $ / _ - P + P / _,
        cellH: C / D - P + P / D
      };
    }
    function g($, C, P) {
      const O = $.getContext("2d");
      if (!O)
        return;
      const E = window.devicePixelRatio || 1, _ = $.getBoundingClientRect();
      if (_.width === 0 || _.height === 0)
        return;
      $.width = _.width * E, $.height = _.height * E, O.scale(E, E);
      const D = _.width, M = _.height, N = C.reduce((Q, G) => Math.min(Q, G), 1 / 0), j = C.reduce((Q, G) => Math.max(Q, G), -1 / 0) - N || 1;
      O.clearRect(0, 0, D, M);
      const B = O.createLinearGradient(0, 0, 0, M);
      B.addColorStop(0, u(P, 0.25)), B.addColorStop(1, u(P, 0));
      const Y = C.map((Q, G) => ({
        x: G / (C.length - 1) * D,
        y: M - 2 - (Q - N) / j * (M - 4)
      }));
      O.beginPath(), Y.forEach(({ x: Q, y: G }, V) => V === 0 ? O.moveTo(Q, G) : O.lineTo(Q, G)), O.lineTo(D, M), O.lineTo(0, M), O.fillStyle = B, O.fill(), O.beginPath(), Y.forEach(({ x: Q, y: G }, V) => V === 0 ? O.moveTo(Q, G) : O.lineTo(Q, G)), O.strokeStyle = P, O.lineWidth = 1.5, O.stroke();
    }
    const m = A(() => Math.max(e.series.length, 1)), y = A(() => {
      const $ = o.value.w, C = o.value.h;
      return $ <= 0 || C <= 0 ? { xCount: 1, yCount: 1, cellW: 0, cellH: 0 } : e.orientation === "horizontal" ? { xCount: 1, yCount: m.value, cellW: $, cellH: (C - LI * (m.value - 1)) / m.value } : p($, C, LI, m.value);
    }), b = A(() => n.isDark ? "#303030" : "#fff");
    Lt(() => {
      i.value && (r = new ResizeObserver(($) => {
        const C = $[0].contentRect;
        (o.value.w !== C.width || o.value.h !== C.height) && (o.value = { w: C.width, h: C.height });
      }), r.observe(i.value));
    }), wo(() => {
      r?.disconnect();
    });
    const w = Oe({
      props: {
        label: String,
        value: Number,
        unit: String,
        mappedLabel: String,
        sparkline: Array,
        percentChange: [Number, null],
        textMode: { type: String, default: "value_and_name" },
        colorMode: String,
        color: String,
        width: Number,
        height: Number
      },
      setup($) {
        const C = de(), P = _l();
        function O() {
          rn(() => {
            C.value && $.sparkline && $.sparkline.length > 1 && g(C.value, $.sparkline, $.color ?? "#1677ff");
          });
        }
        return _e(() => [$.sparkline, $.color, $.width, $.height], O, { immediate: !0 }), () => {
          const E = $, _ = P.isDark, D = E.sparkline != null && E.sparkline.length > 1, M = f(E.width ?? 0, E.height ?? 0, D), N = E.textMode === "value_and_name" || E.textMode === "name", L = E.textMode === "value_and_name" || E.textMode === "value", j = Math.max(10, M.valueFontSize * 0.44), B = E.colorMode === "background_solid" || E.colorMode === "background", Y = B ? c(E.color ?? "#1677ff", E.colorMode ?? "value", _) : "transparent", Q = B ? d(E.color ?? "#1677ff") : E.color ?? "#d9d9d9", G = B ? Q : "#888", V = B ? Q : "#666", H = E.percentChange != null ? (E.percentChange > 0 ? "+" : "") + E.percentChange.toLocaleString(void 0, { style: "percent", minimumFractionDigits: 1, maximumFractionDigits: 2 }) : null, q = E.percentChange != null ? E.percentChange > 0 ? "#52c41a" : E.percentChange < 0 ? "#ff4d4f" : "#888" : "", K = E.percentChange != null ? E.percentChange > 0 ? "↑" : E.percentChange < 0 ? "↓" : "" : "", ee = E.mappedLabel ?? l(E.value ?? 0), ie = [
            lo("span", {
              style: {
                color: Q,
                fontSize: `${M.valueFontSize}px`,
                fontWeight: 500,
                fontFamily: "monospace",
                lineHeight: ac
              }
            }, ee)
          ];
          E.mappedLabel || ie.push(lo("span", {
            style: { color: V, fontSize: `${j}px`, lineHeight: ac }
          }, E.unit)), H && ie.push(lo("span", {
            style: { color: q, fontSize: `${j}px`, marginLeft: "2px", lineHeight: ac }
          }, `${K}${H}`));
          const ae = N ? lo("div", {
            style: {
              color: G,
              fontSize: `${M.titleFontSize}px`,
              lineHeight: ac,
              ...M.isWide ? { whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" } : { marginBottom: "2px" }
            }
          }, E.label) : null, te = L ? lo("div", {
            style: {
              display: "flex",
              alignItems: "baseline",
              gap: M.isWide ? "3px" : "4px",
              flexWrap: "wrap"
            }
          }, ie) : null, U = lo("div", {
            style: M.isWide ? { flex: 1, minWidth: 0, position: "relative", zIndex: 1 } : { position: "relative", zIndex: 1 }
          }, [ae, te]), me = M.showSparkline ? lo("canvas", {
            ref: (ue) => {
              C.value = ue;
            },
            style: M.isWide ? { position: "absolute", right: 0, bottom: 0, left: 0, width: "100%", height: `${M.chartHeight}px`, opacity: 0.7 } : { position: "absolute", bottom: 0, left: 0, right: 0, width: "100%", height: `${M.chartHeight}px`, opacity: 0.6 }
          }) : null, ce = M.isWide ? {
            width: "100%",
            height: "100%",
            display: "flex",
            alignItems: "center",
            padding: `0 ${M.padding}px`,
            gap: "8px",
            overflow: "hidden",
            position: "relative",
            background: Y
          } : {
            width: "100%",
            height: "100%",
            display: "flex",
            flexDirection: "column",
            justifyContent: "center",
            padding: `${M.padding}px`,
            overflow: "hidden",
            position: "relative",
            background: Y
          };
          return lo("div", { style: ce }, M.isWide ? [me, U] : [me, U]);
        };
      }
    });
    return ($, C) => (re(), be("div", {
      ref_key: "containerRef",
      ref: i,
      style: Yt([{ width: "100%", height: "100%", display: "grid", gap: "1px" }, {
        gridTemplateColumns: t.orientation === "horizontal" ? "1fr" : `repeat(${y.value.xCount}, 1fr)`,
        gridTemplateRows: t.orientation === "horizontal" ? `repeat(${m.value}, 1fr)` : `repeat(${y.value.yCount}, 1fr)`,
        background: b.value
      }])
    }, [
      (re(!0), be(tt, null, Jt(t.series, (P, O) => (re(), ut(I(w), {
        key: `${P.label}-${O}`,
        label: m.value === 1 ? t.title : P.label,
        value: P.displayValue ?? (P.values.length > 0 ? P.values[P.values.length - 1] ?? 0 : 0),
        unit: P.units ?? t.unit,
        "mapped-label": P.valueMap !== void 0 ? P.valueMap[String(P.displayValue ?? (P.values.length > 0 ? P.values[P.values.length - 1] ?? 0 : 0))] : void 0,
        sparkline: P.values.length > 1 ? P.values : void 0,
        "percent-change": P.percentChange,
        "text-mode": t.textMode,
        "color-mode": t.colorMode,
        color: s(
          P.displayValue ?? P.values[P.values.length - 1] ?? 0,
          t.thresholds,
          t.thresholdBaseColor,
          a[O % a.length]
        ),
        width: y.value.cellW,
        height: y.value.cellH
      }, null, 8, ["label", "value", "unit", "mapped-label", "sparkline", "percent-change", "text-mode", "color-mode", "color", "width", "height"]))), 128))
    ], 4));
  }
}), e0e = {
  key: 0,
  class: "flex-center h-full text-secondary"
}, t0e = {
  key: 1,
  class: "flex-center h-full"
}, n0e = {
  key: 2,
  class: "flex-center h-full text-red-500 text-xs"
}, i0e = {
  key: 3,
  class: "w-full h-full relative"
}, o0e = {
  key: 0,
  class: "absolute inset-0 z-10 flex items-center justify-center",
  style: { "backdrop-filter": "blur(1px)", "border-radius": "4px" }
}, r0e = {
  key: 0,
  class: "w-full h-full"
}, a0e = {
  key: 0,
  class: "w-full h-full overflow-auto"
}, bS = /* @__PURE__ */ Oe({
  __name: "PanelRenderer",
  props: {
    panelId: {},
    panelConfig: { default: void 0 }
  },
  setup(t) {
    const e = t, n = Nl(), { t: i } = On(), o = A(() => e.panelConfig ?? n.panels[e.panelId]);
    let r = null;
    const a = de(null), l = ["#1677ff", "#52c41a", "#fa8c16", "#f5222d", "#722ed1", "#13c2c2", "#eb2f96", "#faad14"];
    function s(C, P) {
      u();
      const O = C.seriesCount ?? 1, E = IR(
        { from: P.from / 1e3, to: P.to / 1e3 },
        15,
        O,
        C.pattern,
        C.labels
      ), _ = Array.from({ length: O }, (M, N) => 20 + (N * 37 + 13) % 60), D = Array.from({ length: O }, (M, N) => 10 + (N * 53 + 7) % 40);
      a.value = {
        timestamps: [...E.timestamps],
        seriesValues: E.series.map((M) => [...M.values])
      }, r = setInterval(() => {
        const M = a.value;
        if (!M)
          return;
        const N = Math.floor(Date.now() / 1e3), L = [...M.timestamps.slice(1), N], j = M.seriesValues.map((B, Y) => {
          const Q = B[B.length - 1], G = sH(Q, _[Y], D[Y] * 0.1, D[Y] + _[Y] * 1.8);
          return [...B.slice(1), G];
        });
        a.value = { timestamps: L, seriesValues: j };
      }, 1e3);
    }
    function u() {
      r && (clearInterval(r), r = null), a.value = null;
    }
    wo(u);
    const c = A(() => {
      const C = o.value;
      return C ? C.queries.some((P) => P.enabled !== !1 && P.dataSource?.type === "mock" && P.dataSource?.pattern === "live") : !1;
    });
    _e([o, () => n.timeRange], () => {
      const C = o.value;
      if (!C || !c.value) {
        u();
        return;
      }
      const P = C.queries.find((O) => O.enabled !== !1 && O.dataSource?.type === "mock" && O.dataSource?.pattern === "live");
      P && s(P.dataSource, n.timeRange);
    }, { immediate: !0, deep: !0 });
    const d = A(() => {
      const C = o.value;
      return C ? C.queries.filter((P) => P.enabled !== !1 && !(P.dataSource?.type === "mock" && P.dataSource?.pattern === "live")) : [];
    }), { response: f, loading: h, error: p } = r4(
      () => d.value,
      () => n.timeRange,
      1e3,
      () => n.panelRefreshKeys[e.panelId]
    );
    function g(C) {
      return typeof C?.toArray == "function" ? C.toArray() : Array.isArray(C) ? C : [];
    }
    function m(C, P) {
      if (!C || C.data.length === 0)
        return null;
      if (P.type === "timeseries" || P.type === "bar") {
        const O = g(C.data[0].fields[0]?.values), E = C.data.flatMap(
          (_) => _.fields.filter((D) => D.type === "number").map((D) => ({
            label: D.config?.displayNameFromDS ?? D.name,
            values: g(D.values)
          }))
        );
        return { timestamps: O.map((_) => _ / 1e3), series: E };
      }
      if (P.type === "histogram") {
        const O = C.data.flatMap(
          (_) => _.fields.filter((D) => D.type === "number").map((D) => g(D.values))
        ), E = C.data.flatMap(
          (_) => _.fields.filter((D) => D.type === "number").map((D) => D.config?.displayNameFromDS ?? D.name)
        );
        return { seriesValues: O, seriesLabels: E };
      }
      if (P.type === "stat" || P.type === "gauge") {
        const O = C.data.flatMap(
          (E) => E.fields.filter((_) => _.type === "number").map((_) => {
            const D = g(_.values);
            return {
              label: _.config?.displayNameFromDS ?? _.name,
              values: D,
              displayValue: Qh(D, P.statReducer ?? "lastNotNull"),
              percentChange: P.showPercentChange ? Kg(D) : void 0
            };
          })
        );
        return {
          series: O,
          value: O[0]?.values[O[0].values.length - 1] ?? 0,
          values: O.map((E) => E.values[E.values.length - 1] ?? 0),
          unit: P.unit ?? P.statUnit ?? "",
          trend: P.statTrend ?? "flat",
          percentChange: P.showPercentChange ? Kg(O[0]?.values ?? []) : void 0
        };
      }
      if (P.type === "pie")
        return C.data.flatMap(
          (O, E) => O.fields.filter((_) => _.type === "number").map((_, D) => ({
            label: _.config?.displayNameFromDS ?? _.name,
            value: Qh(g(_.values), P.statReducer ?? "lastNotNull"),
            color: l[(E + D) % l.length],
            rawValues: g(_.values)
          }))
        );
      if (P.type === "table") {
        const O = C.data[0], E = O.fields.map((M) => ({
          key: M.name,
          title: M.config?.displayNameFromDS ?? M.name,
          dataIndex: M.name
        })), _ = g(O.fields[0]?.values).length, D = Array.from({ length: _ }, (M, N) => {
          const L = { key: N };
          return O.fields.forEach((j) => {
            const B = g(j.values)[N];
            L[j.name] = j.type === "time" ? new Date(B).toLocaleString() : B;
          }), L;
        });
        return { columns: E, dataSource: D };
      }
      return null;
    }
    const y = A(() => {
      const C = o.value;
      return C ? m(f.value, C) : null;
    }), b = A(() => {
      const C = a.value, P = o.value;
      return !C || !P ? null : P.type === "timeseries" ? {
        timestamps: C.timestamps,
        series: C.seriesValues.map((O, E) => ({ label: `series-${E + 1}`, values: O }))
      } : P.type === "stat" || P.type === "gauge" ? {
        series: C.seriesValues.map((E, _) => ({
          label: `series-${_ + 1}`,
          values: E,
          displayValue: Qh(E, P.statReducer ?? "lastNotNull"),
          percentChange: P.showPercentChange ? Kg(E) : void 0
        })),
        value: C.seriesValues[0]?.[C.seriesValues[0].length - 1] ?? 0,
        values: C.seriesValues.map((E) => E[E.length - 1] ?? 0),
        unit: P.statUnit ?? "",
        trend: P.statTrend ?? "flat",
        percentChange: P.showPercentChange ? Kg(C.seriesValues[0] ?? []) : void 0
      } : P.type === "pie" ? C.seriesValues.map((O, E) => ({
        label: `series-${E + 1}`,
        value: Qh(O, P.statReducer ?? "lastNotNull"),
        color: l[E % l.length],
        rawValues: O
      })) : P.type === "histogram" ? {
        seriesValues: C.seriesValues,
        seriesLabels: C.seriesValues.map((O, E) => `series-${E + 1}`)
      } : null;
    }), w = A(() => b.value ?? y.value), $ = Oe({
      name: "NoDataPlaceholder",
      setup() {
        const { t: C } = On();
        return () => lo("div", { class: "flex flex-col items-center justify-center h-full gap-1.5 text-gray-400 select-none" }, [
          lo("span", { class: [St.databaseOff, "text-7", "opacity-50"] }),
          lo("span", { class: "text-xs" }, C("panel.noData"))
        ]);
      }
    });
    return (C, P) => o.value ? I(h) && !a.value ? (re(), be("div", t0e, [
      v(I(Bo))
    ])) : I(p) ? (re(), be("div", n0e, se(I(p)), 1)) : (re(), be("div", i0e, [
      I(h) && a.value ? (re(), be("div", o0e, [
        v(I(Bo))
      ])) : et("", !0),
      o.value.type === "timeseries" ? (re(), be(tt, { key: 1 }, [
        w.value && w.value.series?.length > 0 ? (re(), be("div", r0e, [
          v(x4, {
            data: w.value,
            unit: o.value.unit,
            decimals: o.value.decimals,
            "color-scheme": o.value.colorScheme,
            "color-single-value": o.value.colorSingleValue,
            "color-distribution": o.value.colorDistribution,
            thresholds: o.value.thresholds,
            "threshold-base-color": o.value.thresholdBaseColor,
            "fill-opacity": o.value.fillOpacity,
            "line-width": o.value.lineWidth,
            "line-interpolation": o.value.lineInterpolation,
            "line-style": o.value.lineStyle,
            "draw-style": o.value.drawStyle,
            "gradient-mode": o.value.gradientMode,
            "span-nulls": o.value.spanNulls,
            "show-points": o.value.showPoints,
            "show-points-mode": o.value.showPointsMode,
            "stacking-mode": o.value.stackingMode,
            "legend-position": o.value.legendPosition,
            "legend-mode": o.value.legendMode,
            "legend-values": o.value.legendValues,
            "panel-id": o.value.id,
            "tooltip-mode": o.value.tooltipMode,
            "tooltip-sort": o.value.tooltipSort,
            "tooltip-max-height": o.value.tooltipMaxHeight,
            "show-axis-pointer": o.value.showAxisPointer,
            "soft-min": o.value.softMin,
            "soft-max": o.value.softMax,
            "axis-placement": o.value.axisPlacement,
            "axis-name": o.value.axisName,
            "axis-width": o.value.axisWidth,
            "show-grid-lines": o.value.showGridLines,
            "grid-color": o.value.gridColor,
            "axis-label": o.value.axisLabel,
            "axis-label-color": o.value.axisLabelColor,
            "axis-tick": o.value.axisTick,
            "axis-tick-color": o.value.axisTickColor,
            "axis-border": o.value.axisBorder,
            "axis-border-color": o.value.axisBorderColor,
            "scale-distribution": o.value.scaleDistribution,
            "centered-zero": o.value.centeredZero
          }, null, 8, ["data", "unit", "decimals", "color-scheme", "color-single-value", "color-distribution", "thresholds", "threshold-base-color", "fill-opacity", "line-width", "line-interpolation", "line-style", "draw-style", "gradient-mode", "span-nulls", "show-points", "show-points-mode", "stacking-mode", "legend-position", "legend-mode", "legend-values", "panel-id", "tooltip-mode", "tooltip-sort", "tooltip-max-height", "show-axis-pointer", "soft-min", "soft-max", "axis-placement", "axis-name", "axis-width", "show-grid-lines", "grid-color", "axis-label", "axis-label-color", "axis-tick", "axis-tick-color", "axis-border", "axis-border-color", "scale-distribution", "centered-zero"])
        ])) : (re(), ut(I($), { key: 1 }))
      ], 64)) : o.value.type === "bar" ? (re(), be(tt, { key: 2 }, [
        w.value && w.value.series?.length > 0 ? (re(), ut(Lve, {
          key: 0,
          data: w.value,
          stacked: o.value.stacked,
          "bar-width": o.value.barWidth,
          "bar-group-width": o.value.barGroupWidth,
          "show-values": o.value.barShowValues,
          unit: o.value.unit,
          decimals: o.value.decimals,
          "color-scheme": o.value.colorScheme,
          "color-single-value": o.value.colorSingleValue,
          "color-distribution": o.value.colorDistribution,
          "legend-position": o.value.legendPosition,
          "legend-mode": o.value.legendMode,
          "legend-values": o.value.legendValues,
          "tooltip-mode": o.value.tooltipMode,
          "tooltip-sort": o.value.tooltipSort
        }, null, 8, ["data", "stacked", "bar-width", "bar-group-width", "show-values", "unit", "decimals", "color-scheme", "color-single-value", "color-distribution", "legend-position", "legend-mode", "legend-values", "tooltip-mode", "tooltip-sort"])) : (re(), ut(I($), { key: 1 }))
      ], 64)) : o.value.type === "stat" ? (re(), be(tt, { key: 3 }, [
        w.value ? (re(), ut(Jve, {
          key: 0,
          title: o.value.title,
          unit: w.value.unit,
          series: w.value.series,
          trend: w.value.trend,
          thresholds: o.value.thresholds,
          "threshold-base-color": o.value.thresholdBaseColor,
          orientation: o.value.statOrientation,
          "text-mode": o.value.statTextMode,
          "color-mode": o.value.statColorMode
        }, null, 8, ["title", "unit", "series", "trend", "thresholds", "threshold-base-color", "orientation", "text-mode", "color-mode"])) : (re(), ut(I($), { key: 1 }))
      ], 64)) : o.value.type === "gauge" ? (re(), be(tt, { key: 4 }, [
        w.value ? (re(), ut(Bve, {
          key: 0,
          series: w.value.series?.map((O, E) => ({
            label: O.label,
            value: O.displayValue ?? O.values[O.values.length - 1] ?? 0,
            activeColorOverride: l[E % l.length]
          })),
          title: o.value.title,
          min: o.value.min ?? 0,
          max: o.value.max ?? 100,
          unit: o.value.unit,
          thresholds: o.value.thresholds,
          "threshold-base-color": o.value.thresholdBaseColor,
          "cap-round": o.value.gaugeCapRound,
          "track-width": o.value.gaugeTrackWidth,
          "fill-width": o.value.gaugeFillWidth,
          "track-color": o.value.gaugeTrackColor,
          "sweep-angle": o.value.sweepAngle,
          "value-color": o.value.gaugeValueColor,
          "value-size": o.value.gaugeValueSize,
          "value-visible": o.value.gaugeValueVisible,
          "padding-x": o.value.gaugePaddingX,
          "padding-y": o.value.gaugePaddingY,
          "threshold-display": o.value.gaugeThresholdDisplay,
          "threshold-label-display": o.value.gaugeThresholdLabelDisplay,
          "value-offset-y": o.value.gaugeValueOffsetY,
          orientation: o.value.gaugeOrientation
        }, null, 8, ["series", "title", "min", "max", "unit", "thresholds", "threshold-base-color", "cap-round", "track-width", "fill-width", "track-color", "sweep-angle", "value-color", "value-size", "value-visible", "padding-x", "padding-y", "threshold-display", "threshold-label-display", "value-offset-y", "orientation"])) : (re(), ut(I($), { key: 1 }))
      ], 64)) : o.value.type === "table" ? (re(), be(tt, { key: 5 }, [
        w.value ? (re(), be("div", a0e, [
          v(I(cde), {
            columns: w.value.columns,
            "data-source": w.value.dataSource,
            pagination: { pageSize: o.value.tablePageSize ?? 20 },
            size: "small",
            scroll: { y: "100%" },
            "show-header": o.value.tableShowHeader !== !1
          }, null, 8, ["columns", "data-source", "pagination", "show-header"])
        ])) : (re(), ut(I($), { key: 1 }))
      ], 64)) : o.value.type === "pie" ? (re(), be(tt, { key: 6 }, [
        w.value && w.value.length > 0 ? (re(), ut(Uve, {
          key: 0,
          slices: w.value,
          "pie-type": o.value.pieType,
          "pie-labels": o.value.pieLabels,
          unit: o.value.unit,
          decimals: o.value.decimals,
          "legend-position": o.value.legendPosition,
          "legend-mode": o.value.legendMode,
          "legend-values": o.value.legendValues,
          "tooltip-mode": o.value.tooltipMode,
          "tooltip-sort": o.value.tooltipSort
        }, null, 8, ["slices", "pie-type", "pie-labels", "unit", "decimals", "legend-position", "legend-mode", "legend-values", "tooltip-mode", "tooltip-sort"])) : (re(), ut(I($), { key: 1 }))
      ], 64)) : o.value.type === "histogram" ? (re(), be(tt, { key: 7 }, [
        w.value && w.value.seriesValues?.length > 0 ? (re(), ut(Qve, {
          key: 0,
          "series-values": w.value.seriesValues,
          "series-labels": w.value.seriesLabels,
          "bucket-size": o.value.histBucketSize,
          "bucket-count": o.value.histBucketCount,
          "bucket-offset": o.value.histBucketOffset,
          "combine-series": o.value.histCombineSeries,
          "line-width": o.value.lineWidth,
          "fill-opacity": o.value.fillOpacity,
          unit: o.value.unit
        }, null, 8, ["series-values", "series-labels", "bucket-size", "bucket-count", "bucket-offset", "combine-series", "line-width", "fill-opacity", "unit"])) : (re(), ut(I($), { key: 1 }))
      ], 64)) : et("", !0)
    ])) : (re(), be("div", e0e, se(I(i)("panel.noData")), 1));
  }
}), l0e = { class: "w-full h-full flex flex-col" }, s0e = { class: "flex-1 min-h-0" }, u0e = {
  key: 1,
  class: "flex-center h-full text-secondary text-sm"
}, c0e = /* @__PURE__ */ Oe({
  __name: "ChartPreview",
  setup(t) {
    const { panel: e } = fh(), n = A(() => {
      const i = e.value;
      return [
        i.type,
        JSON.stringify(i.queries),
        i.colorScheme,
        i.statReducer,
        i.unit,
        i.decimals,
        i.lineWidth,
        i.fillOpacity,
        i.stacked,
        i.thresholds?.length,
        i.sweepAngle
      ].join("|");
    });
    return (i, o) => (re(), be("div", l0e, [
      F("div", s0e, [
        I(e).id ? (re(), ut(bS, {
          key: n.value,
          "panel-id": I(e).id,
          "panel-config": I(e)
        }, null, 8, ["panel-id", "panel-config"])) : (re(), be("div", u0e, " No preview available "))
      ])
    ]));
  }
}), d0e = { class: "w-full h-full flex flex-col" }, f0e = { class: "flex-1 min-h-0" }, h0e = /* @__PURE__ */ Oe({
  __name: "PanelChrome",
  setup(t) {
    const e = _l(), { panel: n } = fh(), i = A(() => e.isDark), o = A(() => i.value ? "#303030" : "#e8e8e8"), r = A(() => i.value ? "#d9d9d9" : "#141414"), a = A(() => i.value ? "#666" : "#bbb");
    return (l, s) => (re(), be("div", d0e, [
      F("div", {
        class: "flex items-center px-2.5 py-1.5 flex-shrink-0 gap-1.5 h-32px",
        style: Yt({ borderBottom: `1px solid ${o.value}` })
      }, [
        F("span", {
          class: "text-xs font-medium truncate",
          style: Yt({ color: r.value })
        }, se(I(n).title || "—"), 5),
        I(n).description ? (re(), ut(I(zi), {
          key: 0,
          title: I(n).description,
          placement: "bottom"
        }, {
          default: ye(() => [
            F("span", {
              class: Tt([I(St).info, "text-xs"]),
              style: Yt({ color: a.value })
            }, null, 6)
          ]),
          _: 1
        }, 8, ["title"])) : et("", !0),
        v(p4, {
          links: I(n).links ?? [],
          "icon-color": a.value
        }, null, 8, ["links", "icon-color"])
      ], 4),
      F("div", f0e, [
        v(c0e)
      ])
    ]));
  }
}), O4 = /* @__PURE__ */ Oe({
  __name: "TimeRangePicker",
  setup(t) {
    const { RangePicker: e } = dae, n = Nl(), i = [
      { label: "最近 5 分钟", minutes: 5 },
      { label: "最近 15 分钟", minutes: 15 },
      { label: "最近 30 分钟", minutes: 30 },
      { label: "最近 1 小时", minutes: 60 },
      { label: "最近 3 小时", minutes: 180 },
      { label: "最近 6 小时", minutes: 360 },
      { label: "最近 12 小时", minutes: 720 },
      { label: "最近 24 小时", minutes: 1440 },
      { label: "最近 7 天", minutes: 10080 },
      { label: "最近 30 天", minutes: 43200 },
      { label: "最近 90 天", minutes: 129600 }
    ], o = [
      { label: "关闭", value: 0 },
      { label: "5 秒", value: 5 },
      { label: "10 秒", value: 10 },
      { label: "30 秒", value: 30 },
      { label: "1 分钟", value: 60 },
      { label: "5 分钟", value: 300 }
    ], r = de(!1), a = Math.round((n.timeRange.to - n.timeRange.from) / 6e4), l = i.find((c) => c.minutes === a);
    function s(c) {
      const d = Date.now();
      n.setTimeRange({ from: d - c * 60 * 1e3, to: d }), r.value = !1;
    }
    function u() {
      const c = Date.now(), d = n.timeRange.to - n.timeRange.from;
      n.setTimeRange({ from: c - d, to: c });
    }
    return (c, d) => (re(), ut(I(Pl), null, {
      default: ye(() => [
        v(I(Pl).Compact, null, {
          default: ye(() => [
            r.value ? (re(), ut(I(e), {
              key: 1,
              "show-time": "",
              "allow-clear": !1,
              style: { width: "320px" },
              value: [I(Xi)(I(n).timeRange.from), I(Xi)(I(n).timeRange.to)],
              onChange: d[1] || (d[1] = (f) => {
                f?.[0] && f?.[1] && I(n).setTimeRange({ from: f[0].valueOf(), to: f[1].valueOf() });
              })
            }, null, 8, ["value"])) : (re(), ut(I(Dt), {
              key: 0,
              value: I(l)?.minutes,
              options: i.map((f) => ({ value: f.minutes, label: f.label })),
              "popup-match-select-width": "false",
              "dropdown-match-select-width": !1,
              placeholder: "快速选择",
              onChange: d[0] || (d[0] = (f) => s(f))
            }, null, 8, ["value", "options"])),
            v(I(en), {
              onClick: d[2] || (d[2] = (f) => r.value = !r.value)
            }, {
              default: ye(() => [
                Ve(se(r.value ? "收起" : "自定义"), 1)
              ]),
              _: 1
            })
          ]),
          _: 1
        }),
        v(I(Pl).Compact, null, {
          default: ye(() => [
            v(I(en), { onClick: u }, {
              default: ye(() => [
                F("span", {
                  class: Tt([I(St).refresh, "mr-1"])
                }, null, 2),
                d[4] || (d[4] = Ve(" 刷新 ", -1))
              ]),
              _: 1
            }),
            v(I(Dt), {
              value: I(n).autoRefresh,
              options: o,
              "popup-match-select-width": "false",
              "dropdown-match-select-width": !1,
              onChange: d[3] || (d[3] = (f) => I(n).setAutoRefresh(f))
            }, null, 8, ["value"])
          ]),
          _: 1
        })
      ]),
      _: 1
    }));
  }
}), p0e = { class: "font-semibold mb-3" }, g0e = /* @__PURE__ */ Oe({
  __name: "ConstantOptionsSection",
  props: {
    config: {}
  },
  emits: ["change"],
  setup(t, { emit: e }) {
    const n = t, i = e, { t: o } = On(), r = A(() => n.config.constantValueType ?? "string"), a = A(() => !n.config.constantValue || r.value === "number" && Number.isNaN(Number(n.config.constantValue)) ? "error" : ""), l = A(() => n.config.constantValue ? r.value === "number" && Number.isNaN(Number(n.config.constantValue)) ? o("variable.constant.value.notNumber") : "" : o("variable.constant.value.required"));
    return (s, u) => {
      const c = Rn("a-form-item");
      return re(), be("div", null, [
        F("div", p0e, se(I(o)("variable.constant.title")), 1),
        v(c, {
          label: I(o)("variable.constant.valueType")
        }, {
          default: ye(() => [
            v(I(w5), {
              value: r.value,
              onChange: u[0] || (u[0] = (d) => i("change", { constantValueType: d.target.value }))
            }, {
              default: ye(() => [
                v(I(uo), { value: "string" }, {
                  default: ye(() => [
                    Ve(se(I(o)("variable.constant.valueType.string")), 1)
                  ]),
                  _: 1
                }),
                v(I(uo), { value: "number" }, {
                  default: ye(() => [
                    Ve(se(I(o)("variable.constant.valueType.number")), 1)
                  ]),
                  _: 1
                })
              ]),
              _: 1
            }, 8, ["value"])
          ]),
          _: 1
        }, 8, ["label"]),
        v(c, {
          label: I(o)("variable.constant.value"),
          required: "",
          "validate-status": a.value,
          help: l.value
        }, {
          default: ye(() => [
            v(I(jt), {
              value: t.config.constantValue ?? "",
              placeholder: r.value === "number" ? "42" : I(o)("variable.constant.value"),
              onChange: u[1] || (u[1] = (d) => i("change", { constantValue: d.target.value }))
            }, null, 8, ["value", "placeholder"])
          ]),
          _: 1
        }, 8, ["label", "validate-status", "help"]),
        v(I(fo), {
          checked: t.config.hideFromVariableList ?? !1,
          onChange: u[2] || (u[2] = (d) => i("change", { hideFromVariableList: d.target.checked }))
        }, {
          default: ye(() => [
            Ve(se(I(o)("variable.constant.hideFromList")), 1)
          ]),
          _: 1
        }, 8, ["checked"])
      ]);
    };
  }
}), m0e = { class: "font-semibold mb-3" }, v0e = {
  class: "grid mb-1",
  style: { "grid-template-columns": "1fr 1fr 32px", gap: "4px 8px" }
}, y0e = { class: "text-xs text-secondary" }, b0e = { class: "text-xs text-secondary" }, x0e = { class: "mt-3" }, O0e = { class: "mt-1" }, S0e = { class: "mt-1" }, w0e = { class: "mt-1" }, C0e = /* @__PURE__ */ Oe({
  __name: "CustomOptionsSection",
  props: {
    config: {}
  },
  emits: ["change"],
  setup(t, { emit: e }) {
    const n = t, i = e, { t: o } = On();
    function r(a, l, s) {
      const u = (n.config.customOptions ?? []).map(
        (c, d) => d === a ? { ...c, [l]: s } : c
      );
      i("change", { customOptions: u });
    }
    return (a, l) => {
      const s = Rn("a-form-item");
      return re(), be("div", null, [
        F("div", m0e, se(I(o)("variable.custom.title")), 1),
        F("div", v0e, [
          F("div", y0e, se(I(o)("variable.custom.col.text")), 1),
          F("div", b0e, se(I(o)("variable.custom.col.value")), 1),
          l[6] || (l[6] = F("div", null, null, -1)),
          (re(!0), be(tt, null, Jt(t.config.customOptions ?? [], (u, c) => (re(), be(tt, { key: c }, [
            v(I(jt), {
              size: "small",
              value: u.text,
              placeholder: I(o)("variable.custom.text.placeholder"),
              onChange: (d) => r(c, "text", d.target.value)
            }, null, 8, ["value", "placeholder", "onChange"]),
            v(I(jt), {
              size: "small",
              value: u.value,
              placeholder: I(o)("variable.custom.value.placeholder"),
              onChange: (d) => r(c, "value", d.target.value)
            }, null, 8, ["value", "placeholder", "onChange"]),
            v(I(en), {
              type: "text",
              danger: "",
              size: "small",
              onClick: (d) => i("change", { customOptions: (t.config.customOptions ?? []).filter((f, h) => h !== c) })
            }, {
              default: ye(() => [
                F("span", {
                  class: Tt(I(St).delete)
                }, null, 2)
              ]),
              _: 1
            }, 8, ["onClick"])
          ], 64))), 128))
        ]),
        v(I(en), {
          type: "dashed",
          size: "small",
          onClick: l[0] || (l[0] = (u) => i("change", { customOptions: [...t.config.customOptions ?? [], { text: "", value: "" }] }))
        }, {
          default: ye(() => [
            F("span", {
              class: Tt([I(St).plus, "mr-1"])
            }, null, 2),
            Ve(" " + se(I(o)("variable.custom.addOption")), 1)
          ]),
          _: 1
        }),
        F("div", x0e, [
          v(I(fo), {
            checked: t.config.multi,
            onChange: l[1] || (l[1] = (u) => i("change", { multi: u.target.checked }))
          }, {
            default: ye(() => [
              Ve(se(I(o)("variable.custom.multi")), 1)
            ]),
            _: 1
          }, 8, ["checked"])
        ]),
        F("div", O0e, [
          v(I(fo), {
            checked: t.config.includeAll,
            onChange: l[2] || (l[2] = (u) => i("change", { includeAll: u.target.checked }))
          }, {
            default: ye(() => [
              Ve(se(I(o)("variable.custom.includeAll")), 1)
            ]),
            _: 1
          }, 8, ["checked"])
        ]),
        t.config.includeAll ? (re(), ut(s, {
          key: 0,
          label: I(o)("variable.custom.allValue"),
          class: "mt-3"
        }, {
          default: ye(() => [
            v(I(jt), {
              value: t.config.allValue ?? "",
              placeholder: I(o)("variable.custom.allValue.placeholder"),
              onChange: l[3] || (l[3] = (u) => i("change", { allValue: u.target.value }))
            }, null, 8, ["value", "placeholder"])
          ]),
          _: 1
        }, 8, ["label"])) : et("", !0),
        F("div", S0e, [
          v(I(fo), {
            checked: t.config.allowCustomValue ?? !1,
            onChange: l[4] || (l[4] = (u) => i("change", { allowCustomValue: u.target.checked }))
          }, {
            default: ye(() => [
              Ve(se(I(o)("variable.custom.allowCustomValue")), 1)
            ]),
            _: 1
          }, 8, ["checked"])
        ]),
        F("div", w0e, [
          v(I(fo), {
            checked: t.config.allowClear ?? !1,
            onChange: l[5] || (l[5] = (u) => i("change", { allowClear: u.target.checked }))
          }, {
            default: ye(() => [
              Ve(se(I(o)("variable.custom.allowClear")), 1)
            ]),
            _: 1
          }, 8, ["checked"])
        ])
      ]);
    };
  }
}), $0e = { class: "font-semibold mb-3" }, k0e = /* @__PURE__ */ Oe({
  __name: "DataSourceOptionsSection",
  props: {
    config: {}
  },
  emits: ["change"],
  setup(t, { emit: e }) {
    const n = e, { t: i } = On(), o = [
      { label: "Zabbix", value: "zabbix" },
      { label: "Prometheus", value: "prometheus" },
      { label: "MySQL", value: "mysql" }
    ];
    return (r, a) => {
      const l = Rn("a-form-item");
      return re(), be("div", null, [
        F("div", $0e, se(I(i)("variable.ds.title")), 1),
        v(l, {
          label: I(i)("variable.ds.type")
        }, {
          default: ye(() => [
            v(I(Dt), {
              value: t.config.dsType,
              options: o,
              placeholder: I(i)("variable.ds.type.placeholder"),
              onChange: a[0] || (a[0] = (s) => n("change", { dsType: s }))
            }, null, 8, ["value", "placeholder"])
          ]),
          _: 1
        }, 8, ["label"]),
        v(l, {
          label: I(i)("variable.ds.filterRegex")
        }, {
          default: ye(() => [
            v(I(jt), {
              value: t.config.instanceFilterRegex ?? "",
              placeholder: "/regex/",
              onChange: a[1] || (a[1] = (s) => n("change", { instanceFilterRegex: s.target.value }))
            }, null, 8, ["value"])
          ]),
          _: 1
        }, 8, ["label"]),
        v(l, null, {
          default: ye(() => [
            v(I(fo), {
              checked: t.config.multi,
              onChange: a[2] || (a[2] = (s) => n("change", { multi: s.target.checked }))
            }, {
              default: ye(() => [
                Ve(se(I(i)("variable.ds.multi")), 1)
              ]),
              _: 1
            }, 8, ["checked"])
          ]),
          _: 1
        }),
        v(l, null, {
          default: ye(() => [
            v(I(fo), {
              checked: t.config.includeAll,
              onChange: a[3] || (a[3] = (s) => n("change", { includeAll: s.target.checked }))
            }, {
              default: ye(() => [
                Ve(se(I(i)("variable.ds.includeAll")), 1)
              ]),
              _: 1
            }, 8, ["checked"])
          ]),
          _: 1
        })
      ]);
    };
  }
}), T0e = { class: "font-semibold mb-3" }, P0e = { class: "grid grid-cols-2 gap-x-4" }, E0e = /* @__PURE__ */ Oe({
  __name: "GeneralSection",
  props: {
    config: {}
  },
  emits: ["change"],
  setup(t, { emit: e }) {
    const n = e, { t: i } = On(), o = [
      { label: i("variable.type.custom"), value: "custom" },
      { label: i("variable.type.query"), value: "query" },
      { label: i("variable.type.textbox"), value: "textbox" },
      { label: i("variable.type.datasource"), value: "datasource" },
      { label: i("variable.type.constant"), value: "constant" }
    ], r = [
      { label: i("variable.general.showOn.labelAndValue"), value: "label-and-value" },
      { label: i("variable.general.showOn.value"), value: "value" },
      { label: i("variable.general.showOn.nothing"), value: "nothing" }
    ];
    function a(l) {
      n("change", {
        type: l,
        dsType: void 0,
        instanceFilterRegex: void 0,
        targetDsUid: void 0,
        queryType: void 0,
        extractRegex: void 0,
        sortMode: void 0,
        customOptions: void 0,
        allValue: void 0,
        inputWidth: void 0,
        constantValue: void 0,
        hideFromVariableList: void 0
      });
    }
    return (l, s) => {
      const u = Rn("a-form-item");
      return re(), be("div", null, [
        F("div", T0e, se(I(i)("variable.general.title")), 1),
        F("div", P0e, [
          v(u, {
            label: I(i)("variable.general.type"),
            required: "",
            "validate-status": t.config.type ? "" : "error",
            help: t.config.type ? "" : I(i)("variable.general.type.required")
          }, {
            default: ye(() => [
              v(I(Dt), {
                value: t.config.type,
                options: o,
                style: { width: "100%" },
                onChange: a
              }, null, 8, ["value"])
            ]),
            _: 1
          }, 8, ["label", "validate-status", "help"]),
          v(u, {
            label: I(i)("variable.general.name"),
            required: "",
            "validate-status": t.config.name ? "" : "error",
            help: t.config.name ? "" : I(i)("variable.general.name.required")
          }, {
            default: ye(() => [
              v(I(jt), {
                value: t.config.name,
                placeholder: "variable_name",
                onChange: s[0] || (s[0] = (c) => n("change", { name: c.target.value }))
              }, null, 8, ["value"])
            ]),
            _: 1
          }, 8, ["label", "validate-status", "help"]),
          v(u, {
            label: I(i)("variable.general.label")
          }, {
            default: ye(() => [
              v(I(jt), {
                value: t.config.label,
                placeholder: I(i)("variable.general.label.placeholder"),
                onChange: s[1] || (s[1] = (c) => n("change", { label: c.target.value }))
              }, null, 8, ["value", "placeholder"])
            ]),
            _: 1
          }, 8, ["label"]),
          v(u, {
            label: I(i)("variable.general.showOn")
          }, {
            default: ye(() => [
              v(I(Dt), {
                value: t.config.showOnDashboard ?? "label-and-value",
                options: r,
                style: { width: "100%" },
                onChange: s[2] || (s[2] = (c) => n("change", { showOnDashboard: c }))
              }, null, 8, ["value"])
            ]),
            _: 1
          }, 8, ["label"])
        ]),
        v(u, {
          label: I(i)("variable.general.description")
        }, {
          default: ye(() => [
            v(I(jt), {
              value: t.config.description ?? "",
              placeholder: I(i)("variable.general.description.placeholder"),
              onChange: s[3] || (s[3] = (c) => n("change", { description: c.target.value }))
            }, null, 8, ["value", "placeholder"])
          ]),
          _: 1
        }, 8, ["label"])
      ]);
    };
  }
}), _0e = { class: "font-semibold mb-3" }, I0e = { class: "grid grid-cols-2 gap-x-4" }, M0e = { class: "mb-2" }, A0e = { class: "mb-2" }, R0e = {
  class: "p-2 text-xs text-secondary rounded",
  style: { background: "var(--ant-color-fill-tertiary)", border: "1px solid var(--ant-color-border-secondary)", "min-height": "32px" }
}, D0e = /* @__PURE__ */ Oe({
  __name: "QueryOptionsSection",
  props: {
    config: {}
  },
  emits: ["change"],
  setup(t, { emit: e }) {
    const n = e, { t: i } = On(), o = [
      { label: i("variable.query.queryType.group"), value: "group" },
      { label: i("variable.query.queryType.host"), value: "host" },
      { label: i("variable.query.queryType.item"), value: "item" },
      { label: i("variable.query.queryType.labelValues"), value: "label_values" }
    ], r = [
      { label: i("variable.query.sort.disabled"), value: "disabled" },
      { label: i("variable.query.sort.alphabetical"), value: "alphabetical" },
      { label: i("variable.query.sort.numeric"), value: "numeric" }
    ], a = [
      { label: i("variable.query.refresh.onLoad"), value: "onLoad" },
      { label: i("variable.query.refresh.onTimeChange"), value: "onTimeChange" }
    ];
    return (l, s) => {
      const u = Rn("a-form-item");
      return re(), be("div", null, [
        F("div", _0e, se(I(i)("variable.query.title")), 1),
        v(u, {
          label: I(i)("variable.query.dsUid")
        }, {
          default: ye(() => [
            v(I(jt), {
              size: "small",
              value: t.config.targetDsUid ?? "",
              placeholder: I(i)("variable.query.dsUid.placeholder"),
              onChange: s[0] || (s[0] = (c) => n("change", { targetDsUid: c.target.value }))
            }, null, 8, ["value", "placeholder"])
          ]),
          _: 1
        }, 8, ["label"]),
        v(u, {
          label: I(i)("variable.query.queryType")
        }, {
          default: ye(() => [
            v(I(Dt), {
              size: "small",
              value: t.config.queryType,
              options: o,
              style: { width: "100%" },
              placeholder: I(i)("variable.query.queryType.placeholder"),
              onChange: s[1] || (s[1] = (c) => n("change", { queryType: c }))
            }, null, 8, ["value", "placeholder"])
          ]),
          _: 1
        }, 8, ["label"]),
        v(u, {
          label: I(i)("variable.query.query")
        }, {
          default: ye(() => [
            v(I(jt), {
              size: "small",
              value: t.config.query ?? "",
              placeholder: I(i)("variable.query.query.placeholder"),
              onChange: s[2] || (s[2] = (c) => n("change", { query: c.target.value }))
            }, null, 8, ["value", "placeholder"])
          ]),
          _: 1
        }, 8, ["label"]),
        v(u, {
          label: I(i)("variable.query.regex")
        }, {
          default: ye(() => [
            v(I(jt), {
              size: "small",
              value: t.config.extractRegex ?? "",
              placeholder: I(i)("variable.query.regex.placeholder"),
              onChange: s[3] || (s[3] = (c) => n("change", { extractRegex: c.target.value }))
            }, null, 8, ["value", "placeholder"])
          ]),
          _: 1
        }, 8, ["label"]),
        F("div", I0e, [
          v(u, {
            label: I(i)("variable.query.sort")
          }, {
            default: ye(() => [
              v(I(Dt), {
                size: "small",
                value: t.config.sortMode ?? "disabled",
                options: r,
                style: { width: "100%" },
                onChange: s[4] || (s[4] = (c) => n("change", { sortMode: c }))
              }, null, 8, ["value"])
            ]),
            _: 1
          }, 8, ["label"]),
          v(u, {
            label: I(i)("variable.query.refresh")
          }, {
            default: ye(() => [
              v(I(Dt), {
                size: "small",
                value: t.config.refresh,
                options: a,
                style: { width: "100%" },
                onChange: s[5] || (s[5] = (c) => n("change", { refresh: c }))
              }, null, 8, ["value"])
            ]),
            _: 1
          }, 8, ["label"])
        ]),
        F("div", M0e, [
          v(I(fo), {
            checked: t.config.multi,
            onChange: s[6] || (s[6] = (c) => n("change", { multi: c.target.checked }))
          }, {
            default: ye(() => [
              Ve(se(I(i)("variable.query.multi")), 1)
            ]),
            _: 1
          }, 8, ["checked"])
        ]),
        F("div", A0e, [
          v(I(fo), {
            checked: t.config.includeAll,
            onChange: s[7] || (s[7] = (c) => n("change", { includeAll: c.target.checked }))
          }, {
            default: ye(() => [
              Ve(se(I(i)("variable.query.includeAll")), 1)
            ]),
            _: 1
          }, 8, ["checked"])
        ]),
        v(u, {
          label: I(i)("variable.query.preview")
        }, {
          default: ye(() => [
            F("div", R0e, se(I(i)("variable.query.preview.placeholder")), 1)
          ]),
          _: 1
        }, 8, ["label"])
      ]);
    };
  }
}), N0e = { class: "font-semibold mb-3" }, L0e = /* @__PURE__ */ Oe({
  __name: "TextBoxOptionsSection",
  props: {
    config: {}
  },
  emits: ["change"],
  setup(t, { emit: e }) {
    const n = e, { t: i } = On();
    return (o, r) => {
      const a = Rn("a-form-item");
      return re(), be("div", null, [
        F("div", N0e, se(I(i)("variable.textbox.title")), 1),
        v(a, {
          label: I(i)("variable.textbox.default")
        }, {
          default: ye(() => [
            v(I(jt), {
              value: t.config.defaultValue ?? "",
              placeholder: I(i)("variable.textbox.default.placeholder"),
              onChange: r[0] || (r[0] = (l) => n("change", { defaultValue: l.target.value }))
            }, null, 8, ["value", "placeholder"])
          ]),
          _: 1
        }, 8, ["label"]),
        v(a, {
          label: I(i)("variable.textbox.width")
        }, {
          default: ye(() => [
            v(I(Do), {
              value: t.config.inputWidth,
              min: 60,
              max: 800,
              placeholder: "e.g. 200",
              onChange: r[1] || (r[1] = (l) => n("change", { inputWidth: l ?? void 0 }))
            }, null, 8, ["value"])
          ]),
          _: 1
        }, 8, ["label"])
      ]);
    };
  }
}), z0e = /* @__PURE__ */ Oe({
  __name: "VariableForm",
  props: {
    draft: {}
  },
  emits: ["change"],
  setup(t, { emit: e }) {
    const n = e;
    On();
    function i(o) {
      n("change", o);
    }
    return (o, r) => (re(), ut(I(hu), {
      layout: "vertical",
      class: "px-5 py-4 overflow-y-auto flex-1"
    }, {
      default: ye(() => [
        v(E0e, {
          config: t.draft.config,
          onChange: i
        }, null, 8, ["config"]),
        r[0] || (r[0] = F("div", {
          class: "my-4",
          style: { "border-top": "1px solid var(--ant-color-border-secondary)" }
        }, null, -1)),
        t.draft.config.type === "query" ? (re(), ut(D0e, {
          key: 0,
          config: t.draft.config,
          onChange: i
        }, null, 8, ["config"])) : et("", !0),
        t.draft.config.type === "datasource" ? (re(), ut(k0e, {
          key: 1,
          config: t.draft.config,
          onChange: i
        }, null, 8, ["config"])) : et("", !0),
        t.draft.config.type === "custom" ? (re(), ut(C0e, {
          key: 2,
          config: t.draft.config,
          onChange: i
        }, null, 8, ["config"])) : et("", !0),
        t.draft.config.type === "textbox" ? (re(), ut(L0e, {
          key: 3,
          config: t.draft.config,
          onChange: i
        }, null, 8, ["config"])) : et("", !0),
        t.draft.config.type === "constant" ? (re(), ut(g0e, {
          key: 4,
          config: t.draft.config,
          onChange: i
        }, null, 8, ["config"])) : et("", !0)
      ]),
      _: 1
    }));
  }
}), B0e = {
  class: "w-45 flex flex-col h-full",
  style: { "border-right": "1px solid var(--ant-color-border-secondary)" }
}, F0e = {
  class: "px-3 py-2 text-xs text-secondary",
  style: { "border-bottom": "1px solid var(--ant-color-border-secondary)" }
}, V0e = { class: "flex-1 overflow-y-auto" }, Q0e = ["onClick"], H0e = { key: 0 }, W0e = {
  key: 1,
  class: "text-secondary"
}, j0e = {
  class: "p-2",
  style: { "border-top": "1px solid var(--ant-color-border-secondary)" }
}, q0e = /* @__PURE__ */ Oe({
  __name: "VariableNavList",
  props: {
    drafts: {},
    selectedId: {}
  },
  emits: ["select", "add"],
  setup(t, { emit: e }) {
    const n = e, { t: i } = On();
    return (o, r) => (re(), be("div", B0e, [
      F("div", F0e, se(I(i)("variable.nav.count", { n: t.drafts.length })), 1),
      F("div", V0e, [
        (re(!0), be(tt, null, Jt(t.drafts, (a) => (re(), be("div", {
          key: a.id,
          class: Tt(["px-3 py-2 cursor-pointer text-sm transition-colors", a.id === t.selectedId ? "bg-blue-50 dark:bg-blue-900/30 border-l-3 border-primary" : "border-l-3 border-transparent"]),
          onClick: (l) => n("select", a.id)
        }, [
          a.config.name ? (re(), be("span", H0e, se(a.config.name), 1)) : (re(), be("span", W0e, se(I(i)("variable.nav.unnamed")), 1))
        ], 10, Q0e))), 128))
      ]),
      F("div", j0e, [
        v(I(en), {
          type: "dashed",
          block: "",
          onClick: r[0] || (r[0] = (a) => n("add"))
        }, {
          default: ye(() => [
            F("span", {
              class: Tt([I(St).plus, "mr-1"])
            }, null, 2),
            Ve(" " + se(I(i)("variable.modal.add")), 1)
          ]),
          _: 1
        })
      ])
    ]));
  }
}), Y0e = { class: "flex flex-1 overflow-hidden" }, K0e = { class: "flex-1 overflow-hidden flex flex-col" }, X0e = {
  key: 1,
  class: "flex-1 flex-center text-secondary text-sm"
}, Z0e = { class: "flex items-center justify-between w-full" }, G0e = { class: "flex gap-2" }, U0e = /* @__PURE__ */ Oe({
  __name: "VariableConfigModal",
  props: {
    open: { type: Boolean }
  },
  emits: ["close"],
  setup(t, { emit: e }) {
    const n = t, i = e, o = Hc(), { t: r } = On(), a = de([]), l = de(""), s = () => `new-${Date.now()}-${Math.random().toString(36).slice(2, 6)}`;
    function u(g) {
      return {
        id: "",
        name: g,
        label: "",
        type: "custom",
        hide: !1,
        refresh: "onLoad",
        multi: !1,
        includeAll: !1,
        showOnDashboard: "label-and-value"
      };
    }
    _e(
      () => n.open,
      (g) => {
        if (g) {
          const m = Object.values(o.variables).map((y) => ({
            id: y.config.id,
            isNew: !1,
            config: JSON.parse(JSON.stringify(y.config))
          }));
          a.value = m, l.value = m[0]?.id ?? "";
        }
      }
    );
    const c = A(
      () => a.value.find((g) => g.id === l.value) ?? null
    );
    function d() {
      const m = `variable_${a.value.length + 1}`, y = s(), b = {
        id: y,
        isNew: !0,
        config: u(m)
      };
      a.value = [...a.value, b], l.value = y;
    }
    function f() {
      if (!c.value)
        return;
      const g = a.value.findIndex((m) => m.id === l.value);
      a.value = a.value.filter((m) => m.id !== l.value), a.value.length > 0 ? l.value = a.value[Math.min(g, a.value.length - 1)].id : l.value = "";
    }
    function h(g) {
      c.value && (a.value = a.value.map(
        (m) => m.id === l.value ? { ...m, config: { ...m.config, ...g } } : m
      ));
    }
    function p() {
      const g = o.variables, m = new Set(a.value.map((b) => b.id)), y = new Set(Object.keys(g));
      for (const b of y)
        m.has(b) || o.removeVariable(b);
      for (const b of a.value) {
        const w = { ...b.config, id: b.id };
        w.hide = w.showOnDashboard === "nothing" || !!w.hideFromVariableList, w.customOptions && (w.customValues = w.customOptions.map(($) => $.value).join(",")), b.isNew || !y.has(b.id) ? o.addVariable(w) : o.updateVariable(b.id, w);
      }
      i("close");
    }
    return (g, m) => (re(), ut(J$, {
      mode: "modal",
      open: t.open,
      title: I(r)("variable.modal.title"),
      width: 780,
      "body-height": "480px",
      onClose: m[2] || (m[2] = (y) => i("close"))
    }, {
      footer: ye(() => [
        F("div", Z0e, [
          v(I(en), {
            danger: "",
            disabled: !c.value,
            onClick: f
          }, {
            default: ye(() => [
              Ve(se(I(r)("variable.modal.delete")), 1)
            ]),
            _: 1
          }, 8, ["disabled"]),
          F("div", G0e, [
            v(I(en), {
              onClick: m[1] || (m[1] = (y) => i("close"))
            }, {
              default: ye(() => [
                Ve(se(I(r)("variable.modal.cancel")), 1)
              ]),
              _: 1
            }),
            v(I(en), {
              type: "primary",
              onClick: p
            }, {
              default: ye(() => [
                Ve(se(I(r)("variable.modal.save")), 1)
              ]),
              _: 1
            })
          ])
        ])
      ]),
      default: ye(() => [
        F("div", Y0e, [
          v(q0e, {
            drafts: a.value,
            "selected-id": l.value,
            onSelect: m[0] || (m[0] = (y) => l.value = y),
            onAdd: d
          }, null, 8, ["drafts", "selected-id"]),
          F("div", K0e, [
            c.value ? (re(), ut(z0e, {
              key: 0,
              draft: c.value,
              onChange: h
            }, null, 8, ["draft"])) : (re(), be("div", X0e, se(I(r)("variable.modal.placeholder")), 1))
          ])
        ])
      ]),
      _: 1
    }, 8, ["open", "title"]));
  }
}), J0e = {
  key: 0,
  class: "flex items-center gap-3 flex-wrap",
  style: { padding: "0 8px" }
}, eye = {
  key: 0,
  class: "flex items-center gap-1"
}, tye = {
  key: 1,
  class: "flex items-center gap-1"
}, nye = {
  key: 2,
  class: "flex items-center gap-1"
}, S4 = /* @__PURE__ */ Oe({
  __name: "VariableBar",
  setup(t) {
    const e = Hc(), n = Nl(), i = _l(), { t: o } = On(), r = de(!1), a = A(
      () => Object.entries(e.variables).filter(([, u]) => !u.config.hide).map(([u, c]) => ({ id: u, state: c })).sort((u, c) => u.state.config.name.localeCompare(c.state.config.name))
    ), l = A(() => i.isDark ? "#888" : "#555");
    function s(u, c) {
      console.warn("var", c), e.setValue(u, c);
      const d = e.variables[u];
      if (d) {
        const f = e.getDependents(d.config.name);
        for (const h of f)
          for (const [p, g] of Object.entries(e.variables))
            if (g.config.name === h) {
              e.refreshVariable(p);
              break;
            }
      }
    }
    return (u, c) => a.value.length > 0 || I(n).isEditing ? (re(), be("div", J0e, [
      (re(!0), be(tt, null, Jt(a.value, (d) => (re(), be(tt, {
        key: d.id
      }, [
        d.state.config.type === "textbox" ? (re(), be("div", eye, [
          F("span", {
            class: "text-sm",
            style: Yt({ color: l.value, whiteSpace: "nowrap" })
          }, se(d.state.config.label), 5),
          v(I(jt), {
            size: "small",
            style: { width: "160px" },
            value: Array.isArray(d.state.current) ? d.state.current[0] || "" : d.state.current,
            placeholder: "Enter value...",
            onChange: (f) => s(d.id, f.target.value)
          }, null, 8, ["value", "onChange"])
        ])) : d.state.config.type === "constant" ? (re(), be("div", tye, [
          d.state.config.label ? (re(), be("span", {
            key: 0,
            class: "text-sm",
            style: Yt({ color: l.value, whiteSpace: "nowrap" })
          }, se(d.state.config.label), 5)) : et("", !0),
          v(I(Va), { style: { margin: "0", "font-size": "12px" } }, {
            default: ye(() => [
              Ve(se(d.state.config.constantValue ?? ""), 1)
            ]),
            _: 2
          }, 1024)
        ])) : (re(), be("div", nye, [
          F("span", {
            class: "text-sm",
            style: Yt({ color: l.value, whiteSpace: "nowrap" })
          }, se(d.state.config.label || d.state.config.name) + ": ", 5),
          v(I(Dt), {
            value: d.state.current,
            mode: d.state.config.allowCustomValue ? d.state.config.multi ? "tags" : "SECRET_COMBOBOX_MODE_DO_NOT_USE" : d.state.config.multi ? "multiple" : void 0,
            loading: d.state.loading,
            style: { minWidth: "120px" },
            size: "small",
            "show-search": "",
            "allow-clear": d.state.config.allowClear ?? !1,
            "filter-option": (f, h) => (h?.label ?? "").toLowerCase().includes(f.toLowerCase()),
            placeholder: `Select ${d.state.config.label || d.state.config.name}`,
            onChange: (f) => s(d.id, f)
          }, {
            default: ye(() => [
              (re(!0), be(tt, null, Jt(d.state.options, (f) => (re(), ut(I(FU), {
                key: f.value,
                value: f.value,
                label: f.label === "$__all" ? I(o)("common.all") : f.label
              }, {
                default: ye(() => [
                  Ve(se(f.label === "$__all" ? I(o)("common.all") : f.label), 1)
                ]),
                _: 2
              }, 1032, ["value", "label"]))), 128))
            ]),
            _: 2
          }, 1032, ["value", "mode", "loading", "allow-clear", "filter-option", "placeholder", "onChange"]),
          d.state.error ? (re(), ut(I(Va), {
            key: 0,
            color: "red",
            style: { "font-size": "10px", margin: "0" }
          }, {
            default: ye(() => [
              Ve(se(d.state.error), 1)
            ]),
            _: 2
          }, 1024)) : et("", !0)
        ]))
      ], 64))), 128)),
      I(n).isEditing ? (re(), ut(I(en), {
        key: 0,
        size: "small",
        type: "text",
        class: "ml-auto",
        onClick: c[0] || (c[0] = (d) => r.value = !0)
      }, {
        default: ye(() => [
          F("span", {
            class: Tt([I(St).settings, "text-base"])
          }, null, 2)
        ]),
        _: 1
      })) : et("", !0),
      v(U0e, {
        open: r.value,
        onClose: c[1] || (c[1] = (d) => r.value = !1)
      }, null, 8, ["open"])
    ])) : et("", !0);
  }
}), iye = /* @__PURE__ */ Oe({
  __name: "DatasourceSelect",
  props: {
    value: {}
  },
  emits: ["change"],
  setup(t, { emit: e }) {
    const n = e, { config: i } = Uf(), o = A(() => {
      const l = [{ value: "mock", label: "Mock", type: "mock", uid: "" }], s = i.value.datasourceConfig ?? [];
      return s.filter((u) => u.type === "zabbix").forEach((u, c) => {
        const d = u.uid || String(c);
        l.push({ value: `zabbix:${d}`, label: `${u.name}`, type: "zabbix", uid: d });
      }), s.filter((u) => u.type === "argus").forEach((u, c) => {
        const d = u.uid || String(c);
        l.push({ value: `argus:${d}`, label: `${u.name}`, type: "argus", uid: d });
      }), l;
    }), r = A(
      () => o.value.map((l) => ({ value: l.value, label: l.label }))
    );
    function a(l) {
      const s = o.value.find((u) => u.value === l);
      s && n("change", s);
    }
    return (l, s) => (re(), ut(I(Dt), {
      size: "small",
      style: { "min-width": "140px" },
      value: t.value,
      options: r.value,
      onChange: a
    }, null, 8, ["value", "options"]));
  }
}), oye = {
  key: 0,
  class: ""
}, rye = {
  key: 1,
  class: "pt-2 px-2 text-xs text-secondary"
}, aye = /* @__PURE__ */ Oe({
  __name: "QueryEditorRow",
  props: {
    entry: {},
    index: {},
    isChart: { type: Boolean },
    canDelete: { type: Boolean }
  },
  emits: ["update", "remove"],
  setup(t, { emit: e }) {
    const n = t, i = e, o = A(() => "ABCDEFGHIJKLMNOPQRSTUVWXYZ"[n.index] ?? String(n.index + 1)), r = A(() => Dv(n.entry.dataSource.type)), a = A(() => r.value?.QueryEditor ?? null), l = A(() => {
      const c = n.entry.dataSource;
      if (c.type === "mock")
        return "mock";
      const d = "datasourceId" in c ? c.datasourceId : "";
      return d ? `${c.type}:${d}` : c.type;
    });
    function s(c) {
      const d = Dv(c.type);
      if (!d?.defaultQuery)
        return;
      const f = { ...d.defaultQuery(), ...c.uid ? { datasourceId: c.uid } : {} };
      i("update", { dataSource: f });
    }
    function u(c) {
      i("update", { dataSource: c });
    }
    return (c, d) => (re(), ut(I(Tu), {
      size: "small",
      collapsible: "icon",
      bordered: !0,
      "default-active-key": [t.entry.id]
    }, {
      default: ye(() => [
        (re(), ut(I(Tu).Panel, {
          key: t.entry.id
        }, {
          header: ye(() => [
            F("div", {
              class: "flex items-center gap-2",
              onClick: d[3] || (d[3] = la(() => {
              }, ["stop"]))
            }, [
              v(I(Va), {
                color: "blue",
                style: { "font-size": "12px", "font-weight": "600", margin: "0", "min-width": "24px", "text-align": "center", "line-height": "20px" }
              }, {
                default: ye(() => [
                  Ve(se(o.value), 1)
                ]),
                _: 1
              }),
              v(I(ts), {
                size: "small",
                checked: t.entry.enabled,
                onChange: d[0] || (d[0] = (f) => i("update", { enabled: f })),
                onClick: d[1] || (d[1] = la(() => {
                }, ["stop"]))
              }, null, 8, ["checked"]),
              d[5] || (d[5] = F("div", { class: "flex-1" }, null, -1)),
              d[6] || (d[6] = F("span", { style: { "font-size": "11px", color: "var(--ant-color-text-secondary)" } }, "数据源", -1)),
              v(iye, {
                value: l.value,
                onClick: d[2] || (d[2] = la(() => {
                }, ["stop"])),
                onChange: s
              }, null, 8, ["value"])
            ])
          ]),
          extra: ye(() => [
            t.canDelete ? (re(), ut(I(en), {
              key: 0,
              type: "text",
              danger: "",
              size: "small",
              onClick: d[4] || (d[4] = la((f) => i("remove"), ["stop"]))
            }, {
              default: ye(() => [
                F("span", {
                  class: Tt(I(St).delete)
                }, null, 2)
              ]),
              _: 1
            })) : et("", !0)
          ]),
          default: ye(() => [
            t.entry.enabled && a.value ? (re(), be("div", oye, [
              (re(), ut(TA(a.value), {
                query: t.entry.dataSource,
                "datasource-id": "datasourceId" in t.entry.dataSource ? t.entry.dataSource.datasourceId : "",
                "is-chart": t.isChart,
                onChange: u
              }, null, 40, ["query", "datasource-id", "is-chart"]))
            ])) : t.entry.enabled && !a.value ? (re(), be("div", rye, " No query editor available for datasource type: " + se(t.entry.dataSource.type), 1)) : et("", !0)
          ]),
          _: 1
        }))
      ]),
      _: 1
    }, 8, ["default-active-key"]));
  }
}), lye = {
  class: "px-4 py-3 flex flex-col gap-2",
  style: { "min-width": "300px" }
}, sye = { class: "flex items-center gap-2" }, uye = {
  class: "text-xs text-secondary flex-shrink-0",
  style: { width: "120px" }
}, cye = { class: "flex items-center gap-2" }, dye = {
  class: "text-xs text-secondary flex-shrink-0",
  style: { width: "120px" }
}, fye = { class: "flex items-center gap-2" }, hye = {
  class: "text-xs text-secondary flex-shrink-0",
  style: { width: "120px" }
}, pye = {
  class: "text-xs",
  style: { color: "var(--ant-color-text-quaternary)" }
}, gye = { class: "flex items-center gap-2" }, mye = {
  class: "text-xs text-secondary flex-shrink-0",
  style: { width: "120px" }
}, vye = { class: "flex items-center gap-2" }, yye = {
  class: "text-xs text-secondary flex-shrink-0",
  style: { width: "120px" }
}, zI = 1e3, bye = /* @__PURE__ */ Oe({
  __name: "QueryOptionsPanel",
  setup(t) {
    const { t: e } = On(), { panel: n, onChange: i } = fh(), o = Nl();
    function r(u) {
      return u >= 36e5 ? `${Math.round(u / 36e5)}h` : u >= 6e4 ? `${Math.round(u / 6e4)}m` : u >= 1e3 ? `${Math.round(u / 1e3)}s` : `${u}ms`;
    }
    function a(u) {
      const c = u.trim().match(/^(\d+(?:\.\d+)?)(ms|[smh])?$/i);
      if (!c)
        return;
      const d = Number.parseFloat(c[1]), f = (c[2] ?? "s").toLowerCase();
      return f === "ms" ? d : f === "s" ? d * 1e3 : f === "m" ? d * 6e4 : d * 36e5;
    }
    const l = A(() => {
      const u = n.value.queryOptions?.maxDataPoints ?? zI, c = o.timeRange, d = c.to - c.from;
      return Math.max(Math.ceil(d / u), 1e3);
    }), s = A(() => {
      const u = n.value.queryOptions?.minIntervalMs;
      return u != null ? r(u) : "";
    });
    return (u, c) => (re(), be("div", lye, [
      F("div", sye, [
        F("span", uye, [
          v(I(zi), {
            title: I(e)("qb.queryOptions.maxDataPoints")
          }, {
            default: ye(() => [
              F("span", {
                class: Tt([I(St).info, "mr-1 opacity-50 text-xs"])
              }, null, 2)
            ]),
            _: 1
          }, 8, ["title"]),
          Ve(" " + se(I(e)("qb.queryOptions.maxDataPoints")), 1)
        ]),
        v(I(Do), {
          size: "small",
          style: { width: "100px" },
          min: 1,
          value: I(n).queryOptions?.maxDataPoints,
          placeholder: String(zI),
          onChange: c[0] || (c[0] = (d) => I(i)({ queryOptions: { ...I(n).queryOptions, maxDataPoints: d ?? void 0 } }))
        }, null, 8, ["value", "placeholder"])
      ]),
      F("div", cye, [
        F("span", dye, [
          v(I(zi), {
            title: I(e)("qb.queryOptions.minInterval")
          }, {
            default: ye(() => [
              F("span", {
                class: Tt([I(St).info, "mr-1 opacity-50 text-xs"])
              }, null, 2)
            ]),
            _: 1
          }, 8, ["title"]),
          Ve(" " + se(I(e)("qb.queryOptions.minInterval")), 1)
        ]),
        v(I(jt), {
          size: "small",
          style: { width: "100px" },
          value: s.value,
          placeholder: I(e)("qb.queryOptions.minIntervalPlaceholder"),
          onChange: c[1] || (c[1] = (d) => {
            const f = d.target.value.trim();
            if (!f) {
              I(i)({ queryOptions: { ...I(n).queryOptions, minIntervalMs: void 0 } });
              return;
            }
            const h = a(f);
            h !== void 0 && I(i)({ queryOptions: { ...I(n).queryOptions, minIntervalMs: h } });
          })
        }, null, 8, ["value", "placeholder"])
      ]),
      F("div", fye, [
        F("span", hye, [
          v(I(zi), {
            title: I(e)("qb.queryOptions.interval")
          }, {
            default: ye(() => [
              F("span", {
                class: Tt([I(St).info, "mr-1 opacity-50 text-xs"])
              }, null, 2)
            ]),
            _: 1
          }, 8, ["title"]),
          Ve(" " + se(I(e)("qb.queryOptions.interval")), 1)
        ]),
        v(I(jt), {
          size: "small",
          style: { width: "100px" },
          value: r(l.value),
          readonly: ""
        }, null, 8, ["value"]),
        F("span", pye, " = " + se(I(e)("qb.queryOptions.intervalHint")), 1)
      ]),
      F("div", gye, [
        F("span", mye, [
          v(I(zi), {
            title: I(e)("qb.queryOptions.relativeTime")
          }, {
            default: ye(() => [
              F("span", {
                class: Tt([I(St).info, "mr-1 opacity-50 text-xs"])
              }, null, 2)
            ]),
            _: 1
          }, 8, ["title"]),
          Ve(" " + se(I(e)("qb.queryOptions.relativeTime")), 1)
        ]),
        v(I(jt), {
          size: "small",
          style: { width: "100px" },
          placeholder: "1h",
          value: I(n).queryOptions?.relativeTime ?? "",
          onChange: c[2] || (c[2] = (d) => I(i)({ queryOptions: { ...I(n).queryOptions, relativeTime: d.target.value || void 0 } }))
        }, null, 8, ["value"])
      ]),
      F("div", vye, [
        F("span", yye, [
          v(I(zi), {
            title: I(e)("qb.queryOptions.timeShift")
          }, {
            default: ye(() => [
              F("span", {
                class: Tt([I(St).info, "mr-1 opacity-50 text-xs"])
              }, null, 2)
            ]),
            _: 1
          }, 8, ["title"]),
          Ve(" " + se(I(e)("qb.queryOptions.timeShift")), 1)
        ]),
        v(I(jt), {
          size: "small",
          style: { width: "100px" },
          placeholder: "1h",
          value: I(n).queryOptions?.timeShift ?? "",
          onChange: c[3] || (c[3] = (d) => I(i)({ queryOptions: { ...I(n).queryOptions, timeShift: d.target.value || void 0 } }))
        }, null, 8, ["value"])
      ])
    ]));
  }
}), xye = { class: "flex flex-col h-full" }, Oye = {
  class: "flex items-center gap-2 px-3 py-1.5 flex-shrink-0 flex-wrap",
  style: { "border-bottom": "1px solid var(--ant-color-border-secondary)" }
}, Sye = { class: "flex-1 overflow-y-auto px-3 py-2 flex flex-col gap-2" }, wye = {
  key: 0,
  class: "text-center text-secondary text-sm py-8"
}, Cye = /* @__PURE__ */ Oe({
  __name: "QueryEditorPane",
  setup(t) {
    const { t: e } = On(), { panel: n, onChange: i } = fh(), o = A(() => ["timeseries", "bar", "histogram"].includes(n.value.type)), r = A(() => n.value.queries ?? []), a = de(!1), l = de("mock");
    function s(d, f) {
      i({ queries: r.value.map((h, p) => p === d ? { ...h, ...f } : h) });
    }
    function u(d) {
      i({ queries: r.value.filter((f, h) => h !== d) });
    }
    function c() {
      if (r.value.length >= 26)
        return;
      const d = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"[r.value.length] ?? String(r.value.length + 1), [f, h = ""] = l.value.split(":"), p = Dv(f);
      if (!p?.defaultQuery)
        return;
      const g = {
        ...p.defaultQuery(),
        ...h ? { datasourceId: h } : {},
        // Non-chart types: each query = 1 series; seriesCount controlled by query count
        ...!o.value && "seriesCount" in p.defaultQuery() ? { seriesCount: 1 } : {}
      };
      i({
        queries: [...r.value, { id: d, enabled: !0, dataSource: g }]
      });
    }
    return (d, f) => (re(), be("div", xye, [
      F("div", Oye, [
        v(S4),
        f[1] || (f[1] = F("div", { class: "flex-1" }, null, -1)),
        v(O4),
        v(I(mae), {
          type: "vertical",
          style: { margin: "0" }
        }),
        v(I(Pl).Compact, null, {
          default: ye(() => [
            v(I(en), {
              type: "primary",
              disabled: r.value.length >= 26,
              onClick: c
            }, {
              default: ye(() => [
                F("span", {
                  class: Tt([I(St).plus, "mr-1"])
                }, null, 2),
                Ve(" " + se(I(e)("qb.addQuery")), 1)
              ]),
              _: 1
            }, 8, ["disabled"]),
            v(I(P3), {
              open: a.value,
              "onUpdate:open": f[0] || (f[0] = (h) => a.value = h),
              trigger: "click",
              placement: "bottomRight",
              "overlay-inner-style": { padding: 0, minWidth: "320px" }
            }, {
              content: ye(() => [
                v(bye)
              ]),
              default: ye(() => [
                v(I(en), { class: "text-12px cursor-pointer hover:op-90 active:op-80 underline" }, {
                  default: ye(() => [
                    Ve(se(I(e)("qb.queryOptions")) + " ", 1),
                    F("span", {
                      class: Tt([I(St).chevronDown, ""])
                    }, null, 2)
                  ]),
                  _: 1
                })
              ]),
              _: 1
            }, 8, ["open"])
          ]),
          _: 1
        })
      ]),
      F("div", Sye, [
        (re(!0), be(tt, null, Jt(r.value, (h, p) => (re(), ut(aye, {
          key: h.id,
          entry: h,
          index: p,
          "is-chart": o.value,
          "can-delete": r.value.length > 1,
          onUpdate: (g) => s(p, g),
          onRemove: () => u(p)
        }, null, 8, ["entry", "index", "is-chart", "can-delete", "onUpdate", "onRemove"]))), 128)),
        r.value.length === 0 ? (re(), be("div", wye, ' No queries. Click "' + se(I(e)("qb.addQuery")) + '" to start. ', 1)) : et("", !0)
      ])
    ]));
  }
}), $ye = { class: "w-full h-full" }, kye = { class: "w-full h-full" }, Tye = /* @__PURE__ */ Oe({
  __name: "PanelEditorLayout",
  setup(t) {
    const n = _l().isDark ? "#303030" : "#e8e8e8";
    return (i, o) => (re(), ut(I(RI), { style: { height: "100%" } }, {
      default: ye(() => [
        v(I(Pm), { "min-size": 200 }, {
          default: ye(() => [
            v(I(RI), {
              vertical: "",
              "default-sizes": [100, 200]
            }, {
              default: ye(() => [
                v(I(Pm), { "min-size": 100 }, {
                  default: ye(() => [
                    F("div", $ye, [
                      v(h0e)
                    ])
                  ]),
                  _: 1
                }),
                v(I(Pm), { "min-size": 60 }, {
                  default: ye(() => [
                    F("div", kye, [
                      v(Cye)
                    ])
                  ]),
                  _: 1
                })
              ]),
              _: 1
            })
          ]),
          _: 1
        }),
        v(I(Pm), {
          "preferred-size": "35%",
          "min-size": 200
        }, {
          default: ye(() => [
            F("div", {
              class: "w-full h-full overflow-y-auto",
              style: Yt({ borderLeft: `1px solid ${I(n)}` })
            }, [
              v(Hme)
            ], 4)
          ]),
          _: 1
        })
      ]),
      _: 1
    }));
  }
}), Pye = { class: "font-medium text-sm" }, Eye = { class: "flex justify-end gap-2 py-1" }, _ye = /* @__PURE__ */ Oe({
  __name: "PanelEditorModal",
  setup(t) {
    const e = Nl(), { t: n } = On(), i = de(null), o = A(() => {
      const p = e.editingPanelId;
      return p ? e.panels[p] : null;
    }), r = A(() => i.value ?? o.value), { response: a } = r4(
      () => r.value?.queries ?? [],
      () => e.timeRange,
      800
    ), l = A(() => {
      const p = a.value?.data?.[0];
      return p ? p.fields.filter((g) => g.type === "number").map((g) => g.name) : [];
    }), s = A(() => {
      const p = a.value?.data?.[0];
      return p ? p.fields.map((g) => g.config?.displayNameFromDS ?? g.name) : [];
    });
    function u(p) {
      r.value && (i.value = { ...r.value, ...p });
    }
    function c() {
      i.value && e.editingPanelId && e.updatePanel(e.editingPanelId, i.value), i.value = null, e.setEditingPanel(null);
    }
    function d() {
      i.value = null, e.setEditingPanel(null);
    }
    _e(() => e.editingPanelId, (p) => {
      p || (i.value = null);
    });
    const f = A(() => !!e.editingPanelId && !!o.value), h = de(!1);
    return _e(f, (p) => {
      p && !h.value && setTimeout(() => {
        h.value = !0;
      }, 0);
    }), _fe({
      panel: A(() => r.value),
      onChange: u,
      previewData: a,
      numericFieldNames: l,
      allFieldNames: s
    }), (p, g) => (re(), ut(J$, {
      mode: "drawer",
      open: f.value,
      width: "71vw",
      mask: !0,
      "destroy-on-close": !1,
      onClose: d
    }, {
      title: ye(() => [
        F("span", Pye, "Edit: " + se(r.value?.title ?? ""), 1)
      ]),
      footer: ye(() => [
        F("div", Eye, [
          v(I(en), { onClick: d }, {
            default: ye(() => [
              Ve(se(I(n)("dashboard.cancel")), 1)
            ]),
            _: 1
          }),
          v(I(en), {
            type: "primary",
            onClick: c
          }, {
            default: ye(() => [
              Ve(se(I(n)("dashboard.save")), 1)
            ]),
            _: 1
          })
        ])
      ]),
      default: ye(() => [
        r.value && h.value ? (re(), ut(Tye, { key: 0 })) : et("", !0)
      ]),
      _: 1
    }, 8, ["open"]));
  }
}), Iye = {
  key: 0,
  class: "panel-container w-full h-full flex flex-col rounded overflow-hidden bg-white dark:bg-[#1f1f1f] border border-[#e8e8e8] dark:border-[#303030]"
}, Mye = { class: "flex items-center gap-2 min-w-0 lh-1 flex-1 text-[#666] dark:text-[#666]" }, Aye = {
  key: 0,
  class: "drag-handle flex-shrink-0 cursor-grab"
}, Rye = { class: "text-sm truncate text-[#141414] dark:text-[#d9d9d9]" }, Dye = { class: "panel-actions flex items-center gap-10px lh-1 flex-shrink-0 text-[#444] dark:text-[#666]" }, Nye = { class: "panel-content flex-1 overflow-hidden" }, Lye = { class: "w-full h-full flex flex-col rounded-lg overflow-hidden bg-white dark:bg-[#1f1f1f]" }, zye = { class: "panel-content flex-1 overflow-hidden" }, Bye = /* @__PURE__ */ Oe({
  __name: "PanelContainer",
  props: {
    panelId: {},
    menuMode: { default: "inline" }
  },
  setup(t) {
    const e = t, n = Nl(), i = _l(), { t: o } = On(), r = de(!1), a = de(!1), l = A(() => n.panels[e.panelId]), s = A(() => i.isDark), u = A(() => s.value ? "#666" : "#bbb"), c = A(() => {
      const p = (g) => lo("span", { class: g });
      return n.isEditing ? [
        { key: "edit", label: o("panel.menu.edit"), icon: () => p(St.edit) },
        { key: "clone", label: o("panel.menu.clone"), icon: () => p(St.clone) },
        { key: "fullscreen", label: o("panel.menu.fullscreen"), icon: () => p(St.fullscreen) },
        { type: "divider" },
        { key: "remove", label: o("panel.menu.remove"), icon: () => p(St.delete), danger: !0 }
      ] : [
        { key: "fullscreen", label: o("panel.menu.fullscreen"), icon: () => p(St.fullscreen) }
      ];
    });
    function d(p) {
      switch (p) {
        case "edit":
          n.setEditingPanel(e.panelId);
          break;
        case "clone":
          n.clonePanel(e.panelId);
          break;
        case "remove":
          No.confirm({
            title: o("panel.remove.title", { title: l.value?.title ?? "" }),
            content: o("panel.remove.content"),
            okText: o("panel.remove.ok"),
            cancelText: o("panel.remove.cancel"),
            maskStyle: { background: "rgba(0, 0, 0, 0.2)" },
            zIndex: 2001,
            okButtonProps: { danger: !0 },
            onOk: () => n.removePanel(e.panelId)
          });
          break;
        case "fullscreen":
          r.value = !0;
          break;
      }
    }
    function f(p) {
      a.value = !1, d(String(p.key));
    }
    function h(p) {
      p.stopPropagation(), n.refreshPanel(e.panelId);
    }
    return (p, g) => (re(), be(tt, null, [
      l.value && !r.value ? (re(), be("div", Iye, [
        F("div", {
          class: "panel-header flex items-center px-3 py-2 flex-shrink-0 border-b border-[#e8e8e8] dark:border-[#303030]",
          onDblclick: g[6] || (g[6] = (m) => I(n).isEditing && I(n).setEditingPanel(e.panelId))
        }, [
          F("div", Mye, [
            I(n).isEditing ? (re(), be("span", Aye, [
              F("span", {
                class: Tt(I(St).dragVertical)
              }, null, 2)
            ])) : et("", !0),
            F("span", Rye, se(l.value.title), 1),
            l.value.description ? (re(), ut(I(zi), {
              key: 1,
              title: l.value.description,
              placement: "bottom"
            }, {
              default: ye(() => [
                F("span", {
                  class: Tt([I(St).info, "flex-shrink-0"])
                }, null, 2)
              ]),
              _: 1
            }, 8, ["title"])) : et("", !0),
            v(p4, {
              links: l.value.links ?? [],
              "icon-color": u.value
            }, null, 8, ["links", "icon-color"])
          ]),
          F("div", Dye, [
            v(I(zi), {
              title: I(o)("panel.menu.refresh")
            }, {
              default: ye(() => [
                F("span", {
                  class: Tt([I(St).refresh, "panel-refresh-btn cursor-pointer"]),
                  onMousedown: g[0] || (g[0] = la(() => {
                  }, ["stop"])),
                  onClick: h
                }, null, 34)
              ]),
              _: 1
            }, 8, ["title"]),
            e.menuMode === "inline" ? (re(), be(tt, { key: 0 }, [
              I(n).isEditing ? (re(), ut(I(zi), {
                key: 0,
                title: I(o)("panel.menu.edit")
              }, {
                default: ye(() => [
                  F("span", {
                    class: Tt([I(St).edit, "cursor-pointer"]),
                    onClick: g[1] || (g[1] = (m) => d("edit"))
                  }, null, 2)
                ]),
                _: 1
              }, 8, ["title"])) : et("", !0),
              I(n).isEditing ? (re(), ut(I(zi), {
                key: 1,
                title: I(o)("panel.menu.clone")
              }, {
                default: ye(() => [
                  F("span", {
                    class: Tt([I(St).clone, "cursor-pointer"]),
                    onClick: g[2] || (g[2] = (m) => d("clone"))
                  }, null, 2)
                ]),
                _: 1
              }, 8, ["title"])) : et("", !0),
              I(n).isEditing ? (re(), ut(I(zi), {
                key: 2,
                title: I(o)("panel.menu.remove")
              }, {
                default: ye(() => [
                  F("span", {
                    class: Tt([I(St).delete, "cursor-pointer text-red-500"]),
                    onClick: g[3] || (g[3] = (m) => d("remove"))
                  }, null, 2)
                ]),
                _: 1
              }, 8, ["title"])) : et("", !0)
            ], 64)) : (re(), ut(I(Nr), {
              key: 1,
              open: a.value,
              "onUpdate:open": g[5] || (g[5] = (m) => a.value = m),
              trigger: "click"
            }, {
              overlay: ye(() => [
                v(I(Bi), {
                  items: c.value,
                  onClick: f
                }, null, 8, ["items"])
              ]),
              default: ye(() => [
                F("span", {
                  class: "cursor-pointer p-[2px_4px]",
                  onClick: g[4] || (g[4] = la(() => {
                  }, ["prevent"]))
                }, [
                  F("span", {
                    class: Tt(I(St).dotsVertical)
                  }, null, 2)
                ])
              ]),
              _: 1
            }, 8, ["open"]))
          ])
        ], 32),
        F("div", Nye, [
          _o(p.$slots, "default", {}, void 0, !0)
        ])
      ])) : et("", !0),
      r.value ? (re(), ut(I(No), {
        key: 1,
        open: !0,
        title: l.value?.title,
        footer: null,
        width: "92vw",
        "body-style": { height: "82vh", padding: 0 },
        closable: !1,
        onCancel: g[7] || (g[7] = (m) => r.value = !1)
      }, {
        default: ye(() => [
          F("div", Lye, [
            F("div", zye, [
              _o(p.$slots, "default", {}, void 0, !0)
            ])
          ])
        ]),
        _: 3
      }, 8, ["title"])) : et("", !0)
    ], 64));
  }
}), BI = /* @__PURE__ */ Co(Bye, [["__scopeId", "data-v-548b9131"]]), Fye = { class: "font-medium text-sm" }, Vye = { class: "text-xs text-secondary mt-1" }, Qye = /* @__PURE__ */ Oe({
  __name: "AddPanelModal",
  setup(t) {
    const e = Nl(), { t: n } = On(), i = [
      { type: "timeseries", icon: St.chartLine, descKey: "panel.type.desc.timeseries" },
      { type: "bar", icon: St.chartBar, descKey: "panel.type.desc.bar" },
      { type: "histogram", icon: St.chartArea, descKey: "panel.type.desc.histogram" },
      { type: "stat", icon: St.stat, descKey: "panel.type.desc.stat" },
      { type: "gauge", icon: St.gauge, descKey: "panel.type.desc.gauge" },
      { type: "table", icon: St.table, descKey: "panel.type.desc.table" },
      { type: "pie", icon: St.chartPie, descKey: "panel.type.desc.pie" }
    ];
    function o(r) {
      e.addPanel(r);
    }
    return (r, a) => (re(), ut(J$, {
      open: I(e).addPanelModalOpen,
      title: I(n)("dashboard.addPanel"),
      footer: !1,
      onClose: a[0] || (a[0] = (l) => I(e).addPanelModalOpen = !1)
    }, {
      default: ye(() => [
        v(I(Sse), {
          gutter: [16, 16],
          class: "mt-4 px-4 pb-4"
        }, {
          default: ye(() => [
            (re(), be(tt, null, Jt(i, (l) => v(I(Yoe), {
              key: l.type,
              span: 8
            }, {
              default: ye(() => [
                v(I(df), {
                  hoverable: "",
                  class: "text-center cursor-pointer",
                  onClick: (s) => o(l.type)
                }, {
                  default: ye(() => [
                    F("div", {
                      class: Tt(["text-2xl mb-2 text-blue", l.icon])
                    }, null, 2),
                    F("div", Fye, se(I(n)(`config.type.${l.type}`)), 1),
                    F("div", Vye, se(I(n)(l.descKey)), 1)
                  ]),
                  _: 2
                }, 1032, ["onClick"])
              ]),
              _: 2
            }, 1024)), 64))
          ]),
          _: 1
        })
      ]),
      _: 1
    }, 8, ["open", "title"]));
  }
}), Hye = { style: { display: "flex", "align-items": "center", "flex-wrap": "wrap", gap: "8px", padding: "0 4px" } }, Wye = { class: "" }, jye = { style: { margin: "0" } }, qye = { style: { margin: "0" } }, Yye = /* @__PURE__ */ Oe({
  __name: "DashboardHeader",
  setup(t) {
    const e = Nl(), { t: n } = On(), { config: i } = Uf(), { message: o } = fp.useApp(), r = de(!1), a = de(!1), l = de(null);
    function s() {
      e.confirmSave(i.value.onSave);
    }
    function u() {
      e.isDirty ? r.value = !0 : e.discardChanges();
    }
    function c() {
      r.value = !1, e.discardChanges();
    }
    function d() {
      const b = e.exportJSON(), w = new Blob([b], { type: "application/json" }), $ = URL.createObjectURL(w), C = document.createElement("a");
      C.href = $, C.download = "dashboard.json", C.click(), URL.revokeObjectURL($), o.success(n("dashboard.exportSuccess"));
    }
    function f() {
      l.value?.click();
    }
    function h(b) {
      const w = b.target.files?.[0];
      w && (w.text().then(($) => {
        e.importJSON($) ? o.success(n("dashboard.importSuccess")) : o.error(n("dashboard.importError"));
      }), b.target.value = "");
    }
    function p(b) {
      e.importJSON(b) ? o.success(n("dashboard.importSuccess")) : o.error(n("dashboard.importError"));
    }
    const g = A(() => {
      const b = hH(), w = (i.value.presets ?? []).map(($) => ({ label: $.label, value: $.config }));
      return [{ label: "内置模板", value: b }, ...w];
    }), m = A(() => [
      { key: "export", label: n("dashboard.export"), icon: St.export },
      { key: "import", label: n("dashboard.import"), icon: St.import },
      { type: "divider" },
      { key: "clear", label: n("dashboard.clearPanels"), icon: St.delete, danger: !0 }
    ]);
    function y(b) {
      b === "export" ? d() : b === "import" ? f() : b === "clear" && (a.value = !0);
    }
    return (b, w) => (re(), be("div", Hye, [
      I(e).isEditing ? (re(), be(tt, { key: 0 }, [
        v(I(Pl).Compact, null, {
          default: ye(() => [
            v(I(en), {
              onClick: w[0] || (w[0] = ($) => I(e).addPanelModalOpen = !0)
            }, {
              default: ye(() => [
                F("span", {
                  class: Tt([I(St).plus, "mr-1"])
                }, null, 2),
                Ve(" " + se(I(n)("dashboard.addPanel")), 1)
              ]),
              _: 1
            }),
            v(I(Dt), {
              placeholder: "预设",
              "popup-match-select-width": !1,
              options: g.value,
              "dropdown-match-select-width": !1,
              style: { "min-width": "80px" },
              onSelect: w[1] || (w[1] = ($) => p($))
            }, null, 8, ["options"]),
            F("input", {
              ref_key: "fileInputRef",
              ref: l,
              type: "file",
              accept: ".json",
              style: { display: "none" },
              onChange: h
            }, null, 544),
            v(I(Nr), { trigger: ["click"] }, {
              overlay: ye(() => [
                v(I(Bi), {
                  onClick: w[2] || (w[2] = ({ key: $ }) => y($))
                }, {
                  default: ye(() => [
                    (re(!0), be(tt, null, Jt(m.value, ($) => (re(), be(tt, {
                      key: $.key ?? $.type
                    }, [
                      $.type === "divider" ? (re(), ut(I(Bi).Divider, { key: 0 })) : (re(), ut(I(Bi).Item, {
                        key: $.key,
                        danger: $.danger
                      }, {
                        default: ye(() => [
                          F("span", {
                            class: Tt([$.icon, "mr-1"])
                          }, null, 2),
                          Ve(se($.label), 1)
                        ]),
                        _: 2
                      }, 1032, ["danger"]))
                    ], 64))), 128))
                  ]),
                  _: 1
                })
              ]),
              default: ye(() => [
                v(I(en), null, {
                  default: ye(() => [
                    F("span", {
                      class: Tt(I(St).dotsVertical)
                    }, null, 2)
                  ]),
                  _: 1
                })
              ]),
              _: 1
            })
          ]),
          _: 1
        }),
        v(I(en), {
          type: "primary",
          ghost: "",
          onClick: s
        }, {
          default: ye(() => [
            F("span", {
              class: Tt([I(St).save, "mr-1"])
            }, null, 2),
            Ve(" " + se(I(n)("dashboard.save")), 1)
          ]),
          _: 1
        }),
        v(I(en), {
          danger: I(e).isDirty,
          onClick: u
        }, {
          default: ye(() => [
            F("span", {
              class: Tt([I(St).cancel, "mr-1"])
            }, null, 2),
            Ve(" " + se(I(n)("dashboard.cancel")), 1)
          ]),
          _: 1
        }, 8, ["danger"])
      ], 64)) : (re(), ut(I(en), {
        key: 1,
        onClick: I(e).startEditing
      }, {
        default: ye(() => [
          F("span", {
            class: Tt([I(St).edit, "mr-1"])
          }, null, 2),
          F("span", Wye, se(I(n)("dashboard.edit")), 1)
        ]),
        _: 1
      }, 8, ["onClick"])),
      v(I(No), {
        open: r.value,
        "onUpdate:open": w[3] || (w[3] = ($) => r.value = $),
        title: I(n)("dashboard.cancelConfirmTitle"),
        "ok-text": I(n)("dashboard.cancelConfirmOk"),
        "cancel-text": I(n)("dashboard.cancelConfirmCancel"),
        "ok-button-props": { danger: !0 },
        onOk: c,
        onCancel: w[4] || (w[4] = ($) => r.value = !1)
      }, {
        default: ye(() => [
          F("p", jye, se(I(n)("dashboard.cancelConfirmTitle")), 1)
        ]),
        _: 1
      }, 8, ["open", "title", "ok-text", "cancel-text"]),
      v(I(No), {
        open: a.value,
        "onUpdate:open": w[5] || (w[5] = ($) => a.value = $),
        title: I(n)("dashboard.clearConfirmTitle"),
        "ok-text": I(n)("dashboard.clearConfirmOk"),
        "ok-button-props": { danger: !0 },
        onOk: w[6] || (w[6] = () => {
          I(e).clearPanels(), a.value = !1;
        }),
        onCancel: w[7] || (w[7] = ($) => a.value = !1)
      }, {
        default: ye(() => [
          F("p", qye, se(I(n)("dashboard.clearConfirmTitle")), 1)
        ]),
        _: 1
      }, 8, ["open", "title", "ok-text"])
    ]));
  }
}), Kye = { class: "w-full h-full flex flex-col" }, Xye = {
  key: 1,
  class: "dashboad-content h-full"
}, Zye = {
  key: 1,
  class: "flex-center h-full"
}, Gye = { class: "text-center text-gray-400" }, Uye = { class: "text-14px" }, Jye = {
  key: 0,
  class: "mt-2 text-12px text-blue/90"
}, ebe = 30, H1 = 8, tbe = 768, nbe = /* @__PURE__ */ Oe({
  __name: "DashboardPage",
  setup(t) {
    const { t: e } = On(), n = Nl(), i = _l(), { config: o } = Uf(), r = A(() => o.value.canEdit !== !1), a = Te([...n.layouts]);
    _e(
      () => n.layouts,
      (m) => {
        const y = a.value;
        y.length === m.length && y.every(
          (b, w) => b.i === m[w].i && b.x === m[w].x && b.y === m[w].y && b.w === m[w].w && b.h === m[w].h
        ) || (a.value = [...m]);
      }
    );
    function l(m) {
      a.value = m, n.setLayouts(m);
    }
    const s = de(), u = de(0), c = A(() => u.value > 0 && u.value < tbe);
    let d = null;
    Lt(() => {
      s.value && (d = new ResizeObserver((m) => {
        u.value = m[0].contentRect.width;
      }), d.observe(s.value), u.value = s.value.getBoundingClientRect().width);
    }), wo(() => {
      d?.disconnect();
    });
    let f = null;
    function h() {
      p(), n.autoRefresh > 0 && (f = setInterval(() => {
        n.refresh();
      }, n.autoRefresh * 1e3));
    }
    function p() {
      f && (clearInterval(f), f = null);
    }
    _e(() => n.autoRefresh, h);
    const g = A(() => Object.keys(n.panels).length === 0);
    return (m, y) => (re(), be("div", Kye, [
      F("div", {
        class: "flex items-center gap-2 flex-wrap px-2 sticky top-0 z-10",
        style: Yt({
          background: I(i).isDark ? "#1a1a1a" : "#fff",
          borderBottom: `1px solid ${I(i).isDark ? "#303030" : "#e8e8e8"}`,
          height: "42px"
        })
      }, [
        _o(m.$slots, "title"),
        v(S4),
        y[0] || (y[0] = F("div", { class: "flex-1" }, null, -1)),
        v(O4),
        r.value ? (re(), ut(Yye, { key: 0 })) : et("", !0)
      ], 4),
      F("div", {
        ref_key: "containerRef",
        ref: s,
        class: "flex-1 overflow-auto"
      }, [
        c.value ? (re(), be("div", {
          key: 0,
          class: "flex flex-col",
          style: Yt({ gap: `${H1}px`, padding: "8px" })
        }, [
          (re(!0), be(tt, null, Jt(Object.keys(I(n).panels), (b) => (re(), be("div", { key: b }, [
            v(BI, { "panel-id": b }, {
              default: ye(() => [
                v(bS, { "panel-id": b }, null, 8, ["panel-id"])
              ]),
              _: 2
            }, 1032, ["panel-id"])
          ]))), 128))
        ], 4)) : (re(), be("div", Xye, [
          u.value > 0 && !g.value ? (re(), ut(I(Tfe), {
            key: 0,
            layout: a.value,
            "col-num": 12,
            "row-height": ebe,
            margin: [H1, H1],
            "is-draggable": r.value && I(n).isEditing,
            "is-resizable": r.value && I(n).isEditing,
            "vertical-compact": !0,
            onLayoutUpdated: l
          }, {
            item: ye(({ item: b }) => [
              v(BI, {
                "panel-id": String(b.i)
              }, {
                default: ye(() => [
                  v(bS, {
                    "panel-id": String(b.i)
                  }, null, 8, ["panel-id"])
                ]),
                _: 2
              }, 1032, ["panel-id"])
            ]),
            _: 1
          }, 8, ["layout", "margin", "is-draggable", "is-resizable"])) : et("", !0),
          g.value ? (re(), be("div", Zye, [
            F("div", Gye, [
              y[1] || (y[1] = F("div", { class: "text-4xl mb-4" }, [
                F("div", { class: "i-carbon:chart-combo-stacked" })
              ], -1)),
              F("div", Uye, se(I(e)("dashboard.empty")), 1),
              I(n).isEditing ? (re(), be("div", Jye, se(I(e)("dashboard.emptyHint")), 1)) : et("", !0)
            ])
          ])) : et("", !0)
        ]))
      ], 512),
      v(Qye),
      v(_ye)
    ]));
  }
}), ibe = { class: "flex justify-between items-center gap-2" }, obe = { style: { "font-size": "12px" } }, rbe = { style: { "font-size": "10px", color: "var(--ant-color-text-quaternary)" } }, W1 = /* @__PURE__ */ Oe({
  __name: "ArgusGroupBy",
  props: {
    groupBy: {},
    cfg: {},
    signal: {},
    metricName: {},
    disabled: { type: Boolean, default: !1 }
  },
  emits: ["change"],
  setup(t, { emit: e }) {
    const n = t, i = e, o = de(""), r = de([]), a = de(!1), l = de(!1);
    let s = null;
    _e(
      [o, l, () => n.cfg?.url, () => n.cfg?.token, () => n.signal, () => n.metricName],
      () => {
        !n.cfg || !l.value || (s && clearTimeout(s), s = setTimeout(async () => {
          a.value = !0;
          try {
            const h = new Set(n.groupBy.map((g) => g.name)), p = await bw(n.cfg, {
              signal: n.signal,
              metricName: n.metricName,
              searchText: o.value
            });
            r.value = p.filter((g) => !h.has(g.name)).map((g) => ({
              name: g.name,
              fieldContext: g.type === "resource" || g.type === "scope" ? g.type : "tag",
              fieldDataType: f(g.fieldDataType)
            }));
          } catch {
            r.value = [];
          } finally {
            a.value = !1;
          }
        }, 300));
      }
    );
    const u = A(() => n.groupBy.map((h) => h.name));
    function c(h) {
      const g = (Array.isArray(h) ? h : [h]).map((m) => {
        const y = r.value.find((w) => w.name === m), b = n.groupBy.find((w) => w.name === m);
        return y ?? b ?? { name: m, fieldDataType: "string", fieldContext: "tag" };
      });
      i("change", g);
    }
    const d = A(() => a.value ? lo(Bo, { size: "small" }) : null);
    function f(h) {
      return h === "bool" || h === "int64" || h === "float64" || h === "string" ? h : h === "boolean" ? "bool" : h === "number" || h === "integer" ? "float64" : "string";
    }
    return (h, p) => (re(), ut(I(Dt), {
      mode: "tags",
      size: "small",
      style: { flex: "1", "min-width": "160px" },
      placeholder: "不分组（全量汇总）",
      value: u.value,
      disabled: t.disabled,
      "filter-option": !1,
      "not-found-content": d.value,
      onSearch: p[0] || (p[0] = (g) => o.value = g),
      onFocus: p[1] || (p[1] = () => l.value = !0),
      onBlur: p[2] || (p[2] = () => {
        l.value = !1, o.value = "";
      }),
      onChange: c
    }, {
      default: ye(() => [
        (re(!0), be(tt, null, Jt(r.value, (g) => (re(), ut(I(Dt).Option, {
          key: g.name,
          value: g.name
        }, {
          default: ye(() => [
            F("div", ibe, [
              F("span", obe, se(g.name), 1),
              F("span", rbe, se([g.fieldContext, g.fieldDataType].filter(Boolean).join(" · ")), 1)
            ])
          ]),
          _: 2
        }, 1032, ["value"]))), 128))
      ]),
      _: 1
    }, 8, ["value", "disabled", "not-found-content"]));
  }
}), abe = { class: "flex flex-wrap gap-1 items-center" }, lbe = { class: "font-medium" }, sbe = /* @__PURE__ */ Oe({
  __name: "ArgusQueryFunctions",
  props: {
    functions: {},
    signal: {}
  },
  emits: ["change"],
  setup(t, { emit: e }) {
    const n = t, i = e, o = [
      { value: "cutOffMin", label: "Cut Off Min" },
      { value: "cutOffMax", label: "Cut Off Max" },
      { value: "clampMin", label: "Clamp Min" },
      { value: "clampMax", label: "Clamp Max" },
      { value: "absolute", label: "Absolute" },
      { value: "runningDiff", label: "Running Diff" },
      { value: "log2", label: "Log2" },
      { value: "log10", label: "Log10" },
      { value: "cumulativeSum", label: "Cumulative Sum" },
      { value: "ewma3", label: "EWMA 3" },
      { value: "ewma5", label: "EWMA 5" },
      { value: "ewma7", label: "EWMA 7" },
      { value: "median3", label: "Median 3" },
      { value: "median5", label: "Median 5" },
      { value: "median7", label: "Median 7" },
      { value: "timeShift", label: "Time Shift" },
      { value: "fillZero", label: "Fill Zero" }
    ], r = [{ value: "timeShift", label: "Time Shift" }], a = {
      cutOffMin: { showInput: !0, placeholder: "阈值" },
      cutOffMax: { showInput: !0, placeholder: "阈值" },
      clampMin: { showInput: !0, placeholder: "阈值" },
      clampMax: { showInput: !0, placeholder: "阈值" },
      absolute: { showInput: !1 },
      runningDiff: { showInput: !1 },
      log2: { showInput: !1 },
      log10: { showInput: !1 },
      cumulativeSum: { showInput: !1 },
      ewma3: { showInput: !0, placeholder: "Alpha" },
      ewma5: { showInput: !0, placeholder: "Alpha" },
      ewma7: { showInput: !0, placeholder: "Alpha" },
      median3: { showInput: !1 },
      median5: { showInput: !1 },
      median7: { showInput: !1 },
      timeShift: { showInput: !0, placeholder: "如 -1h" },
      fillZero: { showInput: !1 }
    }, l = A(
      () => n.signal === "logs" || n.signal === "traces" ? r : o
    );
    function s(d) {
      const f = a[d];
      i("change", [...n.functions, { name: d, args: f?.showInput ? [{ value: "" }] : [] }]);
    }
    function u(d) {
      i("change", n.functions.filter((f, h) => h !== d));
    }
    function c(d, f) {
      i("change", n.functions.map((h, p) => p === d ? { ...h, args: [{ value: f }] } : h));
    }
    return (d, f) => (re(), be("div", abe, [
      (re(!0), be(tt, null, Jt(t.functions, (h, p) => (re(), be("div", {
        key: p,
        class: "inline-flex items-center gap-1 rounded px-1.5",
        style: { background: "#eee", "font-size": "12px" }
      }, [
        F("span", lbe, se(h.name) + "(", 1),
        a[h.name]?.showInput ? (re(), ut(I(jt), {
          key: 0,
          class: "text-center",
          size: "small",
          bordered: !1,
          variant: "borderless",
          style: { width: "40px", padding: "0 2px", height: "20px" },
          placeholder: a[h.name]?.placeholder ?? "value",
          value: h.args[0]?.value ?? "",
          onChange: (g) => c(p, g.target.value)
        }, null, 8, ["placeholder", "value", "onChange"])) : et("", !0),
        f[1] || (f[1] = F("span", null, ")", -1)),
        v(I(en), {
          class: "p-0!",
          type: "link",
          size: "small",
          danger: "",
          onClick: (g) => u(p)
        }, {
          default: ye(() => [
            F("span", {
              class: Tt(I(St).delete)
            }, null, 2)
          ]),
          _: 1
        }, 8, ["onClick"])
      ]))), 128)),
      v(I(Nr), { trigger: "click" }, {
        overlay: ye(() => [
          v(I(Bi), {
            onClick: f[0] || (f[0] = ({ key: h }) => s(String(h)))
          }, {
            default: ye(() => [
              (re(!0), be(tt, null, Jt(l.value, (h) => (re(), ut(I(Bi).Item, {
                key: h.value
              }, {
                default: ye(() => [
                  Ve(se(h.label), 1)
                ]),
                _: 2
              }, 1024))), 128))
            ]),
            _: 1
          })
        ]),
        default: ye(() => [
          v(I(en), {
            size: "small",
            type: "dashed"
          }, {
            default: ye(() => [
              F("span", {
                class: Tt([I(St).plus, "mr-0.5"])
              }, null, 2),
              f[2] || (f[2] = Ve("函数 ", -1))
            ]),
            _: 1
          })
        ]),
        _: 1
      })
    ]));
  }
});
let xS = [], w4 = [];
(() => {
  let t = "lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map((e) => e ? parseInt(e, 36) : 1);
  for (let e = 0, n = 0; e < t.length; e++)
    (e % 2 ? w4 : xS).push(n = n + t[e]);
})();
function ube(t) {
  if (t < 768) return !1;
  for (let e = 0, n = xS.length; ; ) {
    let i = e + n >> 1;
    if (t < xS[i]) n = i;
    else if (t >= w4[i]) e = i + 1;
    else return !0;
    if (e == n) return !1;
  }
}
function FI(t) {
  return t >= 127462 && t <= 127487;
}
const VI = 8205;
function cbe(t, e, n = !0, i = !0) {
  return (n ? C4 : dbe)(t, e, i);
}
function C4(t, e, n) {
  if (e == t.length) return e;
  e && $4(t.charCodeAt(e)) && k4(t.charCodeAt(e - 1)) && e--;
  let i = j1(t, e);
  for (e += QI(i); e < t.length; ) {
    let o = j1(t, e);
    if (i == VI || o == VI || n && ube(o))
      e += QI(o), i = o;
    else if (FI(o)) {
      let r = 0, a = e - 2;
      for (; a >= 0 && FI(j1(t, a)); )
        r++, a -= 2;
      if (r % 2 == 0) break;
      e += 2;
    } else
      break;
  }
  return e;
}
function dbe(t, e, n) {
  for (; e > 1; ) {
    let i = C4(t, e - 2, n);
    if (i < e) return i;
    e--;
  }
  return 0;
}
function j1(t, e) {
  let n = t.charCodeAt(e);
  if (!k4(n) || e + 1 == t.length) return n;
  let i = t.charCodeAt(e + 1);
  return $4(i) ? (n - 55296 << 10) + (i - 56320) + 65536 : n;
}
function $4(t) {
  return t >= 56320 && t < 57344;
}
function k4(t) {
  return t >= 55296 && t < 56320;
}
function QI(t) {
  return t < 65536 ? 1 : 2;
}
class Wn {
  /**
  Get the line description around the given position.
  */
  lineAt(e) {
    if (e < 0 || e > this.length)
      throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);
    return this.lineInner(e, !1, 1, 0);
  }
  /**
  Get the description for the given (1-based) line number.
  */
  line(e) {
    if (e < 1 || e > this.lines)
      throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);
    return this.lineInner(e, !0, 1, 0);
  }
  /**
  Replace a range of the text with the given content.
  */
  replace(e, n, i) {
    [e, n] = Hf(this, e, n);
    let o = [];
    return this.decompose(
      0,
      e,
      o,
      2
      /* Open.To */
    ), i.length && i.decompose(
      0,
      i.length,
      o,
      3
      /* Open.To */
    ), this.decompose(
      n,
      this.length,
      o,
      1
      /* Open.From */
    ), xl.from(o, this.length - (n - e) + i.length);
  }
  /**
  Append another document to this one.
  */
  append(e) {
    return this.replace(this.length, this.length, e);
  }
  /**
  Retrieve the text between the given points.
  */
  slice(e, n = this.length) {
    [e, n] = Hf(this, e, n);
    let i = [];
    return this.decompose(e, n, i, 0), xl.from(i, n - e);
  }
  /**
  Test whether this text is equal to another instance.
  */
  eq(e) {
    if (e == this)
      return !0;
    if (e.length != this.length || e.lines != this.lines)
      return !1;
    let n = this.scanIdentical(e, 1), i = this.length - this.scanIdentical(e, -1), o = new vp(this), r = new vp(e);
    for (let a = n, l = n; ; ) {
      if (o.next(a), r.next(a), a = 0, o.lineBreak != r.lineBreak || o.done != r.done || o.value != r.value)
        return !1;
      if (l += o.value.length, o.done || l >= i)
        return !0;
    }
  }
  /**
  Iterate over the text. When `dir` is `-1`, iteration happens
  from end to start. This will return lines and the breaks between
  them as separate strings.
  */
  iter(e = 1) {
    return new vp(this, e);
  }
  /**
  Iterate over a range of the text. When `from` > `to`, the
  iterator will run in reverse.
  */
  iterRange(e, n = this.length) {
    return new T4(this, e, n);
  }
  /**
  Return a cursor that iterates over the given range of lines,
  _without_ returning the line breaks between, and yielding empty
  strings for empty lines.
  
  When `from` and `to` are given, they should be 1-based line numbers.
  */
  iterLines(e, n) {
    let i;
    if (e == null)
      i = this.iter();
    else {
      n == null && (n = this.lines + 1);
      let o = this.line(e).from;
      i = this.iterRange(o, Math.max(o, n == this.lines + 1 ? this.length : n <= 1 ? 0 : this.line(n - 1).to));
    }
    return new P4(i);
  }
  /**
  Return the document as a string, using newline characters to
  separate lines.
  */
  toString() {
    return this.sliceString(0);
  }
  /**
  Convert the document to an array of lines (which can be
  deserialized again via [`Text.of`](https://codemirror.net/6/docs/ref/#state.Text^of)).
  */
  toJSON() {
    let e = [];
    return this.flatten(e), e;
  }
  /**
  @internal
  */
  constructor() {
  }
  /**
  Create a `Text` instance for the given array of lines.
  */
  static of(e) {
    if (e.length == 0)
      throw new RangeError("A document must have at least one line");
    return e.length == 1 && !e[0] ? Wn.empty : e.length <= 32 ? new Zi(e) : xl.from(Zi.split(e, []));
  }
}
class Zi extends Wn {
  constructor(e, n = fbe(e)) {
    super(), this.text = e, this.length = n;
  }
  get lines() {
    return this.text.length;
  }
  get children() {
    return null;
  }
  lineInner(e, n, i, o) {
    for (let r = 0; ; r++) {
      let a = this.text[r], l = o + a.length;
      if ((n ? i : l) >= e)
        return new hbe(o, l, i, a);
      o = l + 1, i++;
    }
  }
  decompose(e, n, i, o) {
    let r = e <= 0 && n >= this.length ? this : new Zi(HI(this.text, e, n), Math.min(n, this.length) - Math.max(0, e));
    if (o & 1) {
      let a = i.pop(), l = Cv(r.text, a.text.slice(), 0, r.length);
      if (l.length <= 32)
        i.push(new Zi(l, a.length + r.length));
      else {
        let s = l.length >> 1;
        i.push(new Zi(l.slice(0, s)), new Zi(l.slice(s)));
      }
    } else
      i.push(r);
  }
  replace(e, n, i) {
    if (!(i instanceof Zi))
      return super.replace(e, n, i);
    [e, n] = Hf(this, e, n);
    let o = Cv(this.text, Cv(i.text, HI(this.text, 0, e)), n), r = this.length + i.length - (n - e);
    return o.length <= 32 ? new Zi(o, r) : xl.from(Zi.split(o, []), r);
  }
  sliceString(e, n = this.length, i = `
`) {
    [e, n] = Hf(this, e, n);
    let o = "";
    for (let r = 0, a = 0; r <= n && a < this.text.length; a++) {
      let l = this.text[a], s = r + l.length;
      r > e && a && (o += i), e < s && n > r && (o += l.slice(Math.max(0, e - r), n - r)), r = s + 1;
    }
    return o;
  }
  flatten(e) {
    for (let n of this.text)
      e.push(n);
  }
  scanIdentical() {
    return 0;
  }
  static split(e, n) {
    let i = [], o = -1;
    for (let r of e)
      i.push(r), o += r.length + 1, i.length == 32 && (n.push(new Zi(i, o)), i = [], o = -1);
    return o > -1 && n.push(new Zi(i, o)), n;
  }
}
class xl extends Wn {
  constructor(e, n) {
    super(), this.children = e, this.length = n, this.lines = 0;
    for (let i of e)
      this.lines += i.lines;
  }
  lineInner(e, n, i, o) {
    for (let r = 0; ; r++) {
      let a = this.children[r], l = o + a.length, s = i + a.lines - 1;
      if ((n ? s : l) >= e)
        return a.lineInner(e, n, i, o);
      o = l + 1, i = s + 1;
    }
  }
  decompose(e, n, i, o) {
    for (let r = 0, a = 0; a <= n && r < this.children.length; r++) {
      let l = this.children[r], s = a + l.length;
      if (e <= s && n >= a) {
        let u = o & ((a <= e ? 1 : 0) | (s >= n ? 2 : 0));
        a >= e && s <= n && !u ? i.push(l) : l.decompose(e - a, n - a, i, u);
      }
      a = s + 1;
    }
  }
  replace(e, n, i) {
    if ([e, n] = Hf(this, e, n), i.lines < this.lines)
      for (let o = 0, r = 0; o < this.children.length; o++) {
        let a = this.children[o], l = r + a.length;
        if (e >= r && n <= l) {
          let s = a.replace(e - r, n - r, i), u = this.lines - a.lines + s.lines;
          if (s.lines < u >> 4 && s.lines > u >> 6) {
            let c = this.children.slice();
            return c[o] = s, new xl(c, this.length - (n - e) + i.length);
          }
          return super.replace(r, l, s);
        }
        r = l + 1;
      }
    return super.replace(e, n, i);
  }
  sliceString(e, n = this.length, i = `
`) {
    [e, n] = Hf(this, e, n);
    let o = "";
    for (let r = 0, a = 0; r < this.children.length && a <= n; r++) {
      let l = this.children[r], s = a + l.length;
      a > e && r && (o += i), e < s && n > a && (o += l.sliceString(e - a, n - a, i)), a = s + 1;
    }
    return o;
  }
  flatten(e) {
    for (let n of this.children)
      n.flatten(e);
  }
  scanIdentical(e, n) {
    if (!(e instanceof xl))
      return 0;
    let i = 0, [o, r, a, l] = n > 0 ? [0, 0, this.children.length, e.children.length] : [this.children.length - 1, e.children.length - 1, -1, -1];
    for (; ; o += n, r += n) {
      if (o == a || r == l)
        return i;
      let s = this.children[o], u = e.children[r];
      if (s != u)
        return i + s.scanIdentical(u, n);
      i += s.length + 1;
    }
  }
  static from(e, n = e.reduce((i, o) => i + o.length + 1, -1)) {
    let i = 0;
    for (let h of e)
      i += h.lines;
    if (i < 32) {
      let h = [];
      for (let p of e)
        p.flatten(h);
      return new Zi(h, n);
    }
    let o = Math.max(
      32,
      i >> 5
      /* Tree.BranchShift */
    ), r = o << 1, a = o >> 1, l = [], s = 0, u = -1, c = [];
    function d(h) {
      let p;
      if (h.lines > r && h instanceof xl)
        for (let g of h.children)
          d(g);
      else h.lines > a && (s > a || !s) ? (f(), l.push(h)) : h instanceof Zi && s && (p = c[c.length - 1]) instanceof Zi && h.lines + p.lines <= 32 ? (s += h.lines, u += h.length + 1, c[c.length - 1] = new Zi(p.text.concat(h.text), p.length + 1 + h.length)) : (s + h.lines > o && f(), s += h.lines, u += h.length + 1, c.push(h));
    }
    function f() {
      s != 0 && (l.push(c.length == 1 ? c[0] : xl.from(c, u)), u = -1, s = c.length = 0);
    }
    for (let h of e)
      d(h);
    return f(), l.length == 1 ? l[0] : new xl(l, n);
  }
}
Wn.empty = /* @__PURE__ */ new Zi([""], 0);
function fbe(t) {
  let e = -1;
  for (let n of t)
    e += n.length + 1;
  return e;
}
function Cv(t, e, n = 0, i = 1e9) {
  for (let o = 0, r = 0, a = !0; r < t.length && o <= i; r++) {
    let l = t[r], s = o + l.length;
    s >= n && (s > i && (l = l.slice(0, i - o)), o < n && (l = l.slice(n - o)), a ? (e[e.length - 1] += l, a = !1) : e.push(l)), o = s + 1;
  }
  return e;
}
function HI(t, e, n) {
  return Cv(t, [""], e, n);
}
class vp {
  constructor(e, n = 1) {
    this.dir = n, this.done = !1, this.lineBreak = !1, this.value = "", this.nodes = [e], this.offsets = [n > 0 ? 1 : (e instanceof Zi ? e.text.length : e.children.length) << 1];
  }
  nextInner(e, n) {
    for (this.done = this.lineBreak = !1; ; ) {
      let i = this.nodes.length - 1, o = this.nodes[i], r = this.offsets[i], a = r >> 1, l = o instanceof Zi ? o.text.length : o.children.length;
      if (a == (n > 0 ? l : 0)) {
        if (i == 0)
          return this.done = !0, this.value = "", this;
        n > 0 && this.offsets[i - 1]++, this.nodes.pop(), this.offsets.pop();
      } else if ((r & 1) == (n > 0 ? 0 : 1)) {
        if (this.offsets[i] += n, e == 0)
          return this.lineBreak = !0, this.value = `
`, this;
        e--;
      } else if (o instanceof Zi) {
        let s = o.text[a + (n < 0 ? -1 : 0)];
        if (this.offsets[i] += n, s.length > Math.max(0, e))
          return this.value = e == 0 ? s : n > 0 ? s.slice(e) : s.slice(0, s.length - e), this;
        e -= s.length;
      } else {
        let s = o.children[a + (n < 0 ? -1 : 0)];
        e > s.length ? (e -= s.length, this.offsets[i] += n) : (n < 0 && this.offsets[i]--, this.nodes.push(s), this.offsets.push(n > 0 ? 1 : (s instanceof Zi ? s.text.length : s.children.length) << 1));
      }
    }
  }
  next(e = 0) {
    return e < 0 && (this.nextInner(-e, -this.dir), e = this.value.length), this.nextInner(e, this.dir);
  }
}
class T4 {
  constructor(e, n, i) {
    this.value = "", this.done = !1, this.cursor = new vp(e, n > i ? -1 : 1), this.pos = n > i ? e.length : 0, this.from = Math.min(n, i), this.to = Math.max(n, i);
  }
  nextInner(e, n) {
    if (n < 0 ? this.pos <= this.from : this.pos >= this.to)
      return this.value = "", this.done = !0, this;
    e += Math.max(0, n < 0 ? this.pos - this.to : this.from - this.pos);
    let i = n < 0 ? this.pos - this.from : this.to - this.pos;
    e > i && (e = i), i -= e;
    let { value: o } = this.cursor.next(e);
    return this.pos += (o.length + e) * n, this.value = o.length <= i ? o : n < 0 ? o.slice(o.length - i) : o.slice(0, i), this.done = !this.value, this;
  }
  next(e = 0) {
    return e < 0 ? e = Math.max(e, this.from - this.pos) : e > 0 && (e = Math.min(e, this.to - this.pos)), this.nextInner(e, this.cursor.dir);
  }
  get lineBreak() {
    return this.cursor.lineBreak && this.value != "";
  }
}
class P4 {
  constructor(e) {
    this.inner = e, this.afterBreak = !0, this.value = "", this.done = !1;
  }
  next(e = 0) {
    let { done: n, lineBreak: i, value: o } = this.inner.next(e);
    return n && this.afterBreak ? (this.value = "", this.afterBreak = !1) : n ? (this.done = !0, this.value = "") : i ? this.afterBreak ? this.value = "" : (this.afterBreak = !0, this.next()) : (this.value = o, this.afterBreak = !1), this;
  }
  get lineBreak() {
    return !1;
  }
}
typeof Symbol < "u" && (Wn.prototype[Symbol.iterator] = function() {
  return this.iter();
}, vp.prototype[Symbol.iterator] = T4.prototype[Symbol.iterator] = P4.prototype[Symbol.iterator] = function() {
  return this;
});
class hbe {
  /**
  @internal
  */
  constructor(e, n, i, o) {
    this.from = e, this.to = n, this.number = i, this.text = o;
  }
  /**
  The length of the line (not including any line break after it).
  */
  get length() {
    return this.to - this.from;
  }
}
function Hf(t, e, n) {
  return e = Math.max(0, Math.min(t.length, e)), [e, Math.max(e, Math.min(t.length, n))];
}
function $l(t, e, n = !0, i = !0) {
  return cbe(t, e, n, i);
}
function pbe(t) {
  return t >= 56320 && t < 57344;
}
function gbe(t) {
  return t >= 55296 && t < 56320;
}
function hc(t, e) {
  let n = t.charCodeAt(e);
  if (!gbe(n) || e + 1 == t.length)
    return n;
  let i = t.charCodeAt(e + 1);
  return pbe(i) ? (n - 55296 << 10) + (i - 56320) + 65536 : n;
}
function mbe(t) {
  return t <= 65535 ? String.fromCharCode(t) : (t -= 65536, String.fromCharCode((t >> 10) + 55296, (t & 1023) + 56320));
}
function Hd(t) {
  return t < 65536 ? 1 : 2;
}
const OS = /\r\n?|\n/;
var nr = /* @__PURE__ */ (function(t) {
  return t[t.Simple = 0] = "Simple", t[t.TrackDel = 1] = "TrackDel", t[t.TrackBefore = 2] = "TrackBefore", t[t.TrackAfter = 3] = "TrackAfter", t;
})(nr || (nr = {}));
class Os {
  // Sections are encoded as pairs of integers. The first is the
  // length in the current document, and the second is -1 for
  // unaffected sections, and the length of the replacement content
  // otherwise. So an insertion would be (0, n>0), a deletion (n>0,
  // 0), and a replacement two positive numbers.
  /**
  @internal
  */
  constructor(e) {
    this.sections = e;
  }
  /**
  The length of the document before the change.
  */
  get length() {
    let e = 0;
    for (let n = 0; n < this.sections.length; n += 2)
      e += this.sections[n];
    return e;
  }
  /**
  The length of the document after the change.
  */
  get newLength() {
    let e = 0;
    for (let n = 0; n < this.sections.length; n += 2) {
      let i = this.sections[n + 1];
      e += i < 0 ? this.sections[n] : i;
    }
    return e;
  }
  /**
  False when there are actual changes in this set.
  */
  get empty() {
    return this.sections.length == 0 || this.sections.length == 2 && this.sections[1] < 0;
  }
  /**
  Iterate over the unchanged parts left by these changes. `posA`
  provides the position of the range in the old document, `posB`
  the new position in the changed document.
  */
  iterGaps(e) {
    for (let n = 0, i = 0, o = 0; n < this.sections.length; ) {
      let r = this.sections[n++], a = this.sections[n++];
      a < 0 ? (e(i, o, r), o += r) : o += a, i += r;
    }
  }
  /**
  Iterate over the ranges changed by these changes. (See
  [`ChangeSet.iterChanges`](https://codemirror.net/6/docs/ref/#state.ChangeSet.iterChanges) for a
  variant that also provides you with the inserted text.)
  `fromA`/`toA` provides the extent of the change in the starting
  document, `fromB`/`toB` the extent of the replacement in the
  changed document.
  
  When `individual` is true, adjacent changes (which are kept
  separate for [position mapping](https://codemirror.net/6/docs/ref/#state.ChangeDesc.mapPos)) are
  reported separately.
  */
  iterChangedRanges(e, n = !1) {
    SS(this, e, n);
  }
  /**
  Get a description of the inverted form of these changes.
  */
  get invertedDesc() {
    let e = [];
    for (let n = 0; n < this.sections.length; ) {
      let i = this.sections[n++], o = this.sections[n++];
      o < 0 ? e.push(i, o) : e.push(o, i);
    }
    return new Os(e);
  }
  /**
  Compute the combined effect of applying another set of changes
  after this one. The length of the document after this set should
  match the length before `other`.
  */
  composeDesc(e) {
    return this.empty ? e : e.empty ? this : E4(this, e);
  }
  /**
  Map this description, which should start with the same document
  as `other`, over another set of changes, so that it can be
  applied after it. When `before` is true, map as if the changes
  in `this` happened before the ones in `other`.
  */
  mapDesc(e, n = !1) {
    return e.empty ? this : wS(this, e, n);
  }
  mapPos(e, n = -1, i = nr.Simple) {
    let o = 0, r = 0;
    for (let a = 0; a < this.sections.length; ) {
      let l = this.sections[a++], s = this.sections[a++], u = o + l;
      if (s < 0) {
        if (u > e)
          return r + (e - o);
        r += l;
      } else {
        if (i != nr.Simple && u >= e && (i == nr.TrackDel && o < e && u > e || i == nr.TrackBefore && o < e || i == nr.TrackAfter && u > e))
          return null;
        if (u > e || u == e && n < 0 && !l)
          return e == o || n < 0 ? r : r + s;
        r += s;
      }
      o = u;
    }
    if (e > o)
      throw new RangeError(`Position ${e} is out of range for changeset of length ${o}`);
    return r;
  }
  /**
  Check whether these changes touch a given range. When one of the
  changes entirely covers the range, the string `"cover"` is
  returned.
  */
  touchesRange(e, n = e) {
    for (let i = 0, o = 0; i < this.sections.length && o <= n; ) {
      let r = this.sections[i++], a = this.sections[i++], l = o + r;
      if (a >= 0 && o <= n && l >= e)
        return o < e && l > n ? "cover" : !0;
      o = l;
    }
    return !1;
  }
  /**
  @internal
  */
  toString() {
    let e = "";
    for (let n = 0; n < this.sections.length; ) {
      let i = this.sections[n++], o = this.sections[n++];
      e += (e ? " " : "") + i + (o >= 0 ? ":" + o : "");
    }
    return e;
  }
  /**
  Serialize this change desc to a JSON-representable value.
  */
  toJSON() {
    return this.sections;
  }
  /**
  Create a change desc from its JSON representation (as produced
  by [`toJSON`](https://codemirror.net/6/docs/ref/#state.ChangeDesc.toJSON).
  */
  static fromJSON(e) {
    if (!Array.isArray(e) || e.length % 2 || e.some((n) => typeof n != "number"))
      throw new RangeError("Invalid JSON representation of ChangeDesc");
    return new Os(e);
  }
  /**
  @internal
  */
  static create(e) {
    return new Os(e);
  }
}
class bo extends Os {
  constructor(e, n) {
    super(e), this.inserted = n;
  }
  /**
  Apply the changes to a document, returning the modified
  document.
  */
  apply(e) {
    if (this.length != e.length)
      throw new RangeError("Applying change set to a document with the wrong length");
    return SS(this, (n, i, o, r, a) => e = e.replace(o, o + (i - n), a), !1), e;
  }
  mapDesc(e, n = !1) {
    return wS(this, e, n, !0);
  }
  /**
  Given the document as it existed _before_ the changes, return a
  change set that represents the inverse of this set, which could
  be used to go from the document created by the changes back to
  the document as it existed before the changes.
  */
  invert(e) {
    let n = this.sections.slice(), i = [];
    for (let o = 0, r = 0; o < n.length; o += 2) {
      let a = n[o], l = n[o + 1];
      if (l >= 0) {
        n[o] = l, n[o + 1] = a;
        let s = o >> 1;
        for (; i.length < s; )
          i.push(Wn.empty);
        i.push(a ? e.slice(r, r + a) : Wn.empty);
      }
      r += a;
    }
    return new bo(n, i);
  }
  /**
  Combine two subsequent change sets into a single set. `other`
  must start in the document produced by `this`. If `this` goes
  `docA` → `docB` and `other` represents `docB` → `docC`, the
  returned value will represent the change `docA` → `docC`.
  */
  compose(e) {
    return this.empty ? e : e.empty ? this : E4(this, e, !0);
  }
  /**
  Given another change set starting in the same document, maps this
  change set over the other, producing a new change set that can be
  applied to the document produced by applying `other`. When
  `before` is `true`, order changes as if `this` comes before
  `other`, otherwise (the default) treat `other` as coming first.
  
  Given two changes `A` and `B`, `A.compose(B.map(A))` and
  `B.compose(A.map(B, true))` will produce the same document. This
  provides a basic form of [operational
  transformation](https://en.wikipedia.org/wiki/Operational_transformation),
  and can be used for collaborative editing.
  */
  map(e, n = !1) {
    return e.empty ? this : wS(this, e, n, !0);
  }
  /**
  Iterate over the changed ranges in the document, calling `f` for
  each, with the range in the original document (`fromA`-`toA`)
  and the range that replaces it in the new document
  (`fromB`-`toB`).
  
  When `individual` is true, adjacent changes are reported
  separately.
  */
  iterChanges(e, n = !1) {
    SS(this, e, n);
  }
  /**
  Get a [change description](https://codemirror.net/6/docs/ref/#state.ChangeDesc) for this change
  set.
  */
  get desc() {
    return Os.create(this.sections);
  }
  /**
  @internal
  */
  filter(e) {
    let n = [], i = [], o = [], r = new qp(this);
    e: for (let a = 0, l = 0; ; ) {
      let s = a == e.length ? 1e9 : e[a++];
      for (; l < s || l == s && r.len == 0; ) {
        if (r.done)
          break e;
        let c = Math.min(r.len, s - l);
        Fo(o, c, -1);
        let d = r.ins == -1 ? -1 : r.off == 0 ? r.ins : 0;
        Fo(n, c, d), d > 0 && wu(i, n, r.text), r.forward(c), l += c;
      }
      let u = e[a++];
      for (; l < u; ) {
        if (r.done)
          break e;
        let c = Math.min(r.len, u - l);
        Fo(n, c, -1), Fo(o, c, r.ins == -1 ? -1 : r.off == 0 ? r.ins : 0), r.forward(c), l += c;
      }
    }
    return {
      changes: new bo(n, i),
      filtered: Os.create(o)
    };
  }
  /**
  Serialize this change set to a JSON-representable value.
  */
  toJSON() {
    let e = [];
    for (let n = 0; n < this.sections.length; n += 2) {
      let i = this.sections[n], o = this.sections[n + 1];
      o < 0 ? e.push(i) : o == 0 ? e.push([i]) : e.push([i].concat(this.inserted[n >> 1].toJSON()));
    }
    return e;
  }
  /**
  Create a change set for the given changes, for a document of the
  given length, using `lineSep` as line separator.
  */
  static of(e, n, i) {
    let o = [], r = [], a = 0, l = null;
    function s(c = !1) {
      if (!c && !o.length)
        return;
      a < n && Fo(o, n - a, -1);
      let d = new bo(o, r);
      l = l ? l.compose(d.map(l)) : d, o = [], r = [], a = 0;
    }
    function u(c) {
      if (Array.isArray(c))
        for (let d of c)
          u(d);
      else if (c instanceof bo) {
        if (c.length != n)
          throw new RangeError(`Mismatched change set length (got ${c.length}, expected ${n})`);
        s(), l = l ? l.compose(c.map(l)) : c;
      } else {
        let { from: d, to: f = d, insert: h } = c;
        if (d > f || d < 0 || f > n)
          throw new RangeError(`Invalid change range ${d} to ${f} (in doc of length ${n})`);
        let p = h ? typeof h == "string" ? Wn.of(h.split(i || OS)) : h : Wn.empty, g = p.length;
        if (d == f && g == 0)
          return;
        d < a && s(), d > a && Fo(o, d - a, -1), Fo(o, f - d, g), wu(r, o, p), a = f;
      }
    }
    return u(e), s(!l), l;
  }
  /**
  Create an empty changeset of the given length.
  */
  static empty(e) {
    return new bo(e ? [e, -1] : [], []);
  }
  /**
  Create a changeset from its JSON representation (as produced by
  [`toJSON`](https://codemirror.net/6/docs/ref/#state.ChangeSet.toJSON).
  */
  static fromJSON(e) {
    if (!Array.isArray(e))
      throw new RangeError("Invalid JSON representation of ChangeSet");
    let n = [], i = [];
    for (let o = 0; o < e.length; o++) {
      let r = e[o];
      if (typeof r == "number")
        n.push(r, -1);
      else {
        if (!Array.isArray(r) || typeof r[0] != "number" || r.some((a, l) => l && typeof a != "string"))
          throw new RangeError("Invalid JSON representation of ChangeSet");
        if (r.length == 1)
          n.push(r[0], 0);
        else {
          for (; i.length < o; )
            i.push(Wn.empty);
          i[o] = Wn.of(r.slice(1)), n.push(r[0], i[o].length);
        }
      }
    }
    return new bo(n, i);
  }
  /**
  @internal
  */
  static createSet(e, n) {
    return new bo(e, n);
  }
}
function Fo(t, e, n, i = !1) {
  if (e == 0 && n <= 0)
    return;
  let o = t.length - 2;
  o >= 0 && n <= 0 && n == t[o + 1] ? t[o] += e : o >= 0 && e == 0 && t[o] == 0 ? t[o + 1] += n : i ? (t[o] += e, t[o + 1] += n) : t.push(e, n);
}
function wu(t, e, n) {
  if (n.length == 0)
    return;
  let i = e.length - 2 >> 1;
  if (i < t.length)
    t[t.length - 1] = t[t.length - 1].append(n);
  else {
    for (; t.length < i; )
      t.push(Wn.empty);
    t.push(n);
  }
}
function SS(t, e, n) {
  let i = t.inserted;
  for (let o = 0, r = 0, a = 0; a < t.sections.length; ) {
    let l = t.sections[a++], s = t.sections[a++];
    if (s < 0)
      o += l, r += l;
    else {
      let u = o, c = r, d = Wn.empty;
      for (; u += l, c += s, s && i && (d = d.append(i[a - 2 >> 1])), !(n || a == t.sections.length || t.sections[a + 1] < 0); )
        l = t.sections[a++], s = t.sections[a++];
      e(o, u, r, c, d), o = u, r = c;
    }
  }
}
function wS(t, e, n, i = !1) {
  let o = [], r = i ? [] : null, a = new qp(t), l = new qp(e);
  for (let s = -1; ; ) {
    if (a.done && l.len || l.done && a.len)
      throw new Error("Mismatched change set lengths");
    if (a.ins == -1 && l.ins == -1) {
      let u = Math.min(a.len, l.len);
      Fo(o, u, -1), a.forward(u), l.forward(u);
    } else if (l.ins >= 0 && (a.ins < 0 || s == a.i || a.off == 0 && (l.len < a.len || l.len == a.len && !n))) {
      let u = l.len;
      for (Fo(o, l.ins, -1); u; ) {
        let c = Math.min(a.len, u);
        a.ins >= 0 && s < a.i && a.len <= c && (Fo(o, 0, a.ins), r && wu(r, o, a.text), s = a.i), a.forward(c), u -= c;
      }
      l.next();
    } else if (a.ins >= 0) {
      let u = 0, c = a.len;
      for (; c; )
        if (l.ins == -1) {
          let d = Math.min(c, l.len);
          u += d, c -= d, l.forward(d);
        } else if (l.ins == 0 && l.len < c)
          c -= l.len, l.next();
        else
          break;
      Fo(o, u, s < a.i ? a.ins : 0), r && s < a.i && wu(r, o, a.text), s = a.i, a.forward(a.len - c);
    } else {
      if (a.done && l.done)
        return r ? bo.createSet(o, r) : Os.create(o);
      throw new Error("Mismatched change set lengths");
    }
  }
}
function E4(t, e, n = !1) {
  let i = [], o = n ? [] : null, r = new qp(t), a = new qp(e);
  for (let l = !1; ; ) {
    if (r.done && a.done)
      return o ? bo.createSet(i, o) : Os.create(i);
    if (r.ins == 0)
      Fo(i, r.len, 0, l), r.next();
    else if (a.len == 0 && !a.done)
      Fo(i, 0, a.ins, l), o && wu(o, i, a.text), a.next();
    else {
      if (r.done || a.done)
        throw new Error("Mismatched change set lengths");
      {
        let s = Math.min(r.len2, a.len), u = i.length;
        if (r.ins == -1) {
          let c = a.ins == -1 ? -1 : a.off ? 0 : a.ins;
          Fo(i, s, c, l), o && c && wu(o, i, a.text);
        } else a.ins == -1 ? (Fo(i, r.off ? 0 : r.len, s, l), o && wu(o, i, r.textBit(s))) : (Fo(i, r.off ? 0 : r.len, a.off ? 0 : a.ins, l), o && !a.off && wu(o, i, a.text));
        l = (r.ins > s || a.ins >= 0 && a.len > s) && (l || i.length > u), r.forward2(s), a.forward(s);
      }
    }
  }
}
class qp {
  constructor(e) {
    this.set = e, this.i = 0, this.next();
  }
  next() {
    let { sections: e } = this.set;
    this.i < e.length ? (this.len = e[this.i++], this.ins = e[this.i++]) : (this.len = 0, this.ins = -2), this.off = 0;
  }
  get done() {
    return this.ins == -2;
  }
  get len2() {
    return this.ins < 0 ? this.len : this.ins;
  }
  get text() {
    let { inserted: e } = this.set, n = this.i - 2 >> 1;
    return n >= e.length ? Wn.empty : e[n];
  }
  textBit(e) {
    let { inserted: n } = this.set, i = this.i - 2 >> 1;
    return i >= n.length && !e ? Wn.empty : n[i].slice(this.off, e == null ? void 0 : this.off + e);
  }
  forward(e) {
    e == this.len ? this.next() : (this.len -= e, this.off += e);
  }
  forward2(e) {
    this.ins == -1 ? this.forward(e) : e == this.ins ? this.next() : (this.ins -= e, this.off += e);
  }
}
class gu {
  constructor(e, n, i, o) {
    this.from = e, this.to = n, this.flags = i, this.goalColumn = o;
  }
  /**
  The anchor of the range—the side that doesn't move when you
  extend it.
  */
  get anchor() {
    return this.flags & 32 ? this.to : this.from;
  }
  /**
  The head of the range, which is moved when the range is
  [extended](https://codemirror.net/6/docs/ref/#state.SelectionRange.extend).
  */
  get head() {
    return this.flags & 32 ? this.from : this.to;
  }
  /**
  True when `anchor` and `head` are at the same position.
  */
  get empty() {
    return this.from == this.to;
  }
  /**
  If this is a cursor that is explicitly associated with the
  character on one of its sides, this returns the side. -1 means
  the character before its position, 1 the character after, and 0
  means no association.
  */
  get assoc() {
    return this.flags & 8 ? -1 : this.flags & 16 ? 1 : 0;
  }
  /**
  A flag that, when set, makes some selection-extending commands
  treat the range's head and anchor as exchangeable, so that for
  example Shift-ArrowUp will make the lower side of the selection
  the anchor, even if that was the head before. Used to implement
  MacOS-style undirectional selections.
  */
  get undirectional() {
    return (this.flags & 64) > 0;
  }
  /**
  The bidirectional text level associated with this cursor, if
  any.
  */
  get bidiLevel() {
    let e = this.flags & 7;
    return e == 7 ? null : e;
  }
  /**
  Map this range through a change, producing a valid range in the
  updated document.
  */
  map(e, n = -1) {
    let i, o;
    return this.empty ? i = o = e.mapPos(this.from, n) : (i = e.mapPos(this.from, 1), o = e.mapPos(this.to, -1)), i == this.from && o == this.to ? this : new gu(i, o, this.flags, this.goalColumn);
  }
  /**
  Extend this range to cover at least `from` to `to`.
  */
  extend(e, n = e, i = 0) {
    if (e <= this.anchor && n >= this.anchor)
      return Pt.range(e, n, void 0, void 0, i);
    let o = Math.abs(e - this.anchor) > Math.abs(n - this.anchor) ? e : n;
    return Pt.range(this.anchor, o, void 0, void 0, i);
  }
  /**
  Compare this range to another range.
  */
  eq(e, n = !1) {
    return this.anchor == e.anchor && this.head == e.head && this.goalColumn == e.goalColumn && (!n || !this.empty || this.assoc == e.assoc);
  }
  /**
  Return a JSON-serializable object representing the range.
  */
  toJSON() {
    return { anchor: this.anchor, head: this.head };
  }
  /**
  Convert a JSON representation of a range to a `SelectionRange`
  instance.
  */
  static fromJSON(e) {
    if (!e || typeof e.anchor != "number" || typeof e.head != "number")
      throw new RangeError("Invalid JSON representation for SelectionRange");
    return Pt.range(e.anchor, e.head);
  }
  /**
  @internal
  */
  static create(e, n, i, o) {
    return new gu(e, n, i, o);
  }
}
class Pt {
  constructor(e, n) {
    this.ranges = e, this.mainIndex = n;
  }
  /**
  Map a selection through a change. Used to adjust the selection
  position for changes.
  */
  map(e, n = -1) {
    return e.empty ? this : Pt.create(this.ranges.map((i) => i.map(e, n)), this.mainIndex);
  }
  /**
  Compare this selection to another selection. By default, ranges
  are compared only by position. When `includeAssoc` is true,
  cursor ranges must also have the same
  [`assoc`](https://codemirror.net/6/docs/ref/#state.SelectionRange.assoc) value.
  */
  eq(e, n = !1) {
    if (this.ranges.length != e.ranges.length || this.mainIndex != e.mainIndex)
      return !1;
    for (let i = 0; i < this.ranges.length; i++)
      if (!this.ranges[i].eq(e.ranges[i], n))
        return !1;
    return !0;
  }
  /**
  Get the primary selection range. Usually, you should make sure
  your code applies to _all_ ranges, by using methods like
  [`changeByRange`](https://codemirror.net/6/docs/ref/#state.EditorState.changeByRange).
  */
  get main() {
    return this.ranges[this.mainIndex];
  }
  /**
  Make sure the selection only has one range. Returns a selection
  holding only the main range from this selection.
  */
  asSingle() {
    return this.ranges.length == 1 ? this : new Pt([this.main], 0);
  }
  /**
  Extend this selection with an extra range.
  */
  addRange(e, n = !0) {
    return Pt.create([e].concat(this.ranges), n ? 0 : this.mainIndex + 1);
  }
  /**
  Replace a given range with another range, and then normalize the
  selection to merge and sort ranges if necessary.
  */
  replaceRange(e, n = this.mainIndex) {
    let i = this.ranges.slice();
    return i[n] = e, Pt.create(i, this.mainIndex);
  }
  /**
  Convert this selection to an object that can be serialized to
  JSON.
  */
  toJSON() {
    return { ranges: this.ranges.map((e) => e.toJSON()), main: this.mainIndex };
  }
  /**
  Create a selection from a JSON representation.
  */
  static fromJSON(e) {
    if (!e || !Array.isArray(e.ranges) || typeof e.main != "number" || e.main >= e.ranges.length)
      throw new RangeError("Invalid JSON representation for EditorSelection");
    return new Pt(e.ranges.map((n) => gu.fromJSON(n)), e.main);
  }
  /**
  Create a selection holding a single range.
  */
  static single(e, n = e) {
    return new Pt([Pt.range(e, n)], 0);
  }
  /**
  Sort and merge the given set of ranges, creating a valid
  selection.
  */
  static create(e, n = 0) {
    if (e.length == 0)
      throw new RangeError("A selection needs at least one range");
    for (let i = 0, o = 0; o < e.length; o++) {
      let r = e[o];
      if (r.empty ? r.from <= i : r.from < i)
        return Pt.normalized(e.slice(), n);
      i = r.to;
    }
    return new Pt(e, n);
  }
  /**
  Create a cursor selection range at the given position. You can
  safely ignore the optional arguments in most situations.
  */
  static cursor(e, n = 0, i, o) {
    return gu.create(e, e, (n == 0 ? 0 : n < 0 ? 8 : 16) | (i == null ? 7 : Math.min(6, i)), o);
  }
  /**
  Create a selection range.
  */
  static range(e, n, i, o, r) {
    let a = o == null ? 7 : Math.min(6, o);
    return !r && e != n && (r = n < e ? 1 : -1), r && (a |= r < 0 ? 8 : 16), n < e ? gu.create(n, e, a | 32, i) : gu.create(e, n, a, i);
  }
  /**
  Create an [undirectional](https://codemirror.net/6/docs/ref/#state.SelectionRange.undirectional)
  selection range.
  */
  static undirectionalRange(e, n) {
    return gu.create(e, n, 64, void 0);
  }
  /**
  @internal
  */
  static normalized(e, n = 0) {
    let i = e[n];
    e.sort((o, r) => o.from - r.from), n = e.indexOf(i);
    for (let o = 1; o < e.length; o++) {
      let r = e[o], a = e[o - 1];
      if (r.empty ? r.from <= a.to : r.from < a.to) {
        let l = a.from, s = Math.max(r.to, a.to);
        o <= n && n--, e.splice(--o, 2, r.anchor > r.head ? Pt.range(s, l) : Pt.range(l, s));
      }
    }
    return new Pt(e, n);
  }
}
function _4(t, e) {
  for (let n of t.ranges)
    if (n.to > e)
      throw new RangeError("Selection points outside of document");
}
let tk = 0;
class an {
  constructor(e, n, i, o, r) {
    this.combine = e, this.compareInput = n, this.compare = i, this.isStatic = o, this.id = tk++, this.default = e([]), this.extensions = typeof r == "function" ? r(this) : r;
  }
  /**
  Returns a facet reader for this facet, which can be used to
  [read](https://codemirror.net/6/docs/ref/#state.EditorState.facet) it but not to define values for it.
  */
  get reader() {
    return this;
  }
  /**
  Define a new facet.
  */
  static define(e = {}) {
    return new an(e.combine || ((n) => n), e.compareInput || ((n, i) => n === i), e.compare || (e.combine ? (n, i) => n === i : nk), !!e.static, e.enables);
  }
  /**
  Returns an extension that adds the given value to this facet.
  */
  of(e) {
    return new $v([], this, 0, e);
  }
  /**
  Create an extension that computes a value for the facet from a
  state. You must take care to declare the parts of the state that
  this value depends on, since your function is only called again
  for a new state when one of those parts changed.
  
  In cases where your value depends only on a single field, you'll
  want to use the [`from`](https://codemirror.net/6/docs/ref/#state.Facet.from) method instead.
  */
  compute(e, n) {
    if (this.isStatic)
      throw new Error("Can't compute a static facet");
    return new $v(e, this, 1, n);
  }
  /**
  Create an extension that computes zero or more values for this
  facet from a state.
  */
  computeN(e, n) {
    if (this.isStatic)
      throw new Error("Can't compute a static facet");
    return new $v(e, this, 2, n);
  }
  from(e, n) {
    return n || (n = (i) => i), this.compute([e], (i) => n(i.field(e)));
  }
}
function nk(t, e) {
  return t == e || t.length == e.length && t.every((n, i) => n === e[i]);
}
class $v {
  constructor(e, n, i, o) {
    this.dependencies = e, this.facet = n, this.type = i, this.value = o, this.id = tk++;
  }
  dynamicSlot(e) {
    var n;
    let i = this.value, o = this.facet.compareInput, r = this.id, a = e[r] >> 1, l = this.type == 2, s = !1, u = !1, c = [];
    for (let d of this.dependencies)
      d == "doc" ? s = !0 : d == "selection" ? u = !0 : (((n = e[d.id]) !== null && n !== void 0 ? n : 1) & 1) == 0 && c.push(e[d.id]);
    return {
      create(d) {
        return d.values[a] = i(d), 1;
      },
      update(d, f) {
        if (s && f.docChanged || u && (f.docChanged || f.selection) || CS(d, c)) {
          let h = i(d);
          if (l ? !WI(h, d.values[a], o) : !o(h, d.values[a]))
            return d.values[a] = h, 1;
        }
        return 0;
      },
      reconfigure: (d, f) => {
        let h, p = f.config.address[r];
        if (p != null) {
          let g = h0(f, p);
          if (this.dependencies.every((m) => m instanceof an ? f.facet(m) === d.facet(m) : m instanceof Fs ? f.field(m, !1) == d.field(m, !1) : !0) || (l ? WI(h = i(d), g, o) : o(h = i(d), g)))
            return d.values[a] = g, 0;
        } else
          h = i(d);
        return d.values[a] = h, 1;
      }
    };
  }
  get extension() {
    return this;
  }
}
function WI(t, e, n) {
  if (t.length != e.length)
    return !1;
  for (let i = 0; i < t.length; i++)
    if (!n(t[i], e[i]))
      return !1;
  return !0;
}
function CS(t, e) {
  let n = !1;
  for (let i of e)
    yp(t, i) & 1 && (n = !0);
  return n;
}
function vbe(t, e, n) {
  let i = n.map((s) => t[s.id]), o = n.map((s) => s.type), r = i.filter((s) => !(s & 1)), a = t[e.id] >> 1;
  function l(s) {
    let u = [];
    for (let c = 0; c < i.length; c++) {
      let d = h0(s, i[c]);
      if (o[c] == 2)
        for (let f of d)
          u.push(f);
      else
        u.push(d);
    }
    return e.combine(u);
  }
  return {
    create(s) {
      for (let u of i)
        yp(s, u);
      return s.values[a] = l(s), 1;
    },
    update(s, u) {
      if (!CS(s, r))
        return 0;
      let c = l(s);
      return e.compare(c, s.values[a]) ? 0 : (s.values[a] = c, 1);
    },
    reconfigure(s, u) {
      let c = CS(s, i), d = u.config.facets[e.id], f = u.facet(e);
      if (d && !c && nk(n, d))
        return s.values[a] = f, 0;
      let h = l(s);
      return e.compare(h, f) ? (s.values[a] = f, 0) : (s.values[a] = h, 1);
    }
  };
}
const _m = /* @__PURE__ */ an.define({ static: !0 });
class Fs {
  constructor(e, n, i, o, r) {
    this.id = e, this.createF = n, this.updateF = i, this.compareF = o, this.spec = r, this.provides = void 0;
  }
  /**
  Define a state field.
  */
  static define(e) {
    let n = new Fs(tk++, e.create, e.update, e.compare || ((i, o) => i === o), e);
    return e.provide && (n.provides = e.provide(n)), n;
  }
  create(e) {
    let n = e.facet(_m).find((i) => i.field == this);
    return (n?.create || this.createF)(e);
  }
  /**
  @internal
  */
  slot(e) {
    let n = e[this.id] >> 1;
    return {
      create: (i) => (i.values[n] = this.create(i), 1),
      update: (i, o) => {
        let r = i.values[n], a = this.updateF(r, o);
        return this.compareF(r, a) ? 0 : (i.values[n] = a, 1);
      },
      reconfigure: (i, o) => {
        let r = i.facet(_m), a = o.facet(_m), l;
        return (l = r.find((s) => s.field == this)) && l != a.find((s) => s.field == this) ? (i.values[n] = l.create(i), 1) : o.config.address[this.id] != null ? (i.values[n] = o.field(this), 0) : (i.values[n] = this.create(i), 1);
      }
    };
  }
  /**
  Returns an extension that enables this field and overrides the
  way it is initialized. Can be useful when you need to provide a
  non-default starting value for the field.
  */
  init(e) {
    return [this, _m.of({ field: this, create: e })];
  }
  /**
  State field instances can be used as
  [`Extension`](https://codemirror.net/6/docs/ref/#state.Extension) values to enable the field in a
  given state.
  */
  get extension() {
    return this;
  }
}
const wc = { lowest: 4, low: 3, default: 2, high: 1, highest: 0 };
function Dh(t) {
  return (e) => new I4(e, t);
}
const dd = {
  /**
  The highest precedence level, for extensions that should end up
  near the start of the precedence ordering.
  */
  highest: /* @__PURE__ */ Dh(wc.highest),
  /**
  A higher-than-default precedence, for extensions that should
  come before those with default precedence.
  */
  high: /* @__PURE__ */ Dh(wc.high),
  /**
  The default precedence, which is also used for extensions
  without an explicit precedence.
  */
  default: /* @__PURE__ */ Dh(wc.default),
  /**
  A lower-than-default precedence.
  */
  low: /* @__PURE__ */ Dh(wc.low),
  /**
  The lowest precedence level. Meant for things that should end up
  near the end of the extension order.
  */
  lowest: /* @__PURE__ */ Dh(wc.lowest)
};
class I4 {
  constructor(e, n) {
    this.inner = e, this.prec = n;
  }
  get extension() {
    return this;
  }
}
class Qy {
  /**
  Create an instance of this compartment to add to your [state
  configuration](https://codemirror.net/6/docs/ref/#state.EditorStateConfig.extensions).
  */
  of(e) {
    return new $S(this, e);
  }
  /**
  Create an [effect](https://codemirror.net/6/docs/ref/#state.TransactionSpec.effects) that
  reconfigures this compartment.
  */
  reconfigure(e) {
    return Qy.reconfigure.of({ compartment: this, extension: e });
  }
  /**
  Get the current content of the compartment in the state, or
  `undefined` if it isn't present.
  */
  get(e) {
    return e.config.compartments.get(this);
  }
}
class $S {
  constructor(e, n) {
    this.compartment = e, this.inner = n;
  }
  get extension() {
    return this;
  }
}
class f0 {
  constructor(e, n, i, o, r, a) {
    for (this.base = e, this.compartments = n, this.dynamicSlots = i, this.address = o, this.staticValues = r, this.facets = a, this.statusTemplate = []; this.statusTemplate.length < i.length; )
      this.statusTemplate.push(
        0
        /* SlotStatus.Unresolved */
      );
  }
  staticFacet(e) {
    let n = this.address[e.id];
    return n == null ? e.default : this.staticValues[n >> 1];
  }
  static resolve(e, n, i) {
    let o = [], r = /* @__PURE__ */ Object.create(null), a = /* @__PURE__ */ new Map();
    for (let f of ybe(e, n, a))
      f instanceof Fs ? o.push(f) : (r[f.facet.id] || (r[f.facet.id] = [])).push(f);
    let l = /* @__PURE__ */ Object.create(null), s = [], u = [];
    for (let f of o)
      l[f.id] = u.length << 1, u.push((h) => f.slot(h));
    let c = i?.config.facets;
    for (let f in r) {
      let h = r[f], p = h[0].facet, g = c && c[f] || [];
      if (h.every(
        (m) => m.type == 0
        /* Provider.Static */
      ))
        if (l[p.id] = s.length << 1 | 1, nk(g, h))
          s.push(i.facet(p));
        else {
          let m = p.combine(h.map((y) => y.value));
          s.push(i && p.compare(m, i.facet(p)) ? i.facet(p) : m);
        }
      else {
        for (let m of h)
          m.type == 0 ? (l[m.id] = s.length << 1 | 1, s.push(m.value)) : (l[m.id] = u.length << 1, u.push((y) => m.dynamicSlot(y)));
        l[p.id] = u.length << 1, u.push((m) => vbe(m, p, h));
      }
    }
    let d = u.map((f) => f(l));
    return new f0(e, a, d, l, s, r);
  }
}
function ybe(t, e, n) {
  let i = [[], [], [], [], []], o = /* @__PURE__ */ new Map();
  function r(a, l) {
    let s = o.get(a);
    if (s != null) {
      if (s <= l)
        return;
      let u = i[s].indexOf(a);
      u > -1 && i[s].splice(u, 1), a instanceof $S && n.delete(a.compartment);
    }
    if (o.set(a, l), Array.isArray(a))
      for (let u of a)
        r(u, l);
    else if (a instanceof $S) {
      if (n.has(a.compartment))
        throw new RangeError("Duplicate use of compartment in extensions");
      let u = e.get(a.compartment) || a.inner;
      n.set(a.compartment, u), r(u, l);
    } else if (a instanceof I4)
      r(a.inner, a.prec);
    else if (a instanceof Fs)
      i[l].push(a), a.provides && r(a.provides, l);
    else if (a instanceof $v)
      i[l].push(a), a.facet.extensions && r(a.facet.extensions, wc.default);
    else {
      let u = a.extension;
      if (!u)
        throw new Error(`Unrecognized extension value in extension set (${a}).`);
      if (u == a)
        throw new Error(`Unrecognized extension value in extension set (${a}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);
      r(u, l);
    }
  }
  return r(t, wc.default), i.reduce((a, l) => a.concat(l));
}
function yp(t, e) {
  if (e & 1)
    return 2;
  let n = e >> 1, i = t.status[n];
  if (i == 4)
    throw new Error("Cyclic dependency between fields and/or facets");
  if (i & 2)
    return i;
  t.status[n] = 4;
  let o = t.computeSlot(t, t.config.dynamicSlots[n]);
  return t.status[n] = 2 | o;
}
function h0(t, e) {
  return e & 1 ? t.config.staticValues[e >> 1] : t.values[e >> 1];
}
const M4 = /* @__PURE__ */ an.define(), kS = /* @__PURE__ */ an.define({
  combine: (t) => t.some((e) => e),
  static: !0
}), A4 = /* @__PURE__ */ an.define({
  combine: (t) => t.length ? t[0] : void 0,
  static: !0
}), R4 = /* @__PURE__ */ an.define(), D4 = /* @__PURE__ */ an.define(), N4 = /* @__PURE__ */ an.define(), L4 = /* @__PURE__ */ an.define({
  combine: (t) => t.length ? t[0] : !1
});
class fd {
  /**
  @internal
  */
  constructor(e, n) {
    this.type = e, this.value = n;
  }
  /**
  Define a new type of annotation.
  */
  static define() {
    return new bbe();
  }
}
class bbe {
  /**
  Create an instance of this annotation.
  */
  of(e) {
    return new fd(this, e);
  }
}
class xbe {
  /**
  @internal
  */
  constructor(e) {
    this.map = e;
  }
  /**
  Create a [state effect](https://codemirror.net/6/docs/ref/#state.StateEffect) instance of this
  type.
  */
  of(e) {
    return new xi(this, e);
  }
}
class xi {
  /**
  @internal
  */
  constructor(e, n) {
    this.type = e, this.value = n;
  }
  /**
  Map this effect through a position mapping. Will return
  `undefined` when that ends up deleting the effect.
  */
  map(e) {
    let n = this.type.map(this.value, e);
    return n === void 0 ? void 0 : n == this.value ? this : new xi(this.type, n);
  }
  /**
  Tells you whether this effect object is of a given
  [type](https://codemirror.net/6/docs/ref/#state.StateEffectType).
  */
  is(e) {
    return this.type == e;
  }
  /**
  Define a new effect type. The type parameter indicates the type
  of values that his effect holds. It should be a type that
  doesn't include `undefined`, since that is used in
  [mapping](https://codemirror.net/6/docs/ref/#state.StateEffect.map) to indicate that an effect is
  removed.
  */
  static define(e = {}) {
    return new xbe(e.map || ((n) => n));
  }
  /**
  Map an array of effects through a change set.
  */
  static mapEffects(e, n) {
    if (!e.length)
      return e;
    let i = [];
    for (let o of e) {
      let r = o.map(n);
      r && i.push(r);
    }
    return i;
  }
}
xi.reconfigure = /* @__PURE__ */ xi.define();
xi.appendConfig = /* @__PURE__ */ xi.define();
class Ao {
  constructor(e, n, i, o, r, a) {
    this.startState = e, this.changes = n, this.selection = i, this.effects = o, this.annotations = r, this.scrollIntoView = a, this._doc = null, this._state = null, i && _4(i, n.newLength), r.some((l) => l.type == Ao.time) || (this.annotations = r.concat(Ao.time.of(Date.now())));
  }
  /**
  @internal
  */
  static create(e, n, i, o, r, a) {
    return new Ao(e, n, i, o, r, a);
  }
  /**
  The new document produced by the transaction. Contrary to
  [`.state`](https://codemirror.net/6/docs/ref/#state.Transaction.state)`.doc`, accessing this won't
  force the entire new state to be computed right away, so it is
  recommended that [transaction
  filters](https://codemirror.net/6/docs/ref/#state.EditorState^transactionFilter) use this getter
  when they need to look at the new document.
  */
  get newDoc() {
    return this._doc || (this._doc = this.changes.apply(this.startState.doc));
  }
  /**
  The new selection produced by the transaction. If
  [`this.selection`](https://codemirror.net/6/docs/ref/#state.Transaction.selection) is undefined,
  this will [map](https://codemirror.net/6/docs/ref/#state.EditorSelection.map) the start state's
  current selection through the changes made by the transaction.
  */
  get newSelection() {
    return this.selection || this.startState.selection.map(this.changes);
  }
  /**
  The new state created by the transaction. Computed on demand
  (but retained for subsequent access), so it is recommended not to
  access it in [transaction
  filters](https://codemirror.net/6/docs/ref/#state.EditorState^transactionFilter) when possible.
  */
  get state() {
    return this._state || this.startState.applyTransaction(this), this._state;
  }
  /**
  Get the value of the given annotation type, if any.
  */
  annotation(e) {
    for (let n of this.annotations)
      if (n.type == e)
        return n.value;
  }
  /**
  Indicates whether the transaction changed the document.
  */
  get docChanged() {
    return !this.changes.empty;
  }
  /**
  Indicates whether this transaction reconfigures the state
  (through a [configuration compartment](https://codemirror.net/6/docs/ref/#state.Compartment) or
  with a top-level configuration
  [effect](https://codemirror.net/6/docs/ref/#state.StateEffect^reconfigure).
  */
  get reconfigured() {
    return this.startState.config != this.state.config;
  }
  /**
  Returns true if the transaction has a [user
  event](https://codemirror.net/6/docs/ref/#state.Transaction^userEvent) annotation that is equal to
  or more specific than `event`. For example, if the transaction
  has `"select.pointer"` as user event, `"select"` and
  `"select.pointer"` will match it.
  */
  isUserEvent(e) {
    let n = this.annotation(Ao.userEvent);
    return !!(n && (n == e || n.length > e.length && n.slice(0, e.length) == e && n[e.length] == "."));
  }
}
Ao.time = /* @__PURE__ */ fd.define();
Ao.userEvent = /* @__PURE__ */ fd.define();
Ao.addToHistory = /* @__PURE__ */ fd.define();
Ao.remote = /* @__PURE__ */ fd.define();
function Obe(t, e) {
  let n = [];
  for (let i = 0, o = 0; ; ) {
    let r, a;
    if (i < t.length && (o == e.length || e[o] >= t[i]))
      r = t[i++], a = t[i++];
    else if (o < e.length)
      r = e[o++], a = e[o++];
    else
      return n;
    !n.length || n[n.length - 1] < r ? n.push(r, a) : n[n.length - 1] < a && (n[n.length - 1] = a);
  }
}
function z4(t, e, n) {
  var i;
  let o, r, a;
  return n ? (o = e.changes, r = bo.empty(e.changes.length), a = t.changes.compose(e.changes)) : (o = e.changes.map(t.changes), r = t.changes.mapDesc(e.changes, !0), a = t.changes.compose(o)), {
    changes: a,
    selection: e.selection ? e.selection.map(r) : (i = t.selection) === null || i === void 0 ? void 0 : i.map(o),
    effects: xi.mapEffects(t.effects, o).concat(xi.mapEffects(e.effects, r)),
    annotations: t.annotations.length ? t.annotations.concat(e.annotations) : e.annotations,
    scrollIntoView: t.scrollIntoView || e.scrollIntoView
  };
}
function TS(t, e, n) {
  let i = e.selection, o = mf(e.annotations);
  return e.userEvent && (o = o.concat(Ao.userEvent.of(e.userEvent))), {
    changes: e.changes instanceof bo ? e.changes : bo.of(e.changes || [], n, t.facet(A4)),
    selection: i && (i instanceof Pt ? i : Pt.single(i.anchor, i.head)),
    effects: mf(e.effects),
    annotations: o,
    scrollIntoView: !!e.scrollIntoView
  };
}
function B4(t, e, n) {
  let i = TS(t, e.length ? e[0] : {}, t.doc.length);
  e.length && e[0].filter === !1 && (n = !1);
  for (let r = 1; r < e.length; r++) {
    e[r].filter === !1 && (n = !1);
    let a = !!e[r].sequential;
    i = z4(i, TS(t, e[r], a ? i.changes.newLength : t.doc.length), a);
  }
  let o = Ao.create(t, i.changes, i.selection, i.effects, i.annotations, i.scrollIntoView);
  return wbe(n ? Sbe(o) : o);
}
function Sbe(t) {
  let e = t.startState, n = !0;
  for (let o of e.facet(R4)) {
    let r = o(t);
    if (r === !1) {
      n = !1;
      break;
    }
    Array.isArray(r) && (n = n === !0 ? r : Obe(n, r));
  }
  if (n !== !0) {
    let o, r;
    if (n === !1)
      r = t.changes.invertedDesc, o = bo.empty(e.doc.length);
    else {
      let a = t.changes.filter(n);
      o = a.changes, r = a.filtered.mapDesc(a.changes).invertedDesc;
    }
    t = Ao.create(e, o, t.selection && t.selection.map(r), xi.mapEffects(t.effects, r), t.annotations, t.scrollIntoView);
  }
  let i = e.facet(D4);
  for (let o = i.length - 1; o >= 0; o--) {
    let r = i[o](t);
    r instanceof Ao ? t = r : Array.isArray(r) && r.length == 1 && r[0] instanceof Ao ? t = r[0] : t = B4(e, mf(r), !1);
  }
  return t;
}
function wbe(t) {
  let e = t.startState, n = e.facet(N4), i = t;
  for (let o = n.length - 1; o >= 0; o--) {
    let r = n[o](t);
    r && Object.keys(r).length && (i = z4(i, TS(e, r, t.changes.newLength), !0));
  }
  return i == t ? t : Ao.create(e, t.changes, t.selection, i.effects, i.annotations, i.scrollIntoView);
}
const Cbe = [];
function mf(t) {
  return t == null ? Cbe : Array.isArray(t) ? t : [t];
}
var hs = /* @__PURE__ */ (function(t) {
  return t[t.Word = 0] = "Word", t[t.Space = 1] = "Space", t[t.Other = 2] = "Other", t;
})(hs || (hs = {}));
const $be = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;
let PS;
try {
  PS = /* @__PURE__ */ new RegExp("[\\p{Alphabetic}\\p{Number}_]", "u");
} catch {
}
function kbe(t) {
  if (PS)
    return PS.test(t);
  for (let e = 0; e < t.length; e++) {
    let n = t[e];
    if (/\w/.test(n) || n > "" && (n.toUpperCase() != n.toLowerCase() || $be.test(n)))
      return !0;
  }
  return !1;
}
function Tbe(t) {
  return (e) => {
    if (!/\S/.test(e))
      return hs.Space;
    if (kbe(e))
      return hs.Word;
    for (let n = 0; n < t.length; n++)
      if (e.indexOf(t[n]) > -1)
        return hs.Word;
    return hs.Other;
  };
}
class ni {
  constructor(e, n, i, o, r, a) {
    this.config = e, this.doc = n, this.selection = i, this.values = o, this.status = e.statusTemplate.slice(), this.computeSlot = r, a && (a._state = this);
    for (let l = 0; l < this.config.dynamicSlots.length; l++)
      yp(this, l << 1);
    this.computeSlot = null;
  }
  field(e, n = !0) {
    let i = this.config.address[e.id];
    if (i == null) {
      if (n)
        throw new RangeError("Field is not present in this state");
      return;
    }
    return yp(this, i), h0(this, i);
  }
  /**
  Create a [transaction](https://codemirror.net/6/docs/ref/#state.Transaction) that updates this
  state. Any number of [transaction specs](https://codemirror.net/6/docs/ref/#state.TransactionSpec)
  can be passed. Unless
  [`sequential`](https://codemirror.net/6/docs/ref/#state.TransactionSpec.sequential) is set, the
  [changes](https://codemirror.net/6/docs/ref/#state.TransactionSpec.changes) (if any) of each spec
  are assumed to start in the _current_ document (not the document
  produced by previous specs), and its
  [selection](https://codemirror.net/6/docs/ref/#state.TransactionSpec.selection) and
  [effects](https://codemirror.net/6/docs/ref/#state.TransactionSpec.effects) are assumed to refer
  to the document created by its _own_ changes. The resulting
  transaction contains the combined effect of all the different
  specs. For [selection](https://codemirror.net/6/docs/ref/#state.TransactionSpec.selection), later
  specs take precedence over earlier ones.
  */
  update(...e) {
    return B4(this, e, !0);
  }
  /**
  @internal
  */
  applyTransaction(e) {
    let n = this.config, { base: i, compartments: o } = n;
    for (let l of e.effects)
      l.is(Qy.reconfigure) ? (n && (o = /* @__PURE__ */ new Map(), n.compartments.forEach((s, u) => o.set(u, s)), n = null), o.set(l.value.compartment, l.value.extension)) : l.is(xi.reconfigure) ? (n = null, i = l.value) : l.is(xi.appendConfig) && (n = null, i = mf(i).concat(l.value));
    let r;
    n ? r = e.startState.values.slice() : (n = f0.resolve(i, o, this), r = new ni(n, this.doc, this.selection, n.dynamicSlots.map(() => null), (s, u) => u.reconfigure(s, this), null).values);
    let a = e.startState.facet(kS) ? e.newSelection : e.newSelection.asSingle();
    new ni(n, e.newDoc, a, r, (l, s) => s.update(l, e), e);
  }
  /**
  Create a [transaction spec](https://codemirror.net/6/docs/ref/#state.TransactionSpec) that
  replaces every selection range with the given content.
  */
  replaceSelection(e) {
    return typeof e == "string" && (e = this.toText(e)), this.changeByRange((n) => ({
      changes: { from: n.from, to: n.to, insert: e },
      range: Pt.cursor(n.from + e.length)
    }));
  }
  /**
  Create a set of changes and a new selection by running the given
  function for each range in the active selection. The function
  can return an optional set of changes (in the coordinate space
  of the start document), plus an updated range (in the coordinate
  space of the document produced by the call's own changes). This
  method will merge all the changes and ranges into a single
  changeset and selection, and return it as a [transaction
  spec](https://codemirror.net/6/docs/ref/#state.TransactionSpec), which can be passed to
  [`update`](https://codemirror.net/6/docs/ref/#state.EditorState.update).
  */
  changeByRange(e) {
    let n = this.selection, i = e(n.ranges[0]), o = this.changes(i.changes), r = [i.range], a = mf(i.effects);
    for (let l = 1; l < n.ranges.length; l++) {
      let s = e(n.ranges[l]), u = this.changes(s.changes), c = u.map(o);
      for (let f = 0; f < l; f++)
        r[f] = r[f].map(c);
      let d = o.mapDesc(u, !0);
      r.push(s.range.map(d)), o = o.compose(c), a = xi.mapEffects(a, c).concat(xi.mapEffects(mf(s.effects), d));
    }
    return {
      changes: o,
      selection: Pt.create(r, n.mainIndex),
      effects: a
    };
  }
  /**
  Create a [change set](https://codemirror.net/6/docs/ref/#state.ChangeSet) from the given change
  description, taking the state's document length and line
  separator into account.
  */
  changes(e = []) {
    return e instanceof bo ? e : bo.of(e, this.doc.length, this.facet(ni.lineSeparator));
  }
  /**
  Using the state's [line
  separator](https://codemirror.net/6/docs/ref/#state.EditorState^lineSeparator), create a
  [`Text`](https://codemirror.net/6/docs/ref/#state.Text) instance from the given string.
  */
  toText(e) {
    return Wn.of(e.split(this.facet(ni.lineSeparator) || OS));
  }
  /**
  Return the given range of the document as a string.
  */
  sliceDoc(e = 0, n = this.doc.length) {
    return this.doc.sliceString(e, n, this.lineBreak);
  }
  /**
  Get the value of a state [facet](https://codemirror.net/6/docs/ref/#state.Facet).
  */
  facet(e) {
    let n = this.config.address[e.id];
    return n == null ? e.default : (yp(this, n), h0(this, n));
  }
  /**
  Convert this state to a JSON-serializable object. When custom
  fields should be serialized, you can pass them in as an object
  mapping property names (in the resulting object, which should
  not use `doc` or `selection`) to fields.
  */
  toJSON(e) {
    let n = {
      doc: this.sliceDoc(),
      selection: this.selection.toJSON()
    };
    if (e)
      for (let i in e) {
        let o = e[i];
        o instanceof Fs && this.config.address[o.id] != null && (n[i] = o.spec.toJSON(this.field(e[i]), this));
      }
    return n;
  }
  /**
  Deserialize a state from its JSON representation. When custom
  fields should be deserialized, pass the same object you passed
  to [`toJSON`](https://codemirror.net/6/docs/ref/#state.EditorState.toJSON) when serializing as
  third argument.
  */
  static fromJSON(e, n = {}, i) {
    if (!e || typeof e.doc != "string")
      throw new RangeError("Invalid JSON representation for EditorState");
    let o = [];
    if (i) {
      for (let r in i)
        if (Object.prototype.hasOwnProperty.call(e, r)) {
          let a = i[r], l = e[r];
          o.push(a.init((s) => a.spec.fromJSON(l, s)));
        }
    }
    return ni.create({
      doc: e.doc,
      selection: Pt.fromJSON(e.selection),
      extensions: n.extensions ? o.concat([n.extensions]) : o
    });
  }
  /**
  Create a new state. You'll usually only need this when
  initializing an editor—updated states are created by applying
  transactions.
  */
  static create(e = {}) {
    let n = f0.resolve(e.extensions || [], /* @__PURE__ */ new Map()), i = e.doc instanceof Wn ? e.doc : Wn.of((e.doc || "").split(n.staticFacet(ni.lineSeparator) || OS)), o = e.selection ? e.selection instanceof Pt ? e.selection : Pt.single(e.selection.anchor, e.selection.head) : Pt.single(0);
    return _4(o, i.length), n.staticFacet(kS) || (o = o.asSingle()), new ni(n, i, o, n.dynamicSlots.map(() => null), (r, a) => a.create(r), null);
  }
  /**
  The size (in columns) of a tab in the document, determined by
  the [`tabSize`](https://codemirror.net/6/docs/ref/#state.EditorState^tabSize) facet.
  */
  get tabSize() {
    return this.facet(ni.tabSize);
  }
  /**
  Get the proper [line-break](https://codemirror.net/6/docs/ref/#state.EditorState^lineSeparator)
  string for this state.
  */
  get lineBreak() {
    return this.facet(ni.lineSeparator) || `
`;
  }
  /**
  Returns true when the editor is
  [configured](https://codemirror.net/6/docs/ref/#state.EditorState^readOnly) to be read-only.
  */
  get readOnly() {
    return this.facet(L4);
  }
  /**
  Look up a translation for the given phrase (via the
  [`phrases`](https://codemirror.net/6/docs/ref/#state.EditorState^phrases) facet), or return the
  original string if no translation is found.
  
  If additional arguments are passed, they will be inserted in
  place of markers like `$1` (for the first value) and `$2`, etc.
  A single `$` is equivalent to `$1`, and `$$` will produce a
  literal dollar sign.
  */
  phrase(e, ...n) {
    for (let i of this.facet(ni.phrases))
      if (Object.prototype.hasOwnProperty.call(i, e)) {
        e = i[e];
        break;
      }
    return n.length && (e = e.replace(/\$(\$|\d*)/g, (i, o) => {
      if (o == "$")
        return "$";
      let r = +(o || 1);
      return !r || r > n.length ? i : n[r - 1];
    })), e;
  }
  /**
  Find the values for a given language data field, provided by the
  the [`languageData`](https://codemirror.net/6/docs/ref/#state.EditorState^languageData) facet.
  
  Examples of language data fields are...
  
  - [`"commentTokens"`](https://codemirror.net/6/docs/ref/#commands.CommentTokens) for specifying
    comment syntax.
  - [`"autocomplete"`](https://codemirror.net/6/docs/ref/#autocomplete.autocompletion^config.override)
    for providing language-specific completion sources.
  - [`"wordChars"`](https://codemirror.net/6/docs/ref/#state.EditorState.charCategorizer) for adding
    characters that should be considered part of words in this
    language.
  - [`"closeBrackets"`](https://codemirror.net/6/docs/ref/#autocomplete.CloseBracketConfig) controls
    bracket closing behavior.
  */
  languageDataAt(e, n, i = -1) {
    let o = [];
    for (let r of this.facet(M4))
      for (let a of r(this, n, i))
        Object.prototype.hasOwnProperty.call(a, e) && o.push(a[e]);
    return o;
  }
  /**
  Return a function that can categorize strings (expected to
  represent a single [grapheme cluster](https://codemirror.net/6/docs/ref/#state.findClusterBreak))
  into one of:
  
   - Word (contains an alphanumeric character or a character
     explicitly listed in the local language's `"wordChars"`
     language data, which should be a string)
   - Space (contains only whitespace)
   - Other (anything else)
  */
  charCategorizer(e) {
    let n = this.languageDataAt("wordChars", e);
    return Tbe(n.length ? n[0] : "");
  }
  /**
  Find the word at the given position, meaning the range
  containing all [word](https://codemirror.net/6/docs/ref/#state.CharCategory.Word) characters
  around it. If no word characters are adjacent to the position,
  this returns null.
  */
  wordAt(e) {
    let { text: n, from: i, length: o } = this.doc.lineAt(e), r = this.charCategorizer(e), a = e - i, l = e - i;
    for (; a > 0; ) {
      let s = $l(n, a, !1);
      if (r(n.slice(s, a)) != hs.Word)
        break;
      a = s;
    }
    for (; l < o; ) {
      let s = $l(n, l);
      if (r(n.slice(l, s)) != hs.Word)
        break;
      l = s;
    }
    return a == l ? null : Pt.range(a + i, l + i);
  }
}
ni.allowMultipleSelections = kS;
ni.tabSize = /* @__PURE__ */ an.define({
  combine: (t) => t.length ? t[0] : 4
});
ni.lineSeparator = A4;
ni.readOnly = L4;
ni.phrases = /* @__PURE__ */ an.define({
  compare(t, e) {
    let n = Object.keys(t), i = Object.keys(e);
    return n.length == i.length && n.every((o) => t[o] == e[o]);
  }
});
ni.languageData = M4;
ni.changeFilter = R4;
ni.transactionFilter = D4;
ni.transactionExtender = N4;
Qy.reconfigure = /* @__PURE__ */ xi.define();
function Pbe(t, e, n = {}) {
  let i = {};
  for (let o of t)
    for (let r of Object.keys(o)) {
      let a = o[r], l = i[r];
      if (l === void 0)
        i[r] = a;
      else if (!(l === a || a === void 0)) if (Object.hasOwnProperty.call(n, r))
        i[r] = n[r](l, a);
      else
        throw new Error("Config merge conflict for field " + r);
    }
  for (let o in e)
    i[o] === void 0 && (i[o] = e[o]);
  return i;
}
class Ru {
  /**
  Compare this value with another value. Used when comparing
  rangesets. The default implementation compares by identity.
  Unless you are only creating a fixed number of unique instances
  of your value type, it is a good idea to implement this
  properly.
  */
  eq(e) {
    return this == e;
  }
  /**
  Create a [range](https://codemirror.net/6/docs/ref/#state.Range) with this value.
  */
  range(e, n = e) {
    return ES.create(e, n, this);
  }
}
Ru.prototype.startSide = Ru.prototype.endSide = 0;
Ru.prototype.point = !1;
Ru.prototype.mapMode = nr.TrackDel;
function ik(t, e) {
  return t == e || t.constructor == e.constructor && t.eq(e);
}
let ES = class F4 {
  constructor(e, n, i) {
    this.from = e, this.to = n, this.value = i;
  }
  /**
  @internal
  */
  static create(e, n, i) {
    return new F4(e, n, i);
  }
};
function _S(t, e) {
  return t.from - e.from || t.value.startSide - e.value.startSide;
}
class ok {
  constructor(e, n, i, o) {
    this.from = e, this.to = n, this.value = i, this.maxPoint = o;
  }
  get length() {
    return this.to[this.to.length - 1];
  }
  // Find the index of the given position and side. Use the ranges'
  // `from` pos when `end == false`, `to` when `end == true`.
  findIndex(e, n, i, o = 0) {
    let r = i ? this.to : this.from;
    for (let a = o, l = r.length; ; ) {
      if (a == l)
        return a;
      let s = a + l >> 1, u = r[s] - e || (i ? this.value[s].endSide : this.value[s].startSide) - n;
      if (s == a)
        return u >= 0 ? a : l;
      u >= 0 ? l = s : a = s + 1;
    }
  }
  between(e, n, i, o) {
    for (let r = this.findIndex(n, -1e9, !0), a = this.findIndex(i, 1e9, !1, r); r < a; r++)
      if (o(this.from[r] + e, this.to[r] + e, this.value[r]) === !1)
        return !1;
  }
  map(e, n) {
    let i = [], o = [], r = [], a = -1, l = -1;
    for (let s = 0; s < this.value.length; s++) {
      let u = this.value[s], c = this.from[s] + e, d = this.to[s] + e, f, h;
      if (c == d) {
        let p = n.mapPos(c, u.startSide, u.mapMode);
        if (p == null || (f = h = p, u.startSide != u.endSide && (h = n.mapPos(c, u.endSide), h < f)))
          continue;
      } else if (f = n.mapPos(c, u.startSide), h = n.mapPos(d, u.endSide), f > h || f == h && u.startSide > 0 && u.endSide <= 0)
        continue;
      (h - f || u.endSide - u.startSide) < 0 || (a < 0 && (a = f), u.point && (l = Math.max(l, h - f)), i.push(u), o.push(f - a), r.push(h - a));
    }
    return { mapped: i.length ? new ok(o, r, i, l) : null, pos: a };
  }
}
class ri {
  constructor(e, n, i, o) {
    this.chunkPos = e, this.chunk = n, this.nextLayer = i, this.maxPoint = o;
  }
  /**
  @internal
  */
  static create(e, n, i, o) {
    return new ri(e, n, i, o);
  }
  /**
  @internal
  */
  get length() {
    let e = this.chunk.length - 1;
    return e < 0 ? 0 : Math.max(this.chunkEnd(e), this.nextLayer.length);
  }
  /**
  The number of ranges in the set.
  */
  get size() {
    if (this.isEmpty)
      return 0;
    let e = this.nextLayer.size;
    for (let n of this.chunk)
      e += n.value.length;
    return e;
  }
  /**
  @internal
  */
  chunkEnd(e) {
    return this.chunkPos[e] + this.chunk[e].length;
  }
  /**
  Update the range set, optionally adding new ranges or filtering
  out existing ones.
  
  (Note: The type parameter is just there as a kludge to work
  around TypeScript variance issues that prevented `RangeSet<X>`
  from being a subtype of `RangeSet<Y>` when `X` is a subtype of
  `Y`.)
  */
  update(e) {
    let { add: n = [], sort: i = !1, filterFrom: o = 0, filterTo: r = this.length } = e, a = e.filter;
    if (n.length == 0 && !a)
      return this;
    if (i && (n = n.slice().sort(_S)), this.isEmpty)
      return n.length ? ri.of(n) : this;
    let l = new V4(this, null, -1).goto(0), s = 0, u = [], c = new Wf();
    for (; l.value || s < n.length; )
      if (s < n.length && (l.from - n[s].from || l.startSide - n[s].value.startSide) >= 0) {
        let d = n[s++];
        c.addInner(d.from, d.to, d.value) || u.push(d);
      } else l.rangeIndex == 1 && l.chunkIndex < this.chunk.length && (s == n.length || this.chunkEnd(l.chunkIndex) < n[s].from) && (!a || o > this.chunkEnd(l.chunkIndex) || r < this.chunkPos[l.chunkIndex]) && c.addChunk(this.chunkPos[l.chunkIndex], this.chunk[l.chunkIndex]) ? l.nextChunk() : ((!a || o > l.to || r < l.from || a(l.from, l.to, l.value)) && (c.addInner(l.from, l.to, l.value) || u.push(ES.create(l.from, l.to, l.value))), l.next());
    return c.finishInner(this.nextLayer.isEmpty && !u.length ? ri.empty : this.nextLayer.update({ add: u, filter: a, filterFrom: o, filterTo: r }));
  }
  /**
  Map this range set through a set of changes, return the new set.
  */
  map(e) {
    if (e.empty || this.isEmpty)
      return this;
    let n = [], i = [], o = -1;
    for (let a = 0; a < this.chunk.length; a++) {
      let l = this.chunkPos[a], s = this.chunk[a], u = e.touchesRange(l, l + s.length);
      if (u === !1)
        o = Math.max(o, s.maxPoint), n.push(s), i.push(e.mapPos(l));
      else if (u === !0) {
        let { mapped: c, pos: d } = s.map(l, e);
        c && (o = Math.max(o, c.maxPoint), n.push(c), i.push(d));
      }
    }
    let r = this.nextLayer.map(e);
    return n.length == 0 ? r : new ri(i, n, r || ri.empty, o);
  }
  /**
  Iterate over the ranges that touch the region `from` to `to`,
  calling `f` for each. There is no guarantee that the ranges will
  be reported in any specific order. When the callback returns
  `false`, iteration stops.
  */
  between(e, n, i) {
    if (!this.isEmpty) {
      for (let o = 0; o < this.chunk.length; o++) {
        let r = this.chunkPos[o], a = this.chunk[o];
        if (n >= r && e <= r + a.length && a.between(r, e - r, n - r, i) === !1)
          return;
      }
      this.nextLayer.between(e, n, i);
    }
  }
  /**
  Iterate over the ranges in this set, in order, including all
  ranges that end at or after `from`.
  */
  iter(e = 0) {
    return Yp.from([this]).goto(e);
  }
  /**
  @internal
  */
  get isEmpty() {
    return this.nextLayer == this;
  }
  /**
  Iterate over the ranges in a collection of sets, in order,
  starting from `from`.
  */
  static iter(e, n = 0) {
    return Yp.from(e).goto(n);
  }
  /**
  Iterate over two groups of sets, calling methods on `comparator`
  to notify it of possible differences.
  */
  static compare(e, n, i, o, r = -1) {
    let a = e.filter((d) => d.maxPoint > 0 || !d.isEmpty && d.maxPoint >= r), l = n.filter((d) => d.maxPoint > 0 || !d.isEmpty && d.maxPoint >= r), s = jI(a, l, i), u = new Nh(a, s, r), c = new Nh(l, s, r);
    i.iterGaps((d, f, h) => qI(u, d, c, f, h, o)), i.empty && i.length == 0 && qI(u, 0, c, 0, 0, o);
  }
  /**
  Compare the contents of two groups of range sets, returning true
  if they are equivalent in the given range.
  */
  static eq(e, n, i = 0, o) {
    o == null && (o = 999999999);
    let r = e.filter((c) => !c.isEmpty && n.indexOf(c) < 0), a = n.filter((c) => !c.isEmpty && e.indexOf(c) < 0);
    if (r.length != a.length)
      return !1;
    if (!r.length)
      return !0;
    let l = jI(r, a), s = new Nh(r, l, 0).goto(i), u = new Nh(a, l, 0).goto(i);
    for (; ; ) {
      if (s.to != u.to || !IS(s.active, u.active) || s.point && (!u.point || !ik(s.point, u.point)))
        return !1;
      if (s.to > o)
        return !0;
      s.next(), u.next();
    }
  }
  /**
  Iterate over a group of range sets at the same time, notifying
  the iterator about the ranges covering every given piece of
  content. Returns the open count (see
  [`SpanIterator.span`](https://codemirror.net/6/docs/ref/#state.SpanIterator.span)) at the end
  of the iteration.
  */
  static spans(e, n, i, o, r = -1) {
    let a = new Nh(e, null, r).goto(n), l = n, s = a.openStart;
    for (; ; ) {
      let u = Math.min(a.to, i);
      if (a.point) {
        let c = a.activeForPoint(a.to), d = a.pointFrom < n ? c.length + 1 : a.point.startSide < 0 ? c.length : Math.min(c.length, s);
        o.point(l, u, a.point, c, d, a.pointRank), s = Math.min(a.openEnd(u), c.length);
      } else u > l && (o.span(l, u, a.active, s), s = a.openEnd(u));
      if (a.to > i)
        return s + (a.point && a.to > i ? 1 : 0);
      l = a.to, a.next();
    }
  }
  /**
  Create a range set for the given range or array of ranges. By
  default, this expects the ranges to be _sorted_ (by start
  position and, if two start at the same position,
  `value.startSide`). You can pass `true` as second argument to
  cause the method to sort them.
  */
  static of(e, n = !1) {
    let i = new Wf();
    for (let o of e instanceof ES ? [e] : n ? Ebe(e) : e)
      i.add(o.from, o.to, o.value);
    return i.finish();
  }
  /**
  Join an array of range sets into a single set.
  */
  static join(e) {
    if (!e.length)
      return ri.empty;
    let n = e[e.length - 1];
    for (let i = e.length - 2; i >= 0; i--)
      for (let o = e[i]; o != ri.empty; o = o.nextLayer)
        n = new ri(o.chunkPos, o.chunk, n, Math.max(o.maxPoint, n.maxPoint));
    return n;
  }
}
ri.empty = /* @__PURE__ */ new ri([], [], null, -1);
function Ebe(t) {
  if (t.length > 1)
    for (let e = t[0], n = 1; n < t.length; n++) {
      let i = t[n];
      if (_S(e, i) > 0)
        return t.slice().sort(_S);
      e = i;
    }
  return t;
}
ri.empty.nextLayer = ri.empty;
class Wf {
  finishChunk(e) {
    this.chunks.push(new ok(this.from, this.to, this.value, this.maxPoint)), this.chunkPos.push(this.chunkStart), this.chunkStart = -1, this.setMaxPoint = Math.max(this.setMaxPoint, this.maxPoint), this.maxPoint = -1, e && (this.from = [], this.to = [], this.value = []);
  }
  /**
  Create an empty builder.
  */
  constructor() {
    this.chunks = [], this.chunkPos = [], this.chunkStart = -1, this.last = null, this.lastFrom = -1e9, this.lastTo = -1e9, this.from = [], this.to = [], this.value = [], this.maxPoint = -1, this.setMaxPoint = -1, this.nextLayer = null;
  }
  /**
  Add a range. Ranges should be added in sorted (by `from` and
  `value.startSide`) order.
  */
  add(e, n, i) {
    this.addInner(e, n, i) || (this.nextLayer || (this.nextLayer = new Wf())).add(e, n, i);
  }
  /**
  @internal
  */
  addInner(e, n, i) {
    let o = e - this.lastTo || i.startSide - this.last.endSide;
    if (o <= 0 && (e - this.lastFrom || i.startSide - this.last.startSide) < 0)
      throw new Error("Ranges must be added sorted by `from` position and `startSide`");
    return o < 0 ? !1 : (this.from.length == 250 && this.finishChunk(!0), this.chunkStart < 0 && (this.chunkStart = e), this.from.push(e - this.chunkStart), this.to.push(n - this.chunkStart), this.last = i, this.lastFrom = e, this.lastTo = n, this.value.push(i), i.point && (this.maxPoint = Math.max(this.maxPoint, n - e)), !0);
  }
  /**
  @internal
  */
  addChunk(e, n) {
    if ((e - this.lastTo || n.value[0].startSide - this.last.endSide) < 0)
      return !1;
    this.from.length && this.finishChunk(!0), this.setMaxPoint = Math.max(this.setMaxPoint, n.maxPoint), this.chunks.push(n), this.chunkPos.push(e);
    let i = n.value.length - 1;
    return this.last = n.value[i], this.lastFrom = n.from[i] + e, this.lastTo = n.to[i] + e, !0;
  }
  /**
  Finish the range set. Returns the new set. The builder can't be
  used anymore after this has been called.
  */
  finish() {
    return this.finishInner(ri.empty);
  }
  /**
  @internal
  */
  finishInner(e) {
    if (this.from.length && this.finishChunk(!1), this.chunks.length == 0)
      return e;
    let n = ri.create(this.chunkPos, this.chunks, this.nextLayer ? this.nextLayer.finishInner(e) : e, this.setMaxPoint);
    return this.from = null, n;
  }
}
function jI(t, e, n) {
  let i = /* @__PURE__ */ new Map();
  for (let r of t)
    for (let a = 0; a < r.chunk.length; a++)
      r.chunk[a].maxPoint <= 0 && i.set(r.chunk[a], r.chunkPos[a]);
  let o = /* @__PURE__ */ new Set();
  for (let r of e)
    for (let a = 0; a < r.chunk.length; a++) {
      let l = i.get(r.chunk[a]);
      l != null && (n ? n.mapPos(l) : l) == r.chunkPos[a] && !n?.touchesRange(l, l + r.chunk[a].length) && o.add(r.chunk[a]);
    }
  return o;
}
class V4 {
  constructor(e, n, i, o = 0) {
    this.layer = e, this.skip = n, this.minPoint = i, this.rank = o;
  }
  get startSide() {
    return this.value ? this.value.startSide : 0;
  }
  get endSide() {
    return this.value ? this.value.endSide : 0;
  }
  goto(e, n = -1e9) {
    return this.chunkIndex = this.rangeIndex = 0, this.gotoInner(e, n, !1), this;
  }
  gotoInner(e, n, i) {
    for (; this.chunkIndex < this.layer.chunk.length; ) {
      let o = this.layer.chunk[this.chunkIndex];
      if (!(this.skip && this.skip.has(o) || this.layer.chunkEnd(this.chunkIndex) < e || o.maxPoint < this.minPoint))
        break;
      this.chunkIndex++, i = !1;
    }
    if (this.chunkIndex < this.layer.chunk.length) {
      let o = this.layer.chunk[this.chunkIndex].findIndex(e - this.layer.chunkPos[this.chunkIndex], n, !0);
      (!i || this.rangeIndex < o) && this.setRangeIndex(o);
    }
    this.next();
  }
  forward(e, n) {
    (this.to - e || this.endSide - n) < 0 && this.gotoInner(e, n, !0);
  }
  next() {
    for (; ; )
      if (this.chunkIndex == this.layer.chunk.length) {
        this.from = this.to = 1e9, this.value = null;
        break;
      } else {
        let e = this.layer.chunkPos[this.chunkIndex], n = this.layer.chunk[this.chunkIndex], i = e + n.from[this.rangeIndex];
        if (this.from = i, this.to = e + n.to[this.rangeIndex], this.value = n.value[this.rangeIndex], this.setRangeIndex(this.rangeIndex + 1), this.minPoint < 0 || this.value.point && this.to - this.from >= this.minPoint)
          break;
      }
  }
  setRangeIndex(e) {
    if (e == this.layer.chunk[this.chunkIndex].value.length) {
      if (this.chunkIndex++, this.skip)
        for (; this.chunkIndex < this.layer.chunk.length && this.skip.has(this.layer.chunk[this.chunkIndex]); )
          this.chunkIndex++;
      this.rangeIndex = 0;
    } else
      this.rangeIndex = e;
  }
  nextChunk() {
    this.chunkIndex++, this.rangeIndex = 0, this.next();
  }
  compare(e) {
    return this.from - e.from || this.startSide - e.startSide || this.rank - e.rank || this.to - e.to || this.endSide - e.endSide;
  }
}
class Yp {
  constructor(e) {
    this.heap = e;
  }
  static from(e, n = null, i = -1) {
    let o = [];
    for (let r = 0; r < e.length; r++)
      for (let a = e[r]; !a.isEmpty; a = a.nextLayer)
        a.maxPoint >= i && o.push(new V4(a, n, i, r));
    return o.length == 1 ? o[0] : new Yp(o);
  }
  get startSide() {
    return this.value ? this.value.startSide : 0;
  }
  goto(e, n = -1e9) {
    for (let i of this.heap)
      i.goto(e, n);
    for (let i = this.heap.length >> 1; i >= 0; i--)
      q1(this.heap, i);
    return this.next(), this;
  }
  forward(e, n) {
    for (let i of this.heap)
      i.forward(e, n);
    for (let i = this.heap.length >> 1; i >= 0; i--)
      q1(this.heap, i);
    (this.to - e || this.value.endSide - n) < 0 && this.next();
  }
  next() {
    if (this.heap.length == 0)
      this.from = this.to = 1e9, this.value = null, this.rank = -1;
    else {
      let e = this.heap[0];
      this.from = e.from, this.to = e.to, this.value = e.value, this.rank = e.rank, e.value && e.next(), q1(this.heap, 0);
    }
  }
}
function q1(t, e) {
  for (let n = t[e]; ; ) {
    let i = (e << 1) + 1;
    if (i >= t.length)
      break;
    let o = t[i];
    if (i + 1 < t.length && o.compare(t[i + 1]) >= 0 && (o = t[i + 1], i++), n.compare(o) < 0)
      break;
    t[i] = n, t[e] = o, e = i;
  }
}
class Nh {
  constructor(e, n, i) {
    this.minPoint = i, this.active = [], this.activeTo = [], this.activeRank = [], this.minActive = -1, this.point = null, this.pointFrom = 0, this.pointRank = 0, this.to = -1e9, this.endSide = 0, this.openStart = -1, this.cursor = Yp.from(e, n, i);
  }
  goto(e, n = -1e9) {
    return this.cursor.goto(e, n), this.active.length = this.activeTo.length = this.activeRank.length = 0, this.minActive = -1, this.to = e, this.endSide = n, this.openStart = -1, this.next(), this;
  }
  forward(e, n) {
    for (; this.minActive > -1 && (this.activeTo[this.minActive] - e || this.active[this.minActive].endSide - n) < 0; )
      this.removeActive(this.minActive);
    this.cursor.forward(e, n);
  }
  removeActive(e) {
    Im(this.active, e), Im(this.activeTo, e), Im(this.activeRank, e), this.minActive = YI(this.active, this.activeTo);
  }
  addActive(e) {
    let n = 0, { value: i, to: o, rank: r } = this.cursor;
    for (; n < this.activeRank.length && (r - this.activeRank[n] || o - this.activeTo[n]) > 0; )
      n++;
    Mm(this.active, n, i), Mm(this.activeTo, n, o), Mm(this.activeRank, n, r), e && Mm(e, n, this.cursor.from), this.minActive = YI(this.active, this.activeTo);
  }
  // After calling this, if `this.point` != null, the next range is a
  // point. Otherwise, it's a regular range, covered by `this.active`.
  next() {
    let e = this.to, n = this.point;
    this.point = null;
    let i = this.openStart < 0 ? [] : null;
    for (; ; ) {
      let o = this.minActive;
      if (o > -1 && (this.activeTo[o] - this.cursor.from || this.active[o].endSide - this.cursor.startSide) < 0) {
        if (this.activeTo[o] > e) {
          this.to = this.activeTo[o], this.endSide = this.active[o].endSide;
          break;
        }
        this.removeActive(o), i && Im(i, o);
      } else if (this.cursor.value)
        if (this.cursor.from > e) {
          this.to = this.cursor.from, this.endSide = this.cursor.startSide;
          break;
        } else {
          let r = this.cursor.value;
          if (!r.point)
            this.addActive(i), this.cursor.next();
          else if (n && this.cursor.to == this.to && this.cursor.from < this.cursor.to)
            this.cursor.next();
          else {
            this.point = r, this.pointFrom = this.cursor.from, this.pointRank = this.cursor.rank, this.to = this.cursor.to, this.endSide = r.endSide, this.cursor.next(), this.forward(this.to, this.endSide);
            break;
          }
        }
      else {
        this.to = this.endSide = 1e9;
        break;
      }
    }
    if (i) {
      this.openStart = 0;
      for (let o = i.length - 1; o >= 0 && i[o] < e; o--)
        this.openStart++;
    }
  }
  activeForPoint(e) {
    if (!this.active.length)
      return this.active;
    let n = [];
    for (let i = this.active.length - 1; i >= 0 && !(this.activeRank[i] < this.pointRank); i--)
      (this.activeTo[i] > e || this.activeTo[i] == e && this.active[i].endSide >= this.point.endSide) && n.push(this.active[i]);
    return n.reverse();
  }
  openEnd(e) {
    let n = 0;
    for (let i = this.activeTo.length - 1; i >= 0 && this.activeTo[i] > e; i--)
      n++;
    return n;
  }
}
function qI(t, e, n, i, o, r) {
  t.goto(e), n.goto(i);
  let a = i + o, l = i, s = i - e, u = !!r.boundChange;
  for (let c = !1; ; ) {
    let d = t.to + s - n.to, f = d || t.endSide - n.endSide, h = f < 0 ? t.to + s : n.to, p = Math.min(h, a);
    if (t.point || n.point ? (t.point && n.point && ik(t.point, n.point) && IS(t.activeForPoint(t.to), n.activeForPoint(n.to)) || r.comparePoint(l, p, t.point, n.point), c = !1) : (c && r.boundChange(l), p > l && !IS(t.active, n.active) && r.compareRange(l, p, t.active, n.active), u && p < a && (d || t.openEnd(h) != n.openEnd(h)) && (c = !0)), h > a)
      break;
    l = h, f <= 0 && t.next(), f >= 0 && n.next();
  }
}
function IS(t, e) {
  if (t.length != e.length)
    return !1;
  for (let n = 0; n < t.length; n++)
    if (t[n] != e[n] && !ik(t[n], e[n]))
      return !1;
  return !0;
}
function Im(t, e) {
  for (let n = e, i = t.length - 1; n < i; n++)
    t[n] = t[n + 1];
  t.pop();
}
function Mm(t, e, n) {
  for (let i = t.length - 1; i >= e; i--)
    t[i + 1] = t[i];
  t[e] = n;
}
function YI(t, e) {
  let n = -1, i = 1e9;
  for (let o = 0; o < e.length; o++)
    (e[o] - i || t[o].endSide - t[n].endSide) < 0 && (n = o, i = e[o]);
  return n;
}
function _be(t, e, n, i) {
  for (let o = 0, r = 0; ; ) {
    if (r >= e)
      return o;
    if (o == t.length)
      break;
    r += t.charCodeAt(o) == 9 ? n - r % n : 1, o = $l(t, o);
  }
  return t.length;
}
const MS = "ͼ", KI = typeof Symbol > "u" ? "__" + MS : Symbol.for(MS), AS = typeof Symbol > "u" ? "__styleSet" + Math.floor(Math.random() * 1e8) : Symbol("styleSet"), XI = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : {};
class Du {
  // :: (Object<Style>, ?{finish: ?(string) → string})
  // Create a style module from the given spec.
  //
  // When `finish` is given, it is called on regular (non-`@`)
  // selectors (after `&` expansion) to compute the final selector.
  constructor(e, n) {
    this.rules = [];
    let { finish: i } = n || {};
    function o(a) {
      return /^@/.test(a) ? [a] : a.split(/,\s*/);
    }
    function r(a, l, s, u) {
      let c = [], d = /^@(\w+)\b/.exec(a[0]), f = d && d[1] == "keyframes";
      if (d && l == null) return s.push(a[0] + ";");
      for (let h in l) {
        let p = l[h];
        if (/&/.test(h))
          r(
            h.split(/,\s*/).map((g) => a.map((m) => g.replace(/&/, m))).reduce((g, m) => g.concat(m)),
            p,
            s
          );
        else if (p && typeof p == "object") {
          if (!d) throw new RangeError("The value of a property (" + h + ") should be a primitive value.");
          r(o(h), p, c, f);
        } else p != null && c.push(h.replace(/_.*/, "").replace(/[A-Z]/g, (g) => "-" + g.toLowerCase()) + ": " + p + ";");
      }
      (c.length || f) && s.push((i && !d && !u ? a.map(i) : a).join(", ") + " {" + c.join(" ") + "}");
    }
    for (let a in e) r(o(a), e[a], this.rules);
  }
  // :: () → string
  // Returns a string containing the module's CSS rules.
  getRules() {
    return this.rules.join(`
`);
  }
  // :: () → string
  // Generate a new unique CSS class name.
  static newName() {
    let e = XI[KI] || 1;
    return XI[KI] = e + 1, MS + e.toString(36);
  }
  // :: (union<Document, ShadowRoot>, union<[StyleModule], StyleModule>, ?{nonce: ?string})
  //
  // Mount the given set of modules in the given DOM root, which ensures
  // that the CSS rules defined by the module are available in that
  // context.
  //
  // Rules are only added to the document once per root.
  //
  // Rule order will follow the order of the modules, so that rules from
  // modules later in the array take precedence of those from earlier
  // modules. If you call this function multiple times for the same root
  // in a way that changes the order of already mounted modules, the old
  // order will be changed.
  //
  // If a Content Security Policy nonce is provided, it is added to
  // the `<style>` tag generated by the library.
  static mount(e, n, i) {
    let o = e[AS], r = i && i.nonce;
    o ? r && o.setNonce(r) : o = new Ibe(e, r), o.mount(Array.isArray(n) ? n : [n], e);
  }
}
let ZI = /* @__PURE__ */ new Map();
class Ibe {
  constructor(e, n) {
    let i = e.ownerDocument || e, o = i.defaultView;
    if (!e.head && e.adoptedStyleSheets && o.CSSStyleSheet) {
      let r = ZI.get(i);
      if (r) return e[AS] = r;
      this.sheet = new o.CSSStyleSheet(), ZI.set(i, this);
    } else
      this.styleTag = i.createElement("style"), n && this.styleTag.setAttribute("nonce", n);
    this.modules = [], e[AS] = this;
  }
  mount(e, n) {
    let i = this.sheet, o = 0, r = 0;
    for (let a = 0; a < e.length; a++) {
      let l = e[a], s = this.modules.indexOf(l);
      if (s < r && s > -1 && (this.modules.splice(s, 1), r--, s = -1), s == -1) {
        if (this.modules.splice(r++, 0, l), i) for (let u = 0; u < l.rules.length; u++)
          i.insertRule(l.rules[u], o++);
      } else {
        for (; r < s; ) o += this.modules[r++].rules.length;
        o += l.rules.length, r++;
      }
    }
    if (i)
      n.adoptedStyleSheets.indexOf(this.sheet) < 0 && (n.adoptedStyleSheets = [this.sheet, ...n.adoptedStyleSheets]);
    else {
      let a = "";
      for (let s = 0; s < this.modules.length; s++)
        a += this.modules[s].getRules() + `
`;
      this.styleTag.textContent = a;
      let l = n.head || n;
      this.styleTag.parentNode != l && l.insertBefore(this.styleTag, l.firstChild);
    }
  }
  setNonce(e) {
    this.styleTag && this.styleTag.getAttribute("nonce") != e && this.styleTag.setAttribute("nonce", e);
  }
}
var Nu = {
  8: "Backspace",
  9: "Tab",
  10: "Enter",
  12: "NumLock",
  13: "Enter",
  16: "Shift",
  17: "Control",
  18: "Alt",
  20: "CapsLock",
  27: "Escape",
  32: " ",
  33: "PageUp",
  34: "PageDown",
  35: "End",
  36: "Home",
  37: "ArrowLeft",
  38: "ArrowUp",
  39: "ArrowRight",
  40: "ArrowDown",
  44: "PrintScreen",
  45: "Insert",
  46: "Delete",
  59: ";",
  61: "=",
  91: "Meta",
  92: "Meta",
  106: "*",
  107: "+",
  108: ",",
  109: "-",
  110: ".",
  111: "/",
  144: "NumLock",
  145: "ScrollLock",
  160: "Shift",
  161: "Shift",
  162: "Control",
  163: "Control",
  164: "Alt",
  165: "Alt",
  173: "-",
  186: ";",
  187: "=",
  188: ",",
  189: "-",
  190: ".",
  191: "/",
  192: "`",
  219: "[",
  220: "\\",
  221: "]",
  222: "'"
}, Kp = {
  48: ")",
  49: "!",
  50: "@",
  51: "#",
  52: "$",
  53: "%",
  54: "^",
  55: "&",
  56: "*",
  57: "(",
  59: ":",
  61: "+",
  173: "_",
  186: ":",
  187: "+",
  188: "<",
  189: "_",
  190: ">",
  191: "?",
  192: "~",
  219: "{",
  220: "|",
  221: "}",
  222: '"'
}, Mbe = typeof navigator < "u" && /Mac/.test(navigator.platform), Abe = typeof navigator < "u" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
for (var Io = 0; Io < 10; Io++) Nu[48 + Io] = Nu[96 + Io] = String(Io);
for (var Io = 1; Io <= 24; Io++) Nu[Io + 111] = "F" + Io;
for (var Io = 65; Io <= 90; Io++)
  Nu[Io] = String.fromCharCode(Io + 32), Kp[Io] = String.fromCharCode(Io);
for (var Y1 in Nu) Kp.hasOwnProperty(Y1) || (Kp[Y1] = Nu[Y1]);
function Rbe(t) {
  var e = Mbe && t.metaKey && t.shiftKey && !t.ctrlKey && !t.altKey || Abe && t.shiftKey && t.key && t.key.length == 1 || t.key == "Unidentified", n = !e && t.key || (t.shiftKey ? Kp : Nu)[t.keyCode] || t.key || "Unidentified";
  return n == "Esc" && (n = "Escape"), n == "Del" && (n = "Delete"), n == "Left" && (n = "ArrowLeft"), n == "Up" && (n = "ArrowUp"), n == "Right" && (n = "ArrowRight"), n == "Down" && (n = "ArrowDown"), n;
}
let Zo = typeof navigator < "u" ? navigator : { userAgent: "", vendor: "", platform: "" }, RS = typeof document < "u" ? document : { documentElement: { style: {} } };
const DS = /* @__PURE__ */ /Edge\/(\d+)/.exec(Zo.userAgent), Q4 = /* @__PURE__ */ /MSIE \d/.test(Zo.userAgent), NS = /* @__PURE__ */ /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Zo.userAgent), Hy = !!(Q4 || NS || DS), GI = !Hy && /* @__PURE__ */ /gecko\/(\d+)/i.test(Zo.userAgent), K1 = !Hy && /* @__PURE__ */ /Chrome\/(\d+)/.exec(Zo.userAgent), UI = "webkitFontSmoothing" in RS.documentElement.style, LS = !Hy && /* @__PURE__ */ /Apple Computer/.test(Zo.vendor), JI = LS && (/* @__PURE__ */ /Mobile\/\w+/.test(Zo.userAgent) || Zo.maxTouchPoints > 2);
var kt = {
  mac: JI || /* @__PURE__ */ /Mac/.test(Zo.platform),
  windows: /* @__PURE__ */ /Win/.test(Zo.platform),
  linux: /* @__PURE__ */ /Linux|X11/.test(Zo.platform),
  ie: Hy,
  ie_version: Q4 ? RS.documentMode || 6 : NS ? +NS[1] : DS ? +DS[1] : 0,
  gecko: GI,
  gecko_version: GI ? +(/* @__PURE__ */ /Firefox\/(\d+)/.exec(Zo.userAgent) || [0, 0])[1] : 0,
  chrome: !!K1,
  chrome_version: K1 ? +K1[1] : 0,
  ios: JI,
  android: /* @__PURE__ */ /Android\b/.test(Zo.userAgent),
  webkit: UI,
  webkit_version: UI ? +(/* @__PURE__ */ /\bAppleWebKit\/(\d+)/.exec(Zo.userAgent) || [0, 0])[1] : 0,
  safari: LS,
  safari_version: LS ? +(/* @__PURE__ */ /\bVersion\/(\d+(\.\d+)?)/.exec(Zo.userAgent) || [0, 0])[1] : 0,
  tabSize: RS.documentElement.style.tabSize != null ? "tab-size" : "-moz-tab-size"
};
function rk(t, e) {
  for (let n in t)
    n == "class" && e.class ? e.class += " " + t.class : n == "style" && e.style ? e.style += ";" + t.style : e[n] = t[n];
  return e;
}
const p0 = /* @__PURE__ */ Object.create(null);
function ak(t, e, n) {
  if (t == e)
    return !0;
  t || (t = p0), e || (e = p0);
  let i = Object.keys(t), o = Object.keys(e);
  if (i.length - 0 != o.length - 0)
    return !1;
  for (let r of i)
    if (r != n && (o.indexOf(r) == -1 || t[r] !== e[r]))
      return !1;
  return !0;
}
function Dbe(t, e) {
  for (let n = t.attributes.length - 1; n >= 0; n--) {
    let i = t.attributes[n].name;
    e[i] == null && t.removeAttribute(i);
  }
  for (let n in e) {
    let i = e[n];
    n == "style" ? t.style.cssText = i : t.getAttribute(n) != i && t.setAttribute(n, i);
  }
}
function eM(t, e, n) {
  let i = !1;
  if (e)
    for (let o in e)
      n && o in n || (i = !0, o == "style" ? t.style.cssText = "" : t.removeAttribute(o));
  if (n)
    for (let o in n)
      e && e[o] == n[o] || (i = !0, o == "style" ? t.style.cssText = n[o] : t.setAttribute(o, n[o]));
  return i;
}
function Nbe(t) {
  let e = /* @__PURE__ */ Object.create(null);
  for (let n = 0; n < t.attributes.length; n++) {
    let i = t.attributes[n];
    e[i.name] = i.value;
  }
  return e;
}
class hh {
  /**
  Compare this instance to another instance of the same type.
  (TypeScript can't express this, but only instances of the same
  specific class will be passed to this method.) This is used to
  avoid redrawing widgets when they are replaced by a new
  decoration of the same type. The default implementation just
  returns `false`, which will cause new instances of the widget to
  always be redrawn.
  */
  eq(e) {
    return !1;
  }
  /**
  Update a DOM element created by a widget of the same type (but
  different, non-`eq` content) to reflect this widget. May return
  true to indicate that it could update, false to indicate it
  couldn't (in which case the widget will be redrawn). The default
  implementation just returns false.
  */
  updateDOM(e, n, i) {
    return !1;
  }
  /**
  @internal
  */
  compare(e) {
    return this == e || this.constructor == e.constructor && this.eq(e);
  }
  /**
  The estimated height this widget will have, to be used when
  estimating the height of content that hasn't been drawn. May
  return -1 to indicate you don't know. The default implementation
  returns -1.
  */
  get estimatedHeight() {
    return -1;
  }
  /**
  For inline widgets that are displayed inline (as opposed to
  `inline-block`) and introduce line breaks (through `<br>` tags
  or textual newlines), this must indicate the amount of line
  breaks they introduce. Defaults to 0.
  */
  get lineBreaks() {
    return 0;
  }
  /**
  Can be used to configure which kinds of events inside the widget
  should be ignored by the editor. The default is to ignore all
  events.
  */
  ignoreEvent(e) {
    return !0;
  }
  /**
  Override the way screen coordinates for positions at/in the
  widget are found. `pos` will be the offset into the widget, and
  `side` the side of the position that is being queried—less than
  zero for before, greater than zero for after, and zero for
  directly at that position.
  */
  coordsAt(e, n, i) {
    return null;
  }
  /**
  @internal
  */
  get isHidden() {
    return !1;
  }
  /**
  @internal
  */
  get editable() {
    return !1;
  }
  /**
  This is called when the an instance of the widget is removed
  from the editor view.
  */
  destroy(e) {
  }
}
var da = /* @__PURE__ */ (function(t) {
  return t[t.Text = 0] = "Text", t[t.WidgetBefore = 1] = "WidgetBefore", t[t.WidgetAfter = 2] = "WidgetAfter", t[t.WidgetRange = 3] = "WidgetRange", t;
})(da || (da = {}));
class ai extends Ru {
  constructor(e, n, i, o) {
    super(), this.startSide = e, this.endSide = n, this.widget = i, this.spec = o;
  }
  /**
  @internal
  */
  get heightRelevant() {
    return !1;
  }
  /**
  Create a mark decoration, which influences the styling of the
  content in its range. Nested mark decorations will cause nested
  DOM elements to be created. Nesting order is determined by
  precedence of the [facet](https://codemirror.net/6/docs/ref/#view.EditorView^decorations), with
  the higher-precedence decorations creating the inner DOM nodes.
  Such elements are split on line boundaries and on the boundaries
  of lower-precedence decorations.
  */
  static mark(e) {
    return new kg(e);
  }
  /**
  Create a widget decoration, which displays a DOM element at the
  given position.
  */
  static widget(e) {
    let n = Math.max(-1e4, Math.min(1e4, e.side || 0)), i = !!e.block;
    return n += i && !e.inlineOrder ? n > 0 ? 3e8 : -4e8 : n > 0 ? 1e8 : -1e8, new Gc(e, n, n, i, e.widget || null, !1);
  }
  /**
  Create a replace decoration which replaces the given range with
  a widget, or simply hides it.
  */
  static replace(e) {
    let n = !!e.block, i, o;
    if (e.isBlockGap)
      i = -5e8, o = 4e8;
    else {
      let { start: r, end: a } = H4(e, n);
      i = (r ? n ? -3e8 : -1 : 5e8) - 1, o = (a ? n ? 2e8 : 1 : -6e8) + 1;
    }
    return new Gc(e, i, o, n, e.widget || null, !0);
  }
  /**
  Create a line decoration, which can add DOM attributes to the
  line starting at the given position.
  */
  static line(e) {
    return new Tg(e);
  }
  /**
  Build a [`DecorationSet`](https://codemirror.net/6/docs/ref/#view.DecorationSet) from the given
  decorated range or ranges. If the ranges aren't already sorted,
  pass `true` for `sort` to make the library sort them for you.
  */
  static set(e, n = !1) {
    return ri.of(e, n);
  }
  /**
  @internal
  */
  hasHeight() {
    return this.widget ? this.widget.estimatedHeight > -1 : !1;
  }
}
ai.none = ri.empty;
class kg extends ai {
  constructor(e) {
    let { start: n, end: i } = H4(e);
    super(n ? -1 : 5e8, i ? 1 : -6e8, null, e), this.tagName = e.tagName || "span", this.attrs = e.class && e.attributes ? rk(e.attributes, { class: e.class }) : e.class ? { class: e.class } : e.attributes || p0;
  }
  eq(e) {
    return this == e || e instanceof kg && this.tagName == e.tagName && ak(this.attrs, e.attrs);
  }
  range(e, n = e) {
    if (e >= n)
      throw new RangeError("Mark decorations may not be empty");
    return super.range(e, n);
  }
}
kg.prototype.point = !1;
class Tg extends ai {
  constructor(e) {
    super(-2e8, -2e8, null, e);
  }
  eq(e) {
    return e instanceof Tg && this.spec.class == e.spec.class && ak(this.spec.attributes, e.spec.attributes);
  }
  range(e, n = e) {
    if (n != e)
      throw new RangeError("Line decoration ranges must be zero-length");
    return super.range(e, n);
  }
}
Tg.prototype.mapMode = nr.TrackBefore;
Tg.prototype.point = !0;
class Gc extends ai {
  constructor(e, n, i, o, r, a) {
    super(n, i, r, e), this.block = o, this.isReplace = a, this.mapMode = o ? n <= 0 ? nr.TrackBefore : nr.TrackAfter : nr.TrackDel;
  }
  // Only relevant when this.block == true
  get type() {
    return this.startSide != this.endSide ? da.WidgetRange : this.startSide <= 0 ? da.WidgetBefore : da.WidgetAfter;
  }
  get heightRelevant() {
    return this.block || !!this.widget && (this.widget.estimatedHeight >= 5 || this.widget.lineBreaks > 0);
  }
  eq(e) {
    return e instanceof Gc && Lbe(this.widget, e.widget) && this.block == e.block && this.startSide == e.startSide && this.endSide == e.endSide;
  }
  range(e, n = e) {
    if (this.isReplace && (e > n || e == n && this.startSide > 0 && this.endSide <= 0))
      throw new RangeError("Invalid range for replacement decoration");
    if (!this.isReplace && n != e)
      throw new RangeError("Widget decorations can only have zero-length ranges");
    return super.range(e, n);
  }
}
Gc.prototype.point = !0;
function H4(t, e = !1) {
  let { inclusiveStart: n, inclusiveEnd: i } = t;
  return n == null && (n = t.inclusive), i == null && (i = t.inclusive), { start: n ?? e, end: i ?? e };
}
function Lbe(t, e) {
  return t == e || !!(t && e && t.compare(e));
}
function vf(t, e, n, i = 0) {
  let o = n.length - 1;
  o >= 0 && n[o] + i >= t ? n[o] = Math.max(n[o], e) : n.push(t, e);
}
class Xp extends Ru {
  constructor(e, n, i) {
    super(), this.tagName = e, this.attributes = n, this.rank = i;
  }
  eq(e) {
    return e == this || e instanceof Xp && this.tagName == e.tagName && ak(this.attributes, e.attributes);
  }
  /**
  Create a block wrapper object with the given tag name and
  attributes.
  */
  static create(e) {
    return new Xp(e.tagName, e.attributes || p0, e.rank == null ? 50 : Math.max(0, Math.min(e.rank, 100)));
  }
  /**
  Create a range set from the given block wrapper ranges.
  */
  static set(e, n = !1) {
    return ri.of(e, n);
  }
}
Xp.prototype.startSide = Xp.prototype.endSide = -1;
function Zp(t) {
  let e;
  return t.nodeType == 11 ? e = t.getSelection ? t : t.ownerDocument : e = t, e.getSelection();
}
function zS(t, e) {
  return e ? t == e || t.contains(e.nodeType != 1 ? e.parentNode : e) : !1;
}
function bp(t, e) {
  if (!e.anchorNode)
    return !1;
  try {
    return zS(t, e.anchorNode);
  } catch {
    return !1;
  }
}
function xp(t) {
  return t.nodeType == 3 ? Up(t, 0, t.nodeValue.length).getClientRects() : t.nodeType == 1 ? t.getClientRects() : [];
}
function Op(t, e, n, i) {
  return n ? tM(t, e, n, i, -1) || tM(t, e, n, i, 1) : !1;
}
function Lu(t) {
  for (var e = 0; ; e++)
    if (t = t.previousSibling, !t)
      return e;
}
function g0(t) {
  return t.nodeType == 1 && /^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName);
}
function tM(t, e, n, i, o) {
  for (; ; ) {
    if (t == n && e == i)
      return !0;
    if (e == (o < 0 ? 0 : As(t))) {
      if (t.nodeName == "DIV")
        return !1;
      let r = t.parentNode;
      if (!r || r.nodeType != 1)
        return !1;
      e = Lu(t) + (o < 0 ? 0 : 1), t = r;
    } else if (t.nodeType == 1) {
      if (t = t.childNodes[e + (o < 0 ? -1 : 0)], t.nodeType == 1 && t.contentEditable == "false")
        return !1;
      e = o < 0 ? As(t) : 0;
    } else
      return !1;
  }
}
function As(t) {
  return t.nodeType == 3 ? t.nodeValue.length : t.childNodes.length;
}
function Gp(t, e) {
  let { left: n, right: i } = t;
  if (n == i)
    return t;
  let o = e ? n : i;
  return { left: o, right: o, top: t.top, bottom: t.bottom };
}
function zbe(t) {
  let e = t.visualViewport;
  return e ? {
    left: 0,
    right: e.width,
    top: 0,
    bottom: e.height
  } : {
    left: 0,
    right: t.innerWidth,
    top: 0,
    bottom: t.innerHeight
  };
}
function W4(t, e) {
  let n = e.width / t.offsetWidth, i = e.height / t.offsetHeight;
  return (n > 0.995 && n < 1.005 || !isFinite(n) || Math.abs(e.width - t.offsetWidth) < 1) && (n = 1), (i > 0.995 && i < 1.005 || !isFinite(i) || Math.abs(e.height - t.offsetHeight) < 1) && (i = 1), { scaleX: n, scaleY: i };
}
function Bbe(t, e, n, i, o, r, a, l) {
  let s = t.ownerDocument, u = s.defaultView || window;
  for (let c = t, d = !1; c && !d; )
    if (c.nodeType == 1) {
      let f, h = c == s.body, p = 1, g = 1;
      if (h)
        f = zbe(u);
      else {
        if (/^(fixed|sticky)$/.test(getComputedStyle(c).position) && (d = !0), c.scrollHeight <= c.clientHeight && c.scrollWidth <= c.clientWidth) {
          c = c.assignedSlot || c.parentNode;
          continue;
        }
        let b = c.getBoundingClientRect();
        ({ scaleX: p, scaleY: g } = W4(c, b)), f = {
          left: b.left,
          right: b.left + c.clientWidth * p,
          top: b.top,
          bottom: b.top + c.clientHeight * g
        };
      }
      let m = 0, y = 0;
      if (o == "nearest")
        e.top < f.top + a ? (y = e.top - (f.top + a), n > 0 && e.bottom > f.bottom + y && (y = e.bottom - f.bottom + a)) : e.bottom > f.bottom - a && (y = e.bottom - f.bottom + a, n < 0 && e.top - y < f.top && (y = e.top - (f.top + a)));
      else {
        let b = e.bottom - e.top, w = f.bottom - f.top;
        y = (o == "center" && b <= w ? e.top + b / 2 - w / 2 : o == "start" || o == "center" && n < 0 ? e.top - a : e.bottom - w + a) - f.top;
      }
      if (i == "nearest" ? e.left < f.left + r ? (m = e.left - (f.left + r), n > 0 && e.right > f.right + m && (m = e.right - f.right + r)) : e.right > f.right - r && (m = e.right - f.right + r, n < 0 && e.left < f.left + m && (m = e.left - (f.left + r))) : m = (i == "center" ? e.left + (e.right - e.left) / 2 - (f.right - f.left) / 2 : i == "start" == l ? e.left - r : e.right - (f.right - f.left) + r) - f.left, m || y)
        if (h)
          u.scrollBy(m, y);
        else {
          let b = 0, w = 0;
          if (y) {
            let $ = c.scrollTop;
            c.scrollTop += y / g, w = (c.scrollTop - $) * g;
          }
          if (m) {
            let $ = c.scrollLeft;
            c.scrollLeft += m / p, b = (c.scrollLeft - $) * p;
          }
          e = {
            left: e.left - b,
            top: e.top - w,
            right: e.right - b,
            bottom: e.bottom - w
          }, b && Math.abs(b - m) < 1 && (i = "nearest"), w && Math.abs(w - y) < 1 && (o = "nearest");
        }
      if (h)
        break;
      (e.top < f.top || e.bottom > f.bottom || e.left < f.left || e.right > f.right) && (e = {
        left: Math.max(e.left, f.left),
        right: Math.min(e.right, f.right),
        top: Math.max(e.top, f.top),
        bottom: Math.min(e.bottom, f.bottom)
      }), c = c.assignedSlot || c.parentNode;
    } else if (c.nodeType == 11)
      c = c.host;
    else
      break;
}
function j4(t, e = !0) {
  let n = t.ownerDocument, i = null, o = null;
  for (let r = t.parentNode; r && !(r == n.body || (!e || i) && o); )
    if (r.nodeType == 1)
      !o && r.scrollHeight > r.clientHeight && (o = r), e && !i && r.scrollWidth > r.clientWidth && (i = r), r = r.assignedSlot || r.parentNode;
    else if (r.nodeType == 11)
      r = r.host;
    else
      break;
  return { x: i, y: o };
}
class Fbe {
  constructor() {
    this.anchorNode = null, this.anchorOffset = 0, this.focusNode = null, this.focusOffset = 0;
  }
  eq(e) {
    return this.anchorNode == e.anchorNode && this.anchorOffset == e.anchorOffset && this.focusNode == e.focusNode && this.focusOffset == e.focusOffset;
  }
  setRange(e) {
    let { anchorNode: n, focusNode: i } = e;
    this.set(n, Math.min(e.anchorOffset, n ? As(n) : 0), i, Math.min(e.focusOffset, i ? As(i) : 0));
  }
  set(e, n, i, o) {
    this.anchorNode = e, this.anchorOffset = n, this.focusNode = i, this.focusOffset = o;
  }
}
let pc = null;
kt.safari && kt.safari_version >= 26 && (pc = !1);
function q4(t) {
  if (t.setActive)
    return t.setActive();
  if (pc)
    return t.focus(pc);
  let e = [];
  for (let n = t; n && (e.push(n, n.scrollTop, n.scrollLeft), n != n.ownerDocument); n = n.parentNode)
    ;
  if (t.focus(pc == null ? {
    get preventScroll() {
      return pc = { preventScroll: !0 }, !0;
    }
  } : void 0), !pc) {
    pc = !1;
    for (let n = 0; n < e.length; ) {
      let i = e[n++], o = e[n++], r = e[n++];
      i.scrollTop != o && (i.scrollTop = o), i.scrollLeft != r && (i.scrollLeft = r);
    }
  }
}
let nM;
function Up(t, e, n = e) {
  let i = nM || (nM = document.createRange());
  return i.setEnd(t, n), i.setStart(t, e), i;
}
function yf(t, e, n, i) {
  let o = { key: e, code: e, keyCode: n, which: n, cancelable: !0 };
  i && ({ altKey: o.altKey, ctrlKey: o.ctrlKey, shiftKey: o.shiftKey, metaKey: o.metaKey } = i);
  let r = new KeyboardEvent("keydown", o);
  r.synthetic = !0, t.dispatchEvent(r);
  let a = new KeyboardEvent("keyup", o);
  return a.synthetic = !0, t.dispatchEvent(a), r.defaultPrevented || a.defaultPrevented;
}
function Vbe(t) {
  for (; t; ) {
    if (t && (t.nodeType == 9 || t.nodeType == 11 && t.host))
      return t;
    t = t.assignedSlot || t.parentNode;
  }
  return null;
}
function Qbe(t, e) {
  let n = e.focusNode, i = e.focusOffset;
  if (!n || e.anchorNode != n || e.anchorOffset != i)
    return !1;
  for (i = Math.min(i, As(n)); ; )
    if (i) {
      if (n.nodeType != 1)
        return !1;
      let o = n.childNodes[i - 1];
      o.contentEditable == "false" ? i-- : (n = o, i = As(n));
    } else {
      if (n == t)
        return !0;
      i = Lu(n), n = n.parentNode;
    }
}
function Y4(t) {
  return t instanceof Window ? t.pageYOffset > Math.max(0, t.document.documentElement.scrollHeight - t.innerHeight - 4) : t.scrollTop > Math.max(1, t.scrollHeight - t.clientHeight - 4);
}
function K4(t, e) {
  for (let n = t, i = e; ; ) {
    if (n.nodeType == 3 && i > 0)
      return { node: n, offset: i };
    if (n.nodeType == 1 && i > 0) {
      if (n.contentEditable == "false")
        return null;
      n = n.childNodes[i - 1], i = As(n);
    } else if (n.parentNode && !g0(n))
      i = Lu(n), n = n.parentNode;
    else
      return null;
  }
}
function X4(t, e) {
  for (let n = t, i = e; ; ) {
    if (n.nodeType == 3 && i < n.nodeValue.length)
      return { node: n, offset: i };
    if (n.nodeType == 1 && i < n.childNodes.length) {
      if (n.contentEditable == "false")
        return null;
      n = n.childNodes[i], i = 0;
    } else if (n.parentNode && !g0(n))
      i = Lu(n) + 1, n = n.parentNode;
    else
      return null;
  }
}
class La {
  constructor(e, n, i = !0) {
    this.node = e, this.offset = n, this.precise = i;
  }
  static before(e, n) {
    return new La(e.parentNode, Lu(e), n);
  }
  static after(e, n) {
    return new La(e.parentNode, Lu(e) + 1, n);
  }
}
var Gi = /* @__PURE__ */ (function(t) {
  return t[t.LTR = 0] = "LTR", t[t.RTL = 1] = "RTL", t;
})(Gi || (Gi = {}));
const Uc = Gi.LTR, lk = Gi.RTL;
function Z4(t) {
  let e = [];
  for (let n = 0; n < t.length; n++)
    e.push(1 << +t[n]);
  return e;
}
const Hbe = /* @__PURE__ */ Z4("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"), Wbe = /* @__PURE__ */ Z4("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"), BS = /* @__PURE__ */ Object.create(null), ll = [];
for (let t of ["()", "[]", "{}"]) {
  let e = /* @__PURE__ */ t.charCodeAt(0), n = /* @__PURE__ */ t.charCodeAt(1);
  BS[e] = n, BS[n] = -e;
}
function G4(t) {
  return t <= 247 ? Hbe[t] : 1424 <= t && t <= 1524 ? 2 : 1536 <= t && t <= 1785 ? Wbe[t - 1536] : 1774 <= t && t <= 2220 ? 4 : 8192 <= t && t <= 8204 ? 256 : 64336 <= t && t <= 65023 ? 4 : 1;
}
const jbe = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;
class kl {
  /**
  The direction of this span.
  */
  get dir() {
    return this.level % 2 ? lk : Uc;
  }
  /**
  @internal
  */
  constructor(e, n, i) {
    this.from = e, this.to = n, this.level = i;
  }
  /**
  @internal
  */
  side(e, n) {
    return this.dir == n == e ? this.to : this.from;
  }
  /**
  @internal
  */
  forward(e, n) {
    return e == (this.dir == n);
  }
  /**
  @internal
  */
  static find(e, n, i, o) {
    let r = -1;
    for (let a = 0; a < e.length; a++) {
      let l = e[a];
      if (l.from <= n && l.to >= n) {
        if (l.level == i)
          return a;
        (r < 0 || (o != 0 ? o < 0 ? l.from < n : l.to > n : e[r].level > l.level)) && (r = a);
      }
    }
    if (r < 0)
      throw new RangeError("Index out of range");
    return r;
  }
}
function U4(t, e) {
  if (t.length != e.length)
    return !1;
  for (let n = 0; n < t.length; n++) {
    let i = t[n], o = e[n];
    if (i.from != o.from || i.to != o.to || i.direction != o.direction || !U4(i.inner, o.inner))
      return !1;
  }
  return !0;
}
const gi = [];
function qbe(t, e, n, i, o) {
  for (let r = 0; r <= i.length; r++) {
    let a = r ? i[r - 1].to : e, l = r < i.length ? i[r].from : n, s = r ? 256 : o;
    for (let u = a, c = s, d = s; u < l; u++) {
      let f = G4(t.charCodeAt(u));
      f == 512 ? f = c : f == 8 && d == 4 && (f = 16), gi[u] = f == 4 ? 2 : f, f & 7 && (d = f), c = f;
    }
    for (let u = a, c = s, d = s; u < l; u++) {
      let f = gi[u];
      if (f == 128)
        u < l - 1 && c == gi[u + 1] && c & 24 ? f = gi[u] = c : gi[u] = 256;
      else if (f == 64) {
        let h = u + 1;
        for (; h < l && gi[h] == 64; )
          h++;
        let p = u && c == 8 || h < n && gi[h] == 8 ? d == 1 ? 1 : 8 : 256;
        for (let g = u; g < h; g++)
          gi[g] = p;
        u = h - 1;
      } else f == 8 && d == 1 && (gi[u] = 1);
      c = f, f & 7 && (d = f);
    }
  }
}
function Ybe(t, e, n, i, o) {
  let r = o == 1 ? 2 : 1;
  for (let a = 0, l = 0, s = 0; a <= i.length; a++) {
    let u = a ? i[a - 1].to : e, c = a < i.length ? i[a].from : n;
    for (let d = u, f, h, p; d < c; d++)
      if (h = BS[f = t.charCodeAt(d)])
        if (h < 0) {
          for (let g = l - 3; g >= 0; g -= 3)
            if (ll[g + 1] == -h) {
              let m = ll[g + 2], y = m & 2 ? o : m & 4 ? m & 1 ? r : o : 0;
              y && (gi[d] = gi[ll[g]] = y), l = g;
              break;
            }
        } else {
          if (ll.length == 189)
            break;
          ll[l++] = d, ll[l++] = f, ll[l++] = s;
        }
      else if ((p = gi[d]) == 2 || p == 1) {
        let g = p == o;
        s = g ? 0 : 1;
        for (let m = l - 3; m >= 0; m -= 3) {
          let y = ll[m + 2];
          if (y & 2)
            break;
          if (g)
            ll[m + 2] |= 2;
          else {
            if (y & 4)
              break;
            ll[m + 2] |= 4;
          }
        }
      }
  }
}
function Kbe(t, e, n, i) {
  for (let o = 0, r = i; o <= n.length; o++) {
    let a = o ? n[o - 1].to : t, l = o < n.length ? n[o].from : e;
    for (let s = a; s < l; ) {
      let u = gi[s];
      if (u == 256) {
        let c = s + 1;
        for (; ; )
          if (c == l) {
            if (o == n.length)
              break;
            c = n[o++].to, l = o < n.length ? n[o].from : e;
          } else if (gi[c] == 256)
            c++;
          else
            break;
        let d = r == 1, f = (c < e ? gi[c] : i) == 1, h = d == f ? d ? 1 : 2 : i;
        for (let p = c, g = o, m = g ? n[g - 1].to : t; p > s; )
          p == m && (p = n[--g].from, m = g ? n[g - 1].to : t), gi[--p] = h;
        s = c;
      } else
        r = u, s++;
    }
  }
}
function FS(t, e, n, i, o, r, a) {
  let l = i % 2 ? 2 : 1;
  if (i % 2 == o % 2)
    for (let s = e, u = 0; s < n; ) {
      let c = !0, d = !1;
      if (u == r.length || s < r[u].from) {
        let g = gi[s];
        g != l && (c = !1, d = g == 16);
      }
      let f = !c && l == 1 ? [] : null, h = c ? i : i + 1, p = s;
      e: for (; ; )
        if (u < r.length && p == r[u].from) {
          if (d)
            break e;
          let g = r[u];
          if (!c)
            for (let m = g.to, y = u + 1; ; ) {
              if (m == n)
                break e;
              if (y < r.length && r[y].from == m)
                m = r[y++].to;
              else {
                if (gi[m] == l)
                  break e;
                break;
              }
            }
          if (u++, f)
            f.push(g);
          else {
            g.from > s && a.push(new kl(s, g.from, h));
            let m = g.direction == Uc != !(h % 2);
            VS(t, m ? i + 1 : i, o, g.inner, g.from, g.to, a), s = g.to;
          }
          p = g.to;
        } else {
          if (p == n || (c ? gi[p] != l : gi[p] == l))
            break;
          p++;
        }
      f ? FS(t, s, p, i + 1, o, f, a) : s < p && a.push(new kl(s, p, h)), s = p;
    }
  else
    for (let s = n, u = r.length; s > e; ) {
      let c = !0, d = !1;
      if (!u || s > r[u - 1].to) {
        let g = gi[s - 1];
        g != l && (c = !1, d = g == 16);
      }
      let f = !c && l == 1 ? [] : null, h = c ? i : i + 1, p = s;
      e: for (; ; )
        if (u && p == r[u - 1].to) {
          if (d)
            break e;
          let g = r[--u];
          if (!c)
            for (let m = g.from, y = u; ; ) {
              if (m == e)
                break e;
              if (y && r[y - 1].to == m)
                m = r[--y].from;
              else {
                if (gi[m - 1] == l)
                  break e;
                break;
              }
            }
          if (f)
            f.push(g);
          else {
            g.to < s && a.push(new kl(g.to, s, h));
            let m = g.direction == Uc != !(h % 2);
            VS(t, m ? i + 1 : i, o, g.inner, g.from, g.to, a), s = g.from;
          }
          p = g.from;
        } else {
          if (p == e || (c ? gi[p - 1] != l : gi[p - 1] == l))
            break;
          p--;
        }
      f ? FS(t, p, s, i + 1, o, f, a) : p < s && a.push(new kl(p, s, h)), s = p;
    }
}
function VS(t, e, n, i, o, r, a) {
  let l = e % 2 ? 2 : 1;
  qbe(t, o, r, i, l), Ybe(t, o, r, i, l), Kbe(o, r, i, l), FS(t, o, r, e, n, i, a);
}
function Xbe(t, e, n) {
  if (!t)
    return [new kl(0, 0, e == lk ? 1 : 0)];
  if (e == Uc && !n.length && !jbe.test(t))
    return J4(t.length);
  if (n.length)
    for (; t.length > gi.length; )
      gi[gi.length] = 256;
  let i = [], o = e == Uc ? 0 : 1;
  return VS(t, o, o, n, 0, t.length, i), i;
}
function J4(t) {
  return [new kl(0, t, 0)];
}
let e6 = "";
function Zbe(t, e, n, i, o) {
  var r;
  let a = i.head - t.from, l = kl.find(e, a, (r = i.bidiLevel) !== null && r !== void 0 ? r : -1, i.assoc), s = e[l], u = s.side(o, n);
  if (a == u) {
    let f = l += o ? 1 : -1;
    if (f < 0 || f >= e.length)
      return null;
    s = e[l = f], a = s.side(!o, n), u = s.side(o, n);
  }
  let c = $l(t.text, a, s.forward(o, n));
  (c < s.from || c > s.to) && (c = u), e6 = t.text.slice(Math.min(a, c), Math.max(a, c));
  let d = l == (o ? e.length - 1 : 0) ? null : e[l + (o ? 1 : -1)];
  return d && c == u && d.level + (o ? 0 : 1) < s.level ? Pt.cursor(d.side(!o, n) + t.from, d.forward(o, n) ? 1 : -1, d.level) : Pt.cursor(c + t.from, s.forward(o, n) ? -1 : 1, s.level);
}
function Gbe(t, e, n) {
  for (let i = e; i < n; i++) {
    let o = G4(t.charCodeAt(i));
    if (o == 1)
      return Uc;
    if (o == 2 || o == 4)
      return lk;
  }
  return Uc;
}
const t6 = /* @__PURE__ */ an.define(), n6 = /* @__PURE__ */ an.define(), i6 = /* @__PURE__ */ an.define(), o6 = /* @__PURE__ */ an.define(), QS = /* @__PURE__ */ an.define(), r6 = /* @__PURE__ */ an.define(), a6 = /* @__PURE__ */ an.define(), sk = /* @__PURE__ */ an.define(), uk = /* @__PURE__ */ an.define(), l6 = /* @__PURE__ */ an.define({
  combine: (t) => t.some((e) => e)
}), Ube = /* @__PURE__ */ an.define({
  combine: (t) => t.some((e) => e)
}), s6 = /* @__PURE__ */ an.define();
class bf {
  constructor(e, n, i, o, r, a = !1) {
    this.range = e, this.y = n, this.x = i, this.yMargin = o, this.xMargin = r, this.isSnapshot = a;
  }
  map(e) {
    return e.empty ? this : new bf(this.range.map(e), this.y, this.x, this.yMargin, this.xMargin, this.isSnapshot);
  }
  clip(e) {
    return this.range.to <= e.doc.length ? this : new bf(Pt.cursor(e.doc.length), this.y, this.x, this.yMargin, this.xMargin, this.isSnapshot);
  }
}
const Am = /* @__PURE__ */ xi.define({ map: (t, e) => t.map(e) }), u6 = /* @__PURE__ */ xi.define();
function Rr(t, e, n) {
  let i = t.facet(o6);
  i.length ? i[0](e) : window.onerror && window.onerror(String(e), n, void 0, void 0, e) || (n ? console.error(n + ":", e) : console.error(e));
}
const ss = /* @__PURE__ */ an.define({ combine: (t) => t.length ? t[0] : !0 });
let Jbe = 0;
const Gd = /* @__PURE__ */ an.define({
  combine(t) {
    return t.filter((e, n) => {
      for (let i = 0; i < n; i++)
        if (t[i].plugin == e.plugin)
          return !1;
      return !0;
    });
  }
});
class ga {
  constructor(e, n, i, o, r) {
    this.id = e, this.create = n, this.domEventHandlers = i, this.domEventObservers = o, this.baseExtensions = r(this), this.extension = this.baseExtensions.concat(Gd.of({ plugin: this, arg: void 0 }));
  }
  /**
  Create an extension for this plugin with the given argument.
  */
  of(e) {
    return this.baseExtensions.concat(Gd.of({ plugin: this, arg: e }));
  }
  /**
  Define a plugin from a constructor function that creates the
  plugin's value, given an editor view.
  */
  static define(e, n) {
    const { eventHandlers: i, eventObservers: o, provide: r, decorations: a } = n || {};
    return new ga(Jbe++, e, i, o, (l) => {
      let s = [];
      return a && s.push(Wy.of((u) => {
        let c = u.plugin(l);
        return c ? a(c) : ai.none;
      })), r && s.push(r(l)), s;
    });
  }
  /**
  Create a plugin for a class whose constructor takes a single
  editor view as argument.
  */
  static fromClass(e, n) {
    return ga.define((i, o) => new e(i, o), n);
  }
}
class X1 {
  constructor(e) {
    this.spec = e, this.mustUpdate = null, this.value = null;
  }
  get plugin() {
    return this.spec && this.spec.plugin;
  }
  update(e) {
    if (this.value) {
      if (this.mustUpdate) {
        let n = this.mustUpdate;
        if (this.mustUpdate = null, this.value.update)
          try {
            this.value.update(n);
          } catch (i) {
            if (Rr(n.state, i, "CodeMirror plugin crashed"), this.value.destroy)
              try {
                this.value.destroy();
              } catch {
              }
            this.deactivate();
          }
      }
    } else if (this.spec)
      try {
        this.value = this.spec.plugin.create(e, this.spec.arg);
      } catch (n) {
        Rr(e.state, n, "CodeMirror plugin crashed"), this.deactivate();
      }
    return this;
  }
  destroy(e) {
    var n;
    if (!((n = this.value) === null || n === void 0) && n.destroy)
      try {
        this.value.destroy();
      } catch (i) {
        Rr(e.state, i, "CodeMirror plugin crashed");
      }
  }
  deactivate() {
    this.spec = this.value = null;
  }
}
const c6 = /* @__PURE__ */ an.define(), ck = /* @__PURE__ */ an.define(), Wy = /* @__PURE__ */ an.define(), d6 = /* @__PURE__ */ an.define(), dk = /* @__PURE__ */ an.define(), Pg = /* @__PURE__ */ an.define(), f6 = /* @__PURE__ */ an.define();
function iM(t, e) {
  let n = t.state.facet(f6);
  if (!n.length)
    return n;
  let i = n.map((r) => r instanceof Function ? r(t) : r), o = [];
  return ri.spans(i, e.from, e.to, {
    point() {
    },
    span(r, a, l, s) {
      let u = r - e.from, c = a - e.from, d = o;
      for (let f = l.length - 1; f >= 0; f--, s--) {
        let h = l[f].spec.bidiIsolate, p;
        if (h == null && (h = Gbe(e.text, u, c)), s > 0 && d.length && (p = d[d.length - 1]).to == u && p.direction == h)
          p.to = c, d = p.inner;
        else {
          let g = { from: u, to: c, direction: h, inner: [] };
          d.push(g), d = g.inner;
        }
      }
    }
  }), o;
}
const h6 = /* @__PURE__ */ an.define();
function fk(t) {
  let e = 0, n = 0, i = 0, o = 0;
  for (let r of t.state.facet(h6)) {
    let a = r(t);
    a && (a.left != null && (e = Math.max(e, a.left)), a.right != null && (n = Math.max(n, a.right)), a.top != null && (i = Math.max(i, a.top)), a.bottom != null && (o = Math.max(o, a.bottom)));
  }
  return { left: e, right: n, top: i, bottom: o };
}
const Gh = /* @__PURE__ */ an.define();
class sa {
  constructor(e, n, i, o) {
    this.fromA = e, this.toA = n, this.fromB = i, this.toB = o;
  }
  join(e) {
    return new sa(Math.min(this.fromA, e.fromA), Math.max(this.toA, e.toA), Math.min(this.fromB, e.fromB), Math.max(this.toB, e.toB));
  }
  addToSet(e) {
    let n = e.length, i = this;
    for (; n > 0; n--) {
      let o = e[n - 1];
      if (!(o.fromA > i.toA)) {
        if (o.toA < i.fromA)
          break;
        i = i.join(o), e.splice(n - 1, 1);
      }
    }
    return e.splice(n, 0, i), e;
  }
  // Extend a set to cover all the content in `ranges`, which is a
  // flat array with each pair of numbers representing fromB/toB
  // positions. These pairs are generated in unchanged ranges, so the
  // offset between doc A and doc B is the same for their start and
  // end points.
  static extendWithRanges(e, n) {
    if (n.length == 0)
      return e;
    let i = [];
    for (let o = 0, r = 0, a = 0; ; ) {
      let l = o < e.length ? e[o].fromB : 1e9, s = r < n.length ? n[r] : 1e9, u = Math.min(l, s);
      if (u == 1e9)
        break;
      let c = u + a, d = u, f = c;
      for (; ; )
        if (r < n.length && n[r] <= d) {
          let h = n[r + 1];
          r += 2, d = Math.max(d, h);
          for (let p = o; p < e.length && e[p].fromB <= d; p++)
            a = e[p].toA - e[p].toB;
          f = Math.max(f, h + a);
        } else if (o < e.length && e[o].fromB <= d) {
          let h = e[o++];
          d = Math.max(d, h.toB), f = Math.max(f, h.toA), a = h.toA - h.toB;
        } else
          break;
      i.push(new sa(c, f, u, d));
    }
    return i;
  }
}
class m0 {
  constructor(e, n, i) {
    this.view = e, this.state = n, this.transactions = i, this.flags = 0, this.startState = e.state, this.changes = bo.empty(this.startState.doc.length);
    for (let r of i)
      this.changes = this.changes.compose(r.changes);
    let o = [];
    this.changes.iterChangedRanges((r, a, l, s) => o.push(new sa(r, a, l, s))), this.changedRanges = o;
  }
  /**
  @internal
  */
  static create(e, n, i) {
    return new m0(e, n, i);
  }
  /**
  Tells you whether the [viewport](https://codemirror.net/6/docs/ref/#view.EditorView.viewport) or
  [visible ranges](https://codemirror.net/6/docs/ref/#view.EditorView.visibleRanges) changed in this
  update.
  */
  get viewportChanged() {
    return (this.flags & 4) > 0;
  }
  /**
  Returns true when
  [`viewportChanged`](https://codemirror.net/6/docs/ref/#view.ViewUpdate.viewportChanged) is true
  and the viewport change is not just the result of mapping it in
  response to document changes.
  */
  get viewportMoved() {
    return (this.flags & 8) > 0;
  }
  /**
  Indicates whether the height of a block element in the editor
  changed in this update.
  */
  get heightChanged() {
    return (this.flags & 2) > 0;
  }
  /**
  Returns true when the document was modified or the size of the
  editor, or elements within the editor, changed.
  */
  get geometryChanged() {
    return this.docChanged || (this.flags & 18) > 0;
  }
  /**
  True when this update indicates a focus change.
  */
  get focusChanged() {
    return (this.flags & 1) > 0;
  }
  /**
  Whether the document changed in this update.
  */
  get docChanged() {
    return !this.changes.empty;
  }
  /**
  Whether the selection was explicitly set in this update.
  */
  get selectionSet() {
    return this.transactions.some((e) => e.selection);
  }
  /**
  @internal
  */
  get empty() {
    return this.flags == 0 && this.transactions.length == 0;
  }
}
const e1e = [];
class ji {
  constructor(e, n, i = 0) {
    this.dom = e, this.length = n, this.flags = i, this.parent = null, e.cmTile = this;
  }
  get breakAfter() {
    return this.flags & 1;
  }
  get children() {
    return e1e;
  }
  isWidget() {
    return !1;
  }
  get isHidden() {
    return !1;
  }
  isComposite() {
    return !1;
  }
  isLine() {
    return !1;
  }
  isText() {
    return !1;
  }
  isBlock() {
    return !1;
  }
  get domAttrs() {
    return null;
  }
  sync(e) {
    if (this.flags |= 2, this.flags & 4) {
      this.flags &= -5;
      let n = this.domAttrs;
      n && Dbe(this.dom, n);
    }
  }
  toString() {
    return this.constructor.name + (this.children.length ? `(${this.children})` : "") + (this.breakAfter ? "#" : "");
  }
  destroy() {
    this.parent = null;
  }
  setDOM(e) {
    this.dom = e, e.cmTile = this;
  }
  get posAtStart() {
    return this.parent ? this.parent.posBefore(this) : 0;
  }
  get posAtEnd() {
    return this.posAtStart + this.length;
  }
  posBefore(e, n = this.posAtStart) {
    let i = n;
    for (let o of this.children) {
      if (o == e)
        return i;
      i += o.length + o.breakAfter;
    }
    throw new RangeError("Invalid child in posBefore");
  }
  posAfter(e) {
    return this.posBefore(e) + e.length;
  }
  covers(e) {
    return !0;
  }
  coordsIn(e, n, i) {
    return null;
  }
  domPosFor(e, n) {
    let i = Lu(this.dom), o = this.length ? e > 0 : n > 0;
    return new La(this.parent.dom, i + (o ? 1 : 0), e == 0 || e == this.length);
  }
  markDirty(e) {
    this.flags &= -3, e && (this.flags |= 4), this.parent && this.parent.flags & 2 && this.parent.markDirty(!1);
  }
  get overrideDOMText() {
    return null;
  }
  get root() {
    for (let e = this; e; e = e.parent)
      if (e instanceof qy)
        return e;
    return null;
  }
  static get(e) {
    return e.cmTile;
  }
}
class jy extends ji {
  constructor(e) {
    super(e, 0), this._children = [];
  }
  isComposite() {
    return !0;
  }
  get children() {
    return this._children;
  }
  get lastChild() {
    return this.children.length ? this.children[this.children.length - 1] : null;
  }
  append(e) {
    this.children.push(e), e.parent = this;
  }
  sync(e) {
    if (this.flags & 2)
      return;
    super.sync(e);
    let n = this.dom, i = null, o, r = e?.node == n ? e : null, a = 0;
    for (let l of this.children) {
      if (l.sync(e), a += l.length + l.breakAfter, o = i ? i.nextSibling : n.firstChild, r && o != l.dom && (r.written = !0), l.dom.parentNode == n)
        for (; o && o != l.dom; )
          o = oM(o);
      else
        n.insertBefore(l.dom, o);
      i = l.dom;
    }
    for (o = i ? i.nextSibling : n.firstChild, r && o && (r.written = !0); o; )
      o = oM(o);
    this.length = a;
  }
}
function oM(t) {
  let e = t.nextSibling;
  return t.parentNode.removeChild(t), e;
}
class qy extends jy {
  constructor(e, n) {
    super(n), this.view = e;
  }
  owns(e) {
    for (; e; e = e.parent)
      if (e == this)
        return !0;
    return !1;
  }
  isBlock() {
    return !0;
  }
  nearest(e) {
    for (; ; ) {
      if (!e)
        return null;
      let n = ji.get(e);
      if (n && this.owns(n))
        return n;
      e = e.parentNode;
    }
  }
  blockTiles(e) {
    for (let n = [], i = this, o = 0, r = 0; ; )
      if (o == i.children.length) {
        if (!n.length)
          return;
        i = i.parent, i.breakAfter && r++, o = n.pop();
      } else {
        let a = i.children[o++];
        if (a instanceof Ss)
          n.push(o), i = a, o = 0;
        else {
          let l = r + a.length, s = e(a, r);
          if (s !== void 0)
            return s;
          r = l + a.breakAfter;
        }
      }
  }
  // Find the block at the given position. If side < -1, make sure to
  // stay before block widgets at that position, if side > 1, after
  // such widgets (used for selection drawing, which needs to be able
  // to get coordinates for positions that aren't valid cursor positions).
  resolveBlock(e, n) {
    let i, o = -1, r, a = -1;
    if (this.blockTiles((l, s) => {
      let u = s + l.length;
      if (e >= s && e <= u) {
        if (l.isWidget() && n >= -1 && n <= 1) {
          if (l.flags & 32)
            return !0;
          l.flags & 16 && (i = void 0);
        }
        (s < e || e == u && (n < -1 ? l.length : l.covers(1))) && (!i || !l.isWidget() && i.isWidget()) && (i = l, o = e - s), (u > e || e == s && (n > 1 ? l.length : l.covers(-1))) && (!r || !l.isWidget() && r.isWidget()) && (r = l, a = e - s);
      }
    }), !i && !r)
      throw new Error("No tile at position " + e);
    return i && n < 0 || !r ? { tile: i, offset: o } : { tile: r, offset: a };
  }
}
class Ss extends jy {
  constructor(e, n) {
    super(e), this.wrapper = n;
  }
  isBlock() {
    return !0;
  }
  covers(e) {
    return this.children.length ? e < 0 ? this.children[0].covers(-1) : this.lastChild.covers(1) : !1;
  }
  get domAttrs() {
    return this.wrapper.attributes;
  }
  static of(e, n) {
    let i = new Ss(n || document.createElement(e.tagName), e);
    return n || (i.flags |= 4), i;
  }
}
class jf extends jy {
  constructor(e, n) {
    super(e), this.attrs = n;
  }
  isLine() {
    return !0;
  }
  static start(e, n, i) {
    let o = new jf(n || document.createElement("div"), e);
    return (!n || !i) && (o.flags |= 4), o;
  }
  get domAttrs() {
    return this.attrs;
  }
  // Find the tile associated with a given position in this line.
  resolveInline(e, n, i) {
    let o = null, r = -1, a = null, l = -1;
    function s(c, d) {
      for (let f = 0, h = 0; f < c.children.length && h <= d; f++) {
        let p = c.children[f], g = h + p.length;
        g >= d && (p.isComposite() ? s(p, d - h) : (!a || a.isHidden && (n > 0 && !(a.flags & 32) || i && n1e(a, p))) && (g > d || p.flags & 32) ? (a = p, l = d - h) : (h < d || p.flags & 16 && !p.isHidden) && (o = p, r = d - h)), h = g;
      }
    }
    s(this, e);
    let u = (n < 0 ? o : a) || o || a;
    return u ? { tile: u, offset: u == o ? r : l } : null;
  }
  coordsIn(e, n, i) {
    let o = this.resolveInline(e, n, !0);
    return o ? o.tile.coordsIn(Math.max(0, o.offset), n, i) : t1e(this);
  }
  domIn(e, n) {
    let i = this.resolveInline(e, n);
    if (i) {
      let { tile: o, offset: r } = i;
      if (this.dom.contains(o.dom))
        return o.isText() ? new La(o.dom, Math.min(o.dom.nodeValue.length, r)) : o.domPosFor(r, o.flags & 16 ? 1 : o.flags & 32 ? -1 : n);
      let a = i.tile.parent, l = !1;
      for (let s of a.children) {
        if (l)
          return new La(s.dom, 0);
        s == i.tile && (l = !0);
      }
    }
    return new La(this.dom, 0);
  }
}
function t1e(t) {
  let e = t.dom.lastChild;
  if (!e)
    return t.dom.getBoundingClientRect();
  let n = xp(e);
  return n[n.length - 1] || null;
}
function n1e(t, e) {
  let n = t.coordsIn(0, 1), i = e.coordsIn(0, 1);
  return n && i && i.top < n.bottom;
}
class yr extends jy {
  constructor(e, n) {
    super(e), this.mark = n;
  }
  get domAttrs() {
    return this.mark.attrs;
  }
  static of(e, n) {
    let i = new yr(n || document.createElement(e.tagName), e);
    return n || (i.flags |= 4), i;
  }
}
class Pc extends ji {
  constructor(e, n) {
    super(e, n.length), this.text = n;
  }
  sync(e) {
    this.flags & 2 || (super.sync(e), this.dom.nodeValue != this.text && (e && e.node == this.dom && (e.written = !0), this.dom.nodeValue = this.text));
  }
  isText() {
    return !0;
  }
  toString() {
    return JSON.stringify(this.text);
  }
  coordsIn(e, n, i) {
    let o = this.dom.nodeValue.length;
    e > o && (e = o);
    let r = e, a = e, l = 0;
    e == 0 && n < 0 || e == o && n >= 0 ? kt.chrome || kt.gecko || (e ? (r--, l = 1) : a < o && (a++, l = -1)) : n < 0 ? r-- : a < o && a++;
    let s = Up(this.dom, r, a).getClientRects();
    if (!s.length)
      return null;
    let u = s[(l ? l < 0 : n >= 0) ? 0 : s.length - 1];
    return kt.safari && !l && u.width == 0 && (u = Array.prototype.find.call(s, (c) => c.width) || u), i == null ? u : Gp(u, (l ? l > 0 : n < 0) == i);
  }
  static of(e, n) {
    let i = new Pc(n || document.createTextNode(e), e);
    return n || (i.flags |= 2), i;
  }
}
class Jc extends ji {
  constructor(e, n, i, o) {
    super(e, n, o), this.widget = i;
  }
  isWidget() {
    return !0;
  }
  get isHidden() {
    return this.widget.isHidden;
  }
  covers(e) {
    return this.flags & 48 ? !1 : (this.flags & (e < 0 ? 64 : 128)) > 0;
  }
  coordsIn(e, n) {
    return this.coordsInWidget(e, n, !1);
  }
  coordsInWidget(e, n, i) {
    let o = this.widget.coordsAt(this.dom, e, n);
    if (o)
      return o;
    if (i)
      return Gp(this.dom.getBoundingClientRect(), this.length ? e == 0 : n <= 0);
    {
      let r = this.dom.getClientRects(), a = null;
      if (!r.length)
        return null;
      let l = this.flags & 16 ? !0 : this.flags & 32 ? !1 : e > 0;
      for (let s = l ? r.length - 1 : 0; a = r[s], !(e > 0 ? s == 0 : s == r.length - 1 || a.top < a.bottom); s += l ? -1 : 1)
        ;
      return Gp(a, !l);
    }
  }
  get overrideDOMText() {
    if (!this.length)
      return Wn.empty;
    let { root: e } = this;
    if (!e)
      return Wn.empty;
    let n = this.posAtStart;
    return e.view.state.doc.slice(n, n + this.length);
  }
  destroy() {
    super.destroy(), this.widget.destroy(this.dom);
  }
  static of(e, n, i, o, r) {
    return r || (r = e.toDOM(n), e.editable || (r.contentEditable = "false")), new Jc(r, i, e, o);
  }
}
class v0 extends ji {
  constructor(e) {
    let n = document.createElement("img");
    n.className = "cm-widgetBuffer", n.setAttribute("aria-hidden", "true"), super(n, 0, e);
  }
  get isHidden() {
    return !0;
  }
  get overrideDOMText() {
    return Wn.empty;
  }
  coordsIn(e, n, i) {
    let o = this.dom.getBoundingClientRect();
    return i == null ? o : Gp(o, n > 0 == i);
  }
}
class i1e {
  constructor(e) {
    this.index = 0, this.beforeBreak = !1, this.parents = [], this.tile = e;
  }
  // Advance by the given distance. If side is -1, stop leaving or
  // entering tiles, or skipping zero-length tiles, once the distance
  // has been traversed. When side is 1, leave, enter, or skip
  // everything at the end position.
  advance(e, n, i) {
    let { tile: o, index: r, beforeBreak: a, parents: l } = this;
    for (; e || n > 0; )
      if (o.isComposite())
        if (a) {
          if (!e)
            break;
          i && i.break(), e--, a = !1;
        } else if (r == o.children.length) {
          if (!e && !l.length)
            break;
          i && i.leave(o), a = !!o.breakAfter, { tile: o, index: r } = l.pop(), r++;
        } else {
          let s = o.children[r], u = s.breakAfter;
          (n > 0 ? s.length <= e : s.length < e) && (!i || i.skip(s, 0, s.length) !== !1 || !s.isComposite) ? (a = !!u, r++, e -= s.length) : (l.push({ tile: o, index: r }), o = s, r = 0, i && s.isComposite() && i.enter(s));
        }
      else if (r == o.length)
        a = !!o.breakAfter, { tile: o, index: r } = l.pop(), r++;
      else if (e) {
        let s = Math.min(e, o.length - r);
        i && i.skip(o, r, r + s), e -= s, r += s;
      } else
        break;
    return this.tile = o, this.index = r, this.beforeBreak = a, this;
  }
  get root() {
    return this.parents.length ? this.parents[0].tile : this.tile;
  }
}
class o1e {
  constructor(e, n, i, o) {
    this.from = e, this.to = n, this.wrapper = i, this.rank = o;
  }
}
class r1e {
  constructor(e, n, i) {
    this.cache = e, this.root = n, this.blockWrappers = i, this.curLine = null, this.lastBlock = null, this.afterWidget = null, this.pos = 0, this.wrappers = [], this.wrapperPos = 0;
  }
  addText(e, n, i, o) {
    var r;
    this.flushBuffer();
    let a = this.ensureMarks(n, i), l = a.lastChild;
    if (l && l.isText() && !(l.flags & 8) && l.length + e.length < 512) {
      this.cache.reused.set(
        l,
        2
        /* Reused.DOM */
      );
      let s = a.children[a.children.length - 1] = new Pc(l.dom, l.text + e);
      s.parent = a;
    } else
      a.append(o || Pc.of(e, (r = this.cache.find(Pc)) === null || r === void 0 ? void 0 : r.dom));
    this.pos += e.length, this.afterWidget = null;
  }
  addComposition(e, n) {
    let i = this.curLine;
    i.dom != n.line.dom && (i.setDOM(this.cache.reused.has(n.line) ? Z1(n.line.dom) : n.line.dom), this.cache.reused.set(
      n.line,
      2
      /* Reused.DOM */
    ));
    let o = i;
    for (let l = n.marks.length - 1; l >= 0; l--) {
      let s = n.marks[l], u = o.lastChild;
      if (u instanceof yr && u.mark.eq(s.mark))
        u.dom != s.dom && u.setDOM(Z1(s.dom)), o = u;
      else {
        if (this.cache.reused.get(s)) {
          let d = ji.get(s.dom);
          d && d.setDOM(Z1(s.dom));
        }
        let c = yr.of(s.mark, s.dom);
        o.append(c), o = c;
      }
      this.cache.reused.set(
        s,
        2
        /* Reused.DOM */
      );
    }
    let r = ji.get(e.text);
    r && this.cache.reused.set(
      r,
      2
      /* Reused.DOM */
    );
    let a = new Pc(e.text, e.text.nodeValue);
    a.flags |= 8, this.pos = e.range.toB, o.append(a);
  }
  addInlineWidget(e, n, i) {
    let o = this.afterWidget && e.flags & 48 && (this.afterWidget.flags & 48) == (e.flags & 48);
    o || this.flushBuffer();
    let r = this.ensureMarks(n, i);
    !o && !(e.flags & 16) && r.append(this.getBuffer(1)), r.append(e), this.pos += e.length, this.afterWidget = e;
  }
  addMark(e, n, i) {
    this.flushBuffer(), this.ensureMarks(n, i).append(e), this.pos += e.length, this.afterWidget = null;
  }
  addBlockWidget(e) {
    this.getBlockPos().append(e), this.pos += e.length, this.lastBlock = e, this.endLine();
  }
  continueWidget(e) {
    let n = this.afterWidget || this.lastBlock;
    n.length += e, this.pos += e;
  }
  addLineStart(e, n) {
    var i;
    e || (e = p6);
    let o = jf.start(e, n || ((i = this.cache.find(jf)) === null || i === void 0 ? void 0 : i.dom), !!n);
    this.getBlockPos().append(this.lastBlock = this.curLine = o);
  }
  addLine(e) {
    this.getBlockPos().append(e), this.pos += e.length, this.lastBlock = e, this.endLine();
  }
  addBreak() {
    this.lastBlock.flags |= 1, this.endLine(), this.pos++;
  }
  addLineStartIfNotCovered(e) {
    this.blockPosCovered() || this.addLineStart(e);
  }
  ensureLine(e) {
    this.curLine || this.addLineStart(e);
  }
  ensureMarks(e, n) {
    var i;
    let o = this.curLine;
    for (let r = e.length - 1; r >= 0; r--) {
      let a = e[r], l;
      if (n > 0 && (l = o.lastChild) && l instanceof yr && l.mark.eq(a))
        o = l, n--;
      else {
        let s = yr.of(a, (i = this.cache.find(yr, (u) => u.mark.eq(a))) === null || i === void 0 ? void 0 : i.dom);
        o.append(s), o = s, n = 0;
      }
    }
    return o;
  }
  endLine() {
    if (this.curLine) {
      this.flushBuffer();
      let e = this.curLine.lastChild;
      (!e || !rM(this.curLine, !1) || e.dom.nodeName != "BR" && e.isWidget() && !(kt.ios && rM(this.curLine, !0))) && this.curLine.append(this.cache.findWidget(
        G1,
        0,
        32
        /* TileFlag.After */
      ) || new Jc(
        G1.toDOM(),
        0,
        G1,
        32
        /* TileFlag.After */
      )), this.curLine = this.afterWidget = null;
    }
  }
  updateBlockWrappers() {
    this.wrapperPos > this.pos + 1e4 && (this.blockWrappers.goto(this.pos), this.wrappers.length = 0);
    for (let e = this.wrappers.length - 1; e >= 0; e--)
      this.wrappers[e].to < this.pos && this.wrappers.splice(e, 1);
    for (let e = this.blockWrappers; e.value && e.from <= this.pos; e.next())
      if (e.to >= this.pos) {
        let n = e.rank * 102 + e.value.rank, i = new o1e(e.from, e.to, e.value, n), o = this.wrappers.length;
        for (; o > 0 && (this.wrappers[o - 1].rank - i.rank || this.wrappers[o - 1].to - i.to) < 0; )
          o--;
        this.wrappers.splice(o, 0, i);
      }
    this.wrapperPos = this.pos;
  }
  getBlockPos() {
    var e;
    this.updateBlockWrappers();
    let n = this.root;
    for (let i of this.wrappers) {
      let o = n.lastChild;
      if (i.from < this.pos && o instanceof Ss && o.wrapper.eq(i.wrapper))
        n = o;
      else {
        let r = Ss.of(i.wrapper, (e = this.cache.find(Ss, (a) => a.wrapper.eq(i.wrapper))) === null || e === void 0 ? void 0 : e.dom);
        n.append(r), n = r;
      }
    }
    return n;
  }
  blockPosCovered() {
    let e = this.lastBlock;
    return e != null && !e.breakAfter && (!e.isWidget() || (e.flags & 160) > 0);
  }
  getBuffer(e) {
    let n = 2 | (e < 0 ? 16 : 32), i = this.cache.find(
      v0,
      void 0,
      1
      /* Reused.Full */
    );
    return i && (i.flags = n), i || new v0(n);
  }
  flushBuffer() {
    this.afterWidget && !(this.afterWidget.flags & 32) && (this.afterWidget.parent.append(this.getBuffer(-1)), this.afterWidget = null);
  }
}
class a1e {
  constructor(e) {
    this.skipCount = 0, this.text = "", this.textOff = 0, this.cursor = e.iter();
  }
  skip(e) {
    this.textOff + e <= this.text.length ? this.textOff += e : (this.skipCount += e - (this.text.length - this.textOff), this.text = "", this.textOff = 0);
  }
  next(e) {
    if (this.textOff == this.text.length) {
      let { value: o, lineBreak: r, done: a } = this.cursor.next(this.skipCount);
      if (this.skipCount = 0, a)
        throw new Error("Ran out of text content when drawing inline views");
      this.text = o;
      let l = this.textOff = Math.min(e, o.length);
      return r ? null : o.slice(0, l);
    }
    let n = Math.min(this.text.length, this.textOff + e), i = this.text.slice(this.textOff, n);
    return this.textOff = n, i;
  }
}
const y0 = [Jc, jf, Pc, yr, v0, Ss, qy];
for (let t = 0; t < y0.length; t++)
  y0[t].bucket = t;
class l1e {
  constructor(e) {
    this.view = e, this.buckets = y0.map(() => []), this.index = y0.map(() => 0), this.reused = /* @__PURE__ */ new Map();
  }
  // Put a tile in the cache.
  add(e) {
    let n = e.constructor.bucket, i = this.buckets[n];
    i.length < 6 ? i.push(e) : i[
      this.index[n] = (this.index[n] + 1) % 6
      /* C.Bucket */
    ] = e;
  }
  find(e, n, i = 2) {
    let o = e.bucket, r = this.buckets[o], a = this.index[o];
    for (let l = 0; l < r.length; l++) {
      let s = (l + a) % r.length, u = r[s];
      if ((!n || n(u)) && !this.reused.has(u))
        return r.splice(s, 1), s < a && this.index[o]--, this.reused.set(u, i), u;
    }
    return null;
  }
  findWidget(e, n, i) {
    let o = this.buckets[0];
    if (o.length)
      for (let r = 0, a = 0; ; r++) {
        if (r == o.length) {
          if (a)
            return null;
          a = 1, r = 0;
        }
        let l = o[r];
        if (!this.reused.has(l) && (a == 0 ? l.widget.compare(e) : l.widget.constructor == e.constructor && e.updateDOM(l.dom, this.view, l.widget)))
          return o.splice(r, 1), r < this.index[0] && this.index[0]--, l.widget == e && l.length == n && (l.flags & 497) == i ? (this.reused.set(
            l,
            1
            /* Reused.Full */
          ), l) : (this.reused.set(
            l,
            2
            /* Reused.DOM */
          ), new Jc(l.dom, n, e, l.flags & -498 | i));
      }
  }
  reuse(e) {
    return this.reused.set(
      e,
      1
      /* Reused.Full */
    ), e;
  }
  maybeReuse(e, n = 2) {
    if (!this.reused.has(e))
      return this.reused.set(e, n), e.dom;
  }
  clear() {
    for (let e = 0; e < this.buckets.length; e++)
      this.buckets[e].length = this.index[e] = 0;
  }
}
class s1e {
  constructor(e, n, i, o, r) {
    this.view = e, this.decorations = o, this.disallowBlockEffectsFor = r, this.openWidget = !1, this.openMarks = 0, this.cache = new l1e(e), this.text = new a1e(e.state.doc), this.builder = new r1e(this.cache, new qy(e, e.contentDOM), ri.iter(i)), this.cache.reused.set(
      n,
      2
      /* Reused.DOM */
    ), this.old = new i1e(n), this.reuseWalker = {
      skip: (a, l, s) => {
        if (this.cache.add(a), a.isComposite())
          return !1;
      },
      enter: (a) => this.cache.add(a),
      leave: () => {
      },
      break: () => {
      }
    };
  }
  run(e, n) {
    let i = n && this.getCompositionContext(n.text);
    for (let o = 0, r = 0, a = 0; ; ) {
      let l = a < e.length ? e[a++] : null, s = l ? l.fromA : this.old.root.length;
      if (s > o) {
        let u = s - o;
        this.preserve(u, !a, !l), o = s, r += u;
      }
      if (!l)
        break;
      n && l.fromA <= n.range.fromA && l.toA >= n.range.toA ? (this.forward(l.fromA, n.range.fromA, n.range.fromA < n.range.toA ? 1 : -1), this.emit(r, n.range.fromB), this.builder.flushBuffer(), this.cache.clear(), this.builder.addComposition(n, i), this.text.skip(n.range.toB - n.range.fromB), this.forward(n.range.fromA, l.toA), this.emit(n.range.toB, l.toB)) : (this.forward(l.fromA, l.toA), this.emit(r, l.toB)), r = l.toB, o = l.toA;
    }
    return this.builder.curLine && this.builder.endLine(), this.builder.root;
  }
  preserve(e, n, i) {
    let o = d1e(this.old), r = this.openMarks;
    this.old.advance(e, i ? 1 : -1, {
      skip: (a, l, s) => {
        if (a.isWidget())
          if (this.openWidget)
            this.builder.continueWidget(s - l);
          else {
            let u = s > 0 || l < a.length ? Jc.of(a.widget, this.view, s - l, a.flags & 496, this.cache.maybeReuse(a)) : this.cache.reuse(a);
            u.flags & 256 ? (u.flags &= -2, this.builder.addBlockWidget(u)) : (this.builder.ensureLine(null), this.builder.addInlineWidget(u, o, r), r = o.length);
          }
        else if (a.isText())
          this.builder.ensureLine(null), !l && s == a.length && !this.cache.reused.has(a) ? this.builder.addText(a.text, o, r, this.cache.reuse(a)) : (this.cache.add(a), this.builder.addText(a.text.slice(l, s), o, r)), r = o.length;
        else if (a.isLine())
          a.flags &= -2, this.cache.reused.set(
            a,
            1
            /* Reused.Full */
          ), this.builder.addLine(a);
        else if (a instanceof v0)
          this.cache.add(a);
        else if (a instanceof yr)
          this.builder.ensureLine(null), this.builder.addMark(a, o, r), this.cache.reused.set(
            a,
            1
            /* Reused.Full */
          ), r = o.length;
        else
          return !1;
        this.openWidget = !1;
      },
      enter: (a) => {
        a.isLine() ? this.builder.addLineStart(a.attrs, this.cache.maybeReuse(a)) : (this.cache.add(a), a instanceof yr && o.unshift(a.mark)), this.openWidget = !1;
      },
      leave: (a) => {
        a.isLine() ? o.length && (o.length = r = 0) : a instanceof yr && (o.shift(), r = Math.min(r, o.length));
      },
      break: () => {
        this.builder.addBreak(), this.openWidget = !1;
      }
    }), this.text.skip(e);
  }
  emit(e, n) {
    let i = null, o = this.builder, r = -1, a = ri.spans(this.decorations, e, n, {
      point: (l, s, u, c, d, f) => {
        if (u instanceof Gc) {
          if (this.disallowBlockEffectsFor[f]) {
            if (u.block)
              throw new RangeError("Block decorations may not be specified via plugins");
            if (s > this.view.state.doc.lineAt(l).to)
              throw new RangeError("Decorations that replace line breaks may not be specified via plugins");
          }
          if (r = c.length, d > c.length)
            o.continueWidget(s - l);
          else {
            let h = u.widget || (u.block ? qf.block : qf.inline), p = u1e(u), g = this.cache.findWidget(h, s - l, p) || Jc.of(h, this.view, s - l, p);
            u.block ? (u.startSide > 0 && o.addLineStartIfNotCovered(i), o.addBlockWidget(g)) : (o.ensureLine(i), o.addInlineWidget(g, c, d));
          }
          i = null;
        } else
          i = c1e(i, u);
        s > l && this.text.skip(s - l);
      },
      span: (l, s, u, c) => {
        for (let d = l; d < s; ) {
          let f = this.text.next(Math.min(512, s - d));
          f == null ? (o.addLineStartIfNotCovered(i), o.addBreak(), d++) : (o.ensureLine(i), o.addText(f, u, d == l ? c : u.length), d += f.length), i = null;
        }
        r = u.length;
      }
    });
    r > -1 && (this.openWidget = a > r), this.openWidget || o.addLineStartIfNotCovered(i), this.openMarks = a;
  }
  forward(e, n, i = 1) {
    n - e <= 10 ? this.old.advance(n - e, i, this.reuseWalker) : (this.old.advance(5, -1, this.reuseWalker), this.old.advance(n - e - 10, -1), this.old.advance(5, i, this.reuseWalker));
  }
  getCompositionContext(e) {
    let n = [], i = null;
    for (let o = e.parentNode; ; o = o.parentNode) {
      let r = ji.get(o);
      if (o == this.view.contentDOM)
        break;
      r instanceof yr ? n.push(r) : r?.isLine() ? i = r : r instanceof Ss || (o.nodeName == "DIV" && !i && o != this.view.contentDOM ? i = new jf(o, p6) : i || n.push(yr.of(new kg({ tagName: o.nodeName.toLowerCase(), attributes: Nbe(o) }), o)));
    }
    return { line: i, marks: n };
  }
}
function rM(t, e) {
  let n = (i) => {
    for (let o of i.children)
      if ((e ? o.isText() : o.length) || n(o))
        return !0;
    return !1;
  };
  return n(t);
}
function u1e(t) {
  let e = t.isReplace ? (t.startSide < 0 ? 64 : 0) | (t.endSide > 0 ? 128 : 0) : t.startSide > 0 ? 32 : 16;
  return t.block && (e |= 256), e;
}
const p6 = { class: "cm-line" };
function c1e(t, e) {
  let n = e.spec.attributes, i = e.spec.class;
  return !n && !i || (t || (t = { class: "cm-line" }), n && rk(n, t), i && (t.class += " " + i)), t;
}
function d1e(t) {
  let e = [];
  for (let n = t.parents.length; n > 1; n--) {
    let i = n == t.parents.length ? t.tile : t.parents[n].tile;
    i instanceof yr && e.push(i.mark);
  }
  return e;
}
function Z1(t) {
  let e = ji.get(t);
  return e && e.setDOM(t.cloneNode()), t;
}
class qf extends hh {
  constructor(e) {
    super(), this.tag = e;
  }
  eq(e) {
    return e.tag == this.tag;
  }
  toDOM() {
    return document.createElement(this.tag);
  }
  updateDOM(e) {
    return e.nodeName.toLowerCase() == this.tag;
  }
  get isHidden() {
    return !0;
  }
}
qf.inline = /* @__PURE__ */ new qf("span");
qf.block = /* @__PURE__ */ new qf("div");
const G1 = /* @__PURE__ */ new class extends hh {
  toDOM() {
    return document.createElement("br");
  }
  get isHidden() {
    return !0;
  }
  get editable() {
    return !0;
  }
}();
class aM {
  constructor(e) {
    this.view = e, this.decorations = [], this.blockWrappers = [], this.dynamicDecorationMap = [!1], this.domChanged = null, this.hasComposition = null, this.editContextFormatting = ai.none, this.lastCompositionAfterCursor = !1, this.minWidth = 0, this.minWidthFrom = 0, this.minWidthTo = 0, this.impreciseAnchor = null, this.impreciseHead = null, this.forceSelection = !1, this.lastUpdate = Date.now(), this.updateDeco(), this.tile = new qy(e, e.contentDOM), this.updateInner([new sa(0, 0, 0, e.state.doc.length)], null);
  }
  // Update the document view to a given state.
  update(e) {
    var n;
    let i = e.changedRanges;
    this.minWidth > 0 && i.length && (i.every(({ fromA: c, toA: d }) => d < this.minWidthFrom || c > this.minWidthTo) ? (this.minWidthFrom = e.changes.mapPos(this.minWidthFrom, 1), this.minWidthTo = e.changes.mapPos(this.minWidthTo, 1)) : this.minWidth = this.minWidthFrom = this.minWidthTo = 0), this.updateEditContextFormatting(e);
    let o = -1;
    this.view.inputState.composing >= 0 && !this.view.observer.editContext && (!((n = this.domChanged) === null || n === void 0) && n.newSel ? o = this.domChanged.newSel.head : !x1e(e.changes, this.hasComposition) && !e.selectionSet && (o = e.state.selection.main.head));
    let r = o > -1 ? h1e(this.view, e.changes, o) : null;
    if (this.domChanged = null, this.hasComposition) {
      let { from: c, to: d } = this.hasComposition;
      i = new sa(c, d, e.changes.mapPos(c, -1), e.changes.mapPos(d, 1)).addToSet(i.slice());
    }
    this.hasComposition = r ? { from: r.range.fromB, to: r.range.toB } : null, (kt.ie || kt.chrome) && !r && e && e.state.doc.lines != e.startState.doc.lines && (this.forceSelection = !0);
    let a = this.decorations, l = this.blockWrappers;
    this.updateDeco();
    let s = m1e(a, this.decorations, e.changes);
    s.length && (i = sa.extendWithRanges(i, s));
    let u = y1e(l, this.blockWrappers, e.changes);
    return u.length && (i = sa.extendWithRanges(i, u)), r && !i.some((c) => c.fromA <= r.range.fromA && c.toA >= r.range.toA) && (i = r.range.addToSet(i.slice())), this.tile.flags & 2 && i.length == 0 ? !1 : (this.updateInner(i, r), e.transactions.length && (this.lastUpdate = Date.now()), !0);
  }
  // Used by update and the constructor do perform the actual DOM
  // update
  updateInner(e, n) {
    this.view.viewState.mustMeasureContent = !0;
    let { observer: i } = this.view;
    i.ignore(() => {
      if (n || e.length) {
        let a = this.tile, l = new s1e(this.view, a, this.blockWrappers, this.decorations, this.dynamicDecorationMap);
        n && ji.get(n.text) && l.cache.reused.set(
          ji.get(n.text),
          2
          /* Reused.DOM */
        ), this.tile = l.run(e, n), HS(a, l.cache.reused);
      }
      this.tile.dom.style.height = this.view.viewState.contentHeight / this.view.scaleY + "px", this.tile.dom.style.flexBasis = this.minWidth ? this.minWidth + "px" : "";
      let r = kt.chrome || kt.ios ? { node: i.selectionRange.focusNode, written: !1 } : void 0;
      this.tile.sync(r), r && (r.written || i.selectionRange.focusNode != r.node || !this.tile.dom.contains(r.node)) && (this.forceSelection = !0), this.tile.dom.style.height = "";
    });
    let o = [];
    if (this.view.viewport.from || this.view.viewport.to < this.view.state.doc.length)
      for (let r of this.tile.children)
        r.isWidget() && r.widget instanceof U1 && o.push(r.dom);
    i.updateGaps(o);
  }
  updateEditContextFormatting(e) {
    this.editContextFormatting = this.editContextFormatting.map(e.changes);
    for (let n of e.transactions)
      for (let i of n.effects)
        i.is(u6) && (this.editContextFormatting = i.value);
  }
  // Sync the DOM selection to this.state.selection
  updateSelection(e = !1, n = !1) {
    (e || !this.view.observer.selectionRange.focusNode) && this.view.observer.readSelectionRange();
    let { dom: i } = this.tile, o = this.view.root.activeElement, r = o == i, a = !r && !(this.view.state.facet(ss) || i.tabIndex > -1) && bp(i, this.view.observer.selectionRange) && !(o && i.contains(o));
    if (!(r || n || a))
      return;
    let l = this.forceSelection;
    this.forceSelection = !1;
    let s = this.view.state.selection.main, u, c;
    if (s.empty ? c = u = this.inlineDOMNearPos(s.anchor, s.assoc || 1) : (c = this.inlineDOMNearPos(s.head, s.head == s.from ? 1 : -1), u = this.inlineDOMNearPos(s.anchor, s.anchor == s.from ? 1 : -1)), kt.gecko && s.empty && !this.hasComposition && f1e(u)) {
      let f = document.createTextNode("");
      this.view.observer.ignore(() => u.node.insertBefore(f, u.node.childNodes[u.offset] || null)), u = c = new La(f, 0), l = !0;
    }
    let d = this.view.observer.selectionRange;
    (l || !d.focusNode || (!Op(u.node, u.offset, d.anchorNode, d.anchorOffset) || !Op(c.node, c.offset, d.focusNode, d.focusOffset)) && !this.suppressWidgetCursorChange(d, s)) && (this.view.observer.ignore(() => {
      kt.android && kt.chrome && i.contains(d.focusNode) && b1e(d.focusNode, i) && (i.blur(), i.focus({ preventScroll: !0 }));
      let f = Zp(this.view.root);
      if (f) if (s.empty) {
        if (kt.gecko) {
          let h = p1e(u.node, u.offset);
          if (h && h != 3) {
            let p = (h == 1 ? K4 : X4)(u.node, u.offset);
            p && (u = new La(p.node, p.offset));
          }
        }
        f.collapse(u.node, u.offset), s.bidiLevel != null && f.caretBidiLevel !== void 0 && (f.caretBidiLevel = s.bidiLevel);
      } else if (f.extend) {
        f.collapse(u.node, u.offset);
        try {
          f.extend(c.node, c.offset);
        } catch {
        }
      } else {
        let h = document.createRange();
        s.anchor > s.head && ([u, c] = [c, u]), h.setEnd(c.node, c.offset), h.setStart(u.node, u.offset), f.removeAllRanges(), f.addRange(h);
      }
      a && this.view.root.activeElement == i && (i.blur(), o && o.focus());
    }), this.view.observer.setSelectionRange(u, c)), this.impreciseAnchor = u.precise ? null : new La(d.anchorNode, d.anchorOffset), this.impreciseHead = c.precise ? null : new La(d.focusNode, d.focusOffset);
  }
  // If a zero-length widget is inserted next to the cursor during
  // composition, avoid moving it across it and disrupting the
  // composition.
  suppressWidgetCursorChange(e, n) {
    return this.hasComposition && n.empty && Op(e.focusNode, e.focusOffset, e.anchorNode, e.anchorOffset) && this.posFromDOM(e.focusNode, e.focusOffset) == n.head;
  }
  enforceCursorAssoc() {
    if (this.hasComposition)
      return;
    let { view: e } = this, n = e.state.selection.main, i = Zp(e.root), { anchorNode: o, anchorOffset: r } = e.observer.selectionRange;
    if (!i || !n.empty || !n.assoc || !i.modify)
      return;
    let a = this.lineAt(n.head, n.assoc);
    if (!a)
      return;
    let l = a.posAtStart;
    if (n.head == l || n.head == l + a.length)
      return;
    let s = this.coordsAt(n.head, -1), u = this.coordsAt(n.head, 1);
    if (!s || !u || s.bottom > u.top)
      return;
    let c = this.domAtPos(n.head + n.assoc, n.assoc);
    i.collapse(c.node, c.offset), i.modify("move", n.assoc < 0 ? "forward" : "backward", "lineboundary"), e.observer.readSelectionRange();
    let d = e.observer.selectionRange;
    e.docView.posFromDOM(d.anchorNode, d.anchorOffset) != n.from && i.collapse(o, r);
  }
  posFromDOM(e, n) {
    let i = this.tile.nearest(e);
    if (!i)
      return this.tile.dom.compareDocumentPosition(e) & 2 ? 0 : this.view.state.doc.length;
    let o = i.posAtStart;
    if (i.isComposite()) {
      let r;
      if (e == i.dom)
        r = i.dom.childNodes[n];
      else {
        let a = As(e) == 0 ? 0 : n == 0 ? -1 : 1;
        for (; ; ) {
          let l = e.parentNode;
          if (l == i.dom)
            break;
          a == 0 && l.firstChild != l.lastChild && (e == l.firstChild ? a = -1 : a = 1), e = l;
        }
        a < 0 ? r = e : r = e.nextSibling;
      }
      if (r == i.dom.firstChild)
        return o;
      for (; r && !ji.get(r); )
        r = r.nextSibling;
      if (!r)
        return o + i.length;
      for (let a = 0, l = o; ; a++) {
        let s = i.children[a];
        if (s.dom == r)
          return l;
        l += s.length + s.breakAfter;
      }
    } else return i.isText() ? e == i.dom ? o + n : o + (n ? i.length : 0) : o;
  }
  domAtPos(e, n) {
    let { tile: i, offset: o } = this.tile.resolveBlock(e, n);
    return i.isWidget() ? i.domPosFor(o, n) : i.domIn(o, n);
  }
  inlineDOMNearPos(e, n) {
    let i, o = -1, r = !1, a, l = -1, s = !1;
    return this.tile.blockTiles((u, c) => {
      if (u.isWidget()) {
        if (u.flags & 32 && c >= e)
          return !0;
        u.flags & 16 && (r = !0);
      } else {
        let d = c + u.length;
        if (c <= e && (i = u, o = e - c, r = d < e), d >= e && !a && (a = u, l = e - c, s = c > e), c > e && a)
          return !0;
      }
    }), !i && !a ? this.domAtPos(e, n) : (r && a ? i = null : s && i && (a = null), i && n < 0 || !a ? i.domIn(o, n) : a.domIn(l, n));
  }
  // Get the coord of the element at the given side of the given
  // position. If rtl is given, flatten it using that text direction.
  coordsAt(e, n, i) {
    let { tile: o, offset: r } = this.tile.resolveBlock(e, n);
    return o.isWidget() ? o.widget instanceof U1 ? null : o.coordsInWidget(r, n, !0) : o.coordsIn(r, n, i);
  }
  lineAt(e, n) {
    let { tile: i } = this.tile.resolveBlock(e, n);
    return i.isLine() ? i : null;
  }
  coordsForChar(e) {
    let { tile: n, offset: i } = this.tile.resolveBlock(e, 1);
    if (!n.isLine())
      return null;
    function o(r, a) {
      if (r.isComposite())
        for (let l of r.children) {
          if (l.length >= a) {
            let s = o(l, a);
            if (s)
              return s;
          }
          if (a -= l.length, a < 0)
            break;
        }
      else if (r.isText() && a < r.length) {
        let l = $l(r.text, a);
        if (l == a)
          return null;
        let s = Up(r.dom, a, l).getClientRects();
        for (let u = 0; u < s.length; u++) {
          let c = s[u];
          if (u == s.length - 1 || c.top < c.bottom && c.left < c.right)
            return c;
        }
      }
      return null;
    }
    return o(n, i);
  }
  measureVisibleLineHeights(e) {
    let n = [], { from: i, to: o } = e, r = this.view.contentDOM.clientWidth, a = r > Math.max(this.view.scrollDOM.clientWidth, this.minWidth) + 1, l = -1, s = this.view.textDirection == Gi.LTR, u = 0, c = (d, f, h) => {
      for (let p = 0; p < d.children.length && !(f > o); p++) {
        let g = d.children[p], m = f + g.length, y = g.dom.getBoundingClientRect(), { height: b } = y;
        if (h && !p && (u += y.top - h.top), g instanceof Ss)
          m > i && c(g, f, y);
        else if (f >= i && (u > 0 && n.push(-u), n.push(b + u), u = 0, a)) {
          let w = g.dom.lastChild, $ = w ? xp(w) : [];
          if ($.length) {
            let C = $[$.length - 1], P = s ? C.right - y.left : y.right - C.left;
            P > l && (l = P, this.minWidth = r, this.minWidthFrom = f, this.minWidthTo = m);
          }
        }
        h && p == d.children.length - 1 && (u += h.bottom - y.bottom), f = m + g.breakAfter;
      }
    };
    return c(this.tile, 0, null), n;
  }
  textDirectionAt(e) {
    let { tile: n } = this.tile.resolveBlock(e, 1);
    return getComputedStyle(n.dom).direction == "rtl" ? Gi.RTL : Gi.LTR;
  }
  measureTextSize() {
    let e = this.tile.blockTiles((a) => {
      if (a.isLine() && a.children.length && a.length <= 20) {
        let l = 0, s;
        for (let u of a.children) {
          if (!u.isText() || /[^ -~]/.test(u.text))
            return;
          let c = xp(u.dom);
          if (c.length != 1)
            return;
          l += c[0].width, s = c[0].height;
        }
        if (l)
          return {
            lineHeight: a.dom.getBoundingClientRect().height,
            charWidth: l / a.length,
            textHeight: s
          };
      }
    });
    if (e)
      return e;
    let n = document.createElement("div"), i, o, r;
    return n.className = "cm-line", n.style.width = "99999px", n.style.position = "absolute", n.textContent = "abc def ghi jkl mno pqr stu", this.view.observer.ignore(() => {
      this.tile.dom.appendChild(n);
      let a = xp(n.firstChild)[0];
      i = n.getBoundingClientRect().height, o = a && a.width ? a.width / 27 : 7, r = a && a.height ? a.height : i, n.remove();
    }), { lineHeight: i, charWidth: o, textHeight: r };
  }
  computeBlockGapDeco() {
    let e = [], n = this.view.viewState;
    for (let i = 0, o = 0; ; o++) {
      let r = o == n.viewports.length ? null : n.viewports[o], a = r ? r.from - 1 : this.view.state.doc.length;
      if (a > i) {
        let l = (n.lineBlockAt(a).bottom - n.lineBlockAt(i).top) / this.view.scaleY;
        e.push(ai.replace({
          widget: new U1(l),
          block: !0,
          inclusive: !0,
          isBlockGap: !0
        }).range(i, a));
      }
      if (!r)
        break;
      i = r.to + 1;
    }
    return ai.set(e);
  }
  updateDeco() {
    let e = 1, n = this.view.state.facet(Wy).map((r) => (this.dynamicDecorationMap[e++] = typeof r == "function") ? r(this.view) : r), i = !1, o = this.view.state.facet(dk).map((r, a) => {
      let l = typeof r == "function";
      return l && (i = !0), l ? r(this.view) : r;
    });
    for (o.length && (this.dynamicDecorationMap[e++] = i, n.push(ri.join(o))), this.decorations = [
      this.editContextFormatting,
      ...n,
      this.computeBlockGapDeco(),
      this.view.viewState.lineGapDeco
    ]; e < this.decorations.length; )
      this.dynamicDecorationMap[e++] = !1;
    this.blockWrappers = this.view.state.facet(d6).map((r) => typeof r == "function" ? r(this.view) : r);
  }
  scrollIntoView(e) {
    if (e.isSnapshot) {
      let u = this.view.viewState.lineBlockAt(e.range.head);
      this.view.scrollDOM.scrollTop = u.top - e.yMargin, this.view.scrollDOM.scrollLeft = e.xMargin;
      return;
    }
    for (let u of this.view.state.facet(s6))
      try {
        if (u(this.view, e.range, e))
          return !0;
      } catch (c) {
        Rr(this.view.state, c, "scroll handler");
      }
    let { range: n } = e, i = this.coordsAt(n.head, n.assoc || (n.head > n.anchor ? -1 : 1)), o;
    if (!i)
      return;
    !n.empty && (o = this.coordsAt(n.anchor, n.anchor > n.head ? -1 : 1)) && (i = {
      left: Math.min(i.left, o.left),
      top: Math.min(i.top, o.top),
      right: Math.max(i.right, o.right),
      bottom: Math.max(i.bottom, o.bottom)
    });
    let r = fk(this.view), a = {
      left: i.left - r.left,
      top: i.top - r.top,
      right: i.right + r.right,
      bottom: i.bottom + r.bottom
    }, { offsetWidth: l, offsetHeight: s } = this.view.scrollDOM;
    if (Bbe(this.view.scrollDOM, a, n.head < n.anchor ? -1 : 1, e.x, e.y, Math.max(Math.min(e.xMargin, l), -l), Math.max(Math.min(e.yMargin, s), -s), this.view.textDirection == Gi.LTR), window.visualViewport && window.innerHeight - window.visualViewport.height > 1 && (i.top > window.pageYOffset + window.visualViewport.offsetTop + window.visualViewport.height || i.bottom < window.pageYOffset + window.visualViewport.offsetTop)) {
      let u = this.view.docView.lineAt(n.head, 1);
      u && u.dom.scrollIntoView({ block: "nearest" });
    }
  }
  lineHasWidget(e) {
    let n = (i) => i.isWidget() || i.children.some(n);
    return n(this.tile.resolveBlock(e, 1).tile);
  }
  destroy() {
    HS(this.tile);
  }
}
function HS(t, e) {
  let n = e?.get(t);
  if (n != 1) {
    n == null && t.destroy();
    for (let i of t.children)
      HS(i, e);
  }
}
function f1e(t) {
  return t.node.nodeType == 1 && t.node.firstChild && (t.offset == 0 || t.node.childNodes[t.offset - 1].contentEditable == "false") && (t.offset == t.node.childNodes.length || t.node.childNodes[t.offset].contentEditable == "false");
}
function g6(t, e) {
  let n = t.observer.selectionRange;
  if (!n.focusNode)
    return null;
  let i = K4(n.focusNode, n.focusOffset), o = X4(n.focusNode, n.focusOffset), r = i || o;
  if (o && i && o.node != i.node) {
    let l = ji.get(o.node);
    if (!l || l.isText() && l.text != o.node.nodeValue)
      r = o;
    else if (t.docView.lastCompositionAfterCursor) {
      let s = ji.get(i.node);
      !s || s.isText() && s.text != i.node.nodeValue || (r = o);
    }
  }
  if (t.docView.lastCompositionAfterCursor = r != i, !r)
    return null;
  let a = e - r.offset;
  return { from: a, to: a + r.node.nodeValue.length, node: r.node };
}
function h1e(t, e, n) {
  let i = g6(t, n);
  if (!i)
    return null;
  let { node: o, from: r, to: a } = i, l = o.nodeValue;
  if (/[\n\r]/.test(l) || t.state.doc.sliceString(i.from, i.to) != l)
    return null;
  let s = e.invertedDesc;
  return { range: new sa(s.mapPos(r), s.mapPos(a), r, a), text: o };
}
function p1e(t, e) {
  return t.nodeType != 1 ? 0 : (e && t.childNodes[e - 1].contentEditable == "false" ? 1 : 0) | (e < t.childNodes.length && t.childNodes[e].contentEditable == "false" ? 2 : 0);
}
let g1e = class {
  constructor() {
    this.changes = [];
  }
  compareRange(e, n) {
    vf(e, n, this.changes);
  }
  comparePoint(e, n) {
    vf(e, n, this.changes);
  }
  boundChange(e) {
    vf(e, e, this.changes);
  }
};
function m1e(t, e, n) {
  let i = new g1e();
  return ri.compare(t, e, n, i), i.changes;
}
class v1e {
  constructor() {
    this.changes = [];
  }
  compareRange(e, n) {
    vf(e, n, this.changes);
  }
  comparePoint() {
  }
  boundChange(e) {
    vf(e, e, this.changes);
  }
}
function y1e(t, e, n) {
  let i = new v1e();
  return ri.compare(t, e, n, i), i.changes;
}
function b1e(t, e) {
  for (let n = t; n && n != e; n = n.assignedSlot || n.parentNode)
    if (n.nodeType == 1 && n.contentEditable == "false")
      return !0;
  return !1;
}
function x1e(t, e) {
  let n = !1;
  return e && t.iterChangedRanges((i, o) => {
    i < e.to && o > e.from && (n = !0);
  }), n;
}
class U1 extends hh {
  constructor(e) {
    super(), this.height = e;
  }
  toDOM() {
    let e = document.createElement("div");
    return e.className = "cm-gap", this.updateDOM(e), e;
  }
  eq(e) {
    return e.height == this.height;
  }
  updateDOM(e) {
    return e.style.height = this.height + "px", !0;
  }
  get editable() {
    return !0;
  }
  get estimatedHeight() {
    return this.height;
  }
  ignoreEvent() {
    return !1;
  }
}
function O1e(t, e, n = 1) {
  let i = t.charCategorizer(e), o = t.doc.lineAt(e), r = e - o.from;
  if (o.length == 0)
    return Pt.cursor(e);
  r == 0 ? n = 1 : r == o.length && (n = -1);
  let a = r, l = r;
  n < 0 ? a = $l(o.text, r, !1) : l = $l(o.text, r);
  let s = i(o.text.slice(a, l));
  for (; a > 0; ) {
    let u = $l(o.text, a, !1);
    if (i(o.text.slice(u, a)) != s)
      break;
    a = u;
  }
  for (; l < o.length; ) {
    let u = $l(o.text, l);
    if (i(o.text.slice(l, u)) != s)
      break;
    l = u;
  }
  return Pt.undirectionalRange(a + o.from, l + o.from);
}
function S1e(t, e, n, i, o) {
  let r = Math.round((i - e.left) * t.defaultCharacterWidth);
  if (t.lineWrapping && n.height > t.defaultLineHeight * 1.5) {
    let l = t.viewState.heightOracle.textHeight, s = Math.floor((o - n.top - (t.defaultLineHeight - l) * 0.5) / l);
    r += s * t.viewState.heightOracle.lineLength;
  }
  let a = t.state.sliceDoc(n.from, n.to);
  return n.from + _be(a, r, t.state.tabSize);
}
function w1e(t, e, n) {
  let i = t.lineBlockAt(e);
  if (Array.isArray(i.type)) {
    let o;
    for (let r of i.type) {
      if (r.from > e)
        break;
      if (!(r.to < e)) {
        if (r.from < e && r.to > e)
          return r;
        (!o || r.type == da.Text && (o.type != r.type || (n < 0 ? r.from < e : r.to > e))) && (o = r);
      }
    }
    return o || i;
  }
  return i;
}
function C1e(t, e, n, i) {
  let o = w1e(t, e.head, e.assoc || -1), r = !i || o.type != da.Text || !(t.lineWrapping || o.widgetLineBreaks) ? null : t.coordsAtPos(e.assoc < 0 && e.head > o.from ? e.head - 1 : e.head);
  if (r) {
    let a = t.dom.getBoundingClientRect(), l = t.textDirectionAt(o.from), s = t.posAtCoords({
      x: n == (l == Gi.LTR) ? a.right - 1 : a.left + 1,
      y: (r.top + r.bottom) / 2
    });
    if (s != null)
      return Pt.cursor(s, n ? -1 : 1);
  }
  return Pt.cursor(n ? o.to : o.from, n ? -1 : 1);
}
function lM(t, e, n, i) {
  let o = t.state.doc.lineAt(e.head), r = t.bidiSpans(o), a = t.textDirectionAt(o.from);
  for (let l = e, s = null; ; ) {
    let u = Zbe(o, r, a, l, n), c = e6;
    if (!u) {
      if (o.number == (n ? t.state.doc.lines : 1))
        return l;
      c = `
`, o = t.state.doc.line(o.number + (n ? 1 : -1)), r = t.bidiSpans(o), u = t.visualLineSide(o, !n);
    }
    if (s) {
      if (!s(c))
        return l;
    } else {
      if (!i)
        return u;
      s = i(c);
    }
    l = u;
  }
}
function $1e(t, e, n) {
  let i = t.state.charCategorizer(e), o = i(n);
  return (r) => {
    let a = i(r);
    return o == hs.Space && (o = a), o == a;
  };
}
function k1e(t, e, n, i) {
  let o = e.head, r = n ? 1 : -1;
  if (o == (n ? t.state.doc.length : 0))
    return Pt.cursor(o, e.assoc);
  let a = e.goalColumn, l, s = t.contentDOM.getBoundingClientRect(), u = t.coordsAtPos(o, e.assoc || ((e.empty ? n : e.head == e.from) ? 1 : -1)), c = t.documentTop;
  if (u)
    a == null && (a = u.left - s.left), l = r < 0 ? u.top : u.bottom;
  else {
    let p = t.viewState.lineBlockAt(o);
    a == null && (a = Math.min(s.right - s.left, t.defaultCharacterWidth * (o - p.from))), l = (r < 0 ? p.top : p.bottom) + c;
  }
  let d = s.left + a, f = t.viewState.heightOracle.textHeight >> 1, h = i ?? f;
  for (let p = 0; ; p += f) {
    let g = l + (h + p) * r, m = WS(t, { x: d, y: g }, !1, r);
    if (n ? g > s.bottom : g < s.top)
      return Pt.cursor(m.pos, m.assoc);
    let y = t.coordsAtPos(m.pos, m.assoc), b = y ? (y.top + y.bottom) / 2 : 0;
    if (!y || (n ? b > l : b < l))
      return Pt.cursor(m.pos, m.assoc, void 0, a);
  }
}
function Sp(t, e, n) {
  for (; ; ) {
    let i = 0;
    for (let o of t)
      o.between(e - 1, e + 1, (r, a, l) => {
        if (e > r && e < a) {
          let s = i || n || (e - r < a - e ? -1 : 1);
          e = s < 0 ? r : a, i = s;
        }
      });
    if (!i)
      return e;
  }
}
function m6(t, e) {
  let n = null;
  for (let i = 0; i < e.ranges.length; i++) {
    let o = e.ranges[i], r = null;
    if (o.empty) {
      let a = Sp(t, o.from, 0);
      a != o.from && (r = Pt.cursor(a, -1));
    } else {
      let a = Sp(t, o.from, -1), l = Sp(t, o.to, 1);
      (a != o.from || l != o.to) && (o.undirectional ? r = Pt.undirectionalRange(o.from, o.to) : r = Pt.range(o.from == o.anchor ? a : l, o.from == o.head ? a : l));
    }
    r && (n || (n = e.ranges.slice()), n[i] = r);
  }
  return n ? Pt.create(n, e.mainIndex) : e;
}
function J1(t, e, n) {
  let i = Sp(t.state.facet(Pg).map((o) => o(t)), n.from, e.head > n.from ? -1 : 1);
  return i == n.from ? n : Pt.cursor(i, i < n.from ? 1 : -1);
}
class Ol {
  constructor(e, n) {
    this.pos = e, this.assoc = n;
  }
}
function WS(t, e, n, i) {
  let o = t.contentDOM.getBoundingClientRect(), r = o.top + t.viewState.paddingTop, { x: a, y: l } = e, s = l - r, u;
  for (; ; ) {
    if (s < 0)
      return new Ol(0, 1);
    if (s > t.viewState.docHeight)
      return new Ol(t.state.doc.length, -1);
    if (u = t.elementAtHeight(s), i == null)
      break;
    if (u.type == da.Text) {
      if (i < 0 ? u.to < t.viewport.from : u.from > t.viewport.to)
        break;
      let f = t.docView.coordsAt(i < 0 ? u.from : u.to, i > 0 ? -1 : 1);
      if (f && (i < 0 ? f.top <= s + r : f.bottom >= s + r))
        break;
    }
    let d = t.viewState.heightOracle.textHeight / 2;
    s = i > 0 ? u.bottom + d : u.top - d;
  }
  if (t.viewport.from >= u.to || t.viewport.to <= u.from) {
    if (n)
      return null;
    if (u.type == da.Text) {
      let d = S1e(t, o, u, a, l);
      return new Ol(d, d == u.from ? 1 : -1);
    }
  }
  if (u.type != da.Text)
    return s < (u.top + u.bottom) / 2 ? new Ol(u.from, 1) : new Ol(u.to, -1);
  let c = t.docView.lineAt(u.from, 2);
  return (!c || c.length != u.length) && (c = t.docView.lineAt(u.from, -2)), new T1e(t, a, l, t.textDirectionAt(u.from)).scanTile(c, u.from);
}
class T1e {
  constructor(e, n, i, o) {
    this.view = e, this.x = n, this.y = i, this.baseDir = o, this.line = null, this.spans = null;
  }
  bidiSpansAt(e) {
    return (!this.line || this.line.from > e || this.line.to < e) && (this.line = this.view.state.doc.lineAt(e), this.spans = this.view.bidiSpans(this.line)), this;
  }
  baseDirAt(e, n) {
    let { line: i, spans: o } = this.bidiSpansAt(e);
    return o[kl.find(o, e - i.from, -1, n)].level == this.baseDir;
  }
  dirAt(e, n) {
    let { line: i, spans: o } = this.bidiSpansAt(e);
    return o[kl.find(o, e - i.from, -1, n)].dir;
  }
  // Used to short-circuit bidi tests for content with a uniform direction
  bidiIn(e, n) {
    let { spans: i, line: o } = this.bidiSpansAt(e);
    return i.length > 1 || i.length && (i[0].level != this.baseDir || i[0].to + o.from < n);
  }
  // Scan through the rectangles for the content of a tile with inline
  // content, looking for one that overlaps the queried position
  // vertically and is closest horizontally. The caller is responsible
  // for dividing its content into N pieces, and pass an array with
  // N+1 positions (including the position after the last piece). For
  // a text tile, these will be character clusters, for a composite
  // tile, these will be child tiles.
  scan(e, n, i = !1) {
    let o = 0, r = e.length - 1, a = /* @__PURE__ */ new Set(), l = this.bidiIn(e[0], e[r]), s, u, c = -1, d = 1e9, f;
    e: for (; o < r; ) {
      let p = r - o, g = o + r >> 1;
      t: if (a.has(g)) {
        let y = o + Math.floor(Math.random() * p);
        for (let b = 0; b < p; b++) {
          if (!a.has(y)) {
            g = y;
            break t;
          }
          y++, y == r && (y = o);
        }
        break e;
      }
      a.add(g);
      let m = n(g);
      if (m)
        for (let y = 0; y < m.length; y++) {
          let b = m[y], w = 0;
          if (!(b.width == 0 && m.length > 1)) {
            if (b.bottom < this.y)
              (!s || s.bottom < b.bottom) && (s = b), w = 1;
            else if (b.top > this.y)
              (!u || u.top > b.top) && (u = b), w = -1;
            else {
              let $ = b.left > this.x ? this.x - b.left : b.right < this.x ? this.x - b.right : 0, C = Math.abs($);
              C < d && (c = g, d = C, f = b), $ && (w = $ < 0 == (this.baseDir == Gi.LTR) ? -1 : 1);
            }
            w == -1 && (!l || this.baseDirAt(e[g], 1)) ? r = g : w == 1 && (!l || this.baseDirAt(e[g + 1], -1)) && (o = g + 1);
          }
        }
    }
    if (!f) {
      if (!u && !s)
        return { i: e[0], after: !1 };
      let p = s && (!u || this.y - s.bottom < u.top - this.y) ? s : u;
      return this.y = (p.top + p.bottom) / 2, this.scan(e, n, !0);
    }
    if (d && !i) {
      let { top: p, bottom: g } = f;
      if (s && s.bottom > (p + p + g) / 3)
        return this.y = s.bottom - 1, this.scan(e, n, !0);
      if (u && u.top < (p + g + g) / 3)
        return this.y = u.top + 1, this.scan(e, n, !0);
    }
    let h = (l ? this.dirAt(e[c], 1) : this.baseDir) == Gi.LTR;
    return {
      i: c,
      // Test whether x is closes to the start or end of this element
      after: this.x > (f.left + f.right) / 2 == h
    };
  }
  scanText(e, n) {
    let i = [];
    for (let r = 0; r < e.length; r = $l(e.text, r))
      i.push(n + r);
    i.push(n + e.length);
    let o = this.scan(i, (r) => {
      let a = i[r] - n, l = i[r + 1] - n;
      return Up(e.dom, a, l).getClientRects();
    });
    return o.after ? new Ol(i[o.i + 1], -1) : new Ol(i[o.i], 1);
  }
  scanTile(e, n) {
    if (!e.length)
      return new Ol(n, 1);
    if (e.children.length == 1) {
      let l = e.children[0];
      if (l.isText())
        return this.scanText(l, n);
      if (l.isComposite())
        return this.scanTile(l, n);
    }
    let i = [n];
    for (let l = 0, s = n; l < e.children.length; l++)
      i.push(s += e.children[l].length);
    let o = this.scan(i, (l) => {
      let s = e.children[l];
      return s.flags & 48 ? null : (s.dom.nodeType == 1 ? s.dom : Up(s.dom, 0, s.length)).getClientRects();
    }), r = e.children[o.i], a = i[o.i];
    return r.isText() ? this.scanText(r, a) : r.isComposite() ? this.scanTile(r, a) : o.after ? new Ol(i[o.i + 1], -1) : new Ol(a, 1);
  }
}
const Wd = "";
class P1e {
  constructor(e, n) {
    this.points = e, this.view = n, this.text = "", this.lineSeparator = n.state.facet(ni.lineSeparator);
  }
  append(e) {
    this.text += e;
  }
  lineBreak() {
    this.text += Wd;
  }
  readRange(e, n) {
    if (!e)
      return this;
    let i = e.parentNode;
    for (let o = e; ; ) {
      this.findPointBefore(i, o);
      let r = this.text.length;
      this.readNode(o);
      let a = ji.get(o), l = o.nextSibling;
      if (l == n) {
        a?.breakAfter && !l && i != this.view.contentDOM && this.lineBreak();
        break;
      }
      let s = ji.get(l);
      (a && s ? a.breakAfter : (a ? a.breakAfter : g0(o)) || g0(l) && (o.nodeName != "BR" || a?.isWidget()) && this.text.length > r) && !_1e(l, n) && this.lineBreak(), o = l;
    }
    return this.findPointBefore(i, n), this;
  }
  readTextNode(e) {
    let n = e.nodeValue;
    for (let i of this.points)
      i.node == e && (i.pos = this.text.length + Math.min(i.offset, n.length));
    for (let i = 0, o = this.lineSeparator ? null : /\r\n?|\n/g; ; ) {
      let r = -1, a = 1, l;
      if (this.lineSeparator ? (r = n.indexOf(this.lineSeparator, i), a = this.lineSeparator.length) : (l = o.exec(n)) && (r = l.index, a = l[0].length), this.append(n.slice(i, r < 0 ? n.length : r)), r < 0)
        break;
      if (this.lineBreak(), a > 1)
        for (let s of this.points)
          s.node == e && s.pos > this.text.length && (s.pos -= a - 1);
      i = r + a;
    }
  }
  readNode(e) {
    let n = ji.get(e), i = n && n.overrideDOMText;
    if (i != null) {
      this.findPointInside(e, i.length);
      for (let o = i.iter(); !o.next().done; )
        o.lineBreak ? this.lineBreak() : this.append(o.value);
    } else e.nodeType == 3 ? this.readTextNode(e) : e.nodeName == "BR" ? e.nextSibling && this.lineBreak() : e.nodeType == 1 && this.readRange(e.firstChild, null);
  }
  findPointBefore(e, n) {
    for (let i of this.points)
      i.node == e && e.childNodes[i.offset] == n && (i.pos = this.text.length);
  }
  findPointInside(e, n) {
    for (let i of this.points)
      (e.nodeType == 3 ? i.node == e : e.contains(i.node)) && (i.pos = this.text.length + (E1e(e, i.node, i.offset) ? n : 0));
  }
}
function E1e(t, e, n) {
  for (; ; ) {
    if (!e || n < As(e))
      return !1;
    if (e == t)
      return !0;
    n = Lu(e) + 1, e = e.parentNode;
  }
}
function _1e(t, e) {
  let n;
  for (; !(t == e || !t); t = t.nextSibling) {
    let i = ji.get(t);
    if (!i?.isWidget())
      return !1;
    i && (n || (n = [])).push(i);
  }
  if (n)
    for (let i of n) {
      let o = i.overrideDOMText;
      if (o?.length)
        return !1;
    }
  return !0;
}
class sM {
  constructor(e, n) {
    this.node = e, this.offset = n, this.pos = -1;
  }
}
class I1e {
  constructor(e, n, i, o) {
    this.typeOver = o, this.bounds = null, this.text = "", this.domChanged = n > -1;
    let { impreciseHead: r, impreciseAnchor: a } = e.docView, l = e.state.selection;
    if (e.state.readOnly && n > -1)
      this.newSel = null;
    else if (n > -1 && (this.bounds = v6(e.docView.tile, n, i, 0))) {
      let s = r || a ? [] : A1e(e), u = new P1e(s, e);
      u.readRange(this.bounds.startDOM, this.bounds.endDOM), this.text = u.text, this.newSel = R1e(s, this.bounds.from);
    } else {
      let s = e.observer.selectionRange, u = r && r.node == s.focusNode && r.offset == s.focusOffset || !zS(e.contentDOM, s.focusNode) ? l.main.head : e.docView.posFromDOM(s.focusNode, s.focusOffset), c = a && a.node == s.anchorNode && a.offset == s.anchorOffset || !zS(e.contentDOM, s.anchorNode) ? l.main.anchor : e.docView.posFromDOM(s.anchorNode, s.anchorOffset), d = e.viewport;
      if ((kt.ios || kt.chrome) && u != c && Math.min(u, c) <= l.main.from && Math.max(u, c) >= l.main.to && (d.from > 0 || d.to < e.state.doc.length)) {
        let f = Math.min(u, c), h = Math.max(u, c), p = d.from - f, g = d.to - h;
        (p == 0 || p == 1 || f == 0) && (g == 0 || g == -1 || h == e.state.doc.length) && (u = 0, c = e.state.doc.length);
      }
      if (e.inputState.composing > -1 && l.ranges.length > 1)
        this.newSel = l.replaceRange(Pt.range(c, u));
      else if (e.lineWrapping && c == u && !(l.main.empty && l.main.head == u) && e.inputState.lastTouchTime > Date.now() - 100) {
        let f = e.coordsAtPos(u, -1), h = 0;
        f && (h = e.inputState.lastTouchY <= f.bottom ? -1 : 1), this.newSel = Pt.create([Pt.cursor(u, h)]);
      } else
        this.newSel = Pt.single(c, u);
    }
  }
}
function v6(t, e, n, i) {
  if (t.isComposite()) {
    let o = -1, r = -1, a = -1, l = -1;
    for (let s = 0, u = i, c = i; s < t.children.length; s++) {
      let d = t.children[s], f = u + d.length;
      if (u < e && f > n)
        return v6(d, e, n, u);
      if (f >= e && o == -1 && (o = s, r = u), u > n && d.dom.parentNode == t.dom) {
        a = s, l = c;
        break;
      }
      c = f, u = f + d.breakAfter;
    }
    return {
      from: r,
      to: l < 0 ? i + t.length : l,
      startDOM: (o ? t.children[o - 1].dom.nextSibling : null) || t.dom.firstChild,
      endDOM: a < t.children.length && a >= 0 ? t.children[a].dom : null
    };
  } else return t.isText() ? { from: i, to: i + t.length, startDOM: t.dom, endDOM: t.dom.nextSibling } : null;
}
function y6(t, e) {
  let n, { newSel: i } = e, { state: o } = t, r = o.selection.main, a = t.inputState.lastKeyTime > Date.now() - 100 ? t.inputState.lastKeyCode : -1;
  if (e.bounds) {
    let { from: l, to: s } = e.bounds, u = r.from, c = null;
    (a === 8 || kt.android && e.text.length < s - l) && (u = r.to, c = "end");
    let d = o.doc.sliceString(l, s, Wd), f, h;
    !r.empty && r.from >= l && r.to <= s && (e.typeOver || d != e.text) && d.slice(0, r.from - l) == e.text.slice(0, r.from - l) && d.slice(r.to - l) == e.text.slice(f = e.text.length - (d.length - (r.to - l))) ? n = {
      from: r.from,
      to: r.to,
      insert: Wn.of(e.text.slice(r.from - l, f).split(Wd))
    } : (h = b6(d, e.text, u - l, c)) && (kt.chrome && a == 13 && h.toB == h.from + 2 && e.text.slice(h.from, h.toB) == Wd + Wd && h.toB--, n = {
      from: l + h.from,
      to: l + h.toA,
      insert: Wn.of(e.text.slice(h.from, h.toB).split(Wd))
    });
  } else i && (!t.hasFocus && o.facet(ss) || b0(i, r)) && (i = null);
  if (!n && !i)
    return !1;
  if ((kt.mac || kt.android) && n && n.from == n.to && n.from == r.head - 1 && /^\. ?$/.test(n.insert.toString()) && t.contentDOM.getAttribute("autocorrect") == "off" ? (i && n.insert.length == 2 && (i = Pt.single(i.main.anchor - 1, i.main.head - 1)), n = { from: n.from, to: n.to, insert: Wn.of([n.insert.toString().replace(".", " ")]) }) : o.doc.lineAt(r.from).to < r.to && t.docView.lineHasWidget(r.to) && t.inputState.insertingTextAt > Date.now() - 50 ? n = {
    from: r.from,
    to: r.to,
    insert: o.toText(t.inputState.insertingText)
  } : kt.chrome && n && n.from == n.to && n.from == r.head && n.insert.toString() == `
 ` && t.lineWrapping && (i && (i = Pt.single(i.main.anchor - 1, i.main.head - 1)), n = { from: r.from, to: r.to, insert: Wn.of([" "]) }), n)
    return hk(t, n, i, a);
  if (i && !b0(i, r)) {
    let l = !1, s = "select";
    return t.inputState.lastSelectionTime > Date.now() - 50 && (t.inputState.lastSelectionOrigin == "select" && (l = !0), s = t.inputState.lastSelectionOrigin, s == "select.pointer" && (i = m6(o.facet(Pg).map((u) => u(t)), i))), t.dispatch({ selection: i, scrollIntoView: l, userEvent: s }), !0;
  } else
    return !1;
}
function hk(t, e, n, i = -1) {
  if (kt.ios && t.inputState.flushIOSKey(e))
    return !0;
  let o = t.state.selection.main;
  if (kt.android && (e.to == o.to && // GBoard will sometimes remove a space it just inserted
  // after a completion when you press enter
  (e.from == o.from || e.from == o.from - 1 && t.state.sliceDoc(e.from, o.from) == " ") && e.insert.length == 1 && e.insert.lines == 2 && yf(t.contentDOM, "Enter", 13) || (e.from == o.from - 1 && e.to == o.to && e.insert.length == 0 || i == 8 && e.insert.length < e.to - e.from && e.to > o.head) && yf(t.contentDOM, "Backspace", 8) || e.from == o.from && e.to == o.to + 1 && e.insert.length == 0 && yf(t.contentDOM, "Delete", 46)))
    return !0;
  let r = e.insert.toString();
  t.inputState.composing >= 0 && t.inputState.composing++;
  let a, l = () => a || (a = M1e(t, e, n));
  return t.state.facet(r6).some((s) => s(t, e.from, e.to, r, l)) || t.dispatch(l()), !0;
}
function M1e(t, e, n) {
  let i, o = t.state, r = o.selection.main, a = -1;
  if (e.from == e.to && e.from < r.from || e.from > r.to) {
    let s = e.from < r.from ? -1 : 1, u = s < 0 ? r.from : r.to, c = Sp(o.facet(Pg).map((d) => d(t)), u, s);
    e.from == c && (a = c);
  }
  if (a > -1)
    i = {
      changes: e,
      selection: Pt.cursor(e.from + e.insert.length, -1)
    };
  else if (e.from >= r.from && e.to <= r.to && e.to - e.from >= (r.to - r.from) / 3 && (!n || n.main.empty && n.main.from == e.from + e.insert.length) && t.inputState.composing < 0) {
    let s = r.from < e.from ? o.sliceDoc(r.from, e.from) : "", u = r.to > e.to ? o.sliceDoc(e.to, r.to) : "";
    i = o.replaceSelection(t.state.toText(s + e.insert.sliceString(0, void 0, t.state.lineBreak) + u));
  } else {
    let s = o.changes(e), u = n && n.main.to <= s.newLength ? n.main : void 0;
    if (o.selection.ranges.length > 1 && (t.inputState.composing >= 0 || t.inputState.compositionPendingChange) && e.to <= r.to + 10 && e.to >= r.to - 10) {
      let c = t.state.sliceDoc(e.from, e.to), d, f = n && g6(t, n.main.head);
      if (f) {
        let p = e.insert.length - (e.to - e.from);
        d = { from: f.from, to: f.to - p };
      } else
        d = t.state.doc.lineAt(r.head);
      let h = r.to - e.to;
      i = o.changeByRange((p) => {
        if (p.from == r.from && p.to == r.to)
          return { changes: s, range: u || p.map(s) };
        let g = p.to - h, m = g - c.length;
        if (t.state.sliceDoc(m, g) != c || // Unfortunately, there's no way to make multiple
        // changes in the same node work without aborting
        // composition, so cursors in the composition range are
        // ignored.
        g >= d.from && m <= d.to)
          return { range: p };
        let y = o.changes({ from: m, to: g, insert: e.insert }), b = p.to - r.to;
        return {
          changes: y,
          range: u ? Pt.range(Math.max(0, u.anchor + b), Math.max(0, u.head + b)) : p.map(y)
        };
      });
    } else
      i = {
        changes: s,
        selection: u && o.selection.replaceRange(u)
      };
  }
  let l = "input.type";
  return (t.composing || t.inputState.compositionPendingChange && t.inputState.compositionEndedAt > Date.now() - 50) && (t.inputState.compositionPendingChange = !1, l += ".compose", t.inputState.compositionFirstChange && (l += ".start", t.inputState.compositionFirstChange = !1)), o.update(i, { userEvent: l, scrollIntoView: !0 });
}
function b6(t, e, n, i) {
  let o = Math.min(t.length, e.length), r = 0;
  for (; r < o && t.charCodeAt(r) == e.charCodeAt(r); )
    r++;
  if (r == o && t.length == e.length)
    return null;
  let a = t.length, l = e.length;
  for (; a > 0 && l > 0 && t.charCodeAt(a - 1) == e.charCodeAt(l - 1); )
    a--, l--;
  if (i == "end") {
    let s = Math.max(0, r - Math.min(a, l));
    n -= a + s - r;
  }
  if (a < r && t.length < e.length) {
    let s = n <= r && n >= a ? r - n : 0;
    r -= s, l = r + (l - a), a = r;
  } else if (l < r) {
    let s = n <= r && n >= l ? r - n : 0;
    r -= s, a = r + (a - l), l = r;
  }
  return { from: r, toA: a, toB: l };
}
function A1e(t) {
  let e = [];
  if (t.root.activeElement != t.contentDOM)
    return e;
  let { anchorNode: n, anchorOffset: i, focusNode: o, focusOffset: r } = t.observer.selectionRange;
  return n && (e.push(new sM(n, i)), (o != n || r != i) && e.push(new sM(o, r))), e;
}
function R1e(t, e) {
  if (t.length == 0)
    return null;
  let n = t[0].pos, i = t.length == 2 ? t[1].pos : n;
  return n > -1 && i > -1 ? Pt.single(n + e, i + e) : null;
}
function b0(t, e) {
  return e.head == t.main.head && e.anchor == t.main.anchor;
}
class D1e {
  setSelectionOrigin(e) {
    this.lastSelectionOrigin = e, this.lastSelectionTime = Date.now();
  }
  constructor(e) {
    this.view = e, this.lastKeyCode = 0, this.lastKeyTime = 0, this.touchActive = !1, this.lastTouchTime = 0, this.lastTouchX = 0, this.lastTouchY = 0, this.lastFocusTime = 0, this.lastScrollTop = 0, this.lastScrollLeft = 0, this.lastWheelEvent = 0, this.pendingIOSKey = void 0, this.lastIOSMomentumScroll = 0, this.tabFocusMode = -1, this.lastSelectionOrigin = null, this.lastSelectionTime = 0, this.lastContextMenu = 0, this.scrollHandlers = [], this.handlers = /* @__PURE__ */ Object.create(null), this.composing = -1, this.compositionFirstChange = null, this.compositionEndedAt = 0, this.compositionPendingKey = !1, this.compositionPendingChange = !1, this.insertingText = "", this.insertingTextAt = 0, this.mouseSelection = null, this.draggedContent = null, this.handleEvent = this.handleEvent.bind(this), this.notifiedFocused = e.hasFocus, kt.safari && e.contentDOM.addEventListener("input", () => null), kt.gecko && G1e(e.contentDOM.ownerDocument);
  }
  handleEvent(e) {
    !W1e(this.view, e) || this.ignoreDuringComposition(e) || e.type == "keydown" && this.keydown(e) || (this.view.updateState != 0 ? Promise.resolve().then(() => this.runHandlers(e.type, e)) : this.runHandlers(e.type, e));
  }
  runHandlers(e, n) {
    let i = this.handlers[e];
    if (i) {
      for (let o of i.observers)
        o(this.view, n);
      for (let o of i.handlers) {
        if (n.defaultPrevented)
          break;
        if (o(this.view, n)) {
          n.preventDefault();
          break;
        }
      }
    }
  }
  ensureHandlers(e) {
    let n = L1e(e), i = this.handlers, o = this.view.contentDOM;
    for (let r in n)
      if (r != "scroll") {
        let a = !n[r].handlers.length, l = i[r];
        l && a != !l.handlers.length && (o.removeEventListener(r, this.handleEvent), l = null), l || o.addEventListener(r, this.handleEvent, { passive: a });
      }
    for (let r in i)
      r != "scroll" && !n[r] && o.removeEventListener(r, this.handleEvent);
    this.handlers = n;
  }
  keydown(e) {
    if (this.lastKeyCode = e.keyCode, this.lastKeyTime = Date.now(), e.keyCode == 9 && this.tabFocusMode > -1 && (!this.tabFocusMode || Date.now() <= this.tabFocusMode))
      return !0;
    if (this.tabFocusMode > 0 && e.keyCode != 27 && O6.indexOf(e.keyCode) < 0 && (this.tabFocusMode = -1), kt.android && kt.chrome && !e.synthetic && (e.keyCode == 13 || e.keyCode == 8))
      return this.view.observer.delayAndroidKey(e.key, e.keyCode), !0;
    if (kt.ios && !e.synthetic && !e.altKey && !e.metaKey && (x6.some((n) => n.keyCode == e.keyCode) && !e.ctrlKey || z1e.indexOf(e.key) > -1 && e.ctrlKey)) {
      let n = { ctrlKey: e.ctrlKey, altKey: e.altKey, metaKey: e.metaKey, shiftKey: e.shiftKey };
      return n.shiftKey && kt.ios && !/^(off|none)$/.test(this.view.contentDOM.autocapitalize) && N1e(this.view.win) && (n.shiftKey = !1), this.pendingIOSKey = { key: e.key, keyCode: e.keyCode, mods: n }, setTimeout(() => this.flushIOSKey(), 250), !0;
    }
    return e.keyCode != 229 && this.view.observer.forceFlush(), !1;
  }
  flushIOSKey(e) {
    let n = this.pendingIOSKey;
    return !n || n.key == "Enter" && e && e.from < e.to && /^\S+$/.test(e.insert.toString()) ? !1 : (this.pendingIOSKey = void 0, yf(this.view.contentDOM, n.key, n.keyCode, n.mods));
  }
  ignoreDuringComposition(e) {
    return !/^key/.test(e.type) || e.synthetic ? !1 : this.composing > 0 ? !0 : kt.safari && !kt.ios && this.compositionPendingKey && Date.now() - this.compositionEndedAt < 100 ? (this.compositionPendingKey = !1, !0) : !1;
  }
  startMouseSelection(e) {
    this.mouseSelection && this.mouseSelection.destroy(), this.mouseSelection = e;
  }
  update(e) {
    this.view.observer.update(e), this.mouseSelection && this.mouseSelection.update(e), this.draggedContent && e.docChanged && (this.draggedContent = this.draggedContent.map(e.changes)), e.transactions.length && (this.lastKeyCode = this.lastSelectionTime = 0);
  }
  destroy() {
    this.mouseSelection && this.mouseSelection.destroy();
  }
}
function N1e(t) {
  return t.visualViewport ? t.visualViewport.height * t.visualViewport.scale / t.document.documentElement.clientHeight < 0.85 : !1;
}
function uM(t, e) {
  return (n, i) => {
    try {
      return e.call(t, i, n);
    } catch (o) {
      Rr(n.state, o);
    }
  };
}
function L1e(t) {
  let e = /* @__PURE__ */ Object.create(null);
  function n(i) {
    return e[i] || (e[i] = { observers: [], handlers: [] });
  }
  for (let i of t) {
    let o = i.spec, r = o && o.plugin.domEventHandlers, a = o && o.plugin.domEventObservers;
    if (r)
      for (let l in r) {
        let s = r[l];
        s && n(l).handlers.push(uM(i.value, s));
      }
    if (a)
      for (let l in a) {
        let s = a[l];
        s && n(l).observers.push(uM(i.value, s));
      }
  }
  for (let i in Ka)
    n(i).handlers.push(Ka[i]);
  for (let i in lr)
    n(i).observers.push(lr[i]);
  return e;
}
const x6 = [
  { key: "Backspace", keyCode: 8, inputType: "deleteContentBackward" },
  { key: "Enter", keyCode: 13, inputType: "insertParagraph" },
  { key: "Enter", keyCode: 13, inputType: "insertLineBreak" },
  { key: "Delete", keyCode: 46, inputType: "deleteContentForward" }
], z1e = "dthko", O6 = [16, 17, 18, 20, 91, 92, 224, 225], Rm = 6;
function Dm(t) {
  return Math.max(0, t) * 0.7 + 8;
}
function B1e(t, e) {
  return Math.max(Math.abs(t.clientX - e.clientX), Math.abs(t.clientY - e.clientY));
}
class F1e {
  constructor(e, n, i, o) {
    this.view = e, this.startEvent = n, this.style = i, this.mustSelect = o, this.scrollSpeed = { x: 0, y: 0 }, this.scrolling = -1, this.lastEvent = n, this.scrollParents = j4(e.contentDOM), this.atoms = e.state.facet(Pg).map((a) => a(e));
    let r = e.contentDOM.ownerDocument;
    r.addEventListener("mousemove", this.move = this.move.bind(this)), r.addEventListener("mouseup", this.up = this.up.bind(this)), this.extend = n.shiftKey, this.multiple = e.state.facet(ni.allowMultipleSelections) && V1e(e, n), this.dragging = H1e(e, n) && C6(n) == 1 ? null : !1;
  }
  start(e) {
    this.dragging === !1 && this.select(e);
  }
  move(e) {
    if (e.buttons == 0)
      return this.destroy();
    if (this.dragging || this.dragging == null && B1e(this.startEvent, e) < 10)
      return;
    this.select(this.lastEvent = e);
    let n = 0, i = 0, o = 0, r = 0, a = this.view.win.innerWidth, l = this.view.win.innerHeight;
    this.scrollParents.x && ({ left: o, right: a } = this.scrollParents.x.getBoundingClientRect()), this.scrollParents.y && ({ top: r, bottom: l } = this.scrollParents.y.getBoundingClientRect());
    let s = fk(this.view);
    e.clientX - s.left <= o + Rm ? n = -Dm(o - e.clientX) : e.clientX + s.right >= a - Rm && (n = Dm(e.clientX - a)), e.clientY - s.top <= r + Rm ? i = -Dm(r - e.clientY) : e.clientY + s.bottom >= l - Rm && (i = Dm(e.clientY - l)), this.setScrollSpeed(n, i);
  }
  up(e) {
    this.dragging == null && this.select(this.lastEvent), this.dragging || e.preventDefault(), this.destroy();
  }
  destroy() {
    this.setScrollSpeed(0, 0);
    let e = this.view.contentDOM.ownerDocument;
    e.removeEventListener("mousemove", this.move), e.removeEventListener("mouseup", this.up), this.view.inputState.mouseSelection = this.view.inputState.draggedContent = null;
  }
  setScrollSpeed(e, n) {
    this.scrollSpeed = { x: e, y: n }, e || n ? this.scrolling < 0 && (this.scrolling = setInterval(() => this.scroll(), 50)) : this.scrolling > -1 && (clearInterval(this.scrolling), this.scrolling = -1);
  }
  scroll() {
    let { x: e, y: n } = this.scrollSpeed;
    e && this.scrollParents.x && (this.scrollParents.x.scrollLeft += e, e = 0), n && this.scrollParents.y && (this.scrollParents.y.scrollTop += n, n = 0), (e || n) && this.view.win.scrollBy(e, n), this.dragging === !1 && this.select(this.lastEvent);
  }
  select(e) {
    let { view: n } = this, i = m6(this.atoms, this.style.get(e, this.extend, this.multiple));
    (this.mustSelect || !i.eq(n.state.selection, this.dragging === !1)) && this.view.dispatch({
      selection: i,
      userEvent: "select.pointer"
    }), this.mustSelect = !1;
  }
  update(e) {
    e.transactions.some((n) => n.isUserEvent("input.type")) ? this.destroy() : this.style.update(e) && setTimeout(() => this.select(this.lastEvent), 20);
  }
}
function V1e(t, e) {
  let n = t.state.facet(t6);
  return n.length ? n[0](e) : kt.mac ? e.metaKey : e.ctrlKey;
}
function Q1e(t, e) {
  let n = t.state.facet(n6);
  return n.length ? n[0](e) : kt.mac ? !e.altKey : !e.ctrlKey;
}
function H1e(t, e) {
  let { main: n } = t.state.selection;
  if (n.empty)
    return !1;
  let i = Zp(t.root);
  if (!i || i.rangeCount == 0)
    return !0;
  let o = i.getRangeAt(0).getClientRects();
  for (let r = 0; r < o.length; r++) {
    let a = o[r];
    if (a.left <= e.clientX && a.right >= e.clientX && a.top <= e.clientY && a.bottom >= e.clientY)
      return !0;
  }
  return !1;
}
function W1e(t, e) {
  if (!e.bubbles)
    return !0;
  if (e.defaultPrevented)
    return !1;
  for (let n = e.target, i; n != t.contentDOM; n = n.parentNode)
    if (!n || n.nodeType == 11 || (i = ji.get(n)) && i.isWidget() && !i.isHidden && i.widget.ignoreEvent(e))
      return !1;
  return !0;
}
const Ka = /* @__PURE__ */ Object.create(null), lr = /* @__PURE__ */ Object.create(null), S6 = kt.ie && kt.ie_version < 15 || kt.ios && kt.webkit_version < 604;
function j1e(t) {
  let e = t.dom.parentNode;
  if (!e)
    return;
  let n = e.appendChild(document.createElement("textarea"));
  n.style.cssText = "position: fixed; left: -10000px; top: 10px", n.focus(), setTimeout(() => {
    t.focus(), n.remove(), w6(t, n.value);
  }, 50);
}
function Yy(t, e, n) {
  for (let i of t.facet(e))
    n = i(n, t);
  return n;
}
function w6(t, e) {
  e = Yy(t.state, sk, e);
  let { state: n } = t, i, o = 1, r = n.toText(e), a = r.lines == n.selection.ranges.length;
  if (jS != null && n.selection.ranges.every((s) => s.empty) && jS == r.toString()) {
    let s = -1;
    i = n.changeByRange((u) => {
      let c = n.doc.lineAt(u.from);
      if (c.from == s)
        return { range: u };
      s = c.from;
      let d = n.toText((a ? r.line(o++).text : e) + n.lineBreak);
      return {
        changes: { from: c.from, insert: d },
        range: Pt.cursor(u.from + d.length)
      };
    });
  } else a ? i = n.changeByRange((s) => {
    let u = r.line(o++);
    return {
      changes: { from: s.from, to: s.to, insert: u.text },
      range: Pt.cursor(s.from + u.length)
    };
  }) : i = n.replaceSelection(r);
  t.dispatch(i, {
    userEvent: "input.paste",
    scrollIntoView: !0
  });
}
lr.scroll = (t) => {
  let e = t.inputState;
  e.lastScrollTop = t.scrollDOM.scrollTop, e.lastScrollLeft = t.scrollDOM.scrollLeft, kt.ios && !e.touchActive && (e.lastIOSMomentumScroll = Date.now());
};
lr.wheel = lr.mousewheel = (t) => {
  t.inputState.lastWheelEvent = Date.now();
};
Ka.keydown = (t, e) => (t.inputState.setSelectionOrigin("select"), e.keyCode == 27 && t.inputState.tabFocusMode != 0 && (t.inputState.tabFocusMode = Date.now() + 2e3), !1);
lr.touchstart = (t, e) => {
  let n = t.inputState, i = e.targetTouches[0];
  n.touchActive = !0, n.lastTouchTime = Date.now(), i && (n.lastTouchX = i.clientX, n.lastTouchY = i.clientY), n.setSelectionOrigin("select.pointer");
};
lr.touchmove = (t) => {
  t.inputState.setSelectionOrigin("select.pointer");
};
lr.touchend = (t, e) => {
  t.inputState.touchActive = !1;
};
Ka.mousedown = (t, e) => {
  if (t.observer.flush(), t.inputState.lastTouchTime > Date.now() - 2e3)
    return !1;
  let n = null;
  for (let i of t.state.facet(i6))
    if (n = i(t, e), n)
      break;
  if (!n && e.button == 0 && (n = Y1e(t, e)), n) {
    let i = !t.hasFocus;
    t.inputState.startMouseSelection(new F1e(t, e, n, i)), i && t.observer.ignore(() => {
      q4(t.contentDOM);
      let r = t.root.activeElement;
      r && !r.contains(t.contentDOM) && r.blur();
    });
    let o = t.inputState.mouseSelection;
    if (o)
      return o.start(e), o.dragging === !1;
  } else
    t.inputState.setSelectionOrigin("select.pointer");
  return !1;
};
function cM(t, e, n, i) {
  if (i == 1)
    return Pt.cursor(e, n);
  if (i == 2)
    return O1e(t.state, e, n);
  {
    let o = t.docView.lineAt(e, n), r = t.state.doc.lineAt(o ? o.posAtEnd : e), a = o ? o.posAtStart : r.from, l = o ? o.posAtEnd : r.to;
    return l < t.state.doc.length && l == r.to && l++, Pt.undirectionalRange(a, l);
  }
}
const q1e = kt.ie && kt.ie_version <= 11;
let dM = null, fM = 0, hM = 0;
function C6(t) {
  if (!q1e)
    return t.detail;
  let e = dM, n = hM;
  return dM = t, hM = Date.now(), fM = !e || n > Date.now() - 400 && Math.abs(e.clientX - t.clientX) < 2 && Math.abs(e.clientY - t.clientY) < 2 ? (fM + 1) % 3 : 1;
}
function Y1e(t, e) {
  let n = t.posAndSideAtCoords({ x: e.clientX, y: e.clientY }, !1), i = C6(e), o = t.state.selection;
  return {
    update(r) {
      r.docChanged && (n.pos = r.changes.mapPos(n.pos), o = o.map(r.changes));
    },
    get(r, a, l) {
      let s = t.posAndSideAtCoords({ x: r.clientX, y: r.clientY }, !1), u, c = cM(t, s.pos, s.assoc, i);
      if (n.pos != s.pos && !a) {
        let d = cM(t, n.pos, n.assoc, i), f = Math.min(d.from, c.from), h = Math.max(d.to, c.to);
        c = f < c.from ? Pt.range(f, h, c.assoc) : Pt.range(h, f, c.assoc);
      }
      return a ? o.replaceRange(o.main.extend(c.from, c.to, c.assoc)) : l && i == 1 && o.ranges.length > 1 && (u = K1e(o, s.pos)) ? u : l ? o.addRange(c) : Pt.create([c]);
    }
  };
}
function K1e(t, e) {
  for (let n = 0; n < t.ranges.length; n++) {
    let { from: i, to: o } = t.ranges[n];
    if (i <= e && o >= e)
      return Pt.create(t.ranges.slice(0, n).concat(t.ranges.slice(n + 1)), t.mainIndex == n ? 0 : t.mainIndex - (t.mainIndex > n ? 1 : 0));
  }
  return null;
}
Ka.dragstart = (t, e) => {
  let { selection: { main: n } } = t.state;
  if (e.target.draggable) {
    let o = t.docView.tile.nearest(e.target);
    if (o && o.isWidget()) {
      let r = o.posAtStart, a = r + o.length;
      (r >= n.to || a <= n.from) && (n = Pt.undirectionalRange(r, a));
    }
  }
  let { inputState: i } = t;
  return i.mouseSelection && (i.mouseSelection.dragging = !0), i.draggedContent = n, e.dataTransfer && (e.dataTransfer.setData("Text", Yy(t.state, uk, t.state.sliceDoc(n.from, n.to))), e.dataTransfer.effectAllowed = "copyMove"), !1;
};
Ka.dragend = (t) => (t.inputState.draggedContent = null, !1);
function pM(t, e, n, i) {
  if (n = Yy(t.state, sk, n), !n)
    return;
  let o = t.posAtCoords({ x: e.clientX, y: e.clientY }, !1), { draggedContent: r } = t.inputState, a = i && r && Q1e(t, e) ? { from: r.from, to: r.to } : null, l = { from: o, insert: n }, s = t.state.changes(a ? [a, l] : l);
  t.focus(), t.dispatch({
    changes: s,
    selection: { anchor: s.mapPos(o, -1), head: s.mapPos(o, 1) },
    userEvent: a ? "move.drop" : "input.drop"
  }), t.inputState.draggedContent = null;
}
Ka.drop = (t, e) => {
  if (!e.dataTransfer)
    return !1;
  if (t.state.readOnly)
    return !0;
  let n = e.dataTransfer.files;
  if (n && n.length) {
    let i = Array(n.length), o = 0, r = () => {
      ++o == n.length && pM(t, e, i.filter((a) => a != null).join(t.state.lineBreak), !1);
    };
    for (let a = 0; a < n.length; a++) {
      let l = new FileReader();
      l.onerror = r, l.onload = () => {
        /[\x00-\x08\x0e-\x1f]{2}/.test(l.result) || (i[a] = l.result), r();
      }, l.readAsText(n[a]);
    }
    return !0;
  } else {
    let i = e.dataTransfer.getData("Text");
    if (i)
      return pM(t, e, i, !0), !0;
  }
  return !1;
};
Ka.paste = (t, e) => {
  if (t.state.readOnly)
    return !0;
  t.observer.flush();
  let n = S6 ? null : e.clipboardData;
  return n ? (w6(t, n.getData("text/plain") || n.getData("text/uri-list")), !0) : (j1e(t), !1);
};
function X1e(t, e) {
  let n = t.dom.parentNode;
  if (!n)
    return;
  let i = n.appendChild(document.createElement("textarea"));
  i.style.cssText = "position: fixed; left: -10000px; top: 10px", i.value = e, i.focus(), i.selectionEnd = e.length, i.selectionStart = 0, setTimeout(() => {
    i.remove(), t.focus();
  }, 50);
}
function Z1e(t) {
  let e = [], n = [], i = !1;
  for (let o of t.selection.ranges)
    o.empty || (e.push(t.sliceDoc(o.from, o.to)), n.push(o));
  if (!e.length) {
    let o = -1;
    for (let { from: r } of t.selection.ranges) {
      let a = t.doc.lineAt(r);
      a.number > o && (e.push(a.text), n.push({ from: a.from, to: Math.min(t.doc.length, a.to + 1) })), o = a.number;
    }
    i = !0;
  }
  return { text: Yy(t, uk, e.join(t.lineBreak)), ranges: n, linewise: i };
}
let jS = null;
Ka.copy = Ka.cut = (t, e) => {
  if (!bp(t.contentDOM, t.observer.selectionRange))
    return !1;
  let { text: n, ranges: i, linewise: o } = Z1e(t.state);
  if (!n && !o)
    return !1;
  jS = o ? n : null, e.type == "cut" && !t.state.readOnly && t.dispatch({
    changes: i,
    scrollIntoView: !0,
    userEvent: "delete.cut"
  });
  let r = S6 ? null : e.clipboardData;
  return r ? (r.clearData(), r.setData("text/plain", n), !0) : (X1e(t, n), !1);
};
const $6 = /* @__PURE__ */ fd.define();
function k6(t, e) {
  let n = [];
  for (let i of t.facet(a6)) {
    let o = i(t, e);
    o && n.push(o);
  }
  return n.length ? t.update({ effects: n, annotations: $6.of(!0) }) : null;
}
function T6(t) {
  setTimeout(() => {
    let e = t.hasFocus;
    if (e != t.inputState.notifiedFocused) {
      let n = k6(t.state, e);
      n ? t.dispatch(n) : t.update([]);
    }
  }, 10);
}
lr.focus = (t) => {
  t.inputState.lastFocusTime = Date.now(), !t.scrollDOM.scrollTop && (t.inputState.lastScrollTop || t.inputState.lastScrollLeft) && (t.scrollDOM.scrollTop = t.inputState.lastScrollTop, t.scrollDOM.scrollLeft = t.inputState.lastScrollLeft), T6(t);
};
lr.blur = (t) => {
  t.observer.clearSelectionRange(), T6(t);
};
lr.compositionstart = lr.compositionupdate = (t) => {
  t.observer.editContext || (t.inputState.compositionFirstChange == null && (t.inputState.compositionFirstChange = !0), t.inputState.composing < 0 && (t.inputState.composing = 0));
};
lr.compositionend = (t) => {
  t.observer.editContext || (t.inputState.composing = -1, t.inputState.compositionEndedAt = Date.now(), t.inputState.compositionPendingKey = !0, t.inputState.compositionPendingChange = t.observer.pendingRecords().length > 0, t.inputState.compositionFirstChange = null, kt.chrome && kt.android ? t.observer.flushSoon() : t.inputState.compositionPendingChange ? Promise.resolve().then(() => t.observer.flush()) : setTimeout(() => {
    t.inputState.composing < 0 && t.docView.hasComposition && t.update([]);
  }, 50));
};
lr.contextmenu = (t) => {
  t.inputState.lastContextMenu = Date.now();
};
Ka.beforeinput = (t, e) => {
  var n, i;
  if ((e.inputType == "insertText" || e.inputType == "insertCompositionText") && (t.inputState.insertingText = e.data, t.inputState.insertingTextAt = Date.now()), e.inputType == "insertReplacementText" && t.observer.editContext) {
    let r = (n = e.dataTransfer) === null || n === void 0 ? void 0 : n.getData("text/plain"), a = e.getTargetRanges();
    if (r && a.length) {
      let l = a[0], s = t.posAtDOM(l.startContainer, l.startOffset), u = t.posAtDOM(l.endContainer, l.endOffset);
      return hk(t, { from: s, to: u, insert: t.state.toText(r) }, null), !0;
    }
  }
  let o;
  if (kt.chrome && kt.android && (o = x6.find((r) => r.inputType == e.inputType)) && (t.observer.delayAndroidKey(o.key, o.keyCode), o.key == "Backspace" || o.key == "Delete")) {
    let r = ((i = window.visualViewport) === null || i === void 0 ? void 0 : i.height) || 0;
    setTimeout(() => {
      var a;
      (((a = window.visualViewport) === null || a === void 0 ? void 0 : a.height) || 0) > r + 10 && t.hasFocus && (t.contentDOM.blur(), t.focus());
    }, 100);
  }
  return kt.ios && e.inputType == "deleteContentForward" && t.observer.flushSoon(), kt.safari && e.inputType == "insertText" && t.inputState.composing >= 0 && setTimeout(() => lr.compositionend(t, e), 20), !1;
};
const gM = /* @__PURE__ */ new Set();
function G1e(t) {
  gM.has(t) || (gM.add(t), t.addEventListener("copy", () => {
  }), t.addEventListener("cut", () => {
  }));
}
const mM = ["pre-wrap", "normal", "pre-line", "break-spaces"];
let Yf = !1;
function vM() {
  Yf = !1;
}
class U1e {
  constructor(e) {
    this.lineWrapping = e, this.doc = Wn.empty, this.heightSamples = {}, this.lineHeight = 14, this.charWidth = 7, this.textHeight = 14, this.lineLength = 30;
  }
  heightForGap(e, n) {
    let i = this.doc.lineAt(n).number - this.doc.lineAt(e).number + 1;
    return this.lineWrapping && (i += Math.max(0, Math.ceil((n - e - i * this.lineLength * 0.5) / this.lineLength))), this.lineHeight * i;
  }
  heightForLine(e) {
    return this.lineWrapping ? (1 + Math.max(0, Math.ceil((e - this.lineLength) / Math.max(1, this.lineLength - 5)))) * this.lineHeight : this.lineHeight;
  }
  setDoc(e) {
    return this.doc = e, this;
  }
  mustRefreshForWrapping(e) {
    return mM.indexOf(e) > -1 != this.lineWrapping;
  }
  mustRefreshForHeights(e) {
    let n = !1;
    for (let i = 0; i < e.length; i++) {
      let o = e[i];
      o < 0 ? i++ : this.heightSamples[Math.floor(o * 10)] || (n = !0, this.heightSamples[Math.floor(o * 10)] = !0);
    }
    return n;
  }
  refresh(e, n, i, o, r, a) {
    let l = mM.indexOf(e) > -1, s = Math.abs(n - this.lineHeight) > 0.3 || this.lineWrapping != l;
    if (this.lineWrapping = l, this.lineHeight = n, this.charWidth = i, this.textHeight = o, this.lineLength = r, s) {
      this.heightSamples = {};
      for (let u = 0; u < a.length; u++) {
        let c = a[u];
        c < 0 ? u++ : this.heightSamples[Math.floor(c * 10)] = !0;
      }
    }
    return s;
  }
}
class J1e {
  constructor(e, n) {
    this.from = e, this.heights = n, this.index = 0;
  }
  get more() {
    return this.index < this.heights.length;
  }
}
class Ra {
  /**
  @internal
  */
  constructor(e, n, i, o, r) {
    this.from = e, this.length = n, this.top = i, this.height = o, this._content = r;
  }
  /**
  The type of element this is. When querying lines, this may be
  an array of all the blocks that make up the line.
  */
  get type() {
    return typeof this._content == "number" ? da.Text : Array.isArray(this._content) ? this._content : this._content.type;
  }
  /**
  The end of the element as a document position.
  */
  get to() {
    return this.from + this.length;
  }
  /**
  The bottom position of the element.
  */
  get bottom() {
    return this.top + this.height;
  }
  /**
  If this is a widget block, this will return the widget
  associated with it.
  */
  get widget() {
    return this._content instanceof Gc ? this._content.widget : null;
  }
  /**
  If this is a textblock, this holds the number of line breaks
  that appear in widgets inside the block.
  */
  get widgetLineBreaks() {
    return typeof this._content == "number" ? this._content : 0;
  }
  /**
  @internal
  */
  join(e) {
    let n = (Array.isArray(this._content) ? this._content : [this]).concat(Array.isArray(e._content) ? e._content : [e]);
    return new Ra(this.from, this.length + e.length, this.top, this.height + e.height, n);
  }
}
var bi = /* @__PURE__ */ (function(t) {
  return t[t.ByPos = 0] = "ByPos", t[t.ByHeight = 1] = "ByHeight", t[t.ByPosNoHeight = 2] = "ByPosNoHeight", t;
})(bi || (bi = {}));
const kv = 1e-3;
class ar {
  constructor(e, n, i = 2) {
    this.length = e, this.height = n, this.flags = i;
  }
  get outdated() {
    return (this.flags & 2) > 0;
  }
  set outdated(e) {
    this.flags = (e ? 2 : 0) | this.flags & -3;
  }
  setHeight(e) {
    this.height != e && (Math.abs(this.height - e) > kv && (Yf = !0), this.height = e);
  }
  // Base case is to replace a leaf node, which simply builds a tree
  // from the new nodes and returns that (HeightMapBranch and
  // HeightMapGap override this to actually use from/to)
  replace(e, n, i) {
    return ar.of(i);
  }
  // Again, these are base cases, and are overridden for branch and gap nodes.
  decomposeLeft(e, n) {
    n.push(this);
  }
  decomposeRight(e, n) {
    n.push(this);
  }
  applyChanges(e, n, i, o) {
    let r = this, a = i.doc;
    for (let l = o.length - 1; l >= 0; l--) {
      let { fromA: s, toA: u, fromB: c, toB: d } = o[l], f = r.lineAt(s, bi.ByPosNoHeight, i.setDoc(n), 0, 0), h = f.to >= u ? f : r.lineAt(u, bi.ByPosNoHeight, i, 0, 0);
      for (d += h.to - u, u = h.to; l > 0 && f.from <= o[l - 1].toA; )
        s = o[l - 1].fromA, c = o[l - 1].fromB, l--, s < f.from && (f = r.lineAt(s, bi.ByPosNoHeight, i, 0, 0));
      c += f.from - s, s = f.from;
      let p = pk.build(i.setDoc(a), e, c, d);
      r = x0(r, r.replace(s, u, p));
    }
    return r.updateHeight(i, 0);
  }
  static empty() {
    return new Ir(0, 0, 0);
  }
  // nodes uses null values to indicate the position of line breaks.
  // There are never line breaks at the start or end of the array, or
  // two line breaks next to each other, and the array isn't allowed
  // to be empty (same restrictions as return value from the builder).
  static of(e) {
    if (e.length == 1)
      return e[0];
    let n = 0, i = e.length, o = 0, r = 0;
    for (; ; )
      if (n == i)
        if (o > r * 2) {
          let l = e[n - 1];
          l.break ? e.splice(--n, 1, l.left, null, l.right) : e.splice(--n, 1, l.left, l.right), i += 1 + l.break, o -= l.size;
        } else if (r > o * 2) {
          let l = e[i];
          l.break ? e.splice(i, 1, l.left, null, l.right) : e.splice(i, 1, l.left, l.right), i += 2 + l.break, r -= l.size;
        } else
          break;
      else if (o < r) {
        let l = e[n++];
        l && (o += l.size);
      } else {
        let l = e[--i];
        l && (r += l.size);
      }
    let a = 0;
    return e[n - 1] == null ? (a = 1, n--) : e[n] == null && (a = 1, i++), new txe(ar.of(e.slice(0, n)), a, ar.of(e.slice(i)));
  }
}
function x0(t, e) {
  return t == e ? t : (t.constructor != e.constructor && (Yf = !0), e);
}
ar.prototype.size = 1;
const exe = /* @__PURE__ */ ai.replace({});
class P6 extends ar {
  constructor(e, n, i) {
    super(e, n), this.deco = i, this.spaceAbove = 0;
  }
  mainBlock(e, n) {
    return new Ra(n, this.length, e + this.spaceAbove, this.height - this.spaceAbove, this.deco || 0);
  }
  blockAt(e, n, i, o) {
    return this.spaceAbove && e < i + this.spaceAbove ? new Ra(o, 0, i, this.spaceAbove, exe) : this.mainBlock(i, o);
  }
  lineAt(e, n, i, o, r) {
    let a = this.mainBlock(o, r);
    return this.spaceAbove ? this.blockAt(0, i, o, r).join(a) : a;
  }
  forEachLine(e, n, i, o, r, a) {
    e <= r + this.length && n >= r && a(this.lineAt(0, bi.ByPos, i, o, r));
  }
  setMeasuredHeight(e) {
    let n = e.heights[e.index++];
    n < 0 ? (this.spaceAbove = -n, n = e.heights[e.index++]) : this.spaceAbove = 0, this.setHeight(n);
  }
  updateHeight(e, n = 0, i = !1, o) {
    return o && o.from <= n && o.more && this.setMeasuredHeight(o), this.outdated = !1, this;
  }
  toString() {
    return `block(${this.length})`;
  }
}
class Ir extends P6 {
  constructor(e, n, i) {
    super(e, n, null), this.collapsed = 0, this.widgetHeight = 0, this.breaks = 0, this.spaceAbove = i;
  }
  mainBlock(e, n) {
    return new Ra(n, this.length, e + this.spaceAbove, this.height - this.spaceAbove, this.breaks);
  }
  replace(e, n, i) {
    let o = i[0];
    return i.length == 1 && (o instanceof Ir || o instanceof Po && o.flags & 4) && Math.abs(this.length - o.length) < 10 ? (o instanceof Po ? o = new Ir(o.length, this.height, this.spaceAbove) : o.height = this.height, this.outdated || (o.outdated = !1), o) : ar.of(i);
  }
  updateHeight(e, n = 0, i = !1, o) {
    return o && o.from <= n && o.more ? this.setMeasuredHeight(o) : (i || this.outdated) && (this.spaceAbove = 0, this.setHeight(Math.max(this.widgetHeight, e.heightForLine(this.length - this.collapsed)) + this.breaks * e.lineHeight)), this.outdated = !1, this;
  }
  toString() {
    return `line(${this.length}${this.collapsed ? -this.collapsed : ""}${this.widgetHeight ? ":" + this.widgetHeight : ""})`;
  }
}
class Po extends ar {
  constructor(e) {
    super(e, 0);
  }
  heightMetrics(e, n) {
    let i = e.doc.lineAt(n).number, o = e.doc.lineAt(n + this.length).number, r = o - i + 1, a, l = 0;
    if (e.lineWrapping) {
      let s = Math.min(this.height, e.lineHeight * r);
      a = s / r, this.length > r + 1 && (l = (this.height - s) / (this.length - r - 1));
    } else
      a = this.height / r;
    return { firstLine: i, lastLine: o, perLine: a, perChar: l };
  }
  blockAt(e, n, i, o) {
    let { firstLine: r, lastLine: a, perLine: l, perChar: s } = this.heightMetrics(n, o);
    if (n.lineWrapping) {
      let u = o + (e < n.lineHeight ? 0 : Math.round(Math.max(0, Math.min(1, (e - i) / this.height)) * this.length)), c = n.doc.lineAt(u), d = l + c.length * s, f = Math.max(i, e - d / 2);
      return new Ra(c.from, c.length, f, d, 0);
    } else {
      let u = Math.max(0, Math.min(a - r, Math.floor((e - i) / l))), { from: c, length: d } = n.doc.line(r + u);
      return new Ra(c, d, i + l * u, l, 0);
    }
  }
  lineAt(e, n, i, o, r) {
    if (n == bi.ByHeight)
      return this.blockAt(e, i, o, r);
    if (n == bi.ByPosNoHeight) {
      let { from: h, to: p } = i.doc.lineAt(e);
      return new Ra(h, p - h, 0, 0, 0);
    }
    let { firstLine: a, perLine: l, perChar: s } = this.heightMetrics(i, r), u = i.doc.lineAt(e), c = l + u.length * s, d = u.number - a, f = o + l * d + s * (u.from - r - d);
    return new Ra(u.from, u.length, Math.max(o, Math.min(f, o + this.height - c)), c, 0);
  }
  forEachLine(e, n, i, o, r, a) {
    e = Math.max(e, r), n = Math.min(n, r + this.length);
    let { firstLine: l, perLine: s, perChar: u } = this.heightMetrics(i, r);
    for (let c = e, d = o; c <= n; ) {
      let f = i.doc.lineAt(c);
      if (c == e) {
        let p = f.number - l;
        d += s * p + u * (e - r - p);
      }
      let h = s + u * f.length;
      a(new Ra(f.from, f.length, d, h, 0)), d += h, c = f.to + 1;
    }
  }
  replace(e, n, i) {
    let o = this.length - n;
    if (o > 0) {
      let r = i[i.length - 1];
      r instanceof Po ? i[i.length - 1] = new Po(r.length + o) : i.push(null, new Po(o - 1));
    }
    if (e > 0) {
      let r = i[0];
      r instanceof Po ? i[0] = new Po(e + r.length) : i.unshift(new Po(e - 1), null);
    }
    return ar.of(i);
  }
  decomposeLeft(e, n) {
    n.push(new Po(e - 1), null);
  }
  decomposeRight(e, n) {
    n.push(null, new Po(this.length - e - 1));
  }
  updateHeight(e, n = 0, i = !1, o) {
    let r = n + this.length;
    if (o && o.from <= n + this.length && o.more) {
      let a = [], l = Math.max(n, o.from), s = -1;
      for (o.from > n && a.push(new Po(o.from - n - 1).updateHeight(e, n)); l <= r && o.more; ) {
        let c = e.doc.lineAt(l).length;
        a.length && a.push(null);
        let d = o.heights[o.index++], f = 0;
        d < 0 && (f = -d, d = o.heights[o.index++]), s == -1 ? s = d : Math.abs(d - s) >= kv && (s = -2);
        let h = new Ir(c, d, f);
        h.outdated = !1, a.push(h), l += c + 1;
      }
      l <= r && a.push(null, new Po(r - l).updateHeight(e, l));
      let u = ar.of(a);
      return (s < 0 || Math.abs(u.height - this.height) >= kv || Math.abs(s - this.heightMetrics(e, n).perLine) >= kv) && (Yf = !0), x0(this, u);
    } else (i || this.outdated) && (this.setHeight(e.heightForGap(n, n + this.length)), this.outdated = !1);
    return this;
  }
  toString() {
    return `gap(${this.length})`;
  }
}
class txe extends ar {
  constructor(e, n, i) {
    super(e.length + n + i.length, e.height + i.height, n | (e.outdated || i.outdated ? 2 : 0)), this.left = e, this.right = i, this.size = e.size + i.size;
  }
  get break() {
    return this.flags & 1;
  }
  blockAt(e, n, i, o) {
    let r = i + this.left.height;
    return e < r ? this.left.blockAt(e, n, i, o) : this.right.blockAt(e, n, r, o + this.left.length + this.break);
  }
  lineAt(e, n, i, o, r) {
    let a = o + this.left.height, l = r + this.left.length + this.break, s = n == bi.ByHeight ? e < a : e < l, u = s ? this.left.lineAt(e, n, i, o, r) : this.right.lineAt(e, n, i, a, l);
    if (this.break || (s ? u.to < l : u.from > l))
      return u;
    let c = n == bi.ByPosNoHeight ? bi.ByPosNoHeight : bi.ByPos;
    return s ? u.join(this.right.lineAt(l, c, i, a, l)) : this.left.lineAt(l, c, i, o, r).join(u);
  }
  forEachLine(e, n, i, o, r, a) {
    let l = o + this.left.height, s = r + this.left.length + this.break;
    if (this.break)
      e < s && this.left.forEachLine(e, n, i, o, r, a), n >= s && this.right.forEachLine(e, n, i, l, s, a);
    else {
      let u = this.lineAt(s, bi.ByPos, i, o, r);
      e < u.from && this.left.forEachLine(e, u.from - 1, i, o, r, a), u.to >= e && u.from <= n && a(u), n > u.to && this.right.forEachLine(u.to + 1, n, i, l, s, a);
    }
  }
  replace(e, n, i) {
    let o = this.left.length + this.break;
    if (n < o)
      return this.balanced(this.left.replace(e, n, i), this.right);
    if (e > this.left.length)
      return this.balanced(this.left, this.right.replace(e - o, n - o, i));
    let r = [];
    e > 0 && this.decomposeLeft(e, r);
    let a = r.length;
    for (let l of i)
      r.push(l);
    if (e > 0 && yM(r, a - 1), n < this.length) {
      let l = r.length;
      this.decomposeRight(n, r), yM(r, l);
    }
    return ar.of(r);
  }
  decomposeLeft(e, n) {
    let i = this.left.length;
    if (e <= i)
      return this.left.decomposeLeft(e, n);
    n.push(this.left), this.break && (i++, e >= i && n.push(null)), e > i && this.right.decomposeLeft(e - i, n);
  }
  decomposeRight(e, n) {
    let i = this.left.length, o = i + this.break;
    if (e >= o)
      return this.right.decomposeRight(e - o, n);
    e < i && this.left.decomposeRight(e, n), this.break && e < o && n.push(null), n.push(this.right);
  }
  balanced(e, n) {
    return e.size > 2 * n.size || n.size > 2 * e.size ? ar.of(this.break ? [e, null, n] : [e, n]) : (this.left = x0(this.left, e), this.right = x0(this.right, n), this.setHeight(e.height + n.height), this.outdated = e.outdated || n.outdated, this.size = e.size + n.size, this.length = e.length + this.break + n.length, this);
  }
  updateHeight(e, n = 0, i = !1, o) {
    let { left: r, right: a } = this, l = n + r.length + this.break, s = null;
    return o && o.from <= n + r.length && o.more ? s = r = r.updateHeight(e, n, i, o) : r.updateHeight(e, n, i), o && o.from <= l + a.length && o.more ? s = a = a.updateHeight(e, l, i, o) : a.updateHeight(e, l, i), s ? this.balanced(r, a) : (this.height = this.left.height + this.right.height, this.outdated = !1, this);
  }
  toString() {
    return this.left + (this.break ? " " : "-") + this.right;
  }
}
function yM(t, e) {
  let n, i;
  t[e] == null && (n = t[e - 1]) instanceof Po && (i = t[e + 1]) instanceof Po && t.splice(e - 1, 3, new Po(n.length + 1 + i.length));
}
const nxe = 5;
class pk {
  constructor(e, n) {
    this.pos = e, this.oracle = n, this.nodes = [], this.lineStart = -1, this.lineEnd = -1, this.covering = null, this.writtenTo = e;
  }
  get isCovered() {
    return this.covering && this.nodes[this.nodes.length - 1] == this.covering;
  }
  span(e, n) {
    if (this.lineStart > -1) {
      let i = Math.min(n, this.lineEnd), o = this.nodes[this.nodes.length - 1];
      o instanceof Ir ? o.length += i - this.pos : (i > this.pos || !this.isCovered) && this.nodes.push(new Ir(i - this.pos, -1, 0)), this.writtenTo = i, n > i && (this.nodes.push(null), this.writtenTo++, this.lineStart = -1);
    }
    this.pos = n;
  }
  point(e, n, i) {
    if (e < n || i.heightRelevant) {
      let o = i.widget ? i.widget.estimatedHeight : 0, r = i.widget ? i.widget.lineBreaks : 0;
      o < 0 && (o = this.oracle.lineHeight);
      let a = n - e;
      i.block ? this.addBlock(new P6(a, o, i)) : (a || r || o >= nxe) && this.addLineDeco(o, r, a);
    } else n > e && this.span(e, n);
    this.lineEnd > -1 && this.lineEnd < this.pos && (this.lineEnd = this.oracle.doc.lineAt(this.pos).to);
  }
  enterLine() {
    if (this.lineStart > -1)
      return;
    let { from: e, to: n } = this.oracle.doc.lineAt(this.pos);
    this.lineStart = e, this.lineEnd = n, this.writtenTo < e && ((this.writtenTo < e - 1 || this.nodes[this.nodes.length - 1] == null) && this.nodes.push(this.blankContent(this.writtenTo, e - 1)), this.nodes.push(null)), this.pos > e && this.nodes.push(new Ir(this.pos - e, -1, 0)), this.writtenTo = this.pos;
  }
  blankContent(e, n) {
    let i = new Po(n - e);
    return this.oracle.doc.lineAt(e).to == n && (i.flags |= 4), i;
  }
  ensureLine() {
    this.enterLine();
    let e = this.nodes.length ? this.nodes[this.nodes.length - 1] : null;
    if (e instanceof Ir)
      return e;
    let n = new Ir(0, -1, 0);
    return this.nodes.push(n), n;
  }
  addBlock(e) {
    this.enterLine();
    let n = e.deco;
    n && n.startSide > 0 && !this.isCovered && this.ensureLine(), this.nodes.push(e), this.writtenTo = this.pos = this.pos + e.length, n && n.endSide > 0 && (this.covering = e);
  }
  addLineDeco(e, n, i) {
    let o = this.ensureLine();
    o.length += i, o.collapsed += i, o.widgetHeight = Math.max(o.widgetHeight, e), o.breaks += n, this.writtenTo = this.pos = this.pos + i;
  }
  finish(e) {
    let n = this.nodes.length == 0 ? null : this.nodes[this.nodes.length - 1];
    this.lineStart > -1 && !(n instanceof Ir) && !this.isCovered ? this.nodes.push(new Ir(0, -1, 0)) : (this.writtenTo < this.pos || n == null) && this.nodes.push(this.blankContent(this.writtenTo, this.pos));
    let i = e;
    for (let o of this.nodes)
      o instanceof Ir && o.updateHeight(this.oracle, i), i += o ? o.length : 1;
    return this.nodes;
  }
  // Always called with a region that on both sides either stretches
  // to a line break or the end of the document.
  // The returned array uses null to indicate line breaks, but never
  // starts or ends in a line break, or has multiple line breaks next
  // to each other.
  static build(e, n, i, o) {
    let r = new pk(i, e);
    return ri.spans(n, i, o, r, 0), r.finish(i);
  }
}
function ixe(t, e, n) {
  let i = new oxe();
  return ri.compare(t, e, n, i, 0), i.changes;
}
class oxe {
  constructor() {
    this.changes = [];
  }
  compareRange() {
  }
  comparePoint(e, n, i, o) {
    (e < n || i && i.heightRelevant || o && o.heightRelevant) && vf(e, n, this.changes, 5);
  }
}
function rxe(t, e) {
  let n = t.getBoundingClientRect(), i = t.ownerDocument, o = i.defaultView || window, r = Math.max(0, n.left), a = Math.min(o.innerWidth, n.right), l = Math.max(0, n.top), s = Math.min(o.innerHeight, n.bottom);
  for (let u = t.parentNode; u && u != i.body; )
    if (u.nodeType == 1) {
      let c = u, d = window.getComputedStyle(c);
      if ((c.scrollHeight > c.clientHeight || c.scrollWidth > c.clientWidth) && d.overflow != "visible") {
        let f = c.getBoundingClientRect();
        r = Math.max(r, f.left), a = Math.min(a, f.right), l = Math.max(l, f.top), s = Math.min(u == t.parentNode ? o.innerHeight : s, f.bottom);
      }
      u = d.position == "absolute" || d.position == "fixed" ? c.offsetParent : c.parentNode;
    } else if (u.nodeType == 11)
      u = u.host;
    else
      break;
  return {
    left: r - n.left,
    right: Math.max(r, a) - n.left,
    top: l - (n.top + e),
    bottom: Math.max(l, s) - (n.top + e)
  };
}
function axe(t) {
  let e = t.getBoundingClientRect(), n = t.ownerDocument.defaultView || window;
  return e.left < n.innerWidth && e.right > 0 && e.top < n.innerHeight && e.bottom > 0;
}
function lxe(t, e) {
  let n = t.getBoundingClientRect();
  return {
    left: 0,
    right: n.right - n.left,
    top: e,
    bottom: n.bottom - (n.top + e)
  };
}
class ex {
  constructor(e, n, i, o) {
    this.from = e, this.to = n, this.size = i, this.displaySize = o;
  }
  static same(e, n) {
    if (e.length != n.length)
      return !1;
    for (let i = 0; i < e.length; i++) {
      let o = e[i], r = n[i];
      if (o.from != r.from || o.to != r.to || o.size != r.size)
        return !1;
    }
    return !0;
  }
  draw(e, n) {
    return ai.replace({
      widget: new sxe(this.displaySize * (n ? e.scaleY : e.scaleX), n)
    }).range(this.from, this.to);
  }
}
class sxe extends hh {
  constructor(e, n) {
    super(), this.size = e, this.vertical = n;
  }
  eq(e) {
    return e.size == this.size && e.vertical == this.vertical;
  }
  toDOM() {
    let e = document.createElement("div");
    return this.vertical ? e.style.height = this.size + "px" : (e.style.width = this.size + "px", e.style.height = "2px", e.style.display = "inline-block"), e;
  }
  get estimatedHeight() {
    return this.vertical ? this.size : -1;
  }
}
class bM {
  constructor(e, n) {
    this.view = e, this.state = n, this.pixelViewport = { left: 0, right: window.innerWidth, top: 0, bottom: 0 }, this.inView = !0, this.paddingTop = 0, this.paddingBottom = 0, this.contentDOMWidth = 0, this.contentDOMHeight = 0, this.editorHeight = 0, this.editorWidth = 0, this.scaleX = 1, this.scaleY = 1, this.scrollOffset = 0, this.scrolledToBottom = !1, this.scrollAnchorPos = 0, this.scrollAnchorHeight = -1, this.scaler = xM, this.scrollTarget = null, this.printing = !1, this.mustMeasureContent = !0, this.defaultTextDirection = Gi.LTR, this.visibleRanges = [], this.mustEnforceCursorAssoc = !1;
    let i = n.facet(ck).some((o) => typeof o != "function" && o.class == "cm-lineWrapping");
    this.heightOracle = new U1e(i), this.stateDeco = OM(n), this.heightMap = ar.empty().applyChanges(this.stateDeco, Wn.empty, this.heightOracle.setDoc(n.doc), [new sa(0, 0, 0, n.doc.length)]);
    for (let o = 0; o < 2 && (this.viewport = this.getViewport(0, null), !!this.updateForViewport()); o++)
      ;
    this.updateViewportLines(), this.lineGaps = this.ensureLineGaps([]), this.lineGapDeco = ai.set(this.lineGaps.map((o) => o.draw(this, !1))), this.scrollParent = e.scrollDOM, this.computeVisibleRanges();
  }
  updateForViewport() {
    let e = [this.viewport], { main: n } = this.state.selection;
    for (let i = 0; i <= 1; i++) {
      let o = i ? n.head : n.anchor;
      if (!e.some(({ from: r, to: a }) => o >= r && o <= a)) {
        let { from: r, to: a } = this.lineBlockAt(o);
        e.push(new Nm(r, a));
      }
    }
    return this.viewports = e.sort((i, o) => i.from - o.from), this.updateScaler();
  }
  updateScaler() {
    let e = this.scaler;
    return this.scaler = this.heightMap.height <= 7e6 ? xM : new gk(this.heightOracle, this.heightMap, this.viewports), e.eq(this.scaler) ? 0 : 2;
  }
  updateViewportLines() {
    this.viewportLines = [], this.heightMap.forEachLine(this.viewport.from, this.viewport.to, this.heightOracle.setDoc(this.state.doc), 0, 0, (e) => {
      this.viewportLines.push(Uh(e, this.scaler));
    });
  }
  update(e, n = null) {
    this.state = e.state;
    let i = this.stateDeco;
    this.stateDeco = OM(this.state);
    let o = e.changedRanges, r = sa.extendWithRanges(o, ixe(i, this.stateDeco, e ? e.changes : bo.empty(this.state.doc.length))), a = this.heightMap.height, l = this.scrolledToBottom ? null : this.scrollAnchorAt(this.scrollOffset);
    vM(), this.heightMap = this.heightMap.applyChanges(this.stateDeco, e.startState.doc, this.heightOracle.setDoc(this.state.doc), r), (this.heightMap.height != a || Yf) && (e.flags |= 2), l ? (this.scrollAnchorPos = e.changes.mapPos(l.from, -1), this.scrollAnchorHeight = l.top) : (this.scrollAnchorPos = -1, this.scrollAnchorHeight = a);
    let s = r.length ? this.mapViewport(this.viewport, e.changes) : this.viewport;
    (n && (n.range.head < s.from || n.range.head > s.to) || !this.viewportIsAppropriate(s)) && (s = this.getViewport(0, n));
    let u = s.from != this.viewport.from || s.to != this.viewport.to;
    this.viewport = s, e.flags |= this.updateForViewport(), (u || !e.changes.empty || e.flags & 2) && this.updateViewportLines(), (this.lineGaps.length || this.viewport.to - this.viewport.from > 4e3) && this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps, e.changes))), e.flags |= this.computeVisibleRanges(e.changes), n && (this.scrollTarget = n), !this.mustEnforceCursorAssoc && (e.selectionSet || e.focusChanged) && e.view.lineWrapping && e.state.selection.main.empty && e.state.selection.main.assoc && !e.state.facet(Ube) && (this.mustEnforceCursorAssoc = !0);
  }
  measure() {
    let { view: e } = this, n = e.contentDOM, i = window.getComputedStyle(n), o = this.heightOracle, r = i.whiteSpace;
    this.defaultTextDirection = i.direction == "rtl" ? Gi.RTL : Gi.LTR;
    let a = this.heightOracle.mustRefreshForWrapping(r) || this.mustMeasureContent === "refresh", l = n.getBoundingClientRect(), s = a || this.mustMeasureContent || this.contentDOMHeight != l.height;
    this.contentDOMHeight = l.height, this.mustMeasureContent = !1;
    let u = 0, c = 0;
    if (l.width && l.height) {
      let { scaleX: C, scaleY: P } = W4(n, l);
      (C > 5e-3 && Math.abs(this.scaleX - C) > 5e-3 || P > 5e-3 && Math.abs(this.scaleY - P) > 5e-3) && (this.scaleX = C, this.scaleY = P, u |= 16, a = s = !0);
    }
    let d = (parseInt(i.paddingTop) || 0) * this.scaleY, f = (parseInt(i.paddingBottom) || 0) * this.scaleY;
    (this.paddingTop != d || this.paddingBottom != f) && (this.paddingTop = d, this.paddingBottom = f, u |= 18), this.editorWidth != e.scrollDOM.clientWidth && (o.lineWrapping && (s = !0), this.editorWidth = e.scrollDOM.clientWidth, u |= 16);
    let h = j4(this.view.contentDOM, !1).y;
    h != this.scrollParent && (this.scrollParent = h, this.scrollAnchorHeight = -1, this.scrollOffset = 0);
    let p = this.getScrollOffset();
    this.scrollOffset != p && (this.scrollAnchorHeight = -1, this.scrollOffset = p), this.scrolledToBottom = Y4(this.scrollParent || e.win);
    let g = (this.printing ? lxe : rxe)(n, this.paddingTop), m = g.top - this.pixelViewport.top, y = g.bottom - this.pixelViewport.bottom;
    this.pixelViewport = g;
    let b = this.pixelViewport.bottom > this.pixelViewport.top && this.pixelViewport.right > this.pixelViewport.left;
    if (b != this.inView && (this.inView = b, b && (s = !0)), !this.inView && !this.scrollTarget && !axe(e.dom))
      return 0;
    let w = l.width;
    if ((this.contentDOMWidth != w || this.editorHeight != e.scrollDOM.clientHeight) && (this.contentDOMWidth = l.width, this.editorHeight = e.scrollDOM.clientHeight, u |= 16), s) {
      let C = e.docView.measureVisibleLineHeights(this.viewport);
      if (o.mustRefreshForHeights(C) && (a = !0), a || o.lineWrapping && Math.abs(w - this.contentDOMWidth) > o.charWidth) {
        let { lineHeight: P, charWidth: O, textHeight: E } = e.docView.measureTextSize();
        a = P > 0 && o.refresh(r, P, O, E, Math.max(5, w / O), C), a && (e.docView.minWidth = 0, u |= 16);
      }
      m > 0 && y > 0 ? c = Math.max(m, y) : m < 0 && y < 0 && (c = Math.min(m, y)), vM();
      for (let P of this.viewports) {
        let O = P.from == this.viewport.from ? C : e.docView.measureVisibleLineHeights(P);
        this.heightMap = (a ? ar.empty().applyChanges(this.stateDeco, Wn.empty, this.heightOracle, [new sa(0, 0, 0, e.state.doc.length)]) : this.heightMap).updateHeight(o, 0, a, new J1e(P.from, O));
      }
      Yf && (u |= 2);
    }
    let $ = !this.viewportIsAppropriate(this.viewport, c) || this.scrollTarget && (this.scrollTarget.range.head < this.viewport.from || this.scrollTarget.range.head > this.viewport.to);
    return $ && (u & 2 && (u |= this.updateScaler()), this.viewport = this.getViewport(c, this.scrollTarget), u |= this.updateForViewport()), (u & 2 || $) && this.updateViewportLines(), (this.lineGaps.length || this.viewport.to - this.viewport.from > 4e3) && this.updateLineGaps(this.ensureLineGaps(a ? [] : this.lineGaps, e)), u |= this.computeVisibleRanges(), this.mustEnforceCursorAssoc && (this.mustEnforceCursorAssoc = !1, e.docView.enforceCursorAssoc()), u;
  }
  get visibleTop() {
    return this.scaler.fromDOM(this.pixelViewport.top);
  }
  get visibleBottom() {
    return this.scaler.fromDOM(this.pixelViewport.bottom);
  }
  getViewport(e, n) {
    let i = 0.5 - Math.max(-0.5, Math.min(0.5, e / 1e3 / 2)), o = this.heightMap, r = this.heightOracle, { visibleTop: a, visibleBottom: l } = this, s = new Nm(o.lineAt(a - i * 1e3, bi.ByHeight, r, 0, 0).from, o.lineAt(l + (1 - i) * 1e3, bi.ByHeight, r, 0, 0).to);
    if (n) {
      let { head: u } = n.range;
      if (u < s.from || u > s.to) {
        let c = Math.min(this.editorHeight, this.pixelViewport.bottom - this.pixelViewport.top), d = o.lineAt(u, bi.ByPos, r, 0, 0), f;
        n.y == "center" ? f = (d.top + d.bottom) / 2 - c / 2 : n.y == "start" || n.y == "nearest" && u < s.from ? f = d.top : f = d.bottom - c, s = new Nm(o.lineAt(f - 1e3 / 2, bi.ByHeight, r, 0, 0).from, o.lineAt(f + c + 1e3 / 2, bi.ByHeight, r, 0, 0).to);
      }
    }
    return s;
  }
  mapViewport(e, n) {
    let i = n.mapPos(e.from, -1), o = n.mapPos(e.to, 1);
    return new Nm(this.heightMap.lineAt(i, bi.ByPos, this.heightOracle, 0, 0).from, this.heightMap.lineAt(o, bi.ByPos, this.heightOracle, 0, 0).to);
  }
  // Checks if a given viewport covers the visible part of the
  // document and not too much beyond that.
  viewportIsAppropriate({ from: e, to: n }, i = 0) {
    if (!this.inView)
      return !0;
    let { top: o } = this.heightMap.lineAt(e, bi.ByPos, this.heightOracle, 0, 0), { bottom: r } = this.heightMap.lineAt(n, bi.ByPos, this.heightOracle, 0, 0), { visibleTop: a, visibleBottom: l } = this;
    return (e == 0 || o <= a - Math.max(10, Math.min(
      -i,
      250
      /* VP.MaxCoverMargin */
    ))) && (n == this.state.doc.length || r >= l + Math.max(10, Math.min(
      i,
      250
      /* VP.MaxCoverMargin */
    ))) && o > a - 2 * 1e3 && r < l + 2 * 1e3;
  }
  mapLineGaps(e, n) {
    if (!e.length || n.empty)
      return e;
    let i = [];
    for (let o of e)
      n.touchesRange(o.from, o.to) || i.push(new ex(n.mapPos(o.from), n.mapPos(o.to), o.size, o.displaySize));
    return i;
  }
  // Computes positions in the viewport where the start or end of a
  // line should be hidden, trying to reuse existing line gaps when
  // appropriate to avoid unneccesary redraws.
  // Uses crude character-counting for the positioning and sizing,
  // since actual DOM coordinates aren't always available and
  // predictable. Relies on generous margins (see LG.Margin) to hide
  // the artifacts this might produce from the user.
  ensureLineGaps(e, n) {
    let i = this.heightOracle.lineWrapping, o = i ? 1e4 : 2e3, r = o >> 1, a = o << 1;
    if (this.defaultTextDirection != Gi.LTR && !i)
      return [];
    let l = [], s = (c, d, f, h) => {
      if (d - c < r)
        return;
      let p = this.state.selection.main, g = [p.from];
      p.empty || g.push(p.to);
      for (let y of g)
        if (y > c && y < d) {
          s(c, y - 10, f, h), s(y + 10, d, f, h);
          return;
        }
      let m = cxe(e, (y) => y.from >= f.from && y.to <= f.to && Math.abs(y.from - c) < r && Math.abs(y.to - d) < r && !g.some((b) => y.from < b && y.to > b));
      if (!m) {
        if (d < f.to && n && i && n.visibleRanges.some((w) => w.from <= d && w.to >= d)) {
          let w = n.moveToLineBoundary(Pt.cursor(d), !1, !0).head;
          w > c && (d = w);
        }
        let y = this.gapSize(f, c, d, h), b = i || y < 2e6 ? y : 2e6;
        m = new ex(c, d, y, b);
      }
      l.push(m);
    }, u = (c) => {
      if (c.length < a || c.type != da.Text)
        return;
      let d = uxe(c.from, c.to, this.stateDeco);
      if (d.total < a)
        return;
      let f = this.scrollTarget ? this.scrollTarget.range.head : null, h, p;
      if (i) {
        let g = o / this.heightOracle.lineLength * this.heightOracle.lineHeight, m, y;
        if (f != null) {
          let b = zm(d, f), w = ((this.visibleBottom - this.visibleTop) / 2 + g) / c.height;
          m = b - w, y = b + w;
        } else
          m = (this.visibleTop - c.top - g) / c.height, y = (this.visibleBottom - c.top + g) / c.height;
        h = Lm(d, m), p = Lm(d, y);
      } else {
        let g = d.total * this.heightOracle.charWidth, m = o * this.heightOracle.charWidth, y = 0;
        if (g > 2e6)
          for (let P of e)
            P.from >= c.from && P.from < c.to && P.size != P.displaySize && P.from * this.heightOracle.charWidth + y < this.pixelViewport.left && (y = P.size - P.displaySize);
        let b = this.pixelViewport.left + y, w = this.pixelViewport.right + y, $, C;
        if (f != null) {
          let P = zm(d, f), O = ((w - b) / 2 + m) / g;
          $ = P - O, C = P + O;
        } else
          $ = (b - m) / g, C = (w + m) / g;
        h = Lm(d, $), p = Lm(d, C);
      }
      h > c.from && s(c.from, h, c, d), p < c.to && s(p, c.to, c, d);
    };
    for (let c of this.viewportLines)
      Array.isArray(c.type) ? c.type.forEach(u) : u(c);
    return l;
  }
  gapSize(e, n, i, o) {
    let r = zm(o, i) - zm(o, n);
    return this.heightOracle.lineWrapping ? e.height * r : o.total * this.heightOracle.charWidth * r;
  }
  updateLineGaps(e) {
    ex.same(e, this.lineGaps) || (this.lineGaps = e, this.lineGapDeco = ai.set(e.map((n) => n.draw(this, this.heightOracle.lineWrapping))));
  }
  computeVisibleRanges(e) {
    let n = this.stateDeco;
    this.lineGaps.length && (n = n.concat(this.lineGapDeco));
    let i = [];
    ri.spans(n, this.viewport.from, this.viewport.to, {
      span(r, a) {
        i.push({ from: r, to: a });
      },
      point() {
      }
    }, 20);
    let o = 0;
    if (i.length != this.visibleRanges.length)
      o = 12;
    else
      for (let r = 0; r < i.length && !(o & 8); r++) {
        let a = this.visibleRanges[r], l = i[r];
        (a.from != l.from || a.to != l.to) && (o |= 4, e && e.mapPos(a.from, -1) == l.from && e.mapPos(a.to, 1) == l.to || (o |= 8));
      }
    return this.visibleRanges = i, o;
  }
  lineBlockAt(e) {
    return e >= this.viewport.from && e <= this.viewport.to && this.viewportLines.find((n) => n.from <= e && n.to >= e) || Uh(this.heightMap.lineAt(e, bi.ByPos, this.heightOracle, 0, 0), this.scaler);
  }
  lineBlockAtHeight(e) {
    return e >= this.viewportLines[0].top && e <= this.viewportLines[this.viewportLines.length - 1].bottom && this.viewportLines.find((n) => n.top <= e && n.bottom >= e) || Uh(this.heightMap.lineAt(this.scaler.fromDOM(e), bi.ByHeight, this.heightOracle, 0, 0), this.scaler);
  }
  getScrollOffset() {
    return (this.scrollParent == this.view.scrollDOM ? this.scrollParent.scrollTop : (this.scrollParent ? this.scrollParent.getBoundingClientRect().top : 0) - this.view.contentDOM.getBoundingClientRect().top) * this.scaleY;
  }
  scrollAnchorAt(e) {
    let n = this.lineBlockAtHeight(e + 8);
    return n.from >= this.viewport.from || this.viewportLines[0].top - e > 200 ? n : this.viewportLines[0];
  }
  elementAtHeight(e) {
    return Uh(this.heightMap.blockAt(this.scaler.fromDOM(e), this.heightOracle, 0, 0), this.scaler);
  }
  get docHeight() {
    return this.scaler.toDOM(this.heightMap.height);
  }
  get contentHeight() {
    return this.docHeight + this.paddingTop + this.paddingBottom;
  }
}
class Nm {
  constructor(e, n) {
    this.from = e, this.to = n;
  }
}
function uxe(t, e, n) {
  let i = [], o = t, r = 0;
  return ri.spans(n, t, e, {
    span() {
    },
    point(a, l) {
      a > o && (i.push({ from: o, to: a }), r += a - o), o = l;
    }
  }, 20), o < e && (i.push({ from: o, to: e }), r += e - o), { total: r, ranges: i };
}
function Lm({ total: t, ranges: e }, n) {
  if (n <= 0)
    return e[0].from;
  if (n >= 1)
    return e[e.length - 1].to;
  let i = Math.floor(t * n);
  for (let o = 0; ; o++) {
    let { from: r, to: a } = e[o], l = a - r;
    if (i <= l)
      return r + i;
    i -= l;
  }
}
function zm(t, e) {
  let n = 0;
  for (let { from: i, to: o } of t.ranges) {
    if (e <= o) {
      n += e - i;
      break;
    }
    n += o - i;
  }
  return n / t.total;
}
function cxe(t, e) {
  for (let n of t)
    if (e(n))
      return n;
}
const xM = {
  toDOM(t) {
    return t;
  },
  fromDOM(t) {
    return t;
  },
  scale: 1,
  eq(t) {
    return t == this;
  }
};
function OM(t) {
  let e = t.facet(Wy).filter((i) => typeof i != "function"), n = t.facet(dk).filter((i) => typeof i != "function");
  return n.length && e.push(ri.join(n)), e;
}
class gk {
  constructor(e, n, i) {
    let o = 0, r = 0, a = 0;
    this.viewports = i.map(({ from: l, to: s }) => {
      let u = n.lineAt(l, bi.ByPos, e, 0, 0).top, c = n.lineAt(s, bi.ByPos, e, 0, 0).bottom;
      return o += c - u, { from: l, to: s, top: u, bottom: c, domTop: 0, domBottom: 0 };
    }), this.scale = (7e6 - o) / (n.height - o);
    for (let l of this.viewports)
      l.domTop = a + (l.top - r) * this.scale, a = l.domBottom = l.domTop + (l.bottom - l.top), r = l.bottom;
  }
  toDOM(e) {
    for (let n = 0, i = 0, o = 0; ; n++) {
      let r = n < this.viewports.length ? this.viewports[n] : null;
      if (!r || e < r.top)
        return o + (e - i) * this.scale;
      if (e <= r.bottom)
        return r.domTop + (e - r.top);
      i = r.bottom, o = r.domBottom;
    }
  }
  fromDOM(e) {
    for (let n = 0, i = 0, o = 0; ; n++) {
      let r = n < this.viewports.length ? this.viewports[n] : null;
      if (!r || e < r.domTop)
        return i + (e - o) / this.scale;
      if (e <= r.domBottom)
        return r.top + (e - r.domTop);
      i = r.bottom, o = r.domBottom;
    }
  }
  eq(e) {
    return e instanceof gk ? this.scale == e.scale && this.viewports.length == e.viewports.length && this.viewports.every((n, i) => n.from == e.viewports[i].from && n.to == e.viewports[i].to) : !1;
  }
}
function Uh(t, e) {
  if (e.scale == 1)
    return t;
  let n = e.toDOM(t.top), i = e.toDOM(t.bottom);
  return new Ra(t.from, t.length, n, i - n, Array.isArray(t._content) ? t._content.map((o) => Uh(o, e)) : t._content);
}
const Bm = /* @__PURE__ */ an.define({ combine: (t) => t.join(" ") }), qS = /* @__PURE__ */ an.define({ combine: (t) => t.indexOf(!0) > -1 }), YS = /* @__PURE__ */ Du.newName(), E6 = /* @__PURE__ */ Du.newName(), _6 = /* @__PURE__ */ Du.newName(), I6 = { "&light": "." + E6, "&dark": "." + _6 };
function KS(t, e, n) {
  return new Du(e, {
    finish(i) {
      return /&/.test(i) ? i.replace(/&\w*/, (o) => {
        if (o == "&")
          return t;
        if (!n || !n[o])
          throw new RangeError(`Unsupported selector: ${o}`);
        return n[o];
      }) : t + " " + i;
    }
  });
}
const dxe = /* @__PURE__ */ KS("." + YS, {
  "&": {
    position: "relative !important",
    boxSizing: "border-box",
    "&.cm-focused": {
      // Provide a simple default outline to make sure a focused
      // editor is visually distinct. Can't leave the default behavior
      // because that will apply to the content element, which is
      // inside the scrollable container and doesn't include the
      // gutters. We also can't use an 'auto' outline, since those
      // are, for some reason, drawn behind the element content, which
      // will cause things like the active line background to cover
      // the outline (#297).
      outline: "1px dotted #212121"
    },
    display: "flex !important",
    flexDirection: "column"
  },
  ".cm-scroller": {
    display: "flex !important",
    alignItems: "flex-start !important",
    fontFamily: "monospace",
    lineHeight: 1.4,
    height: "100%",
    overflowX: "auto",
    position: "relative",
    zIndex: 0,
    overflowAnchor: "none"
  },
  ".cm-content": {
    margin: 0,
    flexGrow: 2,
    flexShrink: 0,
    display: "block",
    whiteSpace: "pre",
    wordWrap: "normal",
    // Issue #456
    boxSizing: "border-box",
    minHeight: "100%",
    padding: "4px 0",
    outline: "none",
    "&[contenteditable=true]": {
      WebkitUserModify: "read-write-plaintext-only"
    }
  },
  ".cm-lineWrapping": {
    whiteSpace_fallback: "pre-wrap",
    // For IE
    whiteSpace: "break-spaces",
    wordBreak: "break-word",
    // For Safari, which doesn't support overflow-wrap: anywhere
    overflowWrap: "anywhere",
    flexShrink: 1
  },
  "&light .cm-content": { caretColor: "black" },
  "&dark .cm-content": { caretColor: "white" },
  ".cm-line": {
    display: "block",
    padding: "0 2px 0 6px"
  },
  ".cm-layer": {
    userSelect: "none",
    // #1708
    position: "absolute",
    left: 0,
    top: 0,
    contain: "size style",
    "& > *": {
      position: "absolute"
    }
  },
  "&light .cm-selectionBackground": {
    background: "#d9d9d9"
  },
  "&dark .cm-selectionBackground": {
    background: "#222"
  },
  "&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground": {
    background: "#d7d4f0"
  },
  "&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground": {
    background: "#233"
  },
  ".cm-cursorLayer": {
    pointerEvents: "none"
  },
  "&.cm-focused > .cm-scroller > .cm-cursorLayer": {
    animation: "steps(1) cm-blink 1.2s infinite"
  },
  // Two animations defined so that we can switch between them to
  // restart the animation without forcing another style
  // recomputation.
  "@keyframes cm-blink": { "0%": {}, "50%": { opacity: 0 }, "100%": {} },
  "@keyframes cm-blink2": { "0%": {}, "50%": { opacity: 0 }, "100%": {} },
  ".cm-cursor, .cm-dropCursor": {
    borderLeft: "1.2px solid black",
    marginLeft: "-0.6px",
    pointerEvents: "none"
  },
  ".cm-cursor": {
    display: "none"
  },
  "&dark .cm-cursor": {
    borderLeftColor: "#ddd"
  },
  ".cm-selectionHandle": {
    backgroundColor: "currentColor",
    width: "1.5px"
  },
  ".cm-selectionHandle-start::before, .cm-selectionHandle-end::before": {
    content: '""',
    backgroundColor: "inherit",
    borderRadius: "50%",
    width: "8px",
    height: "8px",
    position: "absolute",
    left: "-3.25px"
  },
  ".cm-selectionHandle-start::before": { top: "-8px" },
  ".cm-selectionHandle-end::before": { bottom: "-8px" },
  ".cm-dropCursor": {
    position: "absolute"
  },
  "&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor": {
    display: "block"
  },
  ".cm-iso": {
    unicodeBidi: "isolate"
  },
  ".cm-announced": {
    position: "fixed",
    top: "-10000px"
  },
  "@media print": {
    ".cm-announced": { display: "none" }
  },
  "&light .cm-activeLine": { backgroundColor: "#cceeff44" },
  "&dark .cm-activeLine": { backgroundColor: "#99eeff33" },
  "&light .cm-specialChar": { color: "red" },
  "&dark .cm-specialChar": { color: "#f78" },
  ".cm-gutters": {
    flexShrink: 0,
    display: "flex",
    height: "100%",
    boxSizing: "border-box",
    zIndex: 200
  },
  ".cm-gutters-before": { insetInlineStart: 0 },
  ".cm-gutters-after": { insetInlineEnd: 0 },
  "&light .cm-gutters": {
    backgroundColor: "#f5f5f5",
    color: "#6c6c6c",
    border: "0px solid #ddd",
    "&.cm-gutters-before": { borderRightWidth: "1px" },
    "&.cm-gutters-after": { borderLeftWidth: "1px" }
  },
  "&dark .cm-gutters": {
    backgroundColor: "#333338",
    color: "#ccc"
  },
  ".cm-gutter": {
    display: "flex !important",
    // Necessary -- prevents margin collapsing
    flexDirection: "column",
    flexShrink: 0,
    boxSizing: "border-box",
    minHeight: "100%",
    overflow: "hidden"
  },
  ".cm-gutterElement": {
    boxSizing: "border-box"
  },
  ".cm-lineNumbers .cm-gutterElement": {
    padding: "0 3px 0 5px",
    minWidth: "20px",
    textAlign: "right",
    whiteSpace: "nowrap"
  },
  "&light .cm-activeLineGutter": {
    backgroundColor: "#e2f2ff"
  },
  "&dark .cm-activeLineGutter": {
    backgroundColor: "#222227"
  },
  ".cm-panels": {
    boxSizing: "border-box",
    position: "sticky",
    left: 0,
    right: 0,
    zIndex: 300
  },
  "&light .cm-panels": {
    backgroundColor: "#f5f5f5",
    color: "black"
  },
  "&light .cm-panels-top": {
    borderBottom: "1px solid #ddd"
  },
  "&light .cm-panels-bottom": {
    borderTop: "1px solid #ddd"
  },
  "&dark .cm-panels": {
    backgroundColor: "#333338",
    color: "white"
  },
  ".cm-dialog": {
    padding: "2px 19px 4px 6px",
    position: "relative",
    "& label": { fontSize: "80%" }
  },
  ".cm-dialog-close": {
    position: "absolute",
    top: "3px",
    right: "4px",
    backgroundColor: "inherit",
    border: "none",
    font: "inherit",
    fontSize: "14px",
    padding: "0"
  },
  ".cm-tab": {
    display: "inline-block",
    overflow: "hidden",
    verticalAlign: "bottom"
  },
  ".cm-widgetBuffer": {
    verticalAlign: "text-top",
    height: "1em",
    width: 0,
    display: "inline"
  },
  ".cm-placeholder": {
    color: "#888",
    display: "inline-block",
    verticalAlign: "top",
    userSelect: "none"
  },
  ".cm-highlightSpace": {
    backgroundImage: "radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",
    backgroundPosition: "center"
  },
  ".cm-highlightTab": {
    backgroundImage: `url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,
    backgroundSize: "auto 100%",
    backgroundPosition: "right 90%",
    backgroundRepeat: "no-repeat"
  },
  ".cm-trailingSpace": {
    backgroundColor: "#ff332255"
  },
  ".cm-button": {
    verticalAlign: "middle",
    color: "inherit",
    fontSize: "70%",
    padding: ".2em 1em",
    borderRadius: "1px"
  },
  "&light .cm-button": {
    backgroundImage: "linear-gradient(#eff1f5, #d9d9df)",
    border: "1px solid #888",
    "&:active": {
      backgroundImage: "linear-gradient(#b4b4b4, #d0d3d6)"
    }
  },
  "&dark .cm-button": {
    backgroundImage: "linear-gradient(#393939, #111)",
    border: "1px solid #888",
    "&:active": {
      backgroundImage: "linear-gradient(#111, #333)"
    }
  },
  ".cm-textfield": {
    verticalAlign: "middle",
    color: "inherit",
    fontSize: "70%",
    border: "1px solid silver",
    padding: ".2em .5em"
  },
  "&light .cm-textfield": {
    backgroundColor: "white"
  },
  "&dark .cm-textfield": {
    border: "1px solid #555",
    backgroundColor: "inherit"
  }
}, I6), fxe = {
  childList: !0,
  characterData: !0,
  subtree: !0,
  attributes: !0,
  characterDataOldValue: !0
}, tx = kt.ie && kt.ie_version <= 11;
class hxe {
  constructor(e) {
    this.view = e, this.active = !1, this.editContext = null, this.selectionRange = new Fbe(), this.selectionChanged = !1, this.delayedFlush = -1, this.resizeTimeout = -1, this.queue = [], this.delayedAndroidKey = null, this.flushingAndroidKey = -1, this.lastChange = 0, this.scrollTargets = [], this.intersection = null, this.resizeScroll = null, this.intersecting = !1, this.gapIntersection = null, this.gaps = [], this.printQuery = null, this.parentCheck = -1, this.dom = e.contentDOM, this.observer = new MutationObserver((n) => {
      for (let i of n)
        this.queue.push(i);
      (kt.ie && kt.ie_version <= 11 || kt.ios && e.composing) && n.some((i) => i.type == "childList" && i.removedNodes.length || i.type == "characterData" && i.oldValue.length > i.target.nodeValue.length) ? this.flushSoon() : this.flush();
    }), window.EditContext && kt.android && e.constructor.EDIT_CONTEXT !== !1 && // Chrome <126 doesn't support inverted selections in edit context (#1392)
    !(kt.chrome && kt.chrome_version < 126) && (this.editContext = new gxe(e), e.state.facet(ss) && (e.contentDOM.editContext = this.editContext.editContext)), tx && (this.onCharData = (n) => {
      this.queue.push({
        target: n.target,
        type: "characterData",
        oldValue: n.prevValue
      }), this.flushSoon();
    }), this.onSelectionChange = this.onSelectionChange.bind(this), this.onResize = this.onResize.bind(this), this.onPrint = this.onPrint.bind(this), this.onScroll = this.onScroll.bind(this), window.matchMedia && (this.printQuery = window.matchMedia("print")), typeof ResizeObserver == "function" && (this.resizeScroll = new ResizeObserver(() => {
      var n;
      ((n = this.view.docView) === null || n === void 0 ? void 0 : n.lastUpdate) < Date.now() - 75 && this.onResize();
    }), this.resizeScroll.observe(e.scrollDOM)), this.addWindowListeners(this.win = e.win), this.start(), typeof IntersectionObserver == "function" && (this.intersection = new IntersectionObserver((n) => {
      this.parentCheck < 0 && (this.parentCheck = setTimeout(this.listenForScroll.bind(this), 1e3)), n.length > 0 && n[n.length - 1].intersectionRatio > 0 != this.intersecting && (this.intersecting = !this.intersecting, this.intersecting != this.view.inView && this.onScrollChanged(document.createEvent("Event")));
    }, { threshold: [0, 1e-3] }), this.intersection.observe(this.dom), this.gapIntersection = new IntersectionObserver((n) => {
      n.length > 0 && n[n.length - 1].intersectionRatio > 0 && this.onScrollChanged(document.createEvent("Event"));
    }, {})), this.listenForScroll(), this.readSelectionRange();
  }
  onScrollChanged(e) {
    this.view.inputState.runHandlers("scroll", e), this.intersecting && this.view.measure();
  }
  onScroll(e) {
    this.intersecting && this.flush(!1), this.editContext && this.view.requestMeasure(this.editContext.measureReq), this.onScrollChanged(e);
  }
  onResize() {
    this.resizeTimeout < 0 && (this.resizeTimeout = setTimeout(() => {
      this.resizeTimeout = -1, this.view.requestMeasure();
    }, 50));
  }
  onPrint(e) {
    (e.type == "change" || !e.type) && !e.matches || (this.view.viewState.printing = !0, this.view.measure(), setTimeout(() => {
      this.view.viewState.printing = !1, this.view.requestMeasure();
    }, 500));
  }
  updateGaps(e) {
    if (this.gapIntersection && (e.length != this.gaps.length || this.gaps.some((n, i) => n != e[i]))) {
      this.gapIntersection.disconnect();
      for (let n of e)
        this.gapIntersection.observe(n);
      this.gaps = e;
    }
  }
  onSelectionChange(e) {
    let n = this.selectionChanged;
    if (!this.readSelectionRange() || this.delayedAndroidKey)
      return;
    let { view: i } = this, o = this.selectionRange;
    if (i.state.facet(ss) ? i.root.activeElement != this.dom : !bp(this.dom, o))
      return;
    let r = o.anchorNode && i.docView.tile.nearest(o.anchorNode);
    if (r && r.isWidget() && r.widget.ignoreEvent(e)) {
      n || (this.selectionChanged = !1);
      return;
    }
    (kt.ie && kt.ie_version <= 11 || kt.android && kt.chrome) && !i.state.selection.main.empty && // (Selection.isCollapsed isn't reliable on IE)
    o.focusNode && Op(o.focusNode, o.focusOffset, o.anchorNode, o.anchorOffset) ? this.flushSoon() : this.flush(!1);
  }
  readSelectionRange() {
    let { view: e } = this, n = Zp(e.root);
    if (!n)
      return !1;
    let i = kt.safari && e.root.nodeType == 11 && e.root.activeElement == this.dom && pxe(this.view, n) || n;
    if (!i || this.selectionRange.eq(i))
      return !1;
    let o = bp(this.dom, i);
    return o && !this.selectionChanged && e.inputState.lastFocusTime > Date.now() - 200 && e.inputState.lastTouchTime < Date.now() - 300 && Qbe(this.dom, i) ? (this.view.inputState.lastFocusTime = 0, e.docView.updateSelection(), !1) : (this.selectionRange.setRange(i), o && (this.selectionChanged = !0), !0);
  }
  setSelectionRange(e, n) {
    this.selectionRange.set(e.node, e.offset, n.node, n.offset), this.selectionChanged = !1;
  }
  clearSelectionRange() {
    this.selectionRange.set(null, 0, null, 0);
  }
  listenForScroll() {
    this.parentCheck = -1;
    let e = 0, n = null;
    for (let i = this.dom; i; )
      if (i.nodeType == 1)
        !n && e < this.scrollTargets.length && this.scrollTargets[e] == i ? e++ : n || (n = this.scrollTargets.slice(0, e)), n && n.push(i), i = i.assignedSlot || i.parentNode;
      else if (i.nodeType == 11)
        i = i.host;
      else
        break;
    if (e < this.scrollTargets.length && !n && (n = this.scrollTargets.slice(0, e)), n) {
      for (let i of this.scrollTargets)
        i.removeEventListener("scroll", this.onScroll);
      for (let i of this.scrollTargets = n)
        i.addEventListener("scroll", this.onScroll);
    }
  }
  ignore(e) {
    if (!this.active)
      return e();
    try {
      return this.stop(), e();
    } finally {
      this.start(), this.clear();
    }
  }
  start() {
    this.active || (this.observer.observe(this.dom, fxe), tx && this.dom.addEventListener("DOMCharacterDataModified", this.onCharData), this.active = !0);
  }
  stop() {
    this.active && (this.active = !1, this.observer.disconnect(), tx && this.dom.removeEventListener("DOMCharacterDataModified", this.onCharData));
  }
  // Throw away any pending changes
  clear() {
    this.processRecords(), this.queue.length = 0, this.selectionChanged = !1;
  }
  // Chrome Android, especially in combination with GBoard, not only
  // doesn't reliably fire regular key events, but also often
  // surrounds the effect of enter or backspace with a bunch of
  // composition events that, when interrupted, cause text duplication
  // or other kinds of corruption. This hack makes the editor back off
  // from handling DOM changes for a moment when such a key is
  // detected (via beforeinput or keydown), and then tries to flush
  // them or, if that has no effect, dispatches the given key.
  delayAndroidKey(e, n) {
    var i;
    if (!this.delayedAndroidKey) {
      let o = () => {
        let r = this.delayedAndroidKey;
        r && (this.clearDelayedAndroidKey(), this.view.inputState.lastKeyCode = r.keyCode, this.view.inputState.lastKeyTime = Date.now(), !this.flush() && r.force && yf(this.dom, r.key, r.keyCode));
      };
      this.flushingAndroidKey = this.view.win.requestAnimationFrame(o);
    }
    (!this.delayedAndroidKey || e == "Enter") && (this.delayedAndroidKey = {
      key: e,
      keyCode: n,
      // Only run the key handler when no changes are detected if
      // this isn't coming right after another change, in which case
      // it is probably part of a weird chain of updates, and should
      // be ignored if it returns the DOM to its previous state.
      force: this.lastChange < Date.now() - 50 || !!(!((i = this.delayedAndroidKey) === null || i === void 0) && i.force)
    });
  }
  clearDelayedAndroidKey() {
    this.win.cancelAnimationFrame(this.flushingAndroidKey), this.delayedAndroidKey = null, this.flushingAndroidKey = -1;
  }
  flushSoon() {
    this.delayedFlush < 0 && (this.delayedFlush = this.view.win.requestAnimationFrame(() => {
      this.delayedFlush = -1, this.flush();
    }));
  }
  forceFlush() {
    this.delayedFlush >= 0 && (this.view.win.cancelAnimationFrame(this.delayedFlush), this.delayedFlush = -1), this.flush();
  }
  pendingRecords() {
    for (let e of this.observer.takeRecords())
      this.queue.push(e);
    return this.queue;
  }
  processRecords() {
    let e = this.pendingRecords();
    e.length && (this.queue = []);
    let n = -1, i = -1, o = !1;
    for (let r of e) {
      let a = this.readMutation(r);
      a && (a.typeOver && (o = !0), n == -1 ? { from: n, to: i } = a : (n = Math.min(a.from, n), i = Math.max(a.to, i)));
    }
    return { from: n, to: i, typeOver: o };
  }
  readChange() {
    let { from: e, to: n, typeOver: i } = this.processRecords(), o = this.selectionChanged && bp(this.dom, this.selectionRange);
    if (e < 0 && !o)
      return null;
    e > -1 && (this.lastChange = Date.now()), this.view.inputState.lastFocusTime = 0, this.selectionChanged = !1;
    let r = new I1e(this.view, e, n, i);
    return this.view.docView.domChanged = { newSel: r.newSel ? r.newSel.main : null }, r;
  }
  // Apply pending changes, if any
  flush(e = !0) {
    if (this.delayedFlush >= 0 || this.delayedAndroidKey)
      return !1;
    e && this.readSelectionRange();
    let n = this.readChange();
    if (!n)
      return this.view.requestMeasure(), !1;
    let i = this.view.state, o = y6(this.view, n);
    return this.view.state == i && (n.domChanged || n.newSel && !b0(this.view.state.selection, n.newSel.main)) && this.view.update([]), o;
  }
  readMutation(e) {
    let n = this.view.docView.tile.nearest(e.target);
    if (!n || n.isWidget())
      return null;
    if (n.markDirty(e.type == "attributes"), e.type == "childList") {
      let i = SM(n, e.previousSibling || e.target.previousSibling, -1), o = SM(n, e.nextSibling || e.target.nextSibling, 1);
      return {
        from: i ? n.posAfter(i) : n.posAtStart,
        to: o ? n.posBefore(o) : n.posAtEnd,
        typeOver: !1
      };
    } else return e.type == "characterData" ? { from: n.posAtStart, to: n.posAtEnd, typeOver: e.target.nodeValue == e.oldValue } : null;
  }
  setWindow(e) {
    e != this.win && (this.removeWindowListeners(this.win), this.win = e, this.addWindowListeners(this.win));
  }
  addWindowListeners(e) {
    e.addEventListener("resize", this.onResize), this.printQuery ? this.printQuery.addEventListener ? this.printQuery.addEventListener("change", this.onPrint) : this.printQuery.addListener(this.onPrint) : e.addEventListener("beforeprint", this.onPrint), e.addEventListener("scroll", this.onScroll), e.document.addEventListener("selectionchange", this.onSelectionChange);
  }
  removeWindowListeners(e) {
    e.removeEventListener("scroll", this.onScroll), e.removeEventListener("resize", this.onResize), this.printQuery ? this.printQuery.removeEventListener ? this.printQuery.removeEventListener("change", this.onPrint) : this.printQuery.removeListener(this.onPrint) : e.removeEventListener("beforeprint", this.onPrint), e.document.removeEventListener("selectionchange", this.onSelectionChange);
  }
  update(e) {
    this.editContext && (this.editContext.update(e), e.startState.facet(ss) != e.state.facet(ss) && (e.view.contentDOM.editContext = e.state.facet(ss) ? this.editContext.editContext : null));
  }
  destroy() {
    var e, n, i;
    this.stop(), (e = this.intersection) === null || e === void 0 || e.disconnect(), (n = this.gapIntersection) === null || n === void 0 || n.disconnect(), (i = this.resizeScroll) === null || i === void 0 || i.disconnect();
    for (let o of this.scrollTargets)
      o.removeEventListener("scroll", this.onScroll);
    this.removeWindowListeners(this.win), clearTimeout(this.parentCheck), clearTimeout(this.resizeTimeout), this.win.cancelAnimationFrame(this.delayedFlush), this.win.cancelAnimationFrame(this.flushingAndroidKey), this.editContext && (this.view.contentDOM.editContext = null, this.editContext.destroy());
  }
}
function SM(t, e, n) {
  for (; e; ) {
    let i = ji.get(e);
    if (i && i.parent == t)
      return i;
    let o = e.parentNode;
    e = o != t.dom ? o : n > 0 ? e.nextSibling : e.previousSibling;
  }
  return null;
}
function wM(t, e) {
  let n = e.startContainer, i = e.startOffset, o = e.endContainer, r = e.endOffset, a = t.docView.domAtPos(t.state.selection.main.anchor, 1);
  return Op(a.node, a.offset, o, r) && ([n, i, o, r] = [o, r, n, i]), { anchorNode: n, anchorOffset: i, focusNode: o, focusOffset: r };
}
function pxe(t, e) {
  if (e.getComposedRanges) {
    let o = e.getComposedRanges(t.root)[0];
    if (o)
      return wM(t, o);
  }
  let n = null;
  function i(o) {
    o.preventDefault(), o.stopImmediatePropagation(), n = o.getTargetRanges()[0];
  }
  return t.contentDOM.addEventListener("beforeinput", i, !0), t.dom.ownerDocument.execCommand("indent"), t.contentDOM.removeEventListener("beforeinput", i, !0), n ? wM(t, n) : null;
}
class gxe {
  constructor(e) {
    this.from = 0, this.to = 0, this.pendingContextChange = null, this.handlers = /* @__PURE__ */ Object.create(null), this.composing = null, this.resetRange(e.state);
    let n = this.editContext = new window.EditContext({
      text: e.state.doc.sliceString(this.from, this.to),
      selectionStart: this.toContextPos(Math.max(this.from, Math.min(this.to, e.state.selection.main.anchor))),
      selectionEnd: this.toContextPos(e.state.selection.main.head)
    });
    this.handlers.textupdate = (i) => {
      let o = e.state.selection.main, { anchor: r, head: a } = o, l = this.toEditorPos(i.updateRangeStart), s = this.toEditorPos(i.updateRangeEnd);
      e.inputState.composing >= 0 && !this.composing && (this.composing = { contextBase: i.updateRangeStart, editorBase: l, drifted: !1 });
      let u = s - l > i.text.length;
      l == this.from && r < this.from ? l = r : s == this.to && r > this.to && (s = r);
      let c = b6(e.state.sliceDoc(l, s), i.text, (u ? o.from : o.to) - l, u ? "end" : null);
      if (!c) {
        let f = Pt.single(this.toEditorPos(i.selectionStart), this.toEditorPos(i.selectionEnd));
        b0(f, o) || e.dispatch({ selection: f, userEvent: "select" });
        return;
      }
      let d = {
        from: c.from + l,
        to: c.toA + l,
        insert: Wn.of(i.text.slice(c.from, c.toB).split(`
`))
      };
      if ((kt.mac || kt.android) && d.from == a - 1 && /^\. ?$/.test(i.text) && e.contentDOM.getAttribute("autocorrect") == "off" && (d = { from: l, to: s, insert: Wn.of([i.text.replace(".", " ")]) }), this.pendingContextChange = d, !e.state.readOnly) {
        let f = this.to - this.from + (d.to - d.from + d.insert.length);
        hk(e, d, Pt.single(this.toEditorPos(i.selectionStart, f), this.toEditorPos(i.selectionEnd, f)));
      }
      this.pendingContextChange && (this.revertPending(e.state), this.setSelection(e.state)), d.from < d.to && !d.insert.length && e.inputState.composing >= 0 && !/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0, i.updateRangeStart - 1), Math.min(n.text.length, i.updateRangeStart + 1))) && this.handlers.compositionend(i);
    }, this.handlers.characterboundsupdate = (i) => {
      let o = [], r = null;
      for (let a = this.toEditorPos(i.rangeStart), l = this.toEditorPos(i.rangeEnd); a < l; a++) {
        let s = e.coordsForChar(a);
        r = s && new DOMRect(s.left, s.top, s.right - s.left, s.bottom - s.top) || r || new DOMRect(), o.push(r);
      }
      n.updateCharacterBounds(i.rangeStart, o);
    }, this.handlers.textformatupdate = (i) => {
      let o = [];
      for (let r of i.getTextFormats()) {
        let a = r.underlineStyle, l = r.underlineThickness;
        if (!/none/i.test(a) && !/none/i.test(l)) {
          let s = this.toEditorPos(r.rangeStart), u = this.toEditorPos(r.rangeEnd);
          if (s < u) {
            let c = `text-decoration: underline ${/^[a-z]/.test(a) ? a + " " : a == "Dashed" ? "dashed " : a == "Squiggle" ? "wavy " : ""}${/thin/i.test(l) ? 1 : 2}px`;
            o.push(ai.mark({ attributes: { style: c } }).range(s, u));
          }
        }
      }
      e.dispatch({ effects: u6.of(ai.set(o)) });
    }, this.handlers.compositionstart = () => {
      e.inputState.composing < 0 && (e.inputState.composing = 0, e.inputState.compositionFirstChange = !0);
    }, this.handlers.compositionend = () => {
      if (e.inputState.composing = -1, e.inputState.compositionFirstChange = null, this.composing) {
        let { drifted: i } = this.composing;
        this.composing = null, i && this.reset(e.state);
      }
    };
    for (let i in this.handlers)
      n.addEventListener(i, this.handlers[i]);
    this.measureReq = { read: (i) => {
      let o = Zp(i.root);
      o && o.rangeCount && this.editContext.updateSelectionBounds(o.getRangeAt(0).getBoundingClientRect());
    } };
  }
  applyEdits(e) {
    let n = 0, i = !1, o = this.pendingContextChange;
    return e.changes.iterChanges((r, a, l, s, u) => {
      if (i)
        return;
      let c = u.length - (a - r);
      if (o && a >= o.to)
        if (o.from == r && o.to == a && o.insert.eq(u)) {
          o = this.pendingContextChange = null, n += c, this.to += c;
          return;
        } else
          o = null, this.revertPending(e.state);
      if (r += n, a += n, a <= this.from)
        this.from += c, this.to += c;
      else if (r < this.to) {
        if (r < this.from || a > this.to || this.to - this.from + u.length > 3e4) {
          i = !0;
          return;
        }
        this.editContext.updateText(this.toContextPos(r), this.toContextPos(a), u.toString()), this.to += c;
      }
      n += c;
    }), o && !i && this.revertPending(e.state), !i;
  }
  update(e) {
    let n = this.pendingContextChange, i = e.startState.selection.main;
    this.composing && (this.composing.drifted || !e.changes.touchesRange(i.from, i.to) && e.transactions.some((o) => !o.isUserEvent("input.type") && o.changes.touchesRange(this.from, this.to))) ? (this.composing.drifted = !0, this.composing.editorBase = e.changes.mapPos(this.composing.editorBase)) : !this.applyEdits(e) || !this.rangeIsValid(e.state) ? (this.pendingContextChange = null, this.reset(e.state)) : (e.docChanged || e.selectionSet || n) && this.setSelection(e.state), (e.geometryChanged || e.docChanged || e.selectionSet) && e.view.requestMeasure(this.measureReq);
  }
  resetRange(e) {
    let { head: n } = e.selection.main;
    this.from = Math.max(
      0,
      n - 1e4
      /* CxVp.Margin */
    ), this.to = Math.min(
      e.doc.length,
      n + 1e4
      /* CxVp.Margin */
    );
  }
  reset(e) {
    this.resetRange(e), this.editContext.updateText(0, this.editContext.text.length, e.doc.sliceString(this.from, this.to)), this.setSelection(e);
  }
  revertPending(e) {
    let n = this.pendingContextChange;
    this.pendingContextChange = null, this.editContext.updateText(this.toContextPos(n.from), this.toContextPos(n.from + n.insert.length), e.doc.sliceString(n.from, n.to));
  }
  setSelection(e) {
    let { main: n } = e.selection, i = this.toContextPos(Math.max(this.from, Math.min(this.to, n.anchor))), o = this.toContextPos(n.head);
    (this.editContext.selectionStart != i || this.editContext.selectionEnd != o) && this.editContext.updateSelection(i, o);
  }
  rangeIsValid(e) {
    let { head: n } = e.selection.main;
    return !(this.from > 0 && n - this.from < 500 || this.to < e.doc.length && this.to - n < 500 || this.to - this.from > 1e4 * 3);
  }
  toEditorPos(e, n = this.to - this.from) {
    e = Math.min(e, n);
    let i = this.composing;
    return i && i.drifted ? i.editorBase + (e - i.contextBase) : e + this.from;
  }
  toContextPos(e) {
    let n = this.composing;
    return n && n.drifted ? n.contextBase + (e - n.editorBase) : e - this.from;
  }
  destroy() {
    for (let e in this.handlers)
      this.editContext.removeEventListener(e, this.handlers[e]);
  }
}
class Kt {
  /**
  The current editor state.
  */
  get state() {
    return this.viewState.state;
  }
  /**
  To be able to display large documents without consuming too much
  memory or overloading the browser, CodeMirror only draws the
  code that is visible (plus a margin around it) to the DOM. This
  property tells you the extent of the current drawn viewport, in
  document positions.
  */
  get viewport() {
    return this.viewState.viewport;
  }
  /**
  When there are, for example, large collapsed ranges in the
  viewport, its size can be a lot bigger than the actual visible
  content. Thus, if you are doing something like styling the
  content in the viewport, it is preferable to only do so for
  these ranges, which are the subset of the viewport that is
  actually drawn.
  */
  get visibleRanges() {
    return this.viewState.visibleRanges;
  }
  /**
  Returns false when the editor is entirely scrolled out of view
  or otherwise hidden.
  */
  get inView() {
    return this.viewState.inView;
  }
  /**
  Indicates whether the user is currently composing text via
  [IME](https://en.wikipedia.org/wiki/Input_method), and at least
  one change has been made in the current composition.
  */
  get composing() {
    return !!this.inputState && this.inputState.composing > 0;
  }
  /**
  Indicates whether the user is currently in composing state. Note
  that on some platforms, like Android, this will be the case a
  lot, since just putting the cursor on a word starts a
  composition there.
  */
  get compositionStarted() {
    return !!this.inputState && this.inputState.composing >= 0;
  }
  /**
  The document or shadow root that the view lives in.
  */
  get root() {
    return this._root;
  }
  /**
  @internal
  */
  get win() {
    return this.dom.ownerDocument.defaultView || window;
  }
  /**
  Construct a new view. You'll want to either provide a `parent`
  option, or put `view.dom` into your document after creating a
  view, so that the user can see the editor.
  */
  constructor(e = {}) {
    var n;
    this.plugins = [], this.pluginMap = /* @__PURE__ */ new Map(), this.editorAttrs = {}, this.contentAttrs = {}, this.bidiCache = [], this.destroyed = !1, this.updateState = 2, this.measureScheduled = -1, this.measureRequests = [], this.contentDOM = document.createElement("div"), this.scrollDOM = document.createElement("div"), this.scrollDOM.tabIndex = -1, this.scrollDOM.className = "cm-scroller", this.scrollDOM.appendChild(this.contentDOM), this.announceDOM = document.createElement("div"), this.announceDOM.className = "cm-announced", this.announceDOM.setAttribute("aria-live", "polite"), this.dom = document.createElement("div"), this.dom.appendChild(this.announceDOM), this.dom.appendChild(this.scrollDOM), e.parent && e.parent.appendChild(this.dom);
    let { dispatch: i } = e;
    this.dispatchTransactions = e.dispatchTransactions || i && ((o) => o.forEach((r) => i(r, this))) || ((o) => this.update(o)), this.dispatch = this.dispatch.bind(this), this._root = e.root || Vbe(e.parent) || document, this.viewState = new bM(this, e.state || ni.create(e)), e.scrollTo && e.scrollTo.is(Am) && (this.viewState.scrollTarget = e.scrollTo.value.clip(this.viewState.state)), this.plugins = this.state.facet(Gd).map((o) => new X1(o));
    for (let o of this.plugins)
      o.update(this);
    this.observer = new hxe(this), this.inputState = new D1e(this), this.inputState.ensureHandlers(this.plugins), this.docView = new aM(this), this.mountStyles(), this.updateAttrs(), this.updateState = 0, this.requestMeasure(), !((n = document.fonts) === null || n === void 0) && n.ready && document.fonts.ready.then(() => {
      this.viewState.mustMeasureContent = "refresh", this.requestMeasure();
    });
  }
  dispatch(...e) {
    let n = e.length == 1 && e[0] instanceof Ao ? e : e.length == 1 && Array.isArray(e[0]) ? e[0] : [this.state.update(...e)];
    this.dispatchTransactions(n, this);
  }
  /**
  Update the view for the given array of transactions. This will
  update the visible document and selection to match the state
  produced by the transactions, and notify view plugins of the
  change. You should usually call
  [`dispatch`](https://codemirror.net/6/docs/ref/#view.EditorView.dispatch) instead, which uses this
  as a primitive.
  */
  update(e) {
    if (this.updateState != 0)
      throw new Error("Calls to EditorView.update are not allowed while an update is in progress");
    let n = !1, i = !1, o, r = this.state;
    for (let f of e) {
      if (f.startState != r)
        throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");
      r = f.state;
    }
    if (this.destroyed) {
      this.viewState.state = r;
      return;
    }
    let a = this.hasFocus, l = 0, s = null;
    e.some((f) => f.annotation($6)) ? (this.inputState.notifiedFocused = a, l = 1) : a != this.inputState.notifiedFocused && (this.inputState.notifiedFocused = a, s = k6(r, a), s || (l = 1));
    let u = this.observer.delayedAndroidKey, c = null;
    if (u ? (this.observer.clearDelayedAndroidKey(), c = this.observer.readChange(), (c && !this.state.doc.eq(r.doc) || !this.state.selection.eq(r.selection)) && (c = null)) : this.observer.clear(), r.facet(ni.phrases) != this.state.facet(ni.phrases))
      return this.setState(r);
    o = m0.create(this, r, e), o.flags |= l;
    let d = this.viewState.scrollTarget;
    try {
      this.updateState = 2;
      for (let f of e) {
        if (d && (d = d.map(f.changes)), f.scrollIntoView) {
          let { main: h } = f.state.selection, { x: p, y: g } = this.state.facet(Kt.cursorScrollMargin);
          d = new bf(h.empty ? h : Pt.cursor(h.head, h.head > h.anchor ? -1 : 1), "nearest", "nearest", g, p);
        }
        for (let h of f.effects)
          h.is(Am) && (d = h.value.clip(this.state));
      }
      this.viewState.update(o, d), this.bidiCache = O0.update(this.bidiCache, o.changes), o.empty || (this.updatePlugins(o), this.inputState.update(o)), n = this.docView.update(o), this.state.facet(Gh) != this.styleModules && this.mountStyles(), i = this.updateAttrs(), this.showAnnouncements(e), this.docView.updateSelection(n, e.some((f) => f.isUserEvent("select.pointer")));
    } finally {
      this.updateState = 0;
    }
    if (o.startState.facet(Bm) != o.state.facet(Bm) && (this.viewState.mustMeasureContent = !0), (n || i || d || this.viewState.mustEnforceCursorAssoc || this.viewState.mustMeasureContent) && this.requestMeasure(), n && this.docViewUpdate(), !o.empty)
      for (let f of this.state.facet(QS))
        try {
          f(o);
        } catch (h) {
          Rr(this.state, h, "update listener");
        }
    (s || c) && Promise.resolve().then(() => {
      s && this.state == s.startState && this.dispatch(s), c && !y6(this, c) && u.force && yf(this.contentDOM, u.key, u.keyCode);
    });
  }
  /**
  Reset the view to the given state. (This will cause the entire
  document to be redrawn and all view plugins to be reinitialized,
  so you should probably only use it when the new state isn't
  derived from the old state. Otherwise, use
  [`dispatch`](https://codemirror.net/6/docs/ref/#view.EditorView.dispatch) instead.)
  */
  setState(e) {
    if (this.updateState != 0)
      throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");
    if (this.destroyed) {
      this.viewState.state = e;
      return;
    }
    this.updateState = 2;
    let n = this.hasFocus;
    try {
      for (let i of this.plugins)
        i.destroy(this);
      this.viewState = new bM(this, e), this.plugins = e.facet(Gd).map((i) => new X1(i)), this.pluginMap.clear();
      for (let i of this.plugins)
        i.update(this);
      this.docView.destroy(), this.docView = new aM(this), this.inputState.ensureHandlers(this.plugins), this.mountStyles(), this.updateAttrs(), this.bidiCache = [];
    } finally {
      this.updateState = 0;
    }
    n && this.focus(), this.requestMeasure();
  }
  updatePlugins(e) {
    let n = e.startState.facet(Gd), i = e.state.facet(Gd);
    if (n != i) {
      let o = [];
      for (let r of i) {
        let a = n.indexOf(r);
        if (a < 0)
          o.push(new X1(r));
        else {
          let l = this.plugins[a];
          l.mustUpdate = e, o.push(l);
        }
      }
      for (let r of this.plugins)
        r.mustUpdate != e && r.destroy(this);
      this.plugins = o, this.pluginMap.clear();
    } else
      for (let o of this.plugins)
        o.mustUpdate = e;
    for (let o = 0; o < this.plugins.length; o++)
      this.plugins[o].update(this);
    n != i && this.inputState.ensureHandlers(this.plugins);
  }
  docViewUpdate() {
    for (let e of this.plugins) {
      let n = e.value;
      if (n && n.docViewUpdate)
        try {
          n.docViewUpdate(this);
        } catch (i) {
          Rr(this.state, i, "doc view update listener");
        }
    }
  }
  /**
  @internal
  */
  measure(e = !0) {
    if (this.destroyed)
      return;
    if (this.measureScheduled > -1 && this.win.cancelAnimationFrame(this.measureScheduled), this.observer.delayedAndroidKey) {
      this.measureScheduled = -1, this.requestMeasure();
      return;
    }
    this.measureScheduled = 0, e && this.observer.forceFlush();
    let n = null, i = this.viewState.scrollParent, o = this.viewState.getScrollOffset(), { scrollAnchorPos: r, scrollAnchorHeight: a } = this.viewState;
    Math.abs(o - this.viewState.scrollOffset) > 1 && (a = -1), this.viewState.scrollAnchorHeight = -1;
    try {
      for (let l = 0; ; l++) {
        if (a < 0)
          if (Y4(i || this.win))
            r = -1, a = this.viewState.heightMap.height;
          else {
            let h = this.viewState.scrollAnchorAt(o);
            r = h.from, a = h.top;
          }
        this.updateState = 1;
        let s = this.viewState.measure();
        if (!s && !this.measureRequests.length && this.viewState.scrollTarget == null)
          break;
        if (l > 5) {
          console.warn(this.measureRequests.length ? "Measure loop restarted more than 5 times" : "Viewport failed to stabilize");
          break;
        }
        let u = [];
        s & 4 || ([this.measureRequests, u] = [u, this.measureRequests]);
        let c = u.map((h) => {
          try {
            return h.read(this);
          } catch (p) {
            return Rr(this.state, p), CM;
          }
        }), d = m0.create(this, this.state, []), f = !1;
        d.flags |= s, n ? n.flags |= s : n = d, this.updateState = 2, d.empty || (this.updatePlugins(d), this.inputState.update(d), this.updateAttrs(), f = this.docView.update(d), f && this.docViewUpdate());
        for (let h = 0; h < u.length; h++)
          if (c[h] != CM)
            try {
              let p = u[h];
              p.write && p.write(c[h], this);
            } catch (p) {
              Rr(this.state, p);
            }
        if (f && this.docView.updateSelection(!0), !d.viewportChanged && this.measureRequests.length == 0) {
          if (this.viewState.editorHeight)
            if (this.viewState.scrollTarget) {
              this.docView.scrollIntoView(this.viewState.scrollTarget), this.viewState.scrollTarget = null, a = -1;
              continue;
            } else {
              let p = ((r < 0 ? this.viewState.heightMap.height : this.viewState.lineBlockAt(r).top) - a) / this.scaleY;
              if ((p > 1 || p < -1) && !(kt.ios && this.inputState.lastIOSMomentumScroll > Date.now() - 100) && (i == this.scrollDOM || this.hasFocus || Math.max(this.inputState.lastWheelEvent, this.inputState.lastTouchTime) > Date.now() - 100)) {
                o = o + p, i ? i.scrollTop += p : this.win.scrollBy(0, p), a = -1;
                continue;
              }
            }
          break;
        }
      }
    } finally {
      this.updateState = 0, this.measureScheduled = -1;
    }
    if (n && !n.empty)
      for (let l of this.state.facet(QS))
        l(n);
  }
  /**
  Get the CSS classes for the currently active editor themes.
  */
  get themeClasses() {
    return YS + " " + (this.state.facet(qS) ? _6 : E6) + " " + this.state.facet(Bm);
  }
  updateAttrs() {
    let e = $M(this, c6, {
      class: "cm-editor" + (this.hasFocus ? " cm-focused " : " ") + this.themeClasses
    }), n = {
      spellcheck: "false",
      autocorrect: "off",
      autocapitalize: "off",
      writingsuggestions: "false",
      translate: "no",
      contenteditable: this.state.facet(ss) ? "true" : "false",
      class: "cm-content",
      style: `${kt.tabSize}: ${this.state.tabSize}`,
      role: "textbox",
      "aria-multiline": "true"
    };
    this.state.readOnly && (n["aria-readonly"] = "true"), $M(this, ck, n);
    let i = this.observer.ignore(() => {
      let o = eM(this.contentDOM, this.contentAttrs, n), r = eM(this.dom, this.editorAttrs, e);
      return o || r;
    });
    return this.editorAttrs = e, this.contentAttrs = n, i;
  }
  showAnnouncements(e) {
    let n = !0;
    for (let i of e)
      for (let o of i.effects)
        if (o.is(Kt.announce)) {
          n && (this.announceDOM.textContent = ""), n = !1;
          let r = this.announceDOM.appendChild(document.createElement("div"));
          r.textContent = o.value;
        }
  }
  mountStyles() {
    this.styleModules = this.state.facet(Gh);
    let e = this.state.facet(Kt.cspNonce);
    Du.mount(this.root, this.styleModules.concat(dxe).reverse(), e ? { nonce: e } : void 0);
  }
  readMeasured() {
    if (this.updateState == 2)
      throw new Error("Reading the editor layout isn't allowed during an update");
    this.updateState == 0 && this.measureScheduled > -1 && this.measure(!1);
  }
  /**
  Schedule a layout measurement, optionally providing callbacks to
  do custom DOM measuring followed by a DOM write phase. Using
  this is preferable reading DOM layout directly from, for
  example, an event handler, because it'll make sure measuring and
  drawing done by other components is synchronized, avoiding
  unnecessary DOM layout computations.
  */
  requestMeasure(e) {
    if (this.measureScheduled < 0 && (this.measureScheduled = this.win.requestAnimationFrame(() => this.measure())), e) {
      if (this.measureRequests.indexOf(e) > -1)
        return;
      if (e.key != null) {
        for (let n = 0; n < this.measureRequests.length; n++)
          if (this.measureRequests[n].key === e.key) {
            this.measureRequests[n] = e;
            return;
          }
      }
      this.measureRequests.push(e);
    }
  }
  /**
  Get the value of a specific plugin, if present. Note that
  plugins that crash can be dropped from a view, so even when you
  know you registered a given plugin, it is recommended to check
  the return value of this method.
  */
  plugin(e) {
    let n = this.pluginMap.get(e);
    return (n === void 0 || n && n.plugin != e) && this.pluginMap.set(e, n = this.plugins.find((i) => i.plugin == e) || null), n && n.update(this).value;
  }
  /**
  The top position of the document, in screen coordinates. This
  may be negative when the editor is scrolled down. Points
  directly to the top of the first line, not above the padding.
  */
  get documentTop() {
    return this.contentDOM.getBoundingClientRect().top + this.viewState.paddingTop;
  }
  /**
  Reports the padding above and below the document.
  */
  get documentPadding() {
    return { top: this.viewState.paddingTop, bottom: this.viewState.paddingBottom };
  }
  /**
  If the editor is transformed with CSS, this provides the scale
  along the X axis. Otherwise, it will just be 1. Note that
  transforms other than translation and scaling are not supported.
  */
  get scaleX() {
    return this.viewState.scaleX;
  }
  /**
  Provide the CSS transformed scale along the Y axis.
  */
  get scaleY() {
    return this.viewState.scaleY;
  }
  /**
  Find the text line or block widget at the given vertical
  position (which is interpreted as relative to the [top of the
  document](https://codemirror.net/6/docs/ref/#view.EditorView.documentTop)).
  */
  elementAtHeight(e) {
    return this.readMeasured(), this.viewState.elementAtHeight(e);
  }
  /**
  Find the line block (see
  [`lineBlockAt`](https://codemirror.net/6/docs/ref/#view.EditorView.lineBlockAt)) at the given
  height, again interpreted relative to the [top of the
  document](https://codemirror.net/6/docs/ref/#view.EditorView.documentTop).
  */
  lineBlockAtHeight(e) {
    return this.readMeasured(), this.viewState.lineBlockAtHeight(e);
  }
  /**
  Get the extent and vertical position of all [line
  blocks](https://codemirror.net/6/docs/ref/#view.EditorView.lineBlockAt) in the viewport. Positions
  are relative to the [top of the
  document](https://codemirror.net/6/docs/ref/#view.EditorView.documentTop);
  */
  get viewportLineBlocks() {
    return this.viewState.viewportLines;
  }
  /**
  Find the line block around the given document position. A line
  block is a range delimited on both sides by either a
  non-[hidden](https://codemirror.net/6/docs/ref/#view.Decoration^replace) line break, or the
  start/end of the document. It will usually just hold a line of
  text, but may be broken into multiple textblocks by block
  widgets.
  */
  lineBlockAt(e) {
    return this.viewState.lineBlockAt(e);
  }
  /**
  The editor's total content height.
  */
  get contentHeight() {
    return this.viewState.contentHeight;
  }
  /**
  Move a cursor position by [grapheme
  cluster](https://codemirror.net/6/docs/ref/#state.findClusterBreak). `forward` determines whether
  the motion is away from the line start, or towards it. In
  bidirectional text, the line is traversed in visual order, using
  the editor's [text direction](https://codemirror.net/6/docs/ref/#view.EditorView.textDirection).
  When the start position was the last one on the line, the
  returned position will be across the line break. If there is no
  further line, the original position is returned.
  
  By default, this method moves over a single cluster. The
  optional `by` argument can be used to move across more. It will
  be called with the first cluster as argument, and should return
  a predicate that determines, for each subsequent cluster,
  whether it should also be moved over.
  */
  moveByChar(e, n, i) {
    return J1(this, e, lM(this, e, n, i));
  }
  /**
  Move a cursor position across the next group of either
  [letters](https://codemirror.net/6/docs/ref/#state.EditorState.charCategorizer) or non-letter
  non-whitespace characters.
  */
  moveByGroup(e, n) {
    return J1(this, e, lM(this, e, n, (i) => $1e(this, e.head, i)));
  }
  /**
  Get the cursor position visually at the start or end of a line.
  Note that this may differ from the _logical_ position at its
  start or end (which is simply at `line.from`/`line.to`) if text
  at the start or end goes against the line's base text direction.
  */
  visualLineSide(e, n) {
    let i = this.bidiSpans(e), o = this.textDirectionAt(e.from), r = i[n ? i.length - 1 : 0];
    return Pt.cursor(r.side(n, o) + e.from, r.forward(!n, o) ? 1 : -1);
  }
  /**
  Move to the next line boundary in the given direction. If
  `includeWrap` is true, line wrapping is on, and there is a
  further wrap point on the current line, the wrap point will be
  returned. Otherwise this function will return the start or end
  of the line.
  */
  moveToLineBoundary(e, n, i = !0) {
    return C1e(this, e, n, i);
  }
  /**
  Move a cursor position vertically. When `distance` isn't given,
  it defaults to moving to the next line (including wrapped
  lines). Otherwise, `distance` should provide a positive distance
  in pixels.
  
  When `start` has a
  [`goalColumn`](https://codemirror.net/6/docs/ref/#state.SelectionRange.goalColumn), the vertical
  motion will use that as a target horizontal position. Otherwise,
  the cursor's own horizontal position is used. The returned
  cursor will have its goal column set to whichever column was
  used.
  */
  moveVertically(e, n, i) {
    return J1(this, e, k1e(this, e, n, i));
  }
  /**
  Find the DOM parent node and offset (child offset if `node` is
  an element, character offset when it is a text node) at the
  given document position.
  
  Note that for positions that aren't currently in
  `visibleRanges`, the resulting DOM position isn't necessarily
  meaningful (it may just point before or after a placeholder
  element).
  */
  domAtPos(e, n = 1) {
    return this.docView.domAtPos(e, n);
  }
  /**
  Find the document position at the given DOM node. Can be useful
  for associating positions with DOM events. Will raise an error
  when `node` isn't part of the editor content.
  */
  posAtDOM(e, n = 0) {
    return this.docView.posFromDOM(e, n);
  }
  posAtCoords(e, n = !0) {
    this.readMeasured();
    let i = WS(this, e, n);
    return i && i.pos;
  }
  posAndSideAtCoords(e, n = !0) {
    return this.readMeasured(), WS(this, e, n);
  }
  /**
  Get the screen coordinates at the given document position.
  `side` determines whether the coordinates are based on the
  element before (-1) or after (1) the position (if no element is
  available on the given side, the method will transparently use
  another strategy to get reasonable coordinates).
  */
  coordsAtPos(e, n = 1) {
    this.readMeasured();
    let i = this.state.doc.lineAt(e), o = this.bidiSpans(i), r = o[kl.find(o, e - i.from, -1, n)];
    return this.docView.coordsAt(e, n, r.dir == Gi.RTL);
  }
  /**
  Return the rectangle around a given character. If `pos` does not
  point in front of a character that is in the viewport and
  rendered (i.e. not replaced, not a line break), this will return
  null. For space characters that are a line wrap point, this will
  return the position before the line break.
  */
  coordsForChar(e) {
    return this.readMeasured(), this.docView.coordsForChar(e);
  }
  /**
  The default width of a character in the editor. May not
  accurately reflect the width of all characters (given variable
  width fonts or styling of invididual ranges).
  */
  get defaultCharacterWidth() {
    return this.viewState.heightOracle.charWidth;
  }
  /**
  The default height of a line in the editor. May not be accurate
  for all lines.
  */
  get defaultLineHeight() {
    return this.viewState.heightOracle.lineHeight;
  }
  /**
  The text direction
  ([`direction`](https://developer.mozilla.org/en-US/docs/Web/CSS/direction)
  CSS property) of the editor's content element.
  */
  get textDirection() {
    return this.viewState.defaultTextDirection;
  }
  /**
  Find the text direction of the block at the given position, as
  assigned by CSS. If
  [`perLineTextDirection`](https://codemirror.net/6/docs/ref/#view.EditorView^perLineTextDirection)
  isn't enabled, or the given position is outside of the viewport,
  this will always return the same as
  [`textDirection`](https://codemirror.net/6/docs/ref/#view.EditorView.textDirection). Note that
  this may trigger a DOM layout.
  */
  textDirectionAt(e) {
    return !this.state.facet(l6) || e < this.viewport.from || e > this.viewport.to ? this.textDirection : (this.readMeasured(), this.docView.textDirectionAt(e));
  }
  /**
  Whether this editor [wraps lines](https://codemirror.net/6/docs/ref/#view.EditorView.lineWrapping)
  (as determined by the
  [`white-space`](https://developer.mozilla.org/en-US/docs/Web/CSS/white-space)
  CSS property of its content element).
  */
  get lineWrapping() {
    return this.viewState.heightOracle.lineWrapping;
  }
  /**
  Returns the bidirectional text structure of the given line
  (which should be in the current document) as an array of span
  objects. The order of these spans matches the [text
  direction](https://codemirror.net/6/docs/ref/#view.EditorView.textDirection)—if that is
  left-to-right, the leftmost spans come first, otherwise the
  rightmost spans come first.
  */
  bidiSpans(e) {
    if (e.length > mxe)
      return J4(e.length);
    let n = this.textDirectionAt(e.from), i;
    for (let r of this.bidiCache)
      if (r.from == e.from && r.dir == n && (r.fresh || U4(r.isolates, i = iM(this, e))))
        return r.order;
    i || (i = iM(this, e));
    let o = Xbe(e.text, n, i);
    return this.bidiCache.push(new O0(e.from, e.to, n, i, !0, o)), o;
  }
  /**
  Check whether the editor has focus.
  */
  get hasFocus() {
    var e;
    return (this.dom.ownerDocument.hasFocus() || kt.safari && ((e = this.inputState) === null || e === void 0 ? void 0 : e.lastContextMenu) > Date.now() - 3e4) && this.root.activeElement == this.contentDOM;
  }
  /**
  Put focus on the editor.
  */
  focus() {
    this.observer.ignore(() => {
      q4(this.contentDOM), this.docView.updateSelection();
    });
  }
  /**
  Update the [root](https://codemirror.net/6/docs/ref/##view.EditorViewConfig.root) in which the editor lives. This is only
  necessary when moving the editor's existing DOM to a new window or shadow root.
  */
  setRoot(e) {
    this._root != e && (this._root = e, this.observer.setWindow((e.nodeType == 9 ? e : e.ownerDocument).defaultView || window), this.mountStyles());
  }
  /**
  Clean up this editor view, removing its element from the
  document, unregistering event handlers, and notifying
  plugins. The view instance can no longer be used after
  calling this.
  */
  destroy() {
    this.root.activeElement == this.contentDOM && this.contentDOM.blur();
    for (let e of this.plugins)
      e.destroy(this);
    this.plugins = [], this.inputState.destroy(), this.docView.destroy(), this.dom.remove(), this.observer.destroy(), this.measureScheduled > -1 && this.win.cancelAnimationFrame(this.measureScheduled), this.destroyed = !0;
  }
  /**
  Returns an effect that can be
  [added](https://codemirror.net/6/docs/ref/#state.TransactionSpec.effects) to a transaction to
  cause it to scroll the given position or range into view.
  */
  static scrollIntoView(e, n = {}) {
    var i, o, r, a;
    return Am.of(new bf(typeof e == "number" ? Pt.cursor(e) : e, (i = n.y) !== null && i !== void 0 ? i : "nearest", (o = n.x) !== null && o !== void 0 ? o : "nearest", (r = n.yMargin) !== null && r !== void 0 ? r : 5, (a = n.xMargin) !== null && a !== void 0 ? a : 5));
  }
  /**
  Return an effect that resets the editor to its current (at the
  time this method was called) scroll position. Note that this
  only affects the editor's own scrollable element, not parents.
  See also
  [`EditorViewConfig.scrollTo`](https://codemirror.net/6/docs/ref/#view.EditorViewConfig.scrollTo).
  
  The effect should be used with a document identical to the one
  it was created for. Failing to do so is not an error, but may
  not scroll to the expected position. You can
  [map](https://codemirror.net/6/docs/ref/#state.StateEffect.map) the effect to account for changes.
  */
  scrollSnapshot() {
    let { scrollTop: e, scrollLeft: n } = this.scrollDOM, i = this.viewState.scrollAnchorAt(e);
    return Am.of(new bf(Pt.cursor(i.from), "start", "start", i.top - e, n, !0));
  }
  /**
  Enable or disable tab-focus mode, which disables key bindings
  for Tab and Shift-Tab, letting the browser's default
  focus-changing behavior go through instead. This is useful to
  prevent trapping keyboard users in your editor.
  
  Without argument, this toggles the mode. With a boolean, it
  enables (true) or disables it (false). Given a number, it
  temporarily enables the mode until that number of milliseconds
  have passed or another non-Tab key is pressed.
  */
  setTabFocusMode(e) {
    e == null ? this.inputState.tabFocusMode = this.inputState.tabFocusMode < 0 ? 0 : -1 : typeof e == "boolean" ? this.inputState.tabFocusMode = e ? 0 : -1 : this.inputState.tabFocusMode != 0 && (this.inputState.tabFocusMode = Date.now() + e);
  }
  /**
  Returns an extension that can be used to add DOM event handlers.
  The value should be an object mapping event names to handler
  functions. For any given event, such functions are ordered by
  extension precedence, and the first handler to return true will
  be assumed to have handled that event, and no other handlers or
  built-in behavior will be activated for it. These are registered
  on the [content element](https://codemirror.net/6/docs/ref/#view.EditorView.contentDOM), except
  for `scroll` handlers, which will be called any time the
  editor's [scroll element](https://codemirror.net/6/docs/ref/#view.EditorView.scrollDOM) or one of
  its parent nodes is scrolled.
  */
  static domEventHandlers(e) {
    return ga.define(() => ({}), { eventHandlers: e });
  }
  /**
  Create an extension that registers DOM event observers. Contrary
  to event [handlers](https://codemirror.net/6/docs/ref/#view.EditorView^domEventHandlers),
  observers can't be prevented from running by a higher-precedence
  handler returning true. They also don't prevent other handlers
  and observers from running when they return true, and should not
  call `preventDefault`.
  */
  static domEventObservers(e) {
    return ga.define(() => ({}), { eventObservers: e });
  }
  /**
  Create a theme extension. The first argument can be a
  [`style-mod`](https://code.haverbeke.berlin/marijn/style-mod#documentation)
  style spec providing the styles for the theme. These will be
  prefixed with a generated class for the style.
  
  Because the selectors will be prefixed with a scope class, rule
  that directly match the editor's [wrapper
  element](https://codemirror.net/6/docs/ref/#view.EditorView.dom)—to which the scope class will be
  added—need to be explicitly differentiated by adding an `&` to
  the selector for that element—for example
  `&.cm-focused`.
  
  When `dark` is set to true, the theme will be marked as dark,
  which will cause the `&dark` rules from [base
  themes](https://codemirror.net/6/docs/ref/#view.EditorView^baseTheme) to be used (as opposed to
  `&light` when a light theme is active).
  */
  static theme(e, n) {
    let i = Du.newName(), o = [Bm.of(i), Gh.of(KS(`.${i}`, e))];
    return n && n.dark && o.push(qS.of(!0)), o;
  }
  /**
  Create an extension that adds styles to the base theme. Like
  with [`theme`](https://codemirror.net/6/docs/ref/#view.EditorView^theme), use `&` to indicate the
  place of the editor wrapper element when directly targeting
  that. You can also use `&dark` or `&light` instead to only
  target editors with a dark or light theme.
  */
  static baseTheme(e) {
    return dd.lowest(Gh.of(KS("." + YS, e, I6)));
  }
  /**
  Retrieve an editor view instance from the view's DOM
  representation.
  */
  static findFromDOM(e) {
    var n;
    let i = e.querySelector(".cm-content"), o = i && ji.get(i) || ji.get(e);
    return ((n = o?.root) === null || n === void 0 ? void 0 : n.view) || null;
  }
}
Kt.styleModule = Gh;
Kt.inputHandler = r6;
Kt.clipboardInputFilter = sk;
Kt.clipboardOutputFilter = uk;
Kt.scrollHandler = s6;
Kt.focusChangeEffect = a6;
Kt.perLineTextDirection = l6;
Kt.exceptionSink = o6;
Kt.updateListener = QS;
Kt.editable = ss;
Kt.mouseSelectionStyle = i6;
Kt.dragMovesSelection = n6;
Kt.clickAddsSelectionRange = t6;
Kt.decorations = Wy;
Kt.blockWrappers = d6;
Kt.outerDecorations = dk;
Kt.atomicRanges = Pg;
Kt.bidiIsolatedRanges = f6;
Kt.cursorScrollMargin = /* @__PURE__ */ an.define({
  combine: (t) => {
    let e = 5, n = 5;
    for (let i of t)
      typeof i == "number" ? e = n = i : { x: e, y: n } = i;
    return { x: e, y: n };
  }
});
Kt.scrollMargins = h6;
Kt.darkTheme = qS;
Kt.cspNonce = /* @__PURE__ */ an.define({ combine: (t) => t.length ? t[0] : "" });
Kt.contentAttributes = ck;
Kt.editorAttributes = c6;
Kt.lineWrapping = /* @__PURE__ */ Kt.contentAttributes.of({ class: "cm-lineWrapping" });
Kt.announce = /* @__PURE__ */ xi.define();
const mxe = 4096, CM = {};
class O0 {
  constructor(e, n, i, o, r, a) {
    this.from = e, this.to = n, this.dir = i, this.isolates = o, this.fresh = r, this.order = a;
  }
  static update(e, n) {
    if (n.empty && !e.some((r) => r.fresh))
      return e;
    let i = [], o = e.length ? e[e.length - 1].dir : Gi.LTR;
    for (let r = Math.max(0, e.length - 10); r < e.length; r++) {
      let a = e[r];
      a.dir == o && !n.touchesRange(a.from, a.to) && i.push(new O0(n.mapPos(a.from, 1), n.mapPos(a.to, -1), a.dir, a.isolates, !1, a.order));
    }
    return i;
  }
}
function $M(t, e, n) {
  for (let i = t.state.facet(e), o = i.length - 1; o >= 0; o--) {
    let r = i[o], a = typeof r == "function" ? r(t) : r;
    a && rk(a, n);
  }
  return n;
}
const vxe = kt.mac ? "mac" : kt.windows ? "win" : kt.linux ? "linux" : "key";
function yxe(t, e) {
  const n = t.split(/-(?!$)/);
  let i = n[n.length - 1];
  i == "Space" && (i = " ");
  let o, r, a, l;
  for (let s = 0; s < n.length - 1; ++s) {
    const u = n[s];
    if (/^(cmd|meta|m)$/i.test(u))
      l = !0;
    else if (/^a(lt)?$/i.test(u))
      o = !0;
    else if (/^(c|ctrl|control)$/i.test(u))
      r = !0;
    else if (/^s(hift)?$/i.test(u))
      a = !0;
    else if (/^mod$/i.test(u))
      e == "mac" ? l = !0 : r = !0;
    else
      throw new Error("Unrecognized modifier name: " + u);
  }
  return o && (i = "Alt-" + i), r && (i = "Ctrl-" + i), l && (i = "Meta-" + i), a && (i = "Shift-" + i), i;
}
function Fm(t, e, n) {
  return e.altKey && (t = "Alt-" + t), e.ctrlKey && (t = "Ctrl-" + t), e.metaKey && (t = "Meta-" + t), n !== !1 && e.shiftKey && (t = "Shift-" + t), t;
}
const bxe = /* @__PURE__ */ dd.default(/* @__PURE__ */ Kt.domEventHandlers({
  keydown(t, e) {
    return wxe(xxe(e.state), t, e, "editor");
  }
})), Eg = /* @__PURE__ */ an.define({ enables: bxe }), kM = /* @__PURE__ */ new WeakMap();
function xxe(t) {
  let e = t.facet(Eg), n = kM.get(e);
  return n || kM.set(e, n = Sxe(e.reduce((i, o) => i.concat(o), []))), n;
}
let mu = null;
const Oxe = 4e3;
function Sxe(t, e = vxe) {
  let n = /* @__PURE__ */ Object.create(null), i = /* @__PURE__ */ Object.create(null), o = (a, l) => {
    let s = i[a];
    if (s == null)
      i[a] = l;
    else if (s != l)
      throw new Error("Key binding " + a + " is used both as a regular binding and as a multi-stroke prefix");
  }, r = (a, l, s, u, c) => {
    var d, f;
    let h = n[a] || (n[a] = /* @__PURE__ */ Object.create(null)), p = l.split(/ (?!$)/).map((y) => yxe(y, e));
    for (let y = 1; y < p.length; y++) {
      let b = p.slice(0, y).join(" ");
      o(b, !0), h[b] || (h[b] = {
        preventDefault: !0,
        stopPropagation: !1,
        run: [(w) => {
          let $ = mu = { view: w, prefix: b, scope: a };
          return setTimeout(() => {
            mu == $ && (mu = null);
          }, Oxe), !0;
        }]
      });
    }
    let g = p.join(" ");
    o(g, !1);
    let m = h[g] || (h[g] = {
      preventDefault: !1,
      stopPropagation: !1,
      run: ((f = (d = h._any) === null || d === void 0 ? void 0 : d.run) === null || f === void 0 ? void 0 : f.slice()) || []
    });
    s && m.run.push(s), u && (m.preventDefault = !0), c && (m.stopPropagation = !0);
  };
  for (let a of t) {
    let l = a.scope ? a.scope.split(" ") : ["editor"];
    if (a.any)
      for (let u of l) {
        let c = n[u] || (n[u] = /* @__PURE__ */ Object.create(null));
        c._any || (c._any = { preventDefault: !1, stopPropagation: !1, run: [] });
        let { any: d } = a;
        for (let f in c)
          c[f].run.push((h) => d(h, XS));
      }
    let s = a[e] || a.key;
    if (s)
      for (let u of l)
        r(u, s, a.run, a.preventDefault, a.stopPropagation), a.shift && r(u, "Shift-" + s, a.shift, a.preventDefault, a.stopPropagation);
  }
  return n;
}
let XS = null;
function wxe(t, e, n, i) {
  XS = e;
  let o = Rbe(e), r = hc(o, 0), a = Hd(r) == o.length && o != " ", l = "", s = !1, u = !1, c = !1;
  mu && mu.view == n && mu.scope == i && (l = mu.prefix + " ", O6.indexOf(e.keyCode) < 0 && (u = !0, mu = null));
  let d = /* @__PURE__ */ new Set(), f = (m) => {
    if (m) {
      for (let y of m.run)
        if (!d.has(y) && (d.add(y), y(n)))
          return m.stopPropagation && (c = !0), !0;
      m.preventDefault && (m.stopPropagation && (c = !0), u = !0);
    }
    return !1;
  }, h = t[i], p, g;
  return h && (f(h[l + Fm(o, e, !a)]) ? s = !0 : a && (e.altKey || e.metaKey || e.ctrlKey) && // Ctrl-Alt may be used for AltGr on Windows
  !(kt.windows && e.ctrlKey && e.altKey) && // Alt-combinations on macOS tend to be typed characters
  !(kt.mac && e.altKey && !(e.ctrlKey || e.metaKey)) && (p = Nu[e.keyCode]) && p != o ? (f(h[l + Fm(p, e, !0)]) || e.shiftKey && (g = Kp[e.keyCode]) != o && g != p && f(h[l + Fm(g, e, !1)])) && (s = !0) : a && e.shiftKey && f(h[l + Fm(o, e, !0)]) && (s = !0), !s && f(h._any) && (s = !0)), u && (s = !0), s && c && e.stopPropagation(), XS = null, s;
}
function Cxe() {
  return kxe;
}
const $xe = /* @__PURE__ */ ai.line({ class: "cm-activeLine" }), kxe = /* @__PURE__ */ ga.fromClass(class {
  constructor(t) {
    this.decorations = this.getDeco(t);
  }
  update(t) {
    (t.docChanged || t.selectionSet) && (this.decorations = this.getDeco(t.view));
  }
  getDeco(t) {
    let e = -1, n = [];
    for (let i of t.state.selection.ranges) {
      let o = t.lineBlockAt(i.head);
      o.from > e && (n.push($xe.range(o.from)), e = o.from);
    }
    return ai.set(n);
  }
}, {
  decorations: (t) => t.decorations
});
class Txe extends hh {
  constructor(e) {
    super(), this.content = e;
  }
  toDOM(e) {
    let n = document.createElement("span");
    return n.className = "cm-placeholder", n.style.pointerEvents = "none", n.appendChild(typeof this.content == "string" ? document.createTextNode(this.content) : typeof this.content == "function" ? this.content(e) : this.content.cloneNode(!0)), n.setAttribute("aria-hidden", "true"), n;
  }
  coordsAt(e) {
    let n = e.firstChild ? xp(e.firstChild) : [];
    if (!n.length)
      return null;
    let i = window.getComputedStyle(e.parentNode), o = Gp(n[0], i.direction != "rtl"), r = parseInt(i.lineHeight);
    return o.bottom - o.top > r * 1.5 ? { left: o.left, right: o.right, top: o.top, bottom: o.top + r } : o;
  }
  ignoreEvent() {
    return !1;
  }
}
function Pxe(t) {
  let e = ga.fromClass(class {
    constructor(n) {
      this.view = n, this.placeholder = t ? ai.set([ai.widget({ widget: new Txe(t), side: 1 }).range(0)]) : ai.none;
    }
    get decorations() {
      return this.view.state.doc.length ? ai.none : this.placeholder;
    }
  }, { decorations: (n) => n.decorations });
  return typeof t == "string" ? [
    e,
    Kt.contentAttributes.of({ "aria-placeholder": t })
  ] : e;
}
const Vm = "-10000px";
class Exe {
  constructor(e, n, i, o) {
    this.facet = n, this.createTooltipView = i, this.removeTooltipView = o, this.input = e.state.facet(n), this.tooltips = this.input.filter((a) => a);
    let r = null;
    this.tooltipViews = this.tooltips.map((a) => r = i(a, r));
  }
  update(e, n) {
    var i;
    let o = e.state.facet(this.facet), r = o.filter((s) => s);
    if (o === this.input) {
      for (let s of this.tooltipViews)
        s.update && s.update(e);
      return !1;
    }
    let a = [], l = n ? [] : null;
    for (let s = 0; s < r.length; s++) {
      let u = r[s], c = -1;
      if (u) {
        for (let d = 0; d < this.tooltips.length; d++) {
          let f = this.tooltips[d];
          f && f.create == u.create && (c = d);
        }
        if (c < 0)
          a[s] = this.createTooltipView(u, s ? a[s - 1] : null), l && (l[s] = !!u.above);
        else {
          let d = a[s] = this.tooltipViews[c];
          l && (l[s] = n[c]), d.update && d.update(e);
        }
      }
    }
    for (let s of this.tooltipViews)
      a.indexOf(s) < 0 && (this.removeTooltipView(s), (i = s.destroy) === null || i === void 0 || i.call(s));
    return n && (l.forEach((s, u) => n[u] = s), n.length = l.length), this.input = o, this.tooltips = r, this.tooltipViews = a, !0;
  }
}
function _xe(t) {
  let e = t.dom.ownerDocument.documentElement;
  return { top: 0, left: 0, bottom: e.clientHeight, right: e.clientWidth };
}
const nx = /* @__PURE__ */ an.define({
  combine: (t) => {
    var e, n, i;
    return {
      position: kt.ios ? "absolute" : ((e = t.find((o) => o.position)) === null || e === void 0 ? void 0 : e.position) || "fixed",
      parent: ((n = t.find((o) => o.parent)) === null || n === void 0 ? void 0 : n.parent) || null,
      tooltipSpace: ((i = t.find((o) => o.tooltipSpace)) === null || i === void 0 ? void 0 : i.tooltipSpace) || _xe
    };
  }
}), TM = /* @__PURE__ */ new WeakMap(), M6 = /* @__PURE__ */ ga.fromClass(class {
  constructor(t) {
    this.view = t, this.above = [], this.inView = !0, this.madeAbsolute = !1, this.lastTransaction = 0, this.measureTimeout = -1;
    let e = t.state.facet(nx);
    this.position = e.position, this.parent = e.parent, this.classes = t.themeClasses, this.createContainer(), this.measureReq = { read: this.readMeasure.bind(this), write: this.writeMeasure.bind(this), key: this }, this.resizeObserver = typeof ResizeObserver == "function" ? new ResizeObserver(() => this.measureSoon()) : null, this.manager = new Exe(t, A6, (n, i) => this.createTooltip(n, i), (n) => {
      this.resizeObserver && this.resizeObserver.unobserve(n.dom), n.dom.remove();
    }), this.above = this.manager.tooltips.map((n) => !!n.above), this.intersectionObserver = typeof IntersectionObserver == "function" ? new IntersectionObserver((n) => {
      Date.now() > this.lastTransaction - 50 && n.length > 0 && n[n.length - 1].intersectionRatio < 1 && this.measureSoon();
    }, { threshold: [1] }) : null, this.observeIntersection(), t.win.addEventListener("resize", this.measureSoon = this.measureSoon.bind(this)), this.maybeMeasure();
  }
  createContainer() {
    this.parent ? (this.container = document.createElement("div"), this.container.style.position = "relative", this.container.className = this.view.themeClasses, this.parent.appendChild(this.container)) : this.container = this.view.dom;
  }
  observeIntersection() {
    if (this.intersectionObserver) {
      this.intersectionObserver.disconnect();
      for (let t of this.manager.tooltipViews)
        this.intersectionObserver.observe(t.dom);
    }
  }
  measureSoon() {
    this.measureTimeout < 0 && (this.measureTimeout = setTimeout(() => {
      this.measureTimeout = -1, this.maybeMeasure();
    }, 50));
  }
  update(t) {
    t.transactions.length && (this.lastTransaction = Date.now());
    let e = this.manager.update(t, this.above);
    e && this.observeIntersection();
    let n = e || t.geometryChanged, i = t.state.facet(nx);
    if (i.position != this.position && !this.madeAbsolute) {
      this.position = i.position;
      for (let o of this.manager.tooltipViews)
        o.dom.style.position = this.position;
      n = !0;
    }
    if (i.parent != this.parent) {
      this.parent && this.container.remove(), this.parent = i.parent, this.createContainer();
      for (let o of this.manager.tooltipViews)
        this.container.appendChild(o.dom);
      n = !0;
    } else this.parent && this.view.themeClasses != this.classes && (this.classes = this.container.className = this.view.themeClasses);
    n && this.maybeMeasure();
  }
  createTooltip(t, e) {
    let n = t.create(this.view), i = e ? e.dom : null;
    if (n.dom.classList.add("cm-tooltip"), t.arrow && !n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")) {
      let o = document.createElement("div");
      o.className = "cm-tooltip-arrow", n.dom.appendChild(o);
    }
    return n.dom.style.position = this.position, n.dom.style.top = Vm, n.dom.style.left = "0px", this.container.insertBefore(n.dom, i), n.mount && n.mount(this.view), this.resizeObserver && this.resizeObserver.observe(n.dom), n;
  }
  destroy() {
    var t, e, n;
    this.view.win.removeEventListener("resize", this.measureSoon);
    for (let i of this.manager.tooltipViews)
      i.dom.remove(), (t = i.destroy) === null || t === void 0 || t.call(i);
    this.parent && this.container.remove(), (e = this.resizeObserver) === null || e === void 0 || e.disconnect(), (n = this.intersectionObserver) === null || n === void 0 || n.disconnect(), clearTimeout(this.measureTimeout);
  }
  readMeasure() {
    let t = 1, e = 1, n = !1;
    if (this.position == "fixed" && this.manager.tooltipViews.length) {
      let { dom: r } = this.manager.tooltipViews[0];
      if (kt.safari) {
        let a = r.getBoundingClientRect();
        n = Math.abs(a.top + 1e4) > 1 || Math.abs(a.left) > 1;
      } else
        n = !!r.offsetParent && r.offsetParent != this.container.ownerDocument.body;
    }
    if (n || this.position == "absolute")
      if (this.parent) {
        let r = this.parent.getBoundingClientRect();
        r.width && r.height && (t = r.width / this.parent.offsetWidth, e = r.height / this.parent.offsetHeight);
      } else
        ({ scaleX: t, scaleY: e } = this.view.viewState);
    let i = this.view.scrollDOM.getBoundingClientRect(), o = fk(this.view);
    return {
      visible: {
        left: i.left + o.left,
        top: i.top + o.top,
        right: i.right - o.right,
        bottom: i.bottom - o.bottom
      },
      parent: this.parent ? this.container.getBoundingClientRect() : this.view.dom.getBoundingClientRect(),
      pos: this.manager.tooltips.map((r, a) => {
        let l = this.manager.tooltipViews[a];
        return l.getCoords ? l.getCoords(r.pos) : this.view.coordsAtPos(r.pos);
      }),
      size: this.manager.tooltipViews.map(({ dom: r }) => r.getBoundingClientRect()),
      space: this.view.state.facet(nx).tooltipSpace(this.view),
      scaleX: t,
      scaleY: e,
      makeAbsolute: n
    };
  }
  writeMeasure(t) {
    var e;
    if (t.makeAbsolute) {
      this.madeAbsolute = !0, this.position = "absolute";
      for (let l of this.manager.tooltipViews)
        l.dom.style.position = "absolute";
    }
    let { visible: n, space: i, scaleX: o, scaleY: r } = t, a = [];
    for (let l = 0; l < this.manager.tooltips.length; l++) {
      let s = this.manager.tooltips[l], u = this.manager.tooltipViews[l], { dom: c } = u, d = t.pos[l], f = t.size[l];
      if (!d || s.clip !== !1 && (d.bottom <= Math.max(n.top, i.top) || d.top >= Math.min(n.bottom, i.bottom) || d.right < Math.max(n.left, i.left) - 0.1 || d.left > Math.min(n.right, i.right) + 0.1)) {
        c.style.top = Vm;
        continue;
      }
      let h = s.arrow ? u.dom.querySelector(".cm-tooltip-arrow") : null, p = h ? 7 : 0, g = f.right - f.left, m = (e = TM.get(u)) !== null && e !== void 0 ? e : f.bottom - f.top, y = u.offset || Mxe, b = this.view.textDirection == Gi.LTR, w = f.width > i.right - i.left ? b ? i.left : i.right - f.width : b ? Math.max(i.left, Math.min(d.left - (h ? 14 : 0) + y.x, i.right - g)) : Math.min(Math.max(i.left, d.left - g + (h ? 14 : 0) - y.x), i.right - g), $ = this.above[l];
      !s.strictSide && ($ ? d.top - m - p - y.y < i.top : d.bottom + m + p + y.y > i.bottom) && $ == i.bottom - d.bottom > d.top - i.top && ($ = this.above[l] = !$);
      let C = ($ ? d.top - i.top : i.bottom - d.bottom) - p;
      if (C < m && u.resize !== !1) {
        if (C < this.view.defaultLineHeight) {
          c.style.top = Vm;
          continue;
        }
        TM.set(u, m), c.style.height = (m = C) / r + "px";
      } else c.style.height && (c.style.height = "");
      let P = $ ? d.top - m - p - y.y : d.bottom + p + y.y, O = w + g;
      if (u.overlap !== !0)
        for (let E of a)
          E.left < O && E.right > w && E.top < P + m && E.bottom > P && (P = $ ? E.top - m - 2 - p : E.bottom + p + 2);
      if (this.position == "absolute" ? (c.style.top = (P - t.parent.top) / r + "px", PM(c, (w - t.parent.left) / o)) : (c.style.top = P / r + "px", PM(c, w / o)), h) {
        let E = d.left + (b ? y.x : -y.x) - (w + 14 - 7);
        h.style.left = E / o + "px";
      }
      u.overlap !== !0 && a.push({ left: w, top: P, right: O, bottom: P + m }), c.classList.toggle("cm-tooltip-above", $), c.classList.toggle("cm-tooltip-below", !$), u.positioned && u.positioned(t.space);
    }
  }
  maybeMeasure() {
    if (this.manager.tooltips.length && (this.view.inView && this.view.requestMeasure(this.measureReq), this.inView != this.view.inView && (this.inView = this.view.inView, !this.inView)))
      for (let t of this.manager.tooltipViews)
        t.dom.style.top = Vm;
  }
}, {
  eventObservers: {
    scroll() {
      this.maybeMeasure();
    }
  }
});
function PM(t, e) {
  let n = parseInt(t.style.left, 10);
  (isNaN(n) || Math.abs(e - n) > 1) && (t.style.left = e + "px");
}
const Ixe = /* @__PURE__ */ Kt.baseTheme({
  ".cm-tooltip": {
    zIndex: 500,
    boxSizing: "border-box"
  },
  "&light .cm-tooltip": {
    border: "1px solid #bbb",
    backgroundColor: "#f5f5f5"
  },
  "&light .cm-tooltip-section:not(:first-child)": {
    borderTop: "1px solid #bbb"
  },
  "&dark .cm-tooltip": {
    backgroundColor: "#333338",
    color: "white"
  },
  ".cm-tooltip-arrow": {
    height: "7px",
    width: "14px",
    position: "absolute",
    zIndex: -1,
    overflow: "hidden",
    "&:before, &:after": {
      content: "''",
      position: "absolute",
      width: 0,
      height: 0,
      borderLeft: "7px solid transparent",
      borderRight: "7px solid transparent"
    },
    ".cm-tooltip-above &": {
      bottom: "-7px",
      "&:before": {
        borderTop: "7px solid #bbb"
      },
      "&:after": {
        borderTop: "7px solid #f5f5f5",
        bottom: "1px"
      }
    },
    ".cm-tooltip-below &": {
      top: "-7px",
      "&:before": {
        borderBottom: "7px solid #bbb"
      },
      "&:after": {
        borderBottom: "7px solid #f5f5f5",
        top: "1px"
      }
    }
  },
  "&dark .cm-tooltip .cm-tooltip-arrow": {
    "&:before": {
      borderTopColor: "#333338",
      borderBottomColor: "#333338"
    },
    "&:after": {
      borderTopColor: "transparent",
      borderBottomColor: "transparent"
    }
  }
}), Mxe = { x: 0, y: 0 }, A6 = /* @__PURE__ */ an.define({
  enables: [M6, Ixe]
});
function R6(t, e) {
  let n = t.plugin(M6);
  if (!n)
    return null;
  let i = n.manager.tooltips.indexOf(e);
  return i < 0 ? null : n.manager.tooltipViews[i];
}
class Kf extends Ru {
  /**
  @internal
  */
  compare(e) {
    return this == e || this.constructor == e.constructor && this.eq(e);
  }
  /**
  Compare this marker to another marker of the same type.
  */
  eq(e) {
    return !1;
  }
  /**
  Called if the marker has a `toDOM` method and its representation
  was removed from a gutter.
  */
  destroy(e) {
  }
}
Kf.prototype.elementClass = "";
Kf.prototype.toDOM = void 0;
Kf.prototype.mapMode = nr.TrackBefore;
Kf.prototype.startSide = Kf.prototype.endSide = -1;
Kf.prototype.point = !0;
const D6 = 1024;
let Axe = 0;
class ix {
  constructor(e, n) {
    this.from = e, this.to = n;
  }
}
class ei {
  /**
  Create a new node prop type.
  */
  constructor(e = {}) {
    this.id = Axe++, this.perNode = !!e.perNode, this.deserialize = e.deserialize || (() => {
      throw new Error("This node type doesn't define a deserialize function");
    }), this.combine = e.combine || null;
  }
  /**
  This is meant to be used with
  [`NodeSet.extend`](#common.NodeSet.extend) or
  [`LRParser.configure`](#lr.ParserConfig.props) to compute
  prop values for each node type in the set. Takes a [match
  object](#common.NodeType^match) or function that returns undefined
  if the node type doesn't get this prop, and the prop's value if
  it does.
  */
  add(e) {
    if (this.perNode)
      throw new RangeError("Can't add per-node props to node types");
    return typeof e != "function" && (e = Sr.match(e)), (n) => {
      let i = e(n);
      return i === void 0 ? null : [this, i];
    };
  }
}
ei.closedBy = new ei({ deserialize: (t) => t.split(" ") });
ei.openedBy = new ei({ deserialize: (t) => t.split(" ") });
ei.group = new ei({ deserialize: (t) => t.split(" ") });
ei.isolate = new ei({ deserialize: (t) => {
  if (t && t != "rtl" && t != "ltr" && t != "auto")
    throw new RangeError("Invalid value for isolate: " + t);
  return t || "auto";
} });
ei.contextHash = new ei({ perNode: !0 });
ei.lookAhead = new ei({ perNode: !0 });
ei.mounted = new ei({ perNode: !0 });
class wp {
  constructor(e, n, i, o = !1) {
    this.tree = e, this.overlay = n, this.parser = i, this.bracketed = o;
  }
  /**
  @internal
  */
  static get(e) {
    return e && e.props && e.props[ei.mounted.id];
  }
}
const Rxe = /* @__PURE__ */ Object.create(null);
class Sr {
  /**
  @internal
  */
  constructor(e, n, i, o = 0) {
    this.name = e, this.props = n, this.id = i, this.flags = o;
  }
  /**
  Define a node type.
  */
  static define(e) {
    let n = e.props && e.props.length ? /* @__PURE__ */ Object.create(null) : Rxe, i = (e.top ? 1 : 0) | (e.skipped ? 2 : 0) | (e.error ? 4 : 0) | (e.name == null ? 8 : 0), o = new Sr(e.name || "", n, e.id, i);
    if (e.props) {
      for (let r of e.props)
        if (Array.isArray(r) || (r = r(o)), r) {
          if (r[0].perNode)
            throw new RangeError("Can't store a per-node prop on a node type");
          n[r[0].id] = r[1];
        }
    }
    return o;
  }
  /**
  Retrieves a node prop for this type. Will return `undefined` if
  the prop isn't present on this node.
  */
  prop(e) {
    return this.props[e.id];
  }
  /**
  True when this is the top node of a grammar.
  */
  get isTop() {
    return (this.flags & 1) > 0;
  }
  /**
  True when this node is produced by a skip rule.
  */
  get isSkipped() {
    return (this.flags & 2) > 0;
  }
  /**
  Indicates whether this is an error node.
  */
  get isError() {
    return (this.flags & 4) > 0;
  }
  /**
  When true, this node type doesn't correspond to a user-declared
  named node, for example because it is used to cache repetition.
  */
  get isAnonymous() {
    return (this.flags & 8) > 0;
  }
  /**
  Returns true when this node's name or one of its
  [groups](#common.NodeProp^group) matches the given string.
  */
  is(e) {
    if (typeof e == "string") {
      if (this.name == e)
        return !0;
      let n = this.prop(ei.group);
      return n ? n.indexOf(e) > -1 : !1;
    }
    return this.id == e;
  }
  /**
  Create a function from node types to arbitrary values by
  specifying an object whose property names are node or
  [group](#common.NodeProp^group) names. Often useful with
  [`NodeProp.add`](#common.NodeProp.add). You can put multiple
  names, separated by spaces, in a single property name to map
  multiple node names to a single value.
  */
  static match(e) {
    let n = /* @__PURE__ */ Object.create(null);
    for (let i in e)
      for (let o of i.split(" "))
        n[o] = e[i];
    return (i) => {
      for (let o = i.prop(ei.group), r = -1; r < (o ? o.length : 0); r++) {
        let a = n[r < 0 ? i.name : o[r]];
        if (a)
          return a;
      }
    };
  }
}
Sr.none = new Sr(
  "",
  /* @__PURE__ */ Object.create(null),
  0,
  8
  /* NodeFlag.Anonymous */
);
class mk {
  /**
  Create a set with the given types. The `id` property of each
  type should correspond to its position within the array.
  */
  constructor(e) {
    this.types = e;
    for (let n = 0; n < e.length; n++)
      if (e[n].id != n)
        throw new RangeError("Node type ids should correspond to array positions when creating a node set");
  }
  /**
  Create a copy of this set with some node properties added. The
  arguments to this method can be created with
  [`NodeProp.add`](#common.NodeProp.add).
  */
  extend(...e) {
    let n = [];
    for (let i of this.types) {
      let o = null;
      for (let r of e) {
        let a = r(i);
        if (a) {
          o || (o = Object.assign({}, i.props));
          let l = a[1], s = a[0];
          s.combine && s.id in o && (l = s.combine(o[s.id], l)), o[s.id] = l;
        }
      }
      n.push(o ? new Sr(i.name, o, i.id, i.flags) : i);
    }
    return new mk(n);
  }
}
const Qm = /* @__PURE__ */ new WeakMap(), EM = /* @__PURE__ */ new WeakMap();
var Li;
(function(t) {
  t[t.ExcludeBuffers = 1] = "ExcludeBuffers", t[t.IncludeAnonymous = 2] = "IncludeAnonymous", t[t.IgnoreMounts = 4] = "IgnoreMounts", t[t.IgnoreOverlays = 8] = "IgnoreOverlays", t[t.EnterBracketed = 16] = "EnterBracketed";
})(Li || (Li = {}));
class Ui {
  /**
  Construct a new tree. See also [`Tree.build`](#common.Tree^build).
  */
  constructor(e, n, i, o, r) {
    if (this.type = e, this.children = n, this.positions = i, this.length = o, this.props = null, r && r.length) {
      this.props = /* @__PURE__ */ Object.create(null);
      for (let [a, l] of r)
        this.props[typeof a == "number" ? a : a.id] = l;
    }
  }
  /**
  @internal
  */
  toString() {
    let e = wp.get(this);
    if (e && !e.overlay)
      return e.tree.toString();
    let n = "";
    for (let i of this.children) {
      let o = i.toString();
      o && (n && (n += ","), n += o);
    }
    return this.type.name ? (/\W/.test(this.type.name) && !this.type.isError ? JSON.stringify(this.type.name) : this.type.name) + (n.length ? "(" + n + ")" : "") : n;
  }
  /**
  Get a [tree cursor](#common.TreeCursor) positioned at the top of
  the tree. Mode can be used to [control](#common.IterMode) which
  nodes the cursor visits.
  */
  cursor(e = 0) {
    return new GS(this.topNode, e);
  }
  /**
  Get a [tree cursor](#common.TreeCursor) pointing into this tree
  at the given position and side (see
  [`moveTo`](#common.TreeCursor.moveTo).
  */
  cursorAt(e, n = 0, i = 0) {
    let o = Qm.get(this) || this.topNode, r = new GS(o);
    return r.moveTo(e, n), Qm.set(this, r._tree), r;
  }
  /**
  Get a [syntax node](#common.SyntaxNode) object for the top of the
  tree.
  */
  get topNode() {
    return new xr(this, 0, 0, null);
  }
  /**
  Get the [syntax node](#common.SyntaxNode) at the given position.
  If `side` is -1, this will move into nodes that end at the
  position. If 1, it'll move into nodes that start at the
  position. With 0, it'll only enter nodes that cover the position
  from both sides.
  
  Note that this will not enter
  [overlays](#common.MountedTree.overlay), and you often want
  [`resolveInner`](#common.Tree.resolveInner) instead.
  */
  resolve(e, n = 0) {
    let i = Jp(Qm.get(this) || this.topNode, e, n, !1);
    return Qm.set(this, i), i;
  }
  /**
  Like [`resolve`](#common.Tree.resolve), but will enter
  [overlaid](#common.MountedTree.overlay) nodes, producing a syntax node
  pointing into the innermost overlaid tree at the given position
  (with parent links going through all parent structure, including
  the host trees).
  */
  resolveInner(e, n = 0) {
    let i = Jp(EM.get(this) || this.topNode, e, n, !0);
    return EM.set(this, i), i;
  }
  /**
  In some situations, it can be useful to iterate through all
  nodes around a position, including those in overlays that don't
  directly cover the position. This method gives you an iterator
  that will produce all nodes, from small to big, around the given
  position.
  */
  resolveStack(e, n = 0) {
    return Lxe(this, e, n);
  }
  /**
  Iterate over the tree and its children, calling `enter` for any
  node that touches the `from`/`to` region (if given) before
  running over such a node's children, and `leave` (if given) when
  leaving the node. When `enter` returns `false`, that node will
  not have its children iterated over (or `leave` called).
  */
  iterate(e) {
    let { enter: n, leave: i, from: o = 0, to: r = this.length } = e, a = e.mode || 0, l = (a & Li.IncludeAnonymous) > 0;
    for (let s = this.cursor(a | Li.IncludeAnonymous); ; ) {
      let u = !1;
      if (s.from <= r && s.to >= o && (!l && s.type.isAnonymous || n(s) !== !1)) {
        if (s.firstChild())
          continue;
        u = !0;
      }
      for (; u && i && (l || !s.type.isAnonymous) && i(s), !s.nextSibling(); ) {
        if (!s.parent())
          return;
        u = !0;
      }
    }
  }
  /**
  Get the value of the given [node prop](#common.NodeProp) for this
  node. Works with both per-node and per-type props.
  */
  prop(e) {
    return e.perNode ? this.props ? this.props[e.id] : void 0 : this.type.prop(e);
  }
  /**
  Returns the node's [per-node props](#common.NodeProp.perNode) in a
  format that can be passed to the [`Tree`](#common.Tree)
  constructor.
  */
  get propValues() {
    let e = [];
    if (this.props)
      for (let n in this.props)
        e.push([+n, this.props[n]]);
    return e;
  }
  /**
  Balance the direct children of this tree, producing a copy of
  which may have children grouped into subtrees with type
  [`NodeType.none`](#common.NodeType^none).
  */
  balance(e = {}) {
    return this.children.length <= 8 ? this : bk(Sr.none, this.children, this.positions, 0, this.children.length, 0, this.length, (n, i, o) => new Ui(this.type, n, i, o, this.propValues), e.makeTree || ((n, i, o) => new Ui(Sr.none, n, i, o)));
  }
  /**
  Build a tree from a postfix-ordered buffer of node information,
  or a cursor over such a buffer.
  */
  static build(e) {
    return zxe(e);
  }
}
Ui.empty = new Ui(Sr.none, [], [], 0);
class vk {
  constructor(e, n) {
    this.buffer = e, this.index = n;
  }
  get id() {
    return this.buffer[this.index - 4];
  }
  get start() {
    return this.buffer[this.index - 3];
  }
  get end() {
    return this.buffer[this.index - 2];
  }
  get size() {
    return this.buffer[this.index - 1];
  }
  get pos() {
    return this.index;
  }
  next() {
    this.index -= 4;
  }
  fork() {
    return new vk(this.buffer, this.index);
  }
}
class zu {
  /**
  Create a tree buffer.
  */
  constructor(e, n, i) {
    this.buffer = e, this.length = n, this.set = i;
  }
  /**
  @internal
  */
  get type() {
    return Sr.none;
  }
  /**
  @internal
  */
  toString() {
    let e = [];
    for (let n = 0; n < this.buffer.length; )
      e.push(this.childString(n)), n = this.buffer[n + 3];
    return e.join(",");
  }
  /**
  @internal
  */
  childString(e) {
    let n = this.buffer[e], i = this.buffer[e + 3], o = this.set.types[n], r = o.name;
    if (/\W/.test(r) && !o.isError && (r = JSON.stringify(r)), e += 4, i == e)
      return r;
    let a = [];
    for (; e < i; )
      a.push(this.childString(e)), e = this.buffer[e + 3];
    return r + "(" + a.join(",") + ")";
  }
  /**
  @internal
  */
  findChild(e, n, i, o, r) {
    let { buffer: a } = this, l = -1;
    for (let s = e; s != n && !(N6(r, o, a[s + 1], a[s + 2]) && (l = s, i > 0)); s = a[s + 3])
      ;
    return l;
  }
  /**
  @internal
  */
  slice(e, n, i) {
    let o = this.buffer, r = new Uint16Array(n - e), a = 0;
    for (let l = e, s = 0; l < n; ) {
      r[s++] = o[l++], r[s++] = o[l++] - i;
      let u = r[s++] = o[l++] - i;
      r[s++] = o[l++] - e, a = Math.max(a, u);
    }
    return new zu(r, a, this.set);
  }
}
function N6(t, e, n, i) {
  switch (t) {
    case -2:
      return n < e;
    case -1:
      return i >= e && n < e;
    case 0:
      return n < e && i > e;
    case 1:
      return n <= e && i > e;
    case 2:
      return i > e;
    case 4:
      return !0;
  }
}
function Jp(t, e, n, i) {
  for (var o; t.from == t.to || (n < 1 ? t.from >= e : t.from > e) || (n > -1 ? t.to <= e : t.to < e); ) {
    let a = !i && t instanceof xr && t.index < 0 ? null : t.parent;
    if (!a)
      return t;
    t = a;
  }
  let r = i ? 0 : Li.IgnoreOverlays;
  if (i)
    for (let a = t, l = a.parent; l; a = l, l = a.parent)
      a instanceof xr && a.index < 0 && ((o = l.enter(e, n, r)) === null || o === void 0 ? void 0 : o.from) != a.from && (t = l);
  for (; ; ) {
    let a = t.enter(e, n, r);
    if (!a)
      return t;
    t = a;
  }
}
class L6 {
  cursor(e = 0) {
    return new GS(this, e);
  }
  getChild(e, n = null, i = null) {
    let o = _M(this, e, n, i);
    return o.length ? o[0] : null;
  }
  getChildren(e, n = null, i = null) {
    return _M(this, e, n, i);
  }
  resolve(e, n = 0) {
    return Jp(this, e, n, !1);
  }
  resolveInner(e, n = 0) {
    return Jp(this, e, n, !0);
  }
  matchContext(e) {
    return ZS(this.parent, e);
  }
  enterUnfinishedNodesBefore(e) {
    let n = this.childBefore(e), i = this;
    for (; n; ) {
      let o = n.lastChild;
      if (!o || o.to != n.to)
        break;
      o.type.isError && o.from == o.to ? (i = n, n = o.prevSibling) : n = o;
    }
    return i;
  }
  get node() {
    return this;
  }
  get next() {
    return this.parent;
  }
}
class xr extends L6 {
  constructor(e, n, i, o) {
    super(), this._tree = e, this.from = n, this.index = i, this._parent = o;
  }
  get type() {
    return this._tree.type;
  }
  get name() {
    return this._tree.type.name;
  }
  get to() {
    return this.from + this._tree.length;
  }
  nextChild(e, n, i, o, r = 0) {
    for (let a = this; ; ) {
      for (let { children: l, positions: s } = a._tree, u = n > 0 ? l.length : -1; e != u; e += n) {
        let c = l[e], d = s[e] + a.from, f;
        if (!(!(r & Li.EnterBracketed && c instanceof Ui && (f = wp.get(c)) && !f.overlay && f.bracketed && i >= d && i <= d + c.length) && !N6(o, i, d, d + c.length))) {
          if (c instanceof zu) {
            if (r & Li.ExcludeBuffers)
              continue;
            let h = c.findChild(0, c.buffer.length, n, i - d, o);
            if (h > -1)
              return new Tl(new Dxe(a, c, e, d), null, h);
          } else if (r & Li.IncludeAnonymous || !c.type.isAnonymous || yk(c)) {
            let h;
            if (!(r & Li.IgnoreMounts) && (h = wp.get(c)) && !h.overlay)
              return new xr(h.tree, d, e, a);
            let p = new xr(c, d, e, a);
            return r & Li.IncludeAnonymous || !p.type.isAnonymous ? p : p.nextChild(n < 0 ? c.children.length - 1 : 0, n, i, o, r);
          }
        }
      }
      if (r & Li.IncludeAnonymous || !a.type.isAnonymous || (a.index >= 0 ? e = a.index + n : e = n < 0 ? -1 : a._parent._tree.children.length, a = a._parent, !a))
        return null;
    }
  }
  get firstChild() {
    return this.nextChild(
      0,
      1,
      0,
      4
      /* Side.DontCare */
    );
  }
  get lastChild() {
    return this.nextChild(
      this._tree.children.length - 1,
      -1,
      0,
      4
      /* Side.DontCare */
    );
  }
  childAfter(e) {
    return this.nextChild(
      0,
      1,
      e,
      2
      /* Side.After */
    );
  }
  childBefore(e) {
    return this.nextChild(
      this._tree.children.length - 1,
      -1,
      e,
      -2
      /* Side.Before */
    );
  }
  prop(e) {
    return this._tree.prop(e);
  }
  enter(e, n, i = 0) {
    let o;
    if (!(i & Li.IgnoreOverlays) && (o = wp.get(this._tree)) && o.overlay) {
      let r = e - this.from, a = i & Li.EnterBracketed && o.bracketed;
      for (let { from: l, to: s } of o.overlay)
        if ((n > 0 || a ? l <= r : l < r) && (n < 0 || a ? s >= r : s > r))
          return new xr(o.tree, o.overlay[0].from + this.from, -1, this);
    }
    return this.nextChild(0, 1, e, n, i);
  }
  nextSignificantParent() {
    let e = this;
    for (; e.type.isAnonymous && e._parent; )
      e = e._parent;
    return e;
  }
  get parent() {
    return this._parent ? this._parent.nextSignificantParent() : null;
  }
  get nextSibling() {
    return this._parent && this.index >= 0 ? this._parent.nextChild(
      this.index + 1,
      1,
      0,
      4
      /* Side.DontCare */
    ) : null;
  }
  get prevSibling() {
    return this._parent && this.index >= 0 ? this._parent.nextChild(
      this.index - 1,
      -1,
      0,
      4
      /* Side.DontCare */
    ) : null;
  }
  get tree() {
    return this._tree;
  }
  toTree() {
    return this._tree;
  }
  /**
  @internal
  */
  toString() {
    return this._tree.toString();
  }
}
function _M(t, e, n, i) {
  let o = t.cursor(), r = [];
  if (!o.firstChild())
    return r;
  if (n != null) {
    for (let a = !1; !a; )
      if (a = o.type.is(n), !o.nextSibling())
        return r;
  }
  for (; ; ) {
    if (i != null && o.type.is(i))
      return r;
    if (o.type.is(e) && r.push(o.node), !o.nextSibling())
      return i == null ? r : [];
  }
}
function ZS(t, e, n = e.length - 1) {
  for (let i = t; n >= 0; i = i.parent) {
    if (!i)
      return !1;
    if (!i.type.isAnonymous) {
      if (e[n] && e[n] != i.name)
        return !1;
      n--;
    }
  }
  return !0;
}
class Dxe {
  constructor(e, n, i, o) {
    this.parent = e, this.buffer = n, this.index = i, this.start = o;
  }
}
class Tl extends L6 {
  get name() {
    return this.type.name;
  }
  get from() {
    return this.context.start + this.context.buffer.buffer[this.index + 1];
  }
  get to() {
    return this.context.start + this.context.buffer.buffer[this.index + 2];
  }
  constructor(e, n, i) {
    super(), this.context = e, this._parent = n, this.index = i, this.type = e.buffer.set.types[e.buffer.buffer[i]];
  }
  child(e, n, i) {
    let { buffer: o } = this.context, r = o.findChild(this.index + 4, o.buffer[this.index + 3], e, n - this.context.start, i);
    return r < 0 ? null : new Tl(this.context, this, r);
  }
  get firstChild() {
    return this.child(
      1,
      0,
      4
      /* Side.DontCare */
    );
  }
  get lastChild() {
    return this.child(
      -1,
      0,
      4
      /* Side.DontCare */
    );
  }
  childAfter(e) {
    return this.child(
      1,
      e,
      2
      /* Side.After */
    );
  }
  childBefore(e) {
    return this.child(
      -1,
      e,
      -2
      /* Side.Before */
    );
  }
  prop(e) {
    return this.type.prop(e);
  }
  enter(e, n, i = 0) {
    if (i & Li.ExcludeBuffers)
      return null;
    let { buffer: o } = this.context, r = o.findChild(this.index + 4, o.buffer[this.index + 3], n > 0 ? 1 : -1, e - this.context.start, n);
    return r < 0 ? null : new Tl(this.context, this, r);
  }
  get parent() {
    return this._parent || this.context.parent.nextSignificantParent();
  }
  externalSibling(e) {
    return this._parent ? null : this.context.parent.nextChild(
      this.context.index + e,
      e,
      0,
      4
      /* Side.DontCare */
    );
  }
  get nextSibling() {
    let { buffer: e } = this.context, n = e.buffer[this.index + 3];
    return n < (this._parent ? e.buffer[this._parent.index + 3] : e.buffer.length) ? new Tl(this.context, this._parent, n) : this.externalSibling(1);
  }
  get prevSibling() {
    let { buffer: e } = this.context, n = this._parent ? this._parent.index + 4 : 0;
    return this.index == n ? this.externalSibling(-1) : new Tl(this.context, this._parent, e.findChild(
      n,
      this.index,
      -1,
      0,
      4
      /* Side.DontCare */
    ));
  }
  get tree() {
    return null;
  }
  toTree() {
    let e = [], n = [], { buffer: i } = this.context, o = this.index + 4, r = i.buffer[this.index + 3];
    if (r > o) {
      let a = i.buffer[this.index + 1];
      e.push(i.slice(o, r, a)), n.push(0);
    }
    return new Ui(this.type, e, n, this.to - this.from);
  }
  /**
  @internal
  */
  toString() {
    return this.context.buffer.childString(this.index);
  }
}
function z6(t) {
  if (!t.length)
    return null;
  let e = 0, n = t[0];
  for (let r = 1; r < t.length; r++) {
    let a = t[r];
    (a.from > n.from || a.to < n.to) && (n = a, e = r);
  }
  let i = n instanceof xr && n.index < 0 ? null : n.parent, o = t.slice();
  return i ? o[e] = i : o.splice(e, 1), new Nxe(o, n);
}
class Nxe {
  constructor(e, n) {
    this.heads = e, this.node = n;
  }
  get next() {
    return z6(this.heads);
  }
}
function Lxe(t, e, n) {
  let i = t.resolveInner(e, n), o = null;
  for (let r = i instanceof xr ? i : i.context.parent; r; r = r.parent)
    if (r.index < 0) {
      let a = r.parent;
      (o || (o = [i])).push(a.resolve(e, n)), r = a;
    } else {
      let a = wp.get(r.tree);
      if (a && a.overlay && a.overlay[0].from <= e && a.overlay[a.overlay.length - 1].to >= e) {
        let l = new xr(a.tree, a.overlay[0].from + r.from, -1, r);
        (o || (o = [i])).push(Jp(l, e, n, !1));
      }
    }
  return o ? z6(o) : i;
}
class GS {
  /**
  Shorthand for `.type.name`.
  */
  get name() {
    return this.type.name;
  }
  /**
  @internal
  */
  constructor(e, n = 0) {
    if (this.buffer = null, this.stack = [], this.index = 0, this.bufferNode = null, this.mode = n & ~Li.EnterBracketed, e instanceof xr)
      this.yieldNode(e);
    else {
      this._tree = e.context.parent, this.buffer = e.context;
      for (let i = e._parent; i; i = i._parent)
        this.stack.unshift(i.index);
      this.bufferNode = e, this.yieldBuf(e.index);
    }
  }
  yieldNode(e) {
    return e ? (this._tree = e, this.type = e.type, this.from = e.from, this.to = e.to, !0) : !1;
  }
  yieldBuf(e, n) {
    this.index = e;
    let { start: i, buffer: o } = this.buffer;
    return this.type = n || o.set.types[o.buffer[e]], this.from = i + o.buffer[e + 1], this.to = i + o.buffer[e + 2], !0;
  }
  /**
  @internal
  */
  yield(e) {
    return e ? e instanceof xr ? (this.buffer = null, this.yieldNode(e)) : (this.buffer = e.context, this.yieldBuf(e.index, e.type)) : !1;
  }
  /**
  @internal
  */
  toString() {
    return this.buffer ? this.buffer.buffer.childString(this.index) : this._tree.toString();
  }
  /**
  @internal
  */
  enterChild(e, n, i) {
    if (!this.buffer)
      return this.yield(this._tree.nextChild(e < 0 ? this._tree._tree.children.length - 1 : 0, e, n, i, this.mode));
    let { buffer: o } = this.buffer, r = o.findChild(this.index + 4, o.buffer[this.index + 3], e, n - this.buffer.start, i);
    return r < 0 ? !1 : (this.stack.push(this.index), this.yieldBuf(r));
  }
  /**
  Move the cursor to this node's first child. When this returns
  false, the node has no child, and the cursor has not been moved.
  */
  firstChild() {
    return this.enterChild(
      1,
      0,
      4
      /* Side.DontCare */
    );
  }
  /**
  Move the cursor to this node's last child.
  */
  lastChild() {
    return this.enterChild(
      -1,
      0,
      4
      /* Side.DontCare */
    );
  }
  /**
  Move the cursor to the first child that ends after `pos`.
  */
  childAfter(e) {
    return this.enterChild(
      1,
      e,
      2
      /* Side.After */
    );
  }
  /**
  Move to the last child that starts before `pos`.
  */
  childBefore(e) {
    return this.enterChild(
      -1,
      e,
      -2
      /* Side.Before */
    );
  }
  /**
  Move the cursor to the child around `pos`. If side is -1 the
  child may end at that position, when 1 it may start there. This
  will also enter [overlaid](#common.MountedTree.overlay)
  [mounted](#common.NodeProp^mounted) trees unless `overlays` is
  set to false.
  */
  enter(e, n, i = this.mode) {
    return this.buffer ? i & Li.ExcludeBuffers ? !1 : this.enterChild(1, e, n) : this.yield(this._tree.enter(e, n, i));
  }
  /**
  Move to the node's parent node, if this isn't the top node.
  */
  parent() {
    if (!this.buffer)
      return this.yieldNode(this.mode & Li.IncludeAnonymous ? this._tree._parent : this._tree.parent);
    if (this.stack.length)
      return this.yieldBuf(this.stack.pop());
    let e = this.mode & Li.IncludeAnonymous ? this.buffer.parent : this.buffer.parent.nextSignificantParent();
    return this.buffer = null, this.yieldNode(e);
  }
  /**
  @internal
  */
  sibling(e) {
    if (!this.buffer)
      return this._tree._parent ? this.yield(this._tree.index < 0 ? null : this._tree._parent.nextChild(this._tree.index + e, e, 0, 4, this.mode)) : !1;
    let { buffer: n } = this.buffer, i = this.stack.length - 1;
    if (e < 0) {
      let o = i < 0 ? 0 : this.stack[i] + 4;
      if (this.index != o)
        return this.yieldBuf(n.findChild(
          o,
          this.index,
          -1,
          0,
          4
          /* Side.DontCare */
        ));
    } else {
      let o = n.buffer[this.index + 3];
      if (o < (i < 0 ? n.buffer.length : n.buffer[this.stack[i] + 3]))
        return this.yieldBuf(o);
    }
    return i < 0 ? this.yield(this.buffer.parent.nextChild(this.buffer.index + e, e, 0, 4, this.mode)) : !1;
  }
  /**
  Move to this node's next sibling, if any.
  */
  nextSibling() {
    return this.sibling(1);
  }
  /**
  Move to this node's previous sibling, if any.
  */
  prevSibling() {
    return this.sibling(-1);
  }
  atLastNode(e) {
    let n, i, { buffer: o } = this;
    if (o) {
      if (e > 0) {
        if (this.index < o.buffer.buffer.length)
          return !1;
      } else
        for (let r = 0; r < this.index; r++)
          if (o.buffer.buffer[r + 3] < this.index)
            return !1;
      ({ index: n, parent: i } = o);
    } else
      ({ index: n, _parent: i } = this._tree);
    for (; i; { index: n, _parent: i } = i)
      if (n > -1)
        for (let r = n + e, a = e < 0 ? -1 : i._tree.children.length; r != a; r += e) {
          let l = i._tree.children[r];
          if (this.mode & Li.IncludeAnonymous || l instanceof zu || !l.type.isAnonymous || yk(l))
            return !1;
        }
    return !0;
  }
  move(e, n) {
    if (n && this.enterChild(
      e,
      0,
      4
      /* Side.DontCare */
    ))
      return !0;
    for (; ; ) {
      if (this.sibling(e))
        return !0;
      if (this.atLastNode(e) || !this.parent())
        return !1;
    }
  }
  /**
  Move to the next node in a
  [pre-order](https://en.wikipedia.org/wiki/Tree_traversal#Pre-order,_NLR)
  traversal, going from a node to its first child or, if the
  current node is empty or `enter` is false, its next sibling or
  the next sibling of the first parent node that has one.
  */
  next(e = !0) {
    return this.move(1, e);
  }
  /**
  Move to the next node in a last-to-first pre-order traversal. A
  node is followed by its last child or, if it has none, its
  previous sibling or the previous sibling of the first parent
  node that has one.
  */
  prev(e = !0) {
    return this.move(-1, e);
  }
  /**
  Move the cursor to the innermost node that covers `pos`. If
  `side` is -1, it will enter nodes that end at `pos`. If it is 1,
  it will enter nodes that start at `pos`.
  */
  moveTo(e, n = 0) {
    for (; (this.from == this.to || (n < 1 ? this.from >= e : this.from > e) || (n > -1 ? this.to <= e : this.to < e)) && this.parent(); )
      ;
    for (; this.enterChild(1, e, n); )
      ;
    return this;
  }
  /**
  Get a [syntax node](#common.SyntaxNode) at the cursor's current
  position.
  */
  get node() {
    if (!this.buffer)
      return this._tree;
    let e = this.bufferNode, n = null, i = 0;
    if (e && e.context == this.buffer)
      e: for (let o = this.index, r = this.stack.length; r >= 0; ) {
        for (let a = e; a; a = a._parent)
          if (a.index == o) {
            if (o == this.index)
              return a;
            n = a, i = r + 1;
            break e;
          }
        o = this.stack[--r];
      }
    for (let o = i; o < this.stack.length; o++)
      n = new Tl(this.buffer, n, this.stack[o]);
    return this.bufferNode = new Tl(this.buffer, n, this.index);
  }
  /**
  Get the [tree](#common.Tree) that represents the current node, if
  any. Will return null when the node is in a [tree
  buffer](#common.TreeBuffer).
  */
  get tree() {
    return this.buffer ? null : this._tree._tree;
  }
  /**
  Iterate over the current node and all its descendants, calling
  `enter` when entering a node and `leave`, if given, when leaving
  one. When `enter` returns `false`, any children of that node are
  skipped, and `leave` isn't called for it.
  */
  iterate(e, n) {
    for (let i = 0; ; ) {
      let o = !1;
      if (this.type.isAnonymous || e(this) !== !1) {
        if (this.firstChild()) {
          i++;
          continue;
        }
        this.type.isAnonymous || (o = !0);
      }
      for (; ; ) {
        if (o && n && n(this), o = this.type.isAnonymous, !i)
          return;
        if (this.nextSibling())
          break;
        this.parent(), i--, o = !0;
      }
    }
  }
  /**
  Test whether the current node matches a given context—a sequence
  of direct parent node names. Empty strings in the context array
  are treated as wildcards.
  */
  matchContext(e) {
    if (!this.buffer)
      return ZS(this.node.parent, e);
    let { buffer: n } = this.buffer, { types: i } = n.set;
    for (let o = e.length - 1, r = this.stack.length - 1; o >= 0; r--) {
      if (r < 0)
        return ZS(this._tree, e, o);
      let a = i[n.buffer[this.stack[r]]];
      if (!a.isAnonymous) {
        if (e[o] && e[o] != a.name)
          return !1;
        o--;
      }
    }
    return !0;
  }
}
function yk(t) {
  return t.children.some((e) => e instanceof zu || !e.type.isAnonymous || yk(e));
}
function zxe(t) {
  var e;
  let { buffer: n, nodeSet: i, maxBufferLength: o = D6, reused: r = [], minRepeatType: a = i.types.length } = t, l = Array.isArray(n) ? new vk(n, n.length) : n, s = i.types, u = 0, c = 0;
  function d(C, P, O, E, _, D) {
    let { id: M, start: N, end: L, size: j } = l, B = c, Y = u;
    if (j < 0)
      if (l.next(), j == -1) {
        let q = r[M];
        O.push(q), E.push(N - C);
        return;
      } else if (j == -3) {
        u = M;
        return;
      } else if (j == -4) {
        c = M;
        return;
      } else
        throw new RangeError(`Unrecognized record size: ${j}`);
    let Q = s[M], G, V, H = N - C;
    if (L - N <= o && (V = m(l.pos - P, _))) {
      let q = new Uint16Array(V.size - V.skip), K = l.pos - V.size, ee = q.length;
      for (; l.pos > K; )
        ee = y(V.start, q, ee);
      G = new zu(q, L - V.start, i), H = V.start - C;
    } else {
      let q = l.pos - j;
      l.next();
      let K = [], ee = [], ie = M >= a ? M : -1, ae = 0, te = L;
      for (; l.pos > q; )
        ie >= 0 && l.id == ie && l.size >= 0 ? (l.end <= te - o && (p(K, ee, N, ae, l.end, te, ie, B, Y), ae = K.length, te = l.end), l.next()) : D > 2500 ? f(N, q, K, ee) : d(N, q, K, ee, ie, D + 1);
      if (ie >= 0 && ae > 0 && ae < K.length && p(K, ee, N, ae, N, te, ie, B, Y), K.reverse(), ee.reverse(), ie > -1 && ae > 0) {
        let U = h(Q, Y);
        G = bk(Q, K, ee, 0, K.length, 0, L - N, U, U);
      } else
        G = g(Q, K, ee, L - N, B - L, Y);
    }
    O.push(G), E.push(H);
  }
  function f(C, P, O, E) {
    let _ = [], D = 0, M = -1;
    for (; l.pos > P; ) {
      let { id: N, start: L, end: j, size: B } = l;
      if (B > 4)
        l.next();
      else {
        if (M > -1 && L < M)
          break;
        M < 0 && (M = j - o), _.push(N, L, j), D++, l.next();
      }
    }
    if (D) {
      let N = new Uint16Array(D * 4), L = _[_.length - 2];
      for (let j = _.length - 3, B = 0; j >= 0; j -= 3)
        N[B++] = _[j], N[B++] = _[j + 1] - L, N[B++] = _[j + 2] - L, N[B++] = B;
      O.push(new zu(N, _[2] - L, i)), E.push(L - C);
    }
  }
  function h(C, P) {
    return (O, E, _) => {
      let D = 0, M = O.length - 1, N, L;
      if (M >= 0 && (N = O[M]) instanceof Ui) {
        if (!M && N.type == C && N.length == _)
          return N;
        (L = N.prop(ei.lookAhead)) && (D = E[M] + N.length + L);
      }
      return g(C, O, E, _, D, P);
    };
  }
  function p(C, P, O, E, _, D, M, N, L) {
    let j = [], B = [];
    for (; C.length > E; )
      j.push(C.pop()), B.push(P.pop() + O - _);
    C.push(g(i.types[M], j, B, D - _, N - D, L)), P.push(_ - O);
  }
  function g(C, P, O, E, _, D, M) {
    if (D) {
      let N = [ei.contextHash, D];
      M = M ? [N].concat(M) : [N];
    }
    if (_ > 25) {
      let N = [ei.lookAhead, _];
      M = M ? [N].concat(M) : [N];
    }
    return new Ui(C, P, O, E, M);
  }
  function m(C, P) {
    let O = l.fork(), E = 0, _ = 0, D = 0, M = O.end - o, N = { size: 0, start: 0, skip: 0 };
    e: for (let L = O.pos - C; O.pos > L; ) {
      let j = O.size;
      if (O.id == P && j >= 0) {
        N.size = E, N.start = _, N.skip = D, D += 4, E += 4, O.next();
        continue;
      }
      let B = O.pos - j;
      if (j < 0 || B < L || O.start < M)
        break;
      let Y = O.id >= a ? 4 : 0, Q = O.start;
      for (O.next(); O.pos > B; ) {
        if (O.size < 0)
          if (O.size == -3 || O.size == -4)
            Y += 4;
          else
            break e;
        else O.id >= a && (Y += 4);
        O.next();
      }
      _ = Q, E += j, D += Y;
    }
    return (P < 0 || E == C) && (N.size = E, N.start = _, N.skip = D), N.size > 4 ? N : void 0;
  }
  function y(C, P, O) {
    let { id: E, start: _, end: D, size: M } = l;
    if (l.next(), M >= 0 && E < a) {
      let N = O;
      if (M > 4) {
        let L = l.pos - (M - 4);
        for (; l.pos > L; )
          O = y(C, P, O);
      }
      P[--O] = N, P[--O] = D - C, P[--O] = _ - C, P[--O] = E;
    } else M == -3 ? u = E : M == -4 && (c = E);
    return O;
  }
  let b = [], w = [];
  for (; l.pos > 0; )
    d(t.start || 0, t.bufferStart || 0, b, w, -1, 0);
  let $ = (e = t.length) !== null && e !== void 0 ? e : b.length ? w[0] + b[0].length : 0;
  return new Ui(s[t.topID], b.reverse(), w.reverse(), $);
}
const IM = /* @__PURE__ */ new WeakMap();
function Tv(t, e) {
  if (!t.isAnonymous || e instanceof zu || e.type != t)
    return 1;
  let n = IM.get(e);
  if (n == null) {
    n = 1;
    for (let i of e.children) {
      if (i.type != t || !(i instanceof Ui)) {
        n = 1;
        break;
      }
      n += Tv(t, i);
    }
    IM.set(e, n);
  }
  return n;
}
function bk(t, e, n, i, o, r, a, l, s) {
  let u = 0;
  for (let p = i; p < o; p++)
    u += Tv(t, e[p]);
  let c = Math.ceil(
    u * 1.5 / 8
    /* Balance.BranchFactor */
  ), d = [], f = [];
  function h(p, g, m, y, b) {
    for (let w = m; w < y; ) {
      let $ = w, C = g[w], P = Tv(t, p[w]);
      for (w++; w < y; w++) {
        let O = Tv(t, p[w]);
        if (P + O >= c)
          break;
        P += O;
      }
      if (w == $ + 1) {
        if (P > c) {
          let O = p[$];
          h(O.children, O.positions, 0, O.children.length, g[$] + b);
          continue;
        }
        d.push(p[$]);
      } else {
        let O = g[w - 1] + p[w - 1].length - C;
        d.push(bk(t, p, g, $, w, C, O, null, s));
      }
      f.push(C + b - r);
    }
  }
  return h(e, n, i, o, 0), (l || s)(d, f, a);
}
class Bxe {
  constructor() {
    this.map = /* @__PURE__ */ new WeakMap();
  }
  setBuffer(e, n, i) {
    let o = this.map.get(e);
    o || this.map.set(e, o = /* @__PURE__ */ new Map()), o.set(n, i);
  }
  getBuffer(e, n) {
    let i = this.map.get(e);
    return i && i.get(n);
  }
  /**
  Set the value for this syntax node.
  */
  set(e, n) {
    e instanceof Tl ? this.setBuffer(e.context.buffer, e.index, n) : e instanceof xr && this.map.set(e.tree, n);
  }
  /**
  Retrieve value for this syntax node, if it exists in the map.
  */
  get(e) {
    return e instanceof Tl ? this.getBuffer(e.context.buffer, e.index) : e instanceof xr ? this.map.get(e.tree) : void 0;
  }
  /**
  Set the value for the node that a cursor currently points to.
  */
  cursorSet(e, n) {
    e.buffer ? this.setBuffer(e.buffer.buffer, e.index, n) : this.map.set(e.tree, n);
  }
  /**
  Retrieve the value for the node that a cursor currently points
  to.
  */
  cursorGet(e) {
    return e.buffer ? this.getBuffer(e.buffer.buffer, e.index) : this.map.get(e.tree);
  }
}
class zc {
  /**
  Construct a tree fragment. You'll usually want to use
  [`addTree`](#common.TreeFragment^addTree) and
  [`applyChanges`](#common.TreeFragment^applyChanges) instead of
  calling this directly.
  */
  constructor(e, n, i, o, r = !1, a = !1) {
    this.from = e, this.to = n, this.tree = i, this.offset = o, this.open = (r ? 1 : 0) | (a ? 2 : 0);
  }
  /**
  Whether the start of the fragment represents the start of a
  parse, or the end of a change. (In the second case, it may not
  be safe to reuse some nodes at the start, depending on the
  parsing algorithm.)
  */
  get openStart() {
    return (this.open & 1) > 0;
  }
  /**
  Whether the end of the fragment represents the end of a
  full-document parse, or the start of a change.
  */
  get openEnd() {
    return (this.open & 2) > 0;
  }
  /**
  Create a set of fragments from a freshly parsed tree, or update
  an existing set of fragments by replacing the ones that overlap
  with a tree with content from the new tree. When `partial` is
  true, the parse is treated as incomplete, and the resulting
  fragment has [`openEnd`](#common.TreeFragment.openEnd) set to
  true.
  */
  static addTree(e, n = [], i = !1) {
    let o = [new zc(0, e.length, e, 0, !1, i)];
    for (let r of n)
      r.to > e.length && o.push(r);
    return o;
  }
  /**
  Apply a set of edits to an array of fragments, removing or
  splitting fragments as necessary to remove edited ranges, and
  adjusting offsets for fragments that moved.
  */
  static applyChanges(e, n, i = 128) {
    if (!n.length)
      return e;
    let o = [], r = 1, a = e.length ? e[0] : null;
    for (let l = 0, s = 0, u = 0; ; l++) {
      let c = l < n.length ? n[l] : null, d = c ? c.fromA : 1e9;
      if (d - s >= i)
        for (; a && a.from < d; ) {
          let f = a;
          if (s >= f.from || d <= f.to || u) {
            let h = Math.max(f.from, s) - u, p = Math.min(f.to, d) - u;
            f = h >= p ? null : new zc(h, p, f.tree, f.offset + u, l > 0, !!c);
          }
          if (f && o.push(f), a.to > d)
            break;
          a = r < e.length ? e[r++] : null;
        }
      if (!c)
        break;
      s = c.toA, u = c.toA - c.toB;
    }
    return o;
  }
}
class B6 {
  /**
  Start a parse, returning a [partial parse](#common.PartialParse)
  object. [`fragments`](#common.TreeFragment) can be passed in to
  make the parse incremental.
  
  By default, the entire input is parsed. You can pass `ranges`,
  which should be a sorted array of non-empty, non-overlapping
  ranges, to parse only those ranges. The tree returned in that
  case will start at `ranges[0].from`.
  */
  startParse(e, n, i) {
    return typeof e == "string" && (e = new Fxe(e)), i = i ? i.length ? i.map((o) => new ix(o.from, o.to)) : [new ix(0, 0)] : [new ix(0, e.length)], this.createParse(e, n || [], i);
  }
  /**
  Run a full parse, returning the resulting tree.
  */
  parse(e, n, i) {
    let o = this.startParse(e, n, i);
    for (; ; ) {
      let r = o.advance();
      if (r)
        return r;
    }
  }
}
class Fxe {
  constructor(e) {
    this.string = e;
  }
  get length() {
    return this.string.length;
  }
  chunk(e) {
    return this.string.slice(e);
  }
  get lineChunks() {
    return !1;
  }
  read(e, n) {
    return this.string.slice(e, n);
  }
}
new ei({ perNode: !0 });
let Vxe = 0;
class ra {
  /**
  @internal
  */
  constructor(e, n, i, o) {
    this.name = e, this.set = n, this.base = i, this.modified = o, this.id = Vxe++;
  }
  toString() {
    let { name: e } = this;
    for (let n of this.modified)
      n.name && (e = `${n.name}(${e})`);
    return e;
  }
  static define(e, n) {
    let i = typeof e == "string" ? e : "?";
    if (e instanceof ra && (n = e), n?.base)
      throw new Error("Can not derive from a modified tag");
    let o = new ra(i, [], null, []);
    if (o.set.push(o), n)
      for (let r of n.set)
        o.set.push(r);
    return o;
  }
  /**
  Define a tag _modifier_, which is a function that, given a tag,
  will return a tag that is a subtag of the original. Applying the
  same modifier to a twice tag will return the same value (`m1(t1)
  == m1(t1)`) and applying multiple modifiers will, regardless or
  order, produce the same tag (`m1(m2(t1)) == m2(m1(t1))`).
  
  When multiple modifiers are applied to a given base tag, each
  smaller set of modifiers is registered as a parent, so that for
  example `m1(m2(m3(t1)))` is a subtype of `m1(m2(t1))`,
  `m1(m3(t1)`, and so on.
  */
  static defineModifier(e) {
    let n = new S0(e);
    return (i) => i.modified.indexOf(n) > -1 ? i : S0.get(i.base || i, i.modified.concat(n).sort((o, r) => o.id - r.id));
  }
}
let Qxe = 0;
class S0 {
  constructor(e) {
    this.name = e, this.instances = [], this.id = Qxe++;
  }
  static get(e, n) {
    if (!n.length)
      return e;
    let i = n[0].instances.find((l) => l.base == e && Hxe(n, l.modified));
    if (i)
      return i;
    let o = [], r = new ra(e.name, o, e, n);
    for (let l of n)
      l.instances.push(r);
    let a = Wxe(n);
    for (let l of e.set)
      if (!l.modified.length)
        for (let s of a)
          o.push(S0.get(l, s));
    return r;
  }
}
function Hxe(t, e) {
  return t.length == e.length && t.every((n, i) => n == e[i]);
}
function Wxe(t) {
  let e = [[]];
  for (let n = 0; n < t.length; n++)
    for (let i = 0, o = e.length; i < o; i++)
      e.push(e[i].concat(t[n]));
  return e.sort((n, i) => i.length - n.length);
}
function F6(t) {
  let e = /* @__PURE__ */ Object.create(null);
  for (let n in t) {
    let i = t[n];
    Array.isArray(i) || (i = [i]);
    for (let o of n.split(" "))
      if (o) {
        let r = [], a = 2, l = o;
        for (let d = 0; ; ) {
          if (l == "..." && d > 0 && d + 3 == o.length) {
            a = 1;
            break;
          }
          let f = /^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);
          if (!f)
            throw new RangeError("Invalid path: " + o);
          if (r.push(f[0] == "*" ? "" : f[0][0] == '"' ? JSON.parse(f[0]) : f[0]), d += f[0].length, d == o.length)
            break;
          let h = o[d++];
          if (d == o.length && h == "!") {
            a = 0;
            break;
          }
          if (h != "/")
            throw new RangeError("Invalid path: " + o);
          l = o.slice(d);
        }
        let s = r.length - 1, u = r[s];
        if (!u)
          throw new RangeError("Invalid path: " + o);
        let c = new eg(i, a, s > 0 ? r.slice(0, s) : null);
        e[u] = c.sort(e[u]);
      }
  }
  return V6.add(e);
}
const V6 = new ei({
  combine(t, e) {
    let n, i, o;
    for (; t || e; ) {
      if (!t || e && t.depth >= e.depth ? (o = e, e = e.next) : (o = t, t = t.next), n && n.mode == o.mode && !o.context && !n.context)
        continue;
      let r = new eg(o.tags, o.mode, o.context);
      n ? n.next = r : i = r, n = r;
    }
    return i;
  }
});
class eg {
  constructor(e, n, i, o) {
    this.tags = e, this.mode = n, this.context = i, this.next = o;
  }
  get opaque() {
    return this.mode == 0;
  }
  get inherit() {
    return this.mode == 1;
  }
  sort(e) {
    return !e || e.depth < this.depth ? (this.next = e, this) : (e.next = this.sort(e.next), e);
  }
  get depth() {
    return this.context ? this.context.length : 0;
  }
}
eg.empty = new eg([], 2, null);
function Q6(t, e) {
  let n = /* @__PURE__ */ Object.create(null);
  for (let r of t)
    if (!Array.isArray(r.tag))
      n[r.tag.id] = r.class;
    else
      for (let a of r.tag)
        n[a.id] = r.class;
  let { scope: i, all: o = null } = e || {};
  return {
    style: (r) => {
      let a = o;
      for (let l of r)
        for (let s of l.set) {
          let u = n[s.id];
          if (u) {
            a = a ? a + " " + u : u;
            break;
          }
        }
      return a;
    },
    scope: i
  };
}
function jxe(t, e) {
  let n = null;
  for (let i of t) {
    let o = i.style(e);
    o && (n = n ? n + " " + o : o);
  }
  return n;
}
function qxe(t, e, n, i = 0, o = t.length) {
  let r = new Yxe(i, Array.isArray(e) ? e : [e], n);
  r.highlightRange(t.cursor(), i, o, "", r.highlighters), r.flush(o);
}
class Yxe {
  constructor(e, n, i) {
    this.at = e, this.highlighters = n, this.span = i, this.class = "";
  }
  startSpan(e, n) {
    n != this.class && (this.flush(e), e > this.at && (this.at = e), this.class = n);
  }
  flush(e) {
    e > this.at && this.class && this.span(this.at, e, this.class);
  }
  highlightRange(e, n, i, o, r) {
    let { type: a, from: l, to: s } = e;
    if (l >= i || s <= n)
      return;
    a.isTop && (r = this.highlighters.filter((h) => !h.scope || h.scope(a)));
    let u = o, c = Kxe(e) || eg.empty, d = jxe(r, c.tags);
    if (d && (u && (u += " "), u += d, c.mode == 1 && (o += (o ? " " : "") + d)), this.startSpan(Math.max(n, l), u), c.opaque)
      return;
    let f = e.tree && e.tree.prop(ei.mounted);
    if (f && f.overlay) {
      let h = e.node.enter(f.overlay[0].from + l, 1), p = this.highlighters.filter((m) => !m.scope || m.scope(f.tree.type)), g = e.firstChild();
      for (let m = 0, y = l; ; m++) {
        let b = m < f.overlay.length ? f.overlay[m] : null, w = b ? b.from + l : s, $ = Math.max(n, y), C = Math.min(i, w);
        if ($ < C && g)
          for (; e.from < C && (this.highlightRange(e, $, C, o, r), this.startSpan(Math.min(C, e.to), u), !(e.to >= w || !e.nextSibling())); )
            ;
        if (!b || w > i)
          break;
        y = b.to + l, y > n && (this.highlightRange(h.cursor(), Math.max(n, b.from + l), Math.min(i, y), "", p), this.startSpan(Math.min(i, y), u));
      }
      g && e.parent();
    } else if (e.firstChild()) {
      f && (o = "");
      do
        if (!(e.to <= n)) {
          if (e.from >= i)
            break;
          this.highlightRange(e, n, i, o, r), this.startSpan(Math.min(i, e.to), u);
        }
      while (e.nextSibling());
      e.parent();
    }
  }
}
function Kxe(t) {
  let e = t.type.prop(V6);
  for (; e && e.context && !t.matchContext(e.context); )
    e = e.next;
  return e || null;
}
const Ot = ra.define, Hm = Ot(), cu = Ot(), MM = Ot(cu), AM = Ot(cu), du = Ot(), Wm = Ot(du), ox = Ot(du), fl = Ot(), lc = Ot(fl), sl = Ot(), ul = Ot(), US = Ot(), Lh = Ot(US), jm = Ot(), Ge = {
  /**
  A comment.
  */
  comment: Hm,
  /**
  A line [comment](#highlight.tags.comment).
  */
  lineComment: Ot(Hm),
  /**
  A block [comment](#highlight.tags.comment).
  */
  blockComment: Ot(Hm),
  /**
  A documentation [comment](#highlight.tags.comment).
  */
  docComment: Ot(Hm),
  /**
  Any kind of identifier.
  */
  name: cu,
  /**
  The [name](#highlight.tags.name) of a variable.
  */
  variableName: Ot(cu),
  /**
  A type [name](#highlight.tags.name).
  */
  typeName: MM,
  /**
  A tag name (subtag of [`typeName`](#highlight.tags.typeName)).
  */
  tagName: Ot(MM),
  /**
  A property or field [name](#highlight.tags.name).
  */
  propertyName: AM,
  /**
  An attribute name (subtag of [`propertyName`](#highlight.tags.propertyName)).
  */
  attributeName: Ot(AM),
  /**
  The [name](#highlight.tags.name) of a class.
  */
  className: Ot(cu),
  /**
  A label [name](#highlight.tags.name).
  */
  labelName: Ot(cu),
  /**
  A namespace [name](#highlight.tags.name).
  */
  namespace: Ot(cu),
  /**
  The [name](#highlight.tags.name) of a macro.
  */
  macroName: Ot(cu),
  /**
  A literal value.
  */
  literal: du,
  /**
  A string [literal](#highlight.tags.literal).
  */
  string: Wm,
  /**
  A documentation [string](#highlight.tags.string).
  */
  docString: Ot(Wm),
  /**
  A character literal (subtag of [string](#highlight.tags.string)).
  */
  character: Ot(Wm),
  /**
  An attribute value (subtag of [string](#highlight.tags.string)).
  */
  attributeValue: Ot(Wm),
  /**
  A number [literal](#highlight.tags.literal).
  */
  number: ox,
  /**
  An integer [number](#highlight.tags.number) literal.
  */
  integer: Ot(ox),
  /**
  A floating-point [number](#highlight.tags.number) literal.
  */
  float: Ot(ox),
  /**
  A boolean [literal](#highlight.tags.literal).
  */
  bool: Ot(du),
  /**
  Regular expression [literal](#highlight.tags.literal).
  */
  regexp: Ot(du),
  /**
  An escape [literal](#highlight.tags.literal), for example a
  backslash escape in a string.
  */
  escape: Ot(du),
  /**
  A color [literal](#highlight.tags.literal).
  */
  color: Ot(du),
  /**
  A URL [literal](#highlight.tags.literal).
  */
  url: Ot(du),
  /**
  A language keyword.
  */
  keyword: sl,
  /**
  The [keyword](#highlight.tags.keyword) for the self or this
  object.
  */
  self: Ot(sl),
  /**
  The [keyword](#highlight.tags.keyword) for null.
  */
  null: Ot(sl),
  /**
  A [keyword](#highlight.tags.keyword) denoting some atomic value.
  */
  atom: Ot(sl),
  /**
  A [keyword](#highlight.tags.keyword) that represents a unit.
  */
  unit: Ot(sl),
  /**
  A modifier [keyword](#highlight.tags.keyword).
  */
  modifier: Ot(sl),
  /**
  A [keyword](#highlight.tags.keyword) that acts as an operator.
  */
  operatorKeyword: Ot(sl),
  /**
  A control-flow related [keyword](#highlight.tags.keyword).
  */
  controlKeyword: Ot(sl),
  /**
  A [keyword](#highlight.tags.keyword) that defines something.
  */
  definitionKeyword: Ot(sl),
  /**
  A [keyword](#highlight.tags.keyword) related to defining or
  interfacing with modules.
  */
  moduleKeyword: Ot(sl),
  /**
  An operator.
  */
  operator: ul,
  /**
  An [operator](#highlight.tags.operator) that dereferences something.
  */
  derefOperator: Ot(ul),
  /**
  Arithmetic-related [operator](#highlight.tags.operator).
  */
  arithmeticOperator: Ot(ul),
  /**
  Logical [operator](#highlight.tags.operator).
  */
  logicOperator: Ot(ul),
  /**
  Bit [operator](#highlight.tags.operator).
  */
  bitwiseOperator: Ot(ul),
  /**
  Comparison [operator](#highlight.tags.operator).
  */
  compareOperator: Ot(ul),
  /**
  [Operator](#highlight.tags.operator) that updates its operand.
  */
  updateOperator: Ot(ul),
  /**
  [Operator](#highlight.tags.operator) that defines something.
  */
  definitionOperator: Ot(ul),
  /**
  Type-related [operator](#highlight.tags.operator).
  */
  typeOperator: Ot(ul),
  /**
  Control-flow [operator](#highlight.tags.operator).
  */
  controlOperator: Ot(ul),
  /**
  Program or markup punctuation.
  */
  punctuation: US,
  /**
  [Punctuation](#highlight.tags.punctuation) that separates
  things.
  */
  separator: Ot(US),
  /**
  Bracket-style [punctuation](#highlight.tags.punctuation).
  */
  bracket: Lh,
  /**
  Angle [brackets](#highlight.tags.bracket) (usually `<` and `>`
  tokens).
  */
  angleBracket: Ot(Lh),
  /**
  Square [brackets](#highlight.tags.bracket) (usually `[` and `]`
  tokens).
  */
  squareBracket: Ot(Lh),
  /**
  Parentheses (usually `(` and `)` tokens). Subtag of
  [bracket](#highlight.tags.bracket).
  */
  paren: Ot(Lh),
  /**
  Braces (usually `{` and `}` tokens). Subtag of
  [bracket](#highlight.tags.bracket).
  */
  brace: Ot(Lh),
  /**
  Content, for example plain text in XML or markup documents.
  */
  content: fl,
  /**
  [Content](#highlight.tags.content) that represents a heading.
  */
  heading: lc,
  /**
  A level 1 [heading](#highlight.tags.heading).
  */
  heading1: Ot(lc),
  /**
  A level 2 [heading](#highlight.tags.heading).
  */
  heading2: Ot(lc),
  /**
  A level 3 [heading](#highlight.tags.heading).
  */
  heading3: Ot(lc),
  /**
  A level 4 [heading](#highlight.tags.heading).
  */
  heading4: Ot(lc),
  /**
  A level 5 [heading](#highlight.tags.heading).
  */
  heading5: Ot(lc),
  /**
  A level 6 [heading](#highlight.tags.heading).
  */
  heading6: Ot(lc),
  /**
  A prose [content](#highlight.tags.content) separator (such as a horizontal rule).
  */
  contentSeparator: Ot(fl),
  /**
  [Content](#highlight.tags.content) that represents a list.
  */
  list: Ot(fl),
  /**
  [Content](#highlight.tags.content) that represents a quote.
  */
  quote: Ot(fl),
  /**
  [Content](#highlight.tags.content) that is emphasized.
  */
  emphasis: Ot(fl),
  /**
  [Content](#highlight.tags.content) that is styled strong.
  */
  strong: Ot(fl),
  /**
  [Content](#highlight.tags.content) that is part of a link.
  */
  link: Ot(fl),
  /**
  [Content](#highlight.tags.content) that is styled as code or
  monospace.
  */
  monospace: Ot(fl),
  /**
  [Content](#highlight.tags.content) that has a strike-through
  style.
  */
  strikethrough: Ot(fl),
  /**
  Inserted text in a change-tracking format.
  */
  inserted: Ot(),
  /**
  Deleted text.
  */
  deleted: Ot(),
  /**
  Changed text.
  */
  changed: Ot(),
  /**
  An invalid or unsyntactic element.
  */
  invalid: Ot(),
  /**
  Metadata or meta-instruction.
  */
  meta: jm,
  /**
  [Metadata](#highlight.tags.meta) that applies to the entire
  document.
  */
  documentMeta: Ot(jm),
  /**
  [Metadata](#highlight.tags.meta) that annotates or adds
  attributes to a given syntactic element.
  */
  annotation: Ot(jm),
  /**
  Processing instruction or preprocessor directive. Subtag of
  [meta](#highlight.tags.meta).
  */
  processingInstruction: Ot(jm),
  /**
  [Modifier](#highlight.Tag^defineModifier) that indicates that a
  given element is being defined. Expected to be used with the
  various [name](#highlight.tags.name) tags.
  */
  definition: ra.defineModifier("definition"),
  /**
  [Modifier](#highlight.Tag^defineModifier) that indicates that
  something is constant. Mostly expected to be used with
  [variable names](#highlight.tags.variableName).
  */
  constant: ra.defineModifier("constant"),
  /**
  [Modifier](#highlight.Tag^defineModifier) used to indicate that
  a [variable](#highlight.tags.variableName) or [property
  name](#highlight.tags.propertyName) is being called or defined
  as a function.
  */
  function: ra.defineModifier("function"),
  /**
  [Modifier](#highlight.Tag^defineModifier) that can be applied to
  [names](#highlight.tags.name) to indicate that they belong to
  the language's standard environment.
  */
  standard: ra.defineModifier("standard"),
  /**
  [Modifier](#highlight.Tag^defineModifier) that indicates a given
  [names](#highlight.tags.name) is local to some scope.
  */
  local: ra.defineModifier("local"),
  /**
  A generic variant [modifier](#highlight.Tag^defineModifier) that
  can be used to tag language-specific alternative variants of
  some common tag. It is recommended for themes to define special
  forms of at least the [string](#highlight.tags.string) and
  [variable name](#highlight.tags.variableName) tags, since those
  come up a lot.
  */
  special: ra.defineModifier("special")
};
for (let t in Ge) {
  let e = Ge[t];
  e instanceof ra && (e.name = t);
}
Q6([
  { tag: Ge.link, class: "tok-link" },
  { tag: Ge.heading, class: "tok-heading" },
  { tag: Ge.emphasis, class: "tok-emphasis" },
  { tag: Ge.strong, class: "tok-strong" },
  { tag: Ge.keyword, class: "tok-keyword" },
  { tag: Ge.atom, class: "tok-atom" },
  { tag: Ge.bool, class: "tok-bool" },
  { tag: Ge.url, class: "tok-url" },
  { tag: Ge.labelName, class: "tok-labelName" },
  { tag: Ge.inserted, class: "tok-inserted" },
  { tag: Ge.deleted, class: "tok-deleted" },
  { tag: Ge.literal, class: "tok-literal" },
  { tag: Ge.string, class: "tok-string" },
  { tag: Ge.number, class: "tok-number" },
  { tag: [Ge.regexp, Ge.escape, Ge.special(Ge.string)], class: "tok-string2" },
  { tag: Ge.variableName, class: "tok-variableName" },
  { tag: Ge.local(Ge.variableName), class: "tok-variableName tok-local" },
  { tag: Ge.definition(Ge.variableName), class: "tok-variableName tok-definition" },
  { tag: Ge.special(Ge.variableName), class: "tok-variableName2" },
  { tag: Ge.definition(Ge.propertyName), class: "tok-propertyName tok-definition" },
  { tag: Ge.typeName, class: "tok-typeName" },
  { tag: Ge.namespace, class: "tok-namespace" },
  { tag: Ge.className, class: "tok-className" },
  { tag: Ge.macroName, class: "tok-macroName" },
  { tag: Ge.propertyName, class: "tok-propertyName" },
  { tag: Ge.operator, class: "tok-operator" },
  { tag: Ge.comment, class: "tok-comment" },
  { tag: Ge.meta, class: "tok-meta" },
  { tag: Ge.invalid, class: "tok-invalid" },
  { tag: Ge.punctuation, class: "tok-punctuation" }
]);
var rx;
const Ud = /* @__PURE__ */ new ei();
function H6(t) {
  return an.define({
    combine: t ? (e) => e.concat(t) : void 0
  });
}
const xk = /* @__PURE__ */ new ei();
class za {
  /**
  Construct a language object. If you need to invoke this
  directly, first define a data facet with
  [`defineLanguageFacet`](https://codemirror.net/6/docs/ref/#language.defineLanguageFacet), and then
  configure your parser to [attach](https://codemirror.net/6/docs/ref/#language.languageDataProp) it
  to the language's outer syntax node.
  */
  constructor(e, n, i = [], o = "") {
    this.data = e, this.name = o, ni.prototype.hasOwnProperty("tree") || Object.defineProperty(ni.prototype, "tree", { get() {
      return Rs(this);
    } }), this.parser = n, this.extension = [
      Zf.of(this),
      ni.languageData.of((r, a, l) => {
        let s = RM(r, a, l), u = s.type.prop(Ud);
        if (!u)
          return [];
        let c = r.facet(u), d = s.type.prop(xk);
        if (d) {
          let f = s.resolve(a - s.from, l);
          for (let h of d)
            if (h.test(f, r)) {
              let p = r.facet(h.facet);
              return h.type == "replace" ? p : p.concat(c);
            }
        }
        return c;
      })
    ].concat(i);
  }
  /**
  Query whether this language is active at the given position.
  */
  isActiveAt(e, n, i = -1) {
    return RM(e, n, i).type.prop(Ud) == this.data;
  }
  /**
  Find the document regions that were parsed using this language.
  The returned regions will _include_ any nested languages rooted
  in this language, when those exist.
  */
  findRegions(e) {
    let n = e.facet(Zf);
    if (n?.data == this.data)
      return [{ from: 0, to: e.doc.length }];
    if (!n || !n.allowsNesting)
      return [];
    let i = [], o = (r, a) => {
      if (r.prop(Ud) == this.data) {
        i.push({ from: a, to: a + r.length });
        return;
      }
      let l = r.prop(ei.mounted);
      if (l) {
        if (l.tree.prop(Ud) == this.data) {
          if (l.overlay)
            for (let s of l.overlay)
              i.push({ from: s.from + a, to: s.to + a });
          else
            i.push({ from: a, to: a + r.length });
          return;
        } else if (l.overlay) {
          let s = i.length;
          if (o(l.tree, l.overlay[0].from + a), i.length > s)
            return;
        }
      }
      for (let s = 0; s < r.children.length; s++) {
        let u = r.children[s];
        u instanceof Ui && o(u, r.positions[s] + a);
      }
    };
    return o(Rs(e), 0), i;
  }
  /**
  Indicates whether this language allows nested languages. The
  default implementation returns true.
  */
  get allowsNesting() {
    return !0;
  }
}
za.setState = /* @__PURE__ */ xi.define();
function RM(t, e, n) {
  let i = t.facet(Zf), o = Rs(t).topNode;
  if (!i || i.allowsNesting)
    for (let r = o; r; r = r.enter(e, n, Li.ExcludeBuffers | Li.EnterBracketed))
      r.type.isTop && (o = r);
  return o;
}
class w0 extends za {
  constructor(e, n, i) {
    super(e, n, [], i), this.parser = n;
  }
  /**
  Define a language from a parser.
  */
  static define(e) {
    let n = H6(e.languageData);
    return new w0(n, e.parser.configure({
      props: [Ud.add((i) => i.isTop ? n : void 0)]
    }), e.name);
  }
  /**
  Create a new instance of this language with a reconfigured
  version of its parser and optionally a new name.
  */
  configure(e, n) {
    return new w0(this.data, this.parser.configure(e), n || this.name);
  }
  get allowsNesting() {
    return this.parser.hasWrappers();
  }
}
function Rs(t) {
  let e = t.field(za.state, !1);
  return e ? e.tree : Ui.empty;
}
class Xxe {
  /**
  Create an input object for the given document.
  */
  constructor(e) {
    this.doc = e, this.cursorPos = 0, this.string = "", this.cursor = e.iter();
  }
  get length() {
    return this.doc.length;
  }
  syncTo(e) {
    return this.string = this.cursor.next(e - this.cursorPos).value, this.cursorPos = e + this.string.length, this.cursorPos - this.string.length;
  }
  chunk(e) {
    return this.syncTo(e), this.string;
  }
  get lineChunks() {
    return !0;
  }
  read(e, n) {
    let i = this.cursorPos - this.string.length;
    return e < i || n >= this.cursorPos ? this.doc.sliceString(e, n) : this.string.slice(e - i, n - i);
  }
}
let zh = null;
class C0 {
  constructor(e, n, i = [], o, r, a, l, s) {
    this.parser = e, this.state = n, this.fragments = i, this.tree = o, this.treeLen = r, this.viewport = a, this.skipped = l, this.scheduleOn = s, this.parse = null, this.tempSkipped = [];
  }
  /**
  @internal
  */
  static create(e, n, i) {
    return new C0(e, n, [], Ui.empty, 0, i, [], null);
  }
  startParse() {
    return this.parser.startParse(new Xxe(this.state.doc), this.fragments);
  }
  /**
  @internal
  */
  work(e, n) {
    return n != null && n >= this.state.doc.length && (n = void 0), this.tree != Ui.empty && this.isDone(n ?? this.state.doc.length) ? (this.takeTree(), !0) : this.withContext(() => {
      var i;
      if (typeof e == "number") {
        let o = Date.now() + e;
        e = () => Date.now() > o;
      }
      for (this.parse || (this.parse = this.startParse()), n != null && (this.parse.stoppedAt == null || this.parse.stoppedAt > n) && n < this.state.doc.length && this.parse.stopAt(n); ; ) {
        let o = this.parse.advance();
        if (o)
          if (this.fragments = this.withoutTempSkipped(zc.addTree(o, this.fragments, this.parse.stoppedAt != null)), this.treeLen = (i = this.parse.stoppedAt) !== null && i !== void 0 ? i : this.state.doc.length, this.tree = o, this.parse = null, this.treeLen < (n ?? this.state.doc.length))
            this.parse = this.startParse();
          else
            return !0;
        if (e())
          return !1;
      }
    });
  }
  /**
  @internal
  */
  takeTree() {
    let e, n;
    this.parse && (e = this.parse.parsedPos) >= this.treeLen && ((this.parse.stoppedAt == null || this.parse.stoppedAt > e) && this.parse.stopAt(e), this.withContext(() => {
      for (; !(n = this.parse.advance()); )
        ;
    }), this.treeLen = e, this.tree = n, this.fragments = this.withoutTempSkipped(zc.addTree(this.tree, this.fragments, !0)), this.parse = null);
  }
  withContext(e) {
    let n = zh;
    zh = this;
    try {
      return e();
    } finally {
      zh = n;
    }
  }
  withoutTempSkipped(e) {
    for (let n; n = this.tempSkipped.pop(); )
      e = DM(e, n.from, n.to);
    return e;
  }
  /**
  @internal
  */
  changes(e, n) {
    let { fragments: i, tree: o, treeLen: r, viewport: a, skipped: l } = this;
    if (this.takeTree(), !e.empty) {
      let s = [];
      if (e.iterChangedRanges((u, c, d, f) => s.push({ fromA: u, toA: c, fromB: d, toB: f })), i = zc.applyChanges(i, s), o = Ui.empty, r = 0, a = { from: e.mapPos(a.from, -1), to: e.mapPos(a.to, 1) }, this.skipped.length) {
        l = [];
        for (let u of this.skipped) {
          let c = e.mapPos(u.from, 1), d = e.mapPos(u.to, -1);
          c < d && l.push({ from: c, to: d });
        }
      }
    }
    return new C0(this.parser, n, i, o, r, a, l, this.scheduleOn);
  }
  /**
  @internal
  */
  updateViewport(e) {
    if (this.viewport.from == e.from && this.viewport.to == e.to)
      return !1;
    this.viewport = e;
    let n = this.skipped.length;
    for (let i = 0; i < this.skipped.length; i++) {
      let { from: o, to: r } = this.skipped[i];
      o < e.to && r > e.from && (this.fragments = DM(this.fragments, o, r), this.skipped.splice(i--, 1));
    }
    return this.skipped.length >= n ? !1 : (this.reset(), !0);
  }
  /**
  @internal
  */
  reset() {
    this.parse && (this.takeTree(), this.parse = null);
  }
  /**
  Notify the parse scheduler that the given region was skipped
  because it wasn't in view, and the parse should be restarted
  when it comes into view.
  */
  skipUntilInView(e, n) {
    this.skipped.push({ from: e, to: n });
  }
  /**
  Returns a parser intended to be used as placeholder when
  asynchronously loading a nested parser. It'll skip its input and
  mark it as not-really-parsed, so that the next update will parse
  it again.
  
  When `until` is given, a reparse will be scheduled when that
  promise resolves.
  */
  static getSkippingParser(e) {
    return new class extends B6 {
      createParse(n, i, o) {
        let r = o[0].from, a = o[o.length - 1].to;
        return {
          parsedPos: r,
          advance() {
            let s = zh;
            if (s) {
              for (let u of o)
                s.tempSkipped.push(u);
              e && (s.scheduleOn = s.scheduleOn ? Promise.all([s.scheduleOn, e]) : e);
            }
            return this.parsedPos = a, new Ui(Sr.none, [], [], a - r);
          },
          stoppedAt: null,
          stopAt() {
          }
        };
      }
    }();
  }
  /**
  @internal
  */
  isDone(e) {
    e = Math.min(e, this.state.doc.length);
    let n = this.fragments;
    return this.treeLen >= e && n.length && n[0].from == 0 && n[0].to >= e;
  }
  /**
  Get the context for the current parse, or `null` if no editor
  parse is in progress.
  */
  static get() {
    return zh;
  }
}
function DM(t, e, n) {
  return zc.applyChanges(t, [{ fromA: e, toA: n, fromB: e, toB: n }]);
}
class Xf {
  constructor(e) {
    this.context = e, this.tree = e.tree;
  }
  apply(e) {
    if (!e.docChanged && this.tree == this.context.tree)
      return this;
    let n = this.context.changes(e.changes, e.state), i = this.context.treeLen == e.startState.doc.length ? void 0 : Math.max(e.changes.mapPos(this.context.treeLen), n.viewport.to);
    return n.work(20, i) || n.takeTree(), new Xf(n);
  }
  static init(e) {
    let n = Math.min(3e3, e.doc.length), i = C0.create(e.facet(Zf).parser, e, { from: 0, to: n });
    return i.work(20, n) || i.takeTree(), new Xf(i);
  }
}
za.state = /* @__PURE__ */ Fs.define({
  create: Xf.init,
  update(t, e) {
    for (let n of e.effects)
      if (n.is(za.setState))
        return n.value;
    return e.startState.facet(Zf) != e.state.facet(Zf) ? Xf.init(e.state) : t.apply(e);
  }
});
let W6 = (t) => {
  let e = setTimeout(
    () => t(),
    500
    /* Work.MaxPause */
  );
  return () => clearTimeout(e);
};
typeof requestIdleCallback < "u" && (W6 = (t) => {
  let e = -1, n = setTimeout(
    () => {
      e = requestIdleCallback(t, {
        timeout: 400
        /* Work.MinPause */
      });
    },
    100
    /* Work.MinPause */
  );
  return () => e < 0 ? clearTimeout(n) : cancelIdleCallback(e);
});
const ax = typeof navigator < "u" && (!((rx = navigator.scheduling) === null || rx === void 0) && rx.isInputPending) ? () => navigator.scheduling.isInputPending() : null, Zxe = /* @__PURE__ */ ga.fromClass(class {
  constructor(e) {
    this.view = e, this.working = null, this.workScheduled = 0, this.chunkEnd = -1, this.chunkBudget = -1, this.work = this.work.bind(this), this.scheduleWork();
  }
  update(e) {
    let n = this.view.state.field(za.state).context;
    (n.updateViewport(e.view.viewport) || this.view.viewport.to > n.treeLen) && this.scheduleWork(), (e.docChanged || e.selectionSet) && (this.view.hasFocus && (this.chunkBudget += 50), this.scheduleWork()), this.checkAsyncSchedule(n);
  }
  scheduleWork() {
    if (this.working)
      return;
    let { state: e } = this.view, n = e.field(za.state);
    (n.tree != n.context.tree || !n.context.isDone(e.doc.length)) && (this.working = W6(this.work));
  }
  work(e) {
    this.working = null;
    let n = Date.now();
    if (this.chunkEnd < n && (this.chunkEnd < 0 || this.view.hasFocus) && (this.chunkEnd = n + 3e4, this.chunkBudget = 3e3), this.chunkBudget <= 0)
      return;
    let { state: i, viewport: { to: o } } = this.view, r = i.field(za.state);
    if (r.tree == r.context.tree && r.context.isDone(
      o + 1e5
      /* Work.MaxParseAhead */
    ))
      return;
    let a = Date.now() + Math.min(this.chunkBudget, 100, e && !ax ? Math.max(25, e.timeRemaining() - 5) : 1e9), l = r.context.treeLen < o && i.doc.length > o + 1e3, s = r.context.work(() => ax && ax() || Date.now() > a, o + (l ? 0 : 1e5));
    this.chunkBudget -= Date.now() - n, (s || this.chunkBudget <= 0) && (r.context.takeTree(), this.view.dispatch({ effects: za.setState.of(new Xf(r.context)) })), this.chunkBudget > 0 && !(s && !l) && this.scheduleWork(), this.checkAsyncSchedule(r.context);
  }
  checkAsyncSchedule(e) {
    e.scheduleOn && (this.workScheduled++, e.scheduleOn.then(() => this.scheduleWork()).catch((n) => Rr(this.view.state, n)).then(() => this.workScheduled--), e.scheduleOn = null);
  }
  destroy() {
    this.working && this.working();
  }
  isWorking() {
    return !!(this.working || this.workScheduled > 0);
  }
}, {
  eventHandlers: { focus() {
    this.scheduleWork();
  } }
}), Zf = /* @__PURE__ */ an.define({
  combine(t) {
    return t.length ? t[0] : null;
  },
  enables: (t) => [
    za.state,
    Zxe,
    Kt.contentAttributes.compute([t], (e) => {
      let n = e.facet(t);
      return n && n.name ? { "data-language": n.name } : {};
    })
  ]
});
class Gxe {
  /**
  Create a language support object.
  */
  constructor(e, n = []) {
    this.language = e, this.support = n, this.extension = [e, n];
  }
}
const Uxe = /* @__PURE__ */ an.define({
  combine: (t) => {
    if (!t.length)
      return "  ";
    let e = t[0];
    if (!e || /\S/.test(e) || Array.from(e).some((n) => n != e[0]))
      throw new Error("Invalid indent unit: " + JSON.stringify(t[0]));
    return e;
  }
}), Jxe = /* @__PURE__ */ new ei();
function eOe(t) {
  let e = t.node, n = e.childAfter(e.from), i = e.lastChild;
  if (!n)
    return null;
  let o = t.options.simulateBreak, r = t.state.doc.lineAt(n.from), a = o == null || o <= r.from ? r.to : Math.min(r.to, o);
  for (let l = n.to; ; ) {
    let s = e.childAfter(l);
    if (!s || s == i)
      return null;
    if (!s.type.isSkipped) {
      if (s.from >= a)
        return null;
      let u = /^ */.exec(r.text.slice(n.to - r.from))[0].length;
      return { from: n.from, to: n.to + u };
    }
    l = s.to;
  }
}
function tOe({ closing: t, align: e = !0, units: n = 1 }) {
  return (i) => nOe(i, e, n, t);
}
function nOe(t, e, n, i, o) {
  let r = t.textAfter, a = r.match(/^\s*/)[0].length, l = i && r.slice(a, a + i.length) == i || o == t.pos + a, s = e ? eOe(t) : null;
  return s ? l ? t.column(s.from) : t.column(s.to) : t.baseIndent + (l ? 0 : t.unit * n);
}
const iOe = (t) => t.baseIndent;
function lx({ except: t, units: e = 1 } = {}) {
  return (n) => {
    let i = t && t.test(n.textAfter);
    return n.baseIndent + (i ? 0 : e * n.unit);
  };
}
const oOe = /* @__PURE__ */ new ei();
function rOe(t) {
  let e = t.firstChild, n = t.lastChild;
  return e && e.to < n.from ? { from: e.to, to: n.type.isError ? t.to : n.from } : null;
}
class _g {
  constructor(e, n) {
    this.specs = e;
    let i;
    function o(l) {
      let s = Du.newName();
      return (i || (i = /* @__PURE__ */ Object.create(null)))["." + s] = l, s;
    }
    const r = typeof n.all == "string" ? n.all : n.all ? o(n.all) : void 0, a = n.scope;
    this.scope = a instanceof za ? (l) => l.prop(Ud) == a.data : a ? (l) => l == a : void 0, this.style = Q6(e.map((l) => ({
      tag: l.tag,
      class: l.class || o(Object.assign({}, l, { tag: null }))
    })), {
      all: r
    }).style, this.module = i ? new Du(i) : null, this.themeType = n.themeType;
  }
  /**
  Create a highlighter style that associates the given styles to
  the given tags. The specs must be objects that hold a style tag
  or array of tags in their `tag` property, and either a single
  `class` property providing a static CSS class (for highlighter
  that rely on external styling), or a
  [`style-mod`](https://code.haverbeke.berlin/marijn/style-mod#documentation)-style
  set of CSS properties (which define the styling for those tags).
  
  The CSS rules created for a highlighter will be emitted in the
  order of the spec's properties. That means that for elements that
  have multiple tags associated with them, styles defined further
  down in the list will have a higher CSS precedence than styles
  defined earlier.
  */
  static define(e, n) {
    return new _g(e, n || {});
  }
}
const JS = /* @__PURE__ */ an.define(), aOe = /* @__PURE__ */ an.define({
  combine(t) {
    return t.length ? [t[0]] : null;
  }
});
function sx(t) {
  let e = t.facet(JS);
  return e.length ? e : t.facet(aOe);
}
function j6(t, e) {
  let n = [sOe], i;
  return t instanceof _g && (t.module && n.push(Kt.styleModule.of(t.module)), i = t.themeType), i ? n.push(JS.computeN([Kt.darkTheme], (o) => o.facet(Kt.darkTheme) == (i == "dark") ? [t] : [])) : n.push(JS.of(t)), n;
}
class lOe {
  constructor(e) {
    this.markCache = /* @__PURE__ */ Object.create(null), this.tree = Rs(e.state), this.decorations = this.buildDeco(e, sx(e.state)), this.decoratedTo = e.viewport.to;
  }
  update(e) {
    let n = Rs(e.state), i = sx(e.state), o = i != sx(e.startState), { viewport: r } = e.view, a = e.changes.mapPos(this.decoratedTo, 1);
    n.length < r.to && !o && n.type == this.tree.type && a >= r.to ? (this.decorations = this.decorations.map(e.changes), this.decoratedTo = a) : (n != this.tree || e.viewportChanged || o) && (this.tree = n, this.decorations = this.buildDeco(e.view, i), this.decoratedTo = r.to);
  }
  buildDeco(e, n) {
    if (!n || !this.tree.length)
      return ai.none;
    let i = new Wf();
    for (let { from: o, to: r } of e.visibleRanges)
      qxe(this.tree, n, (a, l, s) => {
        i.add(a, l, this.markCache[s] || (this.markCache[s] = ai.mark({ class: s })));
      }, o, r);
    return i.finish();
  }
}
const sOe = /* @__PURE__ */ dd.high(/* @__PURE__ */ ga.fromClass(lOe, {
  decorations: (t) => t.decorations
})), uOe = /* @__PURE__ */ Object.create(null), NM = [Sr.none], LM = [], zM = /* @__PURE__ */ Object.create(null), cOe = /* @__PURE__ */ Object.create(null);
for (let [t, e] of [
  ["variable", "variableName"],
  ["variable-2", "variableName.special"],
  ["string-2", "string.special"],
  ["def", "variableName.definition"],
  ["tag", "tagName"],
  ["attribute", "attributeName"],
  ["type", "typeName"],
  ["builtin", "variableName.standard"],
  ["qualifier", "modifier"],
  ["error", "invalid"],
  ["header", "heading"],
  ["property", "propertyName"]
])
  cOe[t] = /* @__PURE__ */ dOe(uOe, e);
function ux(t, e) {
  LM.indexOf(t) > -1 || (LM.push(t), console.warn(e));
}
function dOe(t, e) {
  let n = [];
  for (let l of e.split(" ")) {
    let s = [];
    for (let u of l.split(".")) {
      let c = t[u] || Ge[u];
      c ? typeof c == "function" ? s.length ? s = s.map(c) : ux(u, `Modifier ${u} used at start of tag`) : s.length ? ux(u, `Tag ${u} used as modifier`) : s = Array.isArray(c) ? c : [c] : ux(u, `Unknown highlighting tag ${u}`);
    }
    for (let u of s)
      n.push(u);
  }
  if (!n.length)
    return 0;
  let i = e.replace(/ /g, "_"), o = i + " " + n.map((l) => l.id), r = zM[o];
  if (r)
    return r.id;
  let a = zM[o] = Sr.define({
    id: NM.length,
    name: i,
    props: [F6({ [i]: n })]
  });
  return NM.push(a), a.id;
}
Gi.RTL, Gi.LTR;
class q6 {
  /**
  Create a new completion context. (Mostly useful for testing
  completion sources—in the editor, the extension will create
  these for you.)
  */
  constructor(e, n, i, o) {
    this.state = e, this.pos = n, this.explicit = i, this.view = o, this.abortListeners = [], this.abortOnDocChange = !1;
  }
  /**
  Get the extent, content, and (if there is a token) type of the
  token before `this.pos`.
  */
  tokenBefore(e) {
    let n = Rs(this.state).resolveInner(this.pos, -1);
    for (; n && e.indexOf(n.name) < 0; )
      n = n.parent;
    return n ? {
      from: n.from,
      to: this.pos,
      text: this.state.sliceDoc(n.from, this.pos),
      type: n.type
    } : null;
  }
  /**
  Get the match of the given expression directly before the
  cursor.
  */
  matchBefore(e) {
    let n = this.state.doc.lineAt(this.pos), i = Math.max(n.from, this.pos - 250), o = n.text.slice(i - n.from, this.pos - n.from), r = o.search(K6(e, !1));
    return r < 0 ? null : { from: i + r, to: this.pos, text: o.slice(r) };
  }
  /**
  Yields true when the query has been aborted. Can be useful in
  asynchronous queries to avoid doing work that will be ignored.
  */
  get aborted() {
    return this.abortListeners == null;
  }
  /**
  Allows you to register abort handlers, which will be called when
  the query is
  [aborted](https://codemirror.net/6/docs/ref/#autocomplete.CompletionContext.aborted).
  
  By default, running queries will not be aborted for regular
  typing or backspacing, on the assumption that they are likely to
  return a result with a
  [`validFor`](https://codemirror.net/6/docs/ref/#autocomplete.CompletionResult.validFor) field that
  allows the result to be used after all. Passing `onDocChange:
  true` will cause this query to be aborted for any document
  change.
  */
  addEventListener(e, n, i) {
    e == "abort" && this.abortListeners && (this.abortListeners.push(n), i && i.onDocChange && (this.abortOnDocChange = !0));
  }
}
function BM(t) {
  let e = Object.keys(t).join(""), n = /\w/.test(e);
  return n && (e = e.replace(/\w/g, "")), `[${n ? "\\w" : ""}${e.replace(/[^\w\s]/g, "\\$&")}]`;
}
function fOe(t) {
  let e = /* @__PURE__ */ Object.create(null), n = /* @__PURE__ */ Object.create(null);
  for (let { label: o } of t) {
    e[o[0]] = !0;
    for (let r = 1; r < o.length; r++)
      n[o[r]] = !0;
  }
  let i = BM(e) + BM(n) + "*$";
  return [new RegExp("^" + i), new RegExp(i)];
}
function Y6(t) {
  let e = t.map((o) => typeof o == "string" ? { label: o } : o), [n, i] = e.every((o) => /^\w+$/.test(o.label)) ? [/\w*$/, /\w+$/] : fOe(e);
  return (o) => {
    let r = o.matchBefore(i);
    return r || o.explicit ? { from: r ? r.from : o.pos, options: e, validFor: n } : null;
  };
}
function hOe(t, e) {
  return (n) => {
    for (let i = Rs(n.state).resolveInner(n.pos, -1); i; i = i.parent) {
      if (t.indexOf(i.name) > -1)
        return null;
      if (i.type.isTop)
        break;
    }
    return e(n);
  };
}
class FM {
  constructor(e, n, i, o) {
    this.completion = e, this.source = n, this.match = i, this.score = o;
  }
}
function Bc(t) {
  return t.selection.main.from;
}
function K6(t, e) {
  var n;
  let { source: i } = t, o = e && i[0] != "^", r = i[i.length - 1] != "$";
  return !o && !r ? t : new RegExp(`${o ? "^" : ""}(?:${i})${r ? "$" : ""}`, (n = t.flags) !== null && n !== void 0 ? n : t.ignoreCase ? "i" : "");
}
const Ok = /* @__PURE__ */ fd.define();
function pOe(t, e, n, i) {
  let { main: o } = t.selection, r = n - o.from, a = i - o.from;
  return {
    ...t.changeByRange((l) => {
      if (l != o && n != i && t.sliceDoc(l.from + r, l.from + a) != t.sliceDoc(n, i))
        return { range: l };
      let s = t.toText(e);
      return {
        changes: { from: l.from + r, to: i == o.from ? l.to : l.from + a, insert: s },
        range: Pt.cursor(l.from + r + s.length)
      };
    }),
    scrollIntoView: !0,
    userEvent: "input.complete"
  };
}
const VM = /* @__PURE__ */ new WeakMap();
function gOe(t) {
  if (!Array.isArray(t))
    return t;
  let e = VM.get(t);
  return e || VM.set(t, e = Y6(t)), e;
}
const $0 = /* @__PURE__ */ xi.define(), tg = /* @__PURE__ */ xi.define();
class mOe {
  constructor(e) {
    this.pattern = e, this.chars = [], this.folded = [], this.any = [], this.precise = [], this.byWord = [], this.score = 0, this.matched = [];
    for (let n = 0; n < e.length; ) {
      let i = hc(e, n), o = Hd(i);
      this.chars.push(i);
      let r = e.slice(n, n + o), a = r.toUpperCase();
      this.folded.push(hc(a == r ? r.toLowerCase() : a, 0)), n += o;
    }
    this.astral = e.length != this.chars.length;
  }
  ret(e, n) {
    return this.score = e, this.matched = n, this;
  }
  // Matches a given word (completion) against the pattern (input).
  // Will return a boolean indicating whether there was a match and,
  // on success, set `this.score` to the score, `this.matched` to an
  // array of `from, to` pairs indicating the matched parts of `word`.
  //
  // The score is a number that is more negative the worse the match
  // is. See `Penalty` above.
  match(e) {
    if (this.pattern.length == 0)
      return this.ret(-100, []);
    if (e.length < this.pattern.length)
      return null;
    let { chars: n, folded: i, any: o, precise: r, byWord: a } = this;
    if (n.length == 1) {
      let b = hc(e, 0), w = Hd(b), $ = w == e.length ? 0 : -100;
      if (b != n[0]) if (b == i[0])
        $ += -200;
      else
        return null;
      return this.ret($, [0, w]);
    }
    let l = e.indexOf(this.pattern);
    if (l == 0)
      return this.ret(e.length == this.pattern.length ? 0 : -100, [0, this.pattern.length]);
    let s = n.length, u = 0;
    if (l < 0) {
      for (let b = 0, w = Math.min(e.length, 200); b < w && u < s; ) {
        let $ = hc(e, b);
        ($ == n[u] || $ == i[u]) && (o[u++] = b), b += Hd($);
      }
      if (u < s)
        return null;
    }
    let c = 0, d = 0, f = !1, h = 0, p = -1, g = -1, m = /[a-z]/.test(e), y = !0;
    for (let b = 0, w = Math.min(e.length, 200), $ = 0; b < w && d < s; ) {
      let C = hc(e, b);
      l < 0 && (c < s && C == n[c] && (r[c++] = b), h < s && (C == n[h] || C == i[h] ? (h == 0 && (p = b), g = b + 1, h++) : h = 0));
      let P, O = C < 255 ? C >= 48 && C <= 57 || C >= 97 && C <= 122 ? 2 : C >= 65 && C <= 90 ? 1 : 0 : (P = mbe(C)) != P.toLowerCase() ? 1 : P != P.toUpperCase() ? 2 : 0;
      (!b || O == 1 && m || $ == 0 && O != 0) && (n[d] == C || i[d] == C && (f = !0) ? a[d++] = b : a.length && (y = !1)), $ = O, b += Hd(C);
    }
    return d == s && a[0] == 0 && y ? this.result(-100 + (f ? -200 : 0), a, e) : h == s && p == 0 ? this.ret(-200 - e.length + (g == e.length ? 0 : -100), [0, g]) : l > -1 ? this.ret(-700 - e.length, [l, l + this.pattern.length]) : h == s ? this.ret(-900 - e.length, [p, g]) : d == s ? this.result(-100 + (f ? -200 : 0) + -700 + (y ? 0 : -1100), a, e) : n.length == 2 ? null : this.result((o[0] ? -700 : 0) + -200 + -1100, o, e);
  }
  result(e, n, i) {
    let o = [], r = 0;
    for (let a of n) {
      let l = a + (this.astral ? Hd(hc(i, a)) : 1);
      r && o[r - 1] == a ? o[r - 1] = l : (o[r++] = a, o[r++] = l);
    }
    return this.ret(e - i.length, o);
  }
}
class vOe {
  constructor(e) {
    this.pattern = e, this.matched = [], this.score = 0, this.folded = e.toLowerCase();
  }
  match(e) {
    if (e.length < this.pattern.length)
      return null;
    let n = e.slice(0, this.pattern.length), i = n == this.pattern ? 0 : n.toLowerCase() == this.folded ? -200 : null;
    return i == null ? null : (this.matched = [0, n.length], this.score = i + (e.length == this.pattern.length ? 0 : -100), this);
  }
}
const Oo = /* @__PURE__ */ an.define({
  combine(t) {
    return Pbe(t, {
      activateOnTyping: !0,
      activateOnCompletion: () => !1,
      activateOnTypingDelay: 100,
      selectOnOpen: !0,
      override: null,
      closeOnBlur: !0,
      maxRenderedOptions: 100,
      defaultKeymap: !0,
      tooltipClass: () => "",
      optionClass: () => "",
      aboveCursor: !1,
      icons: !0,
      addToOptions: [],
      positionInfo: yOe,
      filterStrict: !1,
      compareCompletions: (e, n) => (e.sortText || e.label).localeCompare(n.sortText || n.label),
      interactionDelay: 75,
      updateSyncTime: 100
    }, {
      defaultKeymap: (e, n) => e && n,
      closeOnBlur: (e, n) => e && n,
      icons: (e, n) => e && n,
      tooltipClass: (e, n) => (i) => QM(e(i), n(i)),
      optionClass: (e, n) => (i) => QM(e(i), n(i)),
      addToOptions: (e, n) => e.concat(n),
      filterStrict: (e, n) => e || n
    });
  }
});
function QM(t, e) {
  return t ? e ? t + " " + e : t : e;
}
function yOe(t, e, n, i, o, r) {
  let a = t.textDirection == Gi.RTL, l = a, s = !1, u = "top", c, d, f = e.left - o.left, h = o.right - e.right, p = i.right - i.left, g = i.bottom - i.top;
  if (l && f < Math.min(p, h) ? l = !1 : !l && h < Math.min(p, f) && (l = !0), p <= (l ? f : h))
    c = Math.max(o.top, Math.min(n.top, o.bottom - g)) - e.top, d = Math.min(400, l ? f : h);
  else {
    s = !0, d = Math.min(
      400,
      (a ? e.right : o.right - e.left) - 30
      /* Info.Margin */
    );
    let b = o.bottom - e.bottom;
    b >= g || b > e.top ? c = n.bottom - e.top : (u = "bottom", c = e.bottom - n.top);
  }
  let m = (e.bottom - e.top) / r.offsetHeight, y = (e.right - e.left) / r.offsetWidth;
  return {
    style: `${u}: ${c / m}px; max-width: ${d / y}px`,
    class: "cm-completionInfo-" + (s ? a ? "left-narrow" : "right-narrow" : l ? "left" : "right")
  };
}
const Sk = /* @__PURE__ */ xi.define();
function bOe(t) {
  let e = t.addToOptions.slice();
  return t.icons && e.push({
    render(n) {
      let i = document.createElement("div");
      return i.classList.add("cm-completionIcon"), n.type && i.classList.add(...n.type.split(/\s+/g).map((o) => "cm-completionIcon-" + o)), i.setAttribute("aria-hidden", "true"), i;
    },
    position: 20
  }), e.push({
    render(n, i, o, r) {
      let a = document.createElement("span");
      a.className = "cm-completionLabel";
      let l = n.displayLabel || n.label, s = 0;
      for (let u = 0; u < r.length; ) {
        let c = r[u++], d = r[u++];
        c > s && a.appendChild(document.createTextNode(l.slice(s, c)));
        let f = a.appendChild(document.createElement("span"));
        f.appendChild(document.createTextNode(l.slice(c, d))), f.className = "cm-completionMatchedText", s = d;
      }
      return s < l.length && a.appendChild(document.createTextNode(l.slice(s))), a;
    },
    position: 50
  }, {
    render(n) {
      if (!n.detail)
        return null;
      let i = document.createElement("span");
      return i.className = "cm-completionDetail", i.textContent = n.detail, i;
    },
    position: 80
  }), e.sort((n, i) => n.position - i.position).map((n) => n.render);
}
function cx(t, e, n) {
  if (t <= n)
    return { from: 0, to: t };
  if (e < 0 && (e = 0), e <= t >> 1) {
    let o = Math.floor(e / n);
    return { from: o * n, to: (o + 1) * n };
  }
  let i = Math.ceil((t - e) / n);
  return { from: t - i * n, to: t - (i - 1) * n };
}
class xOe {
  constructor(e, n, i) {
    this.view = e, this.stateField = n, this.applyCompletion = i, this.info = null, this.infoDestroy = null, this.placeInfoReq = {
      read: () => this.measureInfo(),
      write: (s) => this.placeInfo(s),
      key: this
    }, this.space = null, this.currentClass = "";
    let o = e.state.field(n), { options: r, selected: a } = o.open, l = e.state.facet(Oo);
    this.optionContent = bOe(l), this.optionClass = l.optionClass, this.tooltipClass = l.tooltipClass, this.range = cx(r.length, a, l.maxRenderedOptions), this.dom = document.createElement("div"), this.dom.className = "cm-tooltip-autocomplete", this.updateTooltipClass(e.state), this.dom.addEventListener("mousedown", (s) => {
      let { options: u } = e.state.field(n).open;
      for (let c = s.target, d; c && c != this.dom; c = c.parentNode)
        if (c.nodeName == "LI" && (d = /-(\d+)$/.exec(c.id)) && +d[1] < u.length) {
          this.applyCompletion(e, u[+d[1]]), s.preventDefault();
          return;
        }
      if (s.target == this.list) {
        let c = this.list.classList.contains("cm-completionListIncompleteTop") && s.clientY < this.list.firstChild.getBoundingClientRect().top ? this.range.from - 1 : this.list.classList.contains("cm-completionListIncompleteBottom") && s.clientY > this.list.lastChild.getBoundingClientRect().bottom ? this.range.to : null;
        c != null && (e.dispatch({ effects: Sk.of(c) }), s.preventDefault());
      }
    }), this.dom.addEventListener("focusout", (s) => {
      let u = e.state.field(this.stateField, !1);
      u && u.tooltip && e.state.facet(Oo).closeOnBlur && s.relatedTarget != e.contentDOM && e.dispatch({ effects: tg.of(null) });
    }), this.showOptions(r, o.id);
  }
  mount() {
    this.updateSel();
  }
  showOptions(e, n) {
    this.list && this.list.remove(), this.list = this.dom.appendChild(this.createListBox(e, n, this.range)), this.list.addEventListener("scroll", () => {
      this.info && this.view.requestMeasure(this.placeInfoReq);
    });
  }
  update(e) {
    var n;
    let i = e.state.field(this.stateField), o = e.startState.field(this.stateField);
    if (this.updateTooltipClass(e.state), i != o) {
      let { options: r, selected: a, disabled: l } = i.open;
      (!o.open || o.open.options != r) && (this.range = cx(r.length, a, e.state.facet(Oo).maxRenderedOptions), this.showOptions(r, i.id)), this.updateSel(), l != ((n = o.open) === null || n === void 0 ? void 0 : n.disabled) && this.dom.classList.toggle("cm-tooltip-autocomplete-disabled", !!l);
    }
  }
  updateTooltipClass(e) {
    let n = this.tooltipClass(e);
    if (n != this.currentClass) {
      for (let i of this.currentClass.split(" "))
        i && this.dom.classList.remove(i);
      for (let i of n.split(" "))
        i && this.dom.classList.add(i);
      this.currentClass = n;
    }
  }
  positioned(e) {
    this.space = e, this.info && this.view.requestMeasure(this.placeInfoReq);
  }
  updateSel() {
    let e = this.view.state.field(this.stateField), n = e.open;
    (n.selected > -1 && n.selected < this.range.from || n.selected >= this.range.to) && (this.range = cx(n.options.length, n.selected, this.view.state.facet(Oo).maxRenderedOptions), this.showOptions(n.options, e.id));
    let i = this.updateSelectedOption(n.selected);
    if (i) {
      this.destroyInfo();
      let { completion: o } = n.options[n.selected], { info: r } = o;
      if (!r)
        return;
      let a = typeof r == "string" ? document.createTextNode(r) : r(o);
      if (!a)
        return;
      "then" in a ? a.then((l) => {
        l && this.view.state.field(this.stateField, !1) == e && this.addInfoPane(l, o);
      }).catch((l) => Rr(this.view.state, l, "completion info")) : (this.addInfoPane(a, o), i.setAttribute("aria-describedby", this.info.id));
    }
  }
  addInfoPane(e, n) {
    this.destroyInfo();
    let i = this.info = document.createElement("div");
    if (i.className = "cm-tooltip cm-completionInfo", i.id = "cm-completionInfo-" + Math.floor(Math.random() * 65535).toString(16), e.nodeType != null)
      i.appendChild(e), this.infoDestroy = null;
    else {
      let { dom: o, destroy: r } = e;
      i.appendChild(o), this.infoDestroy = r || null;
    }
    this.dom.appendChild(i), this.view.requestMeasure(this.placeInfoReq);
  }
  updateSelectedOption(e) {
    let n = null;
    for (let i = this.list.firstChild, o = this.range.from; i; i = i.nextSibling, o++)
      i.nodeName != "LI" || !i.id ? o-- : o == e ? i.hasAttribute("aria-selected") || (i.setAttribute("aria-selected", "true"), n = i) : i.hasAttribute("aria-selected") && (i.removeAttribute("aria-selected"), i.removeAttribute("aria-describedby"));
    return n && SOe(this.list, n), n;
  }
  measureInfo() {
    let e = this.dom.querySelector("[aria-selected]");
    if (!e || !this.info)
      return null;
    let n = this.dom.getBoundingClientRect(), i = this.info.getBoundingClientRect(), o = e.getBoundingClientRect(), r = this.space;
    if (!r) {
      let a = this.dom.ownerDocument.documentElement;
      r = { left: 0, top: 0, right: a.clientWidth, bottom: a.clientHeight };
    }
    return o.top > Math.min(r.bottom, n.bottom) - 10 || o.bottom < Math.max(r.top, n.top) + 10 ? null : this.view.state.facet(Oo).positionInfo(this.view, n, o, i, r, this.dom);
  }
  placeInfo(e) {
    this.info && (e ? (e.style && (this.info.style.cssText = e.style), this.info.className = "cm-tooltip cm-completionInfo " + (e.class || "")) : this.info.style.cssText = "top: -1e6px");
  }
  createListBox(e, n, i) {
    const o = document.createElement("ul");
    o.id = n, o.setAttribute("role", "listbox"), o.setAttribute("aria-expanded", "true"), o.setAttribute("aria-label", this.view.state.phrase("Completions")), o.addEventListener("mousedown", (a) => {
      a.target == o && a.preventDefault();
    });
    let r = null;
    for (let a = i.from; a < i.to; a++) {
      let { completion: l, match: s } = e[a], { section: u } = l;
      if (u) {
        let f = typeof u == "string" ? u : u.name;
        if (f != r && (a > i.from || i.from == 0))
          if (r = f, typeof u != "string" && u.header)
            o.appendChild(u.header(u));
          else {
            let h = o.appendChild(document.createElement("completion-section"));
            h.textContent = f;
          }
      }
      const c = o.appendChild(document.createElement("li"));
      c.id = n + "-" + a, c.setAttribute("role", "option");
      let d = this.optionClass(l);
      d && (c.className = d);
      for (let f of this.optionContent) {
        let h = f(l, this.view.state, this.view, s);
        h && c.appendChild(h);
      }
    }
    return i.from && o.classList.add("cm-completionListIncompleteTop"), i.to < e.length && o.classList.add("cm-completionListIncompleteBottom"), o;
  }
  destroyInfo() {
    this.info && (this.infoDestroy && this.infoDestroy(), this.info.remove(), this.info = null);
  }
  destroy() {
    this.destroyInfo();
  }
}
function OOe(t, e) {
  return (n) => new xOe(n, t, e);
}
function SOe(t, e) {
  let n = t.getBoundingClientRect(), i = e.getBoundingClientRect(), o = n.height / t.offsetHeight;
  i.top < n.top ? t.scrollTop -= (n.top - i.top) / o : i.bottom > n.bottom && (t.scrollTop += (i.bottom - n.bottom) / o);
}
function HM(t) {
  return (t.boost || 0) * 100 + (t.apply ? 10 : 0) + (t.info ? 5 : 0) + (t.type ? 1 : 0);
}
function wOe(t, e) {
  let n = [], i = null, o = null, r = (c) => {
    n.push(c);
    let { section: d } = c.completion;
    if (d) {
      i || (i = []);
      let f = typeof d == "string" ? d : d.name;
      i.some((h) => h.name == f) || i.push(typeof d == "string" ? { name: f } : d);
    }
  }, a = e.facet(Oo);
  for (let c of t)
    if (c.hasResult()) {
      let d = c.result.getMatch;
      if (c.result.filter === !1)
        for (let f of c.result.options)
          r(new FM(f, c.source, d ? d(f) : [], 1e9 - n.length));
      else {
        let f = e.sliceDoc(c.from, c.to), h, p = a.filterStrict ? new vOe(f) : new mOe(f);
        for (let g of c.result.options)
          if (h = p.match(g.label)) {
            let m = g.displayLabel ? d ? d(g, h.matched) : [] : h.matched, y = h.score + (g.boost || 0);
            if (r(new FM(g, c.source, m, y)), typeof g.section == "object" && g.section.rank === "dynamic") {
              let { name: b } = g.section;
              o || (o = /* @__PURE__ */ Object.create(null)), o[b] = Math.max(y, o[b] || -1e9);
            }
          }
      }
    }
  if (i) {
    let c = /* @__PURE__ */ Object.create(null), d = 0, f = (h, p) => (h.rank === "dynamic" && p.rank === "dynamic" ? o[p.name] - o[h.name] : 0) || (typeof h.rank == "number" ? h.rank : 1e9) - (typeof p.rank == "number" ? p.rank : 1e9) || (h.name < p.name ? -1 : 1);
    for (let h of i.sort(f))
      d -= 1e5, c[h.name] = d;
    for (let h of n) {
      let { section: p } = h.completion;
      p && (h.score += c[typeof p == "string" ? p : p.name]);
    }
  }
  let l = [], s = null, u = a.compareCompletions;
  for (let c of n.sort((d, f) => f.score - d.score || u(d.completion, f.completion))) {
    let d = c.completion;
    !s || s.label != d.label || s.detail != d.detail || s.type != null && d.type != null && s.type != d.type || s.apply != d.apply || s.boost != d.boost ? l.push(c) : HM(c.completion) > HM(s) && (l[l.length - 1] = c), s = c.completion;
  }
  return l;
}
class Jd {
  constructor(e, n, i, o, r, a) {
    this.options = e, this.attrs = n, this.tooltip = i, this.timestamp = o, this.selected = r, this.disabled = a;
  }
  setSelected(e, n) {
    return e == this.selected || e >= this.options.length ? this : new Jd(this.options, WM(n, e), this.tooltip, this.timestamp, e, this.disabled);
  }
  static build(e, n, i, o, r, a) {
    if (o && !a && e.some((u) => u.isPending))
      return o.setDisabled();
    let l = wOe(e, n);
    if (!l.length)
      return o && e.some((u) => u.isPending) ? o.setDisabled() : null;
    let s = n.facet(Oo).selectOnOpen ? 0 : -1;
    if (o && o.selected != s && o.selected != -1) {
      let u = o.options[o.selected].completion;
      for (let c = 0; c < l.length; c++)
        if (l[c].completion == u) {
          s = c;
          break;
        }
    }
    return new Jd(l, WM(i, s), {
      pos: e.reduce((u, c) => c.hasResult() ? Math.min(u, c.from) : u, 1e8),
      create: EOe,
      above: r.aboveCursor
    }, o ? o.timestamp : Date.now(), s, !1);
  }
  map(e) {
    return new Jd(this.options, this.attrs, { ...this.tooltip, pos: e.mapPos(this.tooltip.pos) }, this.timestamp, this.selected, this.disabled);
  }
  setDisabled() {
    return new Jd(this.options, this.attrs, this.tooltip, this.timestamp, this.selected, !0);
  }
}
class k0 {
  constructor(e, n, i) {
    this.active = e, this.id = n, this.open = i;
  }
  static start() {
    return new k0(TOe, "cm-ac-" + Math.floor(Math.random() * 2e6).toString(36), null);
  }
  update(e) {
    let { state: n } = e, i = n.facet(Oo), r = (i.override || n.languageDataAt("autocomplete", Bc(n)).map(gOe)).map((s) => (this.active.find((c) => c.source == s) || new ua(
      s,
      this.active.some(
        (c) => c.state != 0
        /* State.Inactive */
      ) ? 1 : 0
      /* State.Inactive */
    )).update(e, i));
    r.length == this.active.length && r.every((s, u) => s == this.active[u]) && (r = this.active);
    let a = this.open, l = e.effects.some((s) => s.is(wk));
    a && e.docChanged && (a = a.map(e.changes)), e.selection || r.some((s) => s.hasResult() && e.changes.touchesRange(s.from, s.to)) || !COe(r, this.active) || l ? a = Jd.build(r, n, this.id, a, i, l) : a && a.disabled && !r.some((s) => s.isPending) && (a = null), !a && r.every((s) => !s.isPending) && r.some((s) => s.hasResult()) && (r = r.map((s) => s.hasResult() ? new ua(
      s.source,
      0
      /* State.Inactive */
    ) : s));
    for (let s of e.effects)
      s.is(Sk) && (a = a && a.setSelected(s.value, this.id));
    return r == this.active && a == this.open ? this : new k0(r, this.id, a);
  }
  get tooltip() {
    return this.open ? this.open.tooltip : null;
  }
  get attrs() {
    return this.open ? this.open.attrs : this.active.length ? $Oe : kOe;
  }
}
function COe(t, e) {
  if (t == e)
    return !0;
  for (let n = 0, i = 0; ; ) {
    for (; n < t.length && !t[n].hasResult(); )
      n++;
    for (; i < e.length && !e[i].hasResult(); )
      i++;
    let o = n == t.length, r = i == e.length;
    if (o || r)
      return o == r;
    if (t[n++].result != e[i++].result)
      return !1;
  }
}
const $Oe = {
  "aria-autocomplete": "list"
}, kOe = {};
function WM(t, e) {
  let n = {
    "aria-autocomplete": "list",
    "aria-haspopup": "listbox",
    "aria-controls": t
  };
  return e > -1 && (n["aria-activedescendant"] = t + "-" + e), n;
}
const TOe = [];
function X6(t, e) {
  if (t.isUserEvent("input.complete")) {
    let i = t.annotation(Ok);
    if (i && e.activateOnCompletion(i))
      return 12;
  }
  let n = t.isUserEvent("input.type");
  return n && e.activateOnTyping ? 5 : n ? 1 : t.isUserEvent("delete.backward") ? 2 : t.selection ? 8 : t.docChanged ? 16 : 0;
}
class ua {
  constructor(e, n, i = !1) {
    this.source = e, this.state = n, this.explicit = i;
  }
  hasResult() {
    return !1;
  }
  get isPending() {
    return this.state == 1;
  }
  update(e, n) {
    let i = X6(e, n), o = this;
    (i & 8 || i & 16 && this.touches(e)) && (o = new ua(
      o.source,
      0
      /* State.Inactive */
    )), i & 4 && o.state == 0 && (o = new ua(
      this.source,
      1
      /* State.Pending */
    )), o = o.updateFor(e, i);
    for (let r of e.effects)
      if (r.is($0))
        o = new ua(o.source, 1, r.value);
      else if (r.is(tg))
        o = new ua(
          o.source,
          0
          /* State.Inactive */
        );
      else if (r.is(wk))
        for (let a of r.value)
          a.source == o.source && (o = a);
    return o;
  }
  updateFor(e, n) {
    return this.map(e.changes);
  }
  map(e) {
    return this;
  }
  touches(e) {
    return e.changes.touchesRange(Bc(e.state));
  }
}
class xf extends ua {
  constructor(e, n, i, o, r, a) {
    super(e, 3, n), this.limit = i, this.result = o, this.from = r, this.to = a;
  }
  hasResult() {
    return !0;
  }
  updateFor(e, n) {
    var i;
    if (!(n & 3))
      return this.map(e.changes);
    let o = this.result;
    o.map && !e.changes.empty && (o = o.map(o, e.changes));
    let r = e.changes.mapPos(this.from), a = e.changes.mapPos(this.to, 1), l = Bc(e.state);
    if (l > a || !o || n & 2 && (Bc(e.startState) == this.from || l < this.limit))
      return new ua(
        this.source,
        n & 4 ? 1 : 0
        /* State.Inactive */
      );
    let s = e.changes.mapPos(this.limit);
    return POe(o.validFor, e.state, r, a) ? new xf(this.source, this.explicit, s, o, r, a) : o.update && (o = o.update(o, r, a, new q6(e.state, l, !1))) ? new xf(this.source, this.explicit, s, o, o.from, (i = o.to) !== null && i !== void 0 ? i : Bc(e.state)) : new ua(this.source, 1, this.explicit);
  }
  map(e) {
    if (e.empty)
      return this;
    let n = this.result.map ? this.result.map(this.result, e) : this.result;
    return n ? new xf(this.source, this.explicit, e.mapPos(this.limit), n, e.mapPos(this.from), e.mapPos(this.to, 1)) : new ua(
      this.source,
      0
      /* State.Inactive */
    );
  }
  touches(e) {
    return e.changes.touchesRange(this.from, this.to);
  }
}
function POe(t, e, n, i) {
  if (!t)
    return !1;
  let o = e.sliceDoc(n, i);
  return typeof t == "function" ? t(o, n, i, e) : K6(t, !0).test(o);
}
const wk = /* @__PURE__ */ xi.define({
  map(t, e) {
    return t.map((n) => n.map(e));
  }
}), mr = /* @__PURE__ */ Fs.define({
  create() {
    return k0.start();
  },
  update(t, e) {
    return t.update(e);
  },
  provide: (t) => [
    A6.from(t, (e) => e.tooltip),
    Kt.contentAttributes.from(t, (e) => e.attrs)
  ]
});
function Ck(t, e) {
  const n = e.completion.apply || e.completion.label;
  let i = t.state.field(mr).active.find((o) => o.source == e.source);
  return i instanceof xf ? (typeof n == "string" ? t.dispatch({
    ...pOe(t.state, n, i.from, i.to),
    annotations: Ok.of(e.completion)
  }) : n(t, e.completion, i.from, i.to), !0) : !1;
}
const EOe = /* @__PURE__ */ OOe(mr, Ck);
function qm(t, e = "option") {
  return (n) => {
    let i = n.state.field(mr, !1);
    if (!i || !i.open || i.open.disabled || Date.now() - i.open.timestamp < n.state.facet(Oo).interactionDelay)
      return !1;
    let o = 1, r;
    e == "page" && (r = R6(n, i.open.tooltip)) && (o = Math.max(2, Math.floor(r.dom.offsetHeight / r.dom.querySelector("li").offsetHeight) - 1));
    let { length: a } = i.open.options, l = i.open.selected > -1 ? i.open.selected + o * (t ? 1 : -1) : t ? 0 : a - 1;
    return l < 0 ? l = e == "page" ? 0 : a - 1 : l >= a && (l = e == "page" ? a - 1 : 0), n.dispatch({ effects: Sk.of(l) }), !0;
  };
}
const _Oe = (t) => {
  let e = t.state.field(mr, !1);
  return t.state.readOnly || !e || !e.open || e.open.selected < 0 || e.open.disabled || Date.now() - e.open.timestamp < t.state.facet(Oo).interactionDelay ? !1 : Ck(t, e.open.options[e.open.selected]);
}, Cu = (t) => t.state.field(mr, !1) ? (t.dispatch({ effects: $0.of(!0) }), !0) : !1, T0 = (t) => {
  let e = t.state.field(mr, !1);
  return !e || !e.active.some(
    (n) => n.state != 0
    /* State.Inactive */
  ) ? !1 : (t.dispatch({ effects: tg.of(null) }), !0);
};
class IOe {
  constructor(e, n) {
    this.active = e, this.context = n, this.time = Date.now(), this.updates = [], this.done = void 0;
  }
}
const MOe = 50, AOe = 1e3, ROe = /* @__PURE__ */ ga.fromClass(class {
  constructor(t) {
    this.view = t, this.debounceUpdate = -1, this.running = [], this.debounceAccept = -1, this.pendingStart = !1, this.composing = 0;
    for (let e of t.state.field(mr).active)
      e.isPending && this.startQuery(e);
  }
  update(t) {
    let e = t.state.field(mr), n = t.state.facet(Oo);
    if (!t.selectionSet && !t.docChanged && t.startState.field(mr) == e)
      return;
    let i = t.transactions.some((r) => {
      let a = X6(r, n);
      return a & 8 || (r.selection || r.docChanged) && !(a & 3);
    });
    for (let r = 0; r < this.running.length; r++) {
      let a = this.running[r];
      if (i || a.context.abortOnDocChange && t.docChanged || a.updates.length + t.transactions.length > MOe && Date.now() - a.time > AOe) {
        for (let l of a.context.abortListeners)
          try {
            l();
          } catch (s) {
            Rr(this.view.state, s);
          }
        a.context.abortListeners = null, this.running.splice(r--, 1);
      } else
        a.updates.push(...t.transactions);
    }
    this.debounceUpdate > -1 && clearTimeout(this.debounceUpdate), t.transactions.some((r) => r.effects.some((a) => a.is($0))) && (this.pendingStart = !0);
    let o = this.pendingStart ? 50 : n.activateOnTypingDelay;
    if (this.debounceUpdate = e.active.some((r) => r.isPending && !this.running.some((a) => a.active.source == r.source)) ? setTimeout(() => this.startUpdate(), o) : -1, this.composing != 0)
      for (let r of t.transactions)
        r.isUserEvent("input.type") ? this.composing = 2 : this.composing == 2 && r.selection && (this.composing = 3);
  }
  startUpdate() {
    this.debounceUpdate = -1, this.pendingStart = !1;
    let { state: t } = this.view, e = t.field(mr);
    for (let n of e.active)
      n.isPending && !this.running.some((i) => i.active.source == n.source) && this.startQuery(n);
    this.running.length && e.open && e.open.disabled && (this.debounceAccept = setTimeout(() => this.accept(), this.view.state.facet(Oo).updateSyncTime));
  }
  startQuery(t) {
    let { state: e } = this.view, n = Bc(e), i = new q6(e, n, t.explicit, this.view), o = new IOe(t, i);
    this.running.push(o), Promise.resolve(t.source(i)).then((r) => {
      o.context.aborted || (o.done = r || null, this.scheduleAccept());
    }, (r) => {
      this.view.dispatch({ effects: tg.of(null) }), Rr(this.view.state, r);
    });
  }
  scheduleAccept() {
    this.running.every((t) => t.done !== void 0) ? this.accept() : this.debounceAccept < 0 && (this.debounceAccept = setTimeout(() => this.accept(), this.view.state.facet(Oo).updateSyncTime));
  }
  // For each finished query in this.running, try to create a result
  // or, if appropriate, restart the query.
  accept() {
    var t;
    this.debounceAccept > -1 && clearTimeout(this.debounceAccept), this.debounceAccept = -1;
    let e = [], n = this.view.state.facet(Oo), i = this.view.state.field(mr);
    for (let o = 0; o < this.running.length; o++) {
      let r = this.running[o];
      if (r.done === void 0)
        continue;
      if (this.running.splice(o--, 1), r.done) {
        let l = Bc(r.updates.length ? r.updates[0].startState : this.view.state), s = Math.min(l, r.done.from + (r.active.explicit ? 0 : 1)), u = new xf(r.active.source, r.active.explicit, s, r.done, r.done.from, (t = r.done.to) !== null && t !== void 0 ? t : l);
        for (let c of r.updates)
          u = u.update(c, n);
        if (u.hasResult()) {
          e.push(u);
          continue;
        }
      }
      let a = i.active.find((l) => l.source == r.active.source);
      if (a && a.isPending)
        if (r.done == null) {
          let l = new ua(
            r.active.source,
            0
            /* State.Inactive */
          );
          for (let s of r.updates)
            l = l.update(s, n);
          l.isPending || e.push(l);
        } else
          this.startQuery(a);
    }
    (e.length || i.open && i.open.disabled) && this.view.dispatch({ effects: wk.of(e) });
  }
}, {
  eventHandlers: {
    blur(t) {
      let e = this.view.state.field(mr, !1);
      if (e && e.tooltip && this.view.state.facet(Oo).closeOnBlur) {
        let n = e.open && R6(this.view, e.open.tooltip);
        (!n || !n.dom.contains(t.relatedTarget)) && setTimeout(() => this.view.dispatch({ effects: tg.of(null) }), 10);
      }
    },
    compositionstart() {
      this.composing = 1;
    },
    compositionend() {
      this.composing == 3 && setTimeout(() => this.view.dispatch({ effects: $0.of(!1) }), 20), this.composing = 0;
    }
  }
}), DOe = typeof navigator == "object" && /* @__PURE__ */ /Win/.test(navigator.platform), NOe = /* @__PURE__ */ dd.highest(/* @__PURE__ */ Kt.domEventHandlers({
  keydown(t, e) {
    let n = e.state.field(mr, !1);
    if (!n || !n.open || n.open.disabled || n.open.selected < 0 || t.key.length > 1 || t.ctrlKey && !(DOe && t.altKey) || t.metaKey)
      return !1;
    let i = n.open.options[n.open.selected], o = n.active.find((a) => a.source == i.source), r = i.completion.commitCharacters || o.result.commitCharacters;
    return r && r.indexOf(t.key) > -1 && Ck(e, i), !1;
  }
})), Z6 = /* @__PURE__ */ Kt.baseTheme({
  ".cm-tooltip.cm-tooltip-autocomplete": {
    "& > ul": {
      fontFamily: "monospace",
      whiteSpace: "nowrap",
      overflow: "hidden auto",
      maxWidth_fallback: "700px",
      maxWidth: "min(700px, 95vw)",
      minWidth: "250px",
      maxHeight: "10em",
      height: "100%",
      listStyle: "none",
      margin: 0,
      padding: 0,
      "& > li, & > completion-section": {
        padding: "1px 3px",
        lineHeight: 1.2
      },
      "& > li": {
        overflowX: "hidden",
        textOverflow: "ellipsis",
        cursor: "pointer"
      },
      "& > completion-section": {
        display: "list-item",
        borderBottom: "1px solid silver",
        paddingLeft: "0.5em",
        opacity: 0.7
      }
    }
  },
  "&light .cm-tooltip-autocomplete ul li[aria-selected]": {
    background: "#17c",
    color: "white"
  },
  "&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]": {
    background: "#777"
  },
  "&dark .cm-tooltip-autocomplete ul li[aria-selected]": {
    background: "#347",
    color: "white"
  },
  "&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]": {
    background: "#444"
  },
  ".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after": {
    content: '"···"',
    opacity: 0.5,
    display: "block",
    textAlign: "center",
    cursor: "pointer"
  },
  ".cm-tooltip.cm-completionInfo": {
    position: "absolute",
    padding: "3px 9px",
    width: "max-content",
    maxWidth: "400px",
    boxSizing: "border-box",
    whiteSpace: "pre-line"
  },
  ".cm-completionInfo.cm-completionInfo-left": { right: "100%" },
  ".cm-completionInfo.cm-completionInfo-right": { left: "100%" },
  ".cm-completionInfo.cm-completionInfo-left-narrow": { right: "30px" },
  ".cm-completionInfo.cm-completionInfo-right-narrow": { left: "30px" },
  "&light .cm-snippetField": { backgroundColor: "#00000022" },
  "&dark .cm-snippetField": { backgroundColor: "#ffffff22" },
  ".cm-snippetFieldPosition": {
    verticalAlign: "text-top",
    width: 0,
    height: "1.15em",
    display: "inline-block",
    margin: "0 -0.7px -.7em",
    borderLeft: "1.4px dotted #888"
  },
  ".cm-completionMatchedText": {
    textDecoration: "underline"
  },
  ".cm-completionDetail": {
    marginLeft: "0.5em",
    fontStyle: "italic"
  },
  ".cm-completionIcon": {
    fontSize: "90%",
    width: ".8em",
    display: "inline-block",
    textAlign: "center",
    paddingRight: ".6em",
    opacity: "0.6",
    boxSizing: "content-box"
  },
  ".cm-completionIcon-function, .cm-completionIcon-method": {
    "&:after": { content: "'ƒ'" }
  },
  ".cm-completionIcon-class": {
    "&:after": { content: "'○'" }
  },
  ".cm-completionIcon-interface": {
    "&:after": { content: "'◌'" }
  },
  ".cm-completionIcon-variable": {
    "&:after": { content: "'𝑥'" }
  },
  ".cm-completionIcon-constant": {
    "&:after": { content: "'𝐶'" }
  },
  ".cm-completionIcon-type": {
    "&:after": { content: "'𝑡'" }
  },
  ".cm-completionIcon-enum": {
    "&:after": { content: "'∪'" }
  },
  ".cm-completionIcon-property": {
    "&:after": { content: "'□'" }
  },
  ".cm-completionIcon-keyword": {
    "&:after": { content: "'🔑︎'" }
    // Disable emoji rendering
  },
  ".cm-completionIcon-namespace": {
    "&:after": { content: "'▢'" }
  },
  ".cm-completionIcon-text": {
    "&:after": { content: "'abc'", fontSize: "50%", verticalAlign: "middle" }
  }
});
class LOe {
  constructor(e, n, i, o) {
    this.field = e, this.line = n, this.from = i, this.to = o;
  }
}
class $k {
  constructor(e, n, i) {
    this.field = e, this.from = n, this.to = i;
  }
  map(e) {
    let n = e.mapPos(this.from, -1, nr.TrackDel), i = e.mapPos(this.to, 1, nr.TrackDel);
    return n == null || i == null ? null : new $k(this.field, n, i);
  }
}
class kk {
  constructor(e, n) {
    this.lines = e, this.fieldPositions = n;
  }
  instantiate(e, n) {
    let i = [], o = [n], r = e.doc.lineAt(n), a = /^\s*/.exec(r.text)[0];
    for (let s of this.lines) {
      if (i.length) {
        let u = a, c = /^\t*/.exec(s)[0].length;
        for (let d = 0; d < c; d++)
          u += e.facet(Uxe);
        o.push(n + u.length - c), s = u + s.slice(c);
      }
      i.push(s), n += s.length + 1;
    }
    let l = this.fieldPositions.map((s) => new $k(s.field, o[s.line] + s.from, o[s.line] + s.to));
    return { text: i, ranges: l };
  }
  static parse(e) {
    let n = [], i = [], o = [], r;
    for (let a of e.split(/\r\n?|\n/)) {
      for (; r = /[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(a); ) {
        let l = r[1] ? +r[1] : null, s = r[2] || r[3] || "", u = -1;
        l === 0 && (l = 1e9);
        let c = s.replace(/\\[{}]/g, (d) => d[1]);
        for (let d = 0; d < n.length; d++)
          (l != null ? n[d].seq == l : c && n[d].name == c) && (u = d);
        if (u < 0) {
          let d = 0;
          for (; d < n.length && (l == null || n[d].seq != null && n[d].seq < l); )
            d++;
          n.splice(d, 0, { seq: l, name: c }), u = d;
          for (let f of o)
            f.field >= u && f.field++;
        }
        for (let d of o)
          if (d.line == i.length && d.from > r.index) {
            let f = r[2] ? 3 + (r[1] || "").length : 2;
            d.from -= f, d.to -= f;
          }
        o.push(new LOe(u, i.length, r.index, r.index + c.length)), a = a.slice(0, r.index) + s + a.slice(r.index + r[0].length);
      }
      a = a.replace(/\\([{}])/g, (l, s, u) => {
        for (let c of o)
          c.line == i.length && c.from > u && (c.from--, c.to--);
        return s;
      }), i.push(a);
    }
    return new kk(i, o);
  }
}
let zOe = /* @__PURE__ */ ai.widget({ widget: /* @__PURE__ */ new class extends hh {
  toDOM() {
    let t = document.createElement("span");
    return t.className = "cm-snippetFieldPosition", t;
  }
  ignoreEvent() {
    return !1;
  }
}() }), BOe = /* @__PURE__ */ ai.mark({ class: "cm-snippetField" });
class ph {
  constructor(e, n) {
    this.ranges = e, this.active = n, this.deco = ai.set(e.map((i) => (i.from == i.to ? zOe : BOe).range(i.from, i.to)), !0);
  }
  map(e) {
    let n = [];
    for (let i of this.ranges) {
      let o = i.map(e);
      if (!o)
        return null;
      n.push(o);
    }
    return new ph(n, this.active);
  }
  selectionInsideField(e) {
    return e.ranges.every((n) => this.ranges.some((i) => i.field == this.active && i.from <= n.from && i.to >= n.to));
  }
}
const Ig = /* @__PURE__ */ xi.define({
  map(t, e) {
    return t && t.map(e);
  }
}), FOe = /* @__PURE__ */ xi.define(), ng = /* @__PURE__ */ Fs.define({
  create() {
    return null;
  },
  update(t, e) {
    for (let n of e.effects) {
      if (n.is(Ig))
        return n.value;
      if (n.is(FOe) && t)
        return new ph(t.ranges, n.value);
    }
    return t && e.docChanged && (t = t.map(e.changes)), t && e.selection && !t.selectionInsideField(e.selection) && (t = null), t;
  },
  provide: (t) => Kt.decorations.from(t, (e) => e ? e.deco : ai.none)
});
function Tk(t, e) {
  return Pt.create(t.filter((n) => n.field == e).map((n) => Pt.range(n.from, n.to)));
}
function VOe(t) {
  let e = kk.parse(t);
  return (n, i, o, r) => {
    let { text: a, ranges: l } = e.instantiate(n.state, o), { main: s } = n.state.selection, u = {
      changes: { from: o, to: r == s.from ? s.to : r, insert: Wn.of(a) },
      scrollIntoView: !0,
      annotations: i ? [Ok.of(i), Ao.userEvent.of("input.complete")] : void 0
    };
    if (l.length && (u.selection = Tk(l, 0)), l.some((c) => c.field > 0)) {
      let c = new ph(l, 0), d = u.effects = [Ig.of(c)];
      n.state.field(ng, !1) === void 0 && d.push(xi.appendConfig.of([ng, qOe, YOe, Z6]));
    }
    n.dispatch(n.state.update(u));
  };
}
function G6(t) {
  return ({ state: e, dispatch: n }) => {
    let i = e.field(ng, !1);
    if (!i || t < 0 && i.active == 0)
      return !1;
    let o = i.active + t, r = t > 0 && !i.ranges.some((a) => a.field == o + t);
    return n(e.update({
      selection: Tk(i.ranges, o),
      effects: Ig.of(r ? null : new ph(i.ranges, o)),
      scrollIntoView: !0
    })), !0;
  };
}
const QOe = ({ state: t, dispatch: e }) => t.field(ng, !1) ? (e(t.update({ effects: Ig.of(null) })), !0) : !1, HOe = /* @__PURE__ */ G6(1), WOe = /* @__PURE__ */ G6(-1), jOe = [
  { key: "Tab", run: HOe, shift: WOe },
  { key: "Escape", run: QOe }
], jM = /* @__PURE__ */ an.define({
  combine(t) {
    return t.length ? t[0] : jOe;
  }
}), qOe = /* @__PURE__ */ dd.highest(/* @__PURE__ */ Eg.compute([jM], (t) => t.facet(jM)));
function fr(t, e) {
  return { ...e, apply: VOe(t) };
}
const YOe = /* @__PURE__ */ Kt.domEventHandlers({
  mousedown(t, e) {
    let n = e.state.field(ng, !1), i;
    if (!n || (i = e.posAtCoords({ x: t.clientX, y: t.clientY })) == null)
      return !1;
    let o = n.ranges.find((r) => r.from <= i && r.to >= i);
    return !o || o.field == n.active ? !1 : (e.dispatch({
      selection: Tk(n.ranges, o.field),
      effects: Ig.of(n.ranges.some((r) => r.field > o.field) ? new ph(n.ranges, o.field) : null),
      scrollIntoView: !0
    }), !0);
  }
}), U6 = /* @__PURE__ */ new class extends Ru {
}();
U6.startSide = 1;
U6.endSide = -1;
function J6(t = {}) {
  return [
    NOe,
    mr,
    Oo.of(t),
    ROe,
    KOe,
    Z6
  ];
}
const Pk = [
  { key: "Ctrl-Space", run: Cu },
  { mac: "Alt-`", run: Cu },
  { mac: "Alt-i", run: Cu },
  { key: "Escape", run: T0 },
  { key: "ArrowDown", run: /* @__PURE__ */ qm(!0) },
  { key: "ArrowUp", run: /* @__PURE__ */ qm(!1) },
  { key: "PageDown", run: /* @__PURE__ */ qm(!0, "page") },
  { key: "PageUp", run: /* @__PURE__ */ qm(!1, "page") },
  { key: "Enter", run: _Oe }
], KOe = /* @__PURE__ */ dd.highest(/* @__PURE__ */ Eg.computeN([Oo], (t) => t.facet(Oo).defaultKeymap ? [Pk] : []));
class P0 {
  /**
  @internal
  */
  constructor(e, n, i, o, r, a, l, s, u, c = 0, d) {
    this.p = e, this.stack = n, this.state = i, this.reducePos = o, this.pos = r, this.score = a, this.buffer = l, this.bufferBase = s, this.curContext = u, this.lookAhead = c, this.parent = d;
  }
  /**
  @internal
  */
  toString() {
    return `[${this.stack.filter((e, n) => n % 3 == 0).concat(this.state)}]@${this.pos}${this.score ? "!" + this.score : ""}`;
  }
  // Start an empty stack
  /**
  @internal
  */
  static start(e, n, i = 0) {
    let o = e.parser.context;
    return new P0(e, [], n, i, i, 0, [], 0, o ? new qM(o, o.start) : null, 0, null);
  }
  /**
  The stack's current [context](#lr.ContextTracker) value, if
  any. Its type will depend on the context tracker's type
  parameter, or it will be `null` if there is no context
  tracker.
  */
  get context() {
    return this.curContext ? this.curContext.context : null;
  }
  // Push a state onto the stack, tracking its start position as well
  // as the buffer base at that point.
  /**
  @internal
  */
  pushState(e, n) {
    this.stack.push(this.state, n, this.bufferBase + this.buffer.length), this.state = e;
  }
  // Apply a reduce action
  /**
  @internal
  */
  reduce(e) {
    var n;
    let i = e >> 19, o = e & 65535, { parser: r } = this.p, a = this.reducePos < this.pos - 25 && this.setLookAhead(this.pos), l = r.dynamicPrecedence(o);
    if (l && (this.score += l), i == 0) {
      o < r.minRepeatTerm && this.reducePos < this.pos && (this.reducePos = this.pos), this.pushState(r.getGoto(this.state, o, !0), this.reducePos), o < r.minRepeatTerm && this.storeNode(o, this.reducePos, this.reducePos, a ? 8 : 4, !0), this.reduceContext(o, this.reducePos);
      return;
    }
    let s = this.stack.length - (i - 1) * 3 - (e & 262144 ? 6 : 0), u = s ? this.stack[s - 2] : this.p.ranges[0].from;
    o < r.minRepeatTerm && u == this.reducePos && this.reducePos < this.pos && (this.reducePos = this.pos);
    let c = this.reducePos - u;
    c >= 2e3 && !(!((n = this.p.parser.nodeSet.types[o]) === null || n === void 0) && n.isAnonymous) && (u == this.p.lastBigReductionStart ? (this.p.bigReductionCount++, this.p.lastBigReductionSize = c) : this.p.lastBigReductionSize < c && (this.p.bigReductionCount = 1, this.p.lastBigReductionStart = u, this.p.lastBigReductionSize = c));
    let d = s ? this.stack[s - 1] : 0, f = this.bufferBase + this.buffer.length - d;
    if (o < r.minRepeatTerm || e & 131072) {
      let h = r.stateFlag(
        this.state,
        1
        /* StateFlag.Skipped */
      ) ? this.pos : this.reducePos;
      this.storeNode(o, u, h, f + 4, !0);
    }
    if (e & 262144)
      this.state = this.stack[s];
    else {
      let h = this.stack[s - 3];
      this.state = r.getGoto(h, o, !0);
    }
    for (; this.stack.length > s; )
      this.stack.pop();
    this.reduceContext(o, u);
  }
  // Shift a value into the buffer
  /**
  @internal
  */
  storeNode(e, n, i, o = 4, r = !1) {
    if (e == 0 && (!this.stack.length || this.stack[this.stack.length - 1] < this.buffer.length + this.bufferBase)) {
      let a = this.buffer.length;
      if (a > 0 && this.buffer[a - 4] == 0 && this.buffer[a - 1] > -1) {
        if (n == i)
          return;
        if (this.buffer[a - 2] >= n) {
          this.buffer[a - 2] = i;
          return;
        }
      }
    }
    if (!r || this.pos == i)
      this.buffer.push(e, n, i, o);
    else {
      let a = this.buffer.length;
      if (a > 0 && (this.buffer[a - 4] != 0 || this.buffer[a - 1] < 0)) {
        let l = !1;
        for (let s = a; s > 0 && this.buffer[s - 2] > i; s -= 4)
          if (this.buffer[s - 1] >= 0) {
            l = !0;
            break;
          }
        if (l)
          for (; a > 0 && this.buffer[a - 2] > i; )
            this.buffer[a] = this.buffer[a - 4], this.buffer[a + 1] = this.buffer[a - 3], this.buffer[a + 2] = this.buffer[a - 2], this.buffer[a + 3] = this.buffer[a - 1], a -= 4, o > 4 && (o -= 4);
      }
      this.buffer[a] = e, this.buffer[a + 1] = n, this.buffer[a + 2] = i, this.buffer[a + 3] = o;
    }
  }
  // Apply a shift action
  /**
  @internal
  */
  shift(e, n, i, o) {
    if (e & 131072)
      this.pushState(e & 65535, this.pos);
    else if ((e & 262144) == 0) {
      let r = e, { parser: a } = this.p;
      this.pos = o;
      let l = a.stateFlag(
        r,
        1
        /* StateFlag.Skipped */
      );
      !l && (o > i || n <= a.maxNode) && (this.reducePos = o), this.pushState(r, l ? i : Math.min(i, this.reducePos)), this.shiftContext(n, i), n <= a.maxNode && this.buffer.push(n, i, o, 4);
    } else
      this.pos = o, this.shiftContext(n, i), n <= this.p.parser.maxNode && this.buffer.push(n, i, o, 4);
  }
  // Apply an action
  /**
  @internal
  */
  apply(e, n, i, o) {
    e & 65536 ? this.reduce(e) : this.shift(e, n, i, o);
  }
  // Add a prebuilt (reused) node into the buffer.
  /**
  @internal
  */
  useNode(e, n) {
    let i = this.p.reused.length - 1;
    (i < 0 || this.p.reused[i] != e) && (this.p.reused.push(e), i++);
    let o = this.pos;
    this.reducePos = this.pos = o + e.length, this.pushState(n, o), this.buffer.push(
      i,
      o,
      this.reducePos,
      -1
      /* size == -1 means this is a reused value */
    ), this.curContext && this.updateContext(this.curContext.tracker.reuse(this.curContext.context, e, this, this.p.stream.reset(this.pos - e.length)));
  }
  // Split the stack. Due to the buffer sharing and the fact
  // that `this.stack` tends to stay quite shallow, this isn't very
  // expensive.
  /**
  @internal
  */
  split() {
    let e = this, n = e.buffer.length;
    for (n && e.buffer[n - 4] == 0 && (n -= 4); n > 0 && e.buffer[n - 2] > e.reducePos; )
      n -= 4;
    let i = e.buffer.slice(n), o = e.bufferBase + n;
    for (; e && o == e.bufferBase; )
      e = e.parent;
    return new P0(this.p, this.stack.slice(), this.state, this.reducePos, this.pos, this.score, i, o, this.curContext, this.lookAhead, e);
  }
  // Try to recover from an error by 'deleting' (ignoring) one token.
  /**
  @internal
  */
  recoverByDelete(e, n) {
    let i = e <= this.p.parser.maxNode;
    i && this.storeNode(e, this.pos, n, 4), this.storeNode(0, this.pos, n, i ? 8 : 4), this.pos = this.reducePos = n, this.score -= 190;
  }
  /**
  Check if the given term would be able to be shifted (optionally
  after some reductions) on this stack. This can be useful for
  external tokenizers that want to make sure they only provide a
  given token when it applies.
  */
  canShift(e) {
    for (let n = new XOe(this); ; ) {
      let i = this.p.parser.stateSlot(
        n.state,
        4
        /* ParseState.DefaultReduce */
      ) || this.p.parser.hasAction(n.state, e);
      if (i == 0)
        return !1;
      if ((i & 65536) == 0)
        return !0;
      n.reduce(i);
    }
  }
  // Apply up to Recover.MaxNext recovery actions that conceptually
  // inserts some missing token or rule.
  /**
  @internal
  */
  recoverByInsert(e) {
    if (this.stack.length >= 300)
      return [];
    let n = this.p.parser.nextStates(this.state);
    if (n.length > 8 || this.stack.length >= 120) {
      let o = [];
      for (let r = 0, a; r < n.length; r += 2)
        (a = n[r + 1]) != this.state && this.p.parser.hasAction(a, e) && o.push(n[r], a);
      if (this.stack.length < 120)
        for (let r = 0; o.length < 8 && r < n.length; r += 2) {
          let a = n[r + 1];
          o.some((l, s) => s & 1 && l == a) || o.push(n[r], a);
        }
      n = o;
    }
    let i = [];
    for (let o = 0; o < n.length && i.length < 4; o += 2) {
      let r = n[o + 1];
      if (r == this.state)
        continue;
      let a = this.split();
      a.pushState(r, this.pos), a.storeNode(0, a.pos, a.pos, 4, !0), a.shiftContext(n[o], this.pos), a.reducePos = this.pos, a.score -= 200, i.push(a);
    }
    return i;
  }
  // Force a reduce, if possible. Return false if that can't
  // be done.
  /**
  @internal
  */
  forceReduce() {
    let { parser: e } = this.p, n = e.stateSlot(
      this.state,
      5
      /* ParseState.ForcedReduce */
    );
    if ((n & 65536) == 0)
      return !1;
    if (!e.validAction(this.state, n)) {
      let i = n >> 19, o = n & 65535, r = this.stack.length - i * 3;
      if (r < 0 || e.getGoto(this.stack[r], o, !1) < 0) {
        let a = this.findForcedReduction();
        if (a == null)
          return !1;
        n = a;
      }
      this.storeNode(0, this.pos, this.pos, 4, !0), this.score -= 100;
    }
    return this.reducePos = this.pos, this.reduce(n), !0;
  }
  /**
  Try to scan through the automaton to find some kind of reduction
  that can be applied. Used when the regular ForcedReduce field
  isn't a valid action. @internal
  */
  findForcedReduction() {
    let { parser: e } = this.p, n = [], i = (o, r) => {
      if (!n.includes(o))
        return n.push(o), e.allActions(o, (a) => {
          if (!(a & 393216)) if (a & 65536) {
            let l = (a >> 19) - r;
            if (l > 1) {
              let s = a & 65535, u = this.stack.length - l * 3;
              if (u >= 0 && e.getGoto(this.stack[u], s, !1) >= 0)
                return l << 19 | 65536 | s;
            }
          } else {
            let l = i(a, r + 1);
            if (l != null)
              return l;
          }
        });
    };
    return i(this.state, 0);
  }
  /**
  @internal
  */
  forceAll() {
    for (; !this.p.parser.stateFlag(
      this.state,
      2
      /* StateFlag.Accepting */
    ); )
      if (!this.forceReduce()) {
        this.storeNode(0, this.pos, this.pos, 4, !0);
        break;
      }
    return this;
  }
  /**
  Check whether this state has no further actions (assumed to be a direct descendant of the
  top state, since any other states must be able to continue
  somehow). @internal
  */
  get deadEnd() {
    if (this.stack.length != 3)
      return !1;
    let { parser: e } = this.p;
    return e.data[e.stateSlot(
      this.state,
      1
      /* ParseState.Actions */
    )] == 65535 && !e.stateSlot(
      this.state,
      4
      /* ParseState.DefaultReduce */
    );
  }
  /**
  Restart the stack (put it back in its start state). Only safe
  when this.stack.length == 3 (state is directly below the top
  state). @internal
  */
  restart() {
    this.storeNode(0, this.pos, this.pos, 4, !0), this.state = this.stack[0], this.stack.length = 0;
  }
  /**
  @internal
  */
  sameState(e) {
    if (this.state != e.state || this.stack.length != e.stack.length)
      return !1;
    for (let n = 0; n < this.stack.length; n += 3)
      if (this.stack[n] != e.stack[n])
        return !1;
    return !0;
  }
  /**
  Get the parser used by this stack.
  */
  get parser() {
    return this.p.parser;
  }
  /**
  Test whether a given dialect (by numeric ID, as exported from
  the terms file) is enabled.
  */
  dialectEnabled(e) {
    return this.p.parser.dialect.flags[e];
  }
  shiftContext(e, n) {
    this.curContext && this.updateContext(this.curContext.tracker.shift(this.curContext.context, e, this, this.p.stream.reset(n)));
  }
  reduceContext(e, n) {
    this.curContext && this.updateContext(this.curContext.tracker.reduce(this.curContext.context, e, this, this.p.stream.reset(n)));
  }
  /**
  @internal
  */
  emitContext() {
    let e = this.buffer.length - 1;
    (e < 0 || this.buffer[e] != -3) && this.buffer.push(this.curContext.hash, this.pos, this.pos, -3);
  }
  /**
  @internal
  */
  emitLookAhead() {
    let e = this.buffer.length - 1;
    (e < 0 || this.buffer[e] != -4) && this.buffer.push(this.lookAhead, this.pos, this.pos, -4);
  }
  updateContext(e) {
    if (e != this.curContext.context) {
      let n = new qM(this.curContext.tracker, e);
      n.hash != this.curContext.hash && this.emitContext(), this.curContext = n;
    }
  }
  /**
  @internal
  */
  setLookAhead(e) {
    return e <= this.lookAhead ? !1 : (this.emitLookAhead(), this.lookAhead = e, !0);
  }
  /**
  @internal
  */
  close() {
    this.curContext && this.curContext.tracker.strict && this.emitContext(), this.lookAhead > 0 && this.emitLookAhead();
  }
}
class qM {
  constructor(e, n) {
    this.tracker = e, this.context = n, this.hash = e.strict ? e.hash(n) : 0;
  }
}
class XOe {
  constructor(e) {
    this.start = e, this.state = e.state, this.stack = e.stack, this.base = this.stack.length;
  }
  reduce(e) {
    let n = e & 65535, i = e >> 19;
    i == 0 ? (this.stack == this.start.stack && (this.stack = this.stack.slice()), this.stack.push(this.state, 0, 0), this.base += 3) : this.base -= (i - 1) * 3;
    let o = this.start.p.parser.getGoto(this.stack[this.base - 3], n, !0);
    this.state = o;
  }
}
class E0 {
  constructor(e, n, i) {
    this.stack = e, this.pos = n, this.index = i, this.buffer = e.buffer, this.index == 0 && this.maybeNext();
  }
  static create(e, n = e.bufferBase + e.buffer.length) {
    return new E0(e, n, n - e.bufferBase);
  }
  maybeNext() {
    let e = this.stack.parent;
    e != null && (this.index = this.stack.bufferBase - e.bufferBase, this.stack = e, this.buffer = e.buffer);
  }
  get id() {
    return this.buffer[this.index - 4];
  }
  get start() {
    return this.buffer[this.index - 3];
  }
  get end() {
    return this.buffer[this.index - 2];
  }
  get size() {
    return this.buffer[this.index - 1];
  }
  next() {
    this.index -= 4, this.pos -= 4, this.index == 0 && this.maybeNext();
  }
  fork() {
    return new E0(this.stack, this.pos, this.index);
  }
}
function Jh(t, e = Uint16Array) {
  if (typeof t != "string")
    return t;
  let n = null;
  for (let i = 0, o = 0; i < t.length; ) {
    let r = 0;
    for (; ; ) {
      let a = t.charCodeAt(i++), l = !1;
      if (a == 126) {
        r = 65535;
        break;
      }
      a >= 92 && a--, a >= 34 && a--;
      let s = a - 32;
      if (s >= 46 && (s -= 46, l = !0), r += s, l)
        break;
      r *= 46;
    }
    n ? n[o++] = r : n = new e(r);
  }
  return n;
}
class Pv {
  constructor() {
    this.start = -1, this.value = -1, this.end = -1, this.extended = -1, this.lookAhead = 0, this.mask = 0, this.context = 0;
  }
}
const YM = new Pv();
class ZOe {
  /**
  @internal
  */
  constructor(e, n) {
    this.input = e, this.ranges = n, this.chunk = "", this.chunkOff = 0, this.chunk2 = "", this.chunk2Pos = 0, this.next = -1, this.token = YM, this.rangeIndex = 0, this.pos = this.chunkPos = n[0].from, this.range = n[0], this.end = n[n.length - 1].to, this.readNext();
  }
  /**
  @internal
  */
  resolveOffset(e, n) {
    let i = this.range, o = this.rangeIndex, r = this.pos + e;
    for (; r < i.from; ) {
      if (!o)
        return null;
      let a = this.ranges[--o];
      r -= i.from - a.to, i = a;
    }
    for (; n < 0 ? r > i.to : r >= i.to; ) {
      if (o == this.ranges.length - 1)
        return null;
      let a = this.ranges[++o];
      r += a.from - i.to, i = a;
    }
    return r;
  }
  /**
  @internal
  */
  clipPos(e) {
    if (e >= this.range.from && e < this.range.to)
      return e;
    for (let n of this.ranges)
      if (n.to > e)
        return Math.max(e, n.from);
    return this.end;
  }
  /**
  Look at a code unit near the stream position. `.peek(0)` equals
  `.next`, `.peek(-1)` gives you the previous character, and so
  on.
  
  Note that looking around during tokenizing creates dependencies
  on potentially far-away content, which may reduce the
  effectiveness incremental parsing—when looking forward—or even
  cause invalid reparses when looking backward more than 25 code
  units, since the library does not track lookbehind.
  */
  peek(e) {
    let n = this.chunkOff + e, i, o;
    if (n >= 0 && n < this.chunk.length)
      i = this.pos + e, o = this.chunk.charCodeAt(n);
    else {
      let r = this.resolveOffset(e, 1);
      if (r == null)
        return -1;
      if (i = r, i >= this.chunk2Pos && i < this.chunk2Pos + this.chunk2.length)
        o = this.chunk2.charCodeAt(i - this.chunk2Pos);
      else {
        let a = this.rangeIndex, l = this.range;
        for (; l.to <= i; )
          l = this.ranges[++a];
        this.chunk2 = this.input.chunk(this.chunk2Pos = i), i + this.chunk2.length > l.to && (this.chunk2 = this.chunk2.slice(0, l.to - i)), o = this.chunk2.charCodeAt(0);
      }
    }
    return i >= this.token.lookAhead && (this.token.lookAhead = i + 1), o;
  }
  /**
  Accept a token. By default, the end of the token is set to the
  current stream position, but you can pass an offset (relative to
  the stream position) to change that.
  */
  acceptToken(e, n = 0) {
    let i = n ? this.resolveOffset(n, -1) : this.pos;
    if (i == null || i < this.token.start)
      throw new RangeError("Token end out of bounds");
    this.token.value = e, this.token.end = i;
  }
  /**
  Accept a token ending at a specific given position.
  */
  acceptTokenTo(e, n) {
    this.token.value = e, this.token.end = n;
  }
  getChunk() {
    if (this.pos >= this.chunk2Pos && this.pos < this.chunk2Pos + this.chunk2.length) {
      let { chunk: e, chunkPos: n } = this;
      this.chunk = this.chunk2, this.chunkPos = this.chunk2Pos, this.chunk2 = e, this.chunk2Pos = n, this.chunkOff = this.pos - this.chunkPos;
    } else {
      this.chunk2 = this.chunk, this.chunk2Pos = this.chunkPos;
      let e = this.input.chunk(this.pos), n = this.pos + e.length;
      this.chunk = n > this.range.to ? e.slice(0, this.range.to - this.pos) : e, this.chunkPos = this.pos, this.chunkOff = 0;
    }
  }
  readNext() {
    return this.chunkOff >= this.chunk.length && (this.getChunk(), this.chunkOff == this.chunk.length) ? this.next = -1 : this.next = this.chunk.charCodeAt(this.chunkOff);
  }
  /**
  Move the stream forward N (defaults to 1) code units. Returns
  the new value of [`next`](#lr.InputStream.next).
  */
  advance(e = 1) {
    for (this.chunkOff += e; this.pos + e >= this.range.to; ) {
      if (this.rangeIndex == this.ranges.length - 1)
        return this.setDone();
      e -= this.range.to - this.pos, this.range = this.ranges[++this.rangeIndex], this.pos = this.range.from;
    }
    return this.pos += e, this.pos >= this.token.lookAhead && (this.token.lookAhead = this.pos + 1), this.readNext();
  }
  setDone() {
    return this.pos = this.chunkPos = this.end, this.range = this.ranges[this.rangeIndex = this.ranges.length - 1], this.chunk = "", this.next = -1;
  }
  /**
  @internal
  */
  reset(e, n) {
    if (n ? (this.token = n, n.start = e, n.lookAhead = e + 1, n.value = n.extended = -1) : this.token = YM, this.pos != e) {
      if (this.pos = e, e == this.end)
        return this.setDone(), this;
      for (; e < this.range.from; )
        this.range = this.ranges[--this.rangeIndex];
      for (; e >= this.range.to; )
        this.range = this.ranges[++this.rangeIndex];
      e >= this.chunkPos && e < this.chunkPos + this.chunk.length ? this.chunkOff = e - this.chunkPos : (this.chunk = "", this.chunkOff = 0), this.readNext();
    }
    return this;
  }
  /**
  @internal
  */
  read(e, n) {
    if (e >= this.chunkPos && n <= this.chunkPos + this.chunk.length)
      return this.chunk.slice(e - this.chunkPos, n - this.chunkPos);
    if (e >= this.chunk2Pos && n <= this.chunk2Pos + this.chunk2.length)
      return this.chunk2.slice(e - this.chunk2Pos, n - this.chunk2Pos);
    if (e >= this.range.from && n <= this.range.to)
      return this.input.read(e, n);
    let i = "";
    for (let o of this.ranges) {
      if (o.from >= n)
        break;
      o.to > e && (i += this.input.read(Math.max(o.from, e), Math.min(o.to, n)));
    }
    return i;
  }
}
class Of {
  constructor(e, n) {
    this.data = e, this.id = n;
  }
  token(e, n) {
    let { parser: i } = n.p;
    e8(this.data, e, n, this.id, i.data, i.tokenPrecTable);
  }
}
Of.prototype.contextual = Of.prototype.fallback = Of.prototype.extend = !1;
class ew {
  constructor(e, n, i) {
    this.precTable = n, this.elseToken = i, this.data = typeof e == "string" ? Jh(e) : e;
  }
  token(e, n) {
    let i = e.pos, o = 0;
    for (; ; ) {
      let r = e.next < 0, a = e.resolveOffset(1, 1);
      if (e8(this.data, e, n, 0, this.data, this.precTable), e.token.value > -1)
        break;
      if (this.elseToken == null)
        return;
      if (r || o++, a == null)
        break;
      e.reset(a, e.token);
    }
    o && (e.reset(i, e.token), e.acceptToken(this.elseToken, o));
  }
}
ew.prototype.contextual = Of.prototype.fallback = Of.prototype.extend = !1;
class Mg {
  /**
  Create a tokenizer. The first argument is the function that,
  given an input stream, scans for the types of tokens it
  recognizes at the stream's position, and calls
  [`acceptToken`](#lr.InputStream.acceptToken) when it finds
  one.
  */
  constructor(e, n = {}) {
    this.token = e, this.contextual = !!n.contextual, this.fallback = !!n.fallback, this.extend = !!n.extend;
  }
}
function e8(t, e, n, i, o, r) {
  let a = 0, l = 1 << i, { dialect: s } = n.p.parser;
  e: for (; (l & t[a]) != 0; ) {
    let u = t[a + 1];
    for (let h = a + 3; h < u; h += 2)
      if ((t[h + 1] & l) > 0) {
        let p = t[h];
        if (s.allows(p) && (e.token.value == -1 || e.token.value == p || GOe(p, e.token.value, o, r))) {
          e.acceptToken(p);
          break;
        }
      }
    let c = e.next, d = 0, f = t[a + 2];
    if (e.next < 0 && f > d && t[u + f * 3 - 3] == 65535) {
      a = t[u + f * 3 - 1];
      continue e;
    }
    for (; d < f; ) {
      let h = d + f >> 1, p = u + h + (h << 1), g = t[p], m = t[p + 1] || 65536;
      if (c < g)
        f = h;
      else if (c >= m)
        d = h + 1;
      else {
        a = t[p + 2], e.advance();
        continue e;
      }
    }
    break;
  }
}
function KM(t, e, n) {
  for (let i = e, o; (o = t[i]) != 65535; i++)
    if (o == n)
      return i - e;
  return -1;
}
function GOe(t, e, n, i) {
  let o = KM(n, i, e);
  return o < 0 || KM(n, i, t) < o;
}
const kr = typeof process < "u" && process.env && /\bparse\b/.test(process.env.LOG);
let dx = null;
function XM(t, e, n) {
  let i = t.cursor(Li.IncludeAnonymous);
  for (i.moveTo(e); ; )
    if (!(n < 0 ? i.childBefore(e) : i.childAfter(e)))
      for (; ; ) {
        if ((n < 0 ? i.to < e : i.from > e) && !i.type.isError)
          return n < 0 ? Math.max(0, Math.min(
            i.to - 1,
            e - 25
            /* Lookahead.Margin */
          )) : Math.min(t.length, Math.max(
            i.from + 1,
            e + 25
            /* Lookahead.Margin */
          ));
        if (n < 0 ? i.prevSibling() : i.nextSibling())
          break;
        if (!i.parent())
          return n < 0 ? 0 : t.length;
      }
}
class UOe {
  constructor(e, n) {
    this.fragments = e, this.nodeSet = n, this.i = 0, this.fragment = null, this.safeFrom = -1, this.safeTo = -1, this.trees = [], this.start = [], this.index = [], this.nextFragment();
  }
  nextFragment() {
    let e = this.fragment = this.i == this.fragments.length ? null : this.fragments[this.i++];
    if (e) {
      for (this.safeFrom = e.openStart ? XM(e.tree, e.from + e.offset, 1) - e.offset : e.from, this.safeTo = e.openEnd ? XM(e.tree, e.to + e.offset, -1) - e.offset : e.to; this.trees.length; )
        this.trees.pop(), this.start.pop(), this.index.pop();
      this.trees.push(e.tree), this.start.push(-e.offset), this.index.push(0), this.nextStart = this.safeFrom;
    } else
      this.nextStart = 1e9;
  }
  // `pos` must be >= any previously given `pos` for this cursor
  nodeAt(e) {
    if (e < this.nextStart)
      return null;
    for (; this.fragment && this.safeTo <= e; )
      this.nextFragment();
    if (!this.fragment)
      return null;
    for (; ; ) {
      let n = this.trees.length - 1;
      if (n < 0)
        return this.nextFragment(), null;
      let i = this.trees[n], o = this.index[n];
      if (o == i.children.length) {
        this.trees.pop(), this.start.pop(), this.index.pop();
        continue;
      }
      let r = i.children[o], a = this.start[n] + i.positions[o];
      if (a > e)
        return this.nextStart = a, null;
      if (r instanceof Ui) {
        if (a == e) {
          if (a < this.safeFrom)
            return null;
          let l = a + r.length;
          if (l <= this.safeTo) {
            let s = r.prop(ei.lookAhead);
            if (!s || l + s < this.fragment.to)
              return r;
          }
        }
        this.index[n]++, a + r.length >= Math.max(this.safeFrom, e) && (this.trees.push(r), this.start.push(a), this.index.push(0));
      } else
        this.index[n]++, this.nextStart = a + r.length;
    }
  }
}
class JOe {
  constructor(e, n) {
    this.stream = n, this.tokens = [], this.mainToken = null, this.actions = [], this.tokens = e.tokenizers.map((i) => new Pv());
  }
  getActions(e) {
    let n = 0, i = null, { parser: o } = e.p, { tokenizers: r } = o, a = o.stateSlot(
      e.state,
      3
      /* ParseState.TokenizerMask */
    ), l = e.curContext ? e.curContext.hash : 0, s = 0;
    for (let u = 0; u < r.length; u++) {
      if ((1 << u & a) == 0)
        continue;
      let c = r[u], d = this.tokens[u];
      if (!(i && !c.fallback) && ((c.contextual || d.start != e.pos || d.mask != a || d.context != l) && (this.updateCachedToken(d, c, e), d.mask = a, d.context = l), d.lookAhead > d.end + 25 && (s = Math.max(d.lookAhead, s)), d.value != 0)) {
        let f = n;
        if (d.extended > -1 && (n = this.addActions(e, d.extended, d.end, n)), n = this.addActions(e, d.value, d.end, n), !c.extend && (i = d, n > f))
          break;
      }
    }
    for (; this.actions.length > n; )
      this.actions.pop();
    return s && e.setLookAhead(s), !i && e.pos == this.stream.end && (i = new Pv(), i.value = e.p.parser.eofTerm, i.start = i.end = e.pos, n = this.addActions(e, i.value, i.end, n)), this.mainToken = i, this.actions;
  }
  getMainToken(e) {
    if (this.mainToken)
      return this.mainToken;
    let n = new Pv(), { pos: i, p: o } = e;
    return n.start = i, n.end = Math.min(i + 1, o.stream.end), n.value = i == o.stream.end ? o.parser.eofTerm : 0, n;
  }
  updateCachedToken(e, n, i) {
    let o = this.stream.clipPos(i.pos);
    if (n.token(this.stream.reset(o, e), i), e.value > -1) {
      let { parser: r } = i.p;
      for (let a = 0; a < r.specialized.length; a++)
        if (r.specialized[a] == e.value) {
          let l = r.specializers[a](this.stream.read(e.start, e.end), i);
          if (l >= 0 && i.p.parser.dialect.allows(l >> 1)) {
            (l & 1) == 0 ? e.value = l >> 1 : e.extended = l >> 1;
            break;
          }
        }
    } else
      e.value = 0, e.end = this.stream.clipPos(o + 1);
  }
  putAction(e, n, i, o) {
    for (let r = 0; r < o; r += 3)
      if (this.actions[r] == e)
        return o;
    return this.actions[o++] = e, this.actions[o++] = n, this.actions[o++] = i, o;
  }
  addActions(e, n, i, o) {
    let { state: r } = e, { parser: a } = e.p, { data: l } = a;
    for (let s = 0; s < 2; s++)
      for (let u = a.stateSlot(
        r,
        s ? 2 : 1
        /* ParseState.Actions */
      ); ; u += 3) {
        if (l[u] == 65535)
          if (l[u + 1] == 1)
            u = rs(l, u + 2);
          else {
            o == 0 && l[u + 1] == 2 && (o = this.putAction(rs(l, u + 2), n, i, o));
            break;
          }
        l[u] == n && (o = this.putAction(rs(l, u + 1), n, i, o));
      }
    return o;
  }
}
class eSe {
  constructor(e, n, i, o) {
    this.parser = e, this.input = n, this.ranges = o, this.recovering = 0, this.nextStackID = 9812, this.minStackPos = 0, this.reused = [], this.stoppedAt = null, this.lastBigReductionStart = -1, this.lastBigReductionSize = 0, this.bigReductionCount = 0, this.stream = new ZOe(n, o), this.tokens = new JOe(e, this.stream), this.topTerm = e.top[1];
    let { from: r } = o[0];
    this.stacks = [P0.start(this, e.top[0], r)], this.fragments = i.length && this.stream.end - r > e.bufferLength * 4 ? new UOe(i, e.nodeSet) : null;
  }
  get parsedPos() {
    return this.minStackPos;
  }
  // Move the parser forward. This will process all parse stacks at
  // `this.pos` and try to advance them to a further position. If no
  // stack for such a position is found, it'll start error-recovery.
  //
  // When the parse is finished, this will return a syntax tree. When
  // not, it returns `null`.
  advance() {
    let e = this.stacks, n = this.minStackPos, i = this.stacks = [], o, r;
    if (this.bigReductionCount > 300 && e.length == 1) {
      let [a] = e;
      for (; a.forceReduce() && a.stack.length && a.stack[a.stack.length - 2] >= this.lastBigReductionStart; )
        ;
      this.bigReductionCount = this.lastBigReductionSize = 0;
    }
    for (let a = 0; a < e.length; a++) {
      let l = e[a];
      for (; ; ) {
        if (this.tokens.mainToken = null, l.pos > n)
          i.push(l);
        else {
          if (this.advanceStack(l, i, e))
            continue;
          {
            o || (o = [], r = []), o.push(l);
            let s = this.tokens.getMainToken(l);
            r.push(s.value, s.end);
          }
        }
        break;
      }
    }
    if (!i.length) {
      let a = o && iSe(o);
      if (a)
        return kr && console.log("Finish with " + this.stackID(a)), this.stackToTree(a);
      if (this.parser.strict)
        throw kr && o && console.log("Stuck with token " + (this.tokens.mainToken ? this.parser.getName(this.tokens.mainToken.value) : "none")), new SyntaxError("No parse at " + n);
      this.recovering || (this.recovering = 5);
    }
    if (this.recovering && o) {
      let a = this.stoppedAt != null && o[0].pos > this.stoppedAt ? o[0] : this.runRecovery(o, r, i);
      if (a)
        return kr && console.log("Force-finish " + this.stackID(a)), this.stackToTree(a.forceAll());
    }
    if (this.recovering) {
      let a = this.recovering == 1 ? 1 : this.recovering * 3;
      if (i.length > a)
        for (i.sort((l, s) => s.score - l.score); i.length > a; )
          i.pop();
      i.some((l) => l.reducePos > n) && this.recovering--;
    } else if (i.length > 1) {
      e: for (let a = 0; a < i.length - 1; a++) {
        let l = i[a];
        for (let s = a + 1; s < i.length; s++) {
          let u = i[s];
          if (l.sameState(u) || l.buffer.length > 500 && u.buffer.length > 500)
            if ((l.score - u.score || l.buffer.length - u.buffer.length) > 0)
              i.splice(s--, 1);
            else {
              i.splice(a--, 1);
              continue e;
            }
        }
      }
      i.length > 12 && (i.sort((a, l) => l.score - a.score), i.splice(
        12,
        i.length - 12
        /* Rec.MaxStackCount */
      ));
    }
    this.minStackPos = i[0].pos;
    for (let a = 1; a < i.length; a++)
      i[a].pos < this.minStackPos && (this.minStackPos = i[a].pos);
    return null;
  }
  stopAt(e) {
    if (this.stoppedAt != null && this.stoppedAt < e)
      throw new RangeError("Can't move stoppedAt forward");
    this.stoppedAt = e;
  }
  // Returns an updated version of the given stack, or null if the
  // stack can't advance normally. When `split` and `stacks` are
  // given, stacks split off by ambiguous operations will be pushed to
  // `split`, or added to `stacks` if they move `pos` forward.
  advanceStack(e, n, i) {
    let o = e.pos, { parser: r } = this, a = kr ? this.stackID(e) + " -> " : "";
    if (this.stoppedAt != null && o > this.stoppedAt)
      return e.forceReduce() ? e : null;
    if (this.fragments) {
      let u = e.curContext && e.curContext.tracker.strict, c = u ? e.curContext.hash : 0;
      for (let d = this.fragments.nodeAt(o); d; ) {
        let f = this.parser.nodeSet.types[d.type.id] == d.type ? r.getGoto(e.state, d.type.id) : -1;
        if (f > -1 && d.length && (!u || (d.prop(ei.contextHash) || 0) == c))
          return e.useNode(d, f), kr && console.log(a + this.stackID(e) + ` (via reuse of ${r.getName(d.type.id)})`), !0;
        if (!(d instanceof Ui) || d.children.length == 0 || d.positions[0] > 0)
          break;
        let h = d.children[0];
        if (h instanceof Ui && d.positions[0] == 0)
          d = h;
        else
          break;
      }
    }
    let l = r.stateSlot(
      e.state,
      4
      /* ParseState.DefaultReduce */
    );
    if (l > 0)
      return e.reduce(l), kr && console.log(a + this.stackID(e) + ` (via always-reduce ${r.getName(
        l & 65535
        /* Action.ValueMask */
      )})`), !0;
    if (e.stack.length >= 8400)
      for (; e.stack.length > 6e3 && e.forceReduce(); )
        ;
    let s = this.tokens.getActions(e);
    for (let u = 0; u < s.length; ) {
      let c = s[u++], d = s[u++], f = s[u++], h = u == s.length || !i, p = h ? e : e.split(), g = this.tokens.mainToken;
      if (p.apply(c, d, g ? g.start : p.pos, f), kr && console.log(a + this.stackID(p) + ` (via ${(c & 65536) == 0 ? "shift" : `reduce of ${r.getName(
        c & 65535
        /* Action.ValueMask */
      )}`} for ${r.getName(d)} @ ${o}${p == e ? "" : ", split"})`), h)
        return !0;
      p.pos > o ? n.push(p) : i.push(p);
    }
    return !1;
  }
  // Advance a given stack forward as far as it will go. Returns the
  // (possibly updated) stack if it got stuck, or null if it moved
  // forward and was given to `pushStackDedup`.
  advanceFully(e, n) {
    let i = e.pos;
    for (; ; ) {
      if (!this.advanceStack(e, null, null))
        return !1;
      if (e.pos > i)
        return ZM(e, n), !0;
    }
  }
  runRecovery(e, n, i) {
    let o = null, r = !1;
    for (let a = 0; a < e.length; a++) {
      let l = e[a], s = n[a << 1], u = n[(a << 1) + 1], c = kr ? this.stackID(l) + " -> " : "";
      if (l.deadEnd && (r || (r = !0, l.restart(), kr && console.log(c + this.stackID(l) + " (restarted)"), this.advanceFully(l, i))))
        continue;
      let d = l.split(), f = c;
      for (let h = 0; h < 10 && d.forceReduce() && (kr && console.log(f + this.stackID(d) + " (via force-reduce)"), !this.advanceFully(d, i)); h++)
        kr && (f = this.stackID(d) + " -> ");
      for (let h of l.recoverByInsert(s))
        kr && console.log(c + this.stackID(h) + " (via recover-insert)"), this.advanceFully(h, i);
      this.stream.end > l.pos ? (u == l.pos && (u++, s = 0), l.recoverByDelete(s, u), kr && console.log(c + this.stackID(l) + ` (via recover-delete ${this.parser.getName(s)})`), ZM(l, i)) : (!o || o.score < d.score) && (o = d);
    }
    return o;
  }
  // Convert the stack's buffer to a syntax tree.
  stackToTree(e) {
    return e.close(), Ui.build({
      buffer: E0.create(e),
      nodeSet: this.parser.nodeSet,
      topID: this.topTerm,
      maxBufferLength: this.parser.bufferLength,
      reused: this.reused,
      start: this.ranges[0].from,
      length: e.pos - this.ranges[0].from,
      minRepeatType: this.parser.minRepeatTerm
    });
  }
  stackID(e) {
    let n = (dx || (dx = /* @__PURE__ */ new WeakMap())).get(e);
    return n || dx.set(e, n = String.fromCodePoint(this.nextStackID++)), n + e;
  }
}
function ZM(t, e) {
  for (let n = 0; n < e.length; n++) {
    let i = e[n];
    if (i.pos == t.pos && i.sameState(t)) {
      e[n].score < t.score && (e[n] = t);
      return;
    }
  }
  e.push(t);
}
class tSe {
  constructor(e, n, i) {
    this.source = e, this.flags = n, this.disabled = i;
  }
  allows(e) {
    return !this.disabled || this.disabled[e] == 0;
  }
}
const fx = (t) => t;
class nSe {
  /**
  Define a context tracker.
  */
  constructor(e) {
    this.start = e.start, this.shift = e.shift || fx, this.reduce = e.reduce || fx, this.reuse = e.reuse || fx, this.hash = e.hash || (() => 0), this.strict = e.strict !== !1;
  }
}
class _0 extends B6 {
  /**
  @internal
  */
  constructor(e) {
    if (super(), this.wrappers = [], e.version != 14)
      throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);
    let n = e.nodeNames.split(" ");
    this.minRepeatTerm = n.length;
    for (let l = 0; l < e.repeatNodeCount; l++)
      n.push("");
    let i = Object.keys(e.topRules).map((l) => e.topRules[l][1]), o = [];
    for (let l = 0; l < n.length; l++)
      o.push([]);
    function r(l, s, u) {
      o[l].push([s, s.deserialize(String(u))]);
    }
    if (e.nodeProps)
      for (let l of e.nodeProps) {
        let s = l[0];
        typeof s == "string" && (s = ei[s]);
        for (let u = 1; u < l.length; ) {
          let c = l[u++];
          if (c >= 0)
            r(c, s, l[u++]);
          else {
            let d = l[u + -c];
            for (let f = -c; f > 0; f--)
              r(l[u++], s, d);
            u++;
          }
        }
      }
    this.nodeSet = new mk(n.map((l, s) => Sr.define({
      name: s >= this.minRepeatTerm ? void 0 : l,
      id: s,
      props: o[s],
      top: i.indexOf(s) > -1,
      error: s == 0,
      skipped: e.skippedNodes && e.skippedNodes.indexOf(s) > -1
    }))), e.propSources && (this.nodeSet = this.nodeSet.extend(...e.propSources)), this.strict = !1, this.bufferLength = D6;
    let a = Jh(e.tokenData);
    this.context = e.context, this.specializerSpecs = e.specialized || [], this.specialized = new Uint16Array(this.specializerSpecs.length);
    for (let l = 0; l < this.specializerSpecs.length; l++)
      this.specialized[l] = this.specializerSpecs[l].term;
    this.specializers = this.specializerSpecs.map(GM), this.states = Jh(e.states, Uint32Array), this.data = Jh(e.stateData), this.goto = Jh(e.goto), this.maxTerm = e.maxTerm, this.tokenizers = e.tokenizers.map((l) => typeof l == "number" ? new Of(a, l) : l), this.topRules = e.topRules, this.dialects = e.dialects || {}, this.dynamicPrecedences = e.dynamicPrecedences || null, this.tokenPrecTable = e.tokenPrec, this.termNames = e.termNames || null, this.maxNode = this.nodeSet.types.length - 1, this.dialect = this.parseDialect(), this.top = this.topRules[Object.keys(this.topRules)[0]];
  }
  createParse(e, n, i) {
    let o = new eSe(this, e, n, i);
    for (let r of this.wrappers)
      o = r(o, e, n, i);
    return o;
  }
  /**
  Get a goto table entry @internal
  */
  getGoto(e, n, i = !1) {
    let o = this.goto;
    if (n >= o[0])
      return -1;
    for (let r = o[n + 1]; ; ) {
      let a = o[r++], l = a & 1, s = o[r++];
      if (l && i)
        return s;
      for (let u = r + (a >> 1); r < u; r++)
        if (o[r] == e)
          return s;
      if (l)
        return -1;
    }
  }
  /**
  Check if this state has an action for a given terminal @internal
  */
  hasAction(e, n) {
    let i = this.data;
    for (let o = 0; o < 2; o++)
      for (let r = this.stateSlot(
        e,
        o ? 2 : 1
        /* ParseState.Actions */
      ), a; ; r += 3) {
        if ((a = i[r]) == 65535)
          if (i[r + 1] == 1)
            a = i[r = rs(i, r + 2)];
          else {
            if (i[r + 1] == 2)
              return rs(i, r + 2);
            break;
          }
        if (a == n || a == 0)
          return rs(i, r + 1);
      }
    return 0;
  }
  /**
  @internal
  */
  stateSlot(e, n) {
    return this.states[e * 6 + n];
  }
  /**
  @internal
  */
  stateFlag(e, n) {
    return (this.stateSlot(
      e,
      0
      /* ParseState.Flags */
    ) & n) > 0;
  }
  /**
  @internal
  */
  validAction(e, n) {
    return !!this.allActions(e, (i) => i == n ? !0 : null);
  }
  /**
  @internal
  */
  allActions(e, n) {
    let i = this.stateSlot(
      e,
      4
      /* ParseState.DefaultReduce */
    ), o = i ? n(i) : void 0;
    for (let r = this.stateSlot(
      e,
      1
      /* ParseState.Actions */
    ); o == null; r += 3) {
      if (this.data[r] == 65535)
        if (this.data[r + 1] == 1)
          r = rs(this.data, r + 2);
        else
          break;
      o = n(rs(this.data, r + 1));
    }
    return o;
  }
  /**
  Get the states that can follow this one through shift actions or
  goto jumps. @internal
  */
  nextStates(e) {
    let n = [];
    for (let i = this.stateSlot(
      e,
      1
      /* ParseState.Actions */
    ); ; i += 3) {
      if (this.data[i] == 65535)
        if (this.data[i + 1] == 1)
          i = rs(this.data, i + 2);
        else
          break;
      if ((this.data[i + 2] & 1) == 0) {
        let o = this.data[i + 1];
        n.some((r, a) => a & 1 && r == o) || n.push(this.data[i], o);
      }
    }
    return n;
  }
  /**
  Configure the parser. Returns a new parser instance that has the
  given settings modified. Settings not provided in `config` are
  kept from the original parser.
  */
  configure(e) {
    let n = Object.assign(Object.create(_0.prototype), this);
    if (e.props && (n.nodeSet = this.nodeSet.extend(...e.props)), e.top) {
      let i = this.topRules[e.top];
      if (!i)
        throw new RangeError(`Invalid top rule name ${e.top}`);
      n.top = i;
    }
    return e.tokenizers && (n.tokenizers = this.tokenizers.map((i) => {
      let o = e.tokenizers.find((r) => r.from == i);
      return o ? o.to : i;
    })), e.specializers && (n.specializers = this.specializers.slice(), n.specializerSpecs = this.specializerSpecs.map((i, o) => {
      let r = e.specializers.find((l) => l.from == i.external);
      if (!r)
        return i;
      let a = Object.assign(Object.assign({}, i), { external: r.to });
      return n.specializers[o] = GM(a), a;
    })), e.contextTracker && (n.context = e.contextTracker), e.dialect && (n.dialect = this.parseDialect(e.dialect)), e.strict != null && (n.strict = e.strict), e.wrap && (n.wrappers = n.wrappers.concat(e.wrap)), e.bufferLength != null && (n.bufferLength = e.bufferLength), n;
  }
  /**
  Tells you whether any [parse wrappers](#lr.ParserConfig.wrap)
  are registered for this parser.
  */
  hasWrappers() {
    return this.wrappers.length > 0;
  }
  /**
  Returns the name associated with a given term. This will only
  work for all terms when the parser was generated with the
  `--names` option. By default, only the names of tagged terms are
  stored.
  */
  getName(e) {
    return this.termNames ? this.termNames[e] : String(e <= this.maxNode && this.nodeSet.types[e].name || e);
  }
  /**
  The eof term id is always allocated directly after the node
  types. @internal
  */
  get eofTerm() {
    return this.maxNode + 1;
  }
  /**
  The type of top node produced by the parser.
  */
  get topNode() {
    return this.nodeSet.types[this.top[1]];
  }
  /**
  @internal
  */
  dynamicPrecedence(e) {
    let n = this.dynamicPrecedences;
    return n == null ? 0 : n[e] || 0;
  }
  /**
  @internal
  */
  parseDialect(e) {
    let n = Object.keys(this.dialects), i = n.map(() => !1);
    if (e)
      for (let r of e.split(" ")) {
        let a = n.indexOf(r);
        a >= 0 && (i[a] = !0);
      }
    let o = null;
    for (let r = 0; r < n.length; r++)
      if (!i[r])
        for (let a = this.dialects[n[r]], l; (l = this.data[a++]) != 65535; )
          (o || (o = new Uint8Array(this.maxTerm + 1)))[l] = 1;
    return new tSe(e, i, o);
  }
  /**
  Used by the output of the parser generator. Not available to
  user code. @hide
  */
  static deserialize(e) {
    return new _0(e);
  }
}
function rs(t, e) {
  return t[e] | t[e + 1] << 16;
}
function iSe(t) {
  let e = null;
  for (let n of t) {
    let i = n.p.stoppedAt;
    (n.pos == n.p.stream.end || i != null && n.pos > i) && n.p.parser.stateFlag(
      n.state,
      2
      /* StateFlag.Accepting */
    ) && (!e || e.score < n.score) && (e = n);
  }
  return e;
}
function GM(t) {
  if (t.external) {
    let e = t.extend ? 1 : 0;
    return (n, i) => t.external(n, i) << 1 | e;
  }
  return t.get;
}
const oSe = 316, rSe = 317, UM = 1, aSe = 2, lSe = 3, sSe = 4, uSe = 318, cSe = 320, dSe = 321, fSe = 5, hSe = 6, pSe = 0, tw = [
  9,
  10,
  11,
  12,
  13,
  32,
  133,
  160,
  5760,
  8192,
  8193,
  8194,
  8195,
  8196,
  8197,
  8198,
  8199,
  8200,
  8201,
  8202,
  8232,
  8233,
  8239,
  8287,
  12288
], t8 = 125, gSe = 59, nw = 47, mSe = 42, vSe = 43, ySe = 45, bSe = 60, xSe = 44, OSe = 63, SSe = 46, wSe = 91, CSe = new nSe({
  start: !1,
  shift(t, e) {
    return e == fSe || e == hSe || e == cSe ? t : e == dSe;
  },
  strict: !1
}), $Se = new Mg((t, e) => {
  let { next: n } = t;
  (n == t8 || n == -1 || e.context) && t.acceptToken(uSe);
}, { contextual: !0, fallback: !0 }), kSe = new Mg((t, e) => {
  let { next: n } = t, i;
  tw.indexOf(n) > -1 || n == nw && ((i = t.peek(1)) == nw || i == mSe) || n != t8 && n != gSe && n != -1 && !e.context && t.acceptToken(oSe);
}, { contextual: !0 }), TSe = new Mg((t, e) => {
  t.next == wSe && !e.context && t.acceptToken(rSe);
}, { contextual: !0 }), PSe = new Mg((t, e) => {
  let { next: n } = t;
  if (n == vSe || n == ySe) {
    if (t.advance(), n == t.next) {
      t.advance();
      let i = !e.context && e.canShift(UM);
      t.acceptToken(i ? UM : aSe);
    }
  } else n == OSe && t.peek(1) == SSe && (t.advance(), t.advance(), (t.next < 48 || t.next > 57) && t.acceptToken(lSe));
}, { contextual: !0 });
function hx(t, e) {
  return t >= 65 && t <= 90 || t >= 97 && t <= 122 || t == 95 || t >= 192 || !e && t >= 48 && t <= 57;
}
const ESe = new Mg((t, e) => {
  if (t.next != bSe || !e.dialectEnabled(pSe) || (t.advance(), t.next == nw)) return;
  let n = 0;
  for (; tw.indexOf(t.next) > -1; )
    t.advance(), n++;
  if (hx(t.next, !0)) {
    for (t.advance(), n++; hx(t.next, !1); )
      t.advance(), n++;
    for (; tw.indexOf(t.next) > -1; )
      t.advance(), n++;
    if (t.next == xSe) return;
    for (let i = 0; ; i++) {
      if (i == 7) {
        if (!hx(t.next, !0)) return;
        break;
      }
      if (t.next != "extends".charCodeAt(i)) break;
      t.advance(), n++;
    }
  }
  t.acceptToken(sSe, -n);
}), _Se = F6({
  "get set async static": Ge.modifier,
  "for while do if else switch try catch finally return throw break continue default case defer": Ge.controlKeyword,
  "in of await yield void typeof delete instanceof as satisfies": Ge.operatorKeyword,
  "let var const using function class extends": Ge.definitionKeyword,
  "import export from": Ge.moduleKeyword,
  "with debugger new": Ge.keyword,
  TemplateString: Ge.special(Ge.string),
  super: Ge.atom,
  BooleanLiteral: Ge.bool,
  this: Ge.self,
  null: Ge.null,
  Star: Ge.modifier,
  VariableName: Ge.variableName,
  "CallExpression/VariableName TaggedTemplateExpression/VariableName": Ge.function(Ge.variableName),
  VariableDefinition: Ge.definition(Ge.variableName),
  Label: Ge.labelName,
  PropertyName: Ge.propertyName,
  PrivatePropertyName: Ge.special(Ge.propertyName),
  "CallExpression/MemberExpression/PropertyName": Ge.function(Ge.propertyName),
  "FunctionDeclaration/VariableDefinition": Ge.function(Ge.definition(Ge.variableName)),
  "ClassDeclaration/VariableDefinition": Ge.definition(Ge.className),
  "NewExpression/VariableName": Ge.className,
  PropertyDefinition: Ge.definition(Ge.propertyName),
  PrivatePropertyDefinition: Ge.definition(Ge.special(Ge.propertyName)),
  UpdateOp: Ge.updateOperator,
  "LineComment Hashbang": Ge.lineComment,
  BlockComment: Ge.blockComment,
  Number: Ge.number,
  String: Ge.string,
  Escape: Ge.escape,
  ArithOp: Ge.arithmeticOperator,
  LogicOp: Ge.logicOperator,
  BitOp: Ge.bitwiseOperator,
  CompareOp: Ge.compareOperator,
  RegExp: Ge.regexp,
  Equals: Ge.definitionOperator,
  Arrow: Ge.function(Ge.punctuation),
  ": Spread": Ge.punctuation,
  "( )": Ge.paren,
  "[ ]": Ge.squareBracket,
  "{ }": Ge.brace,
  "InterpolationStart InterpolationEnd": Ge.special(Ge.brace),
  ".": Ge.derefOperator,
  ", ;": Ge.separator,
  "@": Ge.meta,
  TypeName: Ge.typeName,
  TypeDefinition: Ge.definition(Ge.typeName),
  "type enum interface implements namespace module declare": Ge.definitionKeyword,
  "abstract global Privacy readonly override": Ge.modifier,
  "is keyof unique infer asserts": Ge.operatorKeyword,
  JSXAttributeValue: Ge.attributeValue,
  JSXText: Ge.content,
  "JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag": Ge.angleBracket,
  "JSXIdentifier JSXNameSpacedName": Ge.tagName,
  "JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName": Ge.attributeName,
  "JSXBuiltin/JSXIdentifier": Ge.standard(Ge.tagName)
}), ISe = { __proto__: null, export: 20, as: 25, from: 33, default: 36, async: 41, function: 42, in: 52, out: 55, const: 56, extends: 60, this: 64, true: 72, false: 72, null: 84, void: 88, typeof: 92, super: 108, new: 142, delete: 154, yield: 163, await: 167, class: 172, public: 235, private: 235, protected: 235, readonly: 237, instanceof: 256, satisfies: 259, import: 292, keyof: 349, unique: 353, infer: 359, asserts: 395, is: 397, abstract: 417, implements: 419, type: 421, let: 424, var: 426, using: 429, interface: 435, enum: 439, namespace: 445, module: 447, declare: 451, global: 455, defer: 471, for: 476, of: 485, while: 488, with: 492, do: 496, if: 500, else: 502, switch: 506, case: 512, try: 518, catch: 522, finally: 526, return: 530, throw: 534, break: 538, continue: 542, debugger: 546 }, MSe = { __proto__: null, async: 129, get: 131, set: 133, declare: 195, public: 197, private: 197, protected: 197, static: 199, abstract: 201, override: 203, readonly: 209, accessor: 211, new: 401 }, ASe = { __proto__: null, "<": 193 }, RSe = _0.deserialize({
  version: 14,
  states: "$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#IQO?jQ!0LsO'#ISO?uQ!0LsO'#IUO9uQ!0LrO'#IWO@QQ!0MxO'#CiOASQpO'#DlQOQ`OOO%[QlO'#EQOAjQ`O'#ETO:dQMhO'#EnOAuQ`O'#EnOBQQ!bO'#FeOOQ['#Cg'#CgOOQ!0Lb'#Dq'#DqOOQ!0Lb'#Jv'#JvO%[QlO'#JvOOQO'#Jy'#JyOOQO'#Ih'#IhOCQQpO'#EgOOQ!0Lb'#Ef'#EfOOQ!0Lb'#J}'#J}OC|Q!0MSO'#EgODWQpO'#EWOOQO'#Jx'#JxODlQpO'#JyOEyQpO'#EWODWQpO'#EgPFWO&2DjO'#CbPOOO)CD})CD}OOOO'#I`'#I`OFcO#tO,59UOOQ!0Lh,59U,59UOOOO'#Ia'#IaOFqO&jO,59UOGPQ!L^O'#DcOOOO'#Ic'#IcOGWO#@ItO,59{OOQ!0Lf,59{,59{OGfQlO'#IdOGyQ`O'#JtOIxQ!fO'#JtO+}QlO'#JtOJPQ`O,5:ROJgQ`O'#EpOJtQ`O'#KTOKPQ`O'#KSOKPQ`O'#KSOKXQ`O,5;^OK^Q`O'#KROOQ!0Ln,5:^,5:^OKeQlO,5:^OMcQ!0MxO,5:fONSQ`O,5:nONmQ!0LrO'#KQONtQ`O'#KPO9eQ`O'#KPO! YQ`O'#KPO! bQ`O,5;]O! gQ`O'#KPO!#lQ!fO'#JsOOQ!0Lh'#Ci'#CiO%[QlO'#ESO!$[Q!fO,5:sOOQS'#Jz'#JzOOQO-E<j-E<jO9kQ`O,5=_O!$rQ`O,5=_O!$wQlO,5;ZO!&zQMhO'#EkO!(eQ`O,5;ZO!(jQlO'#DyO!(tQpO,5;dO!(|QpO,5;dO%[QlO,5;dOOQ['#FT'#FTOOQ['#FV'#FVO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eOOQ['#FZ'#FZO!)[QlO,5;tOOQ!0Lf,5;y,5;yOOQ!0Lf,5;z,5;zOOQ!0Lf,5;|,5;|O%[QlO'#IpO!+_Q!0LrO,5<iO%[QlO,5;eO!&zQMhO,5;eO!+|QMhO,5;eO!-nQMhO'#E^O%[QlO,5;wOOQ!0Lf,5;{,5;{O!-uQ,UO'#FjO!.rQ,UO'#KXO!.^Q,UO'#KXO!.yQ,UO'#KXOOQO'#KX'#KXO!/_Q,UO,5<SOOOW,5<`,5<`O!/pQlO'#FvOOOW'#Io'#IoO7VO7dO,5<QO!/wQ,UO'#FxOOQ!0Lf,5<Q,5<QO!0hQ$IUO'#CyOOQ!0Lh'#C}'#C}O!0{O#@ItO'#DRO!1iQMjO,5<eO!1pQ`O,5<hO!3YQ(CWO'#GXO!3jQ`O'#GYO!3oQ`O'#GYO!5_Q(CWO'#G^O!6dQpO'#GbOOQO'#Gn'#GnO!,TQMhO'#GmOOQO'#Gp'#GpO!,TQMhO'#GoO!7VQ$IUO'#JlOOQ!0Lh'#Jl'#JlO!7aQ`O'#JkO!7oQ`O'#JjO!7wQ`O'#CuOOQ!0Lh'#C{'#C{O!8YQ`O'#C}OOQ!0Lh'#DV'#DVOOQ!0Lh'#DX'#DXO!8_Q`O,5<eO1SQ`O'#DZO!,TQMhO'#GPO!,TQMhO'#GRO!8gQ`O'#GTO!8lQ`O'#GUO!3oQ`O'#G[O!,TQMhO'#GaO<]Q`O'#JkO!8qQ`O'#EqO!9`Q`O,5<gOOQ!0Lb'#Cr'#CrO!9hQ`O'#ErO!:bQpO'#EsOOQ!0Lb'#KR'#KRO!:iQ!0LrO'#KaO9uQ!0LrO,5=cO`QlO,5>tOOQ['#Jh'#JhOOQ[,5>u,5>uOOQ[-E<]-E<]O!<hQ!0MxO,5:bO!:]QpO,5:`O!?RQ!0MxO,5:jO%[QlO,5:jO!AiQ!0MxO,5:lOOQO,5@z,5@zO!BYQMhO,5=_O!BhQ!0LrO'#JiO9`Q`O'#JiO!ByQ!0LrO,59ZO!CUQpO,59ZO!C^QMhO,59ZO:dQMhO,59ZO!CiQ`O,5;ZO!CqQ`O'#HbO!DVQ`O'#KdO%[QlO,5;}O!:]QpO,5<PO!D_Q`O,5=zO!DdQ`O,5=zO!DiQ`O,5=zO!DwQ`O,5=zO9uQ!0LrO,5=zO<]Q`O,5=jOOQO'#Cy'#CyO!EOQpO,5=gO!EWQMhO,5=hO!EcQ`O,5=jO!EhQ!bO,5=mO!EpQ`O'#K`O?YQ`O'#HWO9kQ`O'#HYO!EuQ`O'#HYO:dQMhO'#H[O!EzQ`O'#H[OOQ[,5=p,5=pO!FPQ`O'#H]O!FbQ`O'#CoO!FgQ`O,59PO!FqQ`O,59PO!HvQlO,59POOQ[,59P,59PO!IWQ!0LrO,59PO%[QlO,59PO!KcQlO'#HeOOQ['#Hf'#HfOOQ['#Hg'#HgO`QlO,5=}O!KyQ`O,5=}O`QlO,5>TO`QlO,5>VO!LOQ`O,5>XO`QlO,5>ZO!LTQ`O,5>^O!LYQlO,5>dOOQ[,5>j,5>jO%[QlO,5>jO9uQ!0LrO,5>lOOQ[,5>n,5>nO#!dQ`O,5>nOOQ[,5>p,5>pO#!dQ`O,5>pOOQ[,5>r,5>rO##QQpO'#D_O%[QlO'#JvO##sQpO'#JvO##}QpO'#DmO#$`QpO'#DmO#&qQlO'#DmO#&xQ`O'#JuO#'QQ`O,5:WO#'VQ`O'#EtO#'eQ`O'#KUO#'mQ`O,5;_O#'rQpO'#DmO#(PQpO'#EVOOQ!0Lf,5:o,5:oO%[QlO,5:oO#(WQ`O,5:oO?YQ`O,5;YO!CUQpO,5;YO!C^QMhO,5;YO:dQMhO,5;YO#(`Q`O,5@bO#(eQ07dO,5:sOOQO-E<f-E<fO#)kQ!0MSO,5;RODWQpO,5:rO#)uQpO,5:rODWQpO,5;RO!ByQ!0LrO,5:rOOQ!0Lb'#Ej'#EjOOQO,5;R,5;RO%[QlO,5;RO#*SQ!0LrO,5;RO#*_Q!0LrO,5;RO!CUQpO,5:rOOQO,5;X,5;XO#*mQ!0LrO,5;RPOOO'#I^'#I^P#+RO&2DjO,58|POOO,58|,58|OOOO-E<^-E<^OOQ!0Lh1G.p1G.pOOOO-E<_-E<_OOOO,59},59}O#+^Q!bO,59}OOOO-E<a-E<aOOQ!0Lf1G/g1G/gO#+cQ!fO,5?OO+}QlO,5?OOOQO,5?U,5?UO#+mQlO'#IdOOQO-E<b-E<bO#+zQ`O,5@`O#,SQ!fO,5@`O#,ZQ`O,5@nOOQ!0Lf1G/m1G/mO%[QlO,5@oO#,cQ`O'#IjOOQO-E<h-E<hO#,ZQ`O,5@nOOQ!0Lb1G0x1G0xOOQ!0Ln1G/x1G/xOOQ!0Ln1G0Y1G0YO%[QlO,5@lO#,wQ!0LrO,5@lO#-YQ!0LrO,5@lO#-aQ`O,5@kO9eQ`O,5@kO#-iQ`O,5@kO#-wQ`O'#ImO#-aQ`O,5@kOOQ!0Lb1G0w1G0wO!(tQpO,5:uO!)PQpO,5:uOOQS,5:w,5:wO#.iQdO,5:wO#.qQMhO1G2yO9kQ`O1G2yOOQ!0Lf1G0u1G0uO#/PQ!0MxO1G0uO#0UQ!0MvO,5;VOOQ!0Lh'#GW'#GWO#0rQ!0MzO'#JlO!$wQlO1G0uO#2}Q!fO'#JwO%[QlO'#JwO#3XQ`O,5:eOOQ!0Lh'#D_'#D_OOQ!0Lf1G1O1G1OO%[QlO1G1OOOQ!0Lf1G1f1G1fO#3^Q`O1G1OO#5rQ!0MxO1G1PO#5yQ!0MxO1G1PO#8aQ!0MxO1G1PO#8hQ!0MxO1G1PO#;OQ!0MxO1G1PO#=fQ!0MxO1G1PO#=mQ!0MxO1G1PO#=tQ!0MxO1G1PO#@[Q!0MxO1G1PO#@cQ!0MxO1G1PO#BpQ?MtO'#CiO#DkQ?MtO1G1`O#DrQ?MtO'#JsO#EVQ!0MxO,5?[OOQ!0Lb-E<n-E<nO#GdQ!0MxO1G1PO#HaQ!0MzO1G1POOQ!0Lf1G1P1G1PO#IdQMjO'#J|O#InQ`O,5:xO#IsQ!0MxO1G1cO#JgQ,UO,5<WO#JoQ,UO,5<XO#JwQ,UO'#FoO#K`Q`O'#FnOOQO'#KY'#KYOOQO'#In'#InO#KeQ,UO1G1nOOQ!0Lf1G1n1G1nOOOW1G1y1G1yO#KvQ?MtO'#JrO#LQQ`O,5<bO!)[QlO,5<bOOOW-E<m-E<mOOQ!0Lf1G1l1G1lO#LVQpO'#KXOOQ!0Lf,5<d,5<dO#L_QpO,5<dO#LdQMhO'#DTOOOO'#Ib'#IbO#LkO#@ItO,59mOOQ!0Lh,59m,59mO%[QlO1G2PO!8lQ`O'#IrO#LvQ`O,5<zOOQ!0Lh,5<w,5<wO!,TQMhO'#IuO#MdQMjO,5=XO!,TQMhO'#IwO#NVQMjO,5=ZO!&zQMhO,5=]OOQO1G2S1G2SO#NaQ!dO'#CrO#NtQ(CWO'#ErO$ |QpO'#GbO$!dQ!dO,5<sO$!kQ`O'#K[O9eQ`O'#K[O$!yQ`O,5<uO$#aQ!dO'#C{O!,TQMhO,5<tO$#kQ`O'#GZO$$PQ`O,5<tO$$UQ!dO'#GWO$$cQ!dO'#K]O$$mQ`O'#K]O!&zQMhO'#K]O$$rQ`O,5<xO$$wQlO'#JvO$%RQpO'#GcO#$`QpO'#GcO$%dQ`O'#GgO!3oQ`O'#GkO$%iQ!0LrO'#ItO$%tQpO,5<|OOQ!0Lp,5<|,5<|O$%{QpO'#GcO$&YQpO'#GdO$&kQpO'#GdO$&pQMjO,5=XO$'QQMjO,5=ZOOQ!0Lh,5=^,5=^O!,TQMhO,5@VO!,TQMhO,5@VO$'bQ`O'#IyO$'vQ`O,5@UO$(OQ`O,59aOOQ!0Lh,59i,59iO$(TQ`O,5@VO$)TQ$IYO,59uOOQ!0Lh'#Jp'#JpO$)vQMjO,5<kO$*iQMjO,5<mO@zQ`O,5<oOOQ!0Lh,5<p,5<pO$*sQ`O,5<vO$*xQMjO,5<{O$+YQ`O'#KPO!$wQlO1G2RO$+_Q`O1G2RO9eQ`O'#KSO9eQ`O'#EtO%[QlO'#EtO9eQ`O'#I{O$+dQ!0LrO,5@{OOQ[1G2}1G2}OOQ[1G4`1G4`OOQ!0Lf1G/|1G/|OOQ!0Lf1G/z1G/zO$-fQ!0MxO1G0UOOQ[1G2y1G2yO!&zQMhO1G2yO%[QlO1G2yO#.tQ`O1G2yO$/jQMhO'#EkOOQ!0Lb,5@T,5@TO$/wQ!0LrO,5@TOOQ[1G.u1G.uO!ByQ!0LrO1G.uO!CUQpO1G.uO!C^QMhO1G.uO$0YQ`O1G0uO$0_Q`O'#CiO$0jQ`O'#KeO$0rQ`O,5=|O$0wQ`O'#KeO$0|Q`O'#KeO$1[Q`O'#JRO$1jQ`O,5AOO$1rQ!fO1G1iOOQ!0Lf1G1k1G1kO9kQ`O1G3fO@zQ`O1G3fO$1yQ`O1G3fO$2OQ`O1G3fO!DiQ`O1G3fO9uQ!0LrO1G3fOOQ[1G3f1G3fO!EcQ`O1G3UO!&zQMhO1G3RO$2TQ`O1G3ROOQ[1G3S1G3SO!&zQMhO1G3SO$2YQ`O1G3SO$2bQpO'#HQOOQ[1G3U1G3UO!6_QpO'#I}O!EhQ!bO1G3XOOQ[1G3X1G3XOOQ[,5=r,5=rO$2jQMhO,5=tO9kQ`O,5=tO$%dQ`O,5=vO9`Q`O,5=vO!CUQpO,5=vO!C^QMhO,5=vO:dQMhO,5=vO$2xQ`O'#KcO$3TQ`O,5=wOOQ[1G.k1G.kO$3YQ!0LrO1G.kO@zQ`O1G.kO$3eQ`O1G.kO9uQ!0LrO1G.kO$5mQ!fO,5AQO$5zQ`O,5AQO9eQ`O,5AQO$6VQlO,5>PO$6^Q`O,5>POOQ[1G3i1G3iO`QlO1G3iOOQ[1G3o1G3oOOQ[1G3q1G3qO?TQ`O1G3sO$6cQlO1G3uO$:gQlO'#HtOOQ[1G3x1G3xO$:tQ`O'#HzO?YQ`O'#H|OOQ[1G4O1G4OO$:|QlO1G4OO9uQ!0LrO1G4UOOQ[1G4W1G4WOOQ!0Lb'#G_'#G_O9uQ!0LrO1G4YO9uQ!0LrO1G4[O$?TQ`O,5@bO!)[QlO,5;`O9eQ`O,5;`O?YQ`O,5:XO!)[QlO,5:XO!CUQpO,5:XO$?YQ?MtO,5:XOOQO,5;`,5;`O$?dQpO'#IeO$?zQ`O,5@aOOQ!0Lf1G/r1G/rO$@SQpO'#IkO$@^Q`O,5@pOOQ!0Lb1G0y1G0yO#$`QpO,5:XOOQO'#Ig'#IgO$@fQpO,5:qOOQ!0Ln,5:q,5:qO#(ZQ`O1G0ZOOQ!0Lf1G0Z1G0ZO%[QlO1G0ZOOQ!0Lf1G0t1G0tO?YQ`O1G0tO!CUQpO1G0tO!C^QMhO1G0tOOQ!0Lb1G5|1G5|O!ByQ!0LrO1G0^OOQO1G0m1G0mO%[QlO1G0mO$@mQ!0LrO1G0mO$@xQ!0LrO1G0mO!CUQpO1G0^ODWQpO1G0^O$AWQ!0LrO1G0mOOQO1G0^1G0^O$AlQ!0MxO1G0mPOOO-E<[-E<[POOO1G.h1G.hOOOO1G/i1G/iO$AvQ!bO,5<iO$BOQ!fO1G4jOOQO1G4p1G4pO%[QlO,5?OO$BYQ`O1G5zO$BbQ`O1G6YO$BjQ!fO1G6ZO9eQ`O,5?UO$BtQ!0MxO1G6WO%[QlO1G6WO$CUQ!0LrO1G6WO$CgQ`O1G6VO$CgQ`O1G6VO9eQ`O1G6VO$CoQ`O,5?XO9eQ`O,5?XOOQO,5?X,5?XO$DTQ`O,5?XO$+YQ`O,5?XOOQO-E<k-E<kOOQS1G0a1G0aOOQS1G0c1G0cO#.lQ`O1G0cOOQ[7+(e7+(eO!&zQMhO7+(eO%[QlO7+(eO$DcQ`O7+(eO$DnQMhO7+(eO$D|Q!0MzO,5=XO$GXQ!0MzO,5=ZO$IdQ!0MzO,5=XO$KuQ!0MzO,5=ZO$NWQ!0MzO,59uO%!]Q!0MzO,5<kO%$hQ!0MzO,5<mO%&sQ!0MzO,5<{OOQ!0Lf7+&a7+&aO%)UQ!0MxO7+&aO%)xQlO'#IfO%*VQ`O,5@cO%*_Q!fO,5@cOOQ!0Lf1G0P1G0PO%*iQ`O7+&jOOQ!0Lf7+&j7+&jO%*nQ?MtO,5:fO%[QlO7+&zO%*xQ?MtO,5:bO%+VQ?MtO,5:jO%+aQ?MtO,5:lO%+kQMhO'#IiO%+uQ`O,5@hOOQ!0Lh1G0d1G0dOOQO1G1r1G1rOOQO1G1s1G1sO%+}Q!jO,5<ZO!)[QlO,5<YOOQO-E<l-E<lOOQ!0Lf7+'Y7+'YOOOW7+'e7+'eOOOW1G1|1G1|O%,YQ`O1G1|OOQ!0Lf1G2O1G2OOOOO,59o,59oO%,_Q!dO,59oOOOO-E<`-E<`OOQ!0Lh1G/X1G/XO%,fQ!0MxO7+'kOOQ!0Lh,5?^,5?^O%-YQMhO1G2fP%-aQ`O'#IrPOQ!0Lh-E<p-E<pO%-}QMjO,5?aOOQ!0Lh-E<s-E<sO%.pQMjO,5?cOOQ!0Lh-E<u-E<uO%.zQ!dO1G2wO%/RQ!dO'#CrO%/iQMhO'#KSO$$wQlO'#JvOOQ!0Lh1G2_1G2_O%/sQ`O'#IqO%0[Q`O,5@vO%0[Q`O,5@vO%0dQ`O,5@vO%0oQ`O,5@vOOQO1G2a1G2aO%0}QMjO1G2`O$+YQ`O'#K[O!,TQMhO1G2`O%1_Q(CWO'#IsO%1lQ`O,5@wO!&zQMhO,5@wO%1tQ!dO,5@wOOQ!0Lh1G2d1G2dO%4UQ!fO'#CiO%4`Q`O,5=POOQ!0Lb,5<},5<}O%4hQpO,5<}OOQ!0Lb,5=O,5=OOCwQ`O,5<}O%4sQpO,5<}OOQ!0Lb,5=R,5=RO$+YQ`O,5=VOOQO,5?`,5?`OOQO-E<r-E<rOOQ!0Lp1G2h1G2hO#$`QpO,5<}O$$wQlO,5=PO%5RQ`O,5=OO%5^QpO,5=OO!,TQMhO'#IuO%6WQMjO1G2sO!,TQMhO'#IwO%6yQMjO1G2uO%7TQMjO1G5qO%7_QMjO1G5qOOQO,5?e,5?eOOQO-E<w-E<wOOQO1G.{1G.{O!,TQMhO1G5qO!,TQMhO1G5qO!:]QpO,59wO%[QlO,59wOOQ!0Lh,5<j,5<jO%7lQ`O1G2ZO!,TQMhO1G2bO%7qQ!0MxO7+'mOOQ!0Lf7+'m7+'mO!$wQlO7+'mO%8eQ`O,5;`OOQ!0Lb,5?g,5?gOOQ!0Lb-E<y-E<yO%8jQ!dO'#K^O#(ZQ`O7+(eO4UQ!fO7+(eO$DfQ`O7+(eO%8tQ!0MvO'#CiO%9XQ!0MvO,5=SO%9lQ`O,5=SO%9tQ`O,5=SOOQ!0Lb1G5o1G5oOOQ[7+$a7+$aO!ByQ!0LrO7+$aO!CUQpO7+$aO!$wQlO7+&aO%9yQ`O'#JQO%:bQ`O,5APOOQO1G3h1G3hO9kQ`O,5APO%:bQ`O,5APO%:jQ`O,5APOOQO,5?m,5?mOOQO-E=P-E=POOQ!0Lf7+'T7+'TO%:oQ`O7+)QO9uQ!0LrO7+)QO9kQ`O7+)QO@zQ`O7+)QO%:tQ`O7+)QOOQ[7+)Q7+)QOOQ[7+(p7+(pO%:yQ!0MvO7+(mO!&zQMhO7+(mO!E^Q`O7+(nOOQ[7+(n7+(nO!&zQMhO7+(nO%;TQ`O'#KbO%;`Q`O,5=lOOQO,5?i,5?iOOQO-E<{-E<{OOQ[7+(s7+(sO%<rQpO'#HZOOQ[1G3`1G3`O!&zQMhO1G3`O%[QlO1G3`O%<yQ`O1G3`O%=UQMhO1G3`O9uQ!0LrO1G3bO$%dQ`O1G3bO9`Q`O1G3bO!CUQpO1G3bO!C^QMhO1G3bO%=dQ`O'#JPO%=xQ`O,5@}O%>QQpO,5@}OOQ!0Lb1G3c1G3cOOQ[7+$V7+$VO@zQ`O7+$VO9uQ!0LrO7+$VO%>]Q`O7+$VO%[QlO1G6lO%[QlO1G6mO%>bQ!0LrO1G6lO%>lQlO1G3kO%>sQ`O1G3kO%>xQlO1G3kOOQ[7+)T7+)TO9uQ!0LrO7+)_O`QlO7+)aOOQ['#Kh'#KhOOQ['#JS'#JSO%?PQlO,5>`OOQ[,5>`,5>`O%[QlO'#HuO%?^Q`O'#HwOOQ[,5>f,5>fO9eQ`O,5>fOOQ[,5>h,5>hOOQ[7+)j7+)jOOQ[7+)p7+)pOOQ[7+)t7+)tOOQ[7+)v7+)vO%?cQpO1G5|O%?}Q?MtO1G0zO%@XQ`O1G0zOOQO1G/s1G/sO%@dQ?MtO1G/sO?YQ`O1G/sO!)[QlO'#DmOOQO,5?P,5?POOQO-E<c-E<cOOQO,5?V,5?VOOQO-E<i-E<iO!CUQpO1G/sOOQO-E<e-E<eOOQ!0Ln1G0]1G0]OOQ!0Lf7+%u7+%uO#(ZQ`O7+%uOOQ!0Lf7+&`7+&`O?YQ`O7+&`O!CUQpO7+&`OOQO7+%x7+%xO$AlQ!0MxO7+&XOOQO7+&X7+&XO%[QlO7+&XO%@nQ!0LrO7+&XO!ByQ!0LrO7+%xO!CUQpO7+%xO%@yQ!0LrO7+&XO%AXQ!0MxO7++rO%[QlO7++rO%AiQ`O7++qO%AiQ`O7++qOOQO1G4s1G4sO9eQ`O1G4sO%AqQ`O1G4sOOQS7+%}7+%}O#(ZQ`O<<LPO4UQ!fO<<LPO%BPQ`O<<LPOOQ[<<LP<<LPO!&zQMhO<<LPO%[QlO<<LPO%BXQ`O<<LPO%BdQ!0MzO,5?aO%DoQ!0MzO,5?cO%FzQ!0MzO1G2`O%I]Q!0MzO1G2sO%KhQ!0MzO1G2uO%MsQ!fO,5?QO%[QlO,5?QOOQO-E<d-E<dO%M}Q`O1G5}OOQ!0Lf<<JU<<JUO%NVQ?MtO1G0uO&!^Q?MtO1G1PO&!eQ?MtO1G1PO&$fQ?MtO1G1PO&$mQ?MtO1G1PO&&nQ?MtO1G1PO&(oQ?MtO1G1PO&(vQ?MtO1G1PO&(}Q?MtO1G1PO&+OQ?MtO1G1PO&+VQ?MtO1G1PO&+^Q!0MxO<<JfO&-UQ?MtO1G1PO&.RQ?MvO1G1PO&/UQ?MvO'#JlO&1[Q?MtO1G1cO&1iQ?MtO1G0UO&1sQMjO,5?TOOQO-E<g-E<gO!)[QlO'#FqOOQO'#KZ'#KZOOQO1G1u1G1uO&1}Q`O1G1tO&2SQ?MtO,5?[OOOW7+'h7+'hOOOO1G/Z1G/ZO&2^Q!dO1G4xOOQ!0Lh7+(Q7+(QP!&zQMhO,5?^O!,TQMhO7+(cO&2eQ`O,5?]O9eQ`O,5?]O$+YQ`O,5?]OOQO-E<o-E<oO&2sQ`O1G6bO&2sQ`O1G6bO&2{Q`O1G6bO&3WQMjO7+'zO&3hQ!dO,5?_O&3rQ`O,5?_O!&zQMhO,5?_OOQO-E<q-E<qO&3wQ!dO1G6cO&4RQ`O1G6cO&4ZQ`O1G2kO!&zQMhO1G2kOOQ!0Lb1G2i1G2iOOQ!0Lb1G2j1G2jO%4hQpO1G2iO!CUQpO1G2iOCwQ`O1G2iOOQ!0Lb1G2q1G2qO&4`QpO1G2iO&4nQ`O1G2kO$+YQ`O1G2jOCwQ`O1G2jO$$wQlO1G2kO&4vQ`O1G2jO&5jQMjO,5?aOOQ!0Lh-E<t-E<tO&6]QMjO,5?cOOQ!0Lh-E<v-E<vO!,TQMhO7++]O&6gQMjO7++]O&6qQMjO7++]OOQ!0Lh1G/c1G/cO&7OQ`O1G/cOOQ!0Lh7+'u7+'uO&7TQMjO7+'|O&7eQ!0MxO<<KXOOQ!0Lf<<KX<<KXO&8XQ`O1G0zO!&zQMhO'#IzO&8^Q`O,5@xO&:`Q!fO<<LPO!&zQMhO1G2nO&:gQ!0LrO1G2nOOQ[<<G{<<G{O!ByQ!0LrO<<G{O&:xQ!0MxO<<I{OOQ!0Lf<<I{<<I{OOQO,5?l,5?lO&;lQ`O,5?lO&;qQ`O,5?lOOQO-E=O-E=OO&<PQ`O1G6kO&<PQ`O1G6kO9kQ`O1G6kO@zQ`O<<LlOOQ[<<Ll<<LlO&<XQ`O<<LlO9uQ!0LrO<<LlO9kQ`O<<LlOOQ[<<LX<<LXO%:yQ!0MvO<<LXOOQ[<<LY<<LYO!E^Q`O<<LYO&<^QpO'#I|O&<iQ`O,5@|O!)[QlO,5@|OOQ[1G3W1G3WOOQO'#JO'#JOO9uQ!0LrO'#JOO&<qQpO,5=uOOQ[,5=u,5=uO&<xQpO'#EgO&=PQpO'#GeO&=UQ`O7+(zO&=ZQ`O7+(zOOQ[7+(z7+(zO!&zQMhO7+(zO%[QlO7+(zO&=cQ`O7+(zOOQ[7+(|7+(|O9uQ!0LrO7+(|O$%dQ`O7+(|O9`Q`O7+(|O!CUQpO7+(|O&=nQ`O,5?kOOQO-E<}-E<}OOQO'#H^'#H^O&=yQ`O1G6iO9uQ!0LrO<<GqOOQ[<<Gq<<GqO@zQ`O<<GqO&>RQ`O7+,WO&>WQ`O7+,XO%[QlO7+,WO%[QlO7+,XOOQ[7+)V7+)VO&>]Q`O7+)VO&>bQlO7+)VO&>iQ`O7+)VOOQ[<<Ly<<LyOOQ[<<L{<<L{OOQ[-E=Q-E=QOOQ[1G3z1G3zO&>nQ`O,5>aOOQ[,5>c,5>cO&>sQ`O1G4QO9eQ`O7+&fO!)[QlO7+&fOOQO7+%_7+%_O&>xQ?MtO1G6ZO?YQ`O7+%_OOQ!0Lf<<Ia<<IaOOQ!0Lf<<Iz<<IzO?YQ`O<<IzOOQO<<Is<<IsO$AlQ!0MxO<<IsO%[QlO<<IsOOQO<<Id<<IdO!ByQ!0LrO<<IdO&?SQ!0LrO<<IsO&?_Q!0MxO<= ^O&?oQ`O<= ]OOQO7+*_7+*_O9eQ`O7+*_OOQ[ANAkANAkO&?wQ!fOANAkO!&zQMhOANAkO#(ZQ`OANAkO4UQ!fOANAkO&@OQ`OANAkO%[QlOANAkO&@WQ!0MzO7+'zO&BiQ!0MzO,5?aO&DtQ!0MzO,5?cO&GPQ!0MzO7+'|O&IbQ!fO1G4lO&IlQ?MtO7+&aO&KpQ?MvO,5=XO&MwQ?MvO,5=ZO&NXQ?MvO,5=XO&NiQ?MvO,5=ZO&NyQ?MvO,59uO'#PQ?MvO,5<kO'%SQ?MvO,5<mO''hQ?MvO,5<{O')^Q?MtO7+'kO')kQ?MtO7+'mO')xQ`O,5<]OOQO7+'`7+'`OOQ!0Lh7+*d7+*dO')}QMjO<<K}OOQO1G4w1G4wO'*UQ`O1G4wO'*aQ`O1G4wO'*oQ`O7++|O'*oQ`O7++|O!&zQMhO1G4yO'*wQ!dO1G4yO'+RQ`O7++}O'+ZQ`O7+(VO'+fQ!dO7+(VOOQ!0Lb7+(T7+(TOOQ!0Lb7+(U7+(UO!CUQpO7+(TOCwQ`O7+(TO'+pQ`O7+(VO!&zQMhO7+(VO$+YQ`O7+(UO'+uQ`O7+(VOCwQ`O7+(UO'+}QMjO<<NwO!,TQMhO<<NwOOQ!0Lh7+$}7+$}O',XQ!dO,5?fOOQO-E<x-E<xO',cQ!0MvO7+(YO!&zQMhO7+(YOOQ[AN=gAN=gO9kQ`O1G5WOOQO1G5W1G5WO',sQ`O1G5WO',xQ`O7+,VO',xQ`O7+,VO9uQ!0LrOANBWO@zQ`OANBWOOQ[ANBWANBWO'-QQ`OANBWOOQ[ANAsANAsOOQ[ANAtANAtO'-VQ`O,5?hOOQO-E<z-E<zO'-bQ?MtO1G6hOOQO,5?j,5?jOOQO-E<|-E<|OOQ[1G3a1G3aO'-lQ`O,5=POOQ[<<Lf<<LfO!&zQMhO<<LfO&=UQ`O<<LfO'-qQ`O<<LfO%[QlO<<LfOOQ[<<Lh<<LhO9uQ!0LrO<<LhO$%dQ`O<<LhO9`Q`O<<LhO'-yQpO1G5VO'.UQ`O7+,TOOQ[AN=]AN=]O9uQ!0LrOAN=]OOQ[<= r<= rOOQ[<= s<= sO'.^Q`O<= rO'.cQ`O<= sOOQ[<<Lq<<LqO'.hQ`O<<LqO'.mQlO<<LqOOQ[1G3{1G3{O?YQ`O7+)lO'.tQ`O<<JQO'/PQ?MtO<<JQOOQO<<Hy<<HyOOQ!0LfAN?fAN?fOOQOAN?_AN?_O$AlQ!0MxOAN?_OOQOAN?OAN?OO%[QlOAN?_OOQO<<My<<MyOOQ[G27VG27VO!&zQMhOG27VO#(ZQ`OG27VO'/ZQ!fOG27VO4UQ!fOG27VO'/bQ`OG27VO'/jQ?MtO<<JfO'/wQ?MvO1G2`O'1mQ?MvO,5?aO'3pQ?MvO,5?cO'5sQ?MvO1G2sO'7vQ?MvO1G2uO'9yQ?MtO<<KXO':WQ?MtO<<I{OOQO1G1w1G1wO!,TQMhOANAiOOQO7+*c7+*cO':eQ`O7+*cO':pQ`O<= hO':xQ!dO7+*eOOQ!0Lb<<Kq<<KqO$+YQ`O<<KqOCwQ`O<<KqO';SQ`O<<KqO!&zQMhO<<KqOOQ!0Lb<<Ko<<KoO!CUQpO<<KoO';_Q!dO<<KqOOQ!0Lb<<Kp<<KpO';iQ`O<<KqO!&zQMhO<<KqO$+YQ`O<<KpO';nQMjOANDcO';xQ!0MvO<<KtOOQO7+*r7+*rO9kQ`O7+*rO'<YQ`O<= qOOQ[G27rG27rO9uQ!0LrOG27rO@zQ`OG27rO!)[QlO1G5SO'<bQ`O7+,SO'<jQ`O1G2kO&=UQ`OANBQOOQ[ANBQANBQO!&zQMhOANBQO'<oQ`OANBQOOQ[ANBSANBSO9uQ!0LrOANBSO$%dQ`OANBSOOQO'#H_'#H_OOQO7+*q7+*qOOQ[G22wG22wOOQ[ANE^ANE^OOQ[ANE_ANE_OOQ[ANB]ANB]O'<wQ`OANB]OOQ[<<MW<<MWO!)[QlOAN?lOOQOG24yG24yO$AlQ!0MxOG24yO#(ZQ`OLD,qOOQ[LD,qLD,qO!&zQMhOLD,qO'<|Q!fOLD,qO'=TQ?MvO7+'zO'>yQ?MvO,5?aO'@|Q?MvO,5?cO'CPQ?MvO7+'|O'DuQMjOG27TOOQO<<M}<<M}OOQ!0LbANA]ANA]O$+YQ`OANA]OCwQ`OANA]O'EVQ!dOANA]OOQ!0LbANAZANAZO'E^Q`OANA]O!&zQMhOANA]O'EiQ!dOANA]OOQ!0LbANA[ANA[OOQO<<N^<<N^OOQ[LD-^LD-^O9uQ!0LrOLD-^O'EsQ?MtO7+*nOOQO'#Gf'#GfOOQ[G27lG27lO&=UQ`OG27lO!&zQMhOG27lOOQ[G27nG27nO9uQ!0LrOG27nOOQ[G27wG27wO'E}Q?MtOG25WOOQOLD*eLD*eOOQ[!$(!]!$(!]O#(ZQ`O!$(!]O!&zQMhO!$(!]O'FXQ!0MzOG27TOOQ!0LbG26wG26wO$+YQ`OG26wO'HjQ`OG26wOCwQ`OG26wO'HuQ!dOG26wO!&zQMhOG26wOOQ[!$(!x!$(!xOOQ[LD-WLD-WO&=UQ`OLD-WOOQ[LD-YLD-YOOQ[!)9Ew!)9EwO#(ZQ`O!)9EwOOQ!0LbLD,cLD,cO$+YQ`OLD,cOCwQ`OLD,cO'H|Q`OLD,cO'IXQ!dOLD,cOOQ[!$(!r!$(!rOOQ[!.K;c!.K;cO'I`Q?MvOG27TOOQ!0Lb!$( }!$( }O$+YQ`O!$( }OCwQ`O!$( }O'KUQ`O!$( }OOQ!0Lb!)9Ei!)9EiO$+YQ`O!)9EiOCwQ`O!)9EiOOQ!0Lb!.K;T!.K;TO$+YQ`O!.K;TOOQ!0Lb!4/0o!4/0oO!)[QlO'#DzO1PQ`O'#EXO'KaQ!fO'#JrO'KhQ!L^O'#DvO'KoQlO'#EOO'KvQ!fO'#CiO'N^Q!fO'#CiO!)[QlO'#EQO'NnQlO,5;ZO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO'#IpO(!qQ`O,5<iO!)[QlO,5;eO(!yQMhO,5;eO($dQMhO,5;eO!)[QlO,5;wO!&zQMhO'#GmO(!yQMhO'#GmO!&zQMhO'#GoO(!yQMhO'#GoO1SQ`O'#DZO1SQ`O'#DZO!&zQMhO'#GPO(!yQMhO'#GPO!&zQMhO'#GRO(!yQMhO'#GRO!&zQMhO'#GaO(!yQMhO'#GaO!)[QlO,5:jO($kQpO'#D_O($uQpO'#JvO!)[QlO,5@oO'NnQlO1G0uO(%PQ?MtO'#CiO!)[QlO1G2PO!&zQMhO'#IuO(!yQMhO'#IuO!&zQMhO'#IwO(!yQMhO'#IwO(%ZQ!dO'#CrO!&zQMhO,5<tO(!yQMhO,5<tO'NnQlO1G2RO!)[QlO7+&zO!&zQMhO1G2`O(!yQMhO1G2`O!&zQMhO'#IuO(!yQMhO'#IuO!&zQMhO'#IwO(!yQMhO'#IwO!&zQMhO1G2bO(!yQMhO1G2bO'NnQlO7+'mO'NnQlO7+&aO!&zQMhOANAiO(!yQMhOANAiO(%nQ`O'#EoO(%sQ`O'#EoO(%{Q`O'#F]O(&QQ`O'#EyO(&VQ`O'#KTO(&bQ`O'#KRO(&mQ`O,5;ZO(&rQMjO,5<eO(&yQ`O'#GYO('OQ`O'#GYO('TQ`O,5<eO(']Q`O,5<gO('eQ`O,5;ZO('mQ?MtO1G1`O('tQ`O,5<tO('yQ`O,5<tO((OQ`O,5<vO((TQ`O,5<vO((YQ`O1G2RO((_Q`O1G0uO((dQMjO<<K}O((kQMjO<<K}O((rQMhO'#F|O9`Q`O'#F{OAuQ`O'#EnO!)[QlO,5;tO!3oQ`O'#GYO!3oQ`O'#GYO!3oQ`O'#G[O!3oQ`O'#G[O!,TQMhO7+(cO!,TQMhO7+(cO%.zQ!dO1G2wO%.zQ!dO1G2wO!&zQMhO,5=]O!&zQMhO,5=]",
  stateData: "()x~O'|OS'}OSTOS(ORQ~OPYOQYOSfOY!VOaqOdzOeyOl!POpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_XO!iuO!lZO!oYO!pYO!qYO!svO!uwO!xxO!|]O$W|O$niO%h}O%j!QO%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO%y!UO&W!WO&^!XO&`!YO&b!ZO&d![O&g!]O&m!^O&s!_O&u!`O&w!aO&y!bO&{!cO(TSO(VTO(YUO(aVO(o[O~OWtO~P`OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oa!wOs!nO!S!oO!b!yO!c!vO!d!vO!|<VO#T!pO#U!pO#V!xO#W!pO#X!pO#[!zO#]!zO(U!lO(VTO(YUO(e!mO(o!sO~O(O!{O~OP]XR]X[]Xa]Xj]Xr]X!Q]X!S]X!]]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X'z]X(a]X(r]X(y]X(z]X~O!g%RX~P(qO_!}O(V#PO(W!}O(X#PO~O_#QO(X#PO(Y#PO(Z#QO~Ox#SO!U#TO(b#TO(c#VO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T<ZO(VTO(YUO(aVO(o[O~O![#ZO!]#WO!Y(hP!Y(vP~P+}O!^#cO~P`OPYOQYOSfOd!jOe!iOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(VTO(YUO(aVO(o[O~Op#mO![#iO!|]O#i#lO#j#iO(T<[O!k(sP~P.iO!l#oO(T#nO~O!x#sO!|]O%h#tO~O#k#uO~O!g#vO#k#uO~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!]$_O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~Oa(fX'z(fX'w(fX!k(fX!Y(fX!_(fX%i(fX!g(fX~P1qO#S$dO#`$eO$Q$eOP(gXR(gX[(gXj(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX!_(gX%i(gX~Oa(gX'z(gX'w(gX!Y(gX!k(gXv(gX!g(gX~P4UO#`$eO~O$]$hO$_$gO$f$mO~OSfO!_$nO$i$oO$k$qO~Oh%VOj%dOk%dOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T$sO(VTO(YUO(a$uO(y$}O(z%POg(^P~Ol%[O~P7eO!l%eO~O!S%hO!_%iO(T%gO~O!g%mO~Oa%nO'z%nO~O!Q%rO~P%[O(U!lO~P%[O%n%vO~P%[Oh%VO!l%eO(T%gO(U!lO~Oe%}O!l%eO(T%gO~Oj$RO~O!_&PO(T%gO(U!lO(VTO(YUO`)WP~O!Q&SO!l&RO%j&VO&T&WO~P;SO!x#sO~O%s&YO!S)SX!_)SX(T)SX~O(T&ZO~Ol!PO!u&`O%j!QO%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO~Od&eOe&dO!x&bO%h&cO%{&aO~P<bOd&hOeyOl!PO!_&gO!u&`O!xxO!|]O%h}O%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO%y!UO~Ob&kO#`&nO%j&iO(U!lO~P=gO!l&oO!u&sO~O!l#oO~O!_XO~Oa%nO'x&{O'z%nO~Oa%nO'x'OO'z%nO~Oa%nO'x'QO'z%nO~O'w]X!Y]Xv]X!k]X&[]X!_]X%i]X!g]X~P(qO!b'_O!c'WO!d'WO(U!lO(VTO(YUO~Os'UO!S'TO!['XO(e'SO!^(iP!^(xP~P@nOn'bO!_'`O(T%gO~Oe'gO!l%eO(T%gO~O!Q&SO!l&RO~Os!nO!S!oO!|<VO#T!pO#U!pO#W!pO#X!pO(U!lO(VTO(YUO(e!mO(o!sO~O!b'mO!c'lO!d'lO#V!pO#['nO#]'nO~PBYOa%nOh%VO!g#vO!l%eO'z%nO(r'pO~O!p'tO#`'rO~PChOs!nO!S!oO(VTO(YUO(e!mO(o!sO~O!_XOs(mX!S(mX!b(mX!c(mX!d(mX!|(mX#T(mX#U(mX#V(mX#W(mX#X(mX#[(mX#](mX(U(mX(V(mX(Y(mX(e(mX(o(mX~O!c'lO!d'lO(U!lO~PDWO(P'xO(Q'xO(R'zO~O_!}O(V'|O(W!}O(X'|O~O_#QO(X'|O(Y'|O(Z#QO~Ov(OO~P%[Ox#SO!U#TO(b#TO(c(RO~O![(TO!Y'WX!Y'^X!]'WX!]'^X~P+}O!](VO!Y(hX~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!](VO!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~O!Y(hX~PHRO!Y([O~O!Y(uX!](uX!g(uX!k(uX(r(uX~O#`(uX#k#dX!^(uX~PJUO#`(]O!Y(wX!](wX~O!](^O!Y(vX~O!Y(aO~O#`$eO~PJUO!^(bO~P`OR#zO!Q#yO!S#{O!l#xO(aVOP!na[!naj!nar!na!]!na!p!na#R!na#n!na#o!na#p!na#q!na#r!na#s!na#t!na#u!na#v!na#x!na#z!na#{!na(r!na(y!na(z!na~Oa!na'z!na'w!na!Y!na!k!nav!na!_!na%i!na!g!na~PKlO!k(cO~O!g#vO#`(dO(r'pO!](tXa(tX'z(tX~O!k(tX~PNXO!S%hO!_%iO!|]O#i(iO#j(hO(T%gO~O!](jO!k(sX~O!k(lO~O!S%hO!_%iO#j(hO(T%gO~OP(gXR(gX[(gXj(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX~O!g#vO!k(gX~P! uOR(nO!Q(mO!l#xO#S$dO!|!{a!S!{a~O!x!{a%h!{a!_!{a#i!{a#j!{a(T!{a~P!#vO!x(rO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_XO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O<sO!S${O!_$|O!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~O#k(xO~O![(zO!k(kP~P%[O(e(|O(o[O~O!S)OO!l#xO(e(|O(o[O~OP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_!eO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(T)]O(VTO(YUO(aVO(o[O~O!]$_Oa$qa'z$qa'w$qa!k$qa!Y$qa!_$qa%i$qa!g$qa~Ol)dO~P!&zOh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Og(pP~P!,TO!Q)iO!g)hO!_$^X$Z$^X$]$^X$_$^X$f$^X~O!g)hO!_({X$Z({X$]({X$_({X$f({X~O!Q)iO~P!.^O!Q)iO!_({X$Z({X$]({X$_({X$f({X~O!_)kO$Z)oO$])jO$_)jO$f)pO~O![)sO~P!)[O$]$hO$_$gO$f)wO~On$zX!Q$zX#S$zX'y$zX(y$zX(z$zX~OgmXg$zXnmX!]mX#`mX~P!0SOx)yO(b)zO(c)|O~On*VO!Q*OO'y*PO(y$}O(z%PO~Og)}O~P!1WOg*WO~Oh%VOr%XOs$tOt$tOz%YO|%ZO!O<sO!S*YO!_*ZO!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(VTO(YUO(a$uO(y$}O(z%PO~Op*`O![*^O(T*XO!k)OP~P!1uO#k*aO~O!l*bO~Oh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O<sO!S${O!_$|O!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(T*dO(VTO(YUO(a$uO(y$}O(z%PO~O![*gO!Y)PP~P!3tOr*sOs!nO!S*iO!b*qO!c*kO!d*kO!l*bO#[*rO%`*mO(U!lO(VTO(YUO(e!mO~O!^*pO~P!5iO#S$dOn(`X!Q(`X'y(`X(y(`X(z(`X!](`X#`(`X~Og(`X$O(`X~P!6kOn*xO#`*wOg(_X!](_X~O!]*yOg(^X~Oj%dOk%dOl%dO(T&ZOg(^P~Os*|O~Og)}O(T&ZO~O!l+SO~O(T(vO~Op+WO!S%hO![#iO!_%iO!|]O#i#lO#j#iO(T%gO!k(sP~O!g#vO#k+XO~O!S%hO![+ZO!](^O!_%iO(T%gO!Y(vP~Os'[O!S+]O![+[O(VTO(YUO(e(|O~O!^(xP~P!9|O!]+^Oa)TX'z)TX~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~Oa!ja!]!ja'z!ja'w!ja!Y!ja!k!jav!ja!_!ja%i!ja!g!ja~P!:tOR#zO!Q#yO!S#{O!l#xO(aVOP!ra[!raj!rar!ra!]!ra!p!ra#R!ra#n!ra#o!ra#p!ra#q!ra#r!ra#s!ra#t!ra#u!ra#v!ra#x!ra#z!ra#{!ra(r!ra(y!ra(z!ra~Oa!ra'z!ra'w!ra!Y!ra!k!rav!ra!_!ra%i!ra!g!ra~P!=[OR#zO!Q#yO!S#{O!l#xO(aVOP!ta[!taj!tar!ta!]!ta!p!ta#R!ta#n!ta#o!ta#p!ta#q!ta#r!ta#s!ta#t!ta#u!ta#v!ta#x!ta#z!ta#{!ta(r!ta(y!ta(z!ta~Oa!ta'z!ta'w!ta!Y!ta!k!tav!ta!_!ta%i!ta!g!ta~P!?rOh%VOn+gO!_'`O%i+fO~O!g+iOa(]X!_(]X'z(]X!](]X~Oa%nO!_XO'z%nO~Oh%VO!l%eO~Oh%VO!l%eO(T%gO~O!g#vO#k(xO~Ob+tO%j+uO(T+qO(VTO(YUO!^)XP~O!]+vO`)WX~O[+zO~O`+{O~O!_&PO(T%gO(U!lO`)WP~O%j,OO~P;SOh%VO#`,SO~Oh%VOn,VO!_$|O~O!_,XO~O!Q,ZO!_XO~O%n%vO~O!x,`O~Oe,eO~Ob,fO(T#nO(VTO(YUO!^)VP~Oe%}O~O%j!QO(T&ZO~P=gO[,kO`,jO~OPYOQYOSfOdzOeyOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!iuO!lZO!oYO!pYO!qYO!svO!xxO!|]O$niO%h}O(VTO(YUO(aVO(o[O~O!_!eO!u!gO$W!kO(T!dO~P!FyO`,jOa%nO'z%nO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oa,pOl!OO!uwO%l!OO%m!OO%n!OO~P!IcO!l&oO~O&^,vO~O!_,xO~O&o,zO&q,{OP&laQ&laS&laY&laa&lad&lae&lal&lap&lar&las&lat&laz&la|&la!O&la!S&la!W&la!X&la!_&la!i&la!l&la!o&la!p&la!q&la!s&la!u&la!x&la!|&la$W&la$n&la%h&la%j&la%l&la%m&la%n&la%q&la%s&la%v&la%w&la%y&la&W&la&^&la&`&la&b&la&d&la&g&la&m&la&s&la&u&la&w&la&y&la&{&la'w&la(T&la(V&la(Y&la(a&la(o&la!^&la&e&lab&la&j&la~O(T-QO~Oh!eX!]!RX!^!RX!g!RX!g!eX!l!eX#`!RX~O!]!eX!^!eX~P#!iO!g-VO#`-UOh(jX!]#hX!^#hX!g(jX!l(jX~O!](jX!^(jX~P##[Oh%VO!g-XO!l%eO!]!aX!^!aX~Os!nO!S!oO(VTO(YUO(e!mO~OP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_!eO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(VTO(YUO(aVO(o[O~O(T=QO~P#$qO!]-]O!^(iX~O!^-_O~O!g-VO#`-UO!]#hX!^#hX~O!]-`O!^(xX~O!^-bO~O!c-cO!d-cO(U!lO~P#$`O!^-fO~P'_On-iO!_'`O~O!Y-nO~Os!{a!b!{a!c!{a!d!{a#T!{a#U!{a#V!{a#W!{a#X!{a#[!{a#]!{a(U!{a(V!{a(Y!{a(e!{a(o!{a~P!#vO!p-sO#`-qO~PChO!c-uO!d-uO(U!lO~PDWOa%nO#`-qO'z%nO~Oa%nO!g#vO#`-qO'z%nO~Oa%nO!g#vO!p-sO#`-qO'z%nO(r'pO~O(P'xO(Q'xO(R-zO~Ov-{O~O!Y'Wa!]'Wa~P!:tO![.PO!Y'WX!]'WX~P%[O!](VO!Y(ha~O!Y(ha~PHRO!](^O!Y(va~O!S%hO![.TO!_%iO(T%gO!Y'^X!]'^X~O#`.VO!](ta!k(taa(ta'z(ta~O!g#vO~P#,wO!](jO!k(sa~O!S%hO!_%iO#j.ZO(T%gO~Op.`O!S%hO![.]O!_%iO!|]O#i._O#j.]O(T%gO!]'aX!k'aX~OR.dO!l#xO~Oh%VOn.gO!_'`O%i.fO~Oa#ci!]#ci'z#ci'w#ci!Y#ci!k#civ#ci!_#ci%i#ci!g#ci~P!:tOn>]O!Q*OO'y*PO(y$}O(z%PO~O#k#_aa#_a#`#_a'z#_a!]#_a!k#_a!_#_a!Y#_a~P#/sO#k(`XP(`XR(`X[(`Xa(`Xj(`Xr(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X'z(`X(a(`X(r(`X!k(`X!Y(`X'w(`Xv(`X!_(`X%i(`X!g(`X~P!6kO!].tO!k(kX~P!:tO!k.wO~O!Y.yO~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mia#mij#mir#mi!]#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#n#mi~P#3cO#n$OO~P#3cOP$[OR#zOr$aO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO[#mia#mij#mi!]#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#r#mi~P#6QO#r$QO~P#6QOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO(aVOa#mi!]#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#v#mi~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO(aVO(z#}Oa#mi!]#mi#z#mi#{#mi'z#mi(r#mi(y#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#x$UO~P#;VO#x#mi~P#;VO#v$SO~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO(aVO(y#|O(z#}Oa#mi!]#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#z#mi~P#={O#z$WO~P#={OP]XR]X[]Xj]Xr]X!Q]X!S]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X!]]X!^]X~O$O]X~P#@jOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO#x<eO#z<gO#{<hO(aVO(r$YO(y#|O(z#}O~O$O.{O~P#BwO#S$dO#`<nO$Q<nO$O(gX!^(gX~P! uOa'da!]'da'z'da'w'da!k'da!Y'dav'da!_'da%i'da!g'da~P!:tO[#mia#mij#mir#mi!]#mi#R#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO(y#mi(z#mi~P#EyOn>]O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P#EyO!]/POg(pX~P!1WOg/RO~Oa$Pi!]$Pi'z$Pi'w$Pi!Y$Pi!k$Piv$Pi!_$Pi%i$Pi!g$Pi~P!:tO$]/SO$_/SO~O$]/TO$_/TO~O!g)hO#`/UO!_$cX$Z$cX$]$cX$_$cX$f$cX~O![/VO~O!_)kO$Z/XO$])jO$_)jO$f/YO~O!]<iO!^(fX~P#BwO!^/ZO~O!g)hO$f({X~O$f/]O~Ov/^O~P!&zOx)yO(b)zO(c/aO~O!S/dO~O(y$}On%aa!Q%aa'y%aa(z%aa!]%aa#`%aa~Og%aa$O%aa~P#L{O(z%POn%ca!Q%ca'y%ca(y%ca!]%ca#`%ca~Og%ca$O%ca~P#MnO!]fX!gfX!kfX!k$zX(rfX~P!0SOp%WO![/mO!](^O(T/lO!Y(vP!Y)PP~P!1uOr*sO!b*qO!c*kO!d*kO!l*bO#[*rO%`*mO(U!lO(VTO(YUO~Os<}O!S/nO![+[O!^*pO(e<|O!^(xP~P$ [O!k/oO~P#/sO!]/pO!g#vO(r'pO!k)OX~O!k/uO~OnoX!QoX'yoX(yoX(zoX~O!g#vO!koX~P$#OOp/wO!S%hO![*^O!_%iO(T%gO!k)OP~O#k/xO~O!Y$zX!]$zX!g%RX~P!0SO!]/yO!Y)PX~P#/sO!g/{O~O!Y/}O~OpkO(T0OO~P.iOh%VOr0TO!g#vO!l%eO(r'pO~O!g+iO~Oa%nO!]0XO'z%nO~O!^0ZO~P!5iO!c0[O!d0[O(U!lO~P#$`Os!nO!S0]O(VTO(YUO(e!mO~O#[0_O~Og%aa!]%aa#`%aa$O%aa~P!1WOg%ca!]%ca#`%ca$O%ca~P!1WOj%dOk%dOl%dO(T&ZOg'mX!]'mX~O!]*yOg(^a~Og0hO~On0jO#`0iOg(_a!](_a~OR0kO!Q0kO!S0lO#S$dOn}a'y}a(y}a(z}a!]}a#`}a~Og}a$O}a~P$(cO!Q*OO'y*POn$sa(y$sa(z$sa!]$sa#`$sa~Og$sa$O$sa~P$)_O!Q*OO'y*POn$ua(y$ua(z$ua!]$ua#`$ua~Og$ua$O$ua~P$*QO#k0oO~Og%Ta!]%Ta#`%Ta$O%Ta~P!1WO!g#vO~O#k0rO~O!]+^Oa)Ta'z)Ta~OR#zO!Q#yO!S#{O!l#xO(aVOP!ri[!rij!rir!ri!]!ri!p!ri#R!ri#n!ri#o!ri#p!ri#q!ri#r!ri#s!ri#t!ri#u!ri#v!ri#x!ri#z!ri#{!ri(r!ri(y!ri(z!ri~Oa!ri'z!ri'w!ri!Y!ri!k!riv!ri!_!ri%i!ri!g!ri~P$+oOh%VOr%XOs$tOt$tOz%YO|%ZO!O<sO!S${O!_$|O!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(VTO(YUO(a$uO(y$}O(z%PO~Op0{O%]0|O(T0zO~P$.VO!g+iOa(]a!_(]a'z(]a!](]a~O#k1SO~O[]X!]fX!^fX~O!]1TO!^)XX~O!^1VO~O[1WO~Ob1YO(T+qO(VTO(YUO~O!_&PO(T%gO`'uX!]'uX~O!]+vO`)Wa~O!k1]O~P!:tO[1`O~O`1aO~O#`1fO~On1iO!_$|O~O(e(|O!^)UP~Oh%VOn1rO!_1oO%i1qO~O[1|O!]1zO!^)VX~O!^1}O~O`2POa%nO'z%nO~O(T#nO(VTO(YUO~O#S$dO#`$eO$Q$eOP(gXR(gX[(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX~Oj2SO&[2TOa(gX~P$3pOj2SO#`$eO&[2TO~Oa2VO~P%[Oa2XO~O&e2[OP&ciQ&ciS&ciY&cia&cid&cie&cil&cip&cir&cis&cit&ciz&ci|&ci!O&ci!S&ci!W&ci!X&ci!_&ci!i&ci!l&ci!o&ci!p&ci!q&ci!s&ci!u&ci!x&ci!|&ci$W&ci$n&ci%h&ci%j&ci%l&ci%m&ci%n&ci%q&ci%s&ci%v&ci%w&ci%y&ci&W&ci&^&ci&`&ci&b&ci&d&ci&g&ci&m&ci&s&ci&u&ci&w&ci&y&ci&{&ci'w&ci(T&ci(V&ci(Y&ci(a&ci(o&ci!^&cib&ci&j&ci~Ob2bO!^2`O&j2aO~P`O!_XO!l2dO~O&q,{OP&liQ&liS&liY&lia&lid&lie&lil&lip&lir&lis&lit&liz&li|&li!O&li!S&li!W&li!X&li!_&li!i&li!l&li!o&li!p&li!q&li!s&li!u&li!x&li!|&li$W&li$n&li%h&li%j&li%l&li%m&li%n&li%q&li%s&li%v&li%w&li%y&li&W&li&^&li&`&li&b&li&d&li&g&li&m&li&s&li&u&li&w&li&y&li&{&li'w&li(T&li(V&li(Y&li(a&li(o&li!^&li&e&lib&li&j&li~O!Y2jO~O!]!aa!^!aa~P#BwOs!nO!S!oO![2pO(e!mO!]'XX!^'XX~P@nO!]-]O!^(ia~O!]'_X!^'_X~P!9|O!]-`O!^(xa~O!^2wO~P'_Oa%nO#`3QO'z%nO~Oa%nO!g#vO#`3QO'z%nO~Oa%nO!g#vO!p3UO#`3QO'z%nO(r'pO~Oa%nO'z%nO~P!:tO!]$_Ov$qa~O!Y'Wi!]'Wi~P!:tO!](VO!Y(hi~O!](^O!Y(vi~O!Y(wi!](wi~P!:tO!](ti!k(tia(ti'z(ti~P!:tO#`3WO!](ti!k(tia(ti'z(ti~O!](jO!k(si~O!S%hO!_%iO!|]O#i3]O#j3[O(T%gO~O!S%hO!_%iO#j3[O(T%gO~On3dO!_'`O%i3cO~Oh%VOn3dO!_'`O%i3cO~O#k%aaP%aaR%aa[%aaa%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa'z%aa(a%aa(r%aa!k%aa!Y%aa'w%aav%aa!_%aa%i%aa!g%aa~P#L{O#k%caP%caR%ca[%caa%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca'z%ca(a%ca(r%ca!k%ca!Y%ca'w%cav%ca!_%ca%i%ca!g%ca~P#MnO#k%aaP%aaR%aa[%aaa%aaj%aar%aa!S%aa!]%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa'z%aa(a%aa(r%aa!k%aa!Y%aa'w%aa#`%aav%aa!_%aa%i%aa!g%aa~P#/sO#k%caP%caR%ca[%caa%caj%car%ca!S%ca!]%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca'z%ca(a%ca(r%ca!k%ca!Y%ca'w%ca#`%cav%ca!_%ca%i%ca!g%ca~P#/sO#k}aP}a[}aa}aj}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a'z}a(a}a(r}a!k}a!Y}a'w}av}a!_}a%i}a!g}a~P$(cO#k$saP$saR$sa[$saa$saj$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa'z$sa(a$sa(r$sa!k$sa!Y$sa'w$sav$sa!_$sa%i$sa!g$sa~P$)_O#k$uaP$uaR$ua[$uaa$uaj$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua'z$ua(a$ua(r$ua!k$ua!Y$ua'w$uav$ua!_$ua%i$ua!g$ua~P$*QO#k%TaP%TaR%Ta[%Taa%Taj%Tar%Ta!S%Ta!]%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta'z%Ta(a%Ta(r%Ta!k%Ta!Y%Ta'w%Ta#`%Tav%Ta!_%Ta%i%Ta!g%Ta~P#/sOa#cq!]#cq'z#cq'w#cq!Y#cq!k#cqv#cq!_#cq%i#cq!g#cq~P!:tO![3lO!]'YX!k'YX~P%[O!].tO!k(ka~O!].tO!k(ka~P!:tO!Y3oO~O$O!na!^!na~PKlO$O!ja!]!ja!^!ja~P#BwO$O!ra!^!ra~P!=[O$O!ta!^!ta~P!?rOg']X!]']X~P!,TO!]/POg(pa~OSfO!_4TO$d4UO~O!^4YO~Ov4ZO~P#/sOa$mq!]$mq'z$mq'w$mq!Y$mq!k$mqv$mq!_$mq%i$mq!g$mq~P!:tO!Y4]O~P!&zO!S4^O~O!Q*OO'y*PO(z%POn'ia(y'ia!]'ia#`'ia~Og'ia$O'ia~P%-fO!Q*OO'y*POn'ka(y'ka(z'ka!]'ka#`'ka~Og'ka$O'ka~P%.XO(r$YO~P#/sO!YfX!Y$zX!]fX!]$zX!g%RX#`fX~P!0SOp%WO(T=WO~P!1uOp4bO!S%hO![4aO!_%iO(T%gO!]'eX!k'eX~O!]/pO!k)Oa~O!]/pO!g#vO!k)Oa~O!]/pO!g#vO(r'pO!k)Oa~Og$|i!]$|i#`$|i$O$|i~P!1WO![4jO!Y'gX!]'gX~P!3tO!]/yO!Y)Pa~O!]/yO!Y)Pa~P#/sOP]XR]X[]Xj]Xr]X!Q]X!S]X!Y]X!]]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X~Oj%YX!g%YX~P%2OOj4oO!g#vO~Oh%VO!g#vO!l%eO~Oh%VOr4tO!l%eO(r'pO~Or4yO!g#vO(r'pO~Os!nO!S4zO(VTO(YUO(e!mO~O(y$}On%ai!Q%ai'y%ai(z%ai!]%ai#`%ai~Og%ai$O%ai~P%5oO(z%POn%ci!Q%ci'y%ci(y%ci!]%ci#`%ci~Og%ci$O%ci~P%6bOg(_i!](_i~P!1WO#`5QOg(_i!](_i~P!1WO!k5VO~Oa$oq!]$oq'z$oq'w$oq!Y$oq!k$oqv$oq!_$oq%i$oq!g$oq~P!:tO!Y5ZO~O!]5[O!_)QX~P#/sOa$zX!_$zX%^]X'z$zX!]$zX~P!0SO%^5_OaoX!_oX'zoX!]oX~P$#OOp5`O(T#nO~O%^5_O~Ob5fO%j5gO(T+qO(VTO(YUO!]'tX!^'tX~O!]1TO!^)Xa~O[5kO~O`5lO~O[5pO~Oa%nO'z%nO~P#/sO!]5uO#`5wO!^)UX~O!^5xO~Or6OOs!nO!S*iO!b!yO!c!vO!d!vO!|<VO#T!pO#U!pO#V!pO#W!pO#X!pO#[5}O#]!zO(U!lO(VTO(YUO(e!mO(o!sO~O!^5|O~P%;eOn6TO!_1oO%i6SO~Oh%VOn6TO!_1oO%i6SO~Ob6[O(T#nO(VTO(YUO!]'sX!^'sX~O!]1zO!^)Va~O(VTO(YUO(e6^O~O`6bO~Oj6eO&[6fO~PNXO!k6gO~P%[Oa6iO~Oa6iO~P%[Ob2bO!^6nO&j2aO~P`O!g6pO~O!g6rOh(ji!](ji!^(ji!g(ji!l(jir(ji(r(ji~O!]#hi!^#hi~P#BwO#`6sO!]#hi!^#hi~O!]!ai!^!ai~P#BwOa%nO#`6|O'z%nO~Oa%nO!g#vO#`6|O'z%nO~O!](tq!k(tqa(tq'z(tq~P!:tO!](jO!k(sq~O!S%hO!_%iO#j7TO(T%gO~O!_'`O%i7WO~On7[O!_'`O%i7WO~O#k'iaP'iaR'ia['iaa'iaj'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia'z'ia(a'ia(r'ia!k'ia!Y'ia'w'iav'ia!_'ia%i'ia!g'ia~P%-fO#k'kaP'kaR'ka['kaa'kaj'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka'z'ka(a'ka(r'ka!k'ka!Y'ka'w'kav'ka!_'ka%i'ka!g'ka~P%.XO#k$|iP$|iR$|i[$|ia$|ij$|ir$|i!S$|i!]$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i'z$|i(a$|i(r$|i!k$|i!Y$|i'w$|i#`$|iv$|i!_$|i%i$|i!g$|i~P#/sO#k%aiP%aiR%ai[%aia%aij%air%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai'z%ai(a%ai(r%ai!k%ai!Y%ai'w%aiv%ai!_%ai%i%ai!g%ai~P%5oO#k%ciP%ciR%ci[%cia%cij%cir%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci'z%ci(a%ci(r%ci!k%ci!Y%ci'w%civ%ci!_%ci%i%ci!g%ci~P%6bO!]'Ya!k'Ya~P!:tO!].tO!k(ki~O$O#ci!]#ci!^#ci~P#BwOP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mij#mir#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#n#mi~P%NdO#n<_O~P%NdOP$[OR#zOr<kO!Q#yO!S#{O!l#xO!p$[O#n<_O#o<`O#p<`O#q<`O(aVO[#mij#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#r#mi~P&!lO#r<aO~P&!lOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO(aVO#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#v#mi~P&$tOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO(aVO(z#}O#z#mi#{#mi$O#mi(r#mi(y#mi!]#mi!^#mi~O#x<eO~P&&uO#x#mi~P&&uO#v<cO~P&$tOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO#x<eO(aVO(y#|O(z#}O#{#mi$O#mi(r#mi!]#mi!^#mi~O#z#mi~P&)UO#z<gO~P&)UOa#|y!]#|y'z#|y'w#|y!Y#|y!k#|yv#|y!_#|y%i#|y!g#|y~P!:tO[#mij#mir#mi#R#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi!]#mi!^#mi~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O#n<_O#o<`O#p<`O#q<`O(aVO(y#mi(z#mi~P&,QOn>^O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P&,QO#S$dOP(`XR(`X[(`Xj(`Xn(`Xr(`X!Q(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X$O(`X'y(`X(a(`X(r(`X(y(`X(z(`X!](`X!^(`X~O$O$Pi!]$Pi!^$Pi~P#BwO$O!ri!^!ri~P$+oOg']a!]']a~P!1WO!^7nO~O!]'da!^'da~P#BwO!Y7oO~P#/sO!g#vO(r'pO!]'ea!k'ea~O!]/pO!k)Oi~O!]/pO!g#vO!k)Oi~Og$|q!]$|q#`$|q$O$|q~P!1WO!Y'ga!]'ga~P#/sO!g7vO~O!]/yO!Y)Pi~P#/sO!]/yO!Y)Pi~O!Y7yO~Oh%VOr8OO!l%eO(r'pO~Oj8QO!g#vO~Or8TO!g#vO(r'pO~O!Q*OO'y*PO(z%POn'ja(y'ja!]'ja#`'ja~Og'ja$O'ja~P&5RO!Q*OO'y*POn'la(y'la(z'la!]'la#`'la~Og'la$O'la~P&5tOg(_q!](_q~P!1WO#`8VOg(_q!](_q~P!1WO!Y8WO~Og%Oq!]%Oq#`%Oq$O%Oq~P!1WOa$oy!]$oy'z$oy'w$oy!Y$oy!k$oyv$oy!_$oy%i$oy!g$oy~P!:tO!g6rO~O!]5[O!_)Qa~O!_'`OP$TaR$Ta[$Taj$Tar$Ta!Q$Ta!S$Ta!]$Ta!l$Ta!p$Ta#R$Ta#n$Ta#o$Ta#p$Ta#q$Ta#r$Ta#s$Ta#t$Ta#u$Ta#v$Ta#x$Ta#z$Ta#{$Ta(a$Ta(r$Ta(y$Ta(z$Ta~O%i7WO~P&8fO%^8[Oa%[i!_%[i'z%[i!]%[i~Oa#cy!]#cy'z#cy'w#cy!Y#cy!k#cyv#cy!_#cy%i#cy!g#cy~P!:tO[8^O~Ob8`O(T+qO(VTO(YUO~O!]1TO!^)Xi~O`8dO~O(e(|O!]'pX!^'pX~O!]5uO!^)Ua~O!^8nO~P%;eO(o!sO~P$&YO#[8oO~O!_1oO~O!_1oO%i8qO~On8tO!_1oO%i8qO~O[8yO!]'sa!^'sa~O!]1zO!^)Vi~O!k8}O~O!k9OO~O!k9RO~O!k9RO~P%[Oa9TO~O!g9UO~O!k9VO~O!](wi!^(wi~P#BwOa%nO#`9_O'z%nO~O!](ty!k(tya(ty'z(ty~P!:tO!](jO!k(sy~O%i9bO~P&8fO!_'`O%i9bO~O#k$|qP$|qR$|q[$|qa$|qj$|qr$|q!S$|q!]$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q'z$|q(a$|q(r$|q!k$|q!Y$|q'w$|q#`$|qv$|q!_$|q%i$|q!g$|q~P#/sO#k'jaP'jaR'ja['jaa'jaj'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja'z'ja(a'ja(r'ja!k'ja!Y'ja'w'jav'ja!_'ja%i'ja!g'ja~P&5RO#k'laP'laR'la['laa'laj'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la'z'la(a'la(r'la!k'la!Y'la'w'lav'la!_'la%i'la!g'la~P&5tO#k%OqP%OqR%Oq[%Oqa%Oqj%Oqr%Oq!S%Oq!]%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq'z%Oq(a%Oq(r%Oq!k%Oq!Y%Oq'w%Oq#`%Oqv%Oq!_%Oq%i%Oq!g%Oq~P#/sO!]'Yi!k'Yi~P!:tO$O#cq!]#cq!^#cq~P#BwO(y$}OP%aaR%aa[%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa$O%aa(a%aa(r%aa!]%aa!^%aa~On%aa!Q%aa'y%aa(z%aa~P&IyO(z%POP%caR%ca[%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca$O%ca(a%ca(r%ca!]%ca!^%ca~On%ca!Q%ca'y%ca(y%ca~P&LQOn>^O!Q*OO'y*PO(z%PO~P&IyOn>^O!Q*OO'y*PO(y$}O~P&LQOR0kO!Q0kO!S0lO#S$dOP}a[}aj}an}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a$O}a'y}a(a}a(r}a(y}a(z}a!]}a!^}a~O!Q*OO'y*POP$saR$sa[$saj$san$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa$O$sa(a$sa(r$sa(y$sa(z$sa!]$sa!^$sa~O!Q*OO'y*POP$uaR$ua[$uaj$uan$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua$O$ua(a$ua(r$ua(y$ua(z$ua!]$ua!^$ua~On>^O!Q*OO'y*PO(y$}O(z%PO~OP%TaR%Ta[%Taj%Tar%Ta!S%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta$O%Ta(a%Ta(r%Ta!]%Ta!^%Ta~P''VO$O$mq!]$mq!^$mq~P#BwO$O$oq!]$oq!^$oq~P#BwO!^9oO~O$O9pO~P!1WO!g#vO!]'ei!k'ei~O!g#vO(r'pO!]'ei!k'ei~O!]/pO!k)Oq~O!Y'gi!]'gi~P#/sO!]/yO!Y)Pq~Or9wO!g#vO(r'pO~O[9yO!Y9xO~P#/sO!Y9xO~Oj:PO!g#vO~Og(_y!](_y~P!1WO!]'na!_'na~P#/sOa%[q!_%[q'z%[q!]%[q~P#/sO[:UO~O!]1TO!^)Xq~O`:YO~O#`:ZO!]'pa!^'pa~O!]5uO!^)Ui~P#BwO!S:]O~O!_1oO%i:`O~O(VTO(YUO(e:eO~O!]1zO!^)Vq~O!k:hO~O!k:iO~O!k:jO~O!k:jO~P%[O#`:mO!]#hy!^#hy~O!]#hy!^#hy~P#BwO%i:rO~P&8fO!_'`O%i:rO~O$O#|y!]#|y!^#|y~P#BwOP$|iR$|i[$|ij$|ir$|i!S$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i$O$|i(a$|i(r$|i!]$|i!^$|i~P''VO!Q*OO'y*PO(z%POP'iaR'ia['iaj'ian'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia$O'ia(a'ia(r'ia(y'ia!]'ia!^'ia~O!Q*OO'y*POP'kaR'ka['kaj'kan'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka$O'ka(a'ka(r'ka(y'ka(z'ka!]'ka!^'ka~O(y$}OP%aiR%ai[%aij%ain%air%ai!Q%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai$O%ai'y%ai(a%ai(r%ai(z%ai!]%ai!^%ai~O(z%POP%ciR%ci[%cij%cin%cir%ci!Q%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci$O%ci'y%ci(a%ci(r%ci(y%ci!]%ci!^%ci~O$O$oy!]$oy!^$oy~P#BwO$O#cy!]#cy!^#cy~P#BwO!g#vO!]'eq!k'eq~O!]/pO!k)Oy~O!Y'gq!]'gq~P#/sOr:|O!g#vO(r'pO~O[;QO!Y;PO~P#/sO!Y;PO~Og(_!R!](_!R~P!1WOa%[y!_%[y'z%[y!]%[y~P#/sO!]1TO!^)Xy~O!]5uO!^)Uq~O(T;XO~O!_1oO%i;[O~O!k;_O~O%i;dO~P&8fOP$|qR$|q[$|qj$|qr$|q!S$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q$O$|q(a$|q(r$|q!]$|q!^$|q~P''VO!Q*OO'y*PO(z%POP'jaR'ja['jaj'jan'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja$O'ja(a'ja(r'ja(y'ja!]'ja!^'ja~O!Q*OO'y*POP'laR'la['laj'lan'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la$O'la(a'la(r'la(y'la(z'la!]'la!^'la~OP%OqR%Oq[%Oqj%Oqr%Oq!S%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq$O%Oq(a%Oq(r%Oq!]%Oq!^%Oq~P''VOg%e!Z!]%e!Z#`%e!Z$O%e!Z~P!1WO!Y;hO~P#/sOr;iO!g#vO(r'pO~O[;kO!Y;hO~P#/sO!]'pq!^'pq~P#BwO!]#h!Z!^#h!Z~P#BwO#k%e!ZP%e!ZR%e!Z[%e!Za%e!Zj%e!Zr%e!Z!S%e!Z!]%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z'z%e!Z(a%e!Z(r%e!Z!k%e!Z!Y%e!Z'w%e!Z#`%e!Zv%e!Z!_%e!Z%i%e!Z!g%e!Z~P#/sOr;tO!g#vO(r'pO~O!Y;uO~P#/sOr;|O!g#vO(r'pO~O!Y;}O~P#/sOP%e!ZR%e!Z[%e!Zj%e!Zr%e!Z!S%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z$O%e!Z(a%e!Z(r%e!Z!]%e!Z!^%e!Z~P''VOr<QO!g#vO(r'pO~Ov(fX~P1qO!Q%rO~P!)[O(U!lO~P!)[O!YfX!]fX#`fX~P%2OOP]XR]X[]Xj]Xr]X!Q]X!S]X!]]X!]fX!l]X!p]X#R]X#S]X#`]X#`fX#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X~O!gfX!k]X!kfX(rfX~P'LTOP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_XO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(T)]O(VTO(YUO(aVO(o[O~O!]<iO!^$qa~Oh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O<tO!S${O!_$|O!i>WO!l$xO#j<zO$W%`O$t<vO$v<xO$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Ol)dO~P(!yOr!eX(r!eX~P#!iOr(jX(r(jX~P##[O!^]X!^fX~P'LTO!YfX!Y$zX!]fX!]$zX#`fX~P!0SO#k<^O~O!g#vO#k<^O~O#`<nO~Oj<bO~O#`=OO!](wX!^(wX~O#`<nO!](uX!^(uX~O#k=PO~Og=RO~P!1WO#k=XO~O#k=YO~Og=RO(T&ZO~O!g#vO#k=ZO~O!g#vO#k=PO~O$O=[O~P#BwO#k=]O~O#k=^O~O#k=cO~O#k=dO~O#k=eO~O#k=fO~O$O=gO~P!1WO$O=hO~P!1WOl=sO~P7eOk#S#T#U#W#X#[#i#j#u$n$t$v$y%]%^%h%i%j%q%s%v%w%y%{~(OT#o!X'|(U#ps#n#qr!Q'}$]'}(T$_(e~",
  goto: "$9Y)]PPPPPP)^PP)aP)rP+W/]PPPP6mPP7TPP=QPPP@tPA^PA^PPPA^PCfPA^PA^PA^PCjPCoPD^PIWPPPI[PPPPI[L_PPPLeMVPI[PI[PP! eI[PPPI[PI[P!#lI[P!'S!(X!(bP!)U!)Y!)U!,gPPPPPPP!-W!(XPP!-h!/YP!2iI[I[!2n!5z!:h!:h!>gPPP!>oI[PPPPPPPPP!BOP!C]PPI[!DnPI[PI[I[I[I[I[PI[!FQP!I[P!LbP!Lf!Lp!Lt!LtP!IXP!Lx!LxP#!OP#!SI[PI[#!Y#%_CjA^PA^PA^A^P#&lA^A^#)OA^#+vA^#.SA^A^#.r#1W#1W#1]#1f#1W#1qPP#1WPA^#2ZA^#6YA^A^6mPPP#:_PPP#:x#:xP#:xP#;`#:xPP#;fP#;]P#;]#;y#;]#<e#<k#<n)aP#<q)aP#<z#<z#<zP)aP)aP)aP)aPP)aP#=Q#=TP#=T)aP#=XP#=[P)aP)aP)aP)aP)aP)a)aPP#=b#=h#=s#=y#>P#>V#>]#>k#>q#>{#?R#?]#?c#?s#?y#@k#@}#AT#AZ#Ai#BO#Cs#DR#DY#Et#FS#Gt#HS#HY#H`#Hf#Hp#Hv#H|#IW#Ij#IpPPPPPPPPPPP#IvPPPPPPP#Jk#Mx$ b$ i$ qPPP$']P$'f$*_$0x$0{$1O$1}$2Q$2X$2aP$2g$2jP$3W$3[$4S$5b$5g$5}PP$6S$6Y$6^$6a$6e$6i$7e$7|$8e$8i$8l$8o$8y$8|$9Q$9UR!|RoqOXst!Z#d%m&r&t&u&w,s,x2[2_Y!vQ'`-e1o5{Q%tvQ%|yQ&T|Q&j!VS'W!e-]Q'f!iS'l!r!yU*k$|*Z*oQ+o%}S+|&V&WQ,d&dQ-c'_Q-m'gQ-u'mQ0[*qQ1b,OQ1y,eR<{<Y%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_S#q]<V!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SU+P%]<s<tQ+t&PQ,f&gQ,m&oQ0x+gQ0}+iQ1Y+uQ2R,kQ3`.gQ5`0|Q5f1TQ6[1zQ7Y3dQ8`5gR9e7['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S!S!nQ!r!v!y!z$|'W'_'`'l'm'n*k*o*q*r-]-c-e-u0[0_1o5{5}%[$ti#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^Q&X|Q'U!eS'[%i-`Q+t&PQ,P&WQ,f&gQ0n+SQ1Y+uQ1_+{Q2Q,jQ2R,kQ5f1TQ5o1aQ6[1zQ6_1|Q6`2PQ8`5gQ8c5lQ8|6bQ:X8dQ:f8yQ;V:YR<}*ZrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R,h&k&z^OPXYstuvwz!Z!`!g!j!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'b'r(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>R>S[#]WZ#W#Z'X(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ%wxQ%{yW&Q|&V&W,OQ&_!TQ'c!hQ'e!iQ(q#sS+n%|%}Q+r&PQ,_&bQ,c&dS-l'f'gQ.i(rQ1R+oQ1X+uQ1Z+vQ1^+zQ1t,`S1x,d,eQ2|-mQ5e1TQ5i1WQ5n1`Q6Z1yQ8_5gQ8b5kQ8f5pQ:T8^R;T:U!U$zi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y!^%yy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{Q+h%wQ,T&[Q,W&]Q,b&dQ.h(qQ1s,_U1w,c,d,eQ3e.iQ6U1tS6Y1x1yQ8x6Z#f>T#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^o>U<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hW%Ti%V*y>PS&[!Q&iQ&]!RQ&^!SU*}%[%d=sR,R&Y%]%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^T)z$u){V+P%]<s<tW'[!e%i*Z-`S(}#y#zQ+c%rQ+y&SS.b(m(nQ1j,XQ5T0kR8i5u'QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S$i$^c#Y#e%q%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.|.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`<W=vT#TV#U'RkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ'Y!eR2q-]!W!nQ!e!r!v!y!z$|'W'_'`'l'm'n*Z*k*o*q*r-]-c-e-u0[0_1o5{5}R1l,ZnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&y!^Q'v!xS(s#u<^Q+l%zQ,]&_Q,^&aQ-j'dQ-w'oS.r(x=PS0q+X=ZQ1P+mQ1n,[Q2c,zQ2e,{Q2m-WQ2z-kQ2}-oS5Y0r=eQ5a1QS5d1S=fQ6t2oQ6x2{Q6}3SQ8]5bQ9Y6vQ9Z6yQ9^7OR:l9V$d$]c#Y#e%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`<W=vS(o#p'iQ)P#zS+b%q.|S.c(n(pR3^.d'QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SS#q]<VQ&t!XQ&u!YQ&w![Q&x!]R2Z,vQ'a!hQ+e%wQ-h'cS.e(q+hQ2x-gW3b.h.i0w0yQ6w2yW7U3_3a3e5^U9a7V7X7ZU:q9c9d9fS;b:p:sQ;p;cR;x;qU!wQ'`-eT5y1o5{!Q_OXZ`st!V!Z#d#h%e%m&i&k&r&t&u&w(j,s,x.[2[2_]!pQ!r'`-e1o5{T#q]<V%^{OPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_S(}#y#zS.b(m(n!s=l$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SU$fd)_,mS(p#p'iU*v%R(w4OU0m+O.n7gQ5^0xQ7V3`Q9d7YR:s9em!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}Q't!uS(f#g2US-s'k'wQ/s*]Q0R*jQ3U-vQ4f/tQ4r0TQ4s0UQ4x0^Q7r4`S7}4t4vS8R4y4{Q9r7sQ9v7yQ9{8OQ:Q8TS:{9w9xS;g:|;PS;s;h;iS;{;t;uS<P;|;}R<S<QQ#wbQ's!uS(e#g2US(g#m+WQ+Y%fQ+j%xQ+p&OU-r'k't'wQ.W(fU/r*]*`/wQ0S*jQ0V*lQ1O+kQ1u,aS3R-s-vQ3Z.`S4e/s/tQ4n0PS4q0R0^Q4u0WQ6W1vQ7P3US7q4`4bQ7u4fU7|4r4x4{Q8P4wQ8v6XS9q7r7sQ9u7yQ9}8RQ:O8SQ:c8wQ:y9rS:z9v9xQ;S:QQ;^:dS;f:{;PS;r;g;hS;z;s;uS<O;{;}Q<R<PQ<T<SQ=o=jQ={=tR=|=uV!wQ'`-e%^aOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_S#wz!j!r=i$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SR=o>R%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Q%fj!^%xy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{S&Oz!jQ+k%yQ,a&dW1v,b,c,d,eU6X1w1x1yS8w6Y6ZQ:d8x!r=j$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ=t>QR=u>R%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Y#bWZ#W#Z(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ,n&o!p=k$Z$n)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SR=n'XU']!e%i*ZR2s-`%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ,m&oQ0x+gQ3`.gQ7Y3dR9e7[!b$Tc#Y%q(S(Y(t(y)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<W!P<d)^)q-Z.|2k2n3p3y3z4P4X6u7b7k7l8k9X9g9m9n;W;`=v!f$Vc#Y%q(S(Y(t(y)W)X)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<W!T<f)^)q-Z.|2k2n3p3v3w3y3z4P4X6u7b7k7l8k9X9g9m9n;W;`=v!^$Zc#Y%q(S(Y(t(y)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<WQ4_/kz>S)^)q-Z.|2k2n3p4P4X6u7b7k7l8k9X9g9m9n;W;`=vQ>X>ZR>Y>['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SS$oh$pR4U/U'XgOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>ST$kf$qQ$ifS)j$l)nR)v$qT$jf$qT)l$l)n'XhOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>ST$oh$pQ$rhR)u$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_!s>Q$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S#glOPXZst!Z!`!o#S#d#o#{$n%m&k&n&o&r&t&u&w&{'T'b)O)s*i+]+g,p,s,x-i.g/V/n0]0l1r2S2T2V2X2[2_2a3d4T4z6T6e6f6i7[8t9T!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^Q+T%aQ/c*Oo4O<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!U$yi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>YQ*c$zU*l$|*Z*oQ+U%bQ0W*m#f=q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n=r<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hQ=w>TQ=x>UQ=y>VR=z>W!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^o4O<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hnoOXst!Z#d%m&r&t&u&w,s,x2[2_S*f${*YQ-R'OQ-S'QR4i/y%[%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^Q,U&]Q1h,WQ5s1gR8h5tV*n$|*Z*oU*n$|*Z*oT5z1o5{S0P*i/nQ4w0]T8S4z:]Q+j%xQ0V*lQ1O+kQ1u,aQ6W1vQ8v6XQ:c8wR;^:d!U%Oi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Yx*R$v)e*S*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>OS0`*t0a#f<o#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n<p<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!d=S(u)c*[*e.j.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[`=T3}7c7f7j9h:t:w;yS=_.l3iT=`7e9k!U%Qi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y|*T$v)e*U*t+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>OS0b*u0c#f<q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n<r<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!h=U(u)c*[*e.k.l.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[d=V3}7d7e7j9h9i:t:u:w;yS=a.m3jT=b7f9lrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q&f!UR,p&ornOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R&f!UQ,Y&^R1d,RsnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q1p,_S6R1s1tU8p6P6Q6US:_8r8sS;Y:^:aQ;m;ZR;w;nQ&m!VR,i&iR6_1|R:f8yW&Q|&V&W,OR1Z+vQ&r!WR,s&sR,y&xT2],x2_R,}&yQ,|&yR2f,}Q'y!{R-y'ySsOtQ#dXT%ps#dQ#OTR'{#OQ#RUR'}#RQ){$uR/`){Q#UVR(Q#UQ#XWU(W#X(X.QQ(X#YR.Q(YQ-^'YR2r-^Q.u(yS3m.u3nR3n.vQ-e'`R2v-eY!rQ'`-e1o5{R'j!rQ/Q)eR4S/QU#_W%h*YU(_#_(`.RQ(`#`R.R(ZQ-a']R2t-at`OXst!V!Z#d%m&i&k&r&t&u&w,s,x2[2_S#hZ%eU#r`#h.[R.[(jQ(k#jQ.X(gW.a(k.X3X7RQ3X.YR7R3YQ)n$lR/W)nQ$phR)t$pQ$`cU)a$`-|<jQ-|<WR<j)qQ/q*]W4c/q4d7t9sU4d/r/s/tS7t4e4fR9s7u$e*Q$v(u)c)e*[*e*t*u+Q+R+V.l.m.o.p.q/_/g/i/k/v/|0d0e0v1e3f3g3h3}4R4[4g4h4l4|5O5R5S5W5r7]7^7_7`7e7f7h7i7j7p7w7z8U8X8Z9h9i9j9t9|:R:S:t:u:v:w:x:};R;e;j;v;y=p=}>O>Z>[Q/z*eU4k/z4m7xQ4m/|R7x4lS*o$|*ZR0Y*ox*S$v)e*t*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>O!d.j(u)c*[*e.l.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/h*S.j7ca7c3}7e7f7j9h:t:w;yQ0a*tQ3i.lU4}0a3i9kR9k7e|*U$v)e*t*u+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>O!h.k(u)c*[*e.l.m.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/j*U.k7de7d3}7e7f7j9h9i:t:u:w;yQ0c*uQ3j.mU5P0c3j9lR9l7fQ*z%UR0g*zQ5]0vR8Y5]Q+_%kR0u+_Q5v1jS8j5v:[R:[8kQ,[&_R1m,[Q5{1oR8m5{Q1{,fS6]1{8zR8z6_Q1U+rW5h1U5j8a:VQ5j1XQ8a5iR:V8bQ+w&QR1[+wQ2_,xR6m2_YrOXst#dQ&v!ZQ+a%mQ,r&rQ,t&tQ,u&uQ,w&wQ2Y,sS2],x2_R6l2[Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'q!uQ+`%lQ+l%zQ,Q&XQ,h&mQ-P&|W-p'k's't'wQ-w'oQ0X*nQ1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.l<oQ.m<qQ.o<uQ.p<wQ.q<yQ/_)yQ/g*RQ/i*TQ/k*VQ/v*aS/|*g/mQ0d*wQ0e*xl0v+f,V.f1i1q3c6S7W8q9b:`:r;[;dQ1e,SQ3f=SQ3g=UQ3h=XS3}<l<mQ4R/PS4[/d4^Q4g/xQ4h/yQ4l/{Q4|0`Q5O0bQ5R0iQ5S0jQ5W0oQ5r1fQ7]=]Q7^=_Q7_=aQ7`=cQ7e<pQ7f<rQ7h<vQ7i<xQ7j<zQ7p4_Q7w4jQ7z4oQ8U5QQ8X5[Q8Z5_Q9h=YQ9i=TQ9j=VQ9t7vQ9|8QQ:R8VQ:S8[Q:t=^Q:u=`Q:v=bQ:w=dQ:x9pQ:}9yQ;R:PQ;e=gQ;j;QQ;v;kQ;y=hQ=p>PQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.n<sR7g<tnpOXst!Z#d%m&r&t&u&w,s,x2[2_Q!fPS#fZ#oQ&|!`W'h!o*i0]4zQ(P#SQ)Q#{Q)r$nS,l&k&nQ,q&oQ-O&{S-T'T/nQ-g'bQ.x)OQ/[)sQ0s+]Q0y+gQ2W,pQ2y-iQ3a.gQ4W/VQ5U0lQ6Q1rQ6c2SQ6d2TQ6h2VQ6j2XQ6o2aQ7Z3dQ7m4TQ8s6TQ9P6eQ9Q6fQ9S6iQ9f7[Q:a8tR:k9T#[cOPXZst!Z!`!o#d#o#{%m&k&n&o&r&t&u&w&{'T'b)O*i+]+g,p,s,x-i.g/n0]0l1r2S2T2V2X2[2_2a3d4z6T6e6f6i7[8t9TQ#YWQ#eYQ%quQ%svS%uw!gS(S#W(VQ(Y#ZQ(t#uQ(y#xQ)R$OQ)S$PQ)T$QQ)U$RQ)V$SQ)W$TQ)X$UQ)Y$VQ)Z$WQ)[$XQ)^$ZQ)`$_Q)b$aQ)g$eW)q$n)s/V4TQ+d%tQ+x&RS-Z'X2pQ-x'rS-}(T.PQ.S(]Q.U(dQ.s(xQ.v(zQ.z<UQ.|<XQ.}<YQ/O<]Q/b)}Q0p+XQ2k-UQ2n-XQ3O-qQ3V.VQ3k.tQ3p<^Q3q<_Q3r<`Q3s<aQ3t<bQ3u<cQ3v<dQ3w<eQ3x<fQ3y<gQ3z<hQ3{.{Q3|<kQ4P<nQ4Q<{Q4X<iQ5X0rQ5c1SQ6u=OQ6{3QQ7Q3WQ7a3lQ7b=PQ7k=RQ7l=ZQ8k5wQ9X6sQ9]6|Q9g=[Q9m=eQ9n=fQ:o9_Q;W:ZQ;`:mQ<W#SR=v>SR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i<VR)f$dY!uQ'`-e1o5{Q'k!rS'u!v!yS'w!z5}S-t'l'mQ-v'nR3T-uT#kZ%eS#jZ%eS%km,oU(g#h#i#lS.Y(h(iQ.^(jQ0t+^Q3Y.ZU3Z.[.]._S7S3[3]R9`7Td#^W#W#Z%h(T(^*Y+Z.T/mr#gZm#h#i#l%e(h(i(j+^.Z.[.]._3[3]7TS*]$x*bQ/t*^Q2U,oQ2l-VQ4`/pQ6q2dQ7s4aQ9W6rT=m'X+[V#aW%h*YU#`W%h*YS(U#W(^U(Z#Z+Z/mS-['X+[T.O(T.TV'^!e%i*ZQ$lfR)x$qT)m$l)nR4V/UT*_$x*bT*h${*YQ0w+fQ1g,VQ3_.fQ5t1iQ6P1qQ7X3cQ8r6SQ9c7WQ:^8qQ:p9bQ;Z:`Q;c:rQ;n;[R;q;dnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&l!VR,h&itmOXst!U!V!Z#d%m&i&r&t&u&w,s,x2[2_R,o&oT%lm,oR1k,XR,g&gQ&U|S+}&V&WR1^,OR+s&PT&p!W&sT&q!W&sT2^,x2_",
  nodeNames: "⚠ ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",
  maxTerm: 380,
  context: CSe,
  nodeProps: [
    ["isolate", -8, 5, 6, 14, 37, 39, 51, 53, 55, ""],
    ["group", -26, 9, 17, 19, 68, 207, 211, 215, 216, 218, 221, 224, 234, 237, 243, 245, 247, 249, 252, 258, 264, 266, 268, 270, 272, 274, 275, "Statement", -34, 13, 14, 32, 35, 36, 42, 51, 54, 55, 57, 62, 70, 72, 76, 80, 82, 84, 85, 110, 111, 120, 121, 136, 139, 141, 142, 143, 144, 145, 147, 148, 167, 169, 171, "Expression", -23, 31, 33, 37, 41, 43, 45, 173, 175, 177, 178, 180, 181, 182, 184, 185, 186, 188, 189, 190, 201, 203, 205, 206, "Type", -3, 88, 103, 109, "ClassItem"],
    ["openedBy", 23, "<", 38, "InterpolationStart", 56, "[", 60, "{", 73, "(", 160, "JSXStartCloseTag"],
    ["closedBy", -2, 24, 168, ">", 40, "InterpolationEnd", 50, "]", 61, "}", 74, ")", 165, "JSXEndTag"]
  ],
  propSources: [_Se],
  skippedNodes: [0, 5, 6, 278],
  repeatNodeCount: 37,
  tokenData: "$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$<r#p#q$=h#q#r$>x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$i&j(Wp(Z!b'|0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(X#S$i&j'}0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$i&j(Wp(Z!b'}0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$i&j!p),Q(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(V':f$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$i&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$d`$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$d``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$d`$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(Z!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$d`(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$i&j(Wp(Z!bOY%ZYZ&cZq%Zqr<Srs&}st%ZtuCruw%Zwx(rx!^%Z!^!_*g!_!c%Z!c!}Cr!}#O%Z#O#P&c#P#R%Z#R#SCr#S#T%Z#T#oCr#o#p*g#p$g%Z$g;'SCr;'S;=`El<%lOCr(r<__WS$i&j(Wp(Z!bOY<SYZ&cZr<Srs=^sw<Swx@nx!^<S!^!_Bm!_#O<S#O#P>`#P#o<S#o#pBm#p;'S<S;'S;=`Cl<%lO<S(Q=g]WS$i&j(Z!bOY=^YZ&cZw=^wx>`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$i&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(Z!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$i&j(WpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(WpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Wp(Z!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l<S%9[C}i$i&j(o%1l(Wp(Z!bOY%ZYZ&cZr%Zrs&}st%ZtuCruw%Zwx(rx!Q%Z!Q![Cr![!^%Z!^!_*g!_!c%Z!c!}Cr!}#O%Z#O#P&c#P#R%Z#R#SCr#S#T%Z#T#oCr#o#p*g#p$g%Z$g;'SCr;'S;=`El<%lOCr%9[EoP;=`<%lCr07[FRk$i&j(Wp(Z!b$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr+dHRk$i&j(Wp(Z!b$]#tOY%ZYZ&cZr%Zrs&}st%ZtuGvuw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Gv![!^%Z!^!_*g!_!c%Z!c!}Gv!}#O%Z#O#P&c#P#R%Z#R#SGv#S#T%Z#T#oGv#o#p*g#p$g%Z$g;'SGv;'S;=`Iv<%lOGv+dIyP;=`<%lGv07[JPP;=`<%lEr(KWJ_`$i&j(Wp(Z!b#p(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KWKl_$i&j$Q(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z,#xLva(z+JY$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sv%ZvwM{wx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KWNW`$i&j#z(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At! c_(Y';W$i&j(WpOY!!bYZ!#hZr!!brs!#hsw!!bwx!$xx!^!!b!^!_!%z!_#O!!b#O#P!#h#P#o!!b#o#p!%z#p;'S!!b;'S;=`!'c<%lO!!b'l!!i_$i&j(WpOY!!bYZ!#hZr!!brs!#hsw!!bwx!$xx!^!!b!^!_!%z!_#O!!b#O#P!#h#P#o!!b#o#p!%z#p;'S!!b;'S;=`!'c<%lO!!b&z!#mX$i&jOw!#hwx6cx!^!#h!^!_!$Y!_#o!#h#o#p!$Y#p;'S!#h;'S;=`!$r<%lO!#h`!$]TOw!$Ywx7]x;'S!$Y;'S;=`!$l<%lO!$Y`!$oP;=`<%l!$Y&z!$uP;=`<%l!#h'l!%R]$d`$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(r!Q!&PZ(WpOY!%zYZ!$YZr!%zrs!$Ysw!%zwx!&rx#O!%z#O#P!$Y#P;'S!%z;'S;=`!']<%lO!%z!Q!&yU$d`(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)r!Q!'`P;=`<%l!%z'l!'fP;=`<%l!!b/5|!'t_!l/.^$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#&U!)O_!k!Lf$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z-!n!*[b$i&j(Wp(Z!b(U%&f#q(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rxz%Zz{!+d{!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW!+o`$i&j(Wp(Z!b#n(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z+;x!,|`$i&j(Wp(Z!br+4YOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z,$U!.Z_!]+Jf$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[!/ec$i&j(Wp(Z!b!Q.2^OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!0p!P!Q%Z!Q![!3Y![!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#%|!0ya$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!2O!P!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#%|!2Z_![!L^$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!3eg$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!3Y![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S!3Y#S#X%Z#X#Y!4|#Y#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!5Vg$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx{%Z{|!6n|}%Z}!O!6n!O!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!6wc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!8_c$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[!9uf$i&j(Wp(Z!b#o(ChOY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcxz!;Zz{#-}{!P!;Z!P!Q#/d!Q!^!;Z!^!_#(i!_!`#7S!`!a#8i!a!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z?O!;fb$i&j(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z>^!<w`$i&j(Z!b!X7`OY!<nYZ&cZw!<nwx!=yx!P!<n!P!Q!Eq!Q!^!<n!^!_!Gr!_!}!<n!}#O!KS#O#P!Dy#P#o!<n#o#p!Gr#p;'S!<n;'S;=`!L]<%lO!<n<z!>Q^$i&j!X7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y<z!?Td$i&j!X7`O!^&c!_#W&c#W#X!>|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!X7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!X7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c<z!C][$i&jOY!CWYZ&cZ!^!CW!^!_!Ar!_#O!CW#O#P!DR#P#Q!=y#Q#o!CW#o#p!Ar#p;'S!CW;'S;=`!Ds<%lO!CW<z!DWX$i&jOY!CWYZ&cZ!^!CW!^!_!Ar!_#o!CW#o#p!Ar#p;'S!CW;'S;=`!Ds<%lO!CW<z!DvP;=`<%l!CW<z!EOX$i&jOY!=yYZ&cZ!^!=y!^!_!@c!_#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y<z!EnP;=`<%l!=y>^!Ezl$i&j(Z!b!X7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(Z!b!X7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(Z!b!X7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(Z!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$i&j(Z!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!<n#Q#o!KS#o#p!JU#p;'S!KS;'S;=`!LV<%lO!KS>^!LYP;=`<%l!KS>^!L`P;=`<%l!<n=l!Ll`$i&j(Wp!X7`OY!LcYZ&cZr!Lcrs!=ys!P!Lc!P!Q!Mn!Q!^!Lc!^!_# o!_!}!Lc!}#O#%P#O#P!Dy#P#o!Lc#o#p# o#p;'S!Lc;'S;=`#&Y<%lO!Lc=l!Mwl$i&j(Wp!X7`OY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#W(r#W#X!Mn#X#Z(r#Z#[!Mn#[#](r#]#^!Mn#^#a(r#a#b!Mn#b#g(r#g#h!Mn#h#i(r#i#j!Mn#j#k!Mn#k#m(r#m#n!Mn#n#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(r8Q# vZ(Wp!X7`OY# oZr# ors!@cs!P# o!P!Q#!i!Q!}# o!}#O#$R#O#P!Bq#P;'S# o;'S;=`#$y<%lO# o8Q#!pe(Wp!X7`OY)rZr)rs#O)r#P#W)r#W#X#!i#X#Z)r#Z#[#!i#[#])r#]#^#!i#^#a)r#a#b#!i#b#g)r#g#h#!i#h#i)r#i#j#!i#j#k#!i#k#m)r#m#n#!i#n;'S)r;'S;=`*Z<%lO)r8Q#$WX(WpOY#$RZr#$Rrs!Ars#O#$R#O#P!B[#P#Q# o#Q;'S#$R;'S;=`#$s<%lO#$R8Q#$vP;=`<%l#$R8Q#$|P;=`<%l# o=l#%W^$i&j(WpOY#%PYZ&cZr#%Prs!CWs!^#%P!^!_#$R!_#O#%P#O#P!DR#P#Q!Lc#Q#o#%P#o#p#$R#p;'S#%P;'S;=`#&S<%lO#%P=l#&VP;=`<%l#%P=l#&]P;=`<%l!Lc?O#&kn$i&j(Wp(Z!b!X7`OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#W%Z#W#X#&`#X#Z%Z#Z#[#&`#[#]%Z#]#^#&`#^#a%Z#a#b#&`#b#g%Z#g#h#&`#h#i%Z#i#j#&`#j#k#&`#k#m%Z#m#n#&`#n#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z9d#(r](Wp(Z!b!X7`OY#(iZr#(irs!Grsw#(iwx# ox!P#(i!P!Q#)k!Q!}#(i!}#O#+`#O#P!Bq#P;'S#(i;'S;=`#,`<%lO#(i9d#)th(Wp(Z!b!X7`OY*gZr*grs'}sw*gwx)rx#O*g#P#W*g#W#X#)k#X#Z*g#Z#[#)k#[#]*g#]#^#)k#^#a*g#a#b#)k#b#g*g#g#h#)k#h#i*g#i#j#)k#j#k#)k#k#m*g#m#n#)k#n;'S*g;'S;=`+Z<%lO*g9d#+gZ(Wp(Z!bOY#+`Zr#+`rs!JUsw#+`wx#$Rx#O#+`#O#P!B[#P#Q#(i#Q;'S#+`;'S;=`#,Y<%lO#+`9d#,]P;=`<%l#+`9d#,cP;=`<%l#(i?O#,o`$i&j(Wp(Z!bOY#,fYZ&cZr#,frs!KSsw#,fwx#%Px!^#,f!^!_#+`!_#O#,f#O#P!DR#P#Q!;Z#Q#o#,f#o#p#+`#p;'S#,f;'S;=`#-q<%lO#,f?O#-tP;=`<%l#,f?O#-zP;=`<%l!;Z07[#.[b$i&j(Wp(Z!b(O0/l!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z07[#/o_$i&j(Wp(Z!bT0/lOY#/dYZ&cZr#/drs#0nsw#/dwx#4Ox!^#/d!^!_#5}!_#O#/d#O#P#1p#P#o#/d#o#p#5}#p;'S#/d;'S;=`#6|<%lO#/d06j#0w]$i&j(Z!bT0/lOY#0nYZ&cZw#0nwx#1px!^#0n!^!_#3R!_#O#0n#O#P#1p#P#o#0n#o#p#3R#p;'S#0n;'S;=`#3x<%lO#0n05W#1wX$i&jT0/lOY#1pYZ&cZ!^#1p!^!_#2d!_#o#1p#o#p#2d#p;'S#1p;'S;=`#2{<%lO#1p0/l#2iST0/lOY#2dZ;'S#2d;'S;=`#2u<%lO#2d0/l#2xP;=`<%l#2d05W#3OP;=`<%l#1p01O#3YW(Z!bT0/lOY#3RZw#3Rwx#2dx#O#3R#O#P#2d#P;'S#3R;'S;=`#3r<%lO#3R01O#3uP;=`<%l#3R06j#3{P;=`<%l#0n05x#4X]$i&j(WpT0/lOY#4OYZ&cZr#4Ors#1ps!^#4O!^!_#5Q!_#O#4O#O#P#1p#P#o#4O#o#p#5Q#p;'S#4O;'S;=`#5w<%lO#4O00^#5XW(WpT0/lOY#5QZr#5Qrs#2ds#O#5Q#O#P#2d#P;'S#5Q;'S;=`#5q<%lO#5Q00^#5tP;=`<%l#5Q05x#5zP;=`<%l#4O01p#6WY(Wp(Z!bT0/lOY#5}Zr#5}rs#3Rsw#5}wx#5Qx#O#5}#O#P#2d#P;'S#5};'S;=`#6v<%lO#5}01p#6yP;=`<%l#5}07[#7PP;=`<%l#/d)3h#7ab$i&j$Q(Ch(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;ZAt#8vb$Z#t$i&j(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z'Ad#:Zp$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!3Y!P!Q%Z!Q![#<_![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S#<_#S#U%Z#U#V#?i#V#X%Z#X#Y!4|#Y#b%Z#b#c#>_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#<jk$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!3Y!P!Q%Z!Q![#<_![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S#<_#S#X%Z#X#Y!4|#Y#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!g$b$i&j$O)Lv(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#R-<U(Wp(Z!b$n7`OY*gZr*grs'}sw*gwx)rx!P*g!P!Q#MO!Q!^*g!^!_#Mt!_!`$ f!`#O*g#P;'S*g;'S;=`+Z<%lO*g(n#MXX$k&j(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g(El#M}Z#r(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx!_*g!_!`#Np!`#O*g#P;'S*g;'S;=`+Z<%lO*g(El#NyX$Q(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g(El$ oX#s(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g*)x$!ga#`*!Y$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`!a$#l!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(K[$#w_#k(Cl$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x$%Vag!*r#s(Ch$f#|$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`$&[!`!a$'f!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$&g_#s(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$'qa#r(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`!a$(v!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$)R`#r(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(Kd$*`a(r(Ct$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!a%Z!a!b$+e!b#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$+p`$i&j#{(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#`$,}_!|$Ip$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f$.X_!S0,v$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(n$/]Z$i&jO!^$0O!^!_$0f!_#i$0O#i#j$0k#j#l$0O#l#m$2^#m#o$0O#o#p$0f#p;'S$0O;'S;=`$4i<%lO$0O(n$0VT_#S$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c#S$0kO_#S(n$0p[$i&jO!Q&c!Q![$1f![!^&c!_!c&c!c!i$1f!i#T&c#T#Z$1f#Z#o&c#o#p$3|#p;'S&c;'S;=`&w<%lO&c(n$1kZ$i&jO!Q&c!Q![$2^![!^&c!_!c&c!c!i$2^!i#T&c#T#Z$2^#Z#o&c#p;'S&c;'S;=`&w<%lO&c(n$2cZ$i&jO!Q&c!Q![$3U![!^&c!_!c&c!c!i$3U!i#T&c#T#Z$3U#Z#o&c#p;'S&c;'S;=`&w<%lO&c(n$3ZZ$i&jO!Q&c!Q![$0O![!^&c!_!c&c!c!i$0O!i#T&c#T#Z$0O#Z#o&c#p;'S&c;'S;=`&w<%lO&c#S$4PR!Q![$4Y!c!i$4Y#T#Z$4Y#S$4]S!Q![$4Y!c!i$4Y#T#Z$4Y#q#r$0f(n$4lP;=`<%l$0O#1[$4z_!Y#)l$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$6U`#x(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z+;p$7c_$i&j(Wp(Z!b(a+4QOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$8qk$i&j(Wp(Z!b(T,2j$_#t(e$I[OY%ZYZ&cZr%Zrs&}st%Ztu$8buw%Zwx(rx}%Z}!O$:f!O!Q%Z!Q![$8b![!^%Z!^!_*g!_!c%Z!c!}$8b!}#O%Z#O#P&c#P#R%Z#R#S$8b#S#T%Z#T#o$8b#o#p*g#p$g%Z$g;'S$8b;'S;=`$<l<%lO$8b+d$:qk$i&j(Wp(Z!b$_#tOY%ZYZ&cZr%Zrs&}st%Ztu$:fuw%Zwx(rx}%Z}!O$:f!O!Q%Z!Q![$:f![!^%Z!^!_*g!_!c%Z!c!}$:f!}#O%Z#O#P&c#P#R%Z#R#S$:f#S#T%Z#T#o$:f#o#p*g#p$g%Z$g;'S$:f;'S;=`$<f<%lO$:f+d$<iP;=`<%l$:f07[$<oP;=`<%l$8b#Jf$<{X!_#Hb(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g,#x$=sa(y+JY$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p#q$+e#q;'S%Z;'S;=`+a<%lO%Z)>v$?V_!^(CdvBr$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!q7`$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$i&j(Wp(Z!b'|0/l$]#t(T,2j(e$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",
  tokenizers: [kSe, TSe, PSe, ESe, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, $Se, new ew("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~", 141, 340), new ew("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~", 25, 323)],
  topRules: { Script: [0, 7], SingleExpression: [1, 276], SingleClassItem: [2, 277] },
  dialects: { jsx: 0, ts: 15175 },
  dynamicPrecedences: { 80: 1, 82: 1, 94: 1, 169: 1, 199: 1 },
  specialized: [{ term: 327, get: (t) => ISe[t] || -1 }, { term: 343, get: (t) => MSe[t] || -1 }, { term: 95, get: (t) => ASe[t] || -1 }],
  tokenPrec: 15201
}), n8 = [
  /* @__PURE__ */ fr("function ${name}(${params}) {\n	${}\n}", {
    label: "function",
    detail: "definition",
    type: "keyword"
  }),
  /* @__PURE__ */ fr("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n	${}\n}", {
    label: "for",
    detail: "loop",
    type: "keyword"
  }),
  /* @__PURE__ */ fr("for (let ${name} of ${collection}) {\n	${}\n}", {
    label: "for",
    detail: "of loop",
    type: "keyword"
  }),
  /* @__PURE__ */ fr("do {\n	${}\n} while (${})", {
    label: "do",
    detail: "loop",
    type: "keyword"
  }),
  /* @__PURE__ */ fr("while (${}) {\n	${}\n}", {
    label: "while",
    detail: "loop",
    type: "keyword"
  }),
  /* @__PURE__ */ fr(`try {
	\${}
} catch (\${error}) {
	\${}
}`, {
    label: "try",
    detail: "/ catch block",
    type: "keyword"
  }),
  /* @__PURE__ */ fr("if (${}) {\n	${}\n}", {
    label: "if",
    detail: "block",
    type: "keyword"
  }),
  /* @__PURE__ */ fr(`if (\${}) {
	\${}
} else {
	\${}
}`, {
    label: "if",
    detail: "/ else block",
    type: "keyword"
  }),
  /* @__PURE__ */ fr(`class \${name} {
	constructor(\${params}) {
		\${}
	}
}`, {
    label: "class",
    detail: "definition",
    type: "keyword"
  }),
  /* @__PURE__ */ fr('import {${names}} from "${module}"\n${}', {
    label: "import",
    detail: "named",
    type: "keyword"
  }),
  /* @__PURE__ */ fr('import ${name} from "${module}"\n${}', {
    label: "import",
    detail: "default",
    type: "keyword"
  })
], DSe = /* @__PURE__ */ n8.concat([
  /* @__PURE__ */ fr("interface ${name} {\n	${}\n}", {
    label: "interface",
    detail: "definition",
    type: "keyword"
  }),
  /* @__PURE__ */ fr("type ${name} = ${type}", {
    label: "type",
    detail: "definition",
    type: "keyword"
  }),
  /* @__PURE__ */ fr("enum ${name} {\n	${}\n}", {
    label: "enum",
    detail: "definition",
    type: "keyword"
  })
]), JM = /* @__PURE__ */ new Bxe(), i8 = /* @__PURE__ */ new Set([
  "Script",
  "Block",
  "FunctionExpression",
  "FunctionDeclaration",
  "ArrowFunction",
  "MethodDeclaration",
  "ForStatement"
]);
function Bh(t) {
  return (e, n) => {
    let i = e.node.getChild("VariableDefinition");
    return i && n(i, t), !0;
  };
}
const NSe = ["FunctionDeclaration"], LSe = {
  FunctionDeclaration: /* @__PURE__ */ Bh("function"),
  ClassDeclaration: /* @__PURE__ */ Bh("class"),
  ClassExpression: () => !0,
  EnumDeclaration: /* @__PURE__ */ Bh("constant"),
  TypeAliasDeclaration: /* @__PURE__ */ Bh("type"),
  NamespaceDeclaration: /* @__PURE__ */ Bh("namespace"),
  VariableDefinition(t, e) {
    t.matchContext(NSe) || e(t, "variable");
  },
  TypeDefinition(t, e) {
    e(t, "type");
  },
  __proto__: null
};
function o8(t, e) {
  let n = JM.get(e);
  if (n)
    return n;
  let i = [], o = !0;
  function r(a, l) {
    let s = t.sliceString(a.from, a.to);
    i.push({ label: s, type: l });
  }
  return e.cursor(Li.IncludeAnonymous).iterate((a) => {
    if (o)
      o = !1;
    else if (a.name) {
      let l = LSe[a.name];
      if (l && l(a, r) || i8.has(a.name))
        return !1;
    } else if (a.to - a.from > 8192) {
      for (let l of o8(t, a.node))
        i.push(l);
      return !1;
    }
  }), JM.set(e, i), i;
}
const eA = /^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/, r8 = [
  "TemplateString",
  "String",
  "RegExp",
  "LineComment",
  "BlockComment",
  "VariableDefinition",
  "TypeDefinition",
  "Label",
  "PropertyDefinition",
  "PropertyName",
  "PrivatePropertyDefinition",
  "PrivatePropertyName",
  "JSXText",
  "JSXAttributeValue",
  "JSXOpenTag",
  "JSXCloseTag",
  "JSXSelfClosingTag",
  ".",
  "?."
];
function zSe(t) {
  let e = Rs(t.state).resolveInner(t.pos, -1);
  if (r8.indexOf(e.name) > -1)
    return null;
  let n = e.name == "VariableName" || e.to - e.from < 20 && eA.test(t.state.sliceDoc(e.from, e.to));
  if (!n && !t.explicit)
    return null;
  let i = [];
  for (let o = e; o; o = o.parent)
    i8.has(o.name) && (i = i.concat(o8(t.state.doc, o)));
  return {
    options: i,
    from: n ? e.from : t.pos,
    validFor: eA
  };
}
const Fc = /* @__PURE__ */ w0.define({
  name: "javascript",
  parser: /* @__PURE__ */ RSe.configure({
    props: [
      /* @__PURE__ */ Jxe.add({
        IfStatement: /* @__PURE__ */ lx({ except: /^\s*({|else\b)/ }),
        TryStatement: /* @__PURE__ */ lx({ except: /^\s*({|catch\b|finally\b)/ }),
        LabeledStatement: iOe,
        SwitchBody: (t) => {
          let e = t.textAfter, n = /^\s*\}/.test(e), i = /^\s*(case|default)\b/.test(e);
          return t.baseIndent + (n ? 0 : i ? 1 : 2) * t.unit;
        },
        Block: /* @__PURE__ */ tOe({ closing: "}" }),
        ArrowFunction: (t) => t.baseIndent + t.unit,
        "TemplateString BlockComment": () => null,
        "Statement Property": /* @__PURE__ */ lx({ except: /^\s*{/ }),
        JSXElement(t) {
          let e = /^\s*<\//.test(t.textAfter);
          return t.lineIndent(t.node.from) + (e ? 0 : t.unit);
        },
        JSXEscape(t) {
          let e = /\s*\}/.test(t.textAfter);
          return t.lineIndent(t.node.from) + (e ? 0 : t.unit);
        },
        "JSXOpenTag JSXSelfClosingTag"(t) {
          return t.column(t.node.from) + t.unit;
        }
      }),
      /* @__PURE__ */ oOe.add({
        "Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType": rOe,
        BlockComment(t) {
          return { from: t.from + 2, to: t.to - 2 };
        },
        JSXElement(t) {
          let e = t.firstChild;
          if (!e || e.name == "JSXSelfClosingTag")
            return null;
          let n = t.lastChild;
          return { from: e.to, to: n.type.isError ? t.to : n.from };
        },
        "JSXSelfClosingTag JSXOpenTag"(t) {
          var e;
          let n = (e = t.firstChild) === null || e === void 0 ? void 0 : e.nextSibling, i = t.lastChild;
          return !n || n.type.isError ? null : { from: n.to, to: i.type.isError ? t.to : i.from };
        }
      })
    ]
  }),
  languageData: {
    closeBrackets: { brackets: ["(", "[", "{", "'", '"', "`"] },
    commentTokens: { line: "//", block: { open: "/*", close: "*/" } },
    indentOnInput: /^\s*(?:case |default:|\{|\}|<\/)$/,
    wordChars: "$"
  }
}), a8 = {
  test: (t) => /^JSX/.test(t.name),
  facet: /* @__PURE__ */ H6({ commentTokens: { block: { open: "{/*", close: "*/}" } } })
}, BSe = /* @__PURE__ */ Fc.configure({ dialect: "ts" }, "typescript"), FSe = /* @__PURE__ */ Fc.configure({
  dialect: "jsx",
  props: [/* @__PURE__ */ xk.add((t) => t.isTop ? [a8] : void 0)]
}), VSe = /* @__PURE__ */ Fc.configure({
  dialect: "jsx ts",
  props: [/* @__PURE__ */ xk.add((t) => t.isTop ? [a8] : void 0)]
}, "typescript");
let l8 = (t) => ({ label: t, type: "keyword" });
const s8 = /* @__PURE__ */ "break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(l8), QSe = /* @__PURE__ */ s8.concat(/* @__PURE__ */ ["declare", "implements", "private", "protected", "public"].map(l8));
function u8(t = {}) {
  let e = t.jsx ? t.typescript ? VSe : FSe : t.typescript ? BSe : Fc, n = t.typescript ? DSe.concat(QSe) : n8.concat(s8);
  return new Gxe(e, [
    Fc.data.of({
      autocomplete: hOe(r8, Y6(n))
    }),
    Fc.data.of({
      autocomplete: zSe
    }),
    t.jsx ? jSe : []
  ]);
}
function HSe(t) {
  for (; ; ) {
    if (t.name == "JSXOpenTag" || t.name == "JSXSelfClosingTag" || t.name == "JSXFragmentTag")
      return t;
    if (t.name == "JSXEscape" || !t.parent)
      return null;
    t = t.parent;
  }
}
function tA(t, e, n = t.length) {
  for (let i = e?.firstChild; i; i = i.nextSibling)
    if (i.name == "JSXIdentifier" || i.name == "JSXBuiltin" || i.name == "JSXNamespacedName" || i.name == "JSXMemberExpression")
      return t.sliceString(i.from, Math.min(i.to, n));
  return "";
}
const WSe = typeof navigator == "object" && /* @__PURE__ */ /Android\b/.test(navigator.userAgent), jSe = /* @__PURE__ */ Kt.inputHandler.of((t, e, n, i, o) => {
  if ((WSe ? t.composing : t.compositionStarted) || t.state.readOnly || e != n || i != ">" && i != "/" || !Fc.isActiveAt(t.state, e, -1))
    return !1;
  let r = o(), { state: a } = r, l = a.changeByRange((s) => {
    var u;
    let { head: c } = s, d = Rs(a).resolveInner(c - 1, -1), f;
    if (d.name == "JSXStartTag" && (d = d.parent), !(a.doc.sliceString(c - 1, c) != i || d.name == "JSXAttributeValue" && d.to > c)) {
      if (i == ">" && d.name == "JSXFragmentTag")
        return { range: s, changes: { from: c, insert: "</>" } };
      if (i == "/" && d.name == "JSXStartCloseTag") {
        let h = d.parent, p = h.parent;
        if (p && h.from == c - 2 && ((f = tA(a.doc, p.firstChild, c)) || ((u = p.firstChild) === null || u === void 0 ? void 0 : u.name) == "JSXFragmentTag")) {
          let g = `${f}>`;
          return { range: Pt.cursor(c + g.length, -1), changes: { from: c, insert: g } };
        }
      } else if (i == ">") {
        let h = HSe(d);
        if (h && h.name == "JSXOpenTag" && !/^\/?>|^<\//.test(a.doc.sliceString(c, c + 2)) && (f = tA(a.doc, h, c)))
          return { range: s, changes: { from: c, insert: `</${f}>` } };
      }
    }
    return { range: s };
  });
  return l.changes.empty ? !1 : (t.dispatch([
    r,
    a.update(l, { userEvent: "input.complete", scrollIntoView: !0 })
  ]), !0);
}), un = {
  IN: "IN",
  LIKE: "LIKE",
  ILIKE: "ILIKE",
  REGEXP: "REGEXP",
  EXISTS: "EXISTS",
  CONTAINS: "CONTAINS",
  BETWEEN: "BETWEEN",
  NOT: "NOT",
  "=": "=",
  "!=": "!=",
  ">=": ">=",
  ">": ">",
  "<=": "<=",
  "<": "<"
}, qSe = {
  HAS: "has",
  HASANY: "hasAny",
  HASALL: "hasAll",
  HASTOKEN: "hasToken"
}, nA = [un.EXISTS];
var gc = /* @__PURE__ */ ((t) => (t.STRING = "string", t.NUMBER = "number", t.BOOLEAN = "boolean", t))(gc || {});
const px = {
  string: [
    un["="],
    un["!="],
    un.IN,
    un.LIKE,
    un.ILIKE,
    un.CONTAINS,
    un.EXISTS,
    un.REGEXP,
    un.NOT
  ],
  number: [
    un["="],
    un["!="],
    un[">="],
    un[">"],
    un["<="],
    un["<"],
    un.IN,
    un.EXISTS,
    un.BETWEEN,
    un.NOT
  ],
  boolean: [
    un["="],
    un["!="],
    un.EXISTS,
    un.NOT
  ]
}, c8 = [
  { label: un.LIKE, type: "operator", info: "Like" },
  { label: un.ILIKE, type: "operator", info: "Case insensitive like" },
  { label: un.EXISTS, type: "operator", info: "Exists" },
  { label: un.BETWEEN, type: "operator", info: "Between" },
  { label: un.IN, type: "operator", info: "In" },
  { label: un.REGEXP, type: "operator", info: "Regular expression" },
  { label: un.CONTAINS, type: "operator", info: "Contains" }
], YSe = [
  { label: un["="], type: "operator", info: "Equal to" },
  { label: un["!="], type: "operator", info: "Not equal to" },
  { label: un[">"], type: "operator", info: "Greater than" },
  { label: un["<"], type: "operator", info: "Less than" },
  { label: un[">="], type: "operator", info: "Greater than or equal to" },
  { label: un["<="], type: "operator", info: "Less than or equal to" },
  { label: un.NOT, type: "operator", info: "Not" },
  ...c8
];
var KSe = { 763: () => {
} }, iA = {};
function Ec(t) {
  var e = iA[t];
  if (e !== void 0) return e.exports;
  var n = iA[t] = { exports: {} };
  return KSe[t](n, n.exports, Ec), n.exports;
}
Ec.d = (t, e) => {
  for (var n in e) Ec.o(e, n) && !Ec.o(t, n) && Object.defineProperty(t, n, { enumerable: !0, get: e[n] });
}, Ec.o = (t, e) => Object.prototype.hasOwnProperty.call(t, e);
var Tn = {};
Ec.d(Tn, { MG: () => $i, fr: () => zk, sR: () => P8, Zo: () => Vc, iH: () => E8, rt: () => ws, jB: () => I8, M8: () => $8, $t: () => Uy, aq: () => T8, pG: () => Rg, eP: () => Qk, KU: () => wf, zW: () => Wk, IX: () => Cn, mY: () => wr, a7: () => td, JG: () => Ai, ay: () => _i, X2: () => Gy, WU: () => Vk, Uw: () => k8, gw: () => A0, iX: () => jk, re: () => S8, Pg: () => qk, tD: () => w8, R$: () => ro, Dj: () => Qs, m7: () => ed, NZ: () => ig, xo: () => Al, ou: () => dt, qC: () => as, mD: () => ps, Ay: () => xwe });
class dt {
  constructor() {
    this.source = null, this.type = null, this.channel = null, this.start = null, this.stop = null, this.tokenIndex = null, this.line = null, this.column = null, this._text = null;
  }
  getTokenSource() {
    return this.source[0];
  }
  getInputStream() {
    return this.source[1];
  }
  get text() {
    return this._text;
  }
  set text(e) {
    this._text = e;
  }
}
function Gf(t, e) {
  if (!Array.isArray(t) || !Array.isArray(e)) return !1;
  if (t === e) return !0;
  if (t.length !== e.length) return !1;
  for (let n = 0; n < t.length; n++) if (!(t[n] === e[n] || t[n].equals && t[n].equals(e[n]))) return !1;
  return !0;
}
dt.INVALID_TYPE = 0, dt.EPSILON = -2, dt.MIN_USER_TOKEN_TYPE = 1, dt.EOF = -1, dt.DEFAULT_CHANNEL = 0, dt.HIDDEN_CHANNEL = 1;
const XSe = Math.round(Math.random() * Math.pow(2, 32));
function d8(t) {
  if (!t) return 0;
  const e = typeof t, n = e === "string" ? t : !(e !== "object" || !t.toString) && t.toString();
  if (!n) return 0;
  let i, o;
  const r = 3 & n.length, a = n.length - r;
  let l = XSe;
  const s = 3432918353, u = 461845907;
  let c = 0;
  for (; c < a; ) o = 255 & n.charCodeAt(c) | (255 & n.charCodeAt(++c)) << 8 | (255 & n.charCodeAt(++c)) << 16 | (255 & n.charCodeAt(++c)) << 24, ++c, o = (65535 & o) * s + (((o >>> 16) * s & 65535) << 16) & 4294967295, o = o << 15 | o >>> 17, o = (65535 & o) * u + (((o >>> 16) * u & 65535) << 16) & 4294967295, l ^= o, l = l << 13 | l >>> 19, i = 5 * (65535 & l) + ((5 * (l >>> 16) & 65535) << 16) & 4294967295, l = 27492 + (65535 & i) + ((58964 + (i >>> 16) & 65535) << 16);
  switch (o = 0, r) {
    case 3:
      o ^= (255 & n.charCodeAt(c + 2)) << 16;
    case 2:
      o ^= (255 & n.charCodeAt(c + 1)) << 8;
    case 1:
      o ^= 255 & n.charCodeAt(c), o = (65535 & o) * s + (((o >>> 16) * s & 65535) << 16) & 4294967295, o = o << 15 | o >>> 17, o = (65535 & o) * u + (((o >>> 16) * u & 65535) << 16) & 4294967295, l ^= o;
  }
  return l ^= n.length, l ^= l >>> 16, l = 2246822507 * (65535 & l) + ((2246822507 * (l >>> 16) & 65535) << 16) & 4294967295, l ^= l >>> 13, l = 3266489909 * (65535 & l) + ((3266489909 * (l >>> 16) & 65535) << 16) & 4294967295, l ^= l >>> 16, l >>> 0;
}
class Vr {
  constructor() {
    this.count = 0, this.hash = 0;
  }
  update() {
    for (let e = 0; e < arguments.length; e++) {
      const n = arguments[e];
      if (n != null) if (Array.isArray(n)) this.update.apply(this, n);
      else {
        let i = 0;
        switch (typeof n) {
          case "undefined":
          case "function":
            continue;
          case "number":
          case "boolean":
            i = n;
            break;
          case "string":
            i = d8(n);
            break;
          default:
            n.updateHashCode ? n.updateHashCode(this) : console.log("No updateHashCode for " + n.toString());
            continue;
        }
        i *= 3432918353, i = i << 15 | i >>> 17, i *= 461845907, this.count = this.count + 1;
        let o = this.hash ^ i;
        o = o << 13 | o >>> 19, o = 5 * o + 3864292196, this.hash = o;
      }
    }
  }
  finish() {
    let e = this.hash ^ 4 * this.count;
    return e ^= e >>> 16, e *= 2246822507, e ^= e >>> 13, e *= 3266489909, e ^= e >>> 16, e;
  }
  static hashStuff() {
    const e = new Vr();
    return e.update.apply(e, arguments), e.finish();
  }
}
function f8(t) {
  return t ? typeof t == "string" ? d8(t) : t.hashCode() : -1;
}
function h8(t, e) {
  return t && t.equals ? t.equals(e) : t === e;
}
function ZSe(t) {
  return t === null ? "null" : t;
}
function ps(t) {
  return Array.isArray(t) ? "[" + t.map(ZSe).join(", ") + "]" : "null";
}
class Lr {
  constructor(e, n) {
    this.buckets = new Array(16), this.threshold = Math.floor(12), this.itemCount = 0, this.hashFunction = e || f8, this.equalsFunction = n || h8;
  }
  get(e) {
    if (e == null) return e;
    const n = this._getBucket(e);
    if (!n) return null;
    for (const i of n) if (this.equalsFunction(i, e)) return i;
    return null;
  }
  add(e) {
    return this.getOrAdd(e) === e;
  }
  getOrAdd(e) {
    this._expand();
    const n = this._getSlot(e);
    let i = this.buckets[n];
    if (!i) return i = [e], this.buckets[n] = i, this.itemCount++, e;
    for (const o of i) if (this.equalsFunction(o, e)) return o;
    return i.push(e), this.itemCount++, e;
  }
  has(e) {
    return this.get(e) != null;
  }
  values() {
    return this.buckets.filter(((e) => e != null)).flat(1);
  }
  toString() {
    return ps(this.values());
  }
  get length() {
    return this.itemCount;
  }
  _getSlot(e) {
    return this.hashFunction(e) & this.buckets.length - 1;
  }
  _getBucket(e) {
    return this.buckets[this._getSlot(e)];
  }
  _expand() {
    if (this.itemCount <= this.threshold) return;
    const e = this.buckets, n = 2 * this.buckets.length;
    this.buckets = new Array(n), this.threshold = Math.floor(0.75 * n);
    for (const i of e) if (i) for (const o of i) {
      const r = this._getSlot(o);
      let a = this.buckets[r];
      a || (a = [], this.buckets[r] = a), a.push(o);
    }
  }
}
class Hn {
  hashCode() {
    const e = new Vr();
    return this.updateHashCode(e), e.finish();
  }
  evaluate(e, n) {
  }
  evalPrecedence(e, n) {
    return this;
  }
  static andContext(e, n) {
    if (e === null || e === Hn.NONE) return n;
    if (n === null || n === Hn.NONE) return e;
    const i = new Cp(e, n);
    return i.opnds.length === 1 ? i.opnds[0] : i;
  }
  static orContext(e, n) {
    if (e === null) return n;
    if (n === null) return e;
    if (e === Hn.NONE || n === Hn.NONE) return Hn.NONE;
    const i = new $p(e, n);
    return i.opnds.length === 1 ? i.opnds[0] : i;
  }
}
class Cp extends Hn {
  constructor(e, n) {
    super();
    const i = new Lr();
    e instanceof Cp ? e.opnds.map((function(r) {
      i.add(r);
    })) : i.add(e), n instanceof Cp ? n.opnds.map((function(r) {
      i.add(r);
    })) : i.add(n);
    const o = p8(i);
    if (o.length > 0) {
      let r = null;
      o.map((function(a) {
        (r === null || a.precedence < r.precedence) && (r = a);
      })), i.add(r);
    }
    this.opnds = Array.from(i.values());
  }
  equals(e) {
    return this === e || e instanceof Cp && Gf(this.opnds, e.opnds);
  }
  updateHashCode(e) {
    e.update(this.opnds, "AND");
  }
  evaluate(e, n) {
    for (let i = 0; i < this.opnds.length; i++) if (!this.opnds[i].evaluate(e, n)) return !1;
    return !0;
  }
  evalPrecedence(e, n) {
    let i = !1;
    const o = [];
    for (let a = 0; a < this.opnds.length; a++) {
      const l = this.opnds[a], s = l.evalPrecedence(e, n);
      if (i |= s !== l, s === null) return null;
      s !== Hn.NONE && o.push(s);
    }
    if (!i) return this;
    if (o.length === 0) return Hn.NONE;
    let r = null;
    return o.map((function(a) {
      r = r === null ? a : Hn.andContext(r, a);
    })), r;
  }
  toString() {
    const e = this.opnds.map(((n) => n.toString()));
    return (e.length > 3 ? e.slice(3) : e).join("&&");
  }
}
class $p extends Hn {
  constructor(e, n) {
    super();
    const i = new Lr();
    e instanceof $p ? e.opnds.map((function(r) {
      i.add(r);
    })) : i.add(e), n instanceof $p ? n.opnds.map((function(r) {
      i.add(r);
    })) : i.add(n);
    const o = p8(i);
    if (o.length > 0) {
      const r = o.sort((function(l, s) {
        return l.compareTo(s);
      })), a = r[r.length - 1];
      i.add(a);
    }
    this.opnds = Array.from(i.values());
  }
  equals(e) {
    return this === e || e instanceof $p && Gf(this.opnds, e.opnds);
  }
  updateHashCode(e) {
    e.update(this.opnds, "OR");
  }
  evaluate(e, n) {
    for (let i = 0; i < this.opnds.length; i++) if (this.opnds[i].evaluate(e, n)) return !0;
    return !1;
  }
  evalPrecedence(e, n) {
    let i = !1;
    const o = [];
    for (let r = 0; r < this.opnds.length; r++) {
      const a = this.opnds[r], l = a.evalPrecedence(e, n);
      if (i |= l !== a, l === Hn.NONE) return Hn.NONE;
      l !== null && o.push(l);
    }
    return i ? (o.length === 0, null) : this;
  }
  toString() {
    const e = this.opnds.map(((n) => n.toString()));
    return (e.length > 3 ? e.slice(3) : e).join("||");
  }
}
function p8(t) {
  const e = [];
  return t.values().map((function(n) {
    n instanceof Hn.PrecedencePredicate && e.push(n);
  })), e;
}
function oA(t, e) {
  if (t === null) {
    const n = { state: null, alt: null, context: null, semanticContext: null };
    return e && (n.reachesIntoOuterContext = 0), n;
  }
  {
    const n = {};
    return n.state = t.state || null, n.alt = t.alt === void 0 ? null : t.alt, n.context = t.context || null, n.semanticContext = t.semanticContext || null, e && (n.reachesIntoOuterContext = t.reachesIntoOuterContext || 0, n.precedenceFilterSuppressed = t.precedenceFilterSuppressed || !1), n;
  }
}
class Qi {
  constructor(e, n) {
    this.checkContext(e, n), e = oA(e), n = oA(n, !0), this.state = e.state !== null ? e.state : n.state, this.alt = e.alt !== null ? e.alt : n.alt, this.context = e.context !== null ? e.context : n.context, this.semanticContext = e.semanticContext !== null ? e.semanticContext : n.semanticContext !== null ? n.semanticContext : Hn.NONE, this.reachesIntoOuterContext = n.reachesIntoOuterContext, this.precedenceFilterSuppressed = n.precedenceFilterSuppressed;
  }
  checkContext(e, n) {
    e.context !== null && e.context !== void 0 || n !== null && n.context !== null && n.context !== void 0 || (this.context = null);
  }
  hashCode() {
    const e = new Vr();
    return this.updateHashCode(e), e.finish();
  }
  updateHashCode(e) {
    e.update(this.state.stateNumber, this.alt, this.context, this.semanticContext);
  }
  equals(e) {
    return this === e || e instanceof Qi && this.state.stateNumber === e.state.stateNumber && this.alt === e.alt && (this.context === null ? e.context === null : this.context.equals(e.context)) && this.semanticContext.equals(e.semanticContext) && this.precedenceFilterSuppressed === e.precedenceFilterSuppressed;
  }
  hashCodeForConfigSet() {
    const e = new Vr();
    return e.update(this.state.stateNumber, this.alt, this.semanticContext), e.finish();
  }
  equalsForConfigSet(e) {
    return this === e || e instanceof Qi && this.state.stateNumber === e.state.stateNumber && this.alt === e.alt && this.semanticContext.equals(e.semanticContext);
  }
  toString() {
    return "(" + this.state + "," + this.alt + (this.context !== null ? ",[" + this.context.toString() + "]" : "") + (this.semanticContext !== Hn.NONE ? "," + this.semanticContext.toString() : "") + (this.reachesIntoOuterContext > 0 ? ",up=" + this.reachesIntoOuterContext : "") + ")";
  }
}
class Cn {
  constructor(e, n) {
    this.start = e, this.stop = n;
  }
  clone() {
    return new Cn(this.start, this.stop);
  }
  contains(e) {
    return e >= this.start && e < this.stop;
  }
  toString() {
    return this.start === this.stop - 1 ? this.start.toString() : this.start.toString() + ".." + (this.stop - 1).toString();
  }
  get length() {
    return this.stop - this.start;
  }
}
Cn.INVALID_INTERVAL = new Cn(-1, -2);
class wr {
  constructor() {
    this.intervals = null, this.readOnly = !1;
  }
  first(e) {
    return this.intervals === null || this.intervals.length === 0 ? dt.INVALID_TYPE : this.intervals[0].start;
  }
  addOne(e) {
    this.addInterval(new Cn(e, e + 1));
  }
  addRange(e, n) {
    this.addInterval(new Cn(e, n + 1));
  }
  addInterval(e) {
    if (this.intervals === null) this.intervals = [], this.intervals.push(e.clone());
    else {
      for (let n = 0; n < this.intervals.length; n++) {
        const i = this.intervals[n];
        if (e.stop < i.start) return void this.intervals.splice(n, 0, e);
        if (e.stop === i.start) return void (this.intervals[n] = new Cn(e.start, i.stop));
        if (e.start <= i.stop) return this.intervals[n] = new Cn(Math.min(i.start, e.start), Math.max(i.stop, e.stop)), void this.reduce(n);
      }
      this.intervals.push(e.clone());
    }
  }
  addSet(e) {
    return e.intervals !== null && e.intervals.forEach(((n) => this.addInterval(n)), this), this;
  }
  reduce(e) {
    if (e < this.intervals.length - 1) {
      const n = this.intervals[e], i = this.intervals[e + 1];
      n.stop >= i.stop ? (this.intervals.splice(e + 1, 1), this.reduce(e)) : n.stop >= i.start && (this.intervals[e] = new Cn(n.start, i.stop), this.intervals.splice(e + 1, 1));
    }
  }
  complement(e, n) {
    const i = new wr();
    return i.addInterval(new Cn(e, n + 1)), this.intervals !== null && this.intervals.forEach(((o) => i.removeRange(o))), i;
  }
  contains(e) {
    if (this.intervals === null) return !1;
    for (let n = 0; n < this.intervals.length; n++) if (this.intervals[n].contains(e)) return !0;
    return !1;
  }
  removeRange(e) {
    if (e.start === e.stop - 1) this.removeOne(e.start);
    else if (this.intervals !== null) {
      let n = 0;
      for (let i = 0; i < this.intervals.length; i++) {
        const o = this.intervals[n];
        if (e.stop <= o.start) return;
        if (e.start > o.start && e.stop < o.stop) {
          this.intervals[n] = new Cn(o.start, e.start);
          const r = new Cn(e.stop, o.stop);
          return void this.intervals.splice(n, 0, r);
        }
        e.start <= o.start && e.stop >= o.stop ? (this.intervals.splice(n, 1), n -= 1) : e.start < o.stop ? this.intervals[n] = new Cn(o.start, e.start) : e.stop < o.stop && (this.intervals[n] = new Cn(e.stop, o.stop)), n += 1;
      }
    }
  }
  removeOne(e) {
    if (this.intervals !== null) for (let n = 0; n < this.intervals.length; n++) {
      const i = this.intervals[n];
      if (e < i.start) return;
      if (e === i.start && e === i.stop - 1) return void this.intervals.splice(n, 1);
      if (e === i.start) return void (this.intervals[n] = new Cn(i.start + 1, i.stop));
      if (e === i.stop - 1) return void (this.intervals[n] = new Cn(i.start, i.stop - 1));
      if (e < i.stop - 1) {
        const o = new Cn(i.start, e);
        return i.start = e + 1, void this.intervals.splice(n, 0, o);
      }
    }
  }
  toString(e, n, i) {
    return e = e || null, n = n || null, i = i || !1, this.intervals === null ? "{}" : e !== null || n !== null ? this.toTokenString(e, n) : i ? this.toCharString() : this.toIndexString();
  }
  toCharString() {
    const e = [];
    for (let n = 0; n < this.intervals.length; n++) {
      const i = this.intervals[n];
      i.stop === i.start + 1 ? i.start === dt.EOF ? e.push("<EOF>") : e.push("'" + String.fromCharCode(i.start) + "'") : e.push("'" + String.fromCharCode(i.start) + "'..'" + String.fromCharCode(i.stop - 1) + "'");
    }
    return e.length > 1 ? "{" + e.join(", ") + "}" : e[0];
  }
  toIndexString() {
    const e = [];
    for (let n = 0; n < this.intervals.length; n++) {
      const i = this.intervals[n];
      i.stop === i.start + 1 ? i.start === dt.EOF ? e.push("<EOF>") : e.push(i.start.toString()) : e.push(i.start.toString() + ".." + (i.stop - 1).toString());
    }
    return e.length > 1 ? "{" + e.join(", ") + "}" : e[0];
  }
  toTokenString(e, n) {
    const i = [];
    for (let o = 0; o < this.intervals.length; o++) {
      const r = this.intervals[o];
      for (let a = r.start; a < r.stop; a++) i.push(this.elementName(e, n, a));
    }
    return i.length > 1 ? "{" + i.join(", ") + "}" : i[0];
  }
  elementName(e, n, i) {
    return i === dt.EOF ? "<EOF>" : i === dt.EPSILON ? "<EPSILON>" : e[i] || n[i];
  }
  get length() {
    return this.intervals.map(((e) => e.length)).reduce(((e, n) => e + n));
  }
}
class Rt {
  constructor() {
    this.atn = null, this.stateNumber = Rt.INVALID_STATE_NUMBER, this.stateType = null, this.ruleIndex = 0, this.epsilonOnlyTransitions = !1, this.transitions = [], this.nextTokenWithinRule = null;
  }
  toString() {
    return this.stateNumber;
  }
  equals(e) {
    return e instanceof Rt && this.stateNumber === e.stateNumber;
  }
  isNonGreedyExitState() {
    return !1;
  }
  addTransition(e, n) {
    n === void 0 && (n = -1), this.transitions.length === 0 ? this.epsilonOnlyTransitions = e.isEpsilon : this.epsilonOnlyTransitions !== e.isEpsilon && (this.epsilonOnlyTransitions = !1), n === -1 ? this.transitions.push(e) : this.transitions.splice(n, 1, e);
  }
}
Rt.INVALID_TYPE = 0, Rt.BASIC = 1, Rt.RULE_START = 2, Rt.BLOCK_START = 3, Rt.PLUS_BLOCK_START = 4, Rt.STAR_BLOCK_START = 5, Rt.TOKEN_START = 6, Rt.RULE_STOP = 7, Rt.BLOCK_END = 8, Rt.STAR_LOOP_BACK = 9, Rt.STAR_LOOP_ENTRY = 10, Rt.PLUS_LOOP_BACK = 11, Rt.LOOP_END = 12, Rt.serializationNames = ["INVALID", "BASIC", "RULE_START", "BLOCK_START", "PLUS_BLOCK_START", "STAR_BLOCK_START", "TOKEN_START", "RULE_STOP", "BLOCK_END", "STAR_LOOP_BACK", "STAR_LOOP_ENTRY", "PLUS_LOOP_BACK", "LOOP_END"], Rt.INVALID_STATE_NUMBER = -1;
class ir extends Rt {
  constructor() {
    return super(), this.stateType = Rt.RULE_STOP, this;
  }
}
class At {
  constructor(e) {
    if (e == null) throw "target cannot be null.";
    this.target = e, this.isEpsilon = !1, this.label = null;
  }
}
At.EPSILON = 1, At.RANGE = 2, At.RULE = 3, At.PREDICATE = 4, At.ATOM = 5, At.ACTION = 6, At.SET = 7, At.NOT_SET = 8, At.WILDCARD = 9, At.PRECEDENCE = 10, At.serializationNames = ["INVALID", "EPSILON", "RANGE", "RULE", "PREDICATE", "ATOM", "ACTION", "SET", "NOT_SET", "WILDCARD", "PRECEDENCE"], At.serializationTypes = { EpsilonTransition: At.EPSILON, RangeTransition: At.RANGE, RuleTransition: At.RULE, PredicateTransition: At.PREDICATE, AtomTransition: At.ATOM, ActionTransition: At.ACTION, SetTransition: At.SET, NotSetTransition: At.NOT_SET, WildcardTransition: At.WILDCARD, PrecedencePredicateTransition: At.PRECEDENCE };
class I0 extends At {
  constructor(e, n, i, o) {
    super(e), this.ruleIndex = n, this.precedence = i, this.followState = o, this.serializationType = At.RULE, this.isEpsilon = !0;
  }
  matches(e, n, i) {
    return !1;
  }
}
class Ek extends At {
  constructor(e, n) {
    super(e), this.serializationType = At.SET, n != null ? this.label = n : (this.label = new wr(), this.label.addOne(dt.INVALID_TYPE));
  }
  matches(e, n, i) {
    return this.label.contains(e);
  }
  toString() {
    return this.label.toString();
  }
}
class _k extends Ek {
  constructor(e, n) {
    super(e, n), this.serializationType = At.NOT_SET;
  }
  matches(e, n, i) {
    return e >= n && e <= i && !super.matches(e, n, i);
  }
  toString() {
    return "~" + super.toString();
  }
}
class g8 extends At {
  constructor(e) {
    super(e), this.serializationType = At.WILDCARD;
  }
  matches(e, n, i) {
    return e >= n && e <= i;
  }
  toString() {
    return ".";
  }
}
class Ik extends At {
  constructor(e) {
    super(e);
  }
}
class GSe {
}
class USe extends GSe {
}
class m8 extends USe {
}
class ig extends m8 {
  get ruleContext() {
    throw new Error("missing interface implementation");
  }
}
class Al extends m8 {
}
class Ky extends Al {
}
const ns = { toStringTree: function(t, e, n) {
  e = e || null, (n = n || null) !== null && (e = n.ruleNames);
  let i = ns.getNodeText(t, e);
  i = (function(a) {
    return a = a.replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r");
  })(i);
  const o = t.getChildCount();
  if (o === 0) return i;
  let r = "(" + i + " ";
  o > 0 && (i = ns.toStringTree(t.getChild(0), e), r = r.concat(i));
  for (let a = 1; a < o; a++) i = ns.toStringTree(t.getChild(a), e), r = r.concat(" " + i);
  return r = r.concat(")"), r;
}, getNodeText: function(t, e, n) {
  if (e = e || null, (n = n || null) !== null && (e = n.ruleNames), e !== null) {
    if (t instanceof ig) {
      const o = t.ruleContext.getAltNumber();
      return o != 0 ? e[t.ruleIndex] + ":" + o : e[t.ruleIndex];
    }
    if (t instanceof Ky) return t.toString();
    if (t instanceof Al && t.symbol !== null) return t.symbol.text;
  }
  const i = t.getPayload();
  return i instanceof dt ? i.text : t.getPayload().toString();
}, getChildren: function(t) {
  const e = [];
  for (let n = 0; n < t.getChildCount(); n++) e.push(t.getChild(n));
  return e;
}, getAncestors: function(t) {
  let e = [];
  for (t = t.getParent(); t !== null; ) e = [t].concat(e), t = t.getParent();
  return e;
}, findAllTokenNodes: function(t, e) {
  return ns.findAllNodes(t, e, !0);
}, findAllRuleNodes: function(t, e) {
  return ns.findAllNodes(t, e, !1);
}, findAllNodes: function(t, e, n) {
  const i = [];
  return ns._findAllNodes(t, e, n, i), i;
}, _findAllNodes: function(t, e, n, i) {
  n && t instanceof Al ? t.symbol.type === e && i.push(t) : !n && t instanceof ig && t.ruleIndex === e && i.push(t);
  for (let o = 0; o < t.getChildCount(); o++) ns._findAllNodes(t.getChild(o), e, n, i);
}, descendants: function(t) {
  let e = [t];
  for (let n = 0; n < t.getChildCount(); n++) e = e.concat(ns.descendants(t.getChild(n)));
  return e;
} }, v8 = ns;
class ed extends ig {
  constructor(e, n) {
    super(), this.parentCtx = e || null, this.invokingState = n || -1;
  }
  depth() {
    let e = 0, n = this;
    for (; n !== null; ) n = n.parentCtx, e += 1;
    return e;
  }
  isEmpty() {
    return this.invokingState === -1;
  }
  getSourceInterval() {
    return Cn.INVALID_INTERVAL;
  }
  get ruleContext() {
    return this;
  }
  getPayload() {
    return this;
  }
  getText() {
    return this.getChildCount() === 0 ? "" : this.children.map((function(e) {
      return e.getText();
    })).join("");
  }
  getAltNumber() {
    return 0;
  }
  setAltNumber(e) {
  }
  getChild(e) {
    return null;
  }
  getChildCount() {
    return 0;
  }
  accept(e) {
    return e.visitChildren(this);
  }
  toStringTree(e, n) {
    return v8.toStringTree(this, e, n);
  }
  toString(e, n) {
    e = e || null, n = n || null;
    let i = this, o = "[";
    for (; i !== null && i !== n; ) {
      if (e === null) i.isEmpty() || (o += i.invokingState);
      else {
        const r = i.ruleIndex;
        o += r >= 0 && r < e.length ? e[r] : "" + r;
      }
      i.parentCtx === null || e === null && i.parentCtx.isEmpty() || (o += " "), i = i.parentCtx;
    }
    return o += "]", o;
  }
}
class cn {
  constructor(e) {
    this.cachedHashCode = e;
  }
  isEmpty() {
    return this === cn.EMPTY;
  }
  hasEmptyPath() {
    return this.getReturnState(this.length - 1) === cn.EMPTY_RETURN_STATE;
  }
  hashCode() {
    return this.cachedHashCode;
  }
  updateHashCode(e) {
    e.update(this.cachedHashCode);
  }
}
cn.EMPTY = null, cn.EMPTY_RETURN_STATE = 2147483647, cn.globalNodeCount = 1, cn.id = cn.globalNodeCount, cn.trace_atn_sim = !1;
class vl extends cn {
  constructor(e, n) {
    const i = new Vr();
    return i.update(e, n), super(i.finish()), this.parents = e, this.returnStates = n, this;
  }
  isEmpty() {
    return this.returnStates[0] === cn.EMPTY_RETURN_STATE;
  }
  getParent(e) {
    return this.parents[e];
  }
  getReturnState(e) {
    return this.returnStates[e];
  }
  equals(e) {
    return this === e || e instanceof vl && this.hashCode() === e.hashCode() && Gf(this.returnStates, e.returnStates) && Gf(this.parents, e.parents);
  }
  toString() {
    if (this.isEmpty()) return "[]";
    {
      let e = "[";
      for (let n = 0; n < this.returnStates.length; n++) n > 0 && (e += ", "), this.returnStates[n] !== cn.EMPTY_RETURN_STATE ? (e += this.returnStates[n], this.parents[n] !== null ? e = e + " " + this.parents[n] : e += "null") : e += "$";
      return e + "]";
    }
  }
  get length() {
    return this.returnStates.length;
  }
}
class Uo extends cn {
  constructor(e, n) {
    let i = 0;
    const o = new Vr();
    e !== null ? o.update(e, n) : o.update(1), i = o.finish(), super(i), this.parentCtx = e, this.returnState = n;
  }
  getParent(e) {
    return this.parentCtx;
  }
  getReturnState(e) {
    return this.returnState;
  }
  equals(e) {
    return this === e || e instanceof Uo && this.hashCode() === e.hashCode() && this.returnState === e.returnState && (this.parentCtx == null ? e.parentCtx == null : this.parentCtx.equals(e.parentCtx));
  }
  toString() {
    const e = this.parentCtx === null ? "" : this.parentCtx.toString();
    return e.length === 0 ? this.returnState === cn.EMPTY_RETURN_STATE ? "$" : "" + this.returnState : this.returnState + " " + e;
  }
  get length() {
    return 1;
  }
  static create(e, n) {
    return n === cn.EMPTY_RETURN_STATE && e === null ? cn.EMPTY : new Uo(e, n);
  }
}
class iw extends Uo {
  constructor() {
    super(null, cn.EMPTY_RETURN_STATE);
  }
  isEmpty() {
    return !0;
  }
  getParent(e) {
    return null;
  }
  getReturnState(e) {
    return this.returnState;
  }
  equals(e) {
    return this === e;
  }
  toString() {
    return "$";
  }
}
cn.EMPTY = new iw();
class Ag {
  constructor(e, n) {
    this.buckets = new Array(16), this.threshold = Math.floor(12), this.itemCount = 0, this.hashFunction = e || f8, this.equalsFunction = n || h8;
  }
  set(e, n) {
    this._expand();
    const i = this._getSlot(e);
    let o = this.buckets[i];
    if (!o) return o = [[e, n]], this.buckets[i] = o, this.itemCount++, n;
    const r = o.find(((a) => this.equalsFunction(a[0], e)), this);
    if (r) {
      const a = r[1];
      return r[1] = n, a;
    }
    return o.push([e, n]), this.itemCount++, n;
  }
  containsKey(e) {
    const n = this._getBucket(e);
    return !!n && !!n.find(((i) => this.equalsFunction(i[0], e)), this);
  }
  get(e) {
    const n = this._getBucket(e);
    if (!n) return null;
    const i = n.find(((o) => this.equalsFunction(o[0], e)), this);
    return i ? i[1] : null;
  }
  entries() {
    return this.buckets.filter(((e) => e != null)).flat(1);
  }
  getKeys() {
    return this.entries().map(((e) => e[0]));
  }
  getValues() {
    return this.entries().map(((e) => e[1]));
  }
  toString() {
    return "[" + this.entries().map(((e) => "{" + e[0] + ":" + e[1] + "}")).join(", ") + "]";
  }
  get length() {
    return this.itemCount;
  }
  _getSlot(e) {
    return this.hashFunction(e) & this.buckets.length - 1;
  }
  _getBucket(e) {
    return this.buckets[this._getSlot(e)];
  }
  _expand() {
    if (this.itemCount <= this.threshold) return;
    const e = this.buckets, n = 2 * this.buckets.length;
    this.buckets = new Array(n), this.threshold = Math.floor(0.75 * n);
    for (const i of e) if (i) for (const o of i) {
      const r = this._getSlot(o[0]);
      let a = this.buckets[r];
      a || (a = [], this.buckets[r] = a), a.push(o);
    }
  }
}
function Mk(t, e) {
  if (e == null && (e = ed.EMPTY), e.parentCtx === null || e === ed.EMPTY) return cn.EMPTY;
  const n = Mk(t, e.parentCtx), i = t.states[e.invokingState].transitions[0];
  return Uo.create(n, i.followState.stateNumber);
}
function y8(t, e, n) {
  if (t.isEmpty()) return t;
  let i = n.get(t) || null;
  if (i !== null) return i;
  if (i = e.get(t), i !== null) return n.set(t, i), i;
  let o = !1, r = [];
  for (let l = 0; l < r.length; l++) {
    const s = y8(t.getParent(l), e, n);
    if (o || s !== t.getParent(l)) {
      if (!o) {
        r = [];
        for (let u = 0; u < t.length; u++) r[u] = t.getParent(u);
        o = !0;
      }
      r[l] = s;
    }
  }
  if (!o) return e.add(t), n.set(t, t), t;
  let a = null;
  return a = r.length === 0 ? cn.EMPTY : r.length === 1 ? Uo.create(r[0], t.getReturnState(0)) : new vl(r, t.returnStates), e.add(a), n.set(a, a), n.set(t, a), a;
}
function ow(t, e, n, i) {
  if (t === e) return t;
  if (t instanceof Uo && e instanceof Uo) return (function(o, r, a, l) {
    if (l !== null) {
      let u = l.get(o, r);
      if (u !== null || (u = l.get(r, o), u !== null)) return u;
    }
    const s = (function(u, c, d) {
      if (d) {
        if (u === cn.EMPTY || c === cn.EMPTY) return cn.EMPTY;
      } else {
        if (u === cn.EMPTY && c === cn.EMPTY) return cn.EMPTY;
        if (u === cn.EMPTY) {
          const f = [c.returnState, cn.EMPTY_RETURN_STATE], h = [c.parentCtx, null];
          return new vl(h, f);
        }
        if (c === cn.EMPTY) {
          const f = [u.returnState, cn.EMPTY_RETURN_STATE], h = [u.parentCtx, null];
          return new vl(h, f);
        }
      }
      return null;
    })(o, r, a);
    if (s !== null) return l !== null && l.set(o, r, s), s;
    if (o.returnState === r.returnState) {
      const u = ow(o.parentCtx, r.parentCtx, a, l);
      if (u === o.parentCtx) return o;
      if (u === r.parentCtx) return r;
      const c = Uo.create(u, o.returnState);
      return l !== null && l.set(o, r, c), c;
    }
    {
      let u = null;
      if ((o === r || o.parentCtx !== null && o.parentCtx === r.parentCtx) && (u = o.parentCtx), u !== null) {
        const h = [o.returnState, r.returnState];
        o.returnState > r.returnState && (h[0] = r.returnState, h[1] = o.returnState);
        const p = new vl([u, u], h);
        return l !== null && l.set(o, r, p), p;
      }
      const c = [o.returnState, r.returnState];
      let d = [o.parentCtx, r.parentCtx];
      o.returnState > r.returnState && (c[0] = r.returnState, c[1] = o.returnState, d = [r.parentCtx, o.parentCtx]);
      const f = new vl(d, c);
      return l !== null && l.set(o, r, f), f;
    }
  })(t, e, n, i);
  if (n) {
    if (t instanceof iw) return t;
    if (e instanceof iw) return e;
  }
  return t instanceof Uo && (t = new vl([t.getParent()], [t.returnState])), e instanceof Uo && (e = new vl([e.getParent()], [e.returnState])), (function(o, r, a, l) {
    if (l !== null) {
      let p = l.get(o, r);
      if (p !== null || (p = l.get(r, o), p !== null)) return cn.trace_atn_sim && console.log("mergeArrays a=" + o + ",b=" + r + " -> previous"), p;
    }
    let s = 0, u = 0, c = 0, d = new Array(o.returnStates.length + r.returnStates.length).fill(0), f = new Array(o.returnStates.length + r.returnStates.length).fill(null);
    for (; s < o.returnStates.length && u < r.returnStates.length; ) {
      const p = o.parents[s], g = r.parents[u];
      if (o.returnStates[s] === r.returnStates[u]) {
        const m = o.returnStates[s];
        m === cn.EMPTY_RETURN_STATE && p === null && g === null || p !== null && g !== null && p === g ? (f[c] = p, d[c] = m) : (f[c] = ow(p, g, a, l), d[c] = m), s += 1, u += 1;
      } else o.returnStates[s] < r.returnStates[u] ? (f[c] = p, d[c] = o.returnStates[s], s += 1) : (f[c] = g, d[c] = r.returnStates[u], u += 1);
      c += 1;
    }
    if (s < o.returnStates.length) for (let p = s; p < o.returnStates.length; p++) f[c] = o.parents[p], d[c] = o.returnStates[p], c += 1;
    else for (let p = u; p < r.returnStates.length; p++) f[c] = r.parents[p], d[c] = r.returnStates[p], c += 1;
    if (c < f.length) {
      if (c === 1) {
        const p = Uo.create(f[0], d[0]);
        return l !== null && l.set(o, r, p), p;
      }
      f = f.slice(0, c), d = d.slice(0, c);
    }
    const h = new vl(f, d);
    return h.equals(o) ? (l !== null && l.set(o, r, o), cn.trace_atn_sim && console.log("mergeArrays a=" + o + ",b=" + r + " -> a"), o) : h.equals(r) ? (l !== null && l.set(o, r, r), cn.trace_atn_sim && console.log("mergeArrays a=" + o + ",b=" + r + " -> b"), r) : ((function(p) {
      const g = new Ag();
      for (let m = 0; m < p.length; m++) {
        const y = p[m];
        g.containsKey(y) || g.set(y, y);
      }
      for (let m = 0; m < p.length; m++) p[m] = g.get(p[m]);
    })(f), l !== null && l.set(o, r, h), cn.trace_atn_sim && console.log("mergeArrays a=" + o + ",b=" + r + " -> " + h), h);
  })(t, e, n, i);
}
class Jo {
  constructor() {
    this.data = new Uint32Array(1);
  }
  set(e) {
    Jo._checkIndex(e), this._resize(e), this.data[e >>> 5] |= 1 << e % 32;
  }
  get(e) {
    Jo._checkIndex(e);
    const n = e >>> 5;
    return !(n >= this.data.length || !(this.data[n] & 1 << e % 32));
  }
  clear(e) {
    Jo._checkIndex(e);
    const n = e >>> 5;
    n < this.data.length && (this.data[n] &= ~(1 << e));
  }
  or(e) {
    const n = Math.min(this.data.length, e.data.length);
    for (let i = 0; i < n; ++i) this.data[i] |= e.data[i];
    if (this.data.length < e.data.length) {
      this._resize((e.data.length << 5) - 1);
      const i = e.data.length;
      for (let o = n; o < i; ++o) this.data[o] = e.data[o];
    }
  }
  values() {
    const e = new Array(this.length);
    let n = 0;
    const i = this.data.length;
    for (let o = 0; o < i; ++o) {
      let r = this.data[o];
      for (; r !== 0; ) {
        const a = r & -r;
        e[n++] = (o << 5) + Jo._bitCount(a - 1), r ^= a;
      }
    }
    return e;
  }
  minValue() {
    for (let e = 0; e < this.data.length; ++e) {
      let n = this.data[e];
      if (n !== 0) {
        let i = 0;
        for (; !(1 & n); ) i++, n >>= 1;
        return i + 32 * e;
      }
    }
    return 0;
  }
  hashCode() {
    return Vr.hashStuff(this.values());
  }
  equals(e) {
    return e instanceof Jo && Gf(this.data, e.data);
  }
  toString() {
    return "{" + this.values().join(", ") + "}";
  }
  get length() {
    return this.data.map(((e) => Jo._bitCount(e))).reduce(((e, n) => e + n), 0);
  }
  _resize(e) {
    const n = e + 32 >>> 5;
    if (n <= this.data.length) return;
    const i = new Uint32Array(n);
    i.set(this.data), i.fill(0, this.data.length), this.data = i;
  }
  static _checkIndex(e) {
    if (e < 0) throw new RangeError("index cannot be negative");
  }
  static _bitCount(e) {
    return e = (e = (858993459 & (e -= e >> 1 & 1431655765)) + (e >> 2 & 858993459)) + (e >> 4) & 252645135, e += e >> 8, 0 + (e += e >> 16) & 63;
  }
}
class td {
  constructor(e) {
    this.atn = e;
  }
  getDecisionLookahead(e) {
    if (e === null) return null;
    const n = e.transitions.length, i = [];
    for (let o = 0; o < n; o++) {
      i[o] = new wr();
      const r = new Lr();
      this._LOOK(e.transition(o).target, null, cn.EMPTY, i[o], r, new Jo(), !1, !1), (i[o].length === 0 || i[o].contains(td.HIT_PRED)) && (i[o] = null);
    }
    return i;
  }
  LOOK(e, n, i) {
    const o = new wr(), r = (i = i || null) !== null ? Mk(e.atn, i) : null;
    return this._LOOK(e, n, r, o, new Lr(), new Jo(), !0, !0), o;
  }
  _LOOK(e, n, i, o, r, a, l, s) {
    const u = new Qi({ state: e, alt: 0, context: i }, null);
    if (!r.has(u)) {
      if (r.add(u), e === n) {
        if (i === null) return void o.addOne(dt.EPSILON);
        if (i.isEmpty() && s) return void o.addOne(dt.EOF);
      }
      if (e instanceof ir) {
        if (i === null) return void o.addOne(dt.EPSILON);
        if (i.isEmpty() && s) return void o.addOne(dt.EOF);
        if (i !== cn.EMPTY) {
          const c = a.get(e.ruleIndex);
          try {
            a.clear(e.ruleIndex);
            for (let d = 0; d < i.length; d++) {
              const f = this.atn.states[i.getReturnState(d)];
              this._LOOK(f, n, i.getParent(d), o, r, a, l, s);
            }
          } finally {
            c && a.set(e.ruleIndex);
          }
          return;
        }
      }
      for (let c = 0; c < e.transitions.length; c++) {
        const d = e.transitions[c];
        if (d.constructor === I0) {
          if (a.get(d.target.ruleIndex)) continue;
          const f = Uo.create(i, d.followState.stateNumber);
          try {
            a.set(d.target.ruleIndex), this._LOOK(d.target, n, f, o, r, a, l, s);
          } finally {
            a.clear(d.target.ruleIndex);
          }
        } else if (d instanceof Ik) l ? this._LOOK(d.target, n, i, o, r, a, l, s) : o.addOne(td.HIT_PRED);
        else if (d.isEpsilon) this._LOOK(d.target, n, i, o, r, a, l, s);
        else if (d.constructor === g8) o.addRange(dt.MIN_USER_TOKEN_TYPE, this.atn.maxTokenType);
        else {
          let f = d.label;
          f !== null && (d instanceof _k && (f = f.complement(dt.MIN_USER_TOKEN_TYPE, this.atn.maxTokenType)), o.addSet(f));
        }
      }
    }
  }
}
td.HIT_PRED = dt.INVALID_TYPE;
class $i {
  constructor(e, n) {
    this.grammarType = e, this.maxTokenType = n, this.states = [], this.decisionToState = [], this.ruleToStartState = [], this.ruleToStopState = null, this.modeNameToStartState = {}, this.ruleToTokenType = null, this.lexerActions = null, this.modeToStartState = [];
  }
  nextTokensInContext(e, n) {
    return new td(this).LOOK(e, null, n);
  }
  nextTokensNoContext(e) {
    return e.nextTokenWithinRule !== null || (e.nextTokenWithinRule = this.nextTokensInContext(e, null), e.nextTokenWithinRule.readOnly = !0), e.nextTokenWithinRule;
  }
  nextTokens(e, n) {
    return n === void 0 ? this.nextTokensNoContext(e) : this.nextTokensInContext(e, n);
  }
  addState(e) {
    e !== null && (e.atn = this, e.stateNumber = this.states.length), this.states.push(e);
  }
  removeState(e) {
    this.states[e.stateNumber] = null;
  }
  defineDecisionState(e) {
    return this.decisionToState.push(e), e.decision = this.decisionToState.length - 1, e.decision;
  }
  getDecisionState(e) {
    return this.decisionToState.length === 0 ? null : this.decisionToState[e];
  }
  getExpectedTokens(e, n) {
    if (e < 0 || e >= this.states.length) throw "Invalid state number.";
    const i = this.states[e];
    let o = this.nextTokens(i);
    if (!o.contains(dt.EPSILON)) return o;
    const r = new wr();
    for (r.addSet(o), r.removeOne(dt.EPSILON); n !== null && n.invokingState >= 0 && o.contains(dt.EPSILON); ) {
      const a = this.states[n.invokingState].transitions[0];
      o = this.nextTokens(a.followState), r.addSet(o), r.removeOne(dt.EPSILON), n = n.parentCtx;
    }
    return o.contains(dt.EPSILON) && r.addOne(dt.EOF), r;
  }
}
$i.INVALID_ALT_NUMBER = 0;
class rA extends Rt {
  constructor() {
    super(), this.stateType = Rt.BASIC;
  }
}
class gh extends Rt {
  constructor() {
    return super(), this.decision = -1, this.nonGreedy = !1, this;
  }
}
class Sf extends gh {
  constructor() {
    return super(), this.endState = null, this;
  }
}
class gx extends Rt {
  constructor() {
    return super(), this.stateType = Rt.BLOCK_END, this.startState = null, this;
  }
}
class Nd extends Rt {
  constructor() {
    return super(), this.stateType = Rt.LOOP_END, this.loopBackState = null, this;
  }
}
class aA extends Rt {
  constructor() {
    return super(), this.stateType = Rt.RULE_START, this.stopState = null, this.isPrecedenceRule = !1, this;
  }
}
class JSe extends gh {
  constructor() {
    return super(), this.stateType = Rt.TOKEN_START, this;
  }
}
class lA extends gh {
  constructor() {
    return super(), this.stateType = Rt.PLUS_LOOP_BACK, this;
  }
}
class mx extends Rt {
  constructor() {
    return super(), this.stateType = Rt.STAR_LOOP_BACK, this;
  }
}
class mc extends gh {
  constructor() {
    return super(), this.stateType = Rt.STAR_LOOP_ENTRY, this.loopBackState = null, this.isPrecedenceDecision = null, this;
  }
}
class vx extends Sf {
  constructor() {
    return super(), this.stateType = Rt.PLUS_BLOCK_START, this.loopBackState = null, this;
  }
}
class yx extends Sf {
  constructor() {
    return super(), this.stateType = Rt.STAR_BLOCK_START, this;
  }
}
class sA extends Sf {
  constructor() {
    return super(), this.stateType = Rt.BLOCK_START, this;
  }
}
class rw extends At {
  constructor(e, n) {
    super(e), this.label_ = n, this.label = this.makeLabel(), this.serializationType = At.ATOM;
  }
  makeLabel() {
    const e = new wr();
    return e.addOne(this.label_), e;
  }
  matches(e, n, i) {
    return this.label_ === e;
  }
  toString() {
    return this.label_;
  }
}
class ewe extends At {
  constructor(e, n, i) {
    super(e), this.serializationType = At.RANGE, this.start = n, this.stop = i, this.label = this.makeLabel();
  }
  makeLabel() {
    const e = new wr();
    return e.addRange(this.start, this.stop), e;
  }
  matches(e, n, i) {
    return e >= this.start && e <= this.stop;
  }
  toString() {
    return "'" + String.fromCharCode(this.start) + "'..'" + String.fromCharCode(this.stop) + "'";
  }
}
class b8 extends At {
  constructor(e, n, i, o) {
    super(e), this.serializationType = At.ACTION, this.ruleIndex = n, this.actionIndex = i === void 0 ? -1 : i, this.isCtxDependent = o !== void 0 && o, this.isEpsilon = !0;
  }
  matches(e, n, i) {
    return !1;
  }
  toString() {
    return "action_" + this.ruleIndex + ":" + this.actionIndex;
  }
}
class Fh extends At {
  constructor(e, n) {
    super(e), this.serializationType = At.EPSILON, this.isEpsilon = !0, this.outermostPrecedenceReturn = n;
  }
  matches(e, n, i) {
    return !1;
  }
  toString() {
    return "epsilon";
  }
}
class Xy extends Hn {
  constructor(e, n, i) {
    super(), this.ruleIndex = e === void 0 ? -1 : e, this.predIndex = n === void 0 ? -1 : n, this.isCtxDependent = i !== void 0 && i;
  }
  evaluate(e, n) {
    const i = this.isCtxDependent ? n : null;
    return e.sempred(i, this.ruleIndex, this.predIndex);
  }
  updateHashCode(e) {
    e.update(this.ruleIndex, this.predIndex, this.isCtxDependent);
  }
  equals(e) {
    return this === e || e instanceof Xy && this.ruleIndex === e.ruleIndex && this.predIndex === e.predIndex && this.isCtxDependent === e.isCtxDependent;
  }
  toString() {
    return "{" + this.ruleIndex + ":" + this.predIndex + "}?";
  }
}
Hn.NONE = new Xy();
class x8 extends Ik {
  constructor(e, n, i, o) {
    super(e), this.serializationType = At.PREDICATE, this.ruleIndex = n, this.predIndex = i, this.isCtxDependent = o, this.isEpsilon = !0;
  }
  matches(e, n, i) {
    return !1;
  }
  getPredicate() {
    return new Xy(this.ruleIndex, this.predIndex, this.isCtxDependent);
  }
  toString() {
    return "pred_" + this.ruleIndex + ":" + this.predIndex;
  }
}
class Zy extends Hn {
  constructor(e) {
    super(), this.precedence = e === void 0 ? 0 : e;
  }
  evaluate(e, n) {
    return e.precpred(n, this.precedence);
  }
  evalPrecedence(e, n) {
    return e.precpred(n, this.precedence) ? Hn.NONE : null;
  }
  compareTo(e) {
    return this.precedence - e.precedence;
  }
  updateHashCode(e) {
    e.update(this.precedence);
  }
  equals(e) {
    return this === e || e instanceof Zy && this.precedence === e.precedence;
  }
  toString() {
    return "{" + this.precedence + ">=prec}?";
  }
}
Hn.PrecedencePredicate = Zy;
class twe extends Ik {
  constructor(e, n) {
    super(e), this.serializationType = At.PRECEDENCE, this.precedence = n, this.isEpsilon = !0;
  }
  matches(e, n, i) {
    return !1;
  }
  getPredicate() {
    return new Zy(this.precedence);
  }
  toString() {
    return this.precedence + " >= _p";
  }
}
class kp {
  constructor(e) {
    e === void 0 && (e = null), this.readOnly = !1, this.verifyATN = e === null || e.verifyATN, this.generateRuleBypassTransitions = e !== null && e.generateRuleBypassTransitions;
  }
}
kp.defaultOptions = new kp(), kp.defaultOptions.readOnly = !0;
class Vs {
  constructor(e) {
    this.actionType = e, this.isPositionDependent = !1;
  }
  hashCode() {
    const e = new Vr();
    return this.updateHashCode(e), e.finish();
  }
  updateHashCode(e) {
    e.update(this.actionType);
  }
  equals(e) {
    return this === e;
  }
}
class aw extends Vs {
  constructor() {
    super(6);
  }
  execute(e) {
    e.skip();
  }
  toString() {
    return "skip";
  }
}
aw.INSTANCE = new aw();
class Ak extends Vs {
  constructor(e) {
    super(0), this.channel = e;
  }
  execute(e) {
    e._channel = this.channel;
  }
  updateHashCode(e) {
    e.update(this.actionType, this.channel);
  }
  equals(e) {
    return this === e || e instanceof Ak && this.channel === e.channel;
  }
  toString() {
    return "channel(" + this.channel + ")";
  }
}
class Rk extends Vs {
  constructor(e, n) {
    super(1), this.ruleIndex = e, this.actionIndex = n, this.isPositionDependent = !0;
  }
  execute(e) {
    e.action(null, this.ruleIndex, this.actionIndex);
  }
  updateHashCode(e) {
    e.update(this.actionType, this.ruleIndex, this.actionIndex);
  }
  equals(e) {
    return this === e || e instanceof Rk && this.ruleIndex === e.ruleIndex && this.actionIndex === e.actionIndex;
  }
}
class lw extends Vs {
  constructor() {
    super(3);
  }
  execute(e) {
    e.more();
  }
  toString() {
    return "more";
  }
}
lw.INSTANCE = new lw();
class Dk extends Vs {
  constructor(e) {
    super(7), this.type = e;
  }
  execute(e) {
    e.type = this.type;
  }
  updateHashCode(e) {
    e.update(this.actionType, this.type);
  }
  equals(e) {
    return this === e || e instanceof Dk && this.type === e.type;
  }
  toString() {
    return "type(" + this.type + ")";
  }
}
class Nk extends Vs {
  constructor(e) {
    super(5), this.mode = e;
  }
  execute(e) {
    e.pushMode(this.mode);
  }
  updateHashCode(e) {
    e.update(this.actionType, this.mode);
  }
  equals(e) {
    return this === e || e instanceof Nk && this.mode === e.mode;
  }
  toString() {
    return "pushMode(" + this.mode + ")";
  }
}
class sw extends Vs {
  constructor() {
    super(4);
  }
  execute(e) {
    e.popMode();
  }
  toString() {
    return "popMode";
  }
}
sw.INSTANCE = new sw();
class Lk extends Vs {
  constructor(e) {
    super(2), this.mode = e;
  }
  execute(e) {
    e.setMode(this.mode);
  }
  updateHashCode(e) {
    e.update(this.actionType, this.mode);
  }
  equals(e) {
    return this === e || e instanceof Lk && this.mode === e.mode;
  }
  toString() {
    return "mode(" + this.mode + ")";
  }
}
function Ym(t, e) {
  const n = [];
  return n[t - 1] = e, n.map((function(i) {
    return e;
  }));
}
class zk {
  constructor(e) {
    e == null && (e = kp.defaultOptions), this.deserializationOptions = e, this.stateFactories = null, this.actionFactories = null;
  }
  deserialize(e) {
    const n = this.reset(e);
    this.checkVersion(n), n && this.skipUUID();
    const i = this.readATN();
    this.readStates(i, n), this.readRules(i, n), this.readModes(i);
    const o = [];
    return this.readSets(i, o, this.readInt.bind(this)), n && this.readSets(i, o, this.readInt32.bind(this)), this.readEdges(i, o), this.readDecisions(i), this.readLexerActions(i, n), this.markPrecedenceDecisions(i), this.verifyATN(i), this.deserializationOptions.generateRuleBypassTransitions && i.grammarType === 1 && (this.generateRuleBypassTransitions(i), this.verifyATN(i)), i;
  }
  reset(e) {
    if ((e.charCodeAt ? e.charCodeAt(0) : e[0]) === 3) {
      const n = function(o) {
        const r = o.charCodeAt(0);
        return r > 1 ? r - 2 : r + 65534;
      }, i = e.split("").map(n);
      return i[0] = e.charCodeAt(0), this.data = i, this.pos = 0, !0;
    }
    return this.data = e, this.pos = 0, !1;
  }
  skipUUID() {
    let e = 0;
    for (; e++ < 8; ) this.readInt();
  }
  checkVersion(e) {
    const n = this.readInt();
    if (!e && n !== 4) throw "Could not deserialize ATN with version " + n + " (expected 4).";
  }
  readATN() {
    const e = this.readInt(), n = this.readInt();
    return new $i(e, n);
  }
  readStates(e, n) {
    let i, o, r;
    const a = [], l = [], s = this.readInt();
    for (let d = 0; d < s; d++) {
      const f = this.readInt();
      if (f === Rt.INVALID_TYPE) {
        e.addState(null);
        continue;
      }
      let h = this.readInt();
      n && h === 65535 && (h = -1);
      const p = this.stateFactory(f, h);
      if (f === Rt.LOOP_END) {
        const g = this.readInt();
        a.push([p, g]);
      } else if (p instanceof Sf) {
        const g = this.readInt();
        l.push([p, g]);
      }
      e.addState(p);
    }
    for (i = 0; i < a.length; i++) o = a[i], o[0].loopBackState = e.states[o[1]];
    for (i = 0; i < l.length; i++) o = l[i], o[0].endState = e.states[o[1]];
    let u = this.readInt();
    for (i = 0; i < u; i++) r = this.readInt(), e.states[r].nonGreedy = !0;
    let c = this.readInt();
    for (i = 0; i < c; i++) r = this.readInt(), e.states[r].isPrecedenceRule = !0;
  }
  readRules(e, n) {
    let i;
    const o = this.readInt();
    for (e.grammarType === 0 && (e.ruleToTokenType = Ym(o, 0)), e.ruleToStartState = Ym(o, 0), i = 0; i < o; i++) {
      const r = this.readInt();
      if (e.ruleToStartState[i] = e.states[r], e.grammarType === 0) {
        let a = this.readInt();
        n && a === 65535 && (a = dt.EOF), e.ruleToTokenType[i] = a;
      }
    }
    for (e.ruleToStopState = Ym(o, 0), i = 0; i < e.states.length; i++) {
      const r = e.states[i];
      r instanceof ir && (e.ruleToStopState[r.ruleIndex] = r, e.ruleToStartState[r.ruleIndex].stopState = r);
    }
  }
  readModes(e) {
    const n = this.readInt();
    for (let i = 0; i < n; i++) {
      let o = this.readInt();
      e.modeToStartState.push(e.states[o]);
    }
  }
  readSets(e, n, i) {
    const o = this.readInt();
    for (let r = 0; r < o; r++) {
      const a = new wr();
      n.push(a);
      const l = this.readInt();
      this.readInt() !== 0 && a.addOne(-1);
      for (let s = 0; s < l; s++) {
        const u = i(), c = i();
        a.addRange(u, c);
      }
    }
  }
  readEdges(e, n) {
    let i, o, r, a, l;
    const s = this.readInt();
    for (i = 0; i < s; i++) {
      const u = this.readInt(), c = this.readInt(), d = this.readInt(), f = this.readInt(), h = this.readInt(), p = this.readInt();
      a = this.edgeFactory(e, d, u, c, f, h, p, n), e.states[u].addTransition(a);
    }
    for (i = 0; i < e.states.length; i++) for (r = e.states[i], o = 0; o < r.transitions.length; o++) {
      const u = r.transitions[o];
      if (!(u instanceof I0)) continue;
      let c = -1;
      e.ruleToStartState[u.target.ruleIndex].isPrecedenceRule && u.precedence === 0 && (c = u.target.ruleIndex), a = new Fh(u.followState, c), e.ruleToStopState[u.target.ruleIndex].addTransition(a);
    }
    for (i = 0; i < e.states.length; i++) {
      if (r = e.states[i], r instanceof Sf) {
        if (r.endState === null || r.endState.startState !== null) throw "IllegalState";
        r.endState.startState = r;
      }
      if (r instanceof lA) for (o = 0; o < r.transitions.length; o++) l = r.transitions[o].target, l instanceof vx && (l.loopBackState = r);
      else if (r instanceof mx) for (o = 0; o < r.transitions.length; o++) l = r.transitions[o].target, l instanceof mc && (l.loopBackState = r);
    }
  }
  readDecisions(e) {
    const n = this.readInt();
    for (let i = 0; i < n; i++) {
      const o = this.readInt(), r = e.states[o];
      e.decisionToState.push(r), r.decision = i;
    }
  }
  readLexerActions(e, n) {
    if (e.grammarType === 0) {
      const i = this.readInt();
      e.lexerActions = Ym(i, null);
      for (let o = 0; o < i; o++) {
        const r = this.readInt();
        let a = this.readInt();
        n && a === 65535 && (a = -1);
        let l = this.readInt();
        n && l === 65535 && (l = -1), e.lexerActions[o] = this.lexerActionFactory(r, a, l);
      }
    }
  }
  generateRuleBypassTransitions(e) {
    let n;
    const i = e.ruleToStartState.length;
    for (n = 0; n < i; n++) e.ruleToTokenType[n] = e.maxTokenType + n + 1;
    for (n = 0; n < i; n++) this.generateRuleBypassTransition(e, n);
  }
  generateRuleBypassTransition(e, n) {
    let i, o;
    const r = new sA();
    r.ruleIndex = n, e.addState(r);
    const a = new gx();
    a.ruleIndex = n, e.addState(a), r.endState = a, e.defineDecisionState(r), a.startState = r;
    let l = null, s = null;
    if (e.ruleToStartState[n].isPrecedenceRule) {
      for (s = null, i = 0; i < e.states.length; i++) if (o = e.states[i], this.stateIsEndStateFor(o, n)) {
        s = o, l = o.loopBackState.transitions[0];
        break;
      }
      if (l === null) throw "Couldn't identify final state of the precedence rule prefix section.";
    } else s = e.ruleToStopState[n];
    for (i = 0; i < e.states.length; i++) {
      o = e.states[i];
      for (let f = 0; f < o.transitions.length; f++) {
        const h = o.transitions[f];
        h !== l && h.target === s && (h.target = a);
      }
    }
    const u = e.ruleToStartState[n], c = u.transitions.length;
    for (; c > 0; ) r.addTransition(u.transitions[c - 1]), u.transitions = u.transitions.slice(-1);
    e.ruleToStartState[n].addTransition(new Fh(r)), a.addTransition(new Fh(s));
    const d = new rA();
    e.addState(d), d.addTransition(new rw(a, e.ruleToTokenType[n])), r.addTransition(new Fh(d));
  }
  stateIsEndStateFor(e, n) {
    if (e.ruleIndex !== n || !(e instanceof mc)) return null;
    const i = e.transitions[e.transitions.length - 1].target;
    return i instanceof Nd && i.epsilonOnlyTransitions && i.transitions[0].target instanceof ir ? e : null;
  }
  markPrecedenceDecisions(e) {
    for (let n = 0; n < e.states.length; n++) {
      const i = e.states[n];
      if (i instanceof mc && e.ruleToStartState[i.ruleIndex].isPrecedenceRule) {
        const o = i.transitions[i.transitions.length - 1].target;
        o instanceof Nd && o.epsilonOnlyTransitions && o.transitions[0].target instanceof ir && (i.isPrecedenceDecision = !0);
      }
    }
  }
  verifyATN(e) {
    if (this.deserializationOptions.verifyATN) for (let n = 0; n < e.states.length; n++) {
      const i = e.states[n];
      if (i !== null) if (this.checkCondition(i.epsilonOnlyTransitions || i.transitions.length <= 1), i instanceof vx) this.checkCondition(i.loopBackState !== null);
      else if (i instanceof mc) if (this.checkCondition(i.loopBackState !== null), this.checkCondition(i.transitions.length === 2), i.transitions[0].target instanceof yx) this.checkCondition(i.transitions[1].target instanceof Nd), this.checkCondition(!i.nonGreedy);
      else {
        if (!(i.transitions[0].target instanceof Nd)) throw "IllegalState";
        this.checkCondition(i.transitions[1].target instanceof yx), this.checkCondition(i.nonGreedy);
      }
      else i instanceof mx ? (this.checkCondition(i.transitions.length === 1), this.checkCondition(i.transitions[0].target instanceof mc)) : i instanceof Nd ? this.checkCondition(i.loopBackState !== null) : i instanceof aA ? this.checkCondition(i.stopState !== null) : i instanceof Sf ? this.checkCondition(i.endState !== null) : i instanceof gx ? this.checkCondition(i.startState !== null) : i instanceof gh ? this.checkCondition(i.transitions.length <= 1 || i.decision >= 0) : this.checkCondition(i.transitions.length <= 1 || i instanceof ir);
    }
  }
  checkCondition(e, n) {
    if (!e) throw n == null && (n = "IllegalState"), n;
  }
  readInt() {
    return this.data[this.pos++];
  }
  readInt32() {
    return this.readInt() | this.readInt() << 16;
  }
  edgeFactory(e, n, i, o, r, a, l, s) {
    const u = e.states[o];
    switch (n) {
      case At.EPSILON:
        return new Fh(u);
      case At.RANGE:
        return new ewe(u, l !== 0 ? dt.EOF : r, a);
      case At.RULE:
        return new I0(e.states[r], a, l, u);
      case At.PREDICATE:
        return new x8(u, r, a, l !== 0);
      case At.PRECEDENCE:
        return new twe(u, r);
      case At.ATOM:
        return new rw(u, l !== 0 ? dt.EOF : r);
      case At.ACTION:
        return new b8(u, r, a, l !== 0);
      case At.SET:
        return new Ek(u, s[r]);
      case At.NOT_SET:
        return new _k(u, s[r]);
      case At.WILDCARD:
        return new g8(u);
      default:
        throw "The specified transition type: " + n + " is not valid.";
    }
  }
  stateFactory(e, n) {
    if (this.stateFactories === null) {
      const i = [];
      i[Rt.INVALID_TYPE] = null, i[Rt.BASIC] = () => new rA(), i[Rt.RULE_START] = () => new aA(), i[Rt.BLOCK_START] = () => new sA(), i[Rt.PLUS_BLOCK_START] = () => new vx(), i[Rt.STAR_BLOCK_START] = () => new yx(), i[Rt.TOKEN_START] = () => new JSe(), i[Rt.RULE_STOP] = () => new ir(), i[Rt.BLOCK_END] = () => new gx(), i[Rt.STAR_LOOP_BACK] = () => new mx(), i[Rt.STAR_LOOP_ENTRY] = () => new mc(), i[Rt.PLUS_LOOP_BACK] = () => new lA(), i[Rt.LOOP_END] = () => new Nd(), this.stateFactories = i;
    }
    if (e > this.stateFactories.length || this.stateFactories[e] === null) throw "The specified state type " + e + " is not valid.";
    {
      const i = this.stateFactories[e]();
      if (i !== null) return i.ruleIndex = n, i;
    }
  }
  lexerActionFactory(e, n, i) {
    if (this.actionFactories === null) {
      const o = [];
      o[0] = (r, a) => new Ak(r), o[1] = (r, a) => new Rk(r, a), o[2] = (r, a) => new Lk(r), o[3] = (r, a) => lw.INSTANCE, o[4] = (r, a) => sw.INSTANCE, o[5] = (r, a) => new Nk(r), o[6] = (r, a) => aw.INSTANCE, o[7] = (r, a) => new Dk(r), this.actionFactories = o;
    }
    if (e > this.actionFactories.length || this.actionFactories[e] === null) throw "The specified lexer action type " + e + " is not valid.";
    return this.actionFactories[e](n, i);
  }
}
class Rg {
  syntaxError(e, n, i, o, r, a) {
  }
  reportAmbiguity(e, n, i, o, r, a, l) {
  }
  reportAttemptingFullContext(e, n, i, o, r, a) {
  }
  reportContextSensitivity(e, n, i, o, r, a) {
  }
}
class uw extends Rg {
  constructor() {
    super();
  }
  syntaxError(e, n, i, o, r, a) {
    console.error("line " + i + ":" + o + " " + r);
  }
}
uw.INSTANCE = new uw();
class nwe extends Rg {
  constructor(e) {
    if (super(), e === null) throw "delegates";
    return this.delegates = e, this;
  }
  syntaxError(e, n, i, o, r, a) {
    this.delegates.map(((l) => l.syntaxError(e, n, i, o, r, a)));
  }
  reportAmbiguity(e, n, i, o, r, a, l) {
    this.delegates.map(((s) => s.reportAmbiguity(e, n, i, o, r, a, l)));
  }
  reportAttemptingFullContext(e, n, i, o, r, a) {
    this.delegates.map(((l) => l.reportAttemptingFullContext(e, n, i, o, r, a)));
  }
  reportContextSensitivity(e, n, i, o, r, a) {
    this.delegates.map(((l) => l.reportContextSensitivity(e, n, i, o, r, a)));
  }
}
class M0 {
  constructor() {
    this._listeners = [uw.INSTANCE], this._interp = null, this._stateNumber = -1;
  }
  checkVersion(e) {
    const n = "4.13.2";
    n !== e && console.log("ANTLR runtime and generated code versions disagree: " + n + "!=" + e);
  }
  addErrorListener(e) {
    this._listeners.push(e);
  }
  removeErrorListeners() {
    this._listeners = [];
  }
  getLiteralNames() {
    return Object.getPrototypeOf(this).constructor.literalNames || [];
  }
  getSymbolicNames() {
    return Object.getPrototypeOf(this).constructor.symbolicNames || [];
  }
  getTokenNames() {
    if (!this.tokenNames) {
      const e = this.getLiteralNames(), n = this.getSymbolicNames(), i = e.length > n.length ? e.length : n.length;
      this.tokenNames = [];
      for (let o = 0; o < i; o++) this.tokenNames[o] = e[o] || n[o] || "<INVALID";
    }
    return this.tokenNames;
  }
  getTokenTypeMap() {
    const e = this.getTokenNames();
    if (e === null) throw "The current recognizer does not provide a list of token names.";
    let n = this.tokenTypeMapCache[e];
    return n === void 0 && (n = e.reduce((function(i, o, r) {
      i[o] = r;
    })), n.EOF = dt.EOF, this.tokenTypeMapCache[e] = n), n;
  }
  getRuleIndexMap() {
    const e = this.ruleNames;
    if (e === null) throw "The current recognizer does not provide a list of rule names.";
    let n = this.ruleIndexMapCache[e];
    return n === void 0 && (n = e.reduce((function(i, o, r) {
      i[o] = r;
    })), this.ruleIndexMapCache[e] = n), n;
  }
  getTokenType(e) {
    const n = this.getTokenTypeMap()[e];
    return n !== void 0 ? n : dt.INVALID_TYPE;
  }
  getErrorHeader(e) {
    return "line " + e.getOffendingToken().line + ":" + e.getOffendingToken().column;
  }
  getTokenErrorDisplay(e) {
    if (e === null) return "<no token>";
    let n = e.text;
    return n === null && (n = e.type === dt.EOF ? "<EOF>" : "<" + e.type + ">"), n = n.replace(`
`, "\\n").replace("\r", "\\r").replace("	", "\\t"), "'" + n + "'";
  }
  getErrorListenerDispatch() {
    return console.warn("Calling deprecated method in Recognizer class: getErrorListenerDispatch()"), this.getErrorListener();
  }
  getErrorListener() {
    return new nwe(this._listeners);
  }
  sempred(e, n, i) {
    return !0;
  }
  precpred(e, n) {
    return !0;
  }
  get atn() {
    return this._interp.atn;
  }
  get state() {
    return this._stateNumber;
  }
  set state(e) {
    this._stateNumber = e;
  }
}
M0.tokenTypeMapCache = {}, M0.ruleIndexMapCache = {};
class ws extends dt {
  constructor(e, n, i, o, r) {
    super(), this.source = e !== void 0 ? e : ws.EMPTY_SOURCE, this.type = n !== void 0 ? n : null, this.channel = i !== void 0 ? i : dt.DEFAULT_CHANNEL, this.start = o !== void 0 ? o : -1, this.stop = r !== void 0 ? r : -1, this.tokenIndex = -1, this.source[0] !== null ? (this.line = e[0].line, this.column = e[0].column) : this.column = -1;
  }
  clone() {
    const e = new ws(this.source, this.type, this.channel, this.start, this.stop);
    return e.tokenIndex = this.tokenIndex, e.line = this.line, e.column = this.column, e.text = this.text, e;
  }
  cloneWithType(e) {
    const n = new ws(this.source, e, this.channel, this.start, this.stop);
    return n.tokenIndex = this.tokenIndex, n.line = this.line, n.column = this.column, e === dt.EOF && (n.text = ""), n;
  }
  toString() {
    let e = this.text;
    return e = e !== null ? e.replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t") : "<no text>", "[@" + this.tokenIndex + "," + this.start + ":" + this.stop + "='" + e + "',<" + this.type + ">" + (this.channel > 0 ? ",channel=" + this.channel : "") + "," + this.line + ":" + this.column + "]";
  }
  get text() {
    if (this._text !== null) return this._text;
    const e = this.getInputStream();
    if (e === null) return null;
    const n = e.size;
    return this.start < n && this.stop < n ? e.getText(this.start, this.stop) : "<EOF>";
  }
  set text(e) {
    this._text = e;
  }
}
ws.EMPTY_SOURCE = [null, null];
class iwe {
}
class cw extends iwe {
  constructor(e) {
    super(), this.copyText = e !== void 0 && e;
  }
  create(e, n, i, o, r, a, l, s) {
    const u = new ws(e, n, o, r, a);
    return u.line = l, u.column = s, i !== null ? u.text = i : this.copyText && e[1] !== null && (u.text = e[1].getText(r, a)), u;
  }
  createThin(e, n) {
    const i = new ws(null, e);
    return i.text = n, i;
  }
}
cw.DEFAULT = new cw();
class Qs extends Error {
  constructor(e) {
    super(e.message), Error.captureStackTrace && Error.captureStackTrace(this, Qs), this.message = e.message, this.recognizer = e.recognizer, this.input = e.input, this.ctx = e.ctx, this.offendingToken = null, this.offendingState = -1, this.recognizer !== null && (this.offendingState = this.recognizer.state);
  }
  getExpectedTokens() {
    return this.recognizer !== null ? this.recognizer.atn.getExpectedTokens(this.offendingState, this.ctx) : null;
  }
  toString() {
    return this.message;
  }
}
class Bk extends Qs {
  constructor(e, n, i, o) {
    super({ message: "", recognizer: e, input: n, ctx: null }), this.startIndex = i, this.deadEndConfigs = o;
  }
  toString() {
    let e = "";
    return this.startIndex >= 0 && this.startIndex < this.input.size && (e = this.input.getText(new Cn(this.startIndex, this.startIndex))), "LexerNoViableAltException" + e;
  }
}
class Ai extends M0 {
  constructor(e) {
    super(), this._input = e, this._factory = cw.DEFAULT, this._tokenFactorySourcePair = [this, e], this._interp = null, this._token = null, this._tokenStartCharIndex = -1, this._tokenStartLine = -1, this._tokenStartColumn = -1, this._hitEOF = !1, this._channel = dt.DEFAULT_CHANNEL, this._type = dt.INVALID_TYPE, this._modeStack = [], this._mode = Ai.DEFAULT_MODE, this._text = null;
  }
  reset() {
    this._input !== null && this._input.seek(0), this._token = null, this._type = dt.INVALID_TYPE, this._channel = dt.DEFAULT_CHANNEL, this._tokenStartCharIndex = -1, this._tokenStartColumn = -1, this._tokenStartLine = -1, this._text = null, this._hitEOF = !1, this._mode = Ai.DEFAULT_MODE, this._modeStack = [], this._interp.reset();
  }
  nextToken() {
    if (this._input === null) throw "nextToken requires a non-null input stream.";
    const e = this._input.mark();
    try {
      for (; ; ) {
        if (this._hitEOF) return this.emitEOF(), this._token;
        this._token = null, this._channel = dt.DEFAULT_CHANNEL, this._tokenStartCharIndex = this._input.index, this._tokenStartColumn = this._interp.column, this._tokenStartLine = this._interp.line, this._text = null;
        let n = !1;
        for (; ; ) {
          this._type = dt.INVALID_TYPE;
          let i = Ai.SKIP;
          try {
            i = this._interp.match(this._input, this._mode);
          } catch (o) {
            if (!(o instanceof Qs)) throw console.log(o.stack), o;
            this.notifyListeners(o), this.recover(o);
          }
          if (this._input.LA(1) === dt.EOF && (this._hitEOF = !0), this._type === dt.INVALID_TYPE && (this._type = i), this._type === Ai.SKIP) {
            n = !0;
            break;
          }
          if (this._type !== Ai.MORE) break;
        }
        if (!n) return this._token === null && this.emit(), this._token;
      }
    } finally {
      this._input.release(e);
    }
  }
  skip() {
    this._type = Ai.SKIP;
  }
  more() {
    this._type = Ai.MORE;
  }
  mode(e) {
    console.warn("Calling deprecated method in Lexer class: mode(...)"), this.setMode(e);
  }
  setMode(e) {
    this._mode = e;
  }
  getMode() {
    return this._mode;
  }
  getModeStack() {
    return this._modeStack;
  }
  pushMode(e) {
    this._interp.debug && console.log("pushMode " + e), this._modeStack.push(this._mode), this.setMode(e);
  }
  popMode() {
    if (this._modeStack.length === 0) throw "Empty Stack";
    return this._interp.debug && console.log("popMode back to " + this._modeStack.slice(0, -1)), this.setMode(this._modeStack.pop()), this._mode;
  }
  emitToken(e) {
    this._token = e;
  }
  emit() {
    const e = this._factory.create(this._tokenFactorySourcePair, this._type, this._text, this._channel, this._tokenStartCharIndex, this.getCharIndex() - 1, this._tokenStartLine, this._tokenStartColumn);
    return this.emitToken(e), e;
  }
  emitEOF() {
    const e = this.column, n = this.line, i = this._factory.create(this._tokenFactorySourcePair, dt.EOF, null, dt.DEFAULT_CHANNEL, this._input.index, this._input.index - 1, n, e);
    return this.emitToken(i), i;
  }
  getCharIndex() {
    return this._input.index;
  }
  getAllTokens() {
    const e = [];
    let n = this.nextToken();
    for (; n.type !== dt.EOF; ) e.push(n), n = this.nextToken();
    return e;
  }
  notifyListeners(e) {
    const n = this._tokenStartCharIndex, i = this._input.index, o = this._input.getText(n, i), r = "token recognition error at: '" + this.getErrorDisplay(o) + "'";
    this.getErrorListener().syntaxError(this, null, this._tokenStartLine, this._tokenStartColumn, r, e);
  }
  getErrorDisplay(e) {
    const n = [];
    for (let i = 0; i < e.length; i++) n.push(e[i]);
    return n.join("");
  }
  getErrorDisplayForChar(e) {
    return e.charCodeAt(0) === dt.EOF ? "<EOF>" : e === `
` ? "\\n" : e === "	" ? "\\t" : e === "\r" ? "\\r" : e;
  }
  getCharErrorDisplay(e) {
    return "'" + this.getErrorDisplayForChar(e) + "'";
  }
  recover(e) {
    this._input.LA(1) !== dt.EOF && (e instanceof Bk ? this._interp.consume(this._input) : this._input.consume());
  }
  get inputStream() {
    return this._input;
  }
  set inputStream(e) {
    this._input = null, this._tokenFactorySourcePair = [this, this._input], this.reset(), this._input = e, this._tokenFactorySourcePair = [this, this._input];
  }
  get sourceName() {
    return this._input.sourceName;
  }
  get type() {
    return this._type;
  }
  set type(e) {
    this._type = e;
  }
  get line() {
    return this._interp.line;
  }
  set line(e) {
    this._interp.line = e;
  }
  get column() {
    return this._interp.column;
  }
  set column(e) {
    this._interp.column = e;
  }
  get text() {
    return this._text !== null ? this._text : this._interp.getText(this._input);
  }
  set text(e) {
    this._text = e;
  }
}
function owe(t) {
  return t.hashCodeForConfigSet();
}
function rwe(t, e) {
  return t === e || t !== null && e !== null && t.equalsForConfigSet(e);
}
Ai.DEFAULT_MODE = 0, Ai.MORE = -2, Ai.SKIP = -3, Ai.DEFAULT_TOKEN_CHANNEL = dt.DEFAULT_CHANNEL, Ai.HIDDEN = dt.HIDDEN_CHANNEL, Ai.MIN_CHAR_VALUE = 0, Ai.MAX_CHAR_VALUE = 1114111;
class Go {
  constructor(e) {
    this.configLookup = new Lr(owe, rwe), this.fullCtx = e === void 0 || e, this.readOnly = !1, this.configs = [], this.uniqueAlt = 0, this.conflictingAlts = null, this.hasSemanticContext = !1, this.dipsIntoOuterContext = !1, this.cachedHashCode = -1;
  }
  add(e, n) {
    if (n === void 0 && (n = null), this.readOnly) throw "This set is readonly";
    e.semanticContext !== Hn.NONE && (this.hasSemanticContext = !0), e.reachesIntoOuterContext > 0 && (this.dipsIntoOuterContext = !0);
    const i = this.configLookup.getOrAdd(e);
    if (i === e) return this.cachedHashCode = -1, this.configs.push(e), !0;
    const o = !this.fullCtx, r = ow(i.context, e.context, o, n);
    return i.reachesIntoOuterContext = Math.max(i.reachesIntoOuterContext, e.reachesIntoOuterContext), e.precedenceFilterSuppressed && (i.precedenceFilterSuppressed = !0), i.context = r, !0;
  }
  getStates() {
    const e = new Lr();
    for (let n = 0; n < this.configs.length; n++) e.add(this.configs[n].state);
    return e;
  }
  getPredicates() {
    const e = [];
    for (let n = 0; n < this.configs.length; n++) {
      const i = this.configs[n].semanticContext;
      i !== Hn.NONE && e.push(i.semanticContext);
    }
    return e;
  }
  optimizeConfigs(e) {
    if (this.readOnly) throw "This set is readonly";
    if (this.configLookup.length !== 0) for (let n = 0; n < this.configs.length; n++) {
      const i = this.configs[n];
      i.context = e.getCachedContext(i.context);
    }
  }
  addAll(e) {
    for (let n = 0; n < e.length; n++) this.add(e[n]);
    return !1;
  }
  equals(e) {
    return this === e || e instanceof Go && Gf(this.configs, e.configs) && this.fullCtx === e.fullCtx && this.uniqueAlt === e.uniqueAlt && this.conflictingAlts === e.conflictingAlts && this.hasSemanticContext === e.hasSemanticContext && this.dipsIntoOuterContext === e.dipsIntoOuterContext;
  }
  hashCode() {
    const e = new Vr();
    return e.update(this.configs), e.finish();
  }
  updateHashCode(e) {
    this.readOnly ? (this.cachedHashCode === -1 && (this.cachedHashCode = this.hashCode()), e.update(this.cachedHashCode)) : e.update(this.hashCode());
  }
  isEmpty() {
    return this.configs.length === 0;
  }
  contains(e) {
    if (this.configLookup === null) throw "This method is not implemented for readonly sets.";
    return this.configLookup.contains(e);
  }
  containsFast(e) {
    if (this.configLookup === null) throw "This method is not implemented for readonly sets.";
    return this.configLookup.containsFast(e);
  }
  clear() {
    if (this.readOnly) throw "This set is readonly";
    this.configs = [], this.cachedHashCode = -1, this.configLookup = new Lr();
  }
  setReadonly(e) {
    this.readOnly = e, e && (this.configLookup = null);
  }
  toString() {
    return ps(this.configs) + (this.hasSemanticContext ? ",hasSemanticContext=" + this.hasSemanticContext : "") + (this.uniqueAlt !== $i.INVALID_ALT_NUMBER ? ",uniqueAlt=" + this.uniqueAlt : "") + (this.conflictingAlts !== null ? ",conflictingAlts=" + this.conflictingAlts : "") + (this.dipsIntoOuterContext ? ",dipsIntoOuterContext" : "");
  }
  get items() {
    return this.configs;
  }
  get length() {
    return this.configs.length;
  }
}
class Cs {
  constructor(e, n) {
    return e === null && (e = -1), n === null && (n = new Go()), this.stateNumber = e, this.configs = n, this.edges = null, this.isAcceptState = !1, this.prediction = 0, this.lexerActionExecutor = null, this.requiresFullContext = !1, this.predicates = null, this;
  }
  getAltSet() {
    const e = new Lr();
    if (this.configs !== null) for (let n = 0; n < this.configs.length; n++) {
      const i = this.configs[n];
      e.add(i.alt);
    }
    return e.length === 0 ? null : e;
  }
  equals(e) {
    return this === e || e instanceof Cs && this.configs.equals(e.configs);
  }
  toString() {
    let e = this.stateNumber + ":" + this.configs;
    return this.isAcceptState && (e += "=>", this.predicates !== null ? e += this.predicates : e += this.prediction), e;
  }
  hashCode() {
    const e = new Vr();
    return e.update(this.configs), e.finish();
  }
}
class Sl {
  constructor(e, n) {
    return this.atn = e, this.sharedContextCache = n, this;
  }
  getCachedContext(e) {
    if (this.sharedContextCache === null) return e;
    const n = new Ag();
    return y8(e, this.sharedContextCache, n);
  }
}
Sl.ERROR = new Cs(2147483647, new Go());
class uA extends Go {
  constructor() {
    super(), this.configLookup = new Lr();
  }
}
class hr extends Qi {
  constructor(e, n) {
    super(e, n);
    const i = e.lexerActionExecutor || null;
    return this.lexerActionExecutor = i || (n !== null ? n.lexerActionExecutor : null), this.passedThroughNonGreedyDecision = n !== null && this.checkNonGreedyDecision(n, this.state), this.hashCodeForConfigSet = hr.prototype.hashCode, this.equalsForConfigSet = hr.prototype.equals, this;
  }
  updateHashCode(e) {
    e.update(this.state.stateNumber, this.alt, this.context, this.semanticContext, this.passedThroughNonGreedyDecision, this.lexerActionExecutor);
  }
  equals(e) {
    return this === e || e instanceof hr && this.passedThroughNonGreedyDecision === e.passedThroughNonGreedyDecision && (this.lexerActionExecutor ? this.lexerActionExecutor.equals(e.lexerActionExecutor) : !e.lexerActionExecutor) && super.equals(e);
  }
  checkNonGreedyDecision(e, n) {
    return e.passedThroughNonGreedyDecision || n instanceof gh && n.nonGreedy;
  }
}
class Tp extends Vs {
  constructor(e, n) {
    super(n.actionType), this.offset = e, this.action = n, this.isPositionDependent = !0;
  }
  execute(e) {
    this.action.execute(e);
  }
  updateHashCode(e) {
    e.update(this.actionType, this.offset, this.action);
  }
  equals(e) {
    return this === e || e instanceof Tp && this.offset === e.offset && this.action === e.action;
  }
}
class ef {
  constructor(e) {
    return this.lexerActions = e === null ? [] : e, this.cachedHashCode = Vr.hashStuff(e), this;
  }
  fixOffsetBeforeMatch(e) {
    let n = null;
    for (let i = 0; i < this.lexerActions.length; i++) !this.lexerActions[i].isPositionDependent || this.lexerActions[i] instanceof Tp || (n === null && (n = this.lexerActions.concat([])), n[i] = new Tp(e, this.lexerActions[i]));
    return n === null ? this : new ef(n);
  }
  execute(e, n, i) {
    let o = !1;
    const r = n.index;
    try {
      for (let a = 0; a < this.lexerActions.length; a++) {
        let l = this.lexerActions[a];
        if (l instanceof Tp) {
          const s = l.offset;
          n.seek(i + s), l = l.action, o = i + s !== r;
        } else l.isPositionDependent && (n.seek(r), o = !1);
        l.execute(e);
      }
    } finally {
      o && n.seek(r);
    }
  }
  hashCode() {
    return this.cachedHashCode;
  }
  updateHashCode(e) {
    e.update(this.cachedHashCode);
  }
  equals(e) {
    if (this === e) return !0;
    if (e instanceof ef) {
      if (this.cachedHashCode != e.cachedHashCode || this.lexerActions.length != e.lexerActions.length) return !1;
      {
        const n = this.lexerActions.length;
        for (let i = 0; i < n; ++i) if (!this.lexerActions[i].equals(e.lexerActions[i])) return !1;
        return !0;
      }
    }
    return !1;
  }
  static append(e, n) {
    if (e === null) return new ef([n]);
    const i = e.lexerActions.concat([n]);
    return new ef(i);
  }
}
function cA(t) {
  t.index = -1, t.line = 0, t.column = -1, t.dfaState = null;
}
class awe {
  constructor() {
    cA(this);
  }
  reset() {
    cA(this);
  }
}
class _i extends Sl {
  constructor(e, n, i, o) {
    super(n, o), this.decisionToDFA = i, this.recog = e, this.startIndex = -1, this.line = 1, this.column = 0, this.mode = Ai.DEFAULT_MODE, this.prevAccept = new awe();
  }
  copyState(e) {
    this.column = e.column, this.line = e.line, this.mode = e.mode, this.startIndex = e.startIndex;
  }
  match(e, n) {
    this.mode = n;
    const i = e.mark();
    try {
      this.startIndex = e.index, this.prevAccept.reset();
      const o = this.decisionToDFA[n];
      return o.s0 === null ? this.matchATN(e) : this.execATN(e, o.s0);
    } finally {
      e.release(i);
    }
  }
  reset() {
    this.prevAccept.reset(), this.startIndex = -1, this.line = 1, this.column = 0, this.mode = Ai.DEFAULT_MODE;
  }
  matchATN(e) {
    const n = this.atn.modeToStartState[this.mode];
    _i.debug && console.log("matchATN mode " + this.mode + " start: " + n);
    const i = this.mode, o = this.computeStartState(e, n), r = o.hasSemanticContext;
    o.hasSemanticContext = !1;
    const a = this.addDFAState(o);
    r || (this.decisionToDFA[this.mode].s0 = a);
    const l = this.execATN(e, a);
    return _i.debug && console.log("DFA after matchATN: " + this.decisionToDFA[i].toLexerString()), l;
  }
  execATN(e, n) {
    _i.debug && console.log("start state closure=" + n.configs), n.isAcceptState && this.captureSimState(this.prevAccept, e, n);
    let i = e.LA(1), o = n;
    for (; ; ) {
      _i.debug && console.log("execATN loop starting closure: " + o.configs);
      let r = this.getExistingTargetState(o, i);
      if (r === null && (r = this.computeTargetState(e, o, i)), r === Sl.ERROR || (i !== dt.EOF && this.consume(e), r.isAcceptState && (this.captureSimState(this.prevAccept, e, r), i === dt.EOF))) break;
      i = e.LA(1), o = r;
    }
    return this.failOrAccept(this.prevAccept, e, o.configs, i);
  }
  getExistingTargetState(e, n) {
    if (e.edges === null || n < _i.MIN_DFA_EDGE || n > _i.MAX_DFA_EDGE) return null;
    let i = e.edges[n - _i.MIN_DFA_EDGE];
    return i === void 0 && (i = null), _i.debug && i !== null && console.log("reuse state " + e.stateNumber + " edge to " + i.stateNumber), i;
  }
  computeTargetState(e, n, i) {
    const o = new uA();
    return this.getReachableConfigSet(e, n.configs, o, i), o.items.length === 0 ? (o.hasSemanticContext || this.addDFAEdge(n, i, Sl.ERROR), Sl.ERROR) : this.addDFAEdge(n, i, null, o);
  }
  failOrAccept(e, n, i, o) {
    if (this.prevAccept.dfaState !== null) {
      const r = e.dfaState.lexerActionExecutor;
      return this.accept(n, r, this.startIndex, e.index, e.line, e.column), e.dfaState.prediction;
    }
    if (o === dt.EOF && n.index === this.startIndex) return dt.EOF;
    throw new Bk(this.recog, n, this.startIndex, i);
  }
  getReachableConfigSet(e, n, i, o) {
    let r = $i.INVALID_ALT_NUMBER;
    for (let a = 0; a < n.items.length; a++) {
      const l = n.items[a], s = l.alt === r;
      if (!s || !l.passedThroughNonGreedyDecision) {
        _i.debug && console.log(`testing %s at %s
`, this.getTokenName(o), l.toString(this.recog, !0));
        for (let u = 0; u < l.state.transitions.length; u++) {
          const c = l.state.transitions[u], d = this.getReachableTarget(c, o);
          if (d !== null) {
            let f = l.lexerActionExecutor;
            f !== null && (f = f.fixOffsetBeforeMatch(e.index - this.startIndex));
            const h = o === dt.EOF, p = new hr({ state: d, lexerActionExecutor: f }, l);
            this.closure(e, p, i, s, !0, h) && (r = l.alt);
          }
        }
      }
    }
  }
  accept(e, n, i, o, r, a) {
    _i.debug && console.log(`ACTION %s
`, n), e.seek(o), this.line = r, this.column = a, n !== null && this.recog !== null && n.execute(this.recog, e, i);
  }
  getReachableTarget(e, n) {
    return e.matches(n, 0, Ai.MAX_CHAR_VALUE) ? e.target : null;
  }
  computeStartState(e, n) {
    const i = cn.EMPTY, o = new uA();
    for (let r = 0; r < n.transitions.length; r++) {
      const a = n.transitions[r].target, l = new hr({ state: a, alt: r + 1, context: i }, null);
      this.closure(e, l, o, !1, !1, !1);
    }
    return o;
  }
  closure(e, n, i, o, r, a) {
    let l = null;
    if (_i.debug && console.log("closure(" + n.toString(this.recog, !0) + ")"), n.state instanceof ir) {
      if (_i.debug && (this.recog !== null ? console.log(`closure at %s rule stop %s
`, this.recog.ruleNames[n.state.ruleIndex], n) : console.log(`closure at rule stop %s
`, n)), n.context === null || n.context.hasEmptyPath()) {
        if (n.context === null || n.context.isEmpty()) return i.add(n), !0;
        i.add(new hr({ state: n.state, context: cn.EMPTY }, n)), o = !0;
      }
      if (n.context !== null && !n.context.isEmpty()) {
        for (let s = 0; s < n.context.length; s++) if (n.context.getReturnState(s) !== cn.EMPTY_RETURN_STATE) {
          const u = n.context.getParent(s), c = this.atn.states[n.context.getReturnState(s)];
          l = new hr({ state: c, context: u }, n), o = this.closure(e, l, i, o, r, a);
        }
      }
      return o;
    }
    n.state.epsilonOnlyTransitions || o && n.passedThroughNonGreedyDecision || i.add(n);
    for (let s = 0; s < n.state.transitions.length; s++) {
      const u = n.state.transitions[s];
      l = this.getEpsilonTarget(e, n, u, i, r, a), l !== null && (o = this.closure(e, l, i, o, r, a));
    }
    return o;
  }
  getEpsilonTarget(e, n, i, o, r, a) {
    let l = null;
    if (i.serializationType === At.RULE) {
      const s = Uo.create(n.context, i.followState.stateNumber);
      l = new hr({ state: i.target, context: s }, n);
    } else {
      if (i.serializationType === At.PRECEDENCE) throw "Precedence predicates are not supported in lexers.";
      if (i.serializationType === At.PREDICATE) _i.debug && console.log("EVAL rule " + i.ruleIndex + ":" + i.predIndex), o.hasSemanticContext = !0, this.evaluatePredicate(e, i.ruleIndex, i.predIndex, r) && (l = new hr({ state: i.target }, n));
      else if (i.serializationType === At.ACTION) if (n.context === null || n.context.hasEmptyPath()) {
        const s = ef.append(n.lexerActionExecutor, this.atn.lexerActions[i.actionIndex]);
        l = new hr({ state: i.target, lexerActionExecutor: s }, n);
      } else l = new hr({ state: i.target }, n);
      else i.serializationType === At.EPSILON ? l = new hr({ state: i.target }, n) : i.serializationType !== At.ATOM && i.serializationType !== At.RANGE && i.serializationType !== At.SET || a && i.matches(dt.EOF, 0, Ai.MAX_CHAR_VALUE) && (l = new hr({ state: i.target }, n));
    }
    return l;
  }
  evaluatePredicate(e, n, i, o) {
    if (this.recog === null) return !0;
    if (!o) return this.recog.sempred(null, n, i);
    const r = this.column, a = this.line, l = e.index, s = e.mark();
    try {
      return this.consume(e), this.recog.sempred(null, n, i);
    } finally {
      this.column = r, this.line = a, e.seek(l), e.release(s);
    }
  }
  captureSimState(e, n, i) {
    e.index = n.index, e.line = this.line, e.column = this.column, e.dfaState = i;
  }
  addDFAEdge(e, n, i, o) {
    if (i === void 0 && (i = null), o === void 0 && (o = null), i === null && o !== null) {
      const r = o.hasSemanticContext;
      if (o.hasSemanticContext = !1, i = this.addDFAState(o), r) return i;
    }
    return n < _i.MIN_DFA_EDGE || n > _i.MAX_DFA_EDGE || (_i.debug && console.log("EDGE " + e + " -> " + i + " upon " + n), e.edges === null && (e.edges = []), e.edges[n - _i.MIN_DFA_EDGE] = i), i;
  }
  addDFAState(e) {
    const n = new Cs(null, e);
    let i = null;
    for (let l = 0; l < e.items.length; l++) {
      const s = e.items[l];
      if (s.state instanceof ir) {
        i = s;
        break;
      }
    }
    i !== null && (n.isAcceptState = !0, n.lexerActionExecutor = i.lexerActionExecutor, n.prediction = this.atn.ruleToTokenType[i.state.ruleIndex]);
    const o = this.decisionToDFA[this.mode], r = o.states.get(n);
    if (r !== null) return r;
    const a = n;
    return a.stateNumber = o.states.length, e.setReadonly(!0), a.configs = e, o.states.add(a), a;
  }
  getDFA(e) {
    return this.decisionToDFA[e];
  }
  getText(e) {
    return e.getText(this.startIndex, e.index - 1);
  }
  consume(e) {
    e.LA(1) === 10 ? (this.line += 1, this.column = 0) : this.column += 1, e.consume();
  }
  getTokenName(e) {
    return e === -1 ? "EOF" : "'" + String.fromCharCode(e) + "'";
  }
}
_i.debug = !1, _i.dfa_debug = !1, _i.MIN_DFA_EDGE = 0, _i.MAX_DFA_EDGE = 127;
class O8 {
  constructor(e, n) {
    this.alt = n, this.pred = e;
  }
  toString() {
    return "(" + this.pred + ", " + this.alt + ")";
  }
}
class lwe {
  constructor() {
    this.data = {};
  }
  get(e) {
    return this.data["k-" + e] || null;
  }
  set(e, n) {
    this.data["k-" + e] = n;
  }
  values() {
    return Object.keys(this.data).filter(((e) => e.startsWith("k-"))).map(((e) => this.data[e]), this);
  }
}
const hl = { SLL: 0, LL: 1, LL_EXACT_AMBIG_DETECTION: 2, hasSLLConflictTerminatingPrediction: function(t, e) {
  if (hl.allConfigsInRuleStopStates(e)) return !0;
  if (t === hl.SLL && e.hasSemanticContext) {
    const i = new Go();
    for (let o = 0; o < e.items.length; o++) {
      let r = e.items[o];
      r = new Qi({ semanticContext: Hn.NONE }, r), i.add(r);
    }
    e = i;
  }
  const n = hl.getConflictingAltSubsets(e);
  return hl.hasConflictingAltSet(n) && !hl.hasStateAssociatedWithOneAlt(e);
}, hasConfigInRuleStopState: function(t) {
  for (let e = 0; e < t.items.length; e++) if (t.items[e].state instanceof ir) return !0;
  return !1;
}, allConfigsInRuleStopStates: function(t) {
  for (let e = 0; e < t.items.length; e++) if (!(t.items[e].state instanceof ir)) return !1;
  return !0;
}, resolvesToJustOneViableAlt: function(t) {
  return hl.getSingleViableAlt(t);
}, allSubsetsConflict: function(t) {
  return !hl.hasNonConflictingAltSet(t);
}, hasNonConflictingAltSet: function(t) {
  for (let e = 0; e < t.length; e++) if (t[e].length === 1) return !0;
  return !1;
}, hasConflictingAltSet: function(t) {
  for (let e = 0; e < t.length; e++) if (t[e].length > 1) return !0;
  return !1;
}, allSubsetsEqual: function(t) {
  let e = null;
  for (let n = 0; n < t.length; n++) {
    const i = t[n];
    if (e === null) e = i;
    else if (i !== e) return !1;
  }
  return !0;
}, getUniqueAlt: function(t) {
  const e = hl.getAlts(t);
  return e.length === 1 ? e.minValue() : $i.INVALID_ALT_NUMBER;
}, getAlts: function(t) {
  const e = new Jo();
  return t.map((function(n) {
    e.or(n);
  })), e;
}, getConflictingAltSubsets: function(t) {
  const e = new Ag();
  return e.hashFunction = function(n) {
    Vr.hashStuff(n.state.stateNumber, n.context);
  }, e.equalsFunction = function(n, i) {
    return n.state.stateNumber === i.state.stateNumber && n.context.equals(i.context);
  }, t.items.map((function(n) {
    let i = e.get(n);
    i === null && (i = new Jo(), e.set(n, i)), i.set(n.alt);
  })), e.getValues();
}, getStateToAltMap: function(t) {
  const e = new lwe();
  return t.items.map((function(n) {
    let i = e.get(n.state);
    i === null && (i = new Jo(), e.set(n.state, i)), i.set(n.alt);
  })), e;
}, hasStateAssociatedWithOneAlt: function(t) {
  const e = hl.getStateToAltMap(t).values();
  for (let n = 0; n < e.length; n++) if (e[n].length === 1) return !0;
  return !1;
}, getSingleViableAlt: function(t) {
  let e = null;
  for (let n = 0; n < t.length; n++) {
    const i = t[n].minValue();
    if (e === null) e = i;
    else if (e !== i) return $i.INVALID_ALT_NUMBER;
  }
  return e;
} }, ro = hl;
class Gy extends Qs {
  constructor(e, n, i, o, r, a) {
    a = a || e._ctx, o = o || e.getCurrentToken(), i = i || e.getCurrentToken(), n = n || e.getInputStream(), super({ message: "", recognizer: e, input: n, ctx: a }), this.deadEndConfigs = r, this.startToken = i, this.offendingToken = o;
  }
}
class swe {
  constructor(e) {
    this.defaultMapCtor = e || Ag, this.cacheMap = new this.defaultMapCtor();
  }
  get(e, n) {
    const i = this.cacheMap.get(e) || null;
    return i === null ? null : i.get(n) || null;
  }
  set(e, n, i) {
    let o = this.cacheMap.get(e) || null;
    o === null && (o = new this.defaultMapCtor(), this.cacheMap.set(e, o)), o.set(n, i);
  }
}
class S8 extends Sl {
  constructor(e, n, i, o) {
    super(n, o), this.parser = e, this.decisionToDFA = i, this.predictionMode = ro.LL, this._input = null, this._startIndex = 0, this._outerContext = null, this._dfa = null, this.mergeCache = null, this.debug = !1, this.debug_closure = !1, this.debug_add = !1, this.trace_atn_sim = !1, this.dfa_debug = !1, this.retry_debug = !1;
  }
  reset() {
  }
  adaptivePredict(e, n, i) {
    (this.debug || this.trace_atn_sim) && console.log("adaptivePredict decision " + n + " exec LA(1)==" + this.getLookaheadName(e) + " line " + e.LT(1).line + ":" + e.LT(1).column), this._input = e, this._startIndex = e.index, this._outerContext = i;
    const o = this.decisionToDFA[n];
    this._dfa = o;
    const r = e.mark(), a = e.index;
    try {
      let l;
      if (l = o.precedenceDfa ? o.getPrecedenceStartState(this.parser.getPrecedence()) : o.s0, l === null) {
        i === null && (i = ed.EMPTY), this.debug && console.log("predictATN decision " + o.decision + " exec LA(1)==" + this.getLookaheadName(e) + ", outerContext=" + i.toString(this.parser.ruleNames));
        let c = this.computeStartState(o.atnStartState, ed.EMPTY, !1);
        o.precedenceDfa ? (o.s0.configs = c, c = this.applyPrecedenceFilter(c), l = this.addDFAState(o, new Cs(null, c)), o.setPrecedenceStartState(this.parser.getPrecedence(), l)) : (l = this.addDFAState(o, new Cs(null, c)), o.s0 = l);
      }
      const s = this.execATN(o, l, e, a, i);
      return this.debug && console.log("DFA after predictATN: " + o.toString(this.parser.literalNames, this.parser.symbolicNames)), s;
    } finally {
      this._dfa = null, this.mergeCache = null, e.seek(a), e.release(r);
    }
  }
  execATN(e, n, i, o, r) {
    let a;
    (this.debug || this.trace_atn_sim) && console.log("execATN decision " + e.decision + ", DFA state " + n + ", LA(1)==" + this.getLookaheadName(i) + " line " + i.LT(1).line + ":" + i.LT(1).column);
    let l = n;
    this.debug && console.log("s0 = " + n);
    let s = i.LA(1);
    for (; ; ) {
      let u = this.getExistingTargetState(l, s);
      if (u === null && (u = this.computeTargetState(e, l, s)), u === Sl.ERROR) {
        const c = this.noViableAlt(i, r, l.configs, o);
        if (i.seek(o), a = this.getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(l.configs, r), a !== $i.INVALID_ALT_NUMBER) return a;
        throw c;
      }
      if (u.requiresFullContext && this.predictionMode !== ro.SLL) {
        let c = null;
        if (u.predicates !== null) {
          this.debug && console.log("DFA state has preds in DFA sim LL failover");
          const h = i.index;
          if (h !== o && i.seek(o), c = this.evalSemanticContext(u.predicates, r, !0), c.length === 1) return this.debug && console.log("Full LL avoided"), c.minValue();
          h !== o && i.seek(h);
        }
        this.dfa_debug && console.log("ctx sensitive state " + r + " in " + u);
        const d = !0, f = this.computeStartState(e.atnStartState, r, d);
        return this.reportAttemptingFullContext(e, c, u.configs, o, i.index), a = this.execATNWithFullContext(e, u, f, i, o, r), a;
      }
      if (u.isAcceptState) {
        if (u.predicates === null) return u.prediction;
        const c = i.index;
        i.seek(o);
        const d = this.evalSemanticContext(u.predicates, r, !0);
        if (d.length === 0) throw this.noViableAlt(i, r, u.configs, o);
        return d.length === 1 || this.reportAmbiguity(e, u, o, c, !1, d, u.configs), d.minValue();
      }
      l = u, s !== dt.EOF && (i.consume(), s = i.LA(1));
    }
  }
  getExistingTargetState(e, n) {
    const i = e.edges;
    return i === null ? null : i[n + 1] || null;
  }
  computeTargetState(e, n, i) {
    const o = this.computeReachSet(n.configs, i, !1);
    if (o === null) return this.addDFAEdge(e, n, i, Sl.ERROR), Sl.ERROR;
    let r = new Cs(null, o);
    const a = this.getUniqueAlt(o);
    if (this.debug) {
      const l = ro.getConflictingAltSubsets(o);
      console.log("SLL altSubSets=" + ps(l) + ", configs=" + o + ", predict=" + a + ", allSubsetsConflict=" + ro.allSubsetsConflict(l) + ", conflictingAlts=" + this.getConflictingAlts(o));
    }
    return a !== $i.INVALID_ALT_NUMBER ? (r.isAcceptState = !0, r.configs.uniqueAlt = a, r.prediction = a) : ro.hasSLLConflictTerminatingPrediction(this.predictionMode, o) && (r.configs.conflictingAlts = this.getConflictingAlts(o), r.requiresFullContext = !0, r.isAcceptState = !0, r.prediction = r.configs.conflictingAlts.minValue()), r.isAcceptState && r.configs.hasSemanticContext && (this.predicateDFAState(r, this.atn.getDecisionState(e.decision)), r.predicates !== null && (r.prediction = $i.INVALID_ALT_NUMBER)), r = this.addDFAEdge(e, n, i, r), r;
  }
  predicateDFAState(e, n) {
    const i = n.transitions.length, o = this.getConflictingAltsOrUniqueAlt(e.configs), r = this.getPredsForAmbigAlts(o, e.configs, i);
    r !== null ? (e.predicates = this.getPredicatePredictions(o, r), e.prediction = $i.INVALID_ALT_NUMBER) : e.prediction = o.minValue();
  }
  execATNWithFullContext(e, n, i, o, r, a) {
    (this.debug || this.trace_atn_sim) && console.log("execATNWithFullContext " + i);
    let l, s = !1, u = i;
    o.seek(r);
    let c = o.LA(1), d = -1;
    for (; ; ) {
      if (l = this.computeReachSet(u, c, !0), l === null) {
        const h = this.noViableAlt(o, a, u, r);
        o.seek(r);
        const p = this.getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(u, a);
        if (p !== $i.INVALID_ALT_NUMBER) return p;
        throw h;
      }
      const f = ro.getConflictingAltSubsets(l);
      if (this.debug && console.log("LL altSubSets=" + f + ", predict=" + ro.getUniqueAlt(f) + ", resolvesToJustOneViableAlt=" + ro.resolvesToJustOneViableAlt(f)), l.uniqueAlt = this.getUniqueAlt(l), l.uniqueAlt !== $i.INVALID_ALT_NUMBER) {
        d = l.uniqueAlt;
        break;
      }
      if (this.predictionMode !== ro.LL_EXACT_AMBIG_DETECTION) {
        if (d = ro.resolvesToJustOneViableAlt(f), d !== $i.INVALID_ALT_NUMBER) break;
      } else if (ro.allSubsetsConflict(f) && ro.allSubsetsEqual(f)) {
        s = !0, d = ro.getSingleViableAlt(f);
        break;
      }
      u = l, c !== dt.EOF && (o.consume(), c = o.LA(1));
    }
    return l.uniqueAlt !== $i.INVALID_ALT_NUMBER ? (this.reportContextSensitivity(e, d, l, r, o.index), d) : (this.reportAmbiguity(e, n, r, o.index, s, null, l), d);
  }
  computeReachSet(e, n, i) {
    this.debug && console.log("in computeReachSet, starting closure: " + e), this.mergeCache === null && (this.mergeCache = new swe());
    const o = new Go(i);
    let r = null;
    for (let l = 0; l < e.items.length; l++) {
      const s = e.items[l];
      if (this.debug && console.log("testing " + this.getTokenName(n) + " at " + s), s.state instanceof ir) (i || n === dt.EOF) && (r === null && (r = []), r.push(s), this.debug_add && console.log("added " + s + " to skippedStopStates"));
      else for (let u = 0; u < s.state.transitions.length; u++) {
        const c = s.state.transitions[u], d = this.getReachableTarget(c, n);
        if (d !== null) {
          const f = new Qi({ state: d }, s);
          o.add(f, this.mergeCache), this.debug_add && console.log("added " + f + " to intermediate");
        }
      }
    }
    let a = null;
    if (r === null && n !== dt.EOF && (o.items.length === 1 || this.getUniqueAlt(o) !== $i.INVALID_ALT_NUMBER) && (a = o), a === null) {
      a = new Go(i);
      const l = new Lr(), s = n === dt.EOF;
      for (let u = 0; u < o.items.length; u++) this.closure(o.items[u], a, l, !1, i, s);
    }
    if (n === dt.EOF && (a = this.removeAllConfigsNotInRuleStopState(a, a === o)), !(r === null || i && ro.hasConfigInRuleStopState(a))) for (let l = 0; l < r.length; l++) a.add(r[l], this.mergeCache);
    return this.trace_atn_sim && console.log("computeReachSet " + e + " -> " + a), a.items.length === 0 ? null : a;
  }
  removeAllConfigsNotInRuleStopState(e, n) {
    if (ro.allConfigsInRuleStopStates(e)) return e;
    const i = new Go(e.fullCtx);
    for (let o = 0; o < e.items.length; o++) {
      const r = e.items[o];
      if (r.state instanceof ir) i.add(r, this.mergeCache);
      else if (n && r.state.epsilonOnlyTransitions && this.atn.nextTokens(r.state).contains(dt.EPSILON)) {
        const a = this.atn.ruleToStopState[r.state.ruleIndex];
        i.add(new Qi({ state: a }, r), this.mergeCache);
      }
    }
    return i;
  }
  computeStartState(e, n, i) {
    const o = Mk(this.atn, n), r = new Go(i);
    this.trace_atn_sim && console.log("computeStartState from ATN state " + e + " initialContext=" + o.toString(this.parser));
    for (let a = 0; a < e.transitions.length; a++) {
      const l = e.transitions[a].target, s = new Qi({ state: l, alt: a + 1, context: o }, null), u = new Lr();
      this.closure(s, r, u, !0, i, !1);
    }
    return r;
  }
  applyPrecedenceFilter(e) {
    let n;
    const i = [], o = new Go(e.fullCtx);
    for (let r = 0; r < e.items.length; r++) {
      if (n = e.items[r], n.alt !== 1) continue;
      const a = n.semanticContext.evalPrecedence(this.parser, this._outerContext);
      a !== null && (i[n.state.stateNumber] = n.context, a !== n.semanticContext ? o.add(new Qi({ semanticContext: a }, n), this.mergeCache) : o.add(n, this.mergeCache));
    }
    for (let r = 0; r < e.items.length; r++) if (n = e.items[r], n.alt !== 1) {
      if (!n.precedenceFilterSuppressed) {
        const a = i[n.state.stateNumber] || null;
        if (a !== null && a.equals(n.context)) continue;
      }
      o.add(n, this.mergeCache);
    }
    return o;
  }
  getReachableTarget(e, n) {
    return e.matches(n, 0, this.atn.maxTokenType) ? e.target : null;
  }
  getPredsForAmbigAlts(e, n, i) {
    let o = [];
    for (let a = 0; a < n.items.length; a++) {
      const l = n.items[a];
      e.get(l.alt) && (o[l.alt] = Hn.orContext(o[l.alt] || null, l.semanticContext));
    }
    let r = 0;
    for (let a = 1; a < i + 1; a++) {
      const l = o[a] || null;
      l === null ? o[a] = Hn.NONE : l !== Hn.NONE && (r += 1);
    }
    return r === 0 && (o = null), this.debug && console.log("getPredsForAmbigAlts result " + ps(o)), o;
  }
  getPredicatePredictions(e, n) {
    const i = [];
    let o = !1;
    for (let r = 1; r < n.length; r++) {
      const a = n[r];
      e !== null && e.get(r) && i.push(new O8(a, r)), a !== Hn.NONE && (o = !0);
    }
    return o ? i : null;
  }
  getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(e, n) {
    const i = this.splitAccordingToSemanticValidity(e, n), o = i[0], r = i[1];
    let a = this.getAltThatFinishedDecisionEntryRule(o);
    return a !== $i.INVALID_ALT_NUMBER || r.items.length > 0 && (a = this.getAltThatFinishedDecisionEntryRule(r), a !== $i.INVALID_ALT_NUMBER) ? a : $i.INVALID_ALT_NUMBER;
  }
  getAltThatFinishedDecisionEntryRule(e) {
    const n = [];
    for (let i = 0; i < e.items.length; i++) {
      const o = e.items[i];
      (o.reachesIntoOuterContext > 0 || o.state instanceof ir && o.context.hasEmptyPath()) && n.indexOf(o.alt) < 0 && n.push(o.alt);
    }
    return n.length === 0 ? $i.INVALID_ALT_NUMBER : Math.min.apply(null, n);
  }
  splitAccordingToSemanticValidity(e, n) {
    const i = new Go(e.fullCtx), o = new Go(e.fullCtx);
    for (let r = 0; r < e.items.length; r++) {
      const a = e.items[r];
      a.semanticContext !== Hn.NONE ? a.semanticContext.evaluate(this.parser, n) ? i.add(a) : o.add(a) : i.add(a);
    }
    return [i, o];
  }
  evalSemanticContext(e, n, i) {
    const o = new Jo();
    for (let r = 0; r < e.length; r++) {
      const a = e[r];
      if (a.pred === Hn.NONE) {
        if (o.set(a.alt), !i) break;
        continue;
      }
      const l = a.pred.evaluate(this.parser, n);
      if ((this.debug || this.dfa_debug) && console.log("eval pred " + a + "=" + l), l && ((this.debug || this.dfa_debug) && console.log("PREDICT " + a.alt), o.set(a.alt), !i)) break;
    }
    return o;
  }
  closure(e, n, i, o, r, a) {
    this.closureCheckingStopState(e, n, i, o, r, 0, a);
  }
  closureCheckingStopState(e, n, i, o, r, a, l) {
    if ((this.trace_atn_sim || this.debug_closure) && console.log("closure(" + e.toString(this.parser, !0) + ")"), e.state instanceof ir) {
      if (!e.context.isEmpty()) {
        for (let s = 0; s < e.context.length; s++) {
          if (e.context.getReturnState(s) === cn.EMPTY_RETURN_STATE) {
            if (r) {
              n.add(new Qi({ state: e.state, context: cn.EMPTY }, e), this.mergeCache);
              continue;
            }
            this.debug && console.log("FALLING off rule " + this.getRuleName(e.state.ruleIndex)), this.closure_(e, n, i, o, r, a, l);
            continue;
          }
          const u = this.atn.states[e.context.getReturnState(s)], c = e.context.getParent(s), d = { state: u, alt: e.alt, context: c, semanticContext: e.semanticContext }, f = new Qi(d, null);
          f.reachesIntoOuterContext = e.reachesIntoOuterContext, this.closureCheckingStopState(f, n, i, o, r, a - 1, l);
        }
        return;
      }
      if (r) return void n.add(e, this.mergeCache);
      this.debug && console.log("FALLING off rule " + this.getRuleName(e.state.ruleIndex));
    }
    this.closure_(e, n, i, o, r, a, l);
  }
  closure_(e, n, i, o, r, a, l) {
    const s = e.state;
    s.epsilonOnlyTransitions || n.add(e, this.mergeCache);
    for (let u = 0; u < s.transitions.length; u++) {
      if (u === 0 && this.canDropLoopEntryEdgeInLeftRecursiveRule(e)) continue;
      const c = s.transitions[u], d = o && !(c instanceof b8), f = this.getEpsilonTarget(e, c, d, a === 0, r, l);
      if (f !== null) {
        let h = a;
        if (e.state instanceof ir) {
          if (this._dfa !== null && this._dfa.precedenceDfa && c.outermostPrecedenceReturn === this._dfa.atnStartState.ruleIndex && (f.precedenceFilterSuppressed = !0), f.reachesIntoOuterContext += 1, i.getOrAdd(f) !== f) continue;
          n.dipsIntoOuterContext = !0, h -= 1, this.debug && console.log("dips into outer ctx: " + f);
        } else {
          if (!c.isEpsilon && i.getOrAdd(f) !== f) continue;
          c instanceof I0 && h >= 0 && (h += 1);
        }
        this.closureCheckingStopState(f, n, i, d, r, h, l);
      }
    }
  }
  canDropLoopEntryEdgeInLeftRecursiveRule(e) {
    const n = e.state;
    if (n.stateType !== Rt.STAR_LOOP_ENTRY || n.stateType !== Rt.STAR_LOOP_ENTRY || !n.isPrecedenceDecision || e.context.isEmpty() || e.context.hasEmptyPath()) return !1;
    const i = e.context.length;
    for (let a = 0; a < i; a++) if (this.atn.states[e.context.getReturnState(a)].ruleIndex !== n.ruleIndex) return !1;
    const o = n.transitions[0].target.endState.stateNumber, r = this.atn.states[o];
    for (let a = 0; a < i; a++) {
      const l = e.context.getReturnState(a), s = this.atn.states[l];
      if (s.transitions.length !== 1 || !s.transitions[0].isEpsilon) return !1;
      const u = s.transitions[0].target;
      if (!(s.stateType === Rt.BLOCK_END && u === n || s === r || u === r || u.stateType === Rt.BLOCK_END && u.transitions.length === 1 && u.transitions[0].isEpsilon && u.transitions[0].target === n)) return !1;
    }
    return !0;
  }
  getRuleName(e) {
    return this.parser !== null && e >= 0 ? this.parser.ruleNames[e] : "<rule " + e + ">";
  }
  getEpsilonTarget(e, n, i, o, r, a) {
    switch (n.serializationType) {
      case At.RULE:
        return this.ruleTransition(e, n);
      case At.PRECEDENCE:
        return this.precedenceTransition(e, n, i, o, r);
      case At.PREDICATE:
        return this.predTransition(e, n, i, o, r);
      case At.ACTION:
        return this.actionTransition(e, n);
      case At.EPSILON:
        return new Qi({ state: n.target }, e);
      case At.ATOM:
      case At.RANGE:
      case At.SET:
        return a && n.matches(dt.EOF, 0, 1) ? new Qi({ state: n.target }, e) : null;
      default:
        return null;
    }
  }
  actionTransition(e, n) {
    if (this.debug) {
      const i = n.actionIndex === -1 ? 65535 : n.actionIndex;
      console.log("ACTION edge " + n.ruleIndex + ":" + i);
    }
    return new Qi({ state: n.target }, e);
  }
  precedenceTransition(e, n, i, o, r) {
    this.debug && (console.log("PRED (collectPredicates=" + i + ") " + n.precedence + ">=_p, ctx dependent=true"), this.parser !== null && console.log("context surrounding pred is " + ps(this.parser.getRuleInvocationStack())));
    let a = null;
    if (i && o) if (r) {
      const l = this._input.index;
      this._input.seek(this._startIndex);
      const s = n.getPredicate().evaluate(this.parser, this._outerContext);
      this._input.seek(l), s && (a = new Qi({ state: n.target }, e));
    } else {
      const l = Hn.andContext(e.semanticContext, n.getPredicate());
      a = new Qi({ state: n.target, semanticContext: l }, e);
    }
    else a = new Qi({ state: n.target }, e);
    return this.debug && console.log("config from pred transition=" + a), a;
  }
  predTransition(e, n, i, o, r) {
    this.debug && (console.log("PRED (collectPredicates=" + i + ") " + n.ruleIndex + ":" + n.predIndex + ", ctx dependent=" + n.isCtxDependent), this.parser !== null && console.log("context surrounding pred is " + ps(this.parser.getRuleInvocationStack())));
    let a = null;
    if (i && (n.isCtxDependent && o || !n.isCtxDependent)) if (r) {
      const l = this._input.index;
      this._input.seek(this._startIndex);
      const s = n.getPredicate().evaluate(this.parser, this._outerContext);
      this._input.seek(l), s && (a = new Qi({ state: n.target }, e));
    } else {
      const l = Hn.andContext(e.semanticContext, n.getPredicate());
      a = new Qi({ state: n.target, semanticContext: l }, e);
    }
    else a = new Qi({ state: n.target }, e);
    return this.debug && console.log("config from pred transition=" + a), a;
  }
  ruleTransition(e, n) {
    this.debug && console.log("CALL rule " + this.getRuleName(n.target.ruleIndex) + ", ctx=" + e.context);
    const i = n.followState, o = Uo.create(e.context, i.stateNumber);
    return new Qi({ state: n.target, context: o }, e);
  }
  getConflictingAlts(e) {
    const n = ro.getConflictingAltSubsets(e);
    return ro.getAlts(n);
  }
  getConflictingAltsOrUniqueAlt(e) {
    let n = null;
    return e.uniqueAlt !== $i.INVALID_ALT_NUMBER ? (n = new Jo(), n.set(e.uniqueAlt)) : n = e.conflictingAlts, n;
  }
  getTokenName(e) {
    if (e === dt.EOF) return "EOF";
    if (this.parser !== null && this.parser.literalNames !== null) {
      if (!(e >= this.parser.literalNames.length && e >= this.parser.symbolicNames.length)) return (this.parser.literalNames[e] || this.parser.symbolicNames[e]) + "<" + e + ">";
      console.log(e + " ttype out of range: " + this.parser.literalNames), console.log("" + this.parser.getInputStream().getTokens());
    }
    return "" + e;
  }
  getLookaheadName(e) {
    return this.getTokenName(e.LA(1));
  }
  dumpDeadEndConfigs(e) {
    console.log("dead end configs: ");
    const n = e.getDeadEndConfigs();
    for (let i = 0; i < n.length; i++) {
      const o = n[i];
      let r = "no edges";
      if (o.state.transitions.length > 0) {
        const a = o.state.transitions[0];
        a instanceof rw ? r = "Atom " + this.getTokenName(a.label) : a instanceof Ek && (r = (a instanceof _k ? "~" : "") + "Set " + a.set);
      }
      console.error(o.toString(this.parser, !0) + ":" + r);
    }
  }
  noViableAlt(e, n, i, o) {
    return new Gy(this.parser, e, e.get(o), e.LT(1), i, n);
  }
  getUniqueAlt(e) {
    let n = $i.INVALID_ALT_NUMBER;
    for (let i = 0; i < e.items.length; i++) {
      const o = e.items[i];
      if (n === $i.INVALID_ALT_NUMBER) n = o.alt;
      else if (o.alt !== n) return $i.INVALID_ALT_NUMBER;
    }
    return n;
  }
  addDFAEdge(e, n, i, o) {
    if (this.debug && console.log("EDGE " + n + " -> " + o + " upon " + this.getTokenName(i)), o === null) return null;
    if (o = this.addDFAState(e, o), n === null || i < -1 || i > this.atn.maxTokenType) return o;
    if (n.edges === null && (n.edges = []), n.edges[i + 1] = o, this.debug) {
      const r = this.parser === null ? null : this.parser.literalNames, a = this.parser === null ? null : this.parser.symbolicNames;
      console.log(`DFA=
` + e.toString(r, a));
    }
    return o;
  }
  addDFAState(e, n) {
    if (n === Sl.ERROR) return n;
    const i = e.states.get(n);
    return i !== null ? (this.trace_atn_sim && console.log("addDFAState " + n + " exists"), i) : (n.stateNumber = e.states.length, n.configs.readOnly || (n.configs.optimizeConfigs(this), n.configs.setReadonly(!0)), this.trace_atn_sim && console.log("addDFAState new " + n), e.states.add(n), this.debug && console.log("adding new DFA state: " + n), n);
  }
  reportAttemptingFullContext(e, n, i, o, r) {
    if (this.debug || this.retry_debug) {
      const a = new Cn(o, r + 1);
      console.log("reportAttemptingFullContext decision=" + e.decision + ":" + i + ", input=" + this.parser.getTokenStream().getText(a));
    }
    this.parser !== null && this.parser.getErrorListener().reportAttemptingFullContext(this.parser, e, o, r, n, i);
  }
  reportContextSensitivity(e, n, i, o, r) {
    if (this.debug || this.retry_debug) {
      const a = new Cn(o, r + 1);
      console.log("reportContextSensitivity decision=" + e.decision + ":" + i + ", input=" + this.parser.getTokenStream().getText(a));
    }
    this.parser !== null && this.parser.getErrorListener().reportContextSensitivity(this.parser, e, o, r, n, i);
  }
  reportAmbiguity(e, n, i, o, r, a, l) {
    if (this.debug || this.retry_debug) {
      const s = new Cn(i, o + 1);
      console.log("reportAmbiguity " + a + ":" + l + ", input=" + this.parser.getTokenStream().getText(s));
    }
    this.parser !== null && this.parser.getErrorListener().reportAmbiguity(this.parser, e, i, o, r, a, l);
  }
}
class w8 {
  constructor() {
    this.cache = new Ag();
  }
  add(e) {
    if (e === cn.EMPTY) return cn.EMPTY;
    const n = this.cache.get(e) || null;
    return n !== null ? n : (this.cache.set(e, e), e);
  }
  get(e) {
    return this.cache.get(e) || null;
  }
  get length() {
    return this.cache.length;
  }
}
const uwe = { ATN: $i, ATNDeserializer: zk, LexerATNSimulator: _i, ParserATNSimulator: S8, PredictionMode: ro, PredictionContextCache: w8 };
class Fk {
  constructor(e, n, i) {
    this.dfa = e, this.literalNames = n || [], this.symbolicNames = i || [];
  }
  toString() {
    if (this.dfa.s0 === null) return null;
    let e = "";
    const n = this.dfa.sortedStates();
    for (let i = 0; i < n.length; i++) {
      const o = n[i];
      if (o.edges !== null) {
        const r = o.edges.length;
        for (let a = 0; a < r; a++) {
          const l = o.edges[a] || null;
          l !== null && l.stateNumber !== 2147483647 && (e = e.concat(this.getStateString(o)), e = e.concat("-"), e = e.concat(this.getEdgeLabel(a)), e = e.concat("->"), e = e.concat(this.getStateString(l)), e = e.concat(`
`));
        }
      }
    }
    return e.length === 0 ? null : e;
  }
  getEdgeLabel(e) {
    return e === 0 ? "EOF" : this.literalNames !== null || this.symbolicNames !== null ? this.literalNames[e - 1] || this.symbolicNames[e - 1] : String.fromCharCode(e - 1);
  }
  getStateString(e) {
    const n = (e.isAcceptState ? ":" : "") + "s" + e.stateNumber + (e.requiresFullContext ? "^" : "");
    return e.isAcceptState ? e.predicates !== null ? n + "=>" + ps(e.predicates) : n + "=>" + e.prediction.toString() : n;
  }
}
class C8 extends Fk {
  constructor(e) {
    super(e, null);
  }
  getEdgeLabel(e) {
    return "'" + String.fromCharCode(e) + "'";
  }
}
class $8 {
  constructor(e, n) {
    if (n === void 0 && (n = 0), this.atnStartState = e, this.decision = n, this._states = new Lr(), this.s0 = null, this.precedenceDfa = !1, e instanceof mc && e.isPrecedenceDecision) {
      this.precedenceDfa = !0;
      const i = new Cs(null, new Go());
      i.edges = [], i.isAcceptState = !1, i.requiresFullContext = !1, this.s0 = i;
    }
  }
  getPrecedenceStartState(e) {
    if (!this.precedenceDfa) throw "Only precedence DFAs may contain a precedence start state.";
    return e < 0 || e >= this.s0.edges.length ? null : this.s0.edges[e] || null;
  }
  setPrecedenceStartState(e, n) {
    if (!this.precedenceDfa) throw "Only precedence DFAs may contain a precedence start state.";
    e < 0 || (this.s0.edges[e] = n);
  }
  setPrecedenceDfa(e) {
    if (this.precedenceDfa !== e) {
      if (this._states = new Lr(), e) {
        const n = new Cs(null, new Go());
        n.edges = [], n.isAcceptState = !1, n.requiresFullContext = !1, this.s0 = n;
      } else this.s0 = null;
      this.precedenceDfa = e;
    }
  }
  sortedStates() {
    return this._states.values().sort((function(e, n) {
      return e.stateNumber - n.stateNumber;
    }));
  }
  toString(e, n) {
    return e = e || null, n = n || null, this.s0 === null ? "" : new Fk(this, e, n).toString();
  }
  toLexerString() {
    return this.s0 === null ? "" : new C8(this).toString();
  }
  get states() {
    return this._states;
  }
}
const cwe = { DFA: $8, DFASerializer: Fk, LexerDFASerializer: C8, PredPrediction: O8 }, dwe = { PredictionContext: cn }, fwe = { Interval: Cn, IntervalSet: wr };
class Vk {
  visitTerminal(e) {
  }
  visitErrorNode(e) {
  }
  enterEveryRule(e) {
  }
  exitEveryRule(e) {
  }
}
class k8 {
  visit(e) {
    return Array.isArray(e) ? e.map((function(n) {
      return n.accept(this);
    }), this) : e.accept(this);
  }
  visitChildren(e) {
    return e.children ? this.visit(e.children) : null;
  }
  visitTerminal(e) {
  }
  visitErrorNode(e) {
  }
}
class A0 {
  walk(e, n) {
    if (n instanceof Ky || n.isErrorNode !== void 0 && n.isErrorNode()) e.visitErrorNode(n);
    else if (n instanceof Al) e.visitTerminal(n);
    else {
      this.enterRule(e, n);
      for (let i = 0; i < n.getChildCount(); i++) {
        const o = n.getChild(i);
        this.walk(e, o);
      }
      this.exitRule(e, n);
    }
  }
  enterRule(e, n) {
    const i = n.ruleContext;
    e.enterEveryRule(i), i.enterRule(e);
  }
  exitRule(e, n) {
    const i = n.ruleContext;
    i.exitRule(e), e.exitEveryRule(i);
  }
}
A0.DEFAULT = new A0();
const hwe = { Trees: v8, RuleNode: ig, ErrorNode: Ky, TerminalNode: Al, ParseTreeListener: Vk, ParseTreeVisitor: k8, ParseTreeWalker: A0 };
class wf extends Qs {
  constructor(e) {
    super({ message: "", recognizer: e, input: e.getInputStream(), ctx: e._ctx }), this.offendingToken = e.getCurrentToken();
  }
}
class Qk extends Qs {
  constructor(e, n, i) {
    super({ message: pwe(n, i || null), recognizer: e, input: e.getInputStream(), ctx: e._ctx });
    const o = e._interp.atn.states[e.state].transitions[0];
    o instanceof x8 ? (this.ruleIndex = o.ruleIndex, this.predicateIndex = o.predIndex) : (this.ruleIndex = 0, this.predicateIndex = 0), this.predicate = n, this.offendingToken = e.getCurrentToken();
  }
}
function pwe(t, e) {
  return e !== null ? e : "failed predicate: {" + t + "}?";
}
class T8 extends Rg {
  constructor(e) {
    super(), e = e || !0, this.exactOnly = e;
  }
  reportAmbiguity(e, n, i, o, r, a, l) {
    if (this.exactOnly && !r) return;
    const s = "reportAmbiguity d=" + this.getDecisionDescription(e, n) + ": ambigAlts=" + this.getConflictingAlts(a, l) + ", input='" + e.getTokenStream().getText(new Cn(i, o)) + "'";
    e.notifyErrorListeners(s);
  }
  reportAttemptingFullContext(e, n, i, o, r, a) {
    const l = "reportAttemptingFullContext d=" + this.getDecisionDescription(e, n) + ", input='" + e.getTokenStream().getText(new Cn(i, o)) + "'";
    e.notifyErrorListeners(l);
  }
  reportContextSensitivity(e, n, i, o, r, a) {
    const l = "reportContextSensitivity d=" + this.getDecisionDescription(e, n) + ", input='" + e.getTokenStream().getText(new Cn(i, o)) + "'";
    e.notifyErrorListeners(l);
  }
  getDecisionDescription(e, n) {
    const i = n.decision, o = n.atnStartState.ruleIndex, r = e.ruleNames;
    if (o < 0 || o >= r.length) return "" + i;
    const a = r[o] || null;
    return a === null || a.length === 0 ? "" + i : `${i} (${a})`;
  }
  getConflictingAlts(e, n) {
    if (e !== null) return e;
    const i = new Jo();
    for (let o = 0; o < n.items.length; o++) i.set(n.items[o].alt);
    return `{${i.values().join(", ")}}`;
  }
}
class Hk extends Error {
  constructor() {
    super(), Error.captureStackTrace(this, Hk);
  }
}
class gwe {
  reset(e) {
  }
  recoverInline(e) {
  }
  recover(e, n) {
  }
  sync(e) {
  }
  inErrorRecoveryMode(e) {
  }
  reportError(e) {
  }
}
class Uy extends gwe {
  constructor() {
    super(), this.errorRecoveryMode = !1, this.lastErrorIndex = -1, this.lastErrorStates = null, this.nextTokensContext = null, this.nextTokenState = 0;
  }
  reset(e) {
    this.endErrorCondition(e);
  }
  beginErrorCondition(e) {
    this.errorRecoveryMode = !0;
  }
  inErrorRecoveryMode(e) {
    return this.errorRecoveryMode;
  }
  endErrorCondition(e) {
    this.errorRecoveryMode = !1, this.lastErrorStates = null, this.lastErrorIndex = -1;
  }
  reportMatch(e) {
    this.endErrorCondition(e);
  }
  reportError(e, n) {
    this.inErrorRecoveryMode(e) || (this.beginErrorCondition(e), n instanceof Gy ? this.reportNoViableAlternative(e, n) : n instanceof wf ? this.reportInputMismatch(e, n) : n instanceof Qk ? this.reportFailedPredicate(e, n) : (console.log("unknown recognition error type: " + n.constructor.name), console.log(n.stack), e.notifyErrorListeners(n.getOffendingToken(), n.getMessage(), n)));
  }
  recover(e, n) {
    this.lastErrorIndex === e.getInputStream().index && this.lastErrorStates !== null && this.lastErrorStates.indexOf(e.state) >= 0 && e.consume(), this.lastErrorIndex = e._input.index, this.lastErrorStates === null && (this.lastErrorStates = []), this.lastErrorStates.push(e.state);
    const i = this.getErrorRecoverySet(e);
    this.consumeUntil(e, i);
  }
  sync(e) {
    if (this.inErrorRecoveryMode(e)) return;
    const n = e._interp.atn.states[e.state], i = e.getTokenStream().LA(1), o = e.atn.nextTokens(n);
    if (o.contains(i)) return this.nextTokensContext = null, void (this.nextTokenState = Rt.INVALID_STATE_NUMBER);
    if (o.contains(dt.EPSILON)) this.nextTokensContext === null && (this.nextTokensContext = e._ctx, this.nextTokensState = e._stateNumber);
    else switch (n.stateType) {
      case Rt.BLOCK_START:
      case Rt.STAR_BLOCK_START:
      case Rt.PLUS_BLOCK_START:
      case Rt.STAR_LOOP_ENTRY:
        if (this.singleTokenDeletion(e) !== null) return;
        throw new wf(e);
      case Rt.PLUS_LOOP_BACK:
      case Rt.STAR_LOOP_BACK: {
        this.reportUnwantedToken(e);
        const r = new wr();
        r.addSet(e.getExpectedTokens());
        const a = r.addSet(this.getErrorRecoverySet(e));
        this.consumeUntil(e, a);
      }
    }
  }
  reportNoViableAlternative(e, n) {
    const i = e.getTokenStream();
    let o;
    o = i !== null ? n.startToken.type === dt.EOF ? "<EOF>" : i.getText(new Cn(n.startToken.tokenIndex, n.offendingToken.tokenIndex)) : "<unknown input>";
    const r = "no viable alternative at input " + this.escapeWSAndQuote(o);
    e.notifyErrorListeners(r, n.offendingToken, n);
  }
  reportInputMismatch(e, n) {
    const i = "mismatched input " + this.getTokenErrorDisplay(n.offendingToken) + " expecting " + n.getExpectedTokens().toString(e.literalNames, e.symbolicNames);
    e.notifyErrorListeners(i, n.offendingToken, n);
  }
  reportFailedPredicate(e, n) {
    const i = "rule " + e.ruleNames[e._ctx.ruleIndex] + " " + n.message;
    e.notifyErrorListeners(i, n.offendingToken, n);
  }
  reportUnwantedToken(e) {
    if (this.inErrorRecoveryMode(e)) return;
    this.beginErrorCondition(e);
    const n = e.getCurrentToken(), i = "extraneous input " + this.getTokenErrorDisplay(n) + " expecting " + this.getExpectedTokens(e).toString(e.literalNames, e.symbolicNames);
    e.notifyErrorListeners(i, n, null);
  }
  reportMissingToken(e) {
    if (this.inErrorRecoveryMode(e)) return;
    this.beginErrorCondition(e);
    const n = e.getCurrentToken(), i = "missing " + this.getExpectedTokens(e).toString(e.literalNames, e.symbolicNames) + " at " + this.getTokenErrorDisplay(n);
    e.notifyErrorListeners(i, n, null);
  }
  recoverInline(e) {
    const n = this.singleTokenDeletion(e);
    if (n !== null) return e.consume(), n;
    if (this.singleTokenInsertion(e)) return this.getMissingSymbol(e);
    throw new wf(e);
  }
  singleTokenInsertion(e) {
    const n = e.getTokenStream().LA(1), i = e._interp.atn, o = i.states[e.state].transitions[0].target;
    return !!i.nextTokens(o, e._ctx).contains(n) && (this.reportMissingToken(e), !0);
  }
  singleTokenDeletion(e) {
    const n = e.getTokenStream().LA(2);
    if (this.getExpectedTokens(e).contains(n)) {
      this.reportUnwantedToken(e), e.consume();
      const i = e.getCurrentToken();
      return this.reportMatch(e), i;
    }
    return null;
  }
  getMissingSymbol(e) {
    const n = e.getCurrentToken(), i = this.getExpectedTokens(e).first();
    let o;
    o = i === dt.EOF ? "<missing EOF>" : "<missing " + e.literalNames[i] + ">";
    let r = n;
    const a = e.getTokenStream().LT(-1);
    return r.type === dt.EOF && a !== null && (r = a), e.getTokenFactory().create(r.source, i, o, dt.DEFAULT_CHANNEL, -1, -1, r.line, r.column);
  }
  getExpectedTokens(e) {
    return e.getExpectedTokens();
  }
  getTokenErrorDisplay(e) {
    if (e === null) return "<no token>";
    let n = e.text;
    return n === null && (n = e.type === dt.EOF ? "<EOF>" : "<" + e.type + ">"), this.escapeWSAndQuote(n);
  }
  escapeWSAndQuote(e) {
    return "'" + (e = (e = (e = e.replace(/\n/g, "\\n")).replace(/\r/g, "\\r")).replace(/\t/g, "\\t")) + "'";
  }
  getErrorRecoverySet(e) {
    const n = e._interp.atn;
    let i = e._ctx;
    const o = new wr();
    for (; i !== null && i.invokingState >= 0; ) {
      const r = n.states[i.invokingState].transitions[0], a = n.nextTokens(r.followState);
      o.addSet(a), i = i.parentCtx;
    }
    return o.removeOne(dt.EPSILON), o;
  }
  consumeUntil(e, n) {
    let i = e.getTokenStream().LA(1);
    for (; i !== dt.EOF && !n.contains(i); ) e.consume(), i = e.getTokenStream().LA(1);
  }
}
class P8 extends Uy {
  constructor() {
    super();
  }
  recover(e, n) {
    let i = e._ctx;
    for (; i !== null; ) i.exception = n, i = i.parentCtx;
    throw new Hk(n);
  }
  recoverInline(e) {
    this.recover(e, new wf(e));
  }
  sync(e) {
  }
}
const mwe = { RecognitionException: Qs, NoViableAltException: Gy, LexerNoViableAltException: Bk, InputMismatchException: wf, FailedPredicateException: Qk, DiagnosticErrorListener: T8, BailErrorStrategy: P8, DefaultErrorStrategy: Uy, ErrorListener: Rg };
class Vc {
  constructor(e, n) {
    if (this.name = "<empty>", this.strdata = e, this.decodeToUnicodeCodePoints = n || !1, this._index = 0, this.data = [], this.decodeToUnicodeCodePoints) for (let i = 0; i < this.strdata.length; ) {
      const o = this.strdata.codePointAt(i);
      this.data.push(o), i += o <= 65535 ? 1 : 2;
    }
    else {
      this.data = new Array(this.strdata.length);
      for (let i = 0; i < this.strdata.length; i++) this.data[i] = this.strdata.charCodeAt(i);
    }
    this._size = this.data.length;
  }
  reset() {
    this._index = 0;
  }
  consume() {
    if (this._index >= this._size) throw "cannot consume EOF";
    this._index += 1;
  }
  LA(e) {
    if (e === 0) return 0;
    e < 0 && (e += 1);
    const n = this._index + e - 1;
    return n < 0 || n >= this._size ? dt.EOF : this.data[n];
  }
  LT(e) {
    return this.LA(e);
  }
  mark() {
    return -1;
  }
  release(e) {
  }
  seek(e) {
    e <= this._index ? this._index = e : this._index = Math.min(e, this._size);
  }
  getText(e, n) {
    if (n >= this._size && (n = this._size - 1), e >= this._size) return "";
    if (this.decodeToUnicodeCodePoints) {
      let i = "";
      for (let o = e; o <= n; o++) i += String.fromCodePoint(this.data[o]);
      return i;
    }
    return this.strdata.slice(e, n + 1);
  }
  toString() {
    return this.strdata;
  }
  get index() {
    return this._index;
  }
  get size() {
    return this._size;
  }
}
class Wk extends Vc {
  constructor(e, n) {
    super(e, n);
  }
}
var dA = Ec(763);
const fA = typeof process < "u" && process.versions != null && process.versions.node != null;
class hA extends Wk {
  static fromPath(e, n, i) {
    if (!fA) throw new Error("FileStream is only available when running in Node!");
    dA.readFile(e, n, (function(o, r) {
      let a = null;
      r !== null && (a = new Vc(r, !0)), i(o, a);
    }));
  }
  constructor(e, n, i) {
    if (!fA) throw new Error("FileStream is only available when running in Node!");
    super(dA.readFileSync(e, n || "utf-8"), i), this.fileName = e;
  }
}
const E8 = { fromString: function(t) {
  return new Vc(t, !0);
}, fromBlob: function(t, e, n, i) {
  const o = new window.FileReader();
  o.onload = function(r) {
    const a = new Vc(r.target.result, !0);
    n(a);
  }, o.onerror = i, o.readAsText(t, e);
}, fromBuffer: function(t, e) {
  return new Vc(t.toString(e), !0);
}, fromPath: function(t, e, n) {
  hA.fromPath(t, e, n);
}, fromPathSync: function(t, e) {
  return new hA(t, e);
} }, vwe = { arrayToString: ps, stringToCharArray: function(t) {
  let e = new Uint16Array(t.length);
  for (let n = 0; n < t.length; n++) e[n] = t.charCodeAt(n);
  return e;
} };
class ywe {
}
class _8 extends ywe {
  constructor(e) {
    super(), this.tokenSource = e, this.tokens = [], this.index = -1, this.fetchedEOF = !1;
  }
  mark() {
    return 0;
  }
  release(e) {
  }
  reset() {
    this.seek(0);
  }
  seek(e) {
    this.lazyInit(), this.index = this.adjustSeekIndex(e);
  }
  get size() {
    return this.tokens.length;
  }
  get(e) {
    return this.lazyInit(), this.tokens[e];
  }
  consume() {
    let e = !1;
    if (e = this.index >= 0 && (this.fetchedEOF ? this.index < this.tokens.length - 1 : this.index < this.tokens.length), !e && this.LA(1) === dt.EOF) throw "cannot consume EOF";
    this.sync(this.index + 1) && (this.index = this.adjustSeekIndex(this.index + 1));
  }
  sync(e) {
    const n = e - this.tokens.length + 1;
    return !(n > 0) || this.fetch(n) >= n;
  }
  fetch(e) {
    if (this.fetchedEOF) return 0;
    for (let n = 0; n < e; n++) {
      const i = this.tokenSource.nextToken();
      if (i.tokenIndex = this.tokens.length, this.tokens.push(i), i.type === dt.EOF) return this.fetchedEOF = !0, n + 1;
    }
    return e;
  }
  getTokens(e, n, i) {
    if (i === void 0 && (i = null), e < 0 || n < 0) return null;
    this.lazyInit();
    const o = [];
    n >= this.tokens.length && (n = this.tokens.length - 1);
    for (let r = e; r < n; r++) {
      const a = this.tokens[r];
      if (a.type === dt.EOF) break;
      (i === null || i.contains(a.type)) && o.push(a);
    }
    return o;
  }
  LA(e) {
    return this.LT(e).type;
  }
  LB(e) {
    return this.index - e < 0 ? null : this.tokens[this.index - e];
  }
  LT(e) {
    if (this.lazyInit(), e === 0) return null;
    if (e < 0) return this.LB(-e);
    const n = this.index + e - 1;
    return this.sync(n), n >= this.tokens.length ? this.tokens[this.tokens.length - 1] : this.tokens[n];
  }
  adjustSeekIndex(e) {
    return e;
  }
  lazyInit() {
    this.index === -1 && this.setup();
  }
  setup() {
    this.sync(0), this.index = this.adjustSeekIndex(0);
  }
  setTokenSource(e) {
    this.tokenSource = e, this.tokens = [], this.index = -1, this.fetchedEOF = !1;
  }
  nextTokenOnChannel(e, n) {
    if (this.sync(e), e >= this.tokens.length) return -1;
    let i = this.tokens[e];
    for (; i.channel !== n; ) {
      if (i.type === dt.EOF) return -1;
      e += 1, this.sync(e), i = this.tokens[e];
    }
    return e;
  }
  previousTokenOnChannel(e, n) {
    for (; e >= 0 && this.tokens[e].channel !== n; ) e -= 1;
    return e;
  }
  getHiddenTokensToRight(e, n) {
    if (n === void 0 && (n = -1), this.lazyInit(), e < 0 || e >= this.tokens.length) throw e + " not in 0.." + this.tokens.length - 1;
    const i = this.nextTokenOnChannel(e + 1, Ai.DEFAULT_TOKEN_CHANNEL), o = e + 1, r = i === -1 ? this.tokens.length - 1 : i;
    return this.filterForChannel(o, r, n);
  }
  getHiddenTokensToLeft(e, n) {
    if (n === void 0 && (n = -1), this.lazyInit(), e < 0 || e >= this.tokens.length) throw e + " not in 0.." + this.tokens.length - 1;
    const i = this.previousTokenOnChannel(e - 1, Ai.DEFAULT_TOKEN_CHANNEL);
    if (i === e - 1) return null;
    const o = i + 1, r = e - 1;
    return this.filterForChannel(o, r, n);
  }
  filterForChannel(e, n, i) {
    const o = [];
    for (let r = e; r < n + 1; r++) {
      const a = this.tokens[r];
      i === -1 ? a.channel !== Ai.DEFAULT_TOKEN_CHANNEL && o.push(a) : a.channel === i && o.push(a);
    }
    return o.length === 0 ? null : o;
  }
  getSourceName() {
    return this.tokenSource.getSourceName();
  }
  getText(e) {
    this.lazyInit(), this.fill(), e || (e = new Cn(0, this.tokens.length - 1));
    let n = e.start;
    n instanceof dt && (n = n.tokenIndex);
    let i = e.stop;
    if (i instanceof dt && (i = i.tokenIndex), n === null || i === null || n < 0 || i < 0) return "";
    i >= this.tokens.length && (i = this.tokens.length - 1);
    let o = "";
    for (let r = n; r < i + 1; r++) {
      const a = this.tokens[r];
      if (a.type === dt.EOF) break;
      o += a.text;
    }
    return o;
  }
  fill() {
    for (this.lazyInit(); this.fetch(1e3) === 1e3; ) ;
  }
}
Object.defineProperty(_8, "size", { get: function() {
  return this.tokens.length;
} });
class I8 extends _8 {
  constructor(e, n) {
    super(e), this.channel = n === void 0 ? dt.DEFAULT_CHANNEL : n;
  }
  adjustSeekIndex(e) {
    return this.nextTokenOnChannel(e, this.channel);
  }
  LB(e) {
    if (e === 0 || this.index - e < 0) return null;
    let n = this.index, i = 1;
    for (; i <= e; ) n = this.previousTokenOnChannel(n - 1, this.channel), i += 1;
    return n < 0 ? null : this.tokens[n];
  }
  LT(e) {
    if (this.lazyInit(), e === 0) return null;
    if (e < 0) return this.LB(-e);
    let n = this.index, i = 1;
    for (; i < e; ) this.sync(n + 1) && (n = this.nextTokenOnChannel(n + 1, this.channel)), i += 1;
    return this.tokens[n];
  }
  getNumberOfOnChannelTokens() {
    let e = 0;
    this.fill();
    for (let n = 0; n < this.tokens.length; n++) {
      const i = this.tokens[n];
      if (i.channel === this.channel && (e += 1), i.type === dt.EOF) break;
    }
    return e;
  }
}
class bwe extends Vk {
  constructor(e) {
    super(), this.parser = e;
  }
  enterEveryRule(e) {
    console.log("enter   " + this.parser.ruleNames[e.ruleIndex] + ", LT(1)=" + this.parser._input.LT(1).text);
  }
  visitTerminal(e) {
    console.log("consume " + e.symbol + " rule " + this.parser.ruleNames[this.parser._ctx.ruleIndex]);
  }
  exitEveryRule(e) {
    console.log("exit    " + this.parser.ruleNames[e.ruleIndex] + ", LT(1)=" + this.parser._input.LT(1).text);
  }
}
class jk extends M0 {
  constructor(e) {
    super(), this._input = null, this._errHandler = new Uy(), this._precedenceStack = [], this._precedenceStack.push(0), this._ctx = null, this.buildParseTrees = !0, this._tracer = null, this._parseListeners = null, this._syntaxErrors = 0, this.setInputStream(e);
  }
  reset() {
    this._input !== null && this._input.seek(0), this._errHandler.reset(this), this._ctx = null, this._syntaxErrors = 0, this.setTrace(!1), this._precedenceStack = [], this._precedenceStack.push(0), this._interp !== null && this._interp.reset();
  }
  match(e) {
    let n = this.getCurrentToken();
    return n.type === e ? (this._errHandler.reportMatch(this), this.consume()) : (n = this._errHandler.recoverInline(this), this.buildParseTrees && n.tokenIndex === -1 && this._ctx.addErrorNode(n)), n;
  }
  matchWildcard() {
    let e = this.getCurrentToken();
    return e.type > 0 ? (this._errHandler.reportMatch(this), this.consume()) : (e = this._errHandler.recoverInline(this), this.buildParseTrees && e.tokenIndex === -1 && this._ctx.addErrorNode(e)), e;
  }
  getParseListeners() {
    return this._parseListeners || [];
  }
  addParseListener(e) {
    if (e === null) throw "listener";
    this._parseListeners === null && (this._parseListeners = []), this._parseListeners.push(e);
  }
  removeParseListener(e) {
    if (this._parseListeners !== null) {
      const n = this._parseListeners.indexOf(e);
      n >= 0 && this._parseListeners.splice(n, 1), this._parseListeners.length === 0 && (this._parseListeners = null);
    }
  }
  removeParseListeners() {
    this._parseListeners = null;
  }
  triggerEnterRuleEvent() {
    if (this._parseListeners !== null) {
      const e = this._ctx;
      this._parseListeners.forEach((function(n) {
        n.enterEveryRule(e), e.enterRule(n);
      }));
    }
  }
  triggerExitRuleEvent() {
    if (this._parseListeners !== null) {
      const e = this._ctx;
      this._parseListeners.slice(0).reverse().forEach((function(n) {
        e.exitRule(n), n.exitEveryRule(e);
      }));
    }
  }
  getTokenFactory() {
    return this._input.tokenSource._factory;
  }
  setTokenFactory(e) {
    this._input.tokenSource._factory = e;
  }
  getATNWithBypassAlts() {
    const e = this.getSerializedATN();
    if (e === null) throw "The current parser does not support an ATN with bypass alternatives.";
    let n = this.bypassAltsAtnCache[e];
    if (n === null) {
      const i = new kp();
      i.generateRuleBypassTransitions = !0, n = new zk(i).deserialize(e), this.bypassAltsAtnCache[e] = n;
    }
    return n;
  }
  getInputStream() {
    return this.getTokenStream();
  }
  setInputStream(e) {
    this.setTokenStream(e);
  }
  getTokenStream() {
    return this._input;
  }
  setTokenStream(e) {
    this._input = null, this.reset(), this._input = e;
  }
  get syntaxErrorsCount() {
    return this._syntaxErrors;
  }
  getCurrentToken() {
    return this._input.LT(1);
  }
  notifyErrorListeners(e, n, i) {
    i = i || null, (n = n || null) === null && (n = this.getCurrentToken()), this._syntaxErrors += 1;
    const o = n.line, r = n.column;
    this.getErrorListener().syntaxError(this, n, o, r, e, i);
  }
  consume() {
    const e = this.getCurrentToken();
    e.type !== dt.EOF && this.getInputStream().consume();
    const n = this._parseListeners !== null && this._parseListeners.length > 0;
    if (this.buildParseTrees || n) {
      let i;
      i = this._errHandler.inErrorRecoveryMode(this) ? this._ctx.addErrorNode(e) : this._ctx.addTokenNode(e), i.invokingState = this.state, n && this._parseListeners.forEach((function(o) {
        i instanceof Ky || i.isErrorNode !== void 0 && i.isErrorNode() ? o.visitErrorNode(i) : i instanceof Al && o.visitTerminal(i);
      }));
    }
    return e;
  }
  addContextToParseTree() {
    this._ctx.parentCtx !== null && this._ctx.parentCtx.addChild(this._ctx);
  }
  enterRule(e, n, i) {
    this.state = n, this._ctx = e, this._ctx.start = this._input.LT(1), this.buildParseTrees && this.addContextToParseTree(), this.triggerEnterRuleEvent();
  }
  exitRule() {
    this._ctx.stop = this._input.LT(-1), this.triggerExitRuleEvent(), this.state = this._ctx.invokingState, this._ctx = this._ctx.parentCtx;
  }
  enterOuterAlt(e, n) {
    e.setAltNumber(n), this.buildParseTrees && this._ctx !== e && this._ctx.parentCtx !== null && (this._ctx.parentCtx.removeLastChild(), this._ctx.parentCtx.addChild(e)), this._ctx = e;
  }
  getPrecedence() {
    return this._precedenceStack.length === 0 ? -1 : this._precedenceStack[this._precedenceStack.length - 1];
  }
  enterRecursionRule(e, n, i, o) {
    this.state = n, this._precedenceStack.push(o), this._ctx = e, this._ctx.start = this._input.LT(1), this.triggerEnterRuleEvent();
  }
  pushNewRecursionContext(e, n, i) {
    const o = this._ctx;
    o.parentCtx = e, o.invokingState = n, o.stop = this._input.LT(-1), this._ctx = e, this._ctx.start = o.start, this.buildParseTrees && this._ctx.addChild(o), this.triggerEnterRuleEvent();
  }
  unrollRecursionContexts(e) {
    this._precedenceStack.pop(), this._ctx.stop = this._input.LT(-1);
    const n = this._ctx, i = this.getParseListeners();
    if (i !== null && i.length > 0) for (; this._ctx !== e; ) this.triggerExitRuleEvent(), this._ctx = this._ctx.parentCtx;
    else this._ctx = e;
    n.parentCtx = e, this.buildParseTrees && e !== null && e.addChild(n);
  }
  getInvokingContext(e) {
    let n = this._ctx;
    for (; n !== null; ) {
      if (n.ruleIndex === e) return n;
      n = n.parentCtx;
    }
    return null;
  }
  precpred(e, n) {
    return n >= this._precedenceStack[this._precedenceStack.length - 1];
  }
  inContext(e) {
    return !1;
  }
  isExpectedToken(e) {
    const n = this._interp.atn;
    let i = this._ctx;
    const o = n.states[this.state];
    let r = n.nextTokens(o);
    if (r.contains(e)) return !0;
    if (!r.contains(dt.EPSILON)) return !1;
    for (; i !== null && i.invokingState >= 0 && r.contains(dt.EPSILON); ) {
      const a = n.states[i.invokingState].transitions[0];
      if (r = n.nextTokens(a.followState), r.contains(e)) return !0;
      i = i.parentCtx;
    }
    return !(!r.contains(dt.EPSILON) || e !== dt.EOF);
  }
  getExpectedTokens() {
    return this._interp.atn.getExpectedTokens(this.state, this._ctx);
  }
  getExpectedTokensWithinCurrentRule() {
    const e = this._interp.atn, n = e.states[this.state];
    return e.nextTokens(n);
  }
  getRuleIndex(e) {
    const n = this.getRuleIndexMap()[e];
    return n !== null ? n : -1;
  }
  getRuleInvocationStack(e) {
    (e = e || null) === null && (e = this._ctx);
    const n = [];
    for (; e !== null; ) {
      const i = e.ruleIndex;
      i < 0 ? n.push("n/a") : n.push(this.ruleNames[i]), e = e.parentCtx;
    }
    return n;
  }
  getDFAStrings() {
    return this._interp.decisionToDFA.toString();
  }
  dumpDFA() {
    let e = !1;
    for (let n = 0; n < this._interp.decisionToDFA.length; n++) {
      const i = this._interp.decisionToDFA[n];
      i.states.length > 0 && (e && console.log(), this.printer.println("Decision " + i.decision + ":"), this.printer.print(i.toString(this.literalNames, this.symbolicNames)), e = !0);
    }
  }
  getSourceName() {
    return this._input.getSourceName();
  }
  setTrace(e) {
    e ? (this._tracer !== null && this.removeParseListener(this._tracer), this._tracer = new bwe(this), this.addParseListener(this._tracer)) : (this.removeParseListener(this._tracer), this._tracer = null);
  }
}
jk.bypassAltsAtnCache = {};
class M8 extends Al {
  constructor(e) {
    super(), this.parentCtx = null, this.symbol = e;
  }
  getChild(e) {
    return null;
  }
  getSymbol() {
    return this.symbol;
  }
  getParent() {
    return this.parentCtx;
  }
  getPayload() {
    return this.symbol;
  }
  getSourceInterval() {
    if (this.symbol === null) return Cn.INVALID_INTERVAL;
    const e = this.symbol.tokenIndex;
    return new Cn(e, e);
  }
  getChildCount() {
    return 0;
  }
  accept(e) {
    return e.visitTerminal(this);
  }
  getText() {
    return this.symbol.text;
  }
  toString() {
    return this.symbol.type === dt.EOF ? "<EOF>" : this.symbol.text;
  }
}
class pA extends M8 {
  constructor(e) {
    super(e);
  }
  isErrorNode() {
    return !0;
  }
  accept(e) {
    return e.visitErrorNode(this);
  }
}
class qk extends ed {
  constructor(e, n) {
    super(e, n), this.children = null, this.start = null, this.stop = null, this.exception = null;
  }
  copyFrom(e) {
    this.parentCtx = e.parentCtx, this.invokingState = e.invokingState, this.children = null, this.start = e.start, this.stop = e.stop, e.children && (this.children = [], e.children.map((function(n) {
      n instanceof pA && (this.children.push(n), n.parentCtx = this);
    }), this));
  }
  enterRule(e) {
  }
  exitRule(e) {
  }
  addChild(e) {
    return this.children === null && (this.children = []), this.children.push(e), e;
  }
  removeLastChild() {
    this.children !== null && this.children.pop();
  }
  addTokenNode(e) {
    const n = new M8(e);
    return this.addChild(n), n.parentCtx = this, n;
  }
  addErrorNode(e) {
    const n = new pA(e);
    return this.addChild(n), n.parentCtx = this, n;
  }
  getChild(e, n) {
    if (n = n || null, this.children === null || e < 0 || e >= this.children.length) return null;
    if (n === null) return this.children[e];
    for (let i = 0; i < this.children.length; i++) {
      const o = this.children[i];
      if (o instanceof n) {
        if (e === 0) return o;
        e -= 1;
      }
    }
    return null;
  }
  getToken(e, n) {
    if (this.children === null || n < 0 || n >= this.children.length) return null;
    for (let i = 0; i < this.children.length; i++) {
      const o = this.children[i];
      if (o instanceof Al && o.symbol.type === e) {
        if (n === 0) return o;
        n -= 1;
      }
    }
    return null;
  }
  getTokens(e) {
    if (this.children === null) return [];
    {
      const n = [];
      for (let i = 0; i < this.children.length; i++) {
        const o = this.children[i];
        o instanceof Al && o.symbol.type === e && n.push(o);
      }
      return n;
    }
  }
  getTypedRuleContext(e, n) {
    return this.getChild(n, e);
  }
  getTypedRuleContexts(e) {
    if (this.children === null) return [];
    {
      const n = [];
      for (let i = 0; i < this.children.length; i++) {
        const o = this.children[i];
        o instanceof e && n.push(o);
      }
      return n;
    }
  }
  getChildCount() {
    return this.children === null ? 0 : this.children.length;
  }
  getSourceInterval() {
    return this.start === null || this.stop === null ? Cn.INVALID_INTERVAL : new Cn(this.start.tokenIndex, this.stop.tokenIndex);
  }
}
ed.EMPTY = new qk();
class as {
  static DEFAULT_PROGRAM_NAME = "default";
  constructor(e) {
    this.tokens = e, this.programs = /* @__PURE__ */ new Map();
  }
  getTokenStream() {
    return this.tokens;
  }
  insertAfter(e, n) {
    let i, o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : as.DEFAULT_PROGRAM_NAME;
    i = typeof e == "number" ? e : e.tokenIndex;
    let r = this.getProgram(o), a = new gA(this.tokens, i, r.length, n);
    r.push(a);
  }
  insertBefore(e, n) {
    let i, o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : as.DEFAULT_PROGRAM_NAME;
    i = typeof e == "number" ? e : e.tokenIndex;
    const r = this.getProgram(o), a = new jd(this.tokens, i, r.length, n);
    r.push(a);
  }
  replaceSingle(e, n) {
    let i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : as.DEFAULT_PROGRAM_NAME;
    this.replace(e, e, n, i);
  }
  replace(e, n, i) {
    let o = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : as.DEFAULT_PROGRAM_NAME;
    if (typeof e != "number" && (e = e.tokenIndex), typeof n != "number" && (n = n.tokenIndex), e > n || e < 0 || n < 0 || n >= this.tokens.size) throw new RangeError(`replace: range invalid: ${e}..${n}(size=${this.tokens.size})`);
    let r = this.getProgram(o), a = new Km(this.tokens, e, n, r.length, i);
    r.push(a);
  }
  delete(e, n) {
    let i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : as.DEFAULT_PROGRAM_NAME;
    n === void 0 && (n = e), this.replace(e, n, null, i);
  }
  getProgram(e) {
    let n = this.programs.get(e);
    return n == null && (n = this.initializeProgram(e)), n;
  }
  initializeProgram(e) {
    const n = [];
    return this.programs.set(e, n), n;
  }
  getText(e) {
    let n, i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : as.DEFAULT_PROGRAM_NAME;
    n = e instanceof Cn ? e : new Cn(0, this.tokens.size - 1), typeof e == "string" && (i = e);
    const o = this.programs.get(i);
    let r = n.start, a = n.stop;
    if (a > this.tokens.size - 1 && (a = this.tokens.size - 1), r < 0 && (r = 0), o == null || o.length === 0) return this.tokens.getText(new Cn(r, a));
    let l = [], s = this.reduceToSingleOperationPerIndex(o), u = r;
    for (; u <= a && u < this.tokens.size; ) {
      let c = s.get(u);
      s.delete(u);
      let d = this.tokens.get(u);
      c == null ? (d.type !== dt.EOF && l.push(String(d.text)), u++) : u = c.execute(l);
    }
    if (a === this.tokens.size - 1) for (const c of s.values()) c.index >= this.tokens.size - 1 && l.push(c.text.toString());
    return l.join("");
  }
  reduceToSingleOperationPerIndex(e) {
    for (let i = 0; i < e.length; i++) {
      let o = e[i];
      if (o == null || !(o instanceof Km)) continue;
      let r = o, a = this.getKindOfOps(e, jd, i);
      for (let s of a) s.index === r.index ? (e[s.instructionIndex] = void 0, r.text = s.text.toString() + (r.text != null ? r.text.toString() : "")) : s.index > r.index && s.index <= r.lastIndex && (e[s.instructionIndex] = void 0);
      let l = this.getKindOfOps(e, Km, i);
      for (let s of l) {
        if (s.index >= r.index && s.lastIndex <= r.lastIndex) {
          e[s.instructionIndex] = void 0;
          continue;
        }
        let u = s.lastIndex < r.index || s.index > r.lastIndex;
        if (s.text != null || r.text != null || u) {
          if (!u) throw new Error(`replace op boundaries of ${r} overlap with previous ${s}`);
        } else e[s.instructionIndex] = void 0, r.index = Math.min(s.index, r.index), r.lastIndex = Math.max(s.lastIndex, r.lastIndex);
      }
    }
    for (let i = 0; i < e.length; i++) {
      let o = e[i];
      if (o == null || !(o instanceof jd)) continue;
      let r = o, a = this.getKindOfOps(e, jd, i);
      for (let s of a) s.index === r.index && (s instanceof gA ? (r.text = this.catOpText(s.text, r.text), e[s.instructionIndex] = void 0) : s instanceof jd && (r.text = this.catOpText(r.text, s.text), e[s.instructionIndex] = void 0));
      let l = this.getKindOfOps(e, Km, i);
      for (let s of l) if (r.index !== s.index) {
        if (r.index >= s.index && r.index <= s.lastIndex) throw new Error(`insert op ${r} within boundaries of previous ${s}`);
      } else s.text = this.catOpText(r.text, s.text), e[i] = void 0;
    }
    let n = /* @__PURE__ */ new Map();
    for (let i of e) if (i != null) {
      if (n.get(i.index) != null) throw new Error("should only be one op per index");
      n.set(i.index, i);
    }
    return n;
  }
  catOpText(e, n) {
    let i = "", o = "";
    return e != null && (i = e.toString()), n != null && (o = n.toString()), i + o;
  }
  getKindOfOps(e, n, i) {
    return e.slice(0, i).filter(((o) => o && o instanceof n));
  }
}
class A8 {
  constructor(e, n, i, o) {
    this.tokens = e, this.instructionIndex = i, this.index = n, this.text = o === void 0 ? "" : o;
  }
  toString() {
    let e = this.constructor.name;
    const n = e.indexOf("$");
    return e = e.substring(n + 1, e.length), "<" + e + "@" + this.tokens.get(this.index) + ':"' + this.text + '">';
  }
}
class jd extends A8 {
  constructor(e, n, i, o) {
    super(e, n, i, o);
  }
  execute(e) {
    return this.text && e.push(this.text.toString()), this.tokens.get(this.index).type !== dt.EOF && e.push(String(this.tokens.get(this.index).text)), this.index + 1;
  }
}
class gA extends jd {
  constructor(e, n, i, o) {
    super(e, n + 1, i, o);
  }
}
class Km extends A8 {
  constructor(e, n, i, o, r) {
    super(e, n, o, r), this.lastIndex = i;
  }
  execute(e) {
    return this.text && e.push(this.text.toString()), this.lastIndex + 1;
  }
  toString() {
    return this.text == null ? "<DeleteOp@" + this.tokens.get(this.index) + ".." + this.tokens.get(this.lastIndex) + ">" : "<ReplaceOp@" + this.tokens.get(this.index) + ".." + this.tokens.get(this.lastIndex) + ':"' + this.text + '">';
  }
}
const xwe = { atn: uwe, dfa: cwe, context: dwe, misc: fwe, tree: hwe, error: mwe, Token: dt, CommonToken: ws, CharStreams: E8, CharStream: Vc, InputStream: Wk, CommonTokenStream: I8, Lexer: Ai, Parser: jk, ParserRuleContext: qk, Interval: Cn, IntervalSet: wr, LL1Analyzer: td, Utils: vwe, TokenStreamRewriter: as };
Tn.MG;
var R8 = Tn.fr;
Tn.sR;
Tn.Zo;
var Jy = Tn.iH;
Tn.rt;
var eb = Tn.jB, D8 = Tn.M8;
Tn.$t;
Tn.aq;
var Owe = Tn.pG, Swe = Tn.eP;
Tn.KU;
Tn.zW;
Tn.IX;
Tn.mY;
Tn.a7;
var wwe = Tn.JG, Cwe = Tn.ay, $we = Tn.X2;
Tn.WU;
Tn.Uw;
var kwe = Tn.gw, Twe = Tn.iX, Pwe = Tn.re, Lo = Tn.Pg, N8 = Tn.tD;
Tn.R$;
var To = Tn.Dj;
Tn.m7;
Tn.NZ;
Tn.xo;
var L8 = Tn.ou;
Tn.qC;
Tn.mD;
Tn.Ay;
class vt extends wwe {
  static LPAREN = 1;
  static RPAREN = 2;
  static LBRACK = 3;
  static RBRACK = 4;
  static COMMA = 5;
  static EQUALS = 6;
  static NOT_EQUALS = 7;
  static NEQ = 8;
  static LT = 9;
  static LE = 10;
  static GT = 11;
  static GE = 12;
  static LIKE = 13;
  static ILIKE = 14;
  static BETWEEN = 15;
  static EXISTS = 16;
  static REGEXP = 17;
  static CONTAINS = 18;
  static IN = 19;
  static NOT = 20;
  static AND = 21;
  static OR = 22;
  static HASTOKEN = 23;
  static HAS = 24;
  static HASANY = 25;
  static HASALL = 26;
  static BOOL = 27;
  static NUMBER = 28;
  static QUOTED_TEXT = 29;
  static KEY = 30;
  static WS = 31;
  static FREETEXT = 32;
  static EOF = L8.EOF;
  static channelNames = ["DEFAULT_TOKEN_CHANNEL", "HIDDEN"];
  static literalNames = [
    null,
    "'('",
    "')'",
    "'['",
    "']'",
    "','",
    null,
    "'!='",
    "'<>'",
    "'<'",
    "'<='",
    "'>'",
    "'>='"
  ];
  static symbolicNames = [
    null,
    "LPAREN",
    "RPAREN",
    "LBRACK",
    "RBRACK",
    "COMMA",
    "EQUALS",
    "NOT_EQUALS",
    "NEQ",
    "LT",
    "LE",
    "GT",
    "GE",
    "LIKE",
    "ILIKE",
    "BETWEEN",
    "EXISTS",
    "REGEXP",
    "CONTAINS",
    "IN",
    "NOT",
    "AND",
    "OR",
    "HASTOKEN",
    "HAS",
    "HASANY",
    "HASALL",
    "BOOL",
    "NUMBER",
    "QUOTED_TEXT",
    "KEY",
    "WS",
    "FREETEXT"
  ];
  static modeNames = ["DEFAULT_MODE"];
  static ruleNames = [
    "LPAREN",
    "RPAREN",
    "LBRACK",
    "RBRACK",
    "COMMA",
    "EQUALS",
    "NOT_EQUALS",
    "NEQ",
    "LT",
    "LE",
    "GT",
    "GE",
    "LIKE",
    "ILIKE",
    "BETWEEN",
    "EXISTS",
    "REGEXP",
    "CONTAINS",
    "IN",
    "NOT",
    "AND",
    "OR",
    "HASTOKEN",
    "HAS",
    "HASANY",
    "HASALL",
    "BOOL",
    "SIGN",
    "NUMBER",
    "QUOTED_TEXT",
    "SEGMENT",
    "EMPTY_BRACKS",
    "OLD_JSON_BRACKS",
    "KEY",
    "WS",
    "DIGIT",
    "FREETEXT"
  ];
  constructor(e) {
    super(e), this._interp = new Cwe(
      this,
      vt._ATN,
      vt.DecisionsToDFA,
      new N8()
    );
  }
  get grammarFileName() {
    return "FilterQuery.g4";
  }
  get literalNames() {
    return vt.literalNames;
  }
  get symbolicNames() {
    return vt.symbolicNames;
  }
  get ruleNames() {
    return vt.ruleNames;
  }
  get serializedATN() {
    return vt._serializedATN;
  }
  get channelNames() {
    return vt.channelNames;
  }
  get modeNames() {
    return vt.modeNames;
  }
  static _serializedATN = [
    4,
    0,
    32,
    320,
    6,
    -1,
    2,
    0,
    7,
    0,
    2,
    1,
    7,
    1,
    2,
    2,
    7,
    2,
    2,
    3,
    7,
    3,
    2,
    4,
    7,
    4,
    2,
    5,
    7,
    5,
    2,
    6,
    7,
    6,
    2,
    7,
    7,
    7,
    2,
    8,
    7,
    8,
    2,
    9,
    7,
    9,
    2,
    10,
    7,
    10,
    2,
    11,
    7,
    11,
    2,
    12,
    7,
    12,
    2,
    13,
    7,
    13,
    2,
    14,
    7,
    14,
    2,
    15,
    7,
    15,
    2,
    16,
    7,
    16,
    2,
    17,
    7,
    17,
    2,
    18,
    7,
    18,
    2,
    19,
    7,
    19,
    2,
    20,
    7,
    20,
    2,
    21,
    7,
    21,
    2,
    22,
    7,
    22,
    2,
    23,
    7,
    23,
    2,
    24,
    7,
    24,
    2,
    25,
    7,
    25,
    2,
    26,
    7,
    26,
    2,
    27,
    7,
    27,
    2,
    28,
    7,
    28,
    2,
    29,
    7,
    29,
    2,
    30,
    7,
    30,
    2,
    31,
    7,
    31,
    2,
    32,
    7,
    32,
    2,
    33,
    7,
    33,
    2,
    34,
    7,
    34,
    2,
    35,
    7,
    35,
    2,
    36,
    7,
    36,
    1,
    0,
    1,
    0,
    1,
    1,
    1,
    1,
    1,
    2,
    1,
    2,
    1,
    3,
    1,
    3,
    1,
    4,
    1,
    4,
    1,
    5,
    1,
    5,
    1,
    5,
    3,
    5,
    89,
    8,
    5,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    7,
    1,
    7,
    1,
    7,
    1,
    8,
    1,
    8,
    1,
    9,
    1,
    9,
    1,
    9,
    1,
    10,
    1,
    10,
    1,
    11,
    1,
    11,
    1,
    11,
    1,
    12,
    1,
    12,
    1,
    12,
    1,
    12,
    1,
    12,
    1,
    13,
    1,
    13,
    1,
    13,
    1,
    13,
    1,
    13,
    1,
    13,
    1,
    14,
    1,
    14,
    1,
    14,
    1,
    14,
    1,
    14,
    1,
    14,
    1,
    14,
    1,
    14,
    1,
    15,
    1,
    15,
    1,
    15,
    1,
    15,
    1,
    15,
    1,
    15,
    3,
    15,
    132,
    8,
    15,
    1,
    16,
    1,
    16,
    1,
    16,
    1,
    16,
    1,
    16,
    1,
    16,
    1,
    16,
    1,
    17,
    1,
    17,
    1,
    17,
    1,
    17,
    1,
    17,
    1,
    17,
    1,
    17,
    1,
    17,
    3,
    17,
    149,
    8,
    17,
    1,
    18,
    1,
    18,
    1,
    18,
    1,
    19,
    1,
    19,
    1,
    19,
    1,
    19,
    1,
    20,
    1,
    20,
    1,
    20,
    1,
    20,
    1,
    21,
    1,
    21,
    1,
    21,
    1,
    22,
    1,
    22,
    1,
    22,
    1,
    22,
    1,
    22,
    1,
    22,
    1,
    22,
    1,
    22,
    1,
    22,
    1,
    23,
    1,
    23,
    1,
    23,
    1,
    23,
    1,
    24,
    1,
    24,
    1,
    24,
    1,
    24,
    1,
    24,
    1,
    24,
    1,
    24,
    1,
    25,
    1,
    25,
    1,
    25,
    1,
    25,
    1,
    25,
    1,
    25,
    1,
    25,
    1,
    26,
    1,
    26,
    1,
    26,
    1,
    26,
    1,
    26,
    1,
    26,
    1,
    26,
    1,
    26,
    1,
    26,
    3,
    26,
    201,
    8,
    26,
    1,
    27,
    1,
    27,
    1,
    28,
    3,
    28,
    206,
    8,
    28,
    1,
    28,
    4,
    28,
    209,
    8,
    28,
    11,
    28,
    12,
    28,
    210,
    1,
    28,
    1,
    28,
    5,
    28,
    215,
    8,
    28,
    10,
    28,
    12,
    28,
    218,
    9,
    28,
    3,
    28,
    220,
    8,
    28,
    1,
    28,
    1,
    28,
    3,
    28,
    224,
    8,
    28,
    1,
    28,
    4,
    28,
    227,
    8,
    28,
    11,
    28,
    12,
    28,
    228,
    3,
    28,
    231,
    8,
    28,
    1,
    28,
    3,
    28,
    234,
    8,
    28,
    1,
    28,
    1,
    28,
    4,
    28,
    238,
    8,
    28,
    11,
    28,
    12,
    28,
    239,
    1,
    28,
    1,
    28,
    3,
    28,
    244,
    8,
    28,
    1,
    28,
    4,
    28,
    247,
    8,
    28,
    11,
    28,
    12,
    28,
    248,
    3,
    28,
    251,
    8,
    28,
    3,
    28,
    253,
    8,
    28,
    1,
    29,
    1,
    29,
    1,
    29,
    1,
    29,
    5,
    29,
    259,
    8,
    29,
    10,
    29,
    12,
    29,
    262,
    9,
    29,
    1,
    29,
    1,
    29,
    1,
    29,
    1,
    29,
    1,
    29,
    5,
    29,
    269,
    8,
    29,
    10,
    29,
    12,
    29,
    272,
    9,
    29,
    1,
    29,
    3,
    29,
    275,
    8,
    29,
    1,
    30,
    1,
    30,
    5,
    30,
    279,
    8,
    30,
    10,
    30,
    12,
    30,
    282,
    9,
    30,
    1,
    31,
    1,
    31,
    1,
    31,
    1,
    32,
    1,
    32,
    1,
    32,
    1,
    32,
    1,
    33,
    1,
    33,
    1,
    33,
    1,
    33,
    1,
    33,
    1,
    33,
    1,
    33,
    4,
    33,
    298,
    8,
    33,
    11,
    33,
    12,
    33,
    299,
    5,
    33,
    302,
    8,
    33,
    10,
    33,
    12,
    33,
    305,
    9,
    33,
    1,
    34,
    4,
    34,
    308,
    8,
    34,
    11,
    34,
    12,
    34,
    309,
    1,
    34,
    1,
    34,
    1,
    35,
    1,
    35,
    1,
    36,
    4,
    36,
    317,
    8,
    36,
    11,
    36,
    12,
    36,
    318,
    0,
    0,
    37,
    1,
    1,
    3,
    2,
    5,
    3,
    7,
    4,
    9,
    5,
    11,
    6,
    13,
    7,
    15,
    8,
    17,
    9,
    19,
    10,
    21,
    11,
    23,
    12,
    25,
    13,
    27,
    14,
    29,
    15,
    31,
    16,
    33,
    17,
    35,
    18,
    37,
    19,
    39,
    20,
    41,
    21,
    43,
    22,
    45,
    23,
    47,
    24,
    49,
    25,
    51,
    26,
    53,
    27,
    55,
    0,
    57,
    28,
    59,
    29,
    61,
    0,
    63,
    0,
    65,
    0,
    67,
    30,
    69,
    31,
    71,
    0,
    73,
    32,
    1,
    0,
    29,
    2,
    0,
    76,
    76,
    108,
    108,
    2,
    0,
    73,
    73,
    105,
    105,
    2,
    0,
    75,
    75,
    107,
    107,
    2,
    0,
    69,
    69,
    101,
    101,
    2,
    0,
    66,
    66,
    98,
    98,
    2,
    0,
    84,
    84,
    116,
    116,
    2,
    0,
    87,
    87,
    119,
    119,
    2,
    0,
    78,
    78,
    110,
    110,
    2,
    0,
    88,
    88,
    120,
    120,
    2,
    0,
    83,
    83,
    115,
    115,
    2,
    0,
    82,
    82,
    114,
    114,
    2,
    0,
    71,
    71,
    103,
    103,
    2,
    0,
    80,
    80,
    112,
    112,
    2,
    0,
    67,
    67,
    99,
    99,
    2,
    0,
    79,
    79,
    111,
    111,
    2,
    0,
    65,
    65,
    97,
    97,
    2,
    0,
    68,
    68,
    100,
    100,
    2,
    0,
    72,
    72,
    104,
    104,
    2,
    0,
    89,
    89,
    121,
    121,
    2,
    0,
    85,
    85,
    117,
    117,
    2,
    0,
    70,
    70,
    102,
    102,
    2,
    0,
    43,
    43,
    45,
    45,
    2,
    0,
    34,
    34,
    92,
    92,
    2,
    0,
    39,
    39,
    92,
    92,
    4,
    0,
    35,
    36,
    64,
    90,
    95,
    95,
    97,
    123,
    7,
    0,
    35,
    36,
    45,
    45,
    47,
    58,
    64,
    90,
    95,
    95,
    97,
    123,
    125,
    125,
    3,
    0,
    9,
    10,
    13,
    13,
    32,
    32,
    1,
    0,
    48,
    57,
    8,
    0,
    9,
    10,
    13,
    13,
    32,
    34,
    39,
    41,
    44,
    44,
    60,
    62,
    91,
    91,
    93,
    93,
    344,
    0,
    1,
    1,
    0,
    0,
    0,
    0,
    3,
    1,
    0,
    0,
    0,
    0,
    5,
    1,
    0,
    0,
    0,
    0,
    7,
    1,
    0,
    0,
    0,
    0,
    9,
    1,
    0,
    0,
    0,
    0,
    11,
    1,
    0,
    0,
    0,
    0,
    13,
    1,
    0,
    0,
    0,
    0,
    15,
    1,
    0,
    0,
    0,
    0,
    17,
    1,
    0,
    0,
    0,
    0,
    19,
    1,
    0,
    0,
    0,
    0,
    21,
    1,
    0,
    0,
    0,
    0,
    23,
    1,
    0,
    0,
    0,
    0,
    25,
    1,
    0,
    0,
    0,
    0,
    27,
    1,
    0,
    0,
    0,
    0,
    29,
    1,
    0,
    0,
    0,
    0,
    31,
    1,
    0,
    0,
    0,
    0,
    33,
    1,
    0,
    0,
    0,
    0,
    35,
    1,
    0,
    0,
    0,
    0,
    37,
    1,
    0,
    0,
    0,
    0,
    39,
    1,
    0,
    0,
    0,
    0,
    41,
    1,
    0,
    0,
    0,
    0,
    43,
    1,
    0,
    0,
    0,
    0,
    45,
    1,
    0,
    0,
    0,
    0,
    47,
    1,
    0,
    0,
    0,
    0,
    49,
    1,
    0,
    0,
    0,
    0,
    51,
    1,
    0,
    0,
    0,
    0,
    53,
    1,
    0,
    0,
    0,
    0,
    57,
    1,
    0,
    0,
    0,
    0,
    59,
    1,
    0,
    0,
    0,
    0,
    67,
    1,
    0,
    0,
    0,
    0,
    69,
    1,
    0,
    0,
    0,
    0,
    73,
    1,
    0,
    0,
    0,
    1,
    75,
    1,
    0,
    0,
    0,
    3,
    77,
    1,
    0,
    0,
    0,
    5,
    79,
    1,
    0,
    0,
    0,
    7,
    81,
    1,
    0,
    0,
    0,
    9,
    83,
    1,
    0,
    0,
    0,
    11,
    88,
    1,
    0,
    0,
    0,
    13,
    90,
    1,
    0,
    0,
    0,
    15,
    93,
    1,
    0,
    0,
    0,
    17,
    96,
    1,
    0,
    0,
    0,
    19,
    98,
    1,
    0,
    0,
    0,
    21,
    101,
    1,
    0,
    0,
    0,
    23,
    103,
    1,
    0,
    0,
    0,
    25,
    106,
    1,
    0,
    0,
    0,
    27,
    111,
    1,
    0,
    0,
    0,
    29,
    117,
    1,
    0,
    0,
    0,
    31,
    125,
    1,
    0,
    0,
    0,
    33,
    133,
    1,
    0,
    0,
    0,
    35,
    140,
    1,
    0,
    0,
    0,
    37,
    150,
    1,
    0,
    0,
    0,
    39,
    153,
    1,
    0,
    0,
    0,
    41,
    157,
    1,
    0,
    0,
    0,
    43,
    161,
    1,
    0,
    0,
    0,
    45,
    164,
    1,
    0,
    0,
    0,
    47,
    173,
    1,
    0,
    0,
    0,
    49,
    177,
    1,
    0,
    0,
    0,
    51,
    184,
    1,
    0,
    0,
    0,
    53,
    200,
    1,
    0,
    0,
    0,
    55,
    202,
    1,
    0,
    0,
    0,
    57,
    252,
    1,
    0,
    0,
    0,
    59,
    274,
    1,
    0,
    0,
    0,
    61,
    276,
    1,
    0,
    0,
    0,
    63,
    283,
    1,
    0,
    0,
    0,
    65,
    286,
    1,
    0,
    0,
    0,
    67,
    290,
    1,
    0,
    0,
    0,
    69,
    307,
    1,
    0,
    0,
    0,
    71,
    313,
    1,
    0,
    0,
    0,
    73,
    316,
    1,
    0,
    0,
    0,
    75,
    76,
    5,
    40,
    0,
    0,
    76,
    2,
    1,
    0,
    0,
    0,
    77,
    78,
    5,
    41,
    0,
    0,
    78,
    4,
    1,
    0,
    0,
    0,
    79,
    80,
    5,
    91,
    0,
    0,
    80,
    6,
    1,
    0,
    0,
    0,
    81,
    82,
    5,
    93,
    0,
    0,
    82,
    8,
    1,
    0,
    0,
    0,
    83,
    84,
    5,
    44,
    0,
    0,
    84,
    10,
    1,
    0,
    0,
    0,
    85,
    89,
    5,
    61,
    0,
    0,
    86,
    87,
    5,
    61,
    0,
    0,
    87,
    89,
    5,
    61,
    0,
    0,
    88,
    85,
    1,
    0,
    0,
    0,
    88,
    86,
    1,
    0,
    0,
    0,
    89,
    12,
    1,
    0,
    0,
    0,
    90,
    91,
    5,
    33,
    0,
    0,
    91,
    92,
    5,
    61,
    0,
    0,
    92,
    14,
    1,
    0,
    0,
    0,
    93,
    94,
    5,
    60,
    0,
    0,
    94,
    95,
    5,
    62,
    0,
    0,
    95,
    16,
    1,
    0,
    0,
    0,
    96,
    97,
    5,
    60,
    0,
    0,
    97,
    18,
    1,
    0,
    0,
    0,
    98,
    99,
    5,
    60,
    0,
    0,
    99,
    100,
    5,
    61,
    0,
    0,
    100,
    20,
    1,
    0,
    0,
    0,
    101,
    102,
    5,
    62,
    0,
    0,
    102,
    22,
    1,
    0,
    0,
    0,
    103,
    104,
    5,
    62,
    0,
    0,
    104,
    105,
    5,
    61,
    0,
    0,
    105,
    24,
    1,
    0,
    0,
    0,
    106,
    107,
    7,
    0,
    0,
    0,
    107,
    108,
    7,
    1,
    0,
    0,
    108,
    109,
    7,
    2,
    0,
    0,
    109,
    110,
    7,
    3,
    0,
    0,
    110,
    26,
    1,
    0,
    0,
    0,
    111,
    112,
    7,
    1,
    0,
    0,
    112,
    113,
    7,
    0,
    0,
    0,
    113,
    114,
    7,
    1,
    0,
    0,
    114,
    115,
    7,
    2,
    0,
    0,
    115,
    116,
    7,
    3,
    0,
    0,
    116,
    28,
    1,
    0,
    0,
    0,
    117,
    118,
    7,
    4,
    0,
    0,
    118,
    119,
    7,
    3,
    0,
    0,
    119,
    120,
    7,
    5,
    0,
    0,
    120,
    121,
    7,
    6,
    0,
    0,
    121,
    122,
    7,
    3,
    0,
    0,
    122,
    123,
    7,
    3,
    0,
    0,
    123,
    124,
    7,
    7,
    0,
    0,
    124,
    30,
    1,
    0,
    0,
    0,
    125,
    126,
    7,
    3,
    0,
    0,
    126,
    127,
    7,
    8,
    0,
    0,
    127,
    128,
    7,
    1,
    0,
    0,
    128,
    129,
    7,
    9,
    0,
    0,
    129,
    131,
    7,
    5,
    0,
    0,
    130,
    132,
    7,
    9,
    0,
    0,
    131,
    130,
    1,
    0,
    0,
    0,
    131,
    132,
    1,
    0,
    0,
    0,
    132,
    32,
    1,
    0,
    0,
    0,
    133,
    134,
    7,
    10,
    0,
    0,
    134,
    135,
    7,
    3,
    0,
    0,
    135,
    136,
    7,
    11,
    0,
    0,
    136,
    137,
    7,
    3,
    0,
    0,
    137,
    138,
    7,
    8,
    0,
    0,
    138,
    139,
    7,
    12,
    0,
    0,
    139,
    34,
    1,
    0,
    0,
    0,
    140,
    141,
    7,
    13,
    0,
    0,
    141,
    142,
    7,
    14,
    0,
    0,
    142,
    143,
    7,
    7,
    0,
    0,
    143,
    144,
    7,
    5,
    0,
    0,
    144,
    145,
    7,
    15,
    0,
    0,
    145,
    146,
    7,
    1,
    0,
    0,
    146,
    148,
    7,
    7,
    0,
    0,
    147,
    149,
    7,
    9,
    0,
    0,
    148,
    147,
    1,
    0,
    0,
    0,
    148,
    149,
    1,
    0,
    0,
    0,
    149,
    36,
    1,
    0,
    0,
    0,
    150,
    151,
    7,
    1,
    0,
    0,
    151,
    152,
    7,
    7,
    0,
    0,
    152,
    38,
    1,
    0,
    0,
    0,
    153,
    154,
    7,
    7,
    0,
    0,
    154,
    155,
    7,
    14,
    0,
    0,
    155,
    156,
    7,
    5,
    0,
    0,
    156,
    40,
    1,
    0,
    0,
    0,
    157,
    158,
    7,
    15,
    0,
    0,
    158,
    159,
    7,
    7,
    0,
    0,
    159,
    160,
    7,
    16,
    0,
    0,
    160,
    42,
    1,
    0,
    0,
    0,
    161,
    162,
    7,
    14,
    0,
    0,
    162,
    163,
    7,
    10,
    0,
    0,
    163,
    44,
    1,
    0,
    0,
    0,
    164,
    165,
    7,
    17,
    0,
    0,
    165,
    166,
    7,
    15,
    0,
    0,
    166,
    167,
    7,
    9,
    0,
    0,
    167,
    168,
    7,
    5,
    0,
    0,
    168,
    169,
    7,
    14,
    0,
    0,
    169,
    170,
    7,
    2,
    0,
    0,
    170,
    171,
    7,
    3,
    0,
    0,
    171,
    172,
    7,
    7,
    0,
    0,
    172,
    46,
    1,
    0,
    0,
    0,
    173,
    174,
    7,
    17,
    0,
    0,
    174,
    175,
    7,
    15,
    0,
    0,
    175,
    176,
    7,
    9,
    0,
    0,
    176,
    48,
    1,
    0,
    0,
    0,
    177,
    178,
    7,
    17,
    0,
    0,
    178,
    179,
    7,
    15,
    0,
    0,
    179,
    180,
    7,
    9,
    0,
    0,
    180,
    181,
    7,
    15,
    0,
    0,
    181,
    182,
    7,
    7,
    0,
    0,
    182,
    183,
    7,
    18,
    0,
    0,
    183,
    50,
    1,
    0,
    0,
    0,
    184,
    185,
    7,
    17,
    0,
    0,
    185,
    186,
    7,
    15,
    0,
    0,
    186,
    187,
    7,
    9,
    0,
    0,
    187,
    188,
    7,
    15,
    0,
    0,
    188,
    189,
    7,
    0,
    0,
    0,
    189,
    190,
    7,
    0,
    0,
    0,
    190,
    52,
    1,
    0,
    0,
    0,
    191,
    192,
    7,
    5,
    0,
    0,
    192,
    193,
    7,
    10,
    0,
    0,
    193,
    194,
    7,
    19,
    0,
    0,
    194,
    201,
    7,
    3,
    0,
    0,
    195,
    196,
    7,
    20,
    0,
    0,
    196,
    197,
    7,
    15,
    0,
    0,
    197,
    198,
    7,
    0,
    0,
    0,
    198,
    199,
    7,
    9,
    0,
    0,
    199,
    201,
    7,
    3,
    0,
    0,
    200,
    191,
    1,
    0,
    0,
    0,
    200,
    195,
    1,
    0,
    0,
    0,
    201,
    54,
    1,
    0,
    0,
    0,
    202,
    203,
    7,
    21,
    0,
    0,
    203,
    56,
    1,
    0,
    0,
    0,
    204,
    206,
    3,
    55,
    27,
    0,
    205,
    204,
    1,
    0,
    0,
    0,
    205,
    206,
    1,
    0,
    0,
    0,
    206,
    208,
    1,
    0,
    0,
    0,
    207,
    209,
    3,
    71,
    35,
    0,
    208,
    207,
    1,
    0,
    0,
    0,
    209,
    210,
    1,
    0,
    0,
    0,
    210,
    208,
    1,
    0,
    0,
    0,
    210,
    211,
    1,
    0,
    0,
    0,
    211,
    219,
    1,
    0,
    0,
    0,
    212,
    216,
    5,
    46,
    0,
    0,
    213,
    215,
    3,
    71,
    35,
    0,
    214,
    213,
    1,
    0,
    0,
    0,
    215,
    218,
    1,
    0,
    0,
    0,
    216,
    214,
    1,
    0,
    0,
    0,
    216,
    217,
    1,
    0,
    0,
    0,
    217,
    220,
    1,
    0,
    0,
    0,
    218,
    216,
    1,
    0,
    0,
    0,
    219,
    212,
    1,
    0,
    0,
    0,
    219,
    220,
    1,
    0,
    0,
    0,
    220,
    230,
    1,
    0,
    0,
    0,
    221,
    223,
    7,
    3,
    0,
    0,
    222,
    224,
    3,
    55,
    27,
    0,
    223,
    222,
    1,
    0,
    0,
    0,
    223,
    224,
    1,
    0,
    0,
    0,
    224,
    226,
    1,
    0,
    0,
    0,
    225,
    227,
    3,
    71,
    35,
    0,
    226,
    225,
    1,
    0,
    0,
    0,
    227,
    228,
    1,
    0,
    0,
    0,
    228,
    226,
    1,
    0,
    0,
    0,
    228,
    229,
    1,
    0,
    0,
    0,
    229,
    231,
    1,
    0,
    0,
    0,
    230,
    221,
    1,
    0,
    0,
    0,
    230,
    231,
    1,
    0,
    0,
    0,
    231,
    253,
    1,
    0,
    0,
    0,
    232,
    234,
    3,
    55,
    27,
    0,
    233,
    232,
    1,
    0,
    0,
    0,
    233,
    234,
    1,
    0,
    0,
    0,
    234,
    235,
    1,
    0,
    0,
    0,
    235,
    237,
    5,
    46,
    0,
    0,
    236,
    238,
    3,
    71,
    35,
    0,
    237,
    236,
    1,
    0,
    0,
    0,
    238,
    239,
    1,
    0,
    0,
    0,
    239,
    237,
    1,
    0,
    0,
    0,
    239,
    240,
    1,
    0,
    0,
    0,
    240,
    250,
    1,
    0,
    0,
    0,
    241,
    243,
    7,
    3,
    0,
    0,
    242,
    244,
    3,
    55,
    27,
    0,
    243,
    242,
    1,
    0,
    0,
    0,
    243,
    244,
    1,
    0,
    0,
    0,
    244,
    246,
    1,
    0,
    0,
    0,
    245,
    247,
    3,
    71,
    35,
    0,
    246,
    245,
    1,
    0,
    0,
    0,
    247,
    248,
    1,
    0,
    0,
    0,
    248,
    246,
    1,
    0,
    0,
    0,
    248,
    249,
    1,
    0,
    0,
    0,
    249,
    251,
    1,
    0,
    0,
    0,
    250,
    241,
    1,
    0,
    0,
    0,
    250,
    251,
    1,
    0,
    0,
    0,
    251,
    253,
    1,
    0,
    0,
    0,
    252,
    205,
    1,
    0,
    0,
    0,
    252,
    233,
    1,
    0,
    0,
    0,
    253,
    58,
    1,
    0,
    0,
    0,
    254,
    260,
    5,
    34,
    0,
    0,
    255,
    259,
    8,
    22,
    0,
    0,
    256,
    257,
    5,
    92,
    0,
    0,
    257,
    259,
    9,
    0,
    0,
    0,
    258,
    255,
    1,
    0,
    0,
    0,
    258,
    256,
    1,
    0,
    0,
    0,
    259,
    262,
    1,
    0,
    0,
    0,
    260,
    258,
    1,
    0,
    0,
    0,
    260,
    261,
    1,
    0,
    0,
    0,
    261,
    263,
    1,
    0,
    0,
    0,
    262,
    260,
    1,
    0,
    0,
    0,
    263,
    275,
    5,
    34,
    0,
    0,
    264,
    270,
    5,
    39,
    0,
    0,
    265,
    269,
    8,
    23,
    0,
    0,
    266,
    267,
    5,
    92,
    0,
    0,
    267,
    269,
    9,
    0,
    0,
    0,
    268,
    265,
    1,
    0,
    0,
    0,
    268,
    266,
    1,
    0,
    0,
    0,
    269,
    272,
    1,
    0,
    0,
    0,
    270,
    268,
    1,
    0,
    0,
    0,
    270,
    271,
    1,
    0,
    0,
    0,
    271,
    273,
    1,
    0,
    0,
    0,
    272,
    270,
    1,
    0,
    0,
    0,
    273,
    275,
    5,
    39,
    0,
    0,
    274,
    254,
    1,
    0,
    0,
    0,
    274,
    264,
    1,
    0,
    0,
    0,
    275,
    60,
    1,
    0,
    0,
    0,
    276,
    280,
    7,
    24,
    0,
    0,
    277,
    279,
    7,
    25,
    0,
    0,
    278,
    277,
    1,
    0,
    0,
    0,
    279,
    282,
    1,
    0,
    0,
    0,
    280,
    278,
    1,
    0,
    0,
    0,
    280,
    281,
    1,
    0,
    0,
    0,
    281,
    62,
    1,
    0,
    0,
    0,
    282,
    280,
    1,
    0,
    0,
    0,
    283,
    284,
    5,
    91,
    0,
    0,
    284,
    285,
    5,
    93,
    0,
    0,
    285,
    64,
    1,
    0,
    0,
    0,
    286,
    287,
    5,
    91,
    0,
    0,
    287,
    288,
    5,
    42,
    0,
    0,
    288,
    289,
    5,
    93,
    0,
    0,
    289,
    66,
    1,
    0,
    0,
    0,
    290,
    303,
    3,
    61,
    30,
    0,
    291,
    292,
    5,
    46,
    0,
    0,
    292,
    302,
    3,
    61,
    30,
    0,
    293,
    302,
    3,
    63,
    31,
    0,
    294,
    302,
    3,
    65,
    32,
    0,
    295,
    297,
    5,
    46,
    0,
    0,
    296,
    298,
    3,
    71,
    35,
    0,
    297,
    296,
    1,
    0,
    0,
    0,
    298,
    299,
    1,
    0,
    0,
    0,
    299,
    297,
    1,
    0,
    0,
    0,
    299,
    300,
    1,
    0,
    0,
    0,
    300,
    302,
    1,
    0,
    0,
    0,
    301,
    291,
    1,
    0,
    0,
    0,
    301,
    293,
    1,
    0,
    0,
    0,
    301,
    294,
    1,
    0,
    0,
    0,
    301,
    295,
    1,
    0,
    0,
    0,
    302,
    305,
    1,
    0,
    0,
    0,
    303,
    301,
    1,
    0,
    0,
    0,
    303,
    304,
    1,
    0,
    0,
    0,
    304,
    68,
    1,
    0,
    0,
    0,
    305,
    303,
    1,
    0,
    0,
    0,
    306,
    308,
    7,
    26,
    0,
    0,
    307,
    306,
    1,
    0,
    0,
    0,
    308,
    309,
    1,
    0,
    0,
    0,
    309,
    307,
    1,
    0,
    0,
    0,
    309,
    310,
    1,
    0,
    0,
    0,
    310,
    311,
    1,
    0,
    0,
    0,
    311,
    312,
    6,
    34,
    0,
    0,
    312,
    70,
    1,
    0,
    0,
    0,
    313,
    314,
    7,
    27,
    0,
    0,
    314,
    72,
    1,
    0,
    0,
    0,
    315,
    317,
    8,
    28,
    0,
    0,
    316,
    315,
    1,
    0,
    0,
    0,
    317,
    318,
    1,
    0,
    0,
    0,
    318,
    316,
    1,
    0,
    0,
    0,
    318,
    319,
    1,
    0,
    0,
    0,
    319,
    74,
    1,
    0,
    0,
    0,
    29,
    0,
    88,
    131,
    148,
    200,
    205,
    210,
    216,
    219,
    223,
    228,
    230,
    233,
    239,
    243,
    248,
    250,
    252,
    258,
    260,
    268,
    270,
    274,
    280,
    299,
    301,
    303,
    309,
    318,
    1,
    6,
    0,
    0
  ];
  static __ATN;
  static get _ATN() {
    return vt.__ATN || (vt.__ATN = new R8().deserialize(vt._serializedATN)), vt.__ATN;
  }
  static DecisionsToDFA = vt._ATN.decisionToState.map(
    (e, n) => new D8(e, n)
  );
}
function Ewe(t) {
  return t === vt.KEY;
}
function tb(t) {
  return [
    vt.EQUALS,
    vt.NOT_EQUALS,
    vt.NEQ,
    vt.LT,
    vt.LE,
    vt.GT,
    vt.GE,
    vt.LIKE,
    vt.ILIKE,
    vt.BETWEEN,
    vt.EXISTS,
    vt.REGEXP,
    vt.CONTAINS,
    vt.IN,
    vt.NOT
  ].includes(t);
}
function _we(t) {
  return [vt.EXISTS].includes(t);
}
function Cf(t) {
  return [
    vt.QUOTED_TEXT,
    vt.NUMBER,
    vt.BOOL,
    vt.KEY
  ].includes(t);
}
function Yk(t) {
  return [vt.AND, vt.OR].includes(t);
}
function Iwe(t) {
  return [
    vt.LPAREN,
    vt.RPAREN,
    vt.LBRACK,
    vt.RBRACK
  ].includes(t);
}
function Kk(t) {
  return t ? t.toUpperCase() === "IN" : !1;
}
function Mwe(t) {
  return [
    vt.HAS,
    vt.HASANY,
    vt.HASALL,
    vt.HASTOKEN
  ].includes(t);
}
function Xm(t) {
  const e = t.toUpperCase();
  if (nA.includes(e))
    return !0;
  if (e.startsWith(un.NOT)) {
    const n = e.slice(4).trim();
    return nA.includes(n);
  }
  return !1;
}
class He extends Twe {
  static LPAREN = 1;
  static RPAREN = 2;
  static LBRACK = 3;
  static RBRACK = 4;
  static COMMA = 5;
  static EQUALS = 6;
  static NOT_EQUALS = 7;
  static NEQ = 8;
  static LT = 9;
  static LE = 10;
  static GT = 11;
  static GE = 12;
  static LIKE = 13;
  static ILIKE = 14;
  static BETWEEN = 15;
  static EXISTS = 16;
  static REGEXP = 17;
  static CONTAINS = 18;
  static IN = 19;
  static NOT = 20;
  static AND = 21;
  static OR = 22;
  static HASTOKEN = 23;
  static HAS = 24;
  static HASANY = 25;
  static HASALL = 26;
  static BOOL = 27;
  static NUMBER = 28;
  static QUOTED_TEXT = 29;
  static KEY = 30;
  static WS = 31;
  static FREETEXT = 32;
  static EOF = L8.EOF;
  static RULE_query = 0;
  static RULE_expression = 1;
  static RULE_orExpression = 2;
  static RULE_andExpression = 3;
  static RULE_unaryExpression = 4;
  static RULE_primary = 5;
  static RULE_comparison = 6;
  static RULE_inClause = 7;
  static RULE_notInClause = 8;
  static RULE_valueList = 9;
  static RULE_fullText = 10;
  static RULE_functionCall = 11;
  static RULE_functionParamList = 12;
  static RULE_functionParam = 13;
  static RULE_array = 14;
  static RULE_value = 15;
  static RULE_key = 16;
  static literalNames = [
    null,
    "'('",
    "')'",
    "'['",
    "']'",
    "','",
    null,
    "'!='",
    "'<>'",
    "'<'",
    "'<='",
    "'>'",
    "'>='"
  ];
  static symbolicNames = [
    null,
    "LPAREN",
    "RPAREN",
    "LBRACK",
    "RBRACK",
    "COMMA",
    "EQUALS",
    "NOT_EQUALS",
    "NEQ",
    "LT",
    "LE",
    "GT",
    "GE",
    "LIKE",
    "ILIKE",
    "BETWEEN",
    "EXISTS",
    "REGEXP",
    "CONTAINS",
    "IN",
    "NOT",
    "AND",
    "OR",
    "HASTOKEN",
    "HAS",
    "HASANY",
    "HASALL",
    "BOOL",
    "NUMBER",
    "QUOTED_TEXT",
    "KEY",
    "WS",
    "FREETEXT"
  ];
  // tslint:disable:no-trailing-whitespace
  static ruleNames = [
    "query",
    "expression",
    "orExpression",
    "andExpression",
    "unaryExpression",
    "primary",
    "comparison",
    "inClause",
    "notInClause",
    "valueList",
    "fullText",
    "functionCall",
    "functionParamList",
    "functionParam",
    "array",
    "value",
    "key"
  ];
  get grammarFileName() {
    return "FilterQuery.g4";
  }
  get literalNames() {
    return He.literalNames;
  }
  get symbolicNames() {
    return He.symbolicNames;
  }
  get ruleNames() {
    return He.ruleNames;
  }
  get serializedATN() {
    return He._serializedATN;
  }
  createFailedPredicateException(e, n) {
    return new Swe(this, e, n);
  }
  constructor(e) {
    super(e), this._interp = new Pwe(
      this,
      He._ATN,
      He.DecisionsToDFA,
      new N8()
    );
  }
  // @RuleVersion(0)
  query() {
    const e = new Awe(this, this._ctx, this.state);
    this.enterRule(e, 0, He.RULE_query);
    try {
      this.enterOuterAlt(e, 1), this.state = 34, this.expression(), this.state = 35, this.match(He.EOF);
    } catch (n) {
      if (n instanceof To)
        e.exception = n, this._errHandler.reportError(this, n), this._errHandler.recover(this, n);
      else
        throw n;
    } finally {
      this.exitRule();
    }
    return e;
  }
  // @RuleVersion(0)
  expression() {
    const e = new z8(this, this._ctx, this.state);
    this.enterRule(e, 2, He.RULE_expression);
    try {
      this.enterOuterAlt(e, 1), this.state = 37, this.orExpression();
    } catch (n) {
      if (n instanceof To)
        e.exception = n, this._errHandler.reportError(this, n), this._errHandler.recover(this, n);
      else
        throw n;
    } finally {
      this.exitRule();
    }
    return e;
  }
  // @RuleVersion(0)
  orExpression() {
    const e = new Xk(this, this._ctx, this.state);
    this.enterRule(e, 4, He.RULE_orExpression);
    let n;
    try {
      for (this.enterOuterAlt(e, 1), this.state = 39, this.andExpression(), this.state = 44, this._errHandler.sync(this), n = this._input.LA(1); n === 22; )
        this.state = 40, this.match(He.OR), this.state = 41, this.andExpression(), this.state = 46, this._errHandler.sync(this), n = this._input.LA(1);
    } catch (i) {
      if (i instanceof To)
        e.exception = i, this._errHandler.reportError(this, i), this._errHandler.recover(this, i);
      else
        throw i;
    } finally {
      this.exitRule();
    }
    return e;
  }
  // @RuleVersion(0)
  andExpression() {
    const e = new dw(this, this._ctx, this.state);
    this.enterRule(e, 6, He.RULE_andExpression);
    let n;
    try {
      for (this.enterOuterAlt(e, 1), this.state = 47, this.unaryExpression(), this.state = 53, this._errHandler.sync(this), n = this._input.LA(1); (n - 1 & -32) === 0 && (1 << n - 1 & 3218604033) !== 0; ) {
        switch (this.state = 51, this._errHandler.sync(this), this._input.LA(1)) {
          case 21:
            this.state = 48, this.match(He.AND), this.state = 49, this.unaryExpression();
            break;
          case 1:
          case 20:
          case 23:
          case 24:
          case 25:
          case 26:
          case 27:
          case 28:
          case 29:
          case 30:
          case 32:
            this.state = 50, this.unaryExpression();
            break;
          default:
            throw new $we(this);
        }
        this.state = 55, this._errHandler.sync(this), n = this._input.LA(1);
      }
    } catch (i) {
      if (i instanceof To)
        e.exception = i, this._errHandler.reportError(this, i), this._errHandler.recover(this, i);
      else
        throw i;
    } finally {
      this.exitRule();
    }
    return e;
  }
  // @RuleVersion(0)
  unaryExpression() {
    const e = new fw(
      this,
      this._ctx,
      this.state
    );
    this.enterRule(e, 8, He.RULE_unaryExpression);
    let n;
    try {
      this.enterOuterAlt(e, 1), this.state = 57, this._errHandler.sync(this), n = this._input.LA(1), n === 20 && (this.state = 56, this.match(He.NOT)), this.state = 59, this.primary();
    } catch (i) {
      if (i instanceof To)
        e.exception = i, this._errHandler.reportError(this, i), this._errHandler.recover(this, i);
      else
        throw i;
    } finally {
      this.exitRule();
    }
    return e;
  }
  // @RuleVersion(0)
  primary() {
    const e = new B8(this, this._ctx, this.state);
    this.enterRule(e, 10, He.RULE_primary);
    try {
      switch (this.state = 70, this._errHandler.sync(this), this._interp.adaptivePredict(this._input, 4, this._ctx)) {
        case 1:
          this.enterOuterAlt(e, 1), this.state = 61, this.match(He.LPAREN), this.state = 62, this.orExpression(), this.state = 63, this.match(He.RPAREN);
          break;
        case 2:
          this.enterOuterAlt(e, 2), this.state = 65, this.comparison();
          break;
        case 3:
          this.enterOuterAlt(e, 3), this.state = 66, this.functionCall();
          break;
        case 4:
          this.enterOuterAlt(e, 4), this.state = 67, this.fullText();
          break;
        case 5:
          this.enterOuterAlt(e, 5), this.state = 68, this.key();
          break;
        case 6:
          this.enterOuterAlt(e, 6), this.state = 69, this.value();
          break;
      }
    } catch (n) {
      if (n instanceof To)
        e.exception = n, this._errHandler.reportError(this, n), this._errHandler.recover(this, n);
      else
        throw n;
    } finally {
      this.exitRule();
    }
    return e;
  }
  // @RuleVersion(0)
  comparison() {
    const e = new F8(this, this._ctx, this.state);
    this.enterRule(e, 12, He.RULE_comparison);
    let n;
    try {
      switch (this.state = 149, this._errHandler.sync(this), this._interp.adaptivePredict(this._input, 5, this._ctx)) {
        case 1:
          this.enterOuterAlt(e, 1), this.state = 72, this.key(), this.state = 73, this.match(He.EQUALS), this.state = 74, this.value();
          break;
        case 2:
          this.enterOuterAlt(e, 2), this.state = 76, this.key(), this.state = 77, n = this._input.LA(1), n === 7 || n === 8 ? (this._errHandler.reportMatch(this), this.consume()) : this._errHandler.recoverInline(this), this.state = 78, this.value();
          break;
        case 3:
          this.enterOuterAlt(e, 3), this.state = 80, this.key(), this.state = 81, this.match(He.LT), this.state = 82, this.value();
          break;
        case 4:
          this.enterOuterAlt(e, 4), this.state = 84, this.key(), this.state = 85, this.match(He.LE), this.state = 86, this.value();
          break;
        case 5:
          this.enterOuterAlt(e, 5), this.state = 88, this.key(), this.state = 89, this.match(He.GT), this.state = 90, this.value();
          break;
        case 6:
          this.enterOuterAlt(e, 6), this.state = 92, this.key(), this.state = 93, this.match(He.GE), this.state = 94, this.value();
          break;
        case 7:
          this.enterOuterAlt(e, 7), this.state = 96, this.key(), this.state = 97, n = this._input.LA(1), n === 13 || n === 14 ? (this._errHandler.reportMatch(this), this.consume()) : this._errHandler.recoverInline(this), this.state = 98, this.value();
          break;
        case 8:
          this.enterOuterAlt(e, 8), this.state = 100, this.key(), this.state = 101, this.match(He.NOT), this.state = 102, n = this._input.LA(1), n === 13 || n === 14 ? (this._errHandler.reportMatch(this), this.consume()) : this._errHandler.recoverInline(this), this.state = 103, this.value();
          break;
        case 9:
          this.enterOuterAlt(e, 9), this.state = 105, this.key(), this.state = 106, this.match(He.BETWEEN), this.state = 107, this.value(), this.state = 108, this.match(He.AND), this.state = 109, this.value();
          break;
        case 10:
          this.enterOuterAlt(e, 10), this.state = 111, this.key(), this.state = 112, this.match(He.NOT), this.state = 113, this.match(He.BETWEEN), this.state = 114, this.value(), this.state = 115, this.match(He.AND), this.state = 116, this.value();
          break;
        case 11:
          this.enterOuterAlt(e, 11), this.state = 118, this.key(), this.state = 119, this.inClause();
          break;
        case 12:
          this.enterOuterAlt(e, 12), this.state = 121, this.key(), this.state = 122, this.notInClause();
          break;
        case 13:
          this.enterOuterAlt(e, 13), this.state = 124, this.key(), this.state = 125, this.match(He.EXISTS);
          break;
        case 14:
          this.enterOuterAlt(e, 14), this.state = 127, this.key(), this.state = 128, this.match(He.NOT), this.state = 129, this.match(He.EXISTS);
          break;
        case 15:
          this.enterOuterAlt(e, 15), this.state = 131, this.key(), this.state = 132, this.match(He.REGEXP), this.state = 133, this.value();
          break;
        case 16:
          this.enterOuterAlt(e, 16), this.state = 135, this.key(), this.state = 136, this.match(He.NOT), this.state = 137, this.match(He.REGEXP), this.state = 138, this.value();
          break;
        case 17:
          this.enterOuterAlt(e, 17), this.state = 140, this.key(), this.state = 141, this.match(He.CONTAINS), this.state = 142, this.value();
          break;
        case 18:
          this.enterOuterAlt(e, 18), this.state = 144, this.key(), this.state = 145, this.match(He.NOT), this.state = 146, this.match(He.CONTAINS), this.state = 147, this.value();
          break;
      }
    } catch (i) {
      if (i instanceof To)
        e.exception = i, this._errHandler.reportError(this, i), this._errHandler.recover(this, i);
      else
        throw i;
    } finally {
      this.exitRule();
    }
    return e;
  }
  // @RuleVersion(0)
  inClause() {
    const e = new V8(this, this._ctx, this.state);
    this.enterRule(e, 14, He.RULE_inClause);
    try {
      switch (this.state = 163, this._errHandler.sync(this), this._interp.adaptivePredict(this._input, 6, this._ctx)) {
        case 1:
          this.enterOuterAlt(e, 1), this.state = 151, this.match(He.IN), this.state = 152, this.match(He.LPAREN), this.state = 153, this.valueList(), this.state = 154, this.match(He.RPAREN);
          break;
        case 2:
          this.enterOuterAlt(e, 2), this.state = 156, this.match(He.IN), this.state = 157, this.match(He.LBRACK), this.state = 158, this.valueList(), this.state = 159, this.match(He.RBRACK);
          break;
        case 3:
          this.enterOuterAlt(e, 3), this.state = 161, this.match(He.IN), this.state = 162, this.value();
          break;
      }
    } catch (n) {
      if (n instanceof To)
        e.exception = n, this._errHandler.reportError(this, n), this._errHandler.recover(this, n);
      else
        throw n;
    } finally {
      this.exitRule();
    }
    return e;
  }
  // @RuleVersion(0)
  notInClause() {
    const e = new Q8(this, this._ctx, this.state);
    this.enterRule(e, 16, He.RULE_notInClause);
    try {
      switch (this.state = 180, this._errHandler.sync(this), this._interp.adaptivePredict(this._input, 7, this._ctx)) {
        case 1:
          this.enterOuterAlt(e, 1), this.state = 165, this.match(He.NOT), this.state = 166, this.match(He.IN), this.state = 167, this.match(He.LPAREN), this.state = 168, this.valueList(), this.state = 169, this.match(He.RPAREN);
          break;
        case 2:
          this.enterOuterAlt(e, 2), this.state = 171, this.match(He.NOT), this.state = 172, this.match(He.IN), this.state = 173, this.match(He.LBRACK), this.state = 174, this.valueList(), this.state = 175, this.match(He.RBRACK);
          break;
        case 3:
          this.enterOuterAlt(e, 3), this.state = 177, this.match(He.NOT), this.state = 178, this.match(He.IN), this.state = 179, this.value();
          break;
      }
    } catch (n) {
      if (n instanceof To)
        e.exception = n, this._errHandler.reportError(this, n), this._errHandler.recover(this, n);
      else
        throw n;
    } finally {
      this.exitRule();
    }
    return e;
  }
  // @RuleVersion(0)
  valueList() {
    const e = new nb(this, this._ctx, this.state);
    this.enterRule(e, 18, He.RULE_valueList);
    let n;
    try {
      for (this.enterOuterAlt(e, 1), this.state = 182, this.value(), this.state = 187, this._errHandler.sync(this), n = this._input.LA(1); n === 5; )
        this.state = 183, this.match(He.COMMA), this.state = 184, this.value(), this.state = 189, this._errHandler.sync(this), n = this._input.LA(1);
    } catch (i) {
      if (i instanceof To)
        e.exception = i, this._errHandler.reportError(this, i), this._errHandler.recover(this, i);
      else
        throw i;
    } finally {
      this.exitRule();
    }
    return e;
  }
  // @RuleVersion(0)
  fullText() {
    const e = new H8(this, this._ctx, this.state);
    this.enterRule(e, 20, He.RULE_fullText);
    let n;
    try {
      this.enterOuterAlt(e, 1), this.state = 190, n = this._input.LA(1), n === 29 || n === 32 ? (this._errHandler.reportMatch(this), this.consume()) : this._errHandler.recoverInline(this);
    } catch (i) {
      if (i instanceof To)
        e.exception = i, this._errHandler.reportError(this, i), this._errHandler.recover(this, i);
      else
        throw i;
    } finally {
      this.exitRule();
    }
    return e;
  }
  // @RuleVersion(0)
  functionCall() {
    const e = new W8(this, this._ctx, this.state);
    this.enterRule(e, 22, He.RULE_functionCall);
    let n;
    try {
      this.enterOuterAlt(e, 1), this.state = 192, n = this._input.LA(1), (n & -32) === 0 && (1 << n & 125829120) !== 0 ? (this._errHandler.reportMatch(this), this.consume()) : this._errHandler.recoverInline(this), this.state = 193, this.match(He.LPAREN), this.state = 194, this.functionParamList(), this.state = 195, this.match(He.RPAREN);
    } catch (i) {
      if (i instanceof To)
        e.exception = i, this._errHandler.reportError(this, i), this._errHandler.recover(this, i);
      else
        throw i;
    } finally {
      this.exitRule();
    }
    return e;
  }
  // @RuleVersion(0)
  functionParamList() {
    const e = new j8(
      this,
      this._ctx,
      this.state
    );
    this.enterRule(e, 24, He.RULE_functionParamList);
    let n;
    try {
      for (this.enterOuterAlt(e, 1), this.state = 197, this.functionParam(), this.state = 202, this._errHandler.sync(this), n = this._input.LA(1); n === 5; )
        this.state = 198, this.match(He.COMMA), this.state = 199, this.functionParam(), this.state = 204, this._errHandler.sync(this), n = this._input.LA(1);
    } catch (i) {
      if (i instanceof To)
        e.exception = i, this._errHandler.reportError(this, i), this._errHandler.recover(this, i);
      else
        throw i;
    } finally {
      this.exitRule();
    }
    return e;
  }
  // @RuleVersion(0)
  functionParam() {
    const e = new hw(this, this._ctx, this.state);
    this.enterRule(e, 26, He.RULE_functionParam);
    try {
      switch (this.state = 208, this._errHandler.sync(this), this._interp.adaptivePredict(this._input, 10, this._ctx)) {
        case 1:
          this.enterOuterAlt(e, 1), this.state = 205, this.key();
          break;
        case 2:
          this.enterOuterAlt(e, 2), this.state = 206, this.value();
          break;
        case 3:
          this.enterOuterAlt(e, 3), this.state = 207, this.array();
          break;
      }
    } catch (n) {
      if (n instanceof To)
        e.exception = n, this._errHandler.reportError(this, n), this._errHandler.recover(this, n);
      else
        throw n;
    } finally {
      this.exitRule();
    }
    return e;
  }
  // @RuleVersion(0)
  array() {
    const e = new q8(this, this._ctx, this.state);
    this.enterRule(e, 28, He.RULE_array);
    try {
      this.enterOuterAlt(e, 1), this.state = 210, this.match(He.LBRACK), this.state = 211, this.valueList(), this.state = 212, this.match(He.RBRACK);
    } catch (n) {
      if (n instanceof To)
        e.exception = n, this._errHandler.reportError(this, n), this._errHandler.recover(this, n);
      else
        throw n;
    } finally {
      this.exitRule();
    }
    return e;
  }
  // @RuleVersion(0)
  value() {
    const e = new Ds(this, this._ctx, this.state);
    this.enterRule(e, 30, He.RULE_value);
    let n;
    try {
      this.enterOuterAlt(e, 1), this.state = 214, n = this._input.LA(1), (n & -32) === 0 && (1 << n & 2013265920) !== 0 ? (this._errHandler.reportMatch(this), this.consume()) : this._errHandler.recoverInline(this);
    } catch (i) {
      if (i instanceof To)
        e.exception = i, this._errHandler.reportError(this, i), this._errHandler.recover(this, i);
      else
        throw i;
    } finally {
      this.exitRule();
    }
    return e;
  }
  // @RuleVersion(0)
  key() {
    const e = new ib(this, this._ctx, this.state);
    this.enterRule(e, 32, He.RULE_key);
    try {
      this.enterOuterAlt(e, 1), this.state = 216, this.match(He.KEY);
    } catch (n) {
      if (n instanceof To)
        e.exception = n, this._errHandler.reportError(this, n), this._errHandler.recover(this, n);
      else
        throw n;
    } finally {
      this.exitRule();
    }
    return e;
  }
  static _serializedATN = [
    4,
    1,
    32,
    219,
    2,
    0,
    7,
    0,
    2,
    1,
    7,
    1,
    2,
    2,
    7,
    2,
    2,
    3,
    7,
    3,
    2,
    4,
    7,
    4,
    2,
    5,
    7,
    5,
    2,
    6,
    7,
    6,
    2,
    7,
    7,
    7,
    2,
    8,
    7,
    8,
    2,
    9,
    7,
    9,
    2,
    10,
    7,
    10,
    2,
    11,
    7,
    11,
    2,
    12,
    7,
    12,
    2,
    13,
    7,
    13,
    2,
    14,
    7,
    14,
    2,
    15,
    7,
    15,
    2,
    16,
    7,
    16,
    1,
    0,
    1,
    0,
    1,
    0,
    1,
    1,
    1,
    1,
    1,
    2,
    1,
    2,
    1,
    2,
    5,
    2,
    43,
    8,
    2,
    10,
    2,
    12,
    2,
    46,
    9,
    2,
    1,
    3,
    1,
    3,
    1,
    3,
    1,
    3,
    5,
    3,
    52,
    8,
    3,
    10,
    3,
    12,
    3,
    55,
    9,
    3,
    1,
    4,
    3,
    4,
    58,
    8,
    4,
    1,
    4,
    1,
    4,
    1,
    5,
    1,
    5,
    1,
    5,
    1,
    5,
    1,
    5,
    1,
    5,
    1,
    5,
    1,
    5,
    1,
    5,
    3,
    5,
    71,
    8,
    5,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    1,
    6,
    3,
    6,
    150,
    8,
    6,
    1,
    7,
    1,
    7,
    1,
    7,
    1,
    7,
    1,
    7,
    1,
    7,
    1,
    7,
    1,
    7,
    1,
    7,
    1,
    7,
    1,
    7,
    1,
    7,
    3,
    7,
    164,
    8,
    7,
    1,
    8,
    1,
    8,
    1,
    8,
    1,
    8,
    1,
    8,
    1,
    8,
    1,
    8,
    1,
    8,
    1,
    8,
    1,
    8,
    1,
    8,
    1,
    8,
    1,
    8,
    1,
    8,
    1,
    8,
    3,
    8,
    181,
    8,
    8,
    1,
    9,
    1,
    9,
    1,
    9,
    5,
    9,
    186,
    8,
    9,
    10,
    9,
    12,
    9,
    189,
    9,
    9,
    1,
    10,
    1,
    10,
    1,
    11,
    1,
    11,
    1,
    11,
    1,
    11,
    1,
    11,
    1,
    12,
    1,
    12,
    1,
    12,
    5,
    12,
    201,
    8,
    12,
    10,
    12,
    12,
    12,
    204,
    9,
    12,
    1,
    13,
    1,
    13,
    1,
    13,
    3,
    13,
    209,
    8,
    13,
    1,
    14,
    1,
    14,
    1,
    14,
    1,
    14,
    1,
    15,
    1,
    15,
    1,
    16,
    1,
    16,
    1,
    16,
    0,
    0,
    17,
    0,
    2,
    4,
    6,
    8,
    10,
    12,
    14,
    16,
    18,
    20,
    22,
    24,
    26,
    28,
    30,
    32,
    0,
    5,
    1,
    0,
    7,
    8,
    1,
    0,
    13,
    14,
    2,
    0,
    29,
    29,
    32,
    32,
    1,
    0,
    23,
    26,
    1,
    0,
    27,
    30,
    235,
    0,
    34,
    1,
    0,
    0,
    0,
    2,
    37,
    1,
    0,
    0,
    0,
    4,
    39,
    1,
    0,
    0,
    0,
    6,
    47,
    1,
    0,
    0,
    0,
    8,
    57,
    1,
    0,
    0,
    0,
    10,
    70,
    1,
    0,
    0,
    0,
    12,
    149,
    1,
    0,
    0,
    0,
    14,
    163,
    1,
    0,
    0,
    0,
    16,
    180,
    1,
    0,
    0,
    0,
    18,
    182,
    1,
    0,
    0,
    0,
    20,
    190,
    1,
    0,
    0,
    0,
    22,
    192,
    1,
    0,
    0,
    0,
    24,
    197,
    1,
    0,
    0,
    0,
    26,
    208,
    1,
    0,
    0,
    0,
    28,
    210,
    1,
    0,
    0,
    0,
    30,
    214,
    1,
    0,
    0,
    0,
    32,
    216,
    1,
    0,
    0,
    0,
    34,
    35,
    3,
    2,
    1,
    0,
    35,
    36,
    5,
    0,
    0,
    1,
    36,
    1,
    1,
    0,
    0,
    0,
    37,
    38,
    3,
    4,
    2,
    0,
    38,
    3,
    1,
    0,
    0,
    0,
    39,
    44,
    3,
    6,
    3,
    0,
    40,
    41,
    5,
    22,
    0,
    0,
    41,
    43,
    3,
    6,
    3,
    0,
    42,
    40,
    1,
    0,
    0,
    0,
    43,
    46,
    1,
    0,
    0,
    0,
    44,
    42,
    1,
    0,
    0,
    0,
    44,
    45,
    1,
    0,
    0,
    0,
    45,
    5,
    1,
    0,
    0,
    0,
    46,
    44,
    1,
    0,
    0,
    0,
    47,
    53,
    3,
    8,
    4,
    0,
    48,
    49,
    5,
    21,
    0,
    0,
    49,
    52,
    3,
    8,
    4,
    0,
    50,
    52,
    3,
    8,
    4,
    0,
    51,
    48,
    1,
    0,
    0,
    0,
    51,
    50,
    1,
    0,
    0,
    0,
    52,
    55,
    1,
    0,
    0,
    0,
    53,
    51,
    1,
    0,
    0,
    0,
    53,
    54,
    1,
    0,
    0,
    0,
    54,
    7,
    1,
    0,
    0,
    0,
    55,
    53,
    1,
    0,
    0,
    0,
    56,
    58,
    5,
    20,
    0,
    0,
    57,
    56,
    1,
    0,
    0,
    0,
    57,
    58,
    1,
    0,
    0,
    0,
    58,
    59,
    1,
    0,
    0,
    0,
    59,
    60,
    3,
    10,
    5,
    0,
    60,
    9,
    1,
    0,
    0,
    0,
    61,
    62,
    5,
    1,
    0,
    0,
    62,
    63,
    3,
    4,
    2,
    0,
    63,
    64,
    5,
    2,
    0,
    0,
    64,
    71,
    1,
    0,
    0,
    0,
    65,
    71,
    3,
    12,
    6,
    0,
    66,
    71,
    3,
    22,
    11,
    0,
    67,
    71,
    3,
    20,
    10,
    0,
    68,
    71,
    3,
    32,
    16,
    0,
    69,
    71,
    3,
    30,
    15,
    0,
    70,
    61,
    1,
    0,
    0,
    0,
    70,
    65,
    1,
    0,
    0,
    0,
    70,
    66,
    1,
    0,
    0,
    0,
    70,
    67,
    1,
    0,
    0,
    0,
    70,
    68,
    1,
    0,
    0,
    0,
    70,
    69,
    1,
    0,
    0,
    0,
    71,
    11,
    1,
    0,
    0,
    0,
    72,
    73,
    3,
    32,
    16,
    0,
    73,
    74,
    5,
    6,
    0,
    0,
    74,
    75,
    3,
    30,
    15,
    0,
    75,
    150,
    1,
    0,
    0,
    0,
    76,
    77,
    3,
    32,
    16,
    0,
    77,
    78,
    7,
    0,
    0,
    0,
    78,
    79,
    3,
    30,
    15,
    0,
    79,
    150,
    1,
    0,
    0,
    0,
    80,
    81,
    3,
    32,
    16,
    0,
    81,
    82,
    5,
    9,
    0,
    0,
    82,
    83,
    3,
    30,
    15,
    0,
    83,
    150,
    1,
    0,
    0,
    0,
    84,
    85,
    3,
    32,
    16,
    0,
    85,
    86,
    5,
    10,
    0,
    0,
    86,
    87,
    3,
    30,
    15,
    0,
    87,
    150,
    1,
    0,
    0,
    0,
    88,
    89,
    3,
    32,
    16,
    0,
    89,
    90,
    5,
    11,
    0,
    0,
    90,
    91,
    3,
    30,
    15,
    0,
    91,
    150,
    1,
    0,
    0,
    0,
    92,
    93,
    3,
    32,
    16,
    0,
    93,
    94,
    5,
    12,
    0,
    0,
    94,
    95,
    3,
    30,
    15,
    0,
    95,
    150,
    1,
    0,
    0,
    0,
    96,
    97,
    3,
    32,
    16,
    0,
    97,
    98,
    7,
    1,
    0,
    0,
    98,
    99,
    3,
    30,
    15,
    0,
    99,
    150,
    1,
    0,
    0,
    0,
    100,
    101,
    3,
    32,
    16,
    0,
    101,
    102,
    5,
    20,
    0,
    0,
    102,
    103,
    7,
    1,
    0,
    0,
    103,
    104,
    3,
    30,
    15,
    0,
    104,
    150,
    1,
    0,
    0,
    0,
    105,
    106,
    3,
    32,
    16,
    0,
    106,
    107,
    5,
    15,
    0,
    0,
    107,
    108,
    3,
    30,
    15,
    0,
    108,
    109,
    5,
    21,
    0,
    0,
    109,
    110,
    3,
    30,
    15,
    0,
    110,
    150,
    1,
    0,
    0,
    0,
    111,
    112,
    3,
    32,
    16,
    0,
    112,
    113,
    5,
    20,
    0,
    0,
    113,
    114,
    5,
    15,
    0,
    0,
    114,
    115,
    3,
    30,
    15,
    0,
    115,
    116,
    5,
    21,
    0,
    0,
    116,
    117,
    3,
    30,
    15,
    0,
    117,
    150,
    1,
    0,
    0,
    0,
    118,
    119,
    3,
    32,
    16,
    0,
    119,
    120,
    3,
    14,
    7,
    0,
    120,
    150,
    1,
    0,
    0,
    0,
    121,
    122,
    3,
    32,
    16,
    0,
    122,
    123,
    3,
    16,
    8,
    0,
    123,
    150,
    1,
    0,
    0,
    0,
    124,
    125,
    3,
    32,
    16,
    0,
    125,
    126,
    5,
    16,
    0,
    0,
    126,
    150,
    1,
    0,
    0,
    0,
    127,
    128,
    3,
    32,
    16,
    0,
    128,
    129,
    5,
    20,
    0,
    0,
    129,
    130,
    5,
    16,
    0,
    0,
    130,
    150,
    1,
    0,
    0,
    0,
    131,
    132,
    3,
    32,
    16,
    0,
    132,
    133,
    5,
    17,
    0,
    0,
    133,
    134,
    3,
    30,
    15,
    0,
    134,
    150,
    1,
    0,
    0,
    0,
    135,
    136,
    3,
    32,
    16,
    0,
    136,
    137,
    5,
    20,
    0,
    0,
    137,
    138,
    5,
    17,
    0,
    0,
    138,
    139,
    3,
    30,
    15,
    0,
    139,
    150,
    1,
    0,
    0,
    0,
    140,
    141,
    3,
    32,
    16,
    0,
    141,
    142,
    5,
    18,
    0,
    0,
    142,
    143,
    3,
    30,
    15,
    0,
    143,
    150,
    1,
    0,
    0,
    0,
    144,
    145,
    3,
    32,
    16,
    0,
    145,
    146,
    5,
    20,
    0,
    0,
    146,
    147,
    5,
    18,
    0,
    0,
    147,
    148,
    3,
    30,
    15,
    0,
    148,
    150,
    1,
    0,
    0,
    0,
    149,
    72,
    1,
    0,
    0,
    0,
    149,
    76,
    1,
    0,
    0,
    0,
    149,
    80,
    1,
    0,
    0,
    0,
    149,
    84,
    1,
    0,
    0,
    0,
    149,
    88,
    1,
    0,
    0,
    0,
    149,
    92,
    1,
    0,
    0,
    0,
    149,
    96,
    1,
    0,
    0,
    0,
    149,
    100,
    1,
    0,
    0,
    0,
    149,
    105,
    1,
    0,
    0,
    0,
    149,
    111,
    1,
    0,
    0,
    0,
    149,
    118,
    1,
    0,
    0,
    0,
    149,
    121,
    1,
    0,
    0,
    0,
    149,
    124,
    1,
    0,
    0,
    0,
    149,
    127,
    1,
    0,
    0,
    0,
    149,
    131,
    1,
    0,
    0,
    0,
    149,
    135,
    1,
    0,
    0,
    0,
    149,
    140,
    1,
    0,
    0,
    0,
    149,
    144,
    1,
    0,
    0,
    0,
    150,
    13,
    1,
    0,
    0,
    0,
    151,
    152,
    5,
    19,
    0,
    0,
    152,
    153,
    5,
    1,
    0,
    0,
    153,
    154,
    3,
    18,
    9,
    0,
    154,
    155,
    5,
    2,
    0,
    0,
    155,
    164,
    1,
    0,
    0,
    0,
    156,
    157,
    5,
    19,
    0,
    0,
    157,
    158,
    5,
    3,
    0,
    0,
    158,
    159,
    3,
    18,
    9,
    0,
    159,
    160,
    5,
    4,
    0,
    0,
    160,
    164,
    1,
    0,
    0,
    0,
    161,
    162,
    5,
    19,
    0,
    0,
    162,
    164,
    3,
    30,
    15,
    0,
    163,
    151,
    1,
    0,
    0,
    0,
    163,
    156,
    1,
    0,
    0,
    0,
    163,
    161,
    1,
    0,
    0,
    0,
    164,
    15,
    1,
    0,
    0,
    0,
    165,
    166,
    5,
    20,
    0,
    0,
    166,
    167,
    5,
    19,
    0,
    0,
    167,
    168,
    5,
    1,
    0,
    0,
    168,
    169,
    3,
    18,
    9,
    0,
    169,
    170,
    5,
    2,
    0,
    0,
    170,
    181,
    1,
    0,
    0,
    0,
    171,
    172,
    5,
    20,
    0,
    0,
    172,
    173,
    5,
    19,
    0,
    0,
    173,
    174,
    5,
    3,
    0,
    0,
    174,
    175,
    3,
    18,
    9,
    0,
    175,
    176,
    5,
    4,
    0,
    0,
    176,
    181,
    1,
    0,
    0,
    0,
    177,
    178,
    5,
    20,
    0,
    0,
    178,
    179,
    5,
    19,
    0,
    0,
    179,
    181,
    3,
    30,
    15,
    0,
    180,
    165,
    1,
    0,
    0,
    0,
    180,
    171,
    1,
    0,
    0,
    0,
    180,
    177,
    1,
    0,
    0,
    0,
    181,
    17,
    1,
    0,
    0,
    0,
    182,
    187,
    3,
    30,
    15,
    0,
    183,
    184,
    5,
    5,
    0,
    0,
    184,
    186,
    3,
    30,
    15,
    0,
    185,
    183,
    1,
    0,
    0,
    0,
    186,
    189,
    1,
    0,
    0,
    0,
    187,
    185,
    1,
    0,
    0,
    0,
    187,
    188,
    1,
    0,
    0,
    0,
    188,
    19,
    1,
    0,
    0,
    0,
    189,
    187,
    1,
    0,
    0,
    0,
    190,
    191,
    7,
    2,
    0,
    0,
    191,
    21,
    1,
    0,
    0,
    0,
    192,
    193,
    7,
    3,
    0,
    0,
    193,
    194,
    5,
    1,
    0,
    0,
    194,
    195,
    3,
    24,
    12,
    0,
    195,
    196,
    5,
    2,
    0,
    0,
    196,
    23,
    1,
    0,
    0,
    0,
    197,
    202,
    3,
    26,
    13,
    0,
    198,
    199,
    5,
    5,
    0,
    0,
    199,
    201,
    3,
    26,
    13,
    0,
    200,
    198,
    1,
    0,
    0,
    0,
    201,
    204,
    1,
    0,
    0,
    0,
    202,
    200,
    1,
    0,
    0,
    0,
    202,
    203,
    1,
    0,
    0,
    0,
    203,
    25,
    1,
    0,
    0,
    0,
    204,
    202,
    1,
    0,
    0,
    0,
    205,
    209,
    3,
    32,
    16,
    0,
    206,
    209,
    3,
    30,
    15,
    0,
    207,
    209,
    3,
    28,
    14,
    0,
    208,
    205,
    1,
    0,
    0,
    0,
    208,
    206,
    1,
    0,
    0,
    0,
    208,
    207,
    1,
    0,
    0,
    0,
    209,
    27,
    1,
    0,
    0,
    0,
    210,
    211,
    5,
    3,
    0,
    0,
    211,
    212,
    3,
    18,
    9,
    0,
    212,
    213,
    5,
    4,
    0,
    0,
    213,
    29,
    1,
    0,
    0,
    0,
    214,
    215,
    7,
    4,
    0,
    0,
    215,
    31,
    1,
    0,
    0,
    0,
    216,
    217,
    5,
    30,
    0,
    0,
    217,
    33,
    1,
    0,
    0,
    0,
    11,
    44,
    51,
    53,
    57,
    70,
    149,
    163,
    180,
    187,
    202,
    208
  ];
  static __ATN;
  static get _ATN() {
    return He.__ATN || (He.__ATN = new R8().deserialize(He._serializedATN)), He.__ATN;
  }
  static DecisionsToDFA = He._ATN.decisionToState.map(
    (e, n) => new D8(e, n)
  );
}
class Awe extends Lo {
  constructor(e, n, i) {
    super(n, i), this.parser = e;
  }
  expression() {
    return this.getTypedRuleContext(z8, 0);
  }
  EOF() {
    return this.getToken(He.EOF, 0);
  }
  get ruleIndex() {
    return He.RULE_query;
  }
  enterRule(e) {
    e.enterQuery && e.enterQuery(this);
  }
  exitRule(e) {
    e.exitQuery && e.exitQuery(this);
  }
  // @Override
  accept(e) {
    return e.visitQuery ? e.visitQuery(this) : e.visitChildren(this);
  }
}
class z8 extends Lo {
  constructor(e, n, i) {
    super(n, i), this.parser = e;
  }
  orExpression() {
    return this.getTypedRuleContext(Xk, 0);
  }
  get ruleIndex() {
    return He.RULE_expression;
  }
  enterRule(e) {
    e.enterExpression && e.enterExpression(this);
  }
  exitRule(e) {
    e.exitExpression && e.exitExpression(this);
  }
  // @Override
  accept(e) {
    return e.visitExpression ? e.visitExpression(this) : e.visitChildren(this);
  }
}
class Xk extends Lo {
  constructor(e, n, i) {
    super(n, i), this.parser = e;
  }
  andExpression_list() {
    return this.getTypedRuleContexts(dw);
  }
  andExpression(e) {
    return this.getTypedRuleContext(dw, e);
  }
  OR_list() {
    return this.getTokens(He.OR);
  }
  OR(e) {
    return this.getToken(He.OR, e);
  }
  get ruleIndex() {
    return He.RULE_orExpression;
  }
  enterRule(e) {
    e.enterOrExpression && e.enterOrExpression(this);
  }
  exitRule(e) {
    e.exitOrExpression && e.exitOrExpression(this);
  }
  // @Override
  accept(e) {
    return e.visitOrExpression ? e.visitOrExpression(this) : e.visitChildren(this);
  }
}
class dw extends Lo {
  constructor(e, n, i) {
    super(n, i), this.parser = e;
  }
  unaryExpression_list() {
    return this.getTypedRuleContexts(fw);
  }
  unaryExpression(e) {
    return this.getTypedRuleContext(fw, e);
  }
  AND_list() {
    return this.getTokens(He.AND);
  }
  AND(e) {
    return this.getToken(He.AND, e);
  }
  get ruleIndex() {
    return He.RULE_andExpression;
  }
  enterRule(e) {
    e.enterAndExpression && e.enterAndExpression(this);
  }
  exitRule(e) {
    e.exitAndExpression && e.exitAndExpression(this);
  }
  // @Override
  accept(e) {
    return e.visitAndExpression ? e.visitAndExpression(this) : e.visitChildren(this);
  }
}
class fw extends Lo {
  constructor(e, n, i) {
    super(n, i), this.parser = e;
  }
  primary() {
    return this.getTypedRuleContext(B8, 0);
  }
  NOT() {
    return this.getToken(He.NOT, 0);
  }
  get ruleIndex() {
    return He.RULE_unaryExpression;
  }
  enterRule(e) {
    e.enterUnaryExpression && e.enterUnaryExpression(this);
  }
  exitRule(e) {
    e.exitUnaryExpression && e.exitUnaryExpression(this);
  }
  // @Override
  accept(e) {
    return e.visitUnaryExpression ? e.visitUnaryExpression(this) : e.visitChildren(this);
  }
}
class B8 extends Lo {
  constructor(e, n, i) {
    super(n, i), this.parser = e;
  }
  LPAREN() {
    return this.getToken(He.LPAREN, 0);
  }
  orExpression() {
    return this.getTypedRuleContext(Xk, 0);
  }
  RPAREN() {
    return this.getToken(He.RPAREN, 0);
  }
  comparison() {
    return this.getTypedRuleContext(F8, 0);
  }
  functionCall() {
    return this.getTypedRuleContext(W8, 0);
  }
  fullText() {
    return this.getTypedRuleContext(H8, 0);
  }
  key() {
    return this.getTypedRuleContext(ib, 0);
  }
  value() {
    return this.getTypedRuleContext(Ds, 0);
  }
  get ruleIndex() {
    return He.RULE_primary;
  }
  enterRule(e) {
    e.enterPrimary && e.enterPrimary(this);
  }
  exitRule(e) {
    e.exitPrimary && e.exitPrimary(this);
  }
  // @Override
  accept(e) {
    return e.visitPrimary ? e.visitPrimary(this) : e.visitChildren(this);
  }
}
class F8 extends Lo {
  constructor(e, n, i) {
    super(n, i), this.parser = e;
  }
  key() {
    return this.getTypedRuleContext(ib, 0);
  }
  EQUALS() {
    return this.getToken(He.EQUALS, 0);
  }
  value_list() {
    return this.getTypedRuleContexts(Ds);
  }
  value(e) {
    return this.getTypedRuleContext(Ds, e);
  }
  NOT_EQUALS() {
    return this.getToken(He.NOT_EQUALS, 0);
  }
  NEQ() {
    return this.getToken(He.NEQ, 0);
  }
  LT() {
    return this.getToken(He.LT, 0);
  }
  LE() {
    return this.getToken(He.LE, 0);
  }
  GT() {
    return this.getToken(He.GT, 0);
  }
  GE() {
    return this.getToken(He.GE, 0);
  }
  LIKE() {
    return this.getToken(He.LIKE, 0);
  }
  ILIKE() {
    return this.getToken(He.ILIKE, 0);
  }
  NOT() {
    return this.getToken(He.NOT, 0);
  }
  BETWEEN() {
    return this.getToken(He.BETWEEN, 0);
  }
  AND() {
    return this.getToken(He.AND, 0);
  }
  inClause() {
    return this.getTypedRuleContext(V8, 0);
  }
  notInClause() {
    return this.getTypedRuleContext(Q8, 0);
  }
  EXISTS() {
    return this.getToken(He.EXISTS, 0);
  }
  REGEXP() {
    return this.getToken(He.REGEXP, 0);
  }
  CONTAINS() {
    return this.getToken(He.CONTAINS, 0);
  }
  get ruleIndex() {
    return He.RULE_comparison;
  }
  enterRule(e) {
    e.enterComparison && e.enterComparison(this);
  }
  exitRule(e) {
    e.exitComparison && e.exitComparison(this);
  }
  // @Override
  accept(e) {
    return e.visitComparison ? e.visitComparison(this) : e.visitChildren(this);
  }
}
class V8 extends Lo {
  constructor(e, n, i) {
    super(n, i), this.parser = e;
  }
  IN() {
    return this.getToken(He.IN, 0);
  }
  LPAREN() {
    return this.getToken(He.LPAREN, 0);
  }
  valueList() {
    return this.getTypedRuleContext(nb, 0);
  }
  RPAREN() {
    return this.getToken(He.RPAREN, 0);
  }
  LBRACK() {
    return this.getToken(He.LBRACK, 0);
  }
  RBRACK() {
    return this.getToken(He.RBRACK, 0);
  }
  value() {
    return this.getTypedRuleContext(Ds, 0);
  }
  get ruleIndex() {
    return He.RULE_inClause;
  }
  enterRule(e) {
    e.enterInClause && e.enterInClause(this);
  }
  exitRule(e) {
    e.exitInClause && e.exitInClause(this);
  }
  // @Override
  accept(e) {
    return e.visitInClause ? e.visitInClause(this) : e.visitChildren(this);
  }
}
class Q8 extends Lo {
  constructor(e, n, i) {
    super(n, i), this.parser = e;
  }
  NOT() {
    return this.getToken(He.NOT, 0);
  }
  IN() {
    return this.getToken(He.IN, 0);
  }
  LPAREN() {
    return this.getToken(He.LPAREN, 0);
  }
  valueList() {
    return this.getTypedRuleContext(nb, 0);
  }
  RPAREN() {
    return this.getToken(He.RPAREN, 0);
  }
  LBRACK() {
    return this.getToken(He.LBRACK, 0);
  }
  RBRACK() {
    return this.getToken(He.RBRACK, 0);
  }
  value() {
    return this.getTypedRuleContext(Ds, 0);
  }
  get ruleIndex() {
    return He.RULE_notInClause;
  }
  enterRule(e) {
    e.enterNotInClause && e.enterNotInClause(this);
  }
  exitRule(e) {
    e.exitNotInClause && e.exitNotInClause(this);
  }
  // @Override
  accept(e) {
    return e.visitNotInClause ? e.visitNotInClause(this) : e.visitChildren(this);
  }
}
class nb extends Lo {
  constructor(e, n, i) {
    super(n, i), this.parser = e;
  }
  value_list() {
    return this.getTypedRuleContexts(Ds);
  }
  value(e) {
    return this.getTypedRuleContext(Ds, e);
  }
  COMMA_list() {
    return this.getTokens(He.COMMA);
  }
  COMMA(e) {
    return this.getToken(He.COMMA, e);
  }
  get ruleIndex() {
    return He.RULE_valueList;
  }
  enterRule(e) {
    e.enterValueList && e.enterValueList(this);
  }
  exitRule(e) {
    e.exitValueList && e.exitValueList(this);
  }
  // @Override
  accept(e) {
    return e.visitValueList ? e.visitValueList(this) : e.visitChildren(this);
  }
}
class H8 extends Lo {
  constructor(e, n, i) {
    super(n, i), this.parser = e;
  }
  QUOTED_TEXT() {
    return this.getToken(He.QUOTED_TEXT, 0);
  }
  FREETEXT() {
    return this.getToken(He.FREETEXT, 0);
  }
  get ruleIndex() {
    return He.RULE_fullText;
  }
  enterRule(e) {
    e.enterFullText && e.enterFullText(this);
  }
  exitRule(e) {
    e.exitFullText && e.exitFullText(this);
  }
  // @Override
  accept(e) {
    return e.visitFullText ? e.visitFullText(this) : e.visitChildren(this);
  }
}
class W8 extends Lo {
  constructor(e, n, i) {
    super(n, i), this.parser = e;
  }
  LPAREN() {
    return this.getToken(He.LPAREN, 0);
  }
  functionParamList() {
    return this.getTypedRuleContext(j8, 0);
  }
  RPAREN() {
    return this.getToken(He.RPAREN, 0);
  }
  HASTOKEN() {
    return this.getToken(He.HASTOKEN, 0);
  }
  HAS() {
    return this.getToken(He.HAS, 0);
  }
  HASANY() {
    return this.getToken(He.HASANY, 0);
  }
  HASALL() {
    return this.getToken(He.HASALL, 0);
  }
  get ruleIndex() {
    return He.RULE_functionCall;
  }
  enterRule(e) {
    e.enterFunctionCall && e.enterFunctionCall(this);
  }
  exitRule(e) {
    e.exitFunctionCall && e.exitFunctionCall(this);
  }
  // @Override
  accept(e) {
    return e.visitFunctionCall ? e.visitFunctionCall(this) : e.visitChildren(this);
  }
}
class j8 extends Lo {
  constructor(e, n, i) {
    super(n, i), this.parser = e;
  }
  functionParam_list() {
    return this.getTypedRuleContexts(hw);
  }
  functionParam(e) {
    return this.getTypedRuleContext(hw, e);
  }
  COMMA_list() {
    return this.getTokens(He.COMMA);
  }
  COMMA(e) {
    return this.getToken(He.COMMA, e);
  }
  get ruleIndex() {
    return He.RULE_functionParamList;
  }
  enterRule(e) {
    e.enterFunctionParamList && e.enterFunctionParamList(this);
  }
  exitRule(e) {
    e.exitFunctionParamList && e.exitFunctionParamList(this);
  }
  // @Override
  accept(e) {
    return e.visitFunctionParamList ? e.visitFunctionParamList(this) : e.visitChildren(this);
  }
}
class hw extends Lo {
  constructor(e, n, i) {
    super(n, i), this.parser = e;
  }
  key() {
    return this.getTypedRuleContext(ib, 0);
  }
  value() {
    return this.getTypedRuleContext(Ds, 0);
  }
  array() {
    return this.getTypedRuleContext(q8, 0);
  }
  get ruleIndex() {
    return He.RULE_functionParam;
  }
  enterRule(e) {
    e.enterFunctionParam && e.enterFunctionParam(this);
  }
  exitRule(e) {
    e.exitFunctionParam && e.exitFunctionParam(this);
  }
  // @Override
  accept(e) {
    return e.visitFunctionParam ? e.visitFunctionParam(this) : e.visitChildren(this);
  }
}
class q8 extends Lo {
  constructor(e, n, i) {
    super(n, i), this.parser = e;
  }
  LBRACK() {
    return this.getToken(He.LBRACK, 0);
  }
  valueList() {
    return this.getTypedRuleContext(nb, 0);
  }
  RBRACK() {
    return this.getToken(He.RBRACK, 0);
  }
  get ruleIndex() {
    return He.RULE_array;
  }
  enterRule(e) {
    e.enterArray && e.enterArray(this);
  }
  exitRule(e) {
    e.exitArray && e.exitArray(this);
  }
  // @Override
  accept(e) {
    return e.visitArray ? e.visitArray(this) : e.visitChildren(this);
  }
}
class Ds extends Lo {
  constructor(e, n, i) {
    super(n, i), this.parser = e;
  }
  QUOTED_TEXT() {
    return this.getToken(He.QUOTED_TEXT, 0);
  }
  NUMBER() {
    return this.getToken(He.NUMBER, 0);
  }
  BOOL() {
    return this.getToken(He.BOOL, 0);
  }
  KEY() {
    return this.getToken(He.KEY, 0);
  }
  get ruleIndex() {
    return He.RULE_value;
  }
  enterRule(e) {
    e.enterValue && e.enterValue(this);
  }
  exitRule(e) {
    e.exitValue && e.exitValue(this);
  }
  // @Override
  accept(e) {
    return e.visitValue ? e.visitValue(this) : e.visitChildren(this);
  }
}
class ib extends Lo {
  constructor(e, n, i) {
    super(n, i), this.parser = e;
  }
  KEY() {
    return this.getToken(He.KEY, 0);
  }
  get ruleIndex() {
    return He.RULE_key;
  }
  enterRule(e) {
    e.enterKey && e.enterKey(this);
  }
  exitRule(e) {
    e.exitKey && e.exitKey(this);
  }
  // @Override
  accept(e) {
    return e.visitKey ? e.visitKey(this) : e.visitChildren(this);
  }
}
class mA extends Owe {
  syntaxError(...e) {
    console.info(e[4]);
  }
}
class Rwe {
  tokens = [];
  enterKey(e) {
    const n = e.KEY().symbol;
    this.tokens.push({
      text: n.text,
      startIndex: n.start,
      stopIndex: n.stop,
      type: "Key"
    });
  }
  enterValue(e) {
    const n = e.start;
    this.tokens.push({
      text: n.text,
      startIndex: n.start,
      stopIndex: n.stop,
      type: "Value"
    });
  }
  enterComparison(e) {
    const n = e.children || [];
    for (const i of n) {
      const o = i.symbol;
      o && tb(o.type) && this.tokens.push({
        text: o.text,
        startIndex: o.start,
        stopIndex: o.stop,
        type: "Operator"
      });
    }
  }
  // Required no-op stubs
  enterEveryRule() {
  }
  exitEveryRule() {
  }
  exitKey() {
  }
  exitValue() {
  }
  exitComparison() {
  }
  visitTerminal() {
  }
  visitErrorNode() {
  }
}
function Dwe(t, e) {
  t = t.trim();
  const n = Jy.fromString(t), i = new vt(n);
  i.removeErrorListeners(), i.addErrorListener(new mA());
  const o = new eb(i), r = new He(o);
  r.removeErrorListeners(), r.addErrorListener(new mA());
  const a = r.query(), l = new Rwe();
  return kwe.DEFAULT.walk(l, a), l.tokens.find(
    (u) => u.text === e.text && u.startIndex === e.start && u.stopIndex === e.stop
  );
}
function Zm(t, e) {
  let n = !1, i = !1, o = !1, r = !1, a = !1, l = !1, s = !1;
  const u = t.type, c = Dwe(e, t);
  if (!c)
    n = Ewe(u), o = tb(u), r = Cf(u);
  else
    switch (c.type) {
      case "Operator":
        o = !0;
        break;
      case "Value":
        r = !0;
        break;
      case "Key":
        n = !0;
        break;
    }
  return i = u === vt.NOT, a = Mwe(u), l = Yk(u), s = Iwe(u), {
    isInKey: n,
    isInNegation: i,
    isInOperator: o,
    isInValue: r,
    isInFunction: a,
    isInConjunction: l,
    isInParenthesis: s
  };
}
function vA(t, e) {
  if (!t || t.length === 0)
    return null;
  for (const [n, i] of t.entries()) {
    const o = i.start, r = i.end;
    if (o !== void 0 && r !== void 0 && o <= e && e <= r)
      return n;
  }
  return null;
}
function Nwe(t, e, n, i) {
  let o = null;
  i.length > 0 && (o = Y8(i, t, e));
  let r = null;
  const a = [];
  for (let s = 0; s < n.length; s++) {
    const u = n[s];
    if (u.channel === 0) {
      if (u.type === vt.LBRACK || u.type === vt.LPAREN) {
        let c = !1;
        if (s > 0)
          for (let d = s - 1; d >= 0; d--) {
            const f = n[d];
            if (f.channel === 0) {
              if (f.type === vt.IN || f.type === vt.NOT && d + 1 < n.length && n[d + 1].type === vt.IN) {
                c = !0;
                break;
              } else if (f.channel === 0 && !Cf(f.type))
                break;
            }
          }
        a.push({ token: u, isForList: c });
      } else if ((u.type === vt.RBRACK || u.type === vt.RPAREN) && a.length > 0) {
        const c = a.pop();
        if (c && c.token.start <= e && e <= u.stop + 1) {
          r = {
            start: c.token.start,
            end: u.stop,
            isForList: c.isForList
          };
          break;
        }
        if (c && u.stop + 1 < e && e <= u.stop + 2 && t[u.stop + 1] === " ") {
          r = {
            start: c.token.start,
            end: u.stop,
            isForList: c.isForList
          };
          break;
        }
      }
      if (u.start <= e && e <= u.stop + 1) {
        if (u.type === vt.LBRACK || u.type === vt.LPAREN) {
          let c = !1;
          for (let d = s - 1; d >= 0; d--) {
            const f = n[d];
            if (f.channel === 0) {
              if (f.type === vt.IN || f.type === vt.NOT && d + 1 < n.length && n[d + 1].type === vt.IN) {
                c = !0;
                break;
              } else if (f.channel === 0)
                break;
            }
          }
          r = {
            start: u.start,
            end: u.stop,
            isForList: c
          };
          break;
        }
        if (u.type === vt.RBRACK || u.type === vt.RPAREN) {
          if (a.length > 0) {
            const c = a[a.length - 1];
            r = {
              start: c.token.start,
              end: u.stop,
              isForList: c.isForList
            };
          } else
            r = {
              start: u.start,
              end: u.stop,
              isForList: !1
              // We don't know, assume not list
            };
          break;
        }
      }
    }
  }
  if (o) {
    const { position: s } = o, u = {
      start: s.negationStart ?? 0,
      end: s.negationEnd ?? 0
    }, c = {
      start: s.keyStart,
      end: s.keyEnd
    };
    let d = s.keyEnd + 1;
    for (; d < t.length && t[d] === " "; )
      d++;
    const f = {
      start: d,
      end: s.operatorEnd
    };
    let h = s.operatorEnd + 1;
    for (; h < t.length && t[h] === " "; )
      h++;
    const p = Kk(o.operator);
    let g = null;
    p && r && r.isForList ? g = {
      start: r.start,
      end: r.end
    } : s.valueEnd && (g = {
      start: h,
      end: s.valueEnd
    });
    let m = null;
    if (s.valueEnd) {
      let y = s.valueEnd + 1;
      for (; y < t.length && t[y] === " "; )
        y++;
      for (const b of n)
        if (b.start === y && (b.type === vt.AND || b.type === vt.OR)) {
          m = {
            start: y,
            end: b.stop
          };
          break;
        }
    }
    return {
      keyContext: c,
      negationContext: u,
      operatorContext: f,
      valueContext: g,
      conjunctionContext: m,
      bracketContext: r
    };
  }
  const l = n.find(
    (s) => s.channel === 0 && s.start <= e && e <= s.stop + 1
  );
  if (l) {
    if (l.type === vt.KEY)
      return {
        keyContext: { start: l.start, end: l.stop },
        negationContext: null,
        operatorContext: null,
        valueContext: null,
        conjunctionContext: null,
        bracketContext: r
      };
    if (l.type === vt.NOT)
      return {
        keyContext: null,
        negationContext: { start: l.start, end: l.stop },
        operatorContext: null,
        valueContext: null,
        conjunctionContext: null,
        bracketContext: r
      };
    if (tb(l.type))
      return {
        keyContext: null,
        negationContext: null,
        operatorContext: { start: l.start, end: l.stop },
        valueContext: null,
        conjunctionContext: null,
        bracketContext: r
      };
    if (Cf(l.type))
      return {
        keyContext: null,
        negationContext: null,
        operatorContext: null,
        valueContext: { start: l.start, end: l.stop },
        conjunctionContext: null,
        bracketContext: r
      };
    if (Yk(l.type))
      return {
        keyContext: null,
        negationContext: null,
        operatorContext: null,
        valueContext: null,
        conjunctionContext: { start: l.start, end: l.stop },
        bracketContext: r
      };
  }
  return {
    keyContext: null,
    negationContext: null,
    operatorContext: null,
    valueContext: null,
    conjunctionContext: null,
    bracketContext: r
  };
}
function yA(t, e) {
  try {
    if (((new Error().stack || "").match(/getQueryContextAtCursor/g) || []).length > 3)
      return console.warn("Potential infinite recursion detected in getQueryContextAtCursor"), {
        tokenType: -1,
        text: "",
        start: e,
        stop: e,
        currentToken: "",
        isInKey: !0,
        isInNegation: !1,
        isInOperator: !1,
        isInValue: !1,
        isInFunction: !1,
        isInConjunction: !1,
        isInParenthesis: !1,
        isInBracketList: !1,
        queryPairs: [],
        currentPair: null
      };
    const o = e < t.length && t[e] === " ", r = e > 0 && t[e - 1] === " ", a = e > 0 && t[e - 1] !== " ", l = o && a || e === t.length && a, s = t || "", u = Jy.fromString(s), c = new vt(u), d = new eb(c);
    d.fill();
    const f = d.tokens;
    let h = null, p = null, g = null, m = null;
    for (const N of f)
      if (N.type !== vt.EOF && ((N.stop < e || N.stop + 1 === e) && (m = N), N.start > e))
        break;
    const y = Lwe(t);
    let b = null;
    y.length > 0 && (b = Y8(y, t, e));
    const w = Nwe(t, e, f, y), $ = w.keyContext && (e >= w.keyContext.start && e <= w.keyContext.end || e === w.keyContext.end + 1), C = w.negationContext && (e >= w.negationContext.start && e <= w.negationContext.end || e === w.negationContext.end + 1), P = w.operatorContext && (e >= w.operatorContext.start && e <= w.operatorContext.end || e === w.operatorContext.end + 1), O = w.valueContext && (e >= w.valueContext.start && e <= w.valueContext.end || e === w.valueContext.end + 1), E = w.conjunctionContext && (e >= w.conjunctionContext.start && e <= w.conjunctionContext.end || e === w.conjunctionContext.end + 1), _ = w.bracketContext && w.bracketContext.isForList && e >= w.bracketContext.start && e <= w.bracketContext.end + 1, D = w.bracketContext && !w.bracketContext.isForList && e >= w.bracketContext.start && e <= w.bracketContext.end + 1, M = w.bracketContext && w.bracketContext.isForList && e === w.bracketContext.end + 2 && t[w.bracketContext.end + 1] === " ";
    if ($ || C || P || O || E || _ || M) {
      const N = b?.key || "", L = b?.operator || "", j = b?.value || "", B = Kk(L), Y = O || _ && B;
      return {
        tokenType: -1,
        text: "",
        start: e,
        stop: e,
        currentToken: "",
        isInKey: $ || !1,
        isInNegation: C || !1,
        isInOperator: P || !1,
        isInValue: Y || !1,
        isInConjunction: E || M || !1,
        isInFunction: !1,
        isInParenthesis: D || !1,
        isInBracketList: _ || !1,
        keyToken: $ || P || Y ? N : void 0,
        operatorToken: P || Y ? L : void 0,
        valueToken: Y ? j : void 0,
        queryPairs: y,
        currentPair: b
      };
    }
    if (e >= s.length && f.length > 0) {
      const N = f.findLast((L) => L.type !== vt.EOF);
      N && (h = N, p = f.findLast((L) => L.stop < N.start) || null);
    } else {
      for (let N = 0; N < f.length; N++) {
        const L = f[N];
        if (L.type !== vt.EOF && L.start <= e && e <= L.stop + 1) {
          h = L, p = N > 0 ? f[N - 1] : null, g = N < f.length - 1 ? f[N + 1] : null;
          break;
        }
      }
      if (!h)
        for (let N = 0; N < f.length - 1; N++) {
          const L = f[N], j = f[N + 1];
          if (!(L.type === vt.EOF || j.type === vt.EOF) && L.stop + 1 < e && e < j.start) {
            p = L, g = j;
            break;
          }
        }
    }
    if (!p && !g && !h && !m)
      return {
        tokenType: -1,
        text: "",
        start: e,
        stop: e,
        currentToken: "",
        isInKey: !0,
        // Default to key context when input is empty
        isInNegation: !1,
        isInOperator: !1,
        isInValue: !1,
        isInFunction: !1,
        isInConjunction: !1,
        isInParenthesis: !1,
        isInBracketList: !1,
        queryPairs: y,
        // Add all query pairs to the context
        currentPair: null
        // No current pair when query is empty
      };
    if (m && (o || r || l)) {
      const N = Zm(m, s);
      if (N.isInKey)
        return {
          tokenType: m.type,
          text: m.text,
          start: e,
          stop: e,
          currentToken: m.text,
          isInKey: !1,
          isInNegation: !1,
          isInOperator: !0,
          // After key + space, should be operator context
          isInValue: !1,
          isInFunction: !1,
          isInConjunction: !1,
          isInParenthesis: !1,
          isInBracketList: !1,
          keyToken: m.text,
          queryPairs: y,
          currentPair: b
        };
      if (N.isInNegation)
        return {
          tokenType: m.type,
          text: m.text,
          start: e,
          stop: e,
          currentToken: m.text,
          isInKey: !1,
          isInNegation: !1,
          isInOperator: !0,
          // After key + space + NOT, should be operator context
          isInValue: !1,
          isInFunction: !1,
          isInConjunction: !1,
          isInParenthesis: !1,
          isInBracketList: !1,
          keyToken: m.text,
          queryPairs: y,
          currentPair: b
        };
      if (N.isInOperator) {
        const L = b?.key || "", j = _we(m.type);
        return {
          tokenType: m.type,
          text: m.text,
          start: e,
          stop: e,
          currentToken: m.text,
          isInKey: !1,
          isInNegation: !1,
          isInOperator: !1,
          isInValue: !j,
          // After operator + space, should be value context
          isInFunction: !1,
          isInConjunction: j,
          isInParenthesis: !1,
          isInBracketList: !1,
          operatorToken: m.text,
          keyToken: L,
          // Include key from current pair
          queryPairs: y,
          currentPair: b
        };
      }
      if (N.isInValue) {
        const L = b?.key || "", j = b?.operator || "";
        return {
          tokenType: m.type,
          text: m.text,
          start: e,
          stop: e,
          currentToken: m.text,
          isInKey: !1,
          isInNegation: !1,
          isInOperator: !1,
          isInValue: !1,
          isInFunction: !1,
          isInConjunction: !0,
          // After value + space, should be conjunction context
          isInParenthesis: !1,
          isInBracketList: !1,
          valueToken: m.text,
          keyToken: L,
          // Include key from current pair
          operatorToken: j,
          // Include operator from current pair
          queryPairs: y,
          currentPair: b
        };
      }
      if (N.isInConjunction)
        return {
          tokenType: m.type,
          text: m.text,
          start: e,
          stop: e,
          currentToken: m.text,
          isInKey: !0,
          // After conjunction + space, should be key context
          isInNegation: !1,
          isInOperator: !1,
          isInValue: !1,
          isInFunction: !1,
          isInConjunction: !1,
          isInParenthesis: !1,
          isInBracketList: !1,
          queryPairs: y,
          currentPair: b
        };
      if (N.isInParenthesis && m.type === vt.RPAREN)
        return {
          tokenType: m.type,
          text: m.text,
          start: e,
          stop: e,
          currentToken: m.text,
          isInKey: !1,
          isInNegation: !1,
          isInOperator: !1,
          isInValue: !1,
          isInFunction: !1,
          isInConjunction: !0,
          // After RPARAN + space, should be conjunction context
          isInParenthesis: !1,
          isInBracketList: !1,
          queryPairs: y,
          currentPair: b
        };
    }
    if (h && e === h.stop + 1) {
      const N = Zm(h, s);
      return {
        tokenType: h.type,
        text: h.text,
        start: h.start,
        stop: h.stop,
        currentToken: h.text,
        ...N,
        isInBracketList: !1,
        keyToken: N.isInKey ? h.text : b?.key || void 0,
        operatorToken: N.isInOperator ? h.text : b?.operator || void 0,
        valueToken: N.isInValue ? h.text : b?.value || void 0,
        queryPairs: y,
        currentPair: b
      };
    }
    if (h?.channel === 0) {
      const N = Zm(h, s), L = b?.key || "", j = b?.operator || "";
      return {
        tokenType: h.type,
        text: h.text,
        start: h.start,
        stop: h.stop,
        currentToken: h.text,
        ...N,
        isInBracketList: !1,
        keyToken: N.isInKey ? h.text : N.isInOperator || N.isInValue ? L : void 0,
        operatorToken: N.isInOperator ? h.text : N.isInValue ? j : void 0,
        valueToken: N.isInValue ? h.text : void 0,
        queryPairs: y,
        currentPair: b
      };
    }
    if (p?.channel === 0) {
      const N = Zm(p, s), L = b?.key || "", j = b?.operator || "";
      if (N.isInOperator)
        return {
          tokenType: p.type,
          text: p.text,
          start: e,
          stop: e,
          currentToken: p.text,
          isInKey: !1,
          isInNegation: !1,
          isInOperator: !1,
          isInValue: !0,
          // Always in value context after operator
          isInFunction: !1,
          isInConjunction: !1,
          isInParenthesis: !1,
          isInBracketList: !1,
          operatorToken: p.text,
          keyToken: L,
          // Include key from current pair
          queryPairs: y,
          currentPair: b
        };
      if (N.isInKey)
        return {
          tokenType: p.type,
          text: p.text,
          start: e,
          stop: e,
          currentToken: p.text,
          isInKey: !1,
          isInNegation: !1,
          isInOperator: !0,
          // After key, progress to operator context
          isInValue: !1,
          isInFunction: !1,
          isInConjunction: !1,
          isInParenthesis: !1,
          isInBracketList: !1,
          keyToken: p.text,
          queryPairs: y,
          currentPair: b
        };
      if (N.isInValue)
        return {
          tokenType: p.type,
          text: p.text,
          start: e,
          stop: e,
          currentToken: p.text,
          isInKey: !1,
          isInNegation: !1,
          isInOperator: !1,
          isInValue: !1,
          isInFunction: !1,
          isInConjunction: !0,
          // After value, progress to conjunction context
          isInParenthesis: !1,
          isInBracketList: !1,
          valueToken: p.text,
          keyToken: L,
          // Include key from current pair
          operatorToken: j,
          // Include operator from current pair
          queryPairs: y,
          currentPair: b
        };
      if (N.isInConjunction)
        return {
          tokenType: p.type,
          text: p.text,
          start: e,
          stop: e,
          currentToken: p.text,
          isInKey: !0,
          // After conjunction, progress back to key context
          isInNegation: !1,
          isInOperator: !1,
          isInValue: !1,
          isInFunction: !1,
          isInConjunction: !1,
          isInParenthesis: !1,
          isInBracketList: !1,
          queryPairs: y,
          currentPair: b
        };
    }
    return {
      tokenType: -1,
      text: "",
      start: e,
      stop: e,
      currentToken: "",
      isInKey: !0,
      isInNegation: !1,
      isInOperator: !1,
      isInValue: !1,
      isInFunction: !1,
      isInConjunction: !1,
      isInParenthesis: !1,
      isInBracketList: !1,
      queryPairs: y,
      currentPair: b
    };
  } catch (n) {
    return console.error("Error in getQueryContextAtCursor:", n), {
      tokenType: -1,
      text: "",
      start: e,
      stop: e,
      currentToken: "",
      isInValue: !1,
      isInKey: !0,
      // Default to key context on error
      isInNegation: !1,
      isInOperator: !1,
      isInFunction: !1,
      isInConjunction: !1,
      isInParenthesis: !1,
      isInBracketList: !1,
      queryPairs: [],
      currentPair: null
    };
  }
}
function Lwe(t) {
  try {
    if (((new Error().stack || "").match(/extractQueryPairs/g) || []).length > 3)
      return console.warn("Potential infinite recursion detected in extractQueryPairs"), [];
    const i = t || "", o = Jy.fromString(i), r = new vt(o), a = new eb(r);
    a.fill();
    const l = a.tokens, s = [];
    let u = null, c = 0;
    for (; c < l.length; ) {
      const d = l[c];
      if (c += 1, !(d.type === vt.EOF || d.channel !== 0))
        if (d.type === vt.KEY && !(u && u.key))
          u && u.key && s.push({
            key: u.key,
            operator: u.operator || "",
            value: u.value,
            valueList: u.valueList || [],
            valuesPosition: u.valuesPosition || [],
            hasNegation: u.hasNegation || !1,
            isMultiValue: u.isMultiValue || !1,
            position: {
              keyStart: u.position?.keyStart || 0,
              keyEnd: u.position?.keyEnd || 0,
              operatorStart: u.position?.operatorStart || 0,
              operatorEnd: u.position?.operatorEnd || 0,
              valueStart: u.position?.valueStart,
              valueEnd: u.position?.valueEnd,
              negationStart: u.position?.negationStart || 0,
              negationEnd: u.position?.negationEnd || 0
            },
            isComplete: !!(u.key && u.operator && (u.value || Xm(u.operator)))
          }), u = {
            key: d.text,
            position: {
              keyStart: d.start,
              keyEnd: d.stop,
              operatorStart: 0,
              // Initialize with default values
              operatorEnd: 0
              // Initialize with default values
            }
          };
        else if (d.type === vt.NOT && u)
          u.hasNegation = !0, u.position = {
            keyStart: u.position?.keyStart || 0,
            keyEnd: u.position?.keyEnd || 0,
            operatorStart: u.position?.operatorStart || 0,
            operatorEnd: u.position?.operatorEnd || 0,
            valueStart: u.position?.valueStart,
            valueEnd: u.position?.valueEnd,
            negationStart: d.start,
            negationEnd: d.stop
          };
        else if (tb(d.type) && u && u.key && !u.operator) {
          let f, h;
          if (Kk(d.text)) {
            u.isMultiValue = !0;
            const p = [], g = [];
            if ([vt.LPAREN, vt.LBRACK].includes(l[c].type)) {
              const m = l[c].type;
              f = l[c].start, c += 1;
              const y = m === vt.LPAREN ? vt.RPAREN : vt.RBRACK;
              for (; l[c].type !== y && c < l.length; )
                Cf(l[c].type) && (p.push(l[c].text), g.push({
                  start: l[c].start,
                  end: l[c].stop
                })), c += 1;
              l[c].type === y && (h = l[c].stop);
            } else Cf(l[c].type) && (p.push(l[c].text), g.push({
              start: l[c].start,
              end: l[c].stop
            }), f = l[c].start, h = l[c].stop, c += 1);
            u.valuesPosition = g, u.valueList = p, f && h && (u.value = t.substring(f, h + 1));
          }
          u.operator = d.text, u.position = {
            keyStart: u.position?.keyStart || 0,
            keyEnd: u.position?.keyEnd || 0,
            operatorStart: d.start,
            operatorEnd: d.stop,
            valueStart: f || u.position?.valueStart,
            valueEnd: h || u.position?.valueEnd,
            negationStart: u.position?.negationStart || 0,
            negationEnd: u.position?.negationEnd || 0
          };
        } else Cf(d.type) && u && u.key && u.operator && !Xm(u.operator) && !u.value ? (u.value = d.text, u.position = {
          keyStart: u.position?.keyStart || 0,
          keyEnd: u.position?.keyEnd || 0,
          operatorStart: u.position?.operatorStart || 0,
          operatorEnd: u.position?.operatorEnd || 0,
          valueStart: d.start,
          valueEnd: d.stop,
          negationStart: u.position?.negationStart || 0,
          negationEnd: u.position?.negationEnd || 0
        }) : u && u.key && (Yk(d.type) || d.type === vt.KEY) && (s.push({
          key: u.key,
          operator: u.operator || "",
          value: u.value,
          valueList: u.valueList || [],
          valuesPosition: u.valuesPosition || [],
          hasNegation: u.hasNegation || !1,
          isMultiValue: u.isMultiValue || !1,
          position: {
            keyStart: u.position?.keyStart || 0,
            keyEnd: u.position?.keyEnd || 0,
            operatorStart: u.position?.operatorStart || 0,
            operatorEnd: u.position?.operatorEnd || 0,
            valueStart: u.position?.valueStart,
            valueEnd: u.position?.valueEnd,
            negationStart: u.position?.negationStart || 0,
            negationEnd: u.position?.negationEnd || 0
          },
          isComplete: !!(u.key && u.operator && (u.value || Xm(u.operator)))
        }), u = null, d.type === vt.KEY && (u = {
          key: d.text,
          position: {
            keyStart: d.start,
            keyEnd: d.stop,
            operatorStart: 0,
            // Initialize with default values
            operatorEnd: 0
            // Initialize with default values
          }
        }));
    }
    return u && u.key && s.push({
      key: u.key,
      operator: u.operator || "",
      value: u.value,
      valueList: u.valueList || [],
      valuesPosition: u.valuesPosition || [],
      hasNegation: u.hasNegation || !1,
      isMultiValue: u.isMultiValue || !1,
      position: {
        keyStart: u.position?.keyStart || 0,
        keyEnd: u.position?.keyEnd || 0,
        operatorStart: u.position?.operatorStart || 0,
        operatorEnd: u.position?.operatorEnd || 0,
        valueStart: u.position?.valueStart,
        valueEnd: u.position?.valueEnd,
        negationStart: u.position?.negationStart || 0,
        negationEnd: u.position?.negationEnd || 0
      },
      isComplete: !!(u.key && u.operator && (u.value || Xm(u.operator)))
    }), s;
  } catch (e) {
    return console.error("Error in extractQueryPairs:", e), [];
  }
}
function zwe(t, e) {
  const { position: n } = t;
  let i = n.valueEnd || n.operatorEnd || n.keyEnd;
  for (i += 1; i < e.length && e.charAt(i) === " "; )
    i += 1;
  return i;
}
function Y8(t, e, n) {
  try {
    if (t.length > 0) {
      let i = null;
      for (const o of t) {
        const { position: r } = o, a = r.valueEnd || r.operatorEnd || r.keyEnd, l = r.keyStart ?? (r.operatorStart || r.valueStart || 0);
        (a >= n && l <= n || !o.isComplete && l <= n && zwe(o, e) >= n) && (!i || a > (i.position.valueEnd || i.position.operatorEnd || i.position.keyEnd)) && (i = o);
      }
      if (i)
        return i;
      if (n === 0)
        return null;
      if (n >= e.length && t.length > 0)
        return t[t.length - 1];
    }
    return null;
  } catch (i) {
    return console.error("Error in getCurrentQueryPair:", i), null;
  }
}
class Bwe {
  errors = [];
  syntaxError(e, n, i, o, r) {
    if (this.hasUnterminatedQuoteError() && r.includes("expecting"))
      return;
    const a = {
      message: r,
      line: i,
      column: o,
      offendingSymbol: n?.text || String(n)
    };
    if (r.includes("expecting")) {
      const s = r.split("expecting")[1].trim().split(",").map((u) => u.trim());
      a.expectedTokens = s;
    }
    this.errors.some(
      (s) => s.line === i && s.column === o && this.isSimilarError(s.message, r)
    ) || this.errors.push(a);
  }
  hasUnterminatedQuoteError() {
    return this.errors.some(
      (e) => e.message.includes("unterminated") || e.message.includes("missing") && e.message.includes("'")
    );
  }
  isSimilarError = (e, n) => {
    const i = (o) => o.toLowerCase().replaceAll(/['"`]/g, "quote").replaceAll(/\s+/g, " ").trim();
    return i(e) === i(n);
  };
  reportAmbiguity = () => {
  };
  reportAttemptingFullContext = () => {
  };
  reportContextSensitivity = () => {
  };
  getErrors() {
    return this.errors;
  }
  hasErrors() {
    return this.errors.length > 0;
  }
  getFormattedErrors() {
    return this.errors.map((e) => {
      const { offendingSymbol: n, expectedTokens: i, message: o, line: r, column: a } = e;
      let l = `Line ${r}:${a} - ${o}`;
      return n && n !== "undefined" && (l += `
 Symbol: '${n}'`), i && i.length > 0 && (l += `
 Expected: ${i.join(", ")}`), l;
    });
  }
}
function Fwe(t) {
  if (!t.trim())
    return {
      isValid: !0,
      message: "Query is empty",
      errors: []
    };
  try {
    const e = new Bwe(), n = Jy.fromString(t), i = new vt(n);
    i.removeErrorListeners(), i.addErrorListener(e);
    const o = new eb(i), r = new He(o);
    return r.removeErrorListeners(), r.addErrorListener(e), r.query(), e.hasErrors() ? {
      isValid: !1,
      message: "Query syntax error",
      errors: e.getErrors()
    } : {
      isValid: !0,
      message: "Query is valid!",
      errors: []
    };
  } catch (e) {
    return {
      isValid: !1,
      message: "Invalid query syntax",
      errors: [{
        message: e instanceof Error ? e.message : "Invalid query syntax",
        line: 0,
        column: 0,
        offendingSymbol: "",
        expectedTokens: []
      }]
    };
  }
}
function bA(t) {
  if (typeof t != "string")
    return t;
  const e = t.trim(), n = e[0], i = e[e.length - 1];
  return (n === '"' || n === "'") && n === i ? e.slice(1, -1) : e;
}
const Vwe = { class: "lqs" }, Qwe = { class: "lqs-status-content" }, Hwe = /* @__PURE__ */ Oe({
  name: "LogQuerySearch",
  __name: "LogQuerySearch",
  props: {
    modelValue: {},
    cfg: {},
    placeholder: { default: "Enter your filter query (e.g., service.name = 'frontend' AND body CONTAINS 'error')" },
    signal: { default: "logs" },
    hardcodedAttributeKeys: { default: void 0 },
    metricName: { default: void 0 }
  },
  emits: ["update:modelValue", "run"],
  setup(t, { emit: e }) {
    const n = t, i = e, o = {
      "signoz.querySearch.placeholder": "Enter your filter query (e.g., service.name = 'frontend' AND body CONTAINS 'error')",
      "signoz.querySearch.loading": "Loading...",
      "signoz.querySearch.noSuggestions": "No suggestions",
      "signoz.querySearch.error": "Failed to load suggestions"
    }, r = (ee) => o[ee] ?? ee, a = A(() => n.placeholder && n.placeholder !== "Enter your filter query (e.g., service.name = 'frontend' AND body CONTAINS 'error')" ? n.placeholder : r("signoz.querySearch.placeholder")), l = de(null), s = de([]), u = de(null), c = de(""), d = de(!1), f = de(!1), h = de(null), p = de({ isValid: !1, message: "", errors: [] }), g = de({ line: 0, ch: 0 }), m = de(!1);
    let y = null, b = !1, w = { line: 0, ch: 0 }, $ = "", C = "", P = "";
    function O(ee, ie) {
      let ae = null;
      const te = (...U) => {
        ae && clearTimeout(ae), ae = setTimeout(() => ee(...U), ie);
      };
      return te.cancel = () => {
        ae && clearTimeout(ae), ae = null;
      }, te;
    }
    function E() {
      return y?.state.doc.toString() || "";
    }
    function _(ee = 10) {
      setTimeout(() => {
        y && (m.value ? Cu(y) : T0(y));
      }, ee);
    }
    function D(ee) {
      return /^'.*'$/.test(ee) ? ee : ee.includes("'") ? `'${ee.replaceAll("'", "\\'")}'` : `'${ee}'`;
    }
    function M(ee) {
      return ee ? ee.toUpperCase() === "IN" || ee.toUpperCase() === "NOT IN" : !1;
    }
    function N(ee, ie, ae) {
      return M(ie) && !ee.startsWith("[") ? ae === "value" || ae === "keyword" ? `[${D(ee)}]` : `[${ee}]` : ae === "value" || ae === "keyword" ? D(ee) : ee;
    }
    async function L(ee) {
      C = ee || "";
      const ie = n.hardcodedAttributeKeys ? n.hardcodedAttributeKeys.filter(
        (U) => !ee || U.name.toLowerCase().includes(ee.toLowerCase())
      ) : [], ae = n.cfg ? await bw(n.cfg, {
        signal: n.signal,
        searchText: ee || "",
        metricName: n.metricName
      }) : [], te = /* @__PURE__ */ new Map();
      ie.forEach(({ name: U, fieldDataType: me }) => {
        te.set(U, {
          label: U,
          type: me === "string" ? "keyword" : me || "string",
          info: "",
          detail: ""
        });
      }), ae.forEach(({ name: U, fieldDataType: me }) => {
        te.has(U) || te.set(U, {
          label: U,
          type: me === "string" ? "keyword" : me || "string",
          info: "",
          detail: ""
        });
      }), ee && $ !== ee && (u.value || []).forEach((U) => {
        te.has(U.label) || te.set(U.label, U);
      }), u.value = [...te.values()], y && _(10);
    }
    const j = O(L, 300);
    async function B(ee) {
      const { key: ie, searchText: ae, fetchingComplete: te = !1 } = ee;
      if (!ie || ie === c.value && !d.value && !te)
        return;
      d.value = !0, te && (f.value = !0), $ = ie, P = ae || "", c.value = ie, s.value = [
        {
          label: r("signoz.querySearch.loading"),
          type: "text",
          boost: -99,
          apply: () => !1
        }
      ], y && _(10);
      const U = ae ? ae.trim() : "";
      try {
        if (!n.cfg)
          return;
        const { stringValues: me, numberValues: ce } = await CB(n.cfg, {
          key: ie,
          searchText: U,
          signal: n.signal,
          metricName: n.metricName
        });
        if ($ !== ie || P !== U)
          return;
        const ue = me.filter((le) => le != null && le !== "").map((le) => ({ label: le, type: "value", apply: le })), fe = ce.filter((le) => le != null).map((le) => ({ label: le.toString(), type: "number", apply: le }));
        let he = [...ue, ...fe];
        he = he.filter(
          (le, ke, ze) => ke === ze.findIndex((Re) => Re.label === le.label)
        ), $ === ie && (s.value = he.length ? he : [
          {
            label: r("signoz.querySearch.noSuggestions"),
            type: "text",
            boost: -99,
            apply: () => !1
          }
        ], y && _(10));
      } catch {
        $ === ie && (s.value = [
          {
            label: r("signoz.querySearch.error"),
            type: "text",
            boost: -99,
            apply: () => !1
          }
        ]);
      } finally {
        d.value = !1, f.value = !1;
      }
    }
    const Y = O(B, 300);
    function Q(ee) {
      const ie = ee.matchBefore(/[\w.:/?&=#%\-[\]]*/);
      if (ie?.from === ie?.to && !ee.explicit)
        return null;
      const ae = E(), te = yA(ae, g.value.ch);
      let U = [];
      const me = (ue, fe, he, le, ke = !0) => {
        ue.dispatch({
          changes: {
            from: he,
            to: le,
            insert: ke ? `${fe.apply} ` : `${fe.apply}`
          },
          selection: {
            anchor: he + (ke ? fe.apply.length + 1 : fe.apply.length)
          }
        });
      }, ce = (ue) => ue.map((fe) => {
        const he = fe.apply ?? fe.label;
        return {
          ...fe,
          // Show the description (e.g. "Equal to") dimmed on the right of the row
          detail: fe.detail ?? fe.info,
          apply: (le, ke, ze, Re) => {
            let Ye = !0;
            const Ne = te.isInValue && fe.type === "value", Fe = te.isInOperator && fe.type === "operator", We = te.currentPair;
            if (Ne) {
              if (te.isInBracketList && We?.valuesPosition) {
                const nt = vA(We.valuesPosition, g.value.ch);
                if (nt !== null) {
                  const { start: Qe, end: Pe } = We.valuesPosition[nt];
                  typeof Qe == "number" && typeof Pe == "number" && g.value.ch >= Qe && g.value.ch <= Pe + 1 && (Ye = !1, me(le, { apply: he }, Qe, Pe + 1, !1));
                }
              } else if (We?.position) {
                const { valueStart: nt, valueEnd: Qe } = We.position;
                typeof nt == "number" && typeof Qe == "number" && g.value.ch >= nt && g.value.ch <= Qe + 1 && (Ye = !1, me(
                  le,
                  { apply: he },
                  nt,
                  Qe + 1,
                  !1
                ));
              }
            }
            if (Fe && We?.position) {
              const { operatorStart: nt, operatorEnd: Qe } = We.position;
              typeof nt == "number" && typeof Qe == "number" && nt !== 0 && Qe !== 0 && g.value.ch >= nt && g.value.ch <= Qe + 1 && (Ye = !1, me(
                le,
                { apply: he },
                nt,
                Qe + 1,
                !1
              ));
            }
            Ye && me(le, { apply: he }, ze, Re);
          }
        };
      });
      if (te.isInBracketList) {
        const ue = te.keyToken || te.currentPair?.key || "";
        if (!ue)
          return null;
        let fe = "";
        if (te.currentPair?.valuesPosition && te.currentPair?.valueList) {
          const { valuesPosition: ke, valueList: ze } = te.currentPair, Re = vA(ke, g.value.ch);
          fe = Re === null ? "" : bA(ze[Re]).toLowerCase().trim();
        }
        U = (s.value || []).filter(
          (ke) => ke.label.toLowerCase().includes(fe)
        ), ue && ((U.length === 0 || fe === "") && P !== fe && !f.value || ue !== c.value || d.value) && !(d.value && $ === ue) && Y({ key: ue, searchText: fe, fetchingComplete: !0 });
        const le = U.map((ke) => {
          const ze = { ...ke };
          return !ke.apply || typeof ke.apply == "function" ? ke : (ke.type === "value" || ke.type === "keyword" ? ze.apply = D(ke.label) : ze.apply = ke.label, ze);
        });
        return { from: ie?.from ?? 0, options: ce(le) };
      }
      if (te.isInKey) {
        const ue = ie?.text.toLowerCase().trim() ?? "";
        if (U = (u.value || []).filter(
          (fe) => fe.label.toLowerCase().includes(ue)
        ), U.length === 0 && C !== ue && j(ue), te.queryPairs && te.queryPairs.length > 0) {
          const fe = new Set(te.queryPairs.map((he) => he.key));
          U = U.map((he) => ({ ...he, boost: fe.has(he.label) ? -10 : 10 }));
        }
        return U = U.map((fe) => ({
          ...fe,
          boost: (fe.boost || 0) + (fe.label.toLowerCase() === ue ? 100 : 0)
        })), {
          from: ie?.from ?? 0,
          to: ie?.to ?? g.value.ch,
          options: ce(U)
        };
      }
      if (te.isInOperator) {
        U = [...YSe];
        const ue = te.keyToken || te.currentPair?.key;
        if (te.currentPair?.hasNegation && (U = [...c8]), ue) {
          const he = (u.value || []).find((le) => le.label === ue)?.type || "";
          he && (he === gc.NUMBER ? U = U.filter(
            (le) => px[gc.NUMBER].includes(
              le.label
            )
          ).map((le) => ({
            ...le,
            boost: [">", "<", ">=", "<=", "=", "!=", "BETWEEN"].includes(le.label) ? 100 : 0
          })) : he === gc.STRING || he === "keyword" ? U = U.filter(
            (le) => px[gc.STRING].includes(
              le.label
            )
          ).map((le) => le.label === un["="] ? { ...le, boost: 200 } : [
            un["!="],
            un.LIKE,
            un.ILIKE,
            un.CONTAINS,
            un.IN
          ].includes(le.label) ? { ...le, boost: 100 } : { ...le, boost: 0 }) : he === gc.BOOLEAN && (U = U.filter(
            (le) => px[gc.BOOLEAN].includes(
              le.label
            )
          ).map((le) => le.label === un["="] ? { ...le, boost: 200 } : le.label === un["!="] ? { ...le, boost: 100 } : { ...le, boost: 0 })));
        }
        return {
          from: ie?.from ?? 0,
          to: ie?.to ?? g.value.ch,
          options: ce(U)
        };
      }
      if (te.isInValue) {
        const ue = te.keyToken || te.currentPair?.key || "", fe = te.operatorToken || te.currentPair?.operator || "";
        if (!ue)
          return null;
        let he = "";
        te.currentPair?.value && (he = bA(te.currentPair.value).toLowerCase().trim()), U = (s.value || []).filter(
          (ze) => ze.label.toLowerCase().includes(he)
        ), ue && ((U.length === 0 || he === "") && P !== he && !f.value || ue !== c.value || d.value) && !(d.value && $ === ue) && Y({ key: ue, searchText: he, fetchingComplete: !0 });
        const ke = U.map((ze) => {
          const Re = { ...ze };
          return !ze.apply || typeof ze.apply == "function" ? ze : (ze.type === "value" || ze.type === "keyword" ? Re.apply = N(ze.label, fe, ze.type) : ze.type === "number" ? Re.apply = M(fe) ? `[${ze.label}]` : ze.label : Re.apply = ze.label, Re);
        });
        return { from: ie?.from ?? 0, options: ce(ke) };
      }
      if (te.isInFunction)
        return U = Object.values(qSe).map((ue) => ({
          label: ue,
          apply: `${ue}()`,
          type: "function"
        })), { from: ie?.from ?? 0, options: ce(U) };
      if (te.isInConjunction)
        return U = [
          { label: "AND", type: "conjunction" },
          { label: "OR", type: "conjunction" }
        ], { from: ie?.from ?? 0, options: ce(U) };
      if (te.isInParenthesis) {
        const ue = ae.charAt(g.value.ch - 1) || "";
        if (ue === "(" || ue === "[")
          return ue === "(" ? (U = [
            ...u.value || [],
            { label: "(", type: "parenthesis", info: "Open nested group" },
            { label: "NOT", type: "operator", info: "Negate expression" }
          ], { from: ie?.from ?? 0, options: ce(U) }) : { from: ie?.from ?? 0, options: s.value };
        if (ue === ")" || ue === "]")
          return U = [
            { label: "AND", type: "conjunction" },
            { label: "OR", type: "conjunction" }
          ], { from: ie?.from ?? 0, options: ce(U) };
      }
      return { from: ie?.from ?? 0, options: [] };
    }
    function G(ee) {
      try {
        p.value = Fwe(ee);
      } catch (ie) {
        p.value = {
          isValid: !1,
          message: "Failed to process query",
          errors: [{ message: String(ie), line: 0, column: 0 }]
        };
      }
    }
    function V(ee, ie = !1) {
      if (!y)
        return;
      const ae = y.state.doc.toString();
      ae !== ee && (ie && (b = !0), y.dispatch({
        changes: { from: 0, to: ae.length, insert: ee },
        selection: { anchor: ee.length }
      }));
    }
    function H(ee) {
      const ie = ee.view;
      if (ee.docChanged && (b ? b = !1 : i("update:modelValue", ie.state.doc.toString())), !ee.docChanged && !ee.selectionSet)
        return;
      const ae = ie.state.selection.main.head, te = ie.state.doc.lineAt(ae), U = { line: te.number, ch: ae - te.from };
      if (U.line === w.line && U.ch === w.ch)
        return;
      g.value = U, w = U;
      const me = ie.state.doc.toString();
      me && (h.value = yA(me, ae), m.value && _(10));
    }
    const q = _g.define([
      { tag: Ge.string, color: "#0a7c3e" },
      { tag: [Ge.number, Ge.bool, Ge.null], color: "#9a6700" },
      { tag: Ge.propertyName, color: "#0550ae" },
      { tag: Ge.keyword, color: "#cf222e" },
      { tag: Ge.operator, color: "#0550ae" },
      { tag: Ge.variableName, color: "#1d2129" }
    ]);
    Lt(() => {
      if (!l.value)
        return;
      const ee = Kt.domEventHandlers({
        keydown: (te) => (te.stopPropagation(), !1),
        focus: () => (m.value = !0, _(10), !1),
        blur: () => (G(E()), m.value = !1, !1)
      }), ie = dd.highest(
        Eg.of([
          ...Pk,
          { key: "Escape", run: T0 },
          { key: "Enter", preventDefault: !0, run: () => !0 },
          {
            key: "Mod-Enter",
            preventDefault: !0,
            run: () => (i("run", E()), !0)
          },
          { key: "Shift-Enter", preventDefault: !0, run: () => !0 }
        ])
      ), ae = ni.create({
        doc: n.modelValue,
        extensions: [
          J6({
            override: [Q],
            defaultKeymap: !0,
            closeOnBlur: !0,
            activateOnTyping: !0,
            maxRenderedOptions: 50
          }),
          u8({ jsx: !1, typescript: !1 }),
          j6(q),
          Cxe(),
          Kt.lineWrapping,
          ee,
          ie,
          Pxe(a.value),
          Kt.updateListener.of(H),
          Kt.theme({
            "&": { fontSize: "13px", backgroundColor: "transparent" },
            "&.cm-focused": { outline: "none" },
            ".cm-scroller": { fontFamily: "'SFMono-Regular', Consolas, monospace" },
            ".cm-content": {
              fontFamily: "'SFMono-Regular', Consolas, monospace",
              padding: "5px 4px",
              caretColor: "#1664ff",
              minHeight: "20px"
            },
            ".cm-line": { padding: "0" },
            ".cm-activeLine": { backgroundColor: "transparent" },
            ".cm-placeholder": { color: "#86909c" },
            ".cm-selectionBackground, &.cm-focused .cm-selectionBackground": {
              background: "#dbe7ff !important"
            },
            // ── autocomplete dropdown (mirrors SigNoz look) ──
            ".cm-tooltip.cm-tooltip-autocomplete": {
              border: "1px solid #e5e6eb",
              borderRadius: "6px",
              background: "#ffffff",
              boxShadow: "0 8px 24px rgba(31, 41, 51, 0.16)",
              overflow: "hidden",
              marginTop: "6px"
            },
            ".cm-tooltip-autocomplete > ul": {
              fontFamily: "'SFMono-Regular', Consolas, monospace",
              maxHeight: "320px",
              minWidth: "320px"
            },
            ".cm-tooltip-autocomplete ul li": {
              display: "flex",
              alignItems: "center",
              gap: "8px",
              height: "34px",
              lineHeight: "34px",
              padding: "0 12px",
              color: "#1d2129",
              borderLeft: "2px solid transparent"
            },
            ".cm-tooltip-autocomplete ul li:hover": {
              background: "#f3f6ff"
            },
            // Selected row — override CM's built-in `.cm-focused`-prefixed default
            ".cm-tooltip-autocomplete ul li[aria-selected]": {
              background: "#e8f3ff !important",
              color: "#1664ff !important",
              fontWeight: "600",
              borderLeftColor: "#1664ff"
            },
            "&.cm-focused .cm-tooltip-autocomplete ul li[aria-selected]": {
              background: "#e8f3ff !important",
              color: "#1664ff !important",
              fontWeight: "600",
              borderLeftColor: "#1664ff"
            },
            ".cm-completionIcon": { display: "none" },
            ".cm-completionLabel": { flex: "1" },
            ".cm-completionMatchedText": {
              textDecoration: "none",
              color: "#1664ff",
              fontWeight: "700"
            },
            "&.cm-focused .cm-tooltip-autocomplete ul li[aria-selected] .cm-completionMatchedText": {
              color: "#1664ff"
            },
            ".cm-completionDetail": {
              marginLeft: "auto",
              fontStyle: "normal",
              fontSize: "11px",
              color: "#86909c"
            }
          })
        ]
      });
      y = new Kt({ state: ae, parent: l.value }), G(n.modelValue);
    }), tn(() => {
      j.cancel(), Y.cancel(), y?.destroy(), y = null;
    }), _e(
      () => n.modelValue,
      (ee) => {
        !y || m.value || ee !== E() && (V(ee, !0), G(ee));
      }
    ), _e(h, (ee) => {
      if (ee && (y && _(10), ee.isInValue)) {
        const ie = ee.keyToken || ee.currentToken;
        ie && ie !== c.value && !d.value && B({ key: ie });
      }
    }), L(), _e(
      () => n.metricName,
      () => {
        u.value = null, L();
      }
    );
    const K = A(
      () => !!n.modelValue && p.value.isValid === !1 && !m.value
    );
    return (ee, ie) => (re(), be("div", Vwe, [
      F("div", {
        class: Tt(["lqs-editor-wrap", { "lqs-editor-wrap--error": K.value }])
      }, [
        ie[1] || (ie[1] = F("span", { class: "lqs-lead i-material-symbols-search" }, null, -1)),
        F("div", {
          ref_key: "editorEl",
          ref: l,
          class: "lqs-editor"
        }, null, 512),
        K.value ? (re(), ut(I(P3), {
          key: 0,
          placement: "bottomRight",
          trigger: "click",
          "overlay-style": { width: "320px" }
        }, {
          content: ye(() => [
            F("div", Qwe, [
              (re(!0), be(tt, null, Jt(p.value.errors, (ae, te) => (re(), be("div", {
                key: te,
                class: "lqs-status-err"
              }, se(ae.line) + ":" + se(ae.column) + " - " + se(ae.message), 1))), 128))
            ])
          ]),
          default: ye(() => [
            ie[0] || (ie[0] = F("span", { class: "lqs-status lqs-status--error i-material-symbols-warning" }, null, -1))
          ]),
          _: 1
        })) : et("", !0)
      ], 2)
    ]));
  }
}), Wwe = /* @__PURE__ */ Co(Hwe, [["__scopeId", "data-v-e483bded"]]), jwe = { class: "qae" }, qwe = {
  key: 0,
  class: "qae-interval"
}, Ywe = /* @__PURE__ */ Oe({
  name: "QueryAggregationEditor",
  __name: "QueryAggregationEditor",
  props: {
    modelValue: {},
    cfg: {},
    signal: { default: "traces" },
    showInterval: { type: Boolean, default: !1 },
    stepInterval: { default: null }
  },
  emits: ["update:modelValue", "update:stepInterval"],
  setup(t, { emit: e }) {
    const n = t, i = e, o = [
      { value: "count", label: "Count", acceptsArgs: !1, multiple: !1 },
      {
        value: "count_distinct",
        label: "Count Distinct",
        acceptsArgs: !0,
        multiple: !0
      },
      { value: "sum", label: "Sum", acceptsArgs: !0, multiple: !1 },
      { value: "avg", label: "Avg", acceptsArgs: !0, multiple: !1 },
      { value: "max", label: "Max", acceptsArgs: !0, multiple: !1 },
      { value: "min", label: "Min", acceptsArgs: !0, multiple: !1 },
      { value: "p05", label: "P05", acceptsArgs: !0, multiple: !1 },
      { value: "p10", label: "P10", acceptsArgs: !0, multiple: !1 },
      { value: "p20", label: "P20", acceptsArgs: !0, multiple: !1 },
      { value: "p25", label: "P25", acceptsArgs: !0, multiple: !1 },
      { value: "p50", label: "P50", acceptsArgs: !0, multiple: !1 },
      { value: "p75", label: "P75", acceptsArgs: !0, multiple: !1 },
      { value: "p90", label: "P90", acceptsArgs: !0, multiple: !1 },
      { value: "p95", label: "P95", acceptsArgs: !0, multiple: !1 },
      { value: "p99", label: "P99", acceptsArgs: !0, multiple: !1 },
      { value: "rate", label: "Rate", acceptsArgs: !1, multiple: !1 },
      { value: "rate_sum", label: "Rate Sum", acceptsArgs: !0, multiple: !1 },
      { value: "rate_avg", label: "Rate Avg", acceptsArgs: !0, multiple: !1 },
      { value: "rate_min", label: "Rate Min", acceptsArgs: !0, multiple: !1 },
      { value: "rate_max", label: "Rate Max", acceptsArgs: !0, multiple: !1 },
      { value: "noop", label: "Noop", acceptsArgs: !1, multiple: !1 }
    ], r = new Set(o.map((M) => M.value));
    function a(M) {
      return o.find((N) => N.value === M.toLowerCase());
    }
    function l(M, N) {
      let L = -1, j = null, B = 0;
      for (let G = N - 1; G >= 0; G--)
        if (M[G] === ")")
          B++;
        else if (M[G] === "(") {
          if (B === 0) {
            L = G;
            const H = M.slice(0, G).match(/(\w+)\s*$/);
            H && (j = H[1].toLowerCase());
            break;
          }
          B--;
        }
      if (L === -1 || !j)
        return null;
      let Y = -1, Q = 1;
      for (let G = L + 1; G < M.length; G++)
        if (M[G] === "(" ? Q++ : M[G] === ")" && Q--, Q === 0) {
          Y = G;
          break;
        }
      return N > L && (Y === -1 || N <= Y) ? j : null;
    }
    function s(M) {
      if (!M.trim())
        return null;
      if (/[a-z_]\w*\s*\([^)]*$/i.test(M))
        return "Incomplete function call — missing closing parenthesis";
      const N = /([a-z_]\w*)\s*\(([^)]*)\)/gi;
      let L;
      for (L = N.exec(M); L !== null; ) {
        const j = L[1].toLowerCase();
        if (!r.has(j))
          return `Unknown function: ${j}`;
        if (a(j)?.acceptsArgs && L[2].trim() === "")
          return `Function ${j}() requires arguments`;
        L = N.exec(M);
      }
      return null;
    }
    const u = de(null), c = de(null), d = /* @__PURE__ */ new Set([
      "sum",
      "avg",
      "max",
      "min",
      "p05",
      "p10",
      "p20",
      "p25",
      "p50",
      "p75",
      "p90",
      "p95",
      "p99",
      "rate_sum",
      "rate_avg",
      "rate_min",
      "rate_max"
    ]), f = /* @__PURE__ */ new Map();
    function h(M) {
      return `${M}:${n.signal}`;
    }
    function p(M) {
      return d.has(M) ? "number" : void 0;
    }
    async function g(M) {
      const N = h(M), L = f.get(N);
      if (L != null)
        return L;
      if (L === null)
        return [];
      f.set(N, null);
      try {
        if (!n.cfg)
          return f.set(N, []), [];
        const j = await bw(n.cfg, {
          signal: n.signal,
          searchText: "",
          fieldDataType: p(M)
        });
        return f.set(N, j), j;
      } catch {
        return f.delete(N), [];
      }
    }
    function m(M) {
      return f.get(h(M)) ?? [];
    }
    const y = ai.mark({ class: "agg-chip" });
    function b() {
      return ga.fromClass(
        class {
          decorations;
          constructor(M) {
            this.decorations = this._build(M);
          }
          update(M) {
            (M.docChanged || M.viewportChanged) && (this.decorations = this._build(M.view));
          }
          _build(M) {
            const N = new Wf();
            for (const { from: L, to: j } of M.visibleRanges) {
              const B = M.state.doc.sliceString(L, j), Y = /\b([a-z_]\w*)\s*\([^)]*\)/gi;
              let Q;
              for (Q = Y.exec(B); Q !== null; )
                r.has(Q[1].toLowerCase()) && N.add(L + Q.index, L + Q.index + Q[0].length, y), Q = Y.exec(B);
            }
            return N.finish();
          }
        },
        { decorations: (M) => M.decorations }
      );
    }
    const w = _g.define([
      { tag: Ge.string, color: "#0a7c3e" },
      { tag: [Ge.number, Ge.bool], color: "#9a6700" },
      { tag: Ge.propertyName, color: "#0550ae" },
      { tag: Ge.keyword, color: "#cf222e" },
      { tag: Ge.operator, color: "#0550ae" },
      { tag: Ge.variableName, color: "#1664ff" }
    ]), $ = Kt.domEventHandlers({
      keydown: (M) => (M.stopPropagation(), M.stopImmediatePropagation(), !1),
      focus: (M) => (M.stopPropagation(), !1),
      blur: (M) => (M.stopPropagation(), !1)
    });
    let C = null, P = !1, O = !1;
    function E() {
      return C?.state.doc.toString() ?? "";
    }
    function _(M) {
      !C || E() === M || (P = !0, C.dispatch({
        changes: { from: 0, to: C.state.doc.length, insert: M }
      }));
    }
    function D() {
      return J6({
        override: [
          (M) => {
            const N = M.state.doc.toString(), L = M.pos, j = l(N, L);
            if (j === "count" && L > 0 && N[L - 1] !== ")")
              return null;
            if (j && a(j)?.acceptsArgs) {
              m(j).length || g(j).then((me) => {
                me.length && C && O && Cu(C);
              });
              const V = N.slice(0, L), H = V.lastIndexOf("("), q = V.lastIndexOf(",", L - 1), K = q > H ? q + 1 : H + 1, ee = V.slice(K, L).trim(), ie = /* @__PURE__ */ new Set();
              H !== -1 && V.slice(H + 1, L).split(",").forEach((me) => {
                const ce = me.trim();
                ce && ie.add(ce);
              });
              const ae = a(j).multiple, te = m(j);
              if (!te.length)
                return {
                  from: K,
                  options: [{ label: "Loading…", type: "text", apply: () => {
                  } }]
                };
              const U = te.filter((me) => !ie.has(me.name)).filter((me) => !ee || me.name.toLowerCase().includes(ee.toLowerCase())).map(
                (me) => ({
                  label: me.name,
                  type: "variable",
                  detail: me.fieldDataType,
                  apply: (ce, ue, fe, he) => {
                    const le = ae ? `${me.name},` : `${me.name}) `;
                    ce.dispatch({
                      changes: { from: fe, to: he, insert: le },
                      selection: { anchor: fe + le.length }
                    }), setTimeout(() => {
                      ce && Cu(ce);
                    }, 50);
                  }
                })
              );
              return {
                from: K,
                options: U.length ? U : [
                  {
                    label: "No matching fields",
                    type: "text",
                    apply: () => {
                    }
                  }
                ]
              };
            }
            const B = M.matchBefore(/\w*/), Y = N.toLowerCase().includes("count("), Q = o.filter(
              (G) => !(Y && G.value === "count")
            ).map(
              (G) => ({
                label: G.value,
                type: "function",
                detail: G.label,
                apply: (V, H, q, K) => {
                  const ee = G.acceptsArgs ? `${G.value}(` : `${G.value}() `;
                  V.dispatch({
                    changes: { from: q, to: K, insert: ee },
                    selection: { anchor: q + ee.length }
                  }), setTimeout(() => {
                    V && Cu(V);
                  }, 50);
                }
              })
            );
            return B || L === 0 || M.explicit ? { from: B ? B.from : L, options: Q } : null;
          }
        ],
        defaultKeymap: !0,
        closeOnBlur: !0,
        activateOnTyping: !0,
        maxRenderedOptions: 30
      });
    }
    return Lt(() => {
      if (!u.value)
        return;
      const M = n.modelValue, N = ni.create({
        doc: M,
        // Place cursor at end of document on mount
        selection: { anchor: M.length },
        extensions: [
          b(),
          D(),
          u8({ jsx: !1, typescript: !1 }),
          j6(w),
          Kt.lineWrapping,
          $,
          Eg.of([
            ...Pk,
            { key: "Escape", run: T0 },
            { key: "Enter", preventDefault: !0, run: () => !0 },
            { key: "Shift-Enter", preventDefault: !0, run: () => !0 }
          ]),
          Kt.updateListener.of((L) => {
            if (L.docChanged) {
              if (P) {
                P = !1;
                return;
              }
              const j = L.view.state.doc.toString();
              c.value = s(j), i("update:modelValue", j);
            }
          }),
          Kt.domEventHandlers({
            focus: () => (O = !0, setTimeout(() => {
              C && O && Cu(C);
            }, 10), !1),
            blur: () => (O = !1, !1)
          }),
          Kt.theme({
            "&": { fontSize: "13px", backgroundColor: "transparent" },
            "&.cm-focused": { outline: "none" },
            ".cm-scroller": { fontFamily: "'SFMono-Regular', Consolas, monospace" },
            ".cm-content": {
              fontFamily: "'SFMono-Regular', Consolas, monospace",
              padding: "8px 10px",
              caretColor: "#1664ff",
              minHeight: "20px",
              lineHeight: "20px"
            },
            ".cm-line": { padding: "0" },
            ".cm-activeLine": { backgroundColor: "transparent" },
            ".cm-placeholder": { color: "#86909c" },
            ".cm-selectionBackground, &.cm-focused .cm-selectionBackground": {
              background: "#dbe7ff !important"
            },
            ".agg-chip": {
              background: "#f0f4ff",
              color: "#1d2129",
              borderRadius: "3px",
              padding: "1px 4px",
              marginRight: "4px"
            },
            ".cm-tooltip.cm-tooltip-autocomplete": {
              border: "1px solid #e5e6eb",
              borderRadius: "6px",
              background: "#ffffff",
              boxShadow: "0 8px 24px rgba(31,41,51,.16)",
              overflow: "hidden",
              marginTop: "4px"
            },
            ".cm-tooltip-autocomplete > ul": {
              fontFamily: "'SFMono-Regular', Consolas, monospace",
              maxHeight: "300px",
              minWidth: "300px"
            },
            ".cm-tooltip-autocomplete ul li": {
              display: "flex",
              alignItems: "center",
              height: "34px",
              lineHeight: "34px",
              padding: "0 12px",
              color: "#1d2129",
              borderLeft: "2px solid transparent",
              gap: "8px"
            },
            ".cm-tooltip-autocomplete ul li:hover": { background: "#f3f6ff" },
            ".cm-tooltip-autocomplete ul li[aria-selected]": {
              background: "#e8f3ff !important",
              color: "#1664ff !important",
              fontWeight: "600",
              borderLeftColor: "#1664ff"
            },
            "&.cm-focused .cm-tooltip-autocomplete ul li[aria-selected]": {
              background: "#e8f3ff !important",
              color: "#1664ff !important",
              fontWeight: "600",
              borderLeftColor: "#1664ff"
            },
            ".cm-completionIcon": { display: "none" },
            ".cm-completionLabel": { flex: "1" },
            ".cm-completionMatchedText": {
              textDecoration: "none",
              color: "#1664ff",
              fontWeight: "700"
            },
            ".cm-completionDetail": {
              marginLeft: "auto",
              fontStyle: "normal",
              fontSize: "11px",
              color: "#86909c"
            }
          })
        ]
      });
      C = new Kt({ state: N, parent: u.value }), c.value = s(n.modelValue);
    }), tn(() => {
      C?.destroy(), C = null;
    }), _e(
      () => n.modelValue,
      (M) => {
        !O && E() !== M && _(M);
      }
    ), (M, N) => (re(), be("div", jwe, [
      F("div", {
        class: Tt(["qae-editor-wrap", { "qae-editor-wrap--error": c.value }])
      }, [
        F("div", {
          ref_key: "editorEl",
          ref: u,
          class: "qae-editor"
        }, null, 512),
        c.value ? (re(), ut(I(zi), {
          key: 0,
          title: c.value,
          placement: "top"
        }, {
          default: ye(() => [...N[1] || (N[1] = [
            F("span", { class: "qae-error-icon i-material-symbols-warning text-15px" }, null, -1)
          ])]),
          _: 1
        }, 8, ["title"])) : (re(), ut(I(zi), {
          key: 1,
          placement: "left"
        }, {
          title: ye(() => [...N[2] || (N[2] = [
            F("div", { class: "qae-info-tip" }, [
              F("div", { class: "qae-info-tip__title" }, " Aggregation functions "),
              F("div", null, [
                Ve(" • "),
                F("b", null, "count"),
                Ve(" — number of occurrences ")
              ]),
              F("div", null, [
                Ve(" • "),
                F("b", null, "sum / avg / min / max"),
                Ve(" — numeric attribute ")
              ]),
              F("div", null, [
                Ve(" • "),
                F("b", null, "p50 / p90 / p95 / p99"),
                Ve(" — percentiles ")
              ]),
              F("div", null, [
                Ve(" • "),
                F("b", null, "count_distinct(a, b)"),
                Ve(" — unique combinations ")
              ]),
              F("div", null, [
                Ve(" • "),
                F("b", null, "rate"),
                Ve(" — per-interval rate ")
              ])
            ], -1)
          ])]),
          default: ye(() => [
            N[3] || (N[3] = F("span", { class: "qae-info-icon i-material-symbols-info-outline text-15px" }, null, -1))
          ]),
          _: 1
        }))
      ], 2),
      t.showInterval ? (re(), be("div", qwe, [
        v(I(zi), {
          title: "Set the time interval for aggregation",
          placement: "top"
        }, {
          default: ye(() => [...N[4] || (N[4] = [
            F("span", { class: "qae-interval-label" }, "Step", -1)
          ])]),
          _: 1
        }),
        v(I(Do), {
          value: t.stepInterval || void 0,
          min: 1,
          placeholder: "Auto",
          size: "small",
          class: "qae-interval-input",
          onChange: N[0] || (N[0] = (L) => i("update:stepInterval", Number(L) || null))
        }, null, 8, ["value"]),
        N[5] || (N[5] = F("span", { class: "qae-interval-unit" }, "s", -1))
      ])) : et("", !0)
    ]));
  }
}), Kwe = /* @__PURE__ */ Co(Ywe, [["__scopeId", "data-v-dc340c32"]]), Xwe = { class: "argus-query-row__header" }, Zwe = { class: "argus-query-row__type" }, Gwe = ["title"], Uwe = ["disabled"], Jwe = {
  key: 0,
  class: "argus-query-row__body"
}, eCe = { class: "argus-query-row__section" }, tCe = {
  key: 0,
  class: "argus-query-row__section argus-query-row__grid"
}, nCe = { class: "argus-query-row__field" }, iCe = { class: "argus-query-row__field" }, oCe = { class: "argus-query-row__field argus-query-row__field--wide" }, rCe = { class: "argus-query-row__field" }, aCe = { class: "argus-query-row__field" }, lCe = { class: "argus-query-row__field" }, sCe = { class: "argus-query-row__field" }, uCe = {
  key: 1,
  class: "argus-query-row__section"
}, cCe = {
  key: 2,
  class: "argus-query-row__addons"
}, dCe = {
  key: 0,
  class: "argus-query-row__field argus-query-row__field--wide"
}, fCe = {
  key: 1,
  class: "argus-query-row__field"
}, hCe = {
  key: 2,
  class: "argus-query-row__field"
}, pCe = {
  key: 3,
  class: "argus-query-row__field"
}, gCe = {
  key: 4,
  class: "argus-query-row__field"
}, mCe = { class: "argus-query-row__addon-bar" }, vCe = {
  key: 1,
  class: "argus-query-row__section argus-query-row__section--stack"
}, yCe = { class: "argus-query-row__section" }, bCe = {
  key: 0,
  class: "argus-query-row__addons"
}, xCe = {
  key: 0,
  class: "argus-query-row__field"
}, OCe = {
  key: 1,
  class: "argus-query-row__field"
}, SCe = { class: "argus-query-row__addon-bar" }, wCe = /* @__PURE__ */ Oe({
  __name: "QueryItemRow",
  props: {
    item: {},
    cfg: {},
    collapsed: { type: Boolean },
    canDelete: { type: Boolean },
    queryNames: {}
  },
  emits: ["toggleCollapse", "toggleDisabled", "clone", "delete", "change"],
  setup(t, { emit: e }) {
    const n = t, i = e, o = A(() => n.item.type === "builder_formula"), r = A(() => n.item.spec.disabled), a = A(() => n.item.spec.name), l = de(
      n.item.type === "builder_query" ? n.item.queryType ?? "builder" : "builder"
    ), s = [
      { label: "查询构建器", value: "builder" },
      { label: "PromQL", value: "promql" },
      { label: "ClickHouse SQL", value: "clickhouse_sql" }
    ], u = [
      { value: "metrics", label: "指标" },
      { value: "logs", label: "日志" },
      { value: "traces", label: "链路" }
    ], c = [
      { value: null, label: "自动" },
      { value: 60, label: "60s" },
      { value: 300, label: "300s" },
      { value: 600, label: "600s" },
      { value: 1800, label: "1800s" },
      { value: 3600, label: "3600s" }
    ], d = [
      { key: "group_by", label: "分组", icon: "i-carbon-group", metrics: !1, desc: "按字段拆分聚合结果" },
      { key: "having", label: "Having", icon: "i-carbon-filter", metrics: !0, desc: "筛选聚合后的结果" },
      { key: "order_by", label: "排序", icon: "i-carbon-sort-descending", metrics: !0, desc: "设置结果排序字段和方向" },
      { key: "limit", label: "限制", icon: "i-carbon-compress", metrics: !0, desc: "限制返回序列数量" },
      { key: "legend", label: "图例", icon: "i-carbon-tag", metrics: !0, desc: "设置图例模板" }
    ], f = [
      { key: "order_by", label: "排序", icon: "i-carbon-sort-descending", desc: "按查询结果排序公式输出" },
      { key: "limit", label: "限制", icon: "i-carbon-compress", desc: "限制公式结果数量" }
    ], h = de([]), p = de([]);
    function g(he) {
      const le = [];
      he.groupBy.length && he.signal !== "metrics" && le.push("group_by"), he.having?.expression && le.push("having"), he.order.length && le.push("order_by"), he.limit !== void 0 && le.push("limit"), he.legend && le.push("legend"), h.value = Array.from(/* @__PURE__ */ new Set([...h.value, ...le]));
    }
    function m(he) {
      const le = [];
      he.order.length && le.push("order_by"), he.limit !== void 0 && le.push("limit"), p.value = Array.from(/* @__PURE__ */ new Set([...p.value, ...le]));
    }
    _e(
      () => n.item,
      (he) => {
        he.type === "builder_query" ? (l.value = he.queryType ?? "builder", g(he.spec)) : m(he.spec);
      },
      { immediate: !0 }
    );
    function y(he, le) {
      n.item.type === "builder_query" && i("change", { ...n.item, spec: { ...n.item.spec, [he]: le } });
    }
    function b(he) {
      n.item.type === "builder_formula" && i("change", { ...n.item, spec: { ...n.item.spec, ...he } });
    }
    function w(he) {
      if (n.item.type !== "builder_query")
        return;
      const le = he === "metrics" ? [{ metricName: "", metricType: "", timeAggregation: "rate", spaceAggregation: "sum" }] : [{ expression: "count()" }];
      i("change", {
        ...n.item,
        spec: {
          ...n.item.spec,
          signal: he,
          groupBy: he === "metrics" ? n.item.spec.groupBy : [],
          aggregations: le
        }
      });
    }
    function $(he) {
      n.item.type === "builder_query" && (l.value = he, i("change", { ...n.item, queryType: he }));
    }
    const C = A(
      () => n.item.type === "builder_query" ? n.item.spec : null
    ), P = A(
      () => n.item.type === "builder_formula" ? n.item.spec : null
    ), O = A(() => C.value?.signal === "metrics"), E = A(
      () => d.filter((he) => he.metrics || !O.value)
    ), _ = de([]), D = de(!1);
    let M = null;
    function N(he = "") {
      M && clearTimeout(M), M = setTimeout(async () => {
        if (!n.cfg) {
          _.value = [];
          return;
        }
        D.value = !0;
        try {
          _.value = await wB(n.cfg, { searchText: he, limit: 100 });
        } catch {
          _.value = [];
        } finally {
          D.value = !1;
        }
      }, he ? 250 : 0);
    }
    _e(
      [() => n.cfg?.url, () => n.cfg?.token],
      () => {
        N("");
      },
      { immediate: !0 }
    );
    const L = A(
      () => C.value?.aggregations?.[0] ?? { metricName: "", metricType: "", timeAggregation: "rate", spaceAggregation: "sum" }
    ), j = A(
      () => C.value?.aggregations ?? []
    ), B = A(
      () => L.value.metricType === "histogram" || L.value.metricType === "exponential_histogram"
    ), Y = A(() => B.value ? [] : L.value.metricType === "gauge" ? [
      { value: "latest", label: "Latest" },
      { value: "sum", label: "Sum" },
      { value: "avg", label: "Avg" },
      { value: "min", label: "Min" },
      { value: "max", label: "Max" },
      { value: "count", label: "Count" },
      { value: "count_distinct", label: "Count Distinct" }
    ] : [
      { value: "rate", label: "Rate" },
      { value: "increase", label: "Increase" },
      { value: "sum", label: "Sum" },
      { value: "avg", label: "Avg" },
      { value: "min", label: "Min" },
      { value: "max", label: "Max" }
    ]), Q = A(
      () => B.value ? [
        { value: "p50", label: "P50" },
        { value: "p75", label: "P75" },
        { value: "p90", label: "P90" },
        { value: "p95", label: "P95" },
        { value: "p99", label: "P99" }
      ] : [
        { value: "sum", label: "Sum" },
        { value: "avg", label: "Avg" },
        { value: "min", label: "Min" },
        { value: "max", label: "Max" }
      ]
    ), G = A(() => {
      if (O.value && L.value.metricName) {
        const he = `${L.value.spaceAggregation || "sum"}(${L.value.metricName})`;
        return [
          { value: `${he} asc`, label: `${he} 升序` },
          { value: `${he} desc`, label: `${he} 降序` }
        ];
      }
      return [
        { value: "timestamp asc", label: "时间 升序" },
        { value: "timestamp desc", label: "时间 降序" },
        { value: "value asc", label: "值 升序" },
        { value: "value desc", label: "值 降序" }
      ];
    }), V = A(
      () => n.queryNames.flatMap((he) => [
        { value: `${he} asc`, label: `${he} 升序` },
        { value: `${he} desc`, label: `${he} 降序` }
      ])
    ), H = A(() => {
      const he = C.value?.order[0] ?? P.value?.order[0];
      return he ? `${he.key.name} ${he.direction}` : void 0;
    });
    function q(he) {
      const le = he.toLowerCase().replaceAll("-", "_");
      return ["sum", "gauge", "histogram", "exponential_histogram", "summary"].includes(le) ? le : "";
    }
    function K(he) {
      C.value && y("aggregations", [{ ...L.value, ...he }]);
    }
    function ee(he) {
      if (!he) {
        K({ metricName: "", metricType: "", timeAggregation: "rate", spaceAggregation: "sum" });
        return;
      }
      const le = q(_.value.find((ke) => ke.metricName === he)?.type ?? "");
      K({
        metricName: he,
        metricType: le,
        timeAggregation: le === "gauge" ? "latest" : "rate",
        spaceAggregation: le === "histogram" || le === "exponential_histogram" ? "p99" : "sum"
      });
    }
    function ie(he) {
      C.value && y("aggregations", [{ expression: he }]);
    }
    function ae(he) {
      if (!he)
        return [];
      const le = he.trim().split(/\s+/), ke = le.pop();
      return !ke || !["asc", "desc"].includes(ke) ? [] : [{ key: { name: le.join(" ") }, direction: ke }];
    }
    function te(he) {
      C.value ? y("order", ae(he)) : b({ order: ae(he) });
    }
    function U(he) {
      C.value && y("limit", he ?? void 0);
    }
    function me(he) {
      n.item.type === "builder_query" && i("change", { ...n.item, rawQuery: he });
    }
    function ce(he) {
      n.item.type === "builder_query" && i("change", { ...n.item, rawLegend: he });
    }
    function ue(he) {
      const le = h.value.includes(he);
      h.value = le ? h.value.filter((ke) => ke !== he) : [...h.value, he], le && C.value && (he === "group_by" && y("groupBy", []), he === "having" && y("having", { expression: "" }), he === "order_by" && y("order", []), he === "limit" && y("limit", void 0), he === "legend" && y("legend", "")), !le && he === "legend" && C.value && !C.value.legend && C.value.groupBy.length && y("legend", C.value.groupBy.map((ke) => `{{${ke.name}}}`).join("-"));
    }
    function fe(he) {
      const le = p.value.includes(he);
      p.value = le ? p.value.filter((ke) => ke !== he) : [...p.value, he], le && (he === "order_by" && b({ order: [] }), he === "limit" && b({ limit: void 0 }));
    }
    return (he, le) => (re(), be("div", {
      class: Tt(["argus-query-row", { "argus-query-row--disabled": r.value }])
    }, [
      F("div", Xwe, [
        F("button", {
          class: "argus-query-row__icon",
          onClick: le[0] || (le[0] = (ke) => i("toggleCollapse"))
        }, [
          F("span", {
            class: Tt([t.collapsed ? I(St).chevronRight : I(St).chevronDown, "text-16px"])
          }, null, 2)
        ]),
        v(I(Va), {
          color: o.value ? "purple" : "cyan",
          class: "argus-query-row__tag"
        }, {
          default: ye(() => [
            Ve(se(a.value), 1)
          ]),
          _: 1
        }, 8, ["color"]),
        t.item.type === "builder_query" ? (re(), be(tt, { key: 0 }, [
          F("div", Zwe, [
            (re(), be(tt, null, Jt(s, (ke) => v(I(en), {
              key: ke.value,
              size: "small",
              type: l.value === ke.value ? "primary" : "default",
              onClick: (ze) => $(ke.value)
            }, {
              default: ye(() => [
                Ve(se(ke.label), 1)
              ]),
              _: 2
            }, 1032, ["type", "onClick"])), 64))
          ]),
          l.value === "builder" ? (re(), ut(I(Dt), {
            key: 0,
            size: "small",
            style: { width: "86px" },
            value: t.item.spec.signal,
            options: u,
            onChange: le[1] || (le[1] = (ke) => w(ke))
          }, null, 8, ["value"])) : et("", !0),
          l.value === "builder" ? (re(), ut(sbe, {
            key: 1,
            functions: t.item.spec.functions,
            signal: t.item.spec.signal,
            onChange: le[2] || (le[2] = (ke) => y("functions", ke))
          }, null, 8, ["functions", "signal"])) : et("", !0)
        ], 64)) : et("", !0),
        le[29] || (le[29] = F("div", { class: "flex-1" }, null, -1)),
        F("button", {
          class: "argus-query-row__icon",
          title: "克隆",
          onClick: le[3] || (le[3] = (ke) => i("clone"))
        }, [
          F("span", {
            class: Tt(I(St).clone)
          }, null, 2)
        ]),
        F("button", {
          class: "argus-query-row__icon",
          title: r.value ? "启用" : "禁用",
          onClick: le[4] || (le[4] = (ke) => i("toggleDisabled"))
        }, [
          F("span", {
            class: Tt(r.value ? I(St).viewOff : I(St).view)
          }, null, 2)
        ], 8, Gwe),
        F("button", {
          class: "argus-query-row__icon argus-query-row__icon--danger",
          title: "删除",
          disabled: !t.canDelete,
          onClick: le[5] || (le[5] = (ke) => i("delete"))
        }, [
          F("span", {
            class: Tt(I(St).delete)
          }, null, 2)
        ], 8, Uwe)
      ]),
      t.collapsed ? et("", !0) : (re(), be("div", Jwe, [
        t.item.type === "builder_query" && l.value === "builder" && C.value ? (re(), be(tt, { key: 0 }, [
          F("div", eCe, [
            O.value ? (re(), ut(I(Dt), {
              key: 0,
              "show-search": "",
              "allow-clear": "",
              class: "argus-query-row__metric",
              placeholder: "选择指标",
              loading: D.value,
              value: L.value.metricName || void 0,
              options: _.value.map((ke) => ({ value: ke.metricName, label: ke.metricName })),
              "filter-option": !1,
              onDropdownVisibleChange: le[6] || (le[6] = (ke) => ke && N("")),
              onSearch: le[7] || (le[7] = (ke) => N(ke)),
              onChange: le[8] || (le[8] = (ke) => ee(ke))
            }, null, 8, ["loading", "value", "options"])) : et("", !0),
            v(Wwe, {
              class: "argus-query-row__filter",
              "model-value": C.value.filter.expression,
              cfg: t.cfg,
              signal: C.value.signal,
              "metric-name": L.value.metricName || void 0,
              placeholder: O.value ? "源数据筛选，如 host.name = my-host" : "过滤条件",
              "onUpdate:modelValue": le[9] || (le[9] = (ke) => y("filter", { expression: ke }))
            }, null, 8, ["model-value", "cfg", "signal", "metric-name", "placeholder"])
          ]),
          O.value ? (re(), be("div", tCe, [
            B.value ? (re(), be(tt, { key: 0 }, [
              F("label", nCe, [
                le[30] || (le[30] = F("span", null, "跨时序聚合", -1)),
                v(I(Dt), {
                  size: "small",
                  value: L.value.spaceAggregation || void 0,
                  options: Q.value,
                  disabled: !L.value.metricName,
                  onChange: le[10] || (le[10] = (ke) => K({ spaceAggregation: ke }))
                }, null, 8, ["value", "options", "disabled"])
              ]),
              F("label", iCe, [
                le[31] || (le[31] = F("span", null, "步长", -1)),
                v(I(Dt), {
                  size: "small",
                  value: C.value.stepInterval ?? void 0,
                  options: c,
                  onChange: le[11] || (le[11] = (ke) => y("stepInterval", ke ?? null))
                }, null, 8, ["value"])
              ]),
              F("label", oCe, [
                le[32] || (le[32] = F("span", null, "分组", -1)),
                v(W1, {
                  "group-by": C.value.groupBy,
                  cfg: t.cfg,
                  signal: "metrics",
                  "metric-name": L.value.metricName,
                  disabled: !L.value.metricName,
                  onChange: le[12] || (le[12] = (ke) => y("groupBy", ke))
                }, null, 8, ["group-by", "cfg", "metric-name", "disabled"])
              ])
            ], 64)) : (re(), be(tt, { key: 1 }, [
              F("label", rCe, [
                le[33] || (le[33] = F("span", null, "时序内聚合", -1)),
                v(I(Dt), {
                  size: "small",
                  value: L.value.timeAggregation || void 0,
                  options: Y.value,
                  disabled: !L.value.metricName,
                  onChange: le[13] || (le[13] = (ke) => K({ timeAggregation: ke }))
                }, null, 8, ["value", "options", "disabled"])
              ]),
              F("label", aCe, [
                le[34] || (le[34] = F("span", null, "步长", -1)),
                v(I(Dt), {
                  size: "small",
                  value: C.value.stepInterval ?? void 0,
                  options: c,
                  onChange: le[14] || (le[14] = (ke) => y("stepInterval", ke ?? null))
                }, null, 8, ["value"])
              ]),
              F("label", lCe, [
                le[35] || (le[35] = F("span", null, "跨时序聚合", -1)),
                v(I(Dt), {
                  size: "small",
                  value: L.value.spaceAggregation || void 0,
                  options: Q.value,
                  disabled: !L.value.metricName,
                  onChange: le[15] || (le[15] = (ke) => K({ spaceAggregation: ke }))
                }, null, 8, ["value", "options", "disabled"])
              ]),
              F("label", sCe, [
                le[36] || (le[36] = F("span", null, "分组", -1)),
                v(W1, {
                  "group-by": C.value.groupBy,
                  cfg: t.cfg,
                  signal: "metrics",
                  "metric-name": L.value.metricName,
                  disabled: !L.value.metricName,
                  onChange: le[16] || (le[16] = (ke) => y("groupBy", ke))
                }, null, 8, ["group-by", "cfg", "metric-name", "disabled"])
              ])
            ], 64))
          ])) : (re(), be("div", uCe, [
            le[37] || (le[37] = F("span", { class: "argus-query-row__inline-label" }, "聚合", -1)),
            v(Kwe, {
              "model-value": j.value[0]?.expression ?? "",
              cfg: t.cfg,
              signal: C.value.signal,
              "show-interval": !0,
              "step-interval": C.value.stepInterval,
              "onUpdate:modelValue": ie,
              "onUpdate:stepInterval": le[17] || (le[17] = (ke) => y("stepInterval", ke))
            }, null, 8, ["model-value", "cfg", "signal", "step-interval"])
          ])),
          h.value.length ? (re(), be("div", cCe, [
            h.value.includes("group_by") && !O.value ? (re(), be("label", dCe, [
              le[38] || (le[38] = F("span", null, "分组", -1)),
              v(W1, {
                "group-by": C.value.groupBy,
                cfg: t.cfg,
                signal: C.value.signal,
                onChange: le[18] || (le[18] = (ke) => y("groupBy", ke))
              }, null, 8, ["group-by", "cfg", "signal"])
            ])) : et("", !0),
            h.value.includes("having") ? (re(), be("label", fCe, [
              le[39] || (le[39] = F("span", null, "Having", -1)),
              v(I(jt), {
                size: "small",
                placeholder: "如 count() > 100",
                value: C.value.having?.expression ?? "",
                onChange: le[19] || (le[19] = (ke) => y("having", { expression: ke.target.value }))
              }, null, 8, ["value"])
            ])) : et("", !0),
            h.value.includes("order_by") ? (re(), be("label", hCe, [
              le[40] || (le[40] = F("span", null, "排序", -1)),
              v(I(Dt), {
                "show-search": "",
                "allow-clear": "",
                mode: "tags",
                size: "small",
                value: H.value ? [H.value] : [],
                options: G.value,
                onChange: le[20] || (le[20] = (ke) => te(Array.isArray(ke) ? ke[0] : ke))
              }, null, 8, ["value", "options"])
            ])) : et("", !0),
            h.value.includes("limit") ? (re(), be("label", pCe, [
              le[41] || (le[41] = F("span", null, "限制", -1)),
              v(I(Do), {
                size: "small",
                style: { width: "100%" },
                placeholder: "∞",
                min: 1,
                max: 1e4,
                value: C.value.limit,
                onChange: le[21] || (le[21] = (ke) => U(ke))
              }, null, 8, ["value"])
            ])) : et("", !0),
            h.value.includes("legend") ? (re(), be("label", gCe, [
              le[42] || (le[42] = F("span", null, "图例", -1)),
              v(I(jt), {
                size: "small",
                placeholder: "{{label}}",
                value: C.value.legend,
                onChange: le[22] || (le[22] = (ke) => y("legend", ke.target.value))
              }, null, 8, ["value"])
            ])) : et("", !0)
          ])) : et("", !0),
          F("div", mCe, [
            (re(!0), be(tt, null, Jt(E.value, (ke) => (re(), ut(I(zi), {
              key: ke.key,
              title: ke.desc
            }, {
              default: ye(() => [
                v(I(en), {
                  size: "small",
                  type: h.value.includes(ke.key) ? "primary" : "default",
                  onClick: (ze) => ue(ke.key)
                }, {
                  default: ye(() => [
                    F("span", {
                      class: Tt([ke.icon, "mr-1"])
                    }, null, 2),
                    Ve(se(ke.label), 1)
                  ]),
                  _: 2
                }, 1032, ["type", "onClick"])
              ]),
              _: 2
            }, 1032, ["title"]))), 128))
          ])
        ], 64)) : t.item.type === "builder_query" && l.value !== "builder" ? (re(), be("div", vCe, [
          v(I(jt).TextArea, {
            rows: 4,
            placeholder: l.value === "promql" ? "输入 PromQL 查询语句" : "输入 ClickHouse SQL 查询语句",
            value: t.item.rawQuery ?? "",
            style: { "font-family": "monospace", "font-size": "12px" },
            onChange: le[23] || (le[23] = (ke) => me(ke.target.value))
          }, null, 8, ["placeholder", "value"]),
          v(I(jt), {
            size: "small",
            placeholder: "图例格式",
            value: t.item.rawLegend ?? "",
            onChange: le[24] || (le[24] = (ke) => ce(ke.target.value))
          }, null, 8, ["value"])
        ])) : t.item.type === "builder_formula" && P.value ? (re(), be(tt, { key: 2 }, [
          F("div", yCe, [
            v(I(jt), {
              size: "small",
              class: "argus-query-row__filter",
              placeholder: "公式表达式，如 A + B",
              value: P.value.expression,
              onChange: le[25] || (le[25] = (ke) => b({ expression: ke.target.value }))
            }, null, 8, ["value"]),
            v(I(jt), {
              size: "small",
              style: { width: "220px" },
              placeholder: "图例格式",
              value: P.value.legend,
              onChange: le[26] || (le[26] = (ke) => b({ legend: ke.target.value }))
            }, null, 8, ["value"])
          ]),
          p.value.length ? (re(), be("div", bCe, [
            p.value.includes("order_by") ? (re(), be("label", xCe, [
              le[43] || (le[43] = F("span", null, "排序", -1)),
              v(I(Dt), {
                "show-search": "",
                "allow-clear": "",
                mode: "tags",
                size: "small",
                value: H.value ? [H.value] : [],
                options: V.value,
                onChange: le[27] || (le[27] = (ke) => te(Array.isArray(ke) ? ke[0] : ke))
              }, null, 8, ["value", "options"])
            ])) : et("", !0),
            p.value.includes("limit") ? (re(), be("label", OCe, [
              le[44] || (le[44] = F("span", null, "限制", -1)),
              v(I(Do), {
                size: "small",
                style: { width: "100%" },
                placeholder: "∞",
                min: 1,
                max: 1e4,
                value: P.value.limit,
                onChange: le[28] || (le[28] = (ke) => b({ limit: ke ?? void 0 }))
              }, null, 8, ["value"])
            ])) : et("", !0)
          ])) : et("", !0),
          F("div", SCe, [
            (re(), be(tt, null, Jt(f, (ke) => v(I(zi), {
              key: ke.key,
              title: ke.desc
            }, {
              default: ye(() => [
                v(I(en), {
                  size: "small",
                  type: p.value.includes(ke.key) ? "primary" : "default",
                  onClick: (ze) => fe(ke.key)
                }, {
                  default: ye(() => [
                    F("span", {
                      class: Tt([ke.icon, "mr-1"])
                    }, null, 2),
                    Ve(se(ke.label), 1)
                  ]),
                  _: 2
                }, 1032, ["type", "onClick"])
              ]),
              _: 2
            }, 1032, ["title"])), 64))
          ])
        ], 64)) : et("", !0)
      ]))
    ], 2));
  }
}), CCe = /* @__PURE__ */ Co(wCe, [["__scopeId", "data-v-3af2ae9f"]]), $Ce = { class: "argus-qb" }, kCe = { class: "argus-qb__content" }, TCe = {
  key: 0,
  class: "argus-qb__datasource"
}, PCe = { class: "argus-qb__footer" }, ECe = {
  key: 0,
  class: "argus-qb__nav"
}, xA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ", _Ce = /* @__PURE__ */ Oe({
  __name: "ArgusQueryEditor",
  props: {
    query: {},
    datasourceId: {},
    isChart: { type: Boolean }
  },
  emits: ["change"],
  setup(t, { emit: e }) {
    const n = t, i = e, { config: o } = Uf(), r = A(
      () => (o.value.datasourceConfig ?? []).filter((b) => b.type === "argus")
    ), a = de(/* @__PURE__ */ new Set());
    function l(b) {
      return {
        name: b,
        signal: "metrics",
        stepInterval: null,
        disabled: !1,
        filter: { expression: "" },
        having: { expression: "" },
        groupBy: [],
        order: [],
        legend: "",
        functions: [],
        aggregations: [{ metricName: "", metricType: "", timeAggregation: "rate", spaceAggregation: "sum" }]
      };
    }
    function s(b) {
      return { name: b, expression: "", disabled: !1, legend: "", order: [] };
    }
    function u(b, w) {
      i("change", { ...n.query, [b]: w });
    }
    function c() {
      const b = n.query.queries.filter((P) => P.type === "builder_query"), w = new Set(n.query.queries.map((P) => P.spec.name)), $ = xA.split("").find((P) => !w.has(P)) ?? `Q${b.length + 1}`, C = { type: "builder_query", spec: l($) };
      i("change", { ...n.query, queries: [...n.query.queries, C] });
    }
    function d() {
      const b = n.query.queries.filter((O) => O.type === "builder_formula"), w = new Set(n.query.queries.map((O) => O.spec.name));
      let $ = b.length + 1;
      for (; w.has(`F${$}`); )
        $ += 1;
      const C = `F${$}`, P = { type: "builder_formula", spec: s(C) };
      i("change", { ...n.query, queries: [...n.query.queries, P] });
    }
    function f(b) {
      i("change", { ...n.query, queries: n.query.queries.filter((w) => w.spec.name !== b) });
    }
    function h(b) {
      const w = n.query.queries.filter((P) => P.type === "builder_query"), $ = new Set(n.query.queries.map((P) => P.spec.name)), C = JSON.parse(JSON.stringify(b));
      if (C.type === "builder_query")
        C.spec.name = xA.split("").find((P) => !$.has(P)) ?? `Q${w.length + 1}`, C.spec.disabled = !1;
      else {
        let P = n.query.queries.filter((O) => O.type === "builder_formula").length + 1;
        for (; $.has(`F${P}`); )
          P += 1;
        C.spec.name = `F${P}`, C.spec.disabled = !1;
      }
      i("change", { ...n.query, queries: [...n.query.queries, C] });
    }
    function p(b) {
      i("change", {
        ...n.query,
        queries: n.query.queries.map((w) => w.spec.name === b.spec.name ? b : w)
      });
    }
    function g(b) {
      const w = new Set(a.value);
      w.has(b) ? w.delete(b) : w.add(b), a.value = w;
    }
    function m(b) {
      p({ ...b, spec: { ...b.spec, disabled: !b.spec.disabled } });
    }
    const y = A(() => {
      const b = (o.value.datasourceConfig ?? []).filter(($) => $.type === "argus");
      if (!b.length)
        return null;
      const w = b.find(($) => $.uid === n.datasourceId) ?? b.find(($) => $.default) ?? b[0];
      return { url: w.url, token: w.token };
    });
    return (b, w) => (re(), be("div", $Ce, [
      F("div", kCe, [
        r.value.length > 1 ? (re(), be("div", TCe, [
          w[1] || (w[1] = F("span", { class: "text-xs text-secondary whitespace-nowrap" }, "数据源", -1)),
          v(I(Dt), {
            size: "small",
            style: { width: "180px" },
            value: t.query.datasourceId,
            options: r.value.map(($) => ({ value: $.uid, label: $.name })),
            onChange: w[0] || (w[0] = ($) => u("datasourceId", $))
          }, null, 8, ["value", "options"])
        ])) : et("", !0),
        (re(!0), be(tt, null, Jt(t.query.queries, ($) => (re(), ut(CCe, {
          key: $.spec.name,
          item: $,
          cfg: y.value,
          collapsed: a.value.has($.spec.name),
          "can-delete": t.query.queries.length > 1,
          "query-names": t.query.queries.map((C) => C.spec.name),
          onToggleCollapse: () => g($.spec.name),
          onToggleDisabled: () => m($),
          onClone: () => h($),
          onDelete: () => f($.spec.name),
          onChange: p
        }, null, 8, ["item", "cfg", "collapsed", "can-delete", "query-names", "onToggleCollapse", "onToggleDisabled", "onClone", "onDelete"]))), 128)),
        F("div", PCe, [
          v(I(en), {
            size: "small",
            type: "dashed",
            onClick: c
          }, {
            default: ye(() => [
              F("span", {
                class: Tt([I(St).plus, "mr-1"])
              }, null, 2),
              w[2] || (w[2] = Ve("基础查询 ", -1))
            ]),
            _: 1
          }),
          v(I(en), {
            size: "small",
            type: "dashed",
            onClick: d
          }, {
            default: ye(() => [
              F("span", {
                class: Tt([I(St).plus, "mr-1"])
              }, null, 2),
              w[3] || (w[3] = Ve("衍生算式 ", -1))
            ]),
            _: 1
          })
        ])
      ]),
      t.query.queries.length > 1 ? (re(), be("div", ECe, [
        (re(!0), be(tt, null, Jt(t.query.queries, ($) => (re(), ut(I(Va), {
          key: $.spec.name,
          color: $.type === "builder_formula" ? "purple" : "cyan",
          class: "argus-qb__nav-tag"
        }, {
          default: ye(() => [
            Ve(se($.spec.name), 1)
          ]),
          _: 2
        }, 1032, ["color"]))), 128))
      ])) : et("", !0)
    ]));
  }
}), ICe = /* @__PURE__ */ Co(_Ce, [["__scopeId", "data-v-c5f512fd"]]), MCe = { style: { "padding-top": "6px" } }, ACe = { class: "inline-flex items-center gap-1.5 mb-2" }, RCe = { class: "text-xs text-secondary" }, DCe = {
  key: 0,
  class: "inline-flex items-center gap-1.5 mb-0 ml-2"
}, NCe = { class: "text-xs text-secondary" }, LCe = {
  key: 1,
  class: "inline-flex items-center gap-1.5 mb-0 ml-2"
}, zCe = { class: "text-xs text-secondary" }, BCe = {
  class: "text-xs text-secondary",
  style: { "min-width": "28px" }
}, FCe = /* @__PURE__ */ Oe({
  __name: "MockQueryEditor",
  props: {
    query: {},
    datasourceId: {},
    isChart: { type: Boolean }
  },
  emits: ["change"],
  setup(t, { emit: e }) {
    const n = e, { t: i } = On(), o = A(() => [
      { value: "sine", label: i("qb.pattern.sine") },
      { value: "spike", label: i("qb.pattern.spike") },
      { value: "step", label: i("qb.pattern.step") },
      { value: "sawtooth", label: i("qb.pattern.sawtooth") },
      { value: "noise", label: i("qb.pattern.noise") },
      { value: "trend-up", label: i("qb.pattern.trendUp") },
      { value: "trend-down", label: i("qb.pattern.trendDown") },
      { value: "plateau", label: i("qb.pattern.plateau") },
      { value: "random-walk", label: i("qb.pattern.randomWalk") },
      { value: "live", label: i("qb.pattern.live") }
    ]);
    return (r, a) => (re(), be("div", MCe, [
      F("div", ACe, [
        F("span", RCe, se(I(i)("qb.pattern")), 1),
        v(I(Dt), {
          size: "small",
          style: { width: "140px" },
          value: t.query.pattern,
          options: o.value,
          onChange: a[0] || (a[0] = (l) => n("change", { ...t.query, pattern: l }))
        }, null, 8, ["value", "options"])
      ]),
      t.isChart ? (re(), be("div", DCe, [
        F("span", NCe, se(I(i)("qb.seriesCount")), 1),
        v(I(vr), {
          min: 1,
          max: 8,
          value: t.query.seriesCount ?? 1,
          style: { width: "200px" },
          onChange: a[1] || (a[1] = (l) => n("change", { ...t.query, seriesCount: l }))
        }, null, 8, ["value"])
      ])) : et("", !0),
      t.query.pattern === "live" ? (re(), be("div", LCe, [
        F("span", zCe, se(I(i)("qb.liveAmplitude")), 1),
        v(I(vr), {
          min: 0.1,
          max: 5,
          step: 0.1,
          value: t.query.liveAmplitude ?? 1,
          style: { width: "160px" },
          onChange: a[2] || (a[2] = (l) => n("change", { ...t.query, liveAmplitude: l }))
        }, null, 8, ["value"]),
        F("span", BCe, se((t.query.liveAmplitude ?? 1).toFixed(1)) + "x ", 1)
      ])) : et("", !0)
    ]));
  }
}), sc = /* @__PURE__ */ Oe({
  __name: "ComboSelect",
  props: {
    value: {},
    displayValue: {},
    placeholder: {},
    groups: {},
    allowCustom: { type: Boolean, default: !0 },
    loading: { type: Boolean, default: !1 },
    disabled: { type: Boolean, default: !1 }
  },
  emits: ["change", "clear"],
  setup(t, { emit: e }) {
    const n = t, i = e, o = de(n.displayValue ?? n.value ?? "");
    _e(
      [() => n.value, () => n.displayValue],
      ([s, u]) => {
        o.value = u ?? s ?? "";
      }
    );
    function r(s, u) {
      return s.toLowerCase().includes(u.toLowerCase());
    }
    const a = A(() => {
      const s = o.value, u = n.groups.flatMap((f) => f.options), c = n.allowCustom && s && !u.some((f) => f.value === s || f.label === s) ? [{ label: "── 自定义 ──", options: [{ value: s, label: s }] }] : [], d = s ? n.groups.map((f) => ({ ...f, options: f.options.filter((h) => r(h.label, s)) })).filter((f) => f.options.length > 0) : n.groups;
      return [...c, ...d];
    }), l = A(
      () => a.value.map((s) => ({
        label: s.label,
        options: s.options
      }))
    );
    return (s, u) => (re(), ut(I(Dt), {
      size: "small",
      style: { width: "100%" },
      "show-search": "",
      "allow-clear": "",
      "filter-option": !1,
      value: t.value || void 0,
      "search-value": o.value,
      placeholder: t.placeholder,
      loading: t.loading,
      disabled: t.disabled,
      options: l.value,
      onFocus: u[0] || (u[0] = () => {
        o.value = t.displayValue ?? t.value ?? "";
      }),
      onSearch: u[1] || (u[1] = (c) => {
        o.value = c;
      }),
      onChange: u[2] || (u[2] = (c) => {
        o.value = String(c ?? ""), i("change", String(c));
      }),
      onClear: u[3] || (u[3] = () => {
        o.value = "", i("clear");
      })
    }, null, 8, ["value", "search-value", "placeholder", "loading", "disabled", "options"]));
  }
}), VCe = { class: "flex flex-wrap items-center gap-1.5 mt-1" }, QCe = { class: "text-xs text-secondary" }, HCe = { class: "font-medium text-blue lh-1" }, WCe = /* @__PURE__ */ Oe({
  __name: "FunctionsEditor",
  props: {
    functions: {}
  },
  emits: ["change"],
  setup(t, { emit: e }) {
    const n = t, i = e, { t: o } = On();
    function r(h, p) {
      return p.length === 0 ? `${h.name}()` : `${h.name}(${p.join(", ")})`;
    }
    function a(h) {
      return { def: h, params: [...h.defaultParams], text: r(h, h.defaultParams) };
    }
    function l(h) {
      const p = h.filter((m) => m.def.category === "Alias");
      return [...h.filter((m) => m.def.category !== "Alias"), ...p];
    }
    function s(h) {
      const p = rP.find((m) => m.name === h);
      if (!p)
        return;
      const g = a(p);
      i("change", l([...n.functions, g]));
    }
    function u(h, p, g) {
      const m = n.functions.map((y, b) => {
        if (b !== h)
          return y;
        const w = [...y.params];
        return w[p] = g, { ...y, params: w, text: r(y.def, w) };
      });
      i("change", m);
    }
    function c(h) {
      i("change", n.functions.filter((p, g) => g !== h));
    }
    function d(h, p) {
      const g = h + p;
      if (g < 0 || g >= n.functions.length)
        return;
      const m = [...n.functions];
      [m[h], m[g]] = [m[g], m[h]], i("change", m);
    }
    const f = A(
      () => Aj.map((h) => ({
        key: h,
        label: h,
        children: rP.filter((p) => p.category === h).map((p) => ({ key: p.name, label: p.name }))
      }))
    );
    return (h, p) => (re(), be("div", VCe, [
      F("span", QCe, se(I(o)("qb.functions")), 1),
      (re(!0), be(tt, null, Jt(t.functions, (g, m) => (re(), be("div", {
        key: m,
        class: "inline-flex items-center gap-0.5 rounded px-1",
        style: { background: "#eee", "font-size": "12px" }
      }, [
        v(I(en), {
          type: "text",
          size: "small",
          class: "p-0!",
          disabled: m === 0,
          onClick: (y) => d(m, -1)
        }, {
          default: ye(() => [
            F("span", {
              class: Tt(I(St).chevronLeft)
            }, null, 2)
          ]),
          _: 1
        }, 8, ["disabled", "onClick"]),
        F("span", HCe, se(g.def.name), 1),
        p[1] || (p[1] = F("span", { class: "text-yellow" }, "(", -1)),
        (re(!0), be(tt, null, Jt(g.def.params, (y, b) => (re(), be(tt, { key: b }, [
          y.options ? (re(), ut(I(Dt), {
            key: 0,
            size: "small",
            value: String(g.params[b] ?? y.options[0]),
            options: y.options.map((w) => ({ value: String(w), label: String(w) })),
            "popup-match-select-width": "false",
            "dropdown-match-select-width": !1,
            bordered: !1,
            variant: "borderless",
            style: { "min-width": "60px" },
            onChange: (w) => u(m, b, w)
          }, null, 8, ["value", "options", "onChange"])) : (re(), ut(I(jt), {
            key: 1,
            class: "text-green text-center",
            size: "small",
            bordered: !1,
            value: String(g.params[b] ?? ""),
            style: { width: "40px", padding: "0 4px", height: "20px" },
            variant: "borderless",
            onChange: (w) => u(m, b, w.target.value)
          }, null, 8, ["value", "onChange"]))
        ], 64))), 128)),
        p[2] || (p[2] = F("span", { class: "text-yellow font-medium" }, ")", -1)),
        v(I(en), {
          type: "text",
          size: "small",
          class: "p-0!",
          disabled: m === t.functions.length - 1,
          onClick: (y) => d(m, 1)
        }, {
          default: ye(() => [
            F("span", {
              class: Tt(I(St).chevronRight)
            }, null, 2)
          ]),
          _: 1
        }, 8, ["disabled", "onClick"]),
        v(I(en), {
          type: "text",
          size: "small",
          class: "p-0!",
          danger: "",
          onClick: (y) => c(m)
        }, {
          default: ye(() => [
            F("span", {
              class: Tt(I(St).delete)
            }, null, 2)
          ]),
          _: 1
        }, 8, ["onClick"])
      ]))), 128)),
      v(I(Nr), { trigger: ["click"] }, {
        overlay: ye(() => [
          v(I(Bi), {
            onClick: p[0] || (p[0] = ({ key: g }) => s(String(g)))
          }, {
            default: ye(() => [
              (re(!0), be(tt, null, Jt(f.value, (g) => (re(), ut(I(Bi).SubMenu, {
                key: g.key,
                title: g.label
              }, {
                default: ye(() => [
                  (re(!0), be(tt, null, Jt(g.children, (m) => (re(), ut(I(Bi).Item, {
                    key: m.key
                  }, {
                    default: ye(() => [
                      Ve(se(m.label), 1)
                    ]),
                    _: 2
                  }, 1024))), 128))
                ]),
                _: 2
              }, 1032, ["title"]))), 128))
            ]),
            _: 1
          })
        ]),
        default: ye(() => [
          v(I(en), {
            size: "small",
            type: "dashed"
          }, {
            default: ye(() => [
              Ve(" + " + se(I(o)("qb.functions.add")), 1)
            ]),
            _: 1
          })
        ]),
        _: 1
      })
    ]));
  }
}), jCe = { class: "flex flex-wrap items-center gap-0 mt-3" }, qCe = { class: "text-xs text-secondary font-medium" }, YCe = { class: "text-xs" }, KCe = { class: "inline-flex items-center gap-1.5 mr-3" }, XCe = { class: "text-xs text-secondary whitespace-nowrap" }, ZCe = { class: "inline-flex items-center gap-1.5 mr-3" }, GCe = { class: "text-xs text-secondary whitespace-nowrap" }, UCe = { class: "inline-flex items-center gap-1.5 mr-3" }, JCe = { class: "text-xs text-secondary whitespace-nowrap" }, e$e = { class: "inline-flex items-center gap-1.5 mr-3" }, t$e = { class: "text-xs text-secondary whitespace-nowrap" }, n$e = {
  key: 1,
  class: "inline-flex items-center gap-1.5 mr-3"
}, i$e = { class: "text-xs text-secondary whitespace-nowrap" }, o$e = { class: "inline-flex items-center gap-1.5 mr-3" }, r$e = { class: "text-xs text-secondary whitespace-nowrap" }, a$e = { class: "inline-flex items-center gap-1.5 mr-3" }, l$e = { class: "text-xs text-secondary whitespace-nowrap" }, s$e = { class: "inline-flex items-center gap-1.5 mr-3" }, u$e = { class: "text-xs text-secondary whitespace-nowrap" }, c$e = { class: "inline-flex items-center gap-1.5 mr-3" }, d$e = { class: "text-xs text-secondary whitespace-nowrap" }, f$e = { class: "inline-flex items-center gap-1.5 mr-3" }, h$e = { class: "text-xs text-secondary whitespace-nowrap" }, p$e = { class: "inline-flex items-center gap-1.5 mr-3" }, g$e = { class: "text-xs text-secondary whitespace-nowrap" }, m$e = { class: "inline-flex items-center gap-1.5 mr-3" }, v$e = { class: "text-xs text-secondary whitespace-nowrap" }, y$e = { class: "inline-flex items-center gap-1.5 mr-3" }, b$e = { class: "text-xs text-secondary whitespace-nowrap" }, x$e = /* @__PURE__ */ Oe({
  __name: "OptionsEditor",
  props: {
    queryType: {},
    options: {}
  },
  emits: ["change"],
  setup(t, { emit: e }) {
    const n = t, i = e, { t: o } = On(), r = de(!0);
    function a(c) {
      i("change", { ...n.options, ...c });
    }
    const l = [
      { value: 2, label: o("qb.ack.all") },
      { value: 0, label: o("qb.ack.unack") },
      { value: 1, label: o("qb.ack.ack") }
    ], s = [
      { value: "default", label: o("qb.sort.default") },
      { value: "lastchange", label: o("qb.sort.lastchange") },
      { value: "severity", label: o("qb.sort.severity") }
    ], u = [
      { value: "default", label: o("qb.trends.default") },
      { value: "true", label: o("qb.trends.true") },
      { value: "false", label: o("qb.trends.false") }
    ];
    return (c, d) => (re(), be("div", jCe, [
      F("div", {
        class: "inline-flex items-center gap-1.5 cursor-pointer py-1 mr-2 select-none flex-shrink-0",
        onClick: d[0] || (d[0] = (f) => r.value = !r.value)
      }, [
        F("span", qCe, se(I(o)("qb.options")), 1),
        F("span", YCe, se(r.value ? "▸" : "▾"), 1)
      ]),
      F("div", {
        class: "flex flex-wrap items-center overflow-hidden transition-all",
        style: Yt({ maxHeight: r.value ? "200px" : "0" })
      }, [
        t.queryType === "metrics" || t.queryType === "itemid" || t.queryType === "services" ? (re(), be(tt, { key: 0 }, [
          F("div", KCe, [
            F("span", XCe, se(I(o)("qb.options.trends")), 1),
            v(I(Dt), {
              size: "small",
              style: { width: "100px" },
              "dropdown-match-select-width": !1,
              value: t.options.useTrends ?? "default",
              options: u,
              onChange: d[1] || (d[1] = (f) => a({ useTrends: f }))
            }, null, 8, ["value"])
          ]),
          F("div", ZCe, [
            F("span", GCe, se(I(o)("qb.options.showDisabled")), 1),
            v(I(ts), {
              size: "small",
              checked: !!t.options.showDisabledItems,
              onChange: d[2] || (d[2] = (f) => a({ showDisabledItems: f }))
            }, null, 8, ["checked"])
          ]),
          F("div", UCe, [
            F("span", JCe, se(I(o)("qb.options.valueMapping")), 1),
            v(I(ts), {
              size: "small",
              checked: !!t.options.useZabbixValueMapping,
              onChange: d[3] || (d[3] = (f) => a({ useZabbixValueMapping: f }))
            }, null, 8, ["checked"])
          ]),
          F("div", e$e, [
            F("span", t$e, se(I(o)("qb.options.disableAlignment")), 1),
            v(I(ts), {
              size: "small",
              checked: !!t.options.disableDataAlignment,
              onChange: d[4] || (d[4] = (f) => a({ disableDataAlignment: f }))
            }, null, 8, ["checked"])
          ])
        ], 64)) : et("", !0),
        t.queryType === "text" ? (re(), be("div", n$e, [
          F("span", i$e, se(I(o)("qb.options.showDisabled")), 1),
          v(I(ts), {
            size: "small",
            checked: !!t.options.showDisabledItems,
            onChange: d[5] || (d[5] = (f) => a({ showDisabledItems: f }))
          }, null, 8, ["checked"])
        ])) : et("", !0),
        t.queryType === "problems" ? (re(), be(tt, { key: 2 }, [
          F("div", o$e, [
            F("span", r$e, se(I(o)("qb.options.acknowledged")), 1),
            v(I(Dt), {
              size: "small",
              style: { width: "140px" },
              value: t.options.acknowledged ?? 2,
              options: l,
              onChange: d[6] || (d[6] = (f) => a({ acknowledged: f }))
            }, null, 8, ["value"])
          ]),
          F("div", a$e, [
            F("span", l$e, se(I(o)("qb.options.sortBy")), 1),
            v(I(Dt), {
              size: "small",
              style: { width: "120px" },
              value: t.options.sortProblems ?? "default",
              options: s,
              onChange: d[7] || (d[7] = (f) => a({ sortProblems: f }))
            }, null, 8, ["value"])
          ]),
          F("div", s$e, [
            F("span", u$e, se(I(o)("qb.options.useTimeRange")), 1),
            v(I(ts), {
              size: "small",
              checked: !!t.options.useTimeRange,
              onChange: d[8] || (d[8] = (f) => a({ useTimeRange: f }))
            }, null, 8, ["checked"])
          ]),
          F("div", c$e, [
            F("span", d$e, se(I(o)("qb.options.hostsInMaintenance")), 1),
            v(I(ts), {
              size: "small",
              checked: !!t.options.hostsInMaintenance,
              onChange: d[9] || (d[9] = (f) => a({ hostsInMaintenance: f }))
            }, null, 8, ["checked"])
          ]),
          F("div", f$e, [
            F("span", h$e, se(I(o)("qb.options.hostProxy")), 1),
            v(I(ts), {
              size: "small",
              checked: !!t.options.hostProxy,
              onChange: d[10] || (d[10] = (f) => a({ hostProxy: f }))
            }, null, 8, ["checked"])
          ]),
          F("div", p$e, [
            F("span", g$e, se(I(o)("qb.options.limit")), 1),
            v(I(jt), {
              size: "small",
              type: "number",
              style: { width: "80px" },
              value: t.options.limit ?? 100,
              onChange: d[11] || (d[11] = (f) => a({ limit: Number(f.target.value) }))
            }, null, 8, ["value"])
          ])
        ], 64)) : et("", !0),
        t.queryType === "triggers" ? (re(), be(tt, { key: 3 }, [
          F("div", m$e, [
            F("span", v$e, se(I(o)("qb.options.acknowledged")), 1),
            v(I(Dt), {
              size: "small",
              style: { width: "140px" },
              value: t.options.acknowledged ?? 2,
              options: l,
              onChange: d[12] || (d[12] = (f) => a({ acknowledged: f }))
            }, null, 8, ["value"])
          ]),
          F("div", y$e, [
            F("span", b$e, se(I(o)("qb.options.useTimeRange")), 1),
            v(I(ts), {
              size: "small",
              checked: !!t.options.useTimeRange,
              onChange: d[13] || (d[13] = (f) => a({ useTimeRange: f }))
            }, null, 8, ["checked"])
          ])
        ], 64)) : et("", !0)
      ], 4)
    ]));
  }
});
function K8(t) {
  const e = Hc();
  return A(() => {
    const n = t();
    if (!n)
      return [];
    if (!n.startsWith("$"))
      return [n];
    const i = n.slice(1), o = Object.values(e.variables).find(
      (l) => l.config.name === i
    );
    if (!o)
      return [];
    const r = o.current, a = Array.isArray(r) ? r : [r];
    return a.includes("$__all") ? o.options.map((l) => l.value).filter((l) => l !== "$__all") : a.filter(Boolean);
  });
}
function O$e(t, e) {
  const n = de([]), i = de([]), o = de(!1), r = de(!1), a = K8(() => t().groupId);
  return _e(
    () => ({ url: e().url, token: e().token }),
    async ({ url: l, token: s }) => {
      if (l) {
        o.value = !0, n.value = [];
        try {
          n.value = await yj({ url: l, token: s });
        } catch {
        } finally {
          o.value = !1;
        }
      }
    },
    { immediate: !0, deep: !0 }
  ), _e(
    [a, () => e().url, () => e().token],
    async ([l, s, u]) => {
      if (!s || l.length === 0) {
        i.value = [];
        return;
      }
      r.value = !0, i.value = [];
      try {
        i.value = await bj(l, void 0, { url: s, token: u });
      } catch {
      } finally {
        r.value = !1;
      }
    },
    { immediate: !0 }
  ), { groups: n, hosts: i, loadingGroups: o, loadingHosts: r, resolvedGroupIds: a };
}
function S$e(t) {
  const { config: e } = Uf(), n = A(() => (e.value.datasourceConfig ?? []).filter((a) => a.type === "zabbix").map((a, l) => ({
    uid: a.uid || String(l),
    name: a.name,
    url: a.url,
    token: a.token,
    isDefault: !!a.default
  }))), i = A(() => {
    const r = tB(t);
    return n.value.find((l) => l.uid === r) ?? n.value[0] ?? { url: "", token: "" };
  }), o = A(
    () => n.value.find((r) => r.isDefault)?.uid ?? n.value[0]?.uid ?? ""
  );
  return { sources: n, cfg: i, defaultUid: o };
}
const w$e = {
  class: "flex flex-col gap-3 p-2",
  style: { "font-size": "12px" }
}, C$e = {
  class: "text-secondary mb-1",
  style: { "font-size": "11px" }
}, $$e = {
  class: "text-secondary mb-1",
  style: { "font-size": "11px" }
}, k$e = {
  class: "text-secondary mb-1",
  style: { "font-size": "11px" }
}, T$e = { key: 0 }, P$e = {
  class: "text-secondary mb-1",
  style: { "font-size": "11px" }
}, E$e = {
  key: 1,
  style: { "max-width": "400px" }
}, _$e = {
  class: "text-secondary mb-1",
  style: { "font-size": "11px" }
}, I$e = {
  class: "grid gap-3",
  style: { "grid-template-columns": "1fr 1fr" }
}, M$e = {
  class: "text-secondary mb-1",
  style: { "font-size": "11px" }
}, A$e = {
  class: "text-secondary mb-1",
  style: { "font-size": "11px" }
}, R$e = { class: "flex items-center gap-2" }, D$e = {
  class: "text-secondary",
  style: { "font-size": "11px" }
}, N$e = { key: 3 }, L$e = {
  class: "text-secondary mb-1",
  style: { "font-size": "11px" }
}, z$e = { key: 4 }, B$e = {
  class: "text-secondary mb-1",
  style: { "font-size": "11px" }
}, F$e = {
  class: "grid gap-3",
  style: { "grid-template-columns": "1fr 1fr 1fr" }
}, V$e = {
  class: "text-secondary mb-1",
  style: { "font-size": "11px" }
}, Q$e = {
  class: "text-secondary mb-1",
  style: { "font-size": "11px" }
}, H$e = {
  class: "text-secondary mb-1",
  style: { "font-size": "11px" }
}, W$e = {
  class: "text-secondary mb-1",
  style: { "font-size": "11px" }
}, j$e = { class: "flex flex-wrap gap-1" }, q$e = {
  key: 6,
  class: "grid gap-3",
  style: { "grid-template-columns": "1fr 1fr 1fr" }
}, Y$e = {
  class: "text-secondary mb-1",
  style: { "font-size": "11px" }
}, K$e = {
  class: "text-secondary mb-1",
  style: { "font-size": "11px" }
}, X$e = {
  class: "text-secondary mb-1",
  style: { "font-size": "11px" }
}, Z$e = { key: 7 }, G$e = {
  class: "text-secondary mb-1",
  style: { "font-size": "11px" }
}, U$e = {
  key: 8,
  class: "grid gap-3",
  style: { "grid-template-columns": "1fr 1fr" }
}, J$e = {
  class: "text-secondary mb-1",
  style: { "font-size": "11px" }
}, eke = {
  class: "text-secondary mb-1",
  style: { "font-size": "11px" }
}, tke = /* @__PURE__ */ Oe({
  __name: "ZabbixQueryEditor",
  props: {
    query: {},
    datasourceId: {},
    isChart: { type: Boolean }
  },
  emits: ["change"],
  setup(t, { emit: e }) {
    const n = t, i = e, { t: o } = On(), { cfg: r } = S$e(() => n.datasourceId), a = Hc();
    function l(ae) {
      i("change", { ...n.query, ...ae });
    }
    const s = A(
      () => Object.values(a.variables).map((ae) => ({
        value: `$${ae.config.name}`,
        label: `$${ae.config.name}`
      }))
    );
    function u(ae, te) {
      const U = [];
      return s.value.length > 0 && U.push({ label: "── 变量 ──", options: s.value }), U.push({ label: ae, options: te }), U;
    }
    function c(ae) {
      return typeof ae == "string" && ae.startsWith("$");
    }
    const { groups: d, hosts: f, loadingGroups: h, loadingHosts: p } = O$e(
      () => n.query,
      () => r.value
    ), g = K8(() => n.query.hostId), m = A(
      () => d.value.map((ae) => ({ value: ae.groupid, label: ae.name }))
    ), y = A(
      () => f.value.map((ae) => ({ value: ae.hostid, label: ae.name || ae.host }))
    ), b = de([]), w = de(!1);
    _e(
      [
        g,
        () => r.value.url,
        () => r.value.token,
        () => n.query.queryType
      ],
      async ([ae, te, U, me]) => {
        if (me !== "metrics") {
          b.value = [];
          return;
        }
        if (!ae.length || !te) {
          b.value = [];
          return;
        }
        w.value = !0;
        try {
          b.value = (await Promise.all(
            ae.map(
              (ce) => CD([ce], void 0, void 0, { url: te, token: U })
            )
          )).flat();
        } catch {
          b.value = [];
        } finally {
          w.value = !1;
        }
      },
      { immediate: !0 }
    );
    const $ = A(() => {
      const ae = /* @__PURE__ */ new Set();
      return b.value.flatMap(
        (te) => (te.tags ?? []).map((U) => Sj(U))
      ).filter((te) => ae.has(te) ? !1 : (ae.add(te), !0)).map((te) => ({ value: te, label: te }));
    }), C = A(() => {
      if (!n.query.itemTagsFilter)
        return b.value;
      const [ae, te] = n.query.itemTagsFilter.split(":").map((U) => U.trim());
      return b.value.filter(
        (U) => (U.tags ?? []).some(
          (me) => me.tag === ae && (te ? me.value === te : !0)
        )
      );
    }), P = A(() => {
      const ae = /* @__PURE__ */ new Set();
      return C.value.map((te) => te.name).filter((te) => ae.has(te) ? !1 : (ae.add(te), !0)).map((te) => ({ value: te, label: te }));
    }), O = de([]), E = de(!1);
    _e(
      [
        () => n.query.hostId,
        () => r.value.url,
        () => r.value.token,
        () => n.query.queryType
      ],
      async ([ae, te, U, me]) => {
        if (me !== "text" || !ae || !te) {
          O.value = [];
          return;
        }
        E.value = !0;
        try {
          O.value = await wj([ae], void 0, { url: te, token: U });
        } catch {
          O.value = [];
        } finally {
          E.value = !1;
        }
      },
      { immediate: !0 }
    );
    const _ = A(() => {
      const ae = /* @__PURE__ */ new Set();
      return O.value.map((te) => te.name).filter((te) => ae.has(te) ? !1 : (ae.add(te), !0)).map((te) => ({ value: te, label: te }));
    }), D = de([]), M = de(!1);
    _e(
      [() => r.value.url, () => r.value.token, () => n.query.queryType],
      async ([ae, te, U]) => {
        if (!(U !== "services" || !ae)) {
          M.value = !0;
          try {
            D.value = await $j({ url: ae, token: te });
          } catch {
            D.value = [];
          } finally {
            M.value = !1;
          }
        }
      },
      { immediate: !0 }
    );
    const N = de([]), L = de(!1);
    _e(
      [
        () => n.query.hostId,
        () => r.value.url,
        () => r.value.token,
        () => n.query.queryType
      ],
      async ([ae, te, U, me]) => {
        if (me !== "macros" || !ae || !te) {
          N.value = [];
          return;
        }
        L.value = !0;
        try {
          N.value = await Cj([ae], { url: te, token: U });
        } catch {
          N.value = [];
        } finally {
          L.value = !1;
        }
      },
      { immediate: !0 }
    );
    const j = de([]), B = de(!1), Y = de([]), Q = de(!1);
    _e(
      [
        () => n.query.hostId,
        () => r.value.url,
        () => r.value.token,
        () => n.query.queryType
      ],
      async ([ae, te, U, me]) => {
        if (me !== "lld" || !ae || ae.startsWith("$") || !te) {
          j.value = [];
          return;
        }
        B.value = !0;
        try {
          j.value = await Pj([ae], { url: te, token: U });
        } catch {
          j.value = [];
        } finally {
          B.value = !1;
        }
      },
      { immediate: !0 }
    ), _e(
      [() => n.query.lldRuleId, () => r.value.url, () => r.value.token],
      async ([ae, te, U]) => {
        if (!ae || !te) {
          Y.value = [];
          return;
        }
        Q.value = !0;
        try {
          const me = /* @__PURE__ */ new Set();
          Y.value = (await Ej(ae, { url: te, token: U })).map((ce) => {
            const ue = ce.key_.includes("[") ? ce.key_.slice(0, ce.key_.indexOf("[")) : ce.key_;
            return { value: ue, label: `${ce.name} (${ue})` };
          }).filter((ce) => me.has(ce.value) ? !1 : (me.add(ce.value), !0));
        } catch {
          Y.value = [];
        } finally {
          Q.value = !1;
        }
      },
      { immediate: !0 }
    );
    const G = [
      "metrics",
      "text",
      "services",
      "itemid",
      "triggers",
      "problems",
      "macros",
      "lld"
    ], V = [
      "problems",
      "recent",
      "history"
    ], H = {
      problems: "Problems",
      recent: "Recent problems",
      history: "History"
    }, q = [
      { value: 0, label: "Not classified", color: "#97aab3" },
      { value: 1, label: "Information", color: "#7499ff" },
      { value: 2, label: "Warning", color: "#ffc859" },
      { value: 3, label: "Average", color: "#ffa059" },
      { value: 4, label: "High", color: "#e97659" },
      { value: 5, label: "Disaster", color: "#e45959" }
    ], K = [
      { value: "status", label: "Status" },
      { value: "sli", label: "SLI" },
      { value: "uptime", label: "Uptime" },
      { value: "downtime", label: "Downtime" },
      { value: "error_budget", label: "Error budget" }
    ], ee = [
      { value: "none", label: "No interval" },
      { value: "auto", label: "Auto" },
      { value: "1h", label: "1 hour" },
      { value: "12h", label: "12 hours" },
      { value: "1d", label: "24 hours" },
      { value: "1w", label: "1 week" },
      { value: "1M", label: "1 month" }
    ], ie = A(
      () => ["metrics", "text", "triggers", "problems", "macros", "lld"].includes(
        n.query.queryType
      )
    );
    return (ae, te) => (re(), be("div", w$e, [
      F("div", null, [
        F("div", C$e, se(I(o)("qb.queryType")), 1),
        v(I(Dt), {
          size: "small",
          style: { width: "100%" },
          value: t.query.queryType,
          options: G.map((U) => ({
            value: U,
            label: I(o)(`qb.queryType.${U}`)
          })),
          onChange: te[0] || (te[0] = (U) => l({ queryType: U, itemIds: [], itemNames: [], itemids: "" }))
        }, null, 8, ["value", "options"])
      ]),
      ie.value ? (re(), be("div", {
        key: 0,
        class: "grid gap-3",
        style: Yt({ gridTemplateColumns: t.query.queryType === "metrics" ? "repeat(3, 1fr)" : "repeat(2, 1fr)" })
      }, [
        F("div", null, [
          F("div", $$e, se(I(o)("panel.group")), 1),
          v(I(Bo), {
            spinning: I(h),
            size: "small"
          }, {
            default: ye(() => [
              v(sc, {
                value: t.query.groupId || void 0,
                "display-value": t.query.groupName || void 0,
                placeholder: I(o)("panel.group.placeholder"),
                groups: u("── 主机组 ──", m.value),
                onChange: te[1] || (te[1] = (U) => l({ groupId: U, groupName: c(U) ? U : I(d).find((me) => me.groupid === U)?.name ?? U, hostId: "", hostName: "", itemIds: [], itemNames: [] })),
                onClear: te[2] || (te[2] = () => l({ groupId: "", groupName: "", hostId: "", hostName: "", itemIds: [], itemNames: [] }))
              }, null, 8, ["value", "display-value", "placeholder", "groups"])
            ]),
            _: 1
          }, 8, ["spinning"])
        ]),
        F("div", null, [
          F("div", k$e, se(I(o)("panel.host")), 1),
          v(I(Bo), {
            spinning: I(p),
            size: "small"
          }, {
            default: ye(() => [
              v(sc, {
                value: t.query.hostId || void 0,
                "display-value": t.query.hostName || void 0,
                placeholder: I(o)("panel.host.placeholder"),
                groups: u("── 主机 ──", y.value),
                onChange: te[3] || (te[3] = (U) => l({ hostId: U, hostName: c(U) ? U : I(f).find((me) => me.hostid === U)?.name ?? U, itemIds: [], itemNames: [] })),
                onClear: te[4] || (te[4] = () => l({ hostId: "", hostName: "", itemIds: [], itemNames: [] }))
              }, null, 8, ["value", "display-value", "placeholder", "groups"])
            ]),
            _: 1
          }, 8, ["spinning"])
        ]),
        t.query.queryType === "metrics" ? (re(), be("div", T$e, [
          F("div", P$e, se(I(o)("panel.itemTag")), 1),
          v(I(Bo), {
            spinning: w.value,
            size: "small"
          }, {
            default: ye(() => [
              v(sc, {
                value: t.query.itemTagsFilter || void 0,
                placeholder: I(o)("panel.itemTag.placeholder"),
                groups: u("── 标签 ──", $.value),
                onChange: te[5] || (te[5] = (U) => l({ itemTagsFilter: U ?? "", itemIds: [], itemNames: [] })),
                onClear: te[6] || (te[6] = () => l({ itemTagsFilter: "", itemIds: [], itemNames: [] }))
              }, null, 8, ["value", "placeholder", "groups"])
            ]),
            _: 1
          }, 8, ["spinning"])
        ])) : et("", !0)
      ], 4)) : et("", !0),
      t.query.queryType === "metrics" ? (re(), be("div", E$e, [
        F("div", _$e, se(I(o)("panel.items")), 1),
        v(sc, {
          value: t.query.itemNames[0] || void 0,
          placeholder: I(o)("panel.items.placeholder"),
          groups: u("── 监控项 ──", P.value),
          onChange: te[7] || (te[7] = (U) => l({ itemNames: [U], itemIds: [] })),
          onClear: te[8] || (te[8] = () => l({ itemNames: [], itemIds: [] }))
        }, null, 8, ["value", "placeholder", "groups"])
      ])) : et("", !0),
      t.query.queryType === "text" ? (re(), be(tt, { key: 2 }, [
        F("div", I$e, [
          F("div", null, [
            F("div", M$e, se(I(o)("panel.items")), 1),
            v(I(Bo), {
              spinning: E.value,
              size: "small"
            }, {
              default: ye(() => [
                v(sc, {
                  value: t.query.itemNames[0] || void 0,
                  placeholder: I(o)("panel.items.placeholder"),
                  disabled: !t.query.hostId,
                  groups: u("── 监控项 ──", _.value),
                  onChange: te[9] || (te[9] = (U) => l({ itemNames: [U], itemIds: [] })),
                  onClear: te[10] || (te[10] = () => l({ itemNames: [], itemIds: [] }))
                }, null, 8, ["value", "placeholder", "disabled", "groups"])
              ]),
              _: 1
            }, 8, ["spinning"])
          ]),
          F("div", null, [
            F("div", A$e, se(I(o)("qb.textFilter")), 1),
            v(I(jt), {
              size: "small",
              style: { width: "100%" },
              value: t.query.textFilter,
              onChange: te[11] || (te[11] = (U) => l({ textFilter: U.target.value }))
            }, null, 8, ["value"])
          ])
        ]),
        F("div", R$e, [
          v(I(fo), {
            checked: t.query.useCaptureGroups,
            onChange: te[12] || (te[12] = (U) => l({ useCaptureGroups: U.target.checked }))
          }, null, 8, ["checked"]),
          F("span", D$e, se(I(o)("qb.useCaptureGroups")), 1)
        ])
      ], 64)) : et("", !0),
      t.query.queryType === "itemid" ? (re(), be("div", N$e, [
        F("div", L$e, se(I(o)("qb.itemIds")), 1),
        v(I(jt), {
          size: "small",
          style: { width: "100%" },
          value: t.query.itemids,
          placeholder: I(o)("qb.itemIds.placeholder"),
          onChange: te[13] || (te[13] = (U) => l({ itemids: U.target.value }))
        }, null, 8, ["value", "placeholder"])
      ])) : et("", !0),
      t.query.queryType === "triggers" ? (re(), be("div", z$e, [
        F("div", B$e, se(I(o)("qb.triggerFilter")), 1),
        v(I(jt), {
          size: "small",
          style: { width: "100%" },
          value: t.query.triggerFilter,
          onChange: te[14] || (te[14] = (U) => l({ triggerFilter: U.target.value }))
        }, null, 8, ["value"])
      ])) : et("", !0),
      t.query.queryType === "problems" ? (re(), be(tt, { key: 5 }, [
        F("div", F$e, [
          F("div", null, [
            F("div", V$e, se(I(o)("qb.problemName")), 1),
            v(I(jt), {
              size: "small",
              style: { width: "100%" },
              value: t.query.triggerFilter,
              onChange: te[15] || (te[15] = (U) => l({ triggerFilter: U.target.value }))
            }, null, 8, ["value"])
          ]),
          F("div", null, [
            F("div", Q$e, se(I(o)("qb.tags")), 1),
            v(I(jt), {
              size: "small",
              style: { width: "100%" },
              value: t.query.tagsFilter,
              onChange: te[16] || (te[16] = (U) => l({ tagsFilter: U.target.value }))
            }, null, 8, ["value"])
          ]),
          F("div", null, [
            F("div", H$e, se(I(o)("qb.show")), 1),
            v(I(Dt), {
              size: "small",
              style: { width: "100%" },
              value: t.query.showProblems,
              options: V.map((U) => ({ value: U, label: H[U] })),
              onChange: te[17] || (te[17] = (U) => l({ showProblems: U }))
            }, null, 8, ["value", "options"])
          ])
        ]),
        F("div", null, [
          F("div", W$e, se(I(o)("qb.severity")), 1),
          F("div", j$e, [
            (re(), be(tt, null, Jt(q, (U) => v(I(Va), {
              key: U.value,
              color: t.query.severities.includes(U.value) ? U.color : void 0,
              class: "cursor-pointer select-none",
              style: Yt({ opacity: t.query.severities.includes(U.value) ? 1 : 0.4 }),
              onClick: () => l({ severities: t.query.severities.includes(U.value) ? t.query.severities.filter((me) => me !== U.value) : [...t.query.severities, U.value] })
            }, {
              default: ye(() => [
                Ve(se(U.label), 1)
              ]),
              _: 2
            }, 1032, ["color", "style", "onClick"])), 64))
          ])
        ])
      ], 64)) : et("", !0),
      t.query.queryType === "services" ? (re(), be("div", q$e, [
        F("div", null, [
          F("div", Y$e, se(I(o)("qb.itService")), 1),
          v(I(Bo), {
            spinning: M.value,
            size: "small"
          }, {
            default: ye(() => [
              v(sc, {
                value: t.query.itServiceFilter || void 0,
                placeholder: I(o)("qb.itService.placeholder"),
                groups: u("── 服务 ──", D.value.map((U) => ({ value: U.name, label: U.name }))),
                onChange: te[18] || (te[18] = (U) => l({ itServiceFilter: U })),
                onClear: te[19] || (te[19] = () => l({ itServiceFilter: "" }))
              }, null, 8, ["value", "placeholder", "groups"])
            ]),
            _: 1
          }, 8, ["spinning"])
        ]),
        F("div", null, [
          F("div", K$e, se(I(o)("qb.slaProperty")), 1),
          v(I(Dt), {
            size: "small",
            style: { width: "100%" },
            value: t.query.slaProperty,
            options: K,
            onChange: te[20] || (te[20] = (U) => l({ slaProperty: U }))
          }, null, 8, ["value"])
        ]),
        F("div", null, [
          F("div", X$e, se(I(o)("qb.slaInterval")), 1),
          v(I(Dt), {
            size: "small",
            style: { width: "100%" },
            value: t.query.slaInterval,
            options: ee,
            onChange: te[21] || (te[21] = (U) => l({ slaInterval: U }))
          }, null, 8, ["value"])
        ])
      ])) : et("", !0),
      t.query.queryType === "macros" ? (re(), be("div", Z$e, [
        F("div", G$e, se(I(o)("qb.macroFilter")), 1),
        v(I(Bo), {
          spinning: L.value,
          size: "small"
        }, {
          default: ye(() => [
            v(sc, {
              value: t.query.macroFilter || void 0,
              placeholder: "{$MACRO_NAME}",
              disabled: !t.query.hostId,
              groups: [{ label: "── 宏 ──", options: N.value.map((U) => ({ value: U.macro, label: `${U.macro} = ${U.value}` })) }],
              onChange: te[22] || (te[22] = (U) => l({ macroFilter: U })),
              onClear: te[23] || (te[23] = () => l({ macroFilter: "" }))
            }, null, 8, ["value", "disabled", "groups"])
          ]),
          _: 1
        }, 8, ["spinning"])
      ])) : et("", !0),
      t.query.queryType === "lld" ? (re(), be("div", U$e, [
        F("div", null, [
          F("div", J$e, se(I(o)("qb.lld.rule")), 1),
          v(I(Bo), {
            spinning: B.value,
            size: "small"
          }, {
            default: ye(() => [
              v(I(Dt), {
                size: "small",
                style: { width: "100%" },
                "allow-clear": "",
                "show-search": "",
                value: t.query.lldRuleId || void 0,
                placeholder: I(o)("qb.lld.rule.placeholder"),
                options: j.value.map((U) => ({ value: U.itemid, label: U.name })),
                onChange: te[24] || (te[24] = (U) => l({ lldRuleId: U, lldRuleName: j.value.find((me) => me.itemid === U)?.name ?? U, lldItemKeys: [] })),
                onClear: te[25] || (te[25] = () => l({ lldRuleId: "", lldRuleName: "", lldItemKeys: [] }))
              }, null, 8, ["value", "placeholder", "options"])
            ]),
            _: 1
          }, 8, ["spinning"])
        ]),
        F("div", null, [
          F("div", eke, se(I(o)("qb.lld.itemKeys")), 1),
          v(I(Bo), {
            spinning: Q.value,
            size: "small"
          }, {
            default: ye(() => [
              v(I(Dt), {
                size: "small",
                style: { width: "100%" },
                mode: "multiple",
                "allow-clear": "",
                value: t.query.lldItemKeys ?? [],
                options: Y.value,
                onChange: te[26] || (te[26] = (U) => l({ lldItemKeys: U }))
              }, null, 8, ["value", "options"])
            ]),
            _: 1
          }, 8, ["spinning"])
        ])
      ])) : et("", !0),
      ["metrics", "itemid", "services"].includes(t.query.queryType) ? (re(), ut(WCe, {
        key: 9,
        functions: t.query.functions ?? [],
        onChange: te[27] || (te[27] = (U) => l({ functions: U }))
      }, null, 8, ["functions"])) : et("", !0),
      ["macros", "lld"].includes(t.query.queryType) ? et("", !0) : (re(), ut(x$e, {
        key: 10,
        "query-type": t.query.queryType,
        options: t.query.options ?? {},
        onChange: te[28] || (te[28] = (U) => l({ options: U }))
      }, null, 8, ["query-type", "options"]))
    ]));
  }
});
function nke(t) {
  return t.type !== "builder_query" || t.queryType && t.queryType !== "builder" || t.spec.signal !== "metrics" ? !0 : t.spec.aggregations.some(
    (e) => typeof e?.metricName == "string" && e.metricName.trim()
  );
}
class ike {
  type = "argus";
  meta = { type: "argus", displayName: "Argus", icon: "📊" };
  QueryEditor = ICe;
  defaultQuery = () => ({
    type: "argus",
    datasourceId: "",
    queries: [
      {
        type: "builder_query",
        spec: {
          name: "A",
          signal: "metrics",
          stepInterval: null,
          disabled: !1,
          filter: { expression: "" },
          having: { expression: "" },
          groupBy: [],
          order: [],
          legend: "",
          functions: [],
          aggregations: [{ metricName: "", metricType: "", timeAggregation: "rate", spaceAggregation: "sum" }]
        }
      }
    ]
  });
  async query(e) {
    const { range: n, targets: i, _dsCfg: o } = e;
    if (!o)
      return { data: [], state: "Done" };
    const r = { url: o.url, token: o.token }, a = Math.floor(n.from / 1e3), l = Math.ceil(n.to / 1e3), s = [], u = i.filter((f) => f.type === "argus").map((f) => ({ ...f, queries: f.queries.filter(nke) })).filter((f) => f.queries.length > 0);
    if (!u.length)
      return { data: [], state: "Done" };
    const c = await SB(r).catch(() => []), d = new Map(c.map((f) => [f.metricName, f]));
    for (const f of u) {
      const h = await TB(f.queries, a, l, r, d);
      for (const p of h.data?.results ?? [])
        for (const g of p.aggregations ?? []) {
          if (!g.series?.length)
            continue;
          const m = g.series[0].values.map((b) => b.timestamp), y = [
            { name: "Time", type: "time", values: m },
            ...g.series.map((b, w) => {
              const $ = new Map(b.values.map((O) => [O.timestamp, O.value])), C = (b.labels ?? []).map((O) => `${O.key.name}=${String(O.value)}`).join(", "), P = [p.queryName, g.alias, C || `series ${w + 1}`].filter(Boolean).join(" ");
              return {
                name: P,
                type: "number",
                values: m.map((O) => $.get(O) ?? null),
                config: { displayNameFromDS: P }
              };
            })
          ];
          s.push(ER({
            name: g.alias || p.queryName,
            refId: p.queryName,
            fields: y
          }));
        }
    }
    return { data: s, state: "Done" };
  }
}
class oke {
  type = "zabbix";
  meta = { type: "zabbix", displayName: "Zabbix", icon: "" };
  QueryEditor = tke;
  defaultQuery = () => ({
    type: "zabbix",
    datasourceId: "",
    queryType: "metrics",
    groupId: "",
    groupName: "",
    hostId: "",
    hostName: "",
    appId: "",
    appName: "",
    itemIds: [],
    itemNames: [],
    textFilter: "",
    useCaptureGroups: !1,
    itemTagsFilter: "",
    itemids: "",
    triggerFilter: "",
    tagsFilter: "",
    showProblems: "problems",
    severities: [],
    itServiceFilter: "",
    slaFilter: "",
    slaProperty: "sli",
    slaInterval: "none",
    macroFilter: "",
    lldRuleId: "",
    lldRuleName: "",
    lldItemKeys: [],
    functions: [],
    options: {
      useTrends: "default",
      showDisabledItems: !1,
      useZabbixValueMapping: !1,
      disableDataAlignment: !1,
      acknowledged: 2,
      sortProblems: "default",
      useTimeRange: !1,
      hostsInMaintenance: !1,
      hostProxy: !1,
      limit: 100
    }
  });
  async query(e) {
    const { range: n, targets: i, maxDataPoints: o, scopedVars: r, _dsCfg: a } = e;
    if (!a)
      return { data: [], state: "Done" };
    const l = { url: a.url, token: a.token }, s = Math.floor(n.from / 1e3), u = Math.ceil(n.to / 1e3), c = r ?? {}, d = e._variableStates ?? {}, f = [];
    for (const h of i) {
      const p = Dj(h, c, d);
      let g = [];
      if (p.queryType === "itemid" && p.itemids?.trim()) {
        const L = p.itemids.split(",").map((j) => j.trim()).filter(Boolean);
        g = await xj(L, l);
      } else if (p.hostIds.length > 0 && h.itemNames.length > 0) {
        const L = (await Promise.all(
          p.hostIds.map(
            (B) => CD([B], void 0, void 0, l, p.itemTagsFilter || void 0)
          )
        )).flat(), j = new Set(h.itemNames.filter((B) => !B.startsWith("$")));
        g = L.filter((B) => j.has(B.name));
      }
      if (g.length === 0)
        continue;
      const [m, y] = await Promise.all([
        kj(
          g.map((L) => L.itemid),
          s,
          u,
          l
        ),
        h.options?.useZabbixValueMapping ? Tj(l) : Promise.resolve([])
      ]);
      if (m.length === 0)
        continue;
      const b = /* @__PURE__ */ new Map();
      for (const L of y) {
        const j = {};
        for (const B of L.mappings)
          j[B.value] = B.newvalue;
        b.set(L.valuemapid, j);
      }
      const w = _j(m, g.map((L) => L.itemid)), $ = Math.max(Math.ceil((u - s) / o), 60), C = new Map(
        Array.from(w.entries()).map(([L, j]) => [
          L,
          j.length > o ? Mj(j, $ * 1e3) : j
        ])
      ), P = new Map(
        Array.from(C.entries()).map(([L, j]) => [
          L,
          nj(j, s, u, $)
        ])
      ), O = (P.get(g[0].itemid) ?? []).map((L) => L.ts / 1e3), E = {
        timestamps: O,
        series: g.map((L) => {
          const j = P.get(L.itemid) ?? [];
          return { label: L.name, values: j.map((B) => B.value) };
        })
      }, _ = gj(E, h.functions ?? []), D = /* @__PURE__ */ new Map();
      _.series.forEach((L, j) => {
        const B = g[j];
        B && D.set(
          B.itemid,
          L.values.map((Y, Q) => ({ ts: O[Q] * 1e3, value: Y }))
        );
      });
      const M = g.slice(0, _.series.length), N = mj(D, M, b, h.datasourceId || "A");
      _.series.forEach((L, j) => {
        const B = N.fields[j + 1];
        B?.config && (B.config.displayNameFromDS = L.label);
      }), f.push(N);
    }
    return { data: f, state: "Done" };
  }
}
let OA = !1;
function rke() {
  if (OA)
    return;
  OA = !0, SH();
  const t = new uH();
  t.QueryEditor = FCe, wb(t), wb(new ike()), wb(new oke());
}
const OTe = /* @__PURE__ */ Oe({
  __name: "ArgusBoard",
  props: {
    hideHeader: { type: Boolean, default: !1 },
    canEdit: { type: Boolean, default: !0 },
    theme: { default: null },
    lang: { default: null },
    isEditing: { type: [Boolean, null], default: null },
    initialEditingPanelId: { default: null },
    datasourceConfig: { default: null },
    initialConfig: {},
    renderDefaultDashboard: { type: Boolean },
    presets: {}
  },
  emits: ["save"],
  setup(t, { emit: e }) {
    const n = t, i = e;
    Lt(() => {
      console.warn(
        "%c ArgusBoard %c v1.0.4 %c 2026/7/24 14:50:04",
        "background:#4096ff;color:#fff;padding:2px 4px;border-radius:3px 0 0 3px;font-weight:bold",
        "background:#1f1f1f;color:#4096ff;padding:2px 4px;font-weight:bold",
        "background:#1f1f1f;color:#888;padding:2px 4px;border-radius:0 3px 3px 0"
      );
    }), rke(), OB(() => ({
      hideHeader: n.hideHeader,
      canEdit: n.canEdit,
      theme: n.theme ?? null,
      lang: n.lang ?? null,
      isEditing: n.isEditing ?? null,
      initialEditingPanelId: n.initialEditingPanelId ?? null,
      datasourceConfig: n.datasourceConfig ?? null,
      initialConfig: n.initialConfig,
      renderDefaultDashboard: n.renderDefaultDashboard,
      presets: n.presets,
      onSave: (c) => i("save", c)
    }));
    const o = _l();
    n.theme && o.setTheme(n.theme);
    const r = A(() => n.theme ?? o.theme);
    _e(r, (c) => {
      document.documentElement.dataset.theme = c, document.body.dataset.theme = c;
    }, { immediate: !0 });
    const a = de(n.lang ?? "zh");
    bB(a), _e(() => n.lang, (c) => {
      c && (a.value = c);
    });
    const l = Nl();
    function s(c) {
      c ? (l.importJSON(JSON.stringify({ title: "", panels: {}, layouts: [] })), l.importJSON(
        typeof c == "string" ? c : JSON.stringify(c)
      )) : n.renderDefaultDashboard === !1 && l.importJSON(JSON.stringify({ title: "", panels: {}, layouts: [] }));
    }
    Lt(() => {
      n.canEdit === !1 ? l.setEditing(!1) : n.isEditing !== null && l.setEditing(n.isEditing ?? !0), s(n.initialConfig), n.initialEditingPanelId && l.setEditingPanel(n.initialEditingPanelId);
    }), _e(() => n.initialConfig, (c) => {
      s(c);
    });
    const u = A(() => ({
      algorithm: r.value === "dark" ? X_.darkAlgorithm : X_.defaultAlgorithm,
      token: { colorPrimary: "#1677ff", borderRadius: 4 },
      getPopupContainer: () => document.body
    }));
    return (c, d) => (re(), ut(I(xs), { theme: u.value }, {
      default: ye(() => [
        v(nbe, null, bx({ _: 2 }, [
          Jt(c.$slots, (f, h) => ({
            name: h,
            fn: ye((p) => [
              _o(c.$slots, h, nB(iB(p)))
            ])
          }))
        ]), 1024)
      ]),
      _: 3
    }, 8, ["theme"]));
  }
}), ake = { class: "log-toolbar" }, lke = { class: "log-scroller" }, ske = { class: "log-time" }, uke = { class: "log-message" }, cke = {
  key: 0,
  class: "log-empty"
}, dke = /* @__PURE__ */ Oe({
  __name: "LogViewer",
  props: {
    logs: {},
    maxHeight: { default: 400 }
  },
  setup(t) {
    const e = t, n = de(""), i = de([]), o = A(() => e.logs.filter((a) => !(i.value.length > 0 && !i.value.includes(a.level) || n.value && !a.message.toLowerCase().includes(n.value.toLowerCase())))), r = {
      error: "#ff4d4f",
      warn: "#faad14",
      info: "#52c41a",
      debug: "#8c8c8c"
    };
    return (a, l) => {
      const s = Rn("a-input"), u = Rn("a-select");
      return re(), be("div", {
        class: "log-viewer",
        style: Yt({ maxHeight: `${t.maxHeight}px` })
      }, [
        F("div", ake, [
          v(s, {
            value: n.value,
            "onUpdate:value": l[0] || (l[0] = (c) => n.value = c),
            size: "small",
            placeholder: "Search logs...",
            "allow-clear": "",
            style: { flex: "1" }
          }, null, 8, ["value"]),
          v(u, {
            value: i.value,
            "onUpdate:value": l[1] || (l[1] = (c) => i.value = c),
            mode: "multiple",
            size: "small",
            placeholder: "Level",
            style: { "min-width": "160px" },
            options: [
              { value: "error", label: "Error" },
              { value: "warn", label: "Warn" },
              { value: "info", label: "Info" },
              { value: "debug", label: "Debug" }
            ]
          }, null, 8, ["value"])
        ]),
        F("div", lke, [
          (re(!0), be(tt, null, Jt(o.value, (c) => (re(), be("div", {
            key: c.id,
            class: "log-entry"
          }, [
            F("span", ske, se(new Date(c.timestamp).toLocaleTimeString()), 1),
            F("span", {
              class: "log-level",
              style: Yt({ color: r[c.level] })
            }, se(c.level.toUpperCase()), 5),
            F("span", uke, se(c.message), 1)
          ]))), 128))
        ]),
        o.value.length === 0 ? (re(), be("div", cke, " No log entries ")) : et("", !0)
      ], 4);
    };
  }
}), STe = /* @__PURE__ */ Co(dke, [["__scopeId", "data-v-22a0d40d"]]), fke = {
  key: 0,
  class: "topology-empty"
}, hke = ["width", "height"], pke = { class: "edges" }, gke = ["x1", "y1", "x2", "y2"], mke = ["cx", "cy", "fill", "stroke"], vke = ["x", "y"], yke = ["x", "y"], bke = /* @__PURE__ */ Oe({
  __name: "ServiceTopology",
  props: {
    nodes: { default: () => [] },
    edges: { default: () => [] },
    width: { default: 800 },
    height: { default: 500 }
  },
  setup(t) {
    const e = t, n = de(), i = de({});
    function o() {
      if (e.nodes.length === 0)
        return;
      const a = Math.ceil(Math.sqrt(e.nodes.length)), l = e.width / a, s = e.height / Math.ceil(e.nodes.length / a), u = {};
      e.nodes.forEach((c, d) => {
        const f = d % a, h = Math.floor(d / a);
        u[c.id] = {
          x: f * l + l / 2,
          y: h * s + s / 2
        };
      }), i.value = u;
    }
    Lt(o);
    function r(a) {
      return a ? a > 0.05 ? "#ff4d4f" : a > 0.01 ? "#faad14" : "#52c41a" : "#52c41a";
    }
    return (a, l) => (re(), be("div", {
      class: "service-topology",
      style: Yt({ width: `${t.width}px`, height: `${t.height}px` })
    }, [
      t.nodes.length === 0 ? (re(), be("div", fke, " No topology data ")) : (re(), be("svg", {
        key: 1,
        ref_key: "svgRef",
        ref: n,
        width: t.width,
        height: t.height
      }, [
        F("g", pke, [
          (re(!0), be(tt, null, Jt(t.edges, (s) => (re(), be("line", {
            key: `${s.source}-${s.target}`,
            x1: i.value[s.source]?.x ?? 0,
            y1: i.value[s.source]?.y ?? 0,
            x2: i.value[s.target]?.x ?? 0,
            y2: i.value[s.target]?.y ?? 0,
            stroke: "var(--ant-color-border)",
            "stroke-width": "1.5",
            "marker-end": "url(#arrowhead)"
          }, null, 8, gke))), 128))
        ]),
        l[0] || (l[0] = F("defs", null, [
          F("marker", {
            id: "arrowhead",
            markerWidth: "10",
            markerHeight: "7",
            refX: "10",
            refY: "3.5",
            orient: "auto"
          }, [
            F("polygon", {
              points: "0 0, 10 3.5, 0 7",
              fill: "var(--ant-color-border)"
            })
          ])
        ], -1)),
        (re(!0), be(tt, null, Jt(t.nodes, (s) => (re(), be("g", {
          key: s.id,
          class: "topology-node"
        }, [
          F("circle", {
            cx: i.value[s.id]?.x ?? 0,
            cy: i.value[s.id]?.y ?? 0,
            r: "24",
            fill: r(s.errorRate),
            "fill-opacity": "0.15",
            stroke: r(s.errorRate),
            "stroke-width": "2"
          }, null, 8, mke),
          F("text", {
            x: i.value[s.id]?.x ?? 0,
            y: (i.value[s.id]?.y ?? 0) + 4,
            "text-anchor": "middle",
            "font-size": "10",
            fill: "var(--ant-color-text)"
          }, se(s.name), 9, vke),
          s.latency !== void 0 ? (re(), be("text", {
            key: 0,
            x: i.value[s.id]?.x ?? 0,
            y: (i.value[s.id]?.y ?? 0) + 36,
            "text-anchor": "middle",
            "font-size": "9",
            fill: "var(--ant-color-text-secondary)"
          }, se(s.latency) + "ms ", 9, yke)) : et("", !0)
        ]))), 128))
      ], 8, hke))
    ], 4));
  }
}), wTe = /* @__PURE__ */ Co(bke, [["__scopeId", "data-v-da85d863"]]), xke = { class: "trace-waterfall" }, Oke = {
  key: 0,
  class: "trace-empty"
}, Ske = { class: "trace-name-col" }, wke = { class: "trace-service" }, Cke = { class: "trace-op" }, $ke = { class: "trace-bar-col" }, kke = { class: "trace-dur-col" }, Tke = /* @__PURE__ */ Oe({
  __name: "TraceWaterfall",
  props: {
    spans: { default: () => [] },
    startTime: {},
    endTime: {}
  },
  setup(t) {
    const e = t, n = A(() => e.startTime ?? Math.min(...e.spans.map((u) => u.startTime))), i = A(() => e.endTime ?? Math.max(...e.spans.map((u) => u.startTime + u.duration))), o = A(() => i.value - n.value);
    function r(u) {
      return (u.startTime - n.value) / o.value * 100;
    }
    function a(u) {
      return Math.max(u.duration / o.value * 100, 0.5);
    }
    function l(u) {
      return u >= 1e6 ? `${(u / 1e6).toFixed(2)}s` : u >= 1e3 ? `${(u / 1e3).toFixed(2)}ms` : `${u}μs`;
    }
    const s = {
      ok: "#52c41a",
      error: "#ff4d4f",
      unset: "#1677ff"
    };
    return (u, c) => (re(), be("div", xke, [
      t.spans.length === 0 ? (re(), be("div", Oke, " No trace data ")) : (re(), be(tt, { key: 1 }, [
        c[0] || (c[0] = F("div", { class: "trace-header" }, [
          F("div", { class: "trace-name-col" }, " Operation "),
          F("div", { class: "trace-bar-col" }, " Timeline "),
          F("div", { class: "trace-dur-col" }, " Duration ")
        ], -1)),
        (re(!0), be(tt, null, Jt(t.spans, (d) => (re(), be("div", {
          key: d.spanId,
          class: "trace-row"
        }, [
          F("div", Ske, [
            F("span", wke, se(d.serviceName), 1),
            F("span", Cke, se(d.operationName), 1)
          ]),
          F("div", $ke, [
            F("div", {
              class: "trace-bar",
              style: Yt({
                left: `${r(d)}%`,
                width: `${a(d)}%`,
                background: s[d.status ?? "unset"]
              })
            }, null, 4)
          ]),
          F("div", kke, se(l(d.duration)), 1)
        ]))), 128))
      ], 64))
    ]));
  }
}), CTe = /* @__PURE__ */ Co(Tke, [["__scopeId", "data-v-0212681c"]]), $Te = /* @__PURE__ */ Oe({
  __name: "SimpleChart",
  props: {
    options: {},
    data: {}
  },
  setup(t) {
    const e = t, n = de(), i = de(null), o = de({ width: 0, height: 0 });
    let r = null;
    function a() {
      i.value && (i.value.destroy(), i.value = null);
    }
    return tn(() => {
      r?.disconnect(), a();
    }), zt((l) => {
      n.value && (r = new ResizeObserver((s) => {
        const { width: u, height: c } = s[0].contentRect;
        u > 0 && c > 0 && (o.value = { width: Math.floor(u), height: Math.floor(c) });
      }), r.observe(n.value), o.value = {
        width: Math.floor(n.value.getBoundingClientRect().width),
        height: Math.floor(n.value.getBoundingClientRect().height)
      }, l(() => {
        r?.disconnect();
      }));
    }), zt((l) => {
      !n.value || o.value.width <= 0 || o.value.height <= 0 || (a(), i.value = new Ji(
        { ...e.options, width: o.value.width, height: o.value.height },
        e.data,
        n.value
      ), l(() => {
        a();
      }));
    }), (l, s) => (re(), be("div", {
      ref_key: "containerRef",
      ref: n,
      class: "w-full h-full"
    }, null, 512));
  }
}), Pke = { class: "kbd-key" }, Eke = /* @__PURE__ */ Oe({
  __name: "Kbd",
  props: {
    char: {}
  },
  setup(t) {
    return (e, n) => (re(), be("kbd", Pke, [
      _o(e.$slots, "default", {}, () => [
        Ve(se(t.char), 1)
      ], !0)
    ]));
  }
}), kTe = /* @__PURE__ */ Co(Eke, [["__scopeId", "data-v-94fb4749"]]), _ke = ["href", "target"], Ike = {
  key: 1,
  class: "panel-links-icon",
  style: { cursor: "pointer" }
}, Mke = { style: { "font-size": "10px", "margin-left": "2px" } }, Ake = /* @__PURE__ */ Oe({
  __name: "PanelLinksIcon",
  props: {
    panel: {}
  },
  setup(t) {
    return (e, n) => t.panel.links && t.panel.links.length > 0 ? (re(), ut(I(zi), {
      key: 0,
      title: t.panel.links.map((i) => i.title ?? i.url).join(", ")
    }, {
      default: ye(() => [
        t.panel.links.length === 1 ? (re(), be("a", {
          key: 0,
          href: t.panel.links[0].url,
          target: t.panel.links[0].newTab ? "_blank" : "_self",
          class: "panel-links-icon",
          onClick: n[0] || (n[0] = la(() => {
          }, ["stop"]))
        }, [...n[1] || (n[1] = [
          F("span", {
            class: "i-mdi-link",
            style: { "font-size": "14px" }
          }, null, -1)
        ])], 8, _ke)) : (re(), be("span", Ike, [
          n[2] || (n[2] = F("span", {
            class: "i-mdi-link-variant",
            style: { "font-size": "14px" }
          }, null, -1)),
          F("span", Mke, se(t.panel.links.length), 1)
        ]))
      ]),
      _: 1
    }, 8, ["title"])) : et("", !0);
  }
}), TTe = /* @__PURE__ */ Co(Ake, [["__scopeId", "data-v-6925a5a2"]]), Rke = { class: "viz-picker" }, Dke = { class: "viz-picker-title" }, Nke = { class: "viz-picker-grid" }, Lke = ["onClick"], zke = { class: "viz-picker-label" }, Bke = /* @__PURE__ */ Oe({
  __name: "VizPickerPane",
  setup(t) {
    const { t: e } = On(), { panel: n, onChange: i } = fh(), o = [
      { type: "timeseries", icon: St.chartLine, labelKey: "config.type.timeseries" },
      { type: "bar", icon: St.chartBar, labelKey: "config.type.bar" },
      { type: "stat", icon: St.stat, labelKey: "config.type.stat" },
      { type: "gauge", icon: St.gauge, labelKey: "config.type.gauge" },
      { type: "pie", icon: St.chartPie, labelKey: "config.type.pie" },
      { type: "table", icon: St.table, labelKey: "config.type.table" },
      { type: "histogram", icon: St.chartArea, labelKey: "config.type.histogram" }
    ];
    return (r, a) => (re(), be("div", Rke, [
      F("div", Dke, se(I(e)("editor.vizPicker.title")), 1),
      F("div", Nke, [
        (re(), be(tt, null, Jt(o, (l) => F("button", {
          key: l.type,
          class: Tt(["viz-picker-item", { "viz-picker-item--active": I(n).type === l.type }]),
          onClick: (s) => I(i)({ type: l.type })
        }, [
          F("span", {
            class: Tt(["viz-picker-icon", [l.icon]])
          }, null, 2),
          F("span", zke, se(I(e)(l.labelKey)), 1)
        ], 10, Lke)), 64))
      ])
    ]));
  }
}), PTe = /* @__PURE__ */ Co(Bke, [["__scopeId", "data-v-1d0d144f"]]);
export {
  Qye as AddPanelModal,
  x4 as AgChart,
  OTe as ArgusBoard,
  ICe as ArgusQueryEditor,
  Yye as DashboardHeader,
  nbe as DashboardPage,
  kTe as Kbd,
  STe as LogViewer,
  FCe as MockQueryEditor,
  BI as PanelContainer,
  Tye as PanelEditorLayout,
  _ye as PanelEditorModal,
  TTe as PanelLinksIcon,
  bS as PanelRenderer,
  wTe as ServiceTopology,
  $Te as SimpleChart,
  O4 as TimeRangePicker,
  CTe as TraceWaterfall,
  b4 as UPlotChart,
  S4 as VariableBar,
  U0e as VariableConfigModal,
  PTe as VizPickerPane,
  OB as provideArgusBoardConfig,
  Rve as providePlotContext,
  rke as registerAllPlugins,
  Uf as useArgusBoardConfig,
  yTe as usePlotContext
};
