yd-admin 0.1.12 → 0.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.js +2527 -249
  2. package/dist/style.css +337 -325
  3. package/package.json +4 -1
package/dist/index.js CHANGED
@@ -848,7 +848,7 @@ var export_helper_default = (sfc, props) => {
848
848
  };
849
849
  //#endregion
850
850
  //#region src/components/base/button/button.vue
851
- const _hoisted_1$58 = ["disabled", "type"];
851
+ const _hoisted_1$59 = ["disabled", "type"];
852
852
  const _hoisted_2$38 = {
853
853
  key: 0,
854
854
  class: "yd-button__loading"
@@ -910,7 +910,7 @@ var button_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
910
910
  "stroke-width": "3",
911
911
  "stroke-dasharray": "31.4 31.4",
912
912
  "stroke-linecap": "round"
913
- })], -1)])])) : createCommentVNode("v-if", true), createElementVNode("span", _hoisted_3$29, [renderSlot(_ctx.$slots, "default", {}, void 0, true)])], 10, _hoisted_1$58);
913
+ })], -1)])])) : createCommentVNode("v-if", true), createElementVNode("span", _hoisted_3$29, [renderSlot(_ctx.$slots, "default", {}, void 0, true)])], 10, _hoisted_1$59);
914
914
  };
915
915
  }
916
916
  }), [["__scopeId", "data-v-08fa2dc1"]]);
@@ -943,7 +943,7 @@ function getIconRegistry() {
943
943
  }
944
944
  //#endregion
945
945
  //#region src/components/base/icon/icon.vue
946
- const _hoisted_1$57 = ["innerHTML"];
946
+ const _hoisted_1$58 = ["innerHTML"];
947
947
  var icon_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
948
948
  name: "YdIcon",
949
949
  inheritAttrs: false,
@@ -1004,13 +1004,13 @@ var icon_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineC
1004
1004
  fill: "none",
1005
1005
  xmlns: "http://www.w3.org/2000/svg",
1006
1006
  innerHTML: svgContent.value
1007
- }, null, 10, _hoisted_1$57)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createCommentVNode(" Slot Fallback "), renderSlot(_ctx.$slots, "default", {}, void 0, true)], 2112))], 16);
1007
+ }, null, 10, _hoisted_1$58)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createCommentVNode(" Slot Fallback "), renderSlot(_ctx.$slots, "default", {}, void 0, true)], 2112))], 16);
1008
1008
  };
1009
1009
  }
1010
1010
  }), [["__scopeId", "data-v-bb6b8302"]]);
1011
1011
  //#endregion
1012
1012
  //#region src/components/base/input/input.vue
1013
- const _hoisted_1$56 = [
1013
+ const _hoisted_1$57 = [
1014
1014
  "type",
1015
1015
  "value",
1016
1016
  "placeholder",
@@ -1119,7 +1119,7 @@ var input_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
1119
1119
  onFocus: handleFocus,
1120
1120
  onBlur: handleBlur,
1121
1121
  onKeydown: handleKeydown
1122
- }, null, 42, _hoisted_1$56),
1122
+ }, null, 42, _hoisted_1$57),
1123
1123
  __props.clearable && __props.modelValue && !__props.disabled ? (openBlock(), createElementBlock("span", {
1124
1124
  key: 1,
1125
1125
  class: normalizeClass(e("clear")),
@@ -1142,7 +1142,7 @@ var input_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
1142
1142
  }), [["__scopeId", "data-v-5c21184f"]]);
1143
1143
  //#endregion
1144
1144
  //#region src/components/base/textarea/textarea.vue
1145
- const _hoisted_1$55 = [
1145
+ const _hoisted_1$56 = [
1146
1146
  "value",
1147
1147
  "placeholder",
1148
1148
  "disabled",
@@ -1236,7 +1236,7 @@ var textarea_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ def
1236
1236
  onChange: handleChange,
1237
1237
  onFocus: handleFocus,
1238
1238
  onBlur: handleBlur
1239
- }, null, 42, _hoisted_1$55), __props.showWordLimit && __props.maxlength ? (openBlock(), createElementBlock("span", {
1239
+ }, null, 42, _hoisted_1$56), __props.showWordLimit && __props.maxlength ? (openBlock(), createElementBlock("span", {
1240
1240
  key: 0,
1241
1241
  class: normalizeClass(e("word-limit"))
1242
1242
  }, toDisplayString(String(__props.modelValue).length) + "/" + toDisplayString(__props.maxlength), 3)) : createCommentVNode("v-if", true)], 2);
@@ -1245,7 +1245,7 @@ var textarea_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ def
1245
1245
  }), [["__scopeId", "data-v-13af2da6"]]);
1246
1246
  //#endregion
1247
1247
  //#region src/components/base/input-number/input-number.vue
1248
- const _hoisted_1$54 = ["disabled"];
1248
+ const _hoisted_1$55 = ["disabled"];
1249
1249
  const _hoisted_2$37 = ["value", "disabled"];
1250
1250
  const _hoisted_3$28 = ["disabled"];
1251
1251
  var input_number_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
@@ -1342,7 +1342,7 @@ var input_number_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
1342
1342
  y1: "12",
1343
1343
  x2: "19",
1344
1344
  y2: "12"
1345
- })], -1)])], 10, _hoisted_1$54),
1345
+ })], -1)])], 10, _hoisted_1$55),
1346
1346
  createElementVNode("input", {
1347
1347
  ref_key: "inputRef",
1348
1348
  ref: inputRef,
@@ -1430,7 +1430,7 @@ var empty_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
1430
1430
  }), [["__scopeId", "data-v-ed413d74"]]);
1431
1431
  //#endregion
1432
1432
  //#region src/components/base/select/select.vue
1433
- const _hoisted_1$53 = [
1433
+ const _hoisted_1$54 = [
1434
1434
  "value",
1435
1435
  "placeholder",
1436
1436
  "disabled"
@@ -1494,6 +1494,7 @@ var select_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
1494
1494
  const visible = ref(false);
1495
1495
  const searchText = ref("");
1496
1496
  const loading = ref(false);
1497
+ const focusedIndex = ref(-1);
1497
1498
  const cachedDropdownStyle = ref({});
1498
1499
  function updateDropdownPosition() {
1499
1500
  if (!selectRef.value || !visible.value) return;
@@ -1559,6 +1560,36 @@ var select_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
1559
1560
  return opt.label.toLowerCase().includes(query) ? opt : null;
1560
1561
  }).filter(Boolean);
1561
1562
  }
1563
+ function handleKeydown(e) {
1564
+ if (props.disabled) return;
1565
+ const flatOptions = flattenOptions(filteredOptions.value);
1566
+ if (!flatOptions.length) return;
1567
+ switch (e.key) {
1568
+ case "ArrowDown":
1569
+ e.preventDefault();
1570
+ if (!visible.value) visible.value = true;
1571
+ else focusedIndex.value = Math.min(focusedIndex.value + 1, flatOptions.length - 1);
1572
+ break;
1573
+ case "ArrowUp":
1574
+ e.preventDefault();
1575
+ if (!visible.value) visible.value = true;
1576
+ else focusedIndex.value = Math.max(focusedIndex.value - 1, 0);
1577
+ break;
1578
+ case "Enter":
1579
+ e.preventDefault();
1580
+ if (focusedIndex.value >= 0 && flatOptions[focusedIndex.value]) handleSelect(flatOptions[focusedIndex.value]);
1581
+ break;
1582
+ case "Escape":
1583
+ e.preventDefault();
1584
+ visible.value = false;
1585
+ focusedIndex.value = -1;
1586
+ break;
1587
+ case "Tab":
1588
+ visible.value = false;
1589
+ focusedIndex.value = -1;
1590
+ break;
1591
+ }
1592
+ }
1562
1593
  function isSelected(value) {
1563
1594
  return props.multiple ? Array.isArray(props.modelValue) && props.modelValue.includes(value) : props.modelValue === value;
1564
1595
  }
@@ -1675,11 +1706,16 @@ var select_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
1675
1706
  value: searchText.value,
1676
1707
  placeholder: displayPlaceholder.value,
1677
1708
  disabled: __props.disabled,
1709
+ tabindex: "0",
1710
+ role: "combobox",
1711
+ "aria-expanded": "visible",
1712
+ "aria-haspopup": "listbox",
1713
+ "aria-label": "选择器",
1678
1714
  onInput: handleSearch,
1679
1715
  onFocus: handleFocus,
1680
1716
  onBlur: handleBlur,
1681
- onKeydown: _cache[0] || (_cache[0] = withModifiers(() => {}, ["stop"]))
1682
- }, null, 42, _hoisted_1$53)) : (openBlock(), createElementBlock("div", {
1717
+ onKeydown: handleKeydown
1718
+ }, null, 42, _hoisted_1$54)) : (openBlock(), createElementBlock("div", {
1683
1719
  key: 1,
1684
1720
  class: normalizeClass([e("display"), { [e("display--placeholder")]: !selectedLabel.value }])
1685
1721
  }, toDisplayString(selectedLabel.value || __props.placeholder), 3)),
@@ -1706,7 +1742,7 @@ var select_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
1706
1742
  key: 0,
1707
1743
  class: normalizeClass(e("dropdown")),
1708
1744
  style: normalizeStyle(dropdownStyle.value),
1709
- onClick: _cache[1] || (_cache[1] = withModifiers(() => {}, ["stop"]))
1745
+ onClick: _cache[0] || (_cache[0] = withModifiers(() => {}, ["stop"]))
1710
1746
  }, [loading.value ? (openBlock(), createElementBlock("div", {
1711
1747
  key: 0,
1712
1748
  class: normalizeClass(e("loading"))
@@ -1749,10 +1785,10 @@ var select_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
1749
1785
  ], 2);
1750
1786
  };
1751
1787
  }
1752
- }), [["__scopeId", "data-v-8cade129"]]);
1788
+ }), [["__scopeId", "data-v-90548156"]]);
1753
1789
  //#endregion
1754
1790
  //#region src/components/base/switch/switch.vue
1755
- const _hoisted_1$52 = ["aria-checked", "disabled"];
1791
+ const _hoisted_1$53 = ["aria-checked", "disabled"];
1756
1792
  var switch_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
1757
1793
  name: "YdSwitch",
1758
1794
  __name: "switch",
@@ -1788,13 +1824,13 @@ var switch_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
1788
1824
  class: normalizeClass(switchClasses.value),
1789
1825
  disabled: __props.disabled,
1790
1826
  onClick: toggle
1791
- }, [createElementVNode("span", { class: normalizeClass(e("thumb")) }, null, 2)], 10, _hoisted_1$52);
1827
+ }, [createElementVNode("span", { class: normalizeClass(e("thumb")) }, null, 2)], 10, _hoisted_1$53);
1792
1828
  };
1793
1829
  }
1794
1830
  }), [["__scopeId", "data-v-178da0de"]]);
1795
1831
  //#endregion
1796
1832
  //#region src/components/base/checkbox/checkbox.vue
1797
- const _hoisted_1$51 = [
1833
+ const _hoisted_1$52 = [
1798
1834
  "checked",
1799
1835
  "disabled",
1800
1836
  "value"
@@ -1847,7 +1883,7 @@ var checkbox_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ def
1847
1883
  disabled: __props.disabled,
1848
1884
  value: __props.value,
1849
1885
  onChange: handleChange
1850
- }, null, 42, _hoisted_1$51),
1886
+ }, null, 42, _hoisted_1$52),
1851
1887
  createElementVNode("span", { class: normalizeClass(e("box")) }, [__props.modelValue ? (openBlock(), createElementBlock("svg", {
1852
1888
  key: 0,
1853
1889
  class: normalizeClass(e("icon")),
@@ -1914,7 +1950,7 @@ var checkbox_group_default = /* @__PURE__ */ export_helper_default(/* @__PURE__
1914
1950
  }), [["__scopeId", "data-v-3dce3e2c"]]);
1915
1951
  //#endregion
1916
1952
  //#region src/components/base/radio/radio.vue
1917
- const _hoisted_1$50 = [
1953
+ const _hoisted_1$51 = [
1918
1954
  "checked",
1919
1955
  "disabled",
1920
1956
  "value",
@@ -1970,7 +2006,7 @@ var radio_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
1970
2006
  value: __props.value,
1971
2007
  name: __props.name,
1972
2008
  onChange: handleChange
1973
- }, null, 42, _hoisted_1$50),
2009
+ }, null, 42, _hoisted_1$51),
1974
2010
  createElementVNode("span", { class: normalizeClass(e("dot")) }, null, 2),
1975
2011
  _ctx.$slots.default || __props.label ? (openBlock(), createElementBlock("span", {
1976
2012
  key: 0,
@@ -2090,7 +2126,7 @@ var tag_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineCo
2090
2126
  }), [["__scopeId", "data-v-ae4235fd"]]);
2091
2127
  //#endregion
2092
2128
  //#region src/components/base/avatar/avatar.vue
2093
- const _hoisted_1$49 = ["src", "alt"];
2129
+ const _hoisted_1$50 = ["src", "alt"];
2094
2130
  var avatar_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
2095
2131
  name: "YdAvatar",
2096
2132
  __name: "avatar",
@@ -2118,7 +2154,7 @@ var avatar_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
2118
2154
  src: __props.src,
2119
2155
  alt: __props.alt,
2120
2156
  onError: handleError
2121
- }, null, 40, _hoisted_1$49)) : _ctx.$slots.default ? (openBlock(), createElementBlock("span", {
2157
+ }, null, 40, _hoisted_1$50)) : _ctx.$slots.default ? (openBlock(), createElementBlock("span", {
2122
2158
  key: 1,
2123
2159
  class: normalizeClass(e("text"))
2124
2160
  }, [renderSlot(_ctx.$slots, "default", {}, void 0, true)], 2)) : (openBlock(), createElementBlock("span", {
@@ -2178,7 +2214,7 @@ var badge_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
2178
2214
  }), [["__scopeId", "data-v-9b63f1ae"]]);
2179
2215
  //#endregion
2180
2216
  //#region src/components/base/rate/rate.vue
2181
- const _hoisted_1$48 = ["onClick", "onMouseenter"];
2217
+ const _hoisted_1$49 = ["onClick", "onMouseenter"];
2182
2218
  var rate_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
2183
2219
  name: "YdRate",
2184
2220
  __name: "rate",
@@ -2243,7 +2279,7 @@ var rate_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineC
2243
2279
  viewBox: "0 0 24 24",
2244
2280
  fill: "currentColor",
2245
2281
  stroke: "none"
2246
- }, [..._cache[1] || (_cache[1] = [createElementVNode("polygon", { points: "12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" }, null, -1)])], 2))], 42, _hoisted_1$48);
2282
+ }, [..._cache[1] || (_cache[1] = [createElementVNode("polygon", { points: "12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" }, null, -1)])], 2))], 42, _hoisted_1$49);
2247
2283
  }), 128)), __props.showText ? (openBlock(), createElementBlock("span", {
2248
2284
  key: 0,
2249
2285
  class: normalizeClass(e("text"))
@@ -2251,6 +2287,14 @@ var rate_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineC
2251
2287
  };
2252
2288
  }
2253
2289
  }), [["__scopeId", "data-v-52b27a1b"]]);
2290
+ //#endregion
2291
+ //#region src/components/base/slider/slider.vue
2292
+ const _hoisted_1$48 = [
2293
+ "aria-valuenow",
2294
+ "aria-valuemin",
2295
+ "aria-valuemax",
2296
+ "aria-disabled"
2297
+ ];
2254
2298
  var slider_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
2255
2299
  name: "YdSlider",
2256
2300
  __name: "slider",
@@ -2310,9 +2354,47 @@ var slider_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
2310
2354
  document.addEventListener("mousemove", onMove);
2311
2355
  document.addEventListener("mouseup", onUp);
2312
2356
  }
2357
+ function handleKeydown(e) {
2358
+ if (props.disabled) return;
2359
+ switch (e.key) {
2360
+ case "ArrowLeft":
2361
+ case "ArrowDown":
2362
+ e.preventDefault();
2363
+ const newValueLeft = Math.max(props.min, props.modelValue - props.step);
2364
+ emit("update:modelValue", newValueLeft);
2365
+ emit("change", newValueLeft);
2366
+ break;
2367
+ case "ArrowRight":
2368
+ case "ArrowUp":
2369
+ e.preventDefault();
2370
+ const newValueRight = Math.min(props.max, props.modelValue + props.step);
2371
+ emit("update:modelValue", newValueRight);
2372
+ emit("change", newValueRight);
2373
+ break;
2374
+ case "Home":
2375
+ e.preventDefault();
2376
+ emit("update:modelValue", props.min);
2377
+ emit("change", props.min);
2378
+ break;
2379
+ case "End":
2380
+ e.preventDefault();
2381
+ emit("update:modelValue", props.max);
2382
+ emit("change", props.max);
2383
+ break;
2384
+ }
2385
+ }
2313
2386
  onUnmounted(() => {});
2314
2387
  return (_ctx, _cache) => {
2315
- return openBlock(), createElementBlock("div", { class: normalizeClass(sliderClasses.value) }, [createElementVNode("div", {
2388
+ return openBlock(), createElementBlock("div", {
2389
+ class: normalizeClass(sliderClasses.value),
2390
+ role: "slider",
2391
+ "aria-valuenow": __props.modelValue,
2392
+ "aria-valuemin": __props.min,
2393
+ "aria-valuemax": __props.max,
2394
+ "aria-disabled": __props.disabled,
2395
+ tabindex: "0",
2396
+ onKeydown: handleKeydown
2397
+ }, [createElementVNode("div", {
2316
2398
  class: normalizeClass(e("rail")),
2317
2399
  onClick: handleRailClick
2318
2400
  }, [createElementVNode("div", {
@@ -2326,10 +2408,10 @@ var slider_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
2326
2408
  key: 0,
2327
2409
  class: normalizeClass(e("tooltip")),
2328
2410
  style: normalizeStyle({ left: `${percent.value}%` })
2329
- }, toDisplayString(__props.modelValue), 7)) : createCommentVNode("v-if", true)], 2);
2411
+ }, toDisplayString(__props.modelValue), 7)) : createCommentVNode("v-if", true)], 42, _hoisted_1$48);
2330
2412
  };
2331
2413
  }
2332
- }), [["__scopeId", "data-v-51e82523"]]);
2414
+ }), [["__scopeId", "data-v-57b592ff"]]);
2333
2415
  //#endregion
2334
2416
  //#region src/components/base/date-picker/date-picker.vue
2335
2417
  const _hoisted_1$47 = [
@@ -2339,7 +2421,11 @@ const _hoisted_1$47 = [
2339
2421
  ];
2340
2422
  const _hoisted_2$35 = ["onClick"];
2341
2423
  const _hoisted_3$26 = ["onClick"];
2342
- const _hoisted_4$24 = ["disabled", "onClick"];
2424
+ const _hoisted_4$24 = [
2425
+ "tabindex",
2426
+ "disabled",
2427
+ "onClick"
2428
+ ];
2343
2429
  var date_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
2344
2430
  name: "YdDatePicker",
2345
2431
  __name: "date-picker",
@@ -2359,6 +2445,7 @@ var date_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
2359
2445
  const visible = ref(false);
2360
2446
  const triggerRef = ref();
2361
2447
  const view = ref("date");
2448
+ const focusedDate = ref(0);
2362
2449
  const positionKey = ref(0);
2363
2450
  const now = /* @__PURE__ */ new Date();
2364
2451
  const currentYear = ref(now.getFullYear());
@@ -2456,9 +2543,59 @@ var date_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
2456
2543
  currentMonth.value = m - 1;
2457
2544
  yearRangeStart.value = Math.floor(y / 12) * 12;
2458
2545
  }
2546
+ const selectedIdx = calendarDays.value.findIndex((d) => d.selected && d.current);
2547
+ focusedDate.value = selectedIdx >= 0 ? selectedIdx : calendarDays.value.findIndex((d) => d.today && d.current);
2459
2548
  }
2460
2549
  }
2461
2550
  }
2551
+ function handleKeydown(e) {
2552
+ if (props.disabled) return;
2553
+ if (!visible.value) {
2554
+ if (e.key === "Enter" || e.key === " " || e.key === "ArrowDown") {
2555
+ e.preventDefault();
2556
+ visible.value = true;
2557
+ view.value = props.type === "year" ? "year" : props.type === "month" ? "month" : "date";
2558
+ }
2559
+ return;
2560
+ }
2561
+ switch (e.key) {
2562
+ case "ArrowLeft":
2563
+ e.preventDefault();
2564
+ if (view.value === "date") focusedDate.value = Math.max(0, focusedDate.value - 1);
2565
+ else if (view.value === "month") prevMonth();
2566
+ else prevYearRange();
2567
+ break;
2568
+ case "ArrowRight":
2569
+ e.preventDefault();
2570
+ if (view.value === "date") focusedDate.value = Math.min(calendarDays.value.length - 1, focusedDate.value + 1);
2571
+ else if (view.value === "month") nextMonth();
2572
+ else nextYearRange();
2573
+ break;
2574
+ case "ArrowUp":
2575
+ e.preventDefault();
2576
+ if (view.value === "date") focusedDate.value = Math.max(0, focusedDate.value - 7);
2577
+ break;
2578
+ case "ArrowDown":
2579
+ e.preventDefault();
2580
+ if (view.value === "date") focusedDate.value = Math.min(calendarDays.value.length - 1, focusedDate.value + 7);
2581
+ break;
2582
+ case "Enter":
2583
+ e.preventDefault();
2584
+ if (view.value === "date") {
2585
+ const day = calendarDays.value[focusedDate.value];
2586
+ if (day && day.current) selectDate(day);
2587
+ } else if (view.value === "month") selectMonth(currentMonth.value);
2588
+ else selectYear(currentYear.value);
2589
+ break;
2590
+ case "Escape":
2591
+ e.preventDefault();
2592
+ visible.value = false;
2593
+ break;
2594
+ case "Tab":
2595
+ visible.value = false;
2596
+ break;
2597
+ }
2598
+ }
2462
2599
  function prevMonth() {
2463
2600
  if (currentMonth.value === 0) {
2464
2601
  currentMonth.value = 11;
@@ -2553,8 +2690,14 @@ var date_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
2553
2690
  placeholder: __props.placeholder,
2554
2691
  disabled: __props.disabled,
2555
2692
  readonly: "",
2556
- onClick: withModifiers(togglePicker, ["stop"])
2557
- }, null, 10, _hoisted_1$47),
2693
+ tabindex: "0",
2694
+ role: "combobox",
2695
+ "aria-expanded": "visible",
2696
+ "aria-haspopup": "grid",
2697
+ "aria-label": "选择日期",
2698
+ onClick: withModifiers(togglePicker, ["stop"]),
2699
+ onKeydown: handleKeydown
2700
+ }, null, 42, _hoisted_1$47),
2558
2701
  createElementVNode("span", {
2559
2702
  class: normalizeClass(e("icon")),
2560
2703
  onClick: withModifiers(togglePicker, ["stop"])
@@ -2605,14 +2748,16 @@ var date_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
2605
2748
  ], (d) => {
2606
2749
  return createElementVNode("span", { key: d }, toDisplayString(d), 1);
2607
2750
  }), 64))], 2),
2608
- createElementVNode("div", { class: normalizeClass(e("days")) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(calendarDays.value, (day) => {
2751
+ createElementVNode("div", { class: normalizeClass(e("days")) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(calendarDays.value, (day, idx) => {
2609
2752
  return openBlock(), createElementBlock("button", {
2610
2753
  key: day.date,
2611
2754
  class: normalizeClass([e("day"), {
2612
2755
  [e("day--other")]: !day.current,
2613
2756
  [e("day--selected")]: day.selected,
2614
- [e("day--today")]: day.today
2757
+ [e("day--today")]: day.today,
2758
+ [e("day--focused")]: idx === focusedDate.value && day.current
2615
2759
  }]),
2760
+ tabindex: idx === focusedDate.value && day.current ? 0 : -1,
2616
2761
  disabled: !day.current,
2617
2762
  onClick: withModifiers(($event) => selectDate(day), ["stop"])
2618
2763
  }, toDisplayString(day.date.getDate()), 11, _hoisted_4$24);
@@ -2621,7 +2766,7 @@ var date_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
2621
2766
  ], 2);
2622
2767
  };
2623
2768
  }
2624
- }), [["__scopeId", "data-v-23f9364e"]]);
2769
+ }), [["__scopeId", "data-v-1692914b"]]);
2625
2770
  //#endregion
2626
2771
  //#region src/components/base/date-picker/date-range-picker.vue
2627
2772
  const _hoisted_1$46 = [
@@ -2875,6 +3020,7 @@ var time_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
2875
3020
  const selectedHour = ref(0);
2876
3021
  const selectedMinute = ref(0);
2877
3022
  const selectedSecond = ref(0);
3023
+ const activeColumn = ref(0);
2878
3024
  const panelStyle = computed(() => {
2879
3025
  if (!triggerRef.value) return {};
2880
3026
  const rect = triggerRef.value.getBoundingClientRect();
@@ -2888,6 +3034,51 @@ var time_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
2888
3034
  function togglePanel() {
2889
3035
  if (!props.disabled) visible.value = !visible.value;
2890
3036
  }
3037
+ function handleKeydown(e) {
3038
+ if (props.disabled) return;
3039
+ if (!visible.value) {
3040
+ if (e.key === "Enter" || e.key === " " || e.key === "ArrowDown") {
3041
+ e.preventDefault();
3042
+ visible.value = true;
3043
+ }
3044
+ return;
3045
+ }
3046
+ switch (e.key) {
3047
+ case "ArrowLeft":
3048
+ e.preventDefault();
3049
+ if (activeColumn.value > 0) activeColumn.value--;
3050
+ break;
3051
+ case "ArrowRight":
3052
+ e.preventDefault();
3053
+ if (activeColumn.value < (props.showSeconds ? 2 : 1)) activeColumn.value++;
3054
+ break;
3055
+ case "ArrowUp":
3056
+ e.preventDefault();
3057
+ if (activeColumn.value === 0) selectedHour.value = (selectedHour.value - 1 + 24) % 24;
3058
+ else if (activeColumn.value === 1) selectedMinute.value = (selectedMinute.value - 1 + 60) % 60;
3059
+ else selectedSecond.value = (selectedSecond.value - 1 + 60) % 60;
3060
+ updateValue();
3061
+ break;
3062
+ case "ArrowDown":
3063
+ e.preventDefault();
3064
+ if (activeColumn.value === 0) selectedHour.value = (selectedHour.value + 1) % 24;
3065
+ else if (activeColumn.value === 1) selectedMinute.value = (selectedMinute.value + 1) % 60;
3066
+ else selectedSecond.value = (selectedSecond.value + 1) % 60;
3067
+ updateValue();
3068
+ break;
3069
+ case "Enter":
3070
+ e.preventDefault();
3071
+ visible.value = false;
3072
+ break;
3073
+ case "Escape":
3074
+ e.preventDefault();
3075
+ visible.value = false;
3076
+ break;
3077
+ case "Tab":
3078
+ visible.value = false;
3079
+ break;
3080
+ }
3081
+ }
2891
3082
  function selectHour(h) {
2892
3083
  selectedHour.value = h;
2893
3084
  updateValue();
@@ -2918,15 +3109,21 @@ var time_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
2918
3109
  return openBlock(), createElementBlock("div", {
2919
3110
  class: normalizeClass(unref(cn)("yd-time-picker")),
2920
3111
  ref_key: "triggerRef",
2921
- ref: triggerRef,
2922
- onClick: togglePanel
3112
+ ref: triggerRef
2923
3113
  }, [createElementVNode("input", {
2924
3114
  class: normalizeClass(e("input")),
2925
3115
  value: __props.modelValue,
2926
3116
  placeholder: __props.placeholder,
2927
3117
  disabled: __props.disabled,
2928
- readonly: ""
2929
- }, null, 10, _hoisted_1$45), (openBlock(), createBlock(Teleport, { to: "body" }, [visible.value ? (openBlock(), createElementBlock("div", {
3118
+ readonly: "",
3119
+ tabindex: "0",
3120
+ role: "combobox",
3121
+ "aria-expanded": "visible",
3122
+ "aria-haspopup": "listbox",
3123
+ "aria-label": "选择时间",
3124
+ onClick: withModifiers(togglePanel, ["stop"]),
3125
+ onKeydown: handleKeydown
3126
+ }, null, 42, _hoisted_1$45), (openBlock(), createBlock(Teleport, { to: "body" }, [visible.value ? (openBlock(), createElementBlock("div", {
2930
3127
  key: 0,
2931
3128
  class: normalizeClass(e("panel")),
2932
3129
  style: normalizeStyle(panelStyle.value)
@@ -2958,7 +3155,7 @@ var time_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
2958
3155
  ], 2)], 6)) : createCommentVNode("v-if", true)]))], 2);
2959
3156
  };
2960
3157
  }
2961
- }), [["__scopeId", "data-v-a6fe401a"]]);
3158
+ }), [["__scopeId", "data-v-9ebec461"]]);
2962
3159
  //#endregion
2963
3160
  //#region src/components/base/cascader/cascader.vue
2964
3161
  const _hoisted_1$44 = [
@@ -3238,7 +3435,11 @@ var cascader_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ def
3238
3435
  }), [["__scopeId", "data-v-01225c10"]]);
3239
3436
  //#endregion
3240
3437
  //#region src/components/base/auto-complete/auto-complete.vue
3241
- const _hoisted_1$43 = ["onClick", "onMouseenter"];
3438
+ const _hoisted_1$43 = [
3439
+ "aria-selected",
3440
+ "onClick",
3441
+ "onMouseenter"
3442
+ ];
3242
3443
  var auto_complete_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
3243
3444
  name: "YdAutoComplete",
3244
3445
  __name: "auto-complete",
@@ -3294,6 +3495,26 @@ var auto_complete_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ *
3294
3495
  emit("update:modelValue", option.label);
3295
3496
  emit("select", option);
3296
3497
  }
3498
+ function handleKeydown(e) {
3499
+ if (!visible.value || !filteredOptions.value.length) return;
3500
+ const maxIndex = filteredOptions.value.length - 1;
3501
+ switch (e.key) {
3502
+ case "ArrowDown":
3503
+ e.preventDefault();
3504
+ activeIndex.value = activeIndex.value < maxIndex ? activeIndex.value + 1 : 0;
3505
+ break;
3506
+ case "ArrowUp":
3507
+ e.preventDefault();
3508
+ activeIndex.value = activeIndex.value > 0 ? activeIndex.value - 1 : maxIndex;
3509
+ break;
3510
+ case "Enter":
3511
+ if (filteredOptions.value[activeIndex.value]) selectOption(filteredOptions.value[activeIndex.value]);
3512
+ break;
3513
+ case "Escape":
3514
+ visible.value = false;
3515
+ break;
3516
+ }
3517
+ }
3297
3518
  function handleClickOutside(event) {
3298
3519
  const el = document.querySelector(".yd-auto-complete");
3299
3520
  if (el && !el.contains(event.target)) visible.value = false;
@@ -3307,7 +3528,8 @@ var auto_complete_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ *
3307
3528
  placeholder: __props.placeholder,
3308
3529
  disabled: __props.disabled,
3309
3530
  onInput: handleInput,
3310
- onFocus: handleFocus
3531
+ onFocus: handleFocus,
3532
+ onKeydown: handleKeydown
3311
3533
  }, null, 8, [
3312
3534
  "modelValue",
3313
3535
  "placeholder",
@@ -3315,18 +3537,21 @@ var auto_complete_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ *
3315
3537
  ]), (openBlock(), createBlock(Teleport, { to: "body" }, [visible.value && filteredOptions.value.length ? (openBlock(), createElementBlock("div", {
3316
3538
  key: 0,
3317
3539
  class: normalizeClass(e("dropdown")),
3318
- style: normalizeStyle(dropdownStyle.value)
3540
+ style: normalizeStyle(dropdownStyle.value),
3541
+ role: "listbox"
3319
3542
  }, [(openBlock(true), createElementBlock(Fragment, null, renderList(filteredOptions.value, (option, index) => {
3320
3543
  return openBlock(), createElementBlock("div", {
3321
3544
  key: option.value,
3322
3545
  class: normalizeClass([e("option"), { [e("option--active")]: index === activeIndex.value }]),
3546
+ role: "option",
3547
+ "aria-selected": index === activeIndex.value,
3323
3548
  onClick: ($event) => selectOption(option),
3324
3549
  onMouseenter: ($event) => activeIndex.value = index
3325
3550
  }, toDisplayString(option.label), 43, _hoisted_1$43);
3326
3551
  }), 128))], 6)) : createCommentVNode("v-if", true)]))], 2);
3327
3552
  };
3328
3553
  }
3329
- }), [["__scopeId", "data-v-0251e526"]]);
3554
+ }), [["__scopeId", "data-v-4cddacd2"]]);
3330
3555
  //#endregion
3331
3556
  //#region src/components/base/transfer/transfer.vue
3332
3557
  const _hoisted_1$42 = ["onClick"];
@@ -4862,7 +5087,7 @@ const _hoisted_9$9 = [
4862
5087
  const _hoisted_10$8 = ["onClick"];
4863
5088
  const _hoisted_11$8 = ["onClick"];
4864
5089
  const _hoisted_12$5 = ["onClick"];
4865
- const _hoisted_13$4 = [
5090
+ const _hoisted_13$5 = [
4866
5091
  "checked",
4867
5092
  "indeterminate",
4868
5093
  "disabled"
@@ -4922,7 +5147,7 @@ var tree_select_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
4922
5147
  "check"
4923
5148
  ],
4924
5149
  setup(__props, { emit: __emit }) {
4925
- useCssVars((_ctx) => ({ "v23cc09d6": _ctx.dropdownHeight + "px" }));
5150
+ useCssVars((_ctx) => ({ "f4998178": _ctx.dropdownHeight + "px" }));
4926
5151
  const props = __props;
4927
5152
  const emit = __emit;
4928
5153
  const selectRef = ref();
@@ -4931,7 +5156,56 @@ var tree_select_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
4931
5156
  const expandedKeys = ref(props.defaultExpandedKeys);
4932
5157
  const checkedKeys = ref([...props.defaultCheckedKeys]);
4933
5158
  const indeterminateKeys = ref([]);
5159
+ const focusedIndex = ref(-1);
4934
5160
  const scrollTop = ref(0);
5161
+ function handleKeydown(e) {
5162
+ if (props.disabled) return;
5163
+ const nodes = filteredNodes.value;
5164
+ if (!nodes.length) return;
5165
+ switch (e.key) {
5166
+ case "ArrowDown":
5167
+ e.preventDefault();
5168
+ focusedIndex.value = Math.min(focusedIndex.value + 1, nodes.length - 1);
5169
+ if (props.virtualScroll && focusedIndex.value >= 0) {
5170
+ const container = selectRef.value?.querySelector(".yd-tree-select__virtual-wrapper");
5171
+ if (container) container.scrollTop = focusedIndex.value * props.rowHeight;
5172
+ }
5173
+ break;
5174
+ case "ArrowUp":
5175
+ e.preventDefault();
5176
+ focusedIndex.value = Math.max(focusedIndex.value - 1, 0);
5177
+ if (props.virtualScroll && focusedIndex.value >= 0) {
5178
+ const container = selectRef.value?.querySelector(".yd-tree-select__virtual-wrapper");
5179
+ if (container) container.scrollTop = focusedIndex.value * props.rowHeight;
5180
+ }
5181
+ break;
5182
+ case "Enter":
5183
+ e.preventDefault();
5184
+ if (focusedIndex.value >= 0 && nodes[focusedIndex.value]) handleNodeClick(nodes[focusedIndex.value]);
5185
+ break;
5186
+ case "ArrowRight":
5187
+ e.preventDefault();
5188
+ if (focusedIndex.value >= 0 && nodes[focusedIndex.value]) {
5189
+ const node = nodes[focusedIndex.value];
5190
+ if (node.children && !expandedKeys.value.includes(node.key)) handleToggle(node);
5191
+ }
5192
+ break;
5193
+ case "ArrowLeft":
5194
+ e.preventDefault();
5195
+ if (focusedIndex.value >= 0 && nodes[focusedIndex.value]) {
5196
+ const node = nodes[focusedIndex.value];
5197
+ if (expandedKeys.value.includes(node.key)) handleToggle(node);
5198
+ }
5199
+ break;
5200
+ case "Escape":
5201
+ e.preventDefault();
5202
+ visible.value = false;
5203
+ break;
5204
+ case "Tab":
5205
+ visible.value = false;
5206
+ break;
5207
+ }
5208
+ }
4935
5209
  const cachedDropdownStyle = ref({});
4936
5210
  function updateDropdownPosition() {
4937
5211
  if (!selectRef.value || !visible.value) return;
@@ -5169,10 +5443,15 @@ var tree_select_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
5169
5443
  value: searchText.value,
5170
5444
  placeholder: displayPlaceholder.value,
5171
5445
  disabled: __props.disabled,
5446
+ tabindex: "0",
5447
+ role: "combobox",
5448
+ "aria-expanded": "visible",
5449
+ "aria-haspopup": "tree",
5450
+ "aria-label": "树形选择器",
5172
5451
  onInput: handleSearch,
5173
5452
  onFocus: handleFocus,
5174
5453
  onBlur: handleBlur,
5175
- onKeydown: _cache[0] || (_cache[0] = withModifiers(() => {}, ["stop"]))
5454
+ onKeydown: withModifiers(handleKeydown, ["stop"])
5176
5455
  }, null, 42, _hoisted_1$35)) : (openBlock(), createElementBlock("div", {
5177
5456
  key: 1,
5178
5457
  class: normalizeClass([e("display"), { [e("display--placeholder")]: !selectedTitle.value }])
@@ -5181,7 +5460,7 @@ var tree_select_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
5181
5460
  key: 2,
5182
5461
  class: normalizeClass(e("clear")),
5183
5462
  onClick: withModifiers(handleClear, ["stop"])
5184
- }, [..._cache[2] || (_cache[2] = [createElementVNode("svg", {
5463
+ }, [..._cache[1] || (_cache[1] = [createElementVNode("svg", {
5185
5464
  xmlns: "http://www.w3.org/2000/svg",
5186
5465
  width: "14",
5187
5466
  height: "14",
@@ -5202,7 +5481,7 @@ var tree_select_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
5202
5481
  x2: "18",
5203
5482
  y2: "18"
5204
5483
  })], -1)])], 2)) : createCommentVNode("v-if", true),
5205
- createElementVNode("span", { class: normalizeClass(e("arrow")) }, [..._cache[3] || (_cache[3] = [createElementVNode("svg", {
5484
+ createElementVNode("span", { class: normalizeClass(e("arrow")) }, [..._cache[2] || (_cache[2] = [createElementVNode("svg", {
5206
5485
  xmlns: "http://www.w3.org/2000/svg",
5207
5486
  width: "12",
5208
5487
  height: "12",
@@ -5224,7 +5503,7 @@ var tree_select_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
5224
5503
  key: 0,
5225
5504
  class: normalizeClass(e("dropdown")),
5226
5505
  style: normalizeStyle(dropdownStyle.value),
5227
- onClick: _cache[1] || (_cache[1] = withModifiers(() => {}, ["stop"]))
5506
+ onClick: _cache[0] || (_cache[0] = withModifiers(() => {}, ["stop"]))
5228
5507
  }, [createCommentVNode(" Virtual scroll wrapper "), __props.virtualScroll ? (openBlock(), createElementBlock("div", {
5229
5508
  key: 0,
5230
5509
  class: normalizeClass(e("virtual-wrapper")),
@@ -5316,7 +5595,7 @@ var tree_select_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
5316
5595
  checked: checkedKeys.value.includes(child.key),
5317
5596
  indeterminate: indeterminateKeys.value.includes(child.key),
5318
5597
  disabled: child.disabled
5319
- }, null, 8, _hoisted_13$4)], 10, _hoisted_12$5)) : createCommentVNode("v-if", true),
5598
+ }, null, 8, _hoisted_13$5)], 10, _hoisted_12$5)) : createCommentVNode("v-if", true),
5320
5599
  createElementVNode("span", { class: normalizeClass(e("node-title")) }, toDisplayString(child.title), 3)
5321
5600
  ], 10, _hoisted_10$8);
5322
5601
  }), 128))], 2)) : createCommentVNode("v-if", true)
@@ -5330,7 +5609,7 @@ var tree_select_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
5330
5609
  ], 2);
5331
5610
  };
5332
5611
  }
5333
- }), [["__scopeId", "data-v-f36bc312"]]);
5612
+ }), [["__scopeId", "data-v-338c5a59"]]);
5334
5613
  //#endregion
5335
5614
  //#region src/components/base/color-picker/color-picker.vue
5336
5615
  const _hoisted_1$34 = [
@@ -6193,8 +6472,1686 @@ var calendar_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ def
6193
6472
  }, "今天", 2)], 2)) : createCommentVNode("v-if", true)
6194
6473
  ], 2);
6195
6474
  };
6196
- }
6197
- }), [["__scopeId", "data-v-b7db4b77"]]);
6475
+ }
6476
+ }), [["__scopeId", "data-v-b7db4b77"]]);
6477
+ //#endregion
6478
+ //#region node_modules/.pnpm/dompurify@3.4.2/node_modules/dompurify/dist/purify.es.mjs
6479
+ /*! @license DOMPurify 3.4.2 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.2/LICENSE */
6480
+ const { entries, setPrototypeOf, isFrozen, getPrototypeOf, getOwnPropertyDescriptor } = Object;
6481
+ let { freeze, seal, create } = Object;
6482
+ let { apply, construct } = typeof Reflect !== "undefined" && Reflect;
6483
+ if (!freeze) freeze = function freeze(x) {
6484
+ return x;
6485
+ };
6486
+ if (!seal) seal = function seal(x) {
6487
+ return x;
6488
+ };
6489
+ if (!apply) apply = function apply(func, thisArg) {
6490
+ for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) args[_key - 2] = arguments[_key];
6491
+ return func.apply(thisArg, args);
6492
+ };
6493
+ if (!construct) construct = function construct(Func) {
6494
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) args[_key2 - 1] = arguments[_key2];
6495
+ return new Func(...args);
6496
+ };
6497
+ const arrayForEach = unapply(Array.prototype.forEach);
6498
+ const arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);
6499
+ const arrayPop = unapply(Array.prototype.pop);
6500
+ const arrayPush = unapply(Array.prototype.push);
6501
+ const arraySplice = unapply(Array.prototype.splice);
6502
+ const arrayIsArray = Array.isArray;
6503
+ const stringToLowerCase = unapply(String.prototype.toLowerCase);
6504
+ const stringToString = unapply(String.prototype.toString);
6505
+ const stringMatch = unapply(String.prototype.match);
6506
+ const stringReplace = unapply(String.prototype.replace);
6507
+ const stringIndexOf = unapply(String.prototype.indexOf);
6508
+ const stringTrim = unapply(String.prototype.trim);
6509
+ const numberToString = unapply(Number.prototype.toString);
6510
+ const booleanToString = unapply(Boolean.prototype.toString);
6511
+ const bigintToString = typeof BigInt === "undefined" ? null : unapply(BigInt.prototype.toString);
6512
+ const symbolToString = typeof Symbol === "undefined" ? null : unapply(Symbol.prototype.toString);
6513
+ const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);
6514
+ const objectToString = unapply(Object.prototype.toString);
6515
+ const regExpTest = unapply(RegExp.prototype.test);
6516
+ const typeErrorCreate = unconstruct(TypeError);
6517
+ /**
6518
+ * Creates a new function that calls the given function with a specified thisArg and arguments.
6519
+ *
6520
+ * @param func - The function to be wrapped and called.
6521
+ * @returns A new function that calls the given function with a specified thisArg and arguments.
6522
+ */
6523
+ function unapply(func) {
6524
+ return function(thisArg) {
6525
+ if (thisArg instanceof RegExp) thisArg.lastIndex = 0;
6526
+ for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) args[_key3 - 1] = arguments[_key3];
6527
+ return apply(func, thisArg, args);
6528
+ };
6529
+ }
6530
+ /**
6531
+ * Creates a new function that constructs an instance of the given constructor function with the provided arguments.
6532
+ *
6533
+ * @param func - The constructor function to be wrapped and called.
6534
+ * @returns A new function that constructs an instance of the given constructor function with the provided arguments.
6535
+ */
6536
+ function unconstruct(Func) {
6537
+ return function() {
6538
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) args[_key4] = arguments[_key4];
6539
+ return construct(Func, args);
6540
+ };
6541
+ }
6542
+ /**
6543
+ * Add properties to a lookup table
6544
+ *
6545
+ * @param set - The set to which elements will be added.
6546
+ * @param array - The array containing elements to be added to the set.
6547
+ * @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.
6548
+ * @returns The modified set with added elements.
6549
+ */
6550
+ function addToSet(set, array) {
6551
+ let transformCaseFunc = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : stringToLowerCase;
6552
+ if (setPrototypeOf) setPrototypeOf(set, null);
6553
+ if (!arrayIsArray(array)) return set;
6554
+ let l = array.length;
6555
+ while (l--) {
6556
+ let element = array[l];
6557
+ if (typeof element === "string") {
6558
+ const lcElement = transformCaseFunc(element);
6559
+ if (lcElement !== element) {
6560
+ if (!isFrozen(array)) array[l] = lcElement;
6561
+ element = lcElement;
6562
+ }
6563
+ }
6564
+ set[element] = true;
6565
+ }
6566
+ return set;
6567
+ }
6568
+ /**
6569
+ * Clean up an array to harden against CSPP
6570
+ *
6571
+ * @param array - The array to be cleaned.
6572
+ * @returns The cleaned version of the array
6573
+ */
6574
+ function cleanArray(array) {
6575
+ for (let index = 0; index < array.length; index++) if (!objectHasOwnProperty(array, index)) array[index] = null;
6576
+ return array;
6577
+ }
6578
+ /**
6579
+ * Shallow clone an object
6580
+ *
6581
+ * @param object - The object to be cloned.
6582
+ * @returns A new object that copies the original.
6583
+ */
6584
+ function clone(object) {
6585
+ const newObject = create(null);
6586
+ for (const [property, value] of entries(object)) if (objectHasOwnProperty(object, property)) if (arrayIsArray(value)) newObject[property] = cleanArray(value);
6587
+ else if (value && typeof value === "object" && value.constructor === Object) newObject[property] = clone(value);
6588
+ else newObject[property] = value;
6589
+ return newObject;
6590
+ }
6591
+ /**
6592
+ * Convert non-node values into strings without depending on direct property access.
6593
+ *
6594
+ * @param value - The value to stringify.
6595
+ * @returns A string representation of the provided value.
6596
+ */
6597
+ function stringifyValue(value) {
6598
+ switch (typeof value) {
6599
+ case "string": return value;
6600
+ case "number": return numberToString(value);
6601
+ case "boolean": return booleanToString(value);
6602
+ case "bigint": return bigintToString ? bigintToString(value) : "0";
6603
+ case "symbol": return symbolToString ? symbolToString(value) : "Symbol()";
6604
+ case "undefined": return objectToString(value);
6605
+ case "function":
6606
+ case "object": {
6607
+ if (value === null) return objectToString(value);
6608
+ const valueAsRecord = value;
6609
+ const valueToString = lookupGetter(valueAsRecord, "toString");
6610
+ if (typeof valueToString === "function") {
6611
+ const stringified = valueToString(valueAsRecord);
6612
+ return typeof stringified === "string" ? stringified : objectToString(stringified);
6613
+ }
6614
+ return objectToString(value);
6615
+ }
6616
+ default: return objectToString(value);
6617
+ }
6618
+ }
6619
+ /**
6620
+ * This method automatically checks if the prop is function or getter and behaves accordingly.
6621
+ *
6622
+ * @param object - The object to look up the getter function in its prototype chain.
6623
+ * @param prop - The property name for which to find the getter function.
6624
+ * @returns The getter function found in the prototype chain or a fallback function.
6625
+ */
6626
+ function lookupGetter(object, prop) {
6627
+ while (object !== null) {
6628
+ const desc = getOwnPropertyDescriptor(object, prop);
6629
+ if (desc) {
6630
+ if (desc.get) return unapply(desc.get);
6631
+ if (typeof desc.value === "function") return unapply(desc.value);
6632
+ }
6633
+ object = getPrototypeOf(object);
6634
+ }
6635
+ function fallbackValue() {
6636
+ return null;
6637
+ }
6638
+ return fallbackValue;
6639
+ }
6640
+ function isRegex(value) {
6641
+ try {
6642
+ regExpTest(value, "");
6643
+ return true;
6644
+ } catch (_unused) {
6645
+ return false;
6646
+ }
6647
+ }
6648
+ const html$1 = freeze([
6649
+ "a",
6650
+ "abbr",
6651
+ "acronym",
6652
+ "address",
6653
+ "area",
6654
+ "article",
6655
+ "aside",
6656
+ "audio",
6657
+ "b",
6658
+ "bdi",
6659
+ "bdo",
6660
+ "big",
6661
+ "blink",
6662
+ "blockquote",
6663
+ "body",
6664
+ "br",
6665
+ "button",
6666
+ "canvas",
6667
+ "caption",
6668
+ "center",
6669
+ "cite",
6670
+ "code",
6671
+ "col",
6672
+ "colgroup",
6673
+ "content",
6674
+ "data",
6675
+ "datalist",
6676
+ "dd",
6677
+ "decorator",
6678
+ "del",
6679
+ "details",
6680
+ "dfn",
6681
+ "dialog",
6682
+ "dir",
6683
+ "div",
6684
+ "dl",
6685
+ "dt",
6686
+ "element",
6687
+ "em",
6688
+ "fieldset",
6689
+ "figcaption",
6690
+ "figure",
6691
+ "font",
6692
+ "footer",
6693
+ "form",
6694
+ "h1",
6695
+ "h2",
6696
+ "h3",
6697
+ "h4",
6698
+ "h5",
6699
+ "h6",
6700
+ "head",
6701
+ "header",
6702
+ "hgroup",
6703
+ "hr",
6704
+ "html",
6705
+ "i",
6706
+ "img",
6707
+ "input",
6708
+ "ins",
6709
+ "kbd",
6710
+ "label",
6711
+ "legend",
6712
+ "li",
6713
+ "main",
6714
+ "map",
6715
+ "mark",
6716
+ "marquee",
6717
+ "menu",
6718
+ "menuitem",
6719
+ "meter",
6720
+ "nav",
6721
+ "nobr",
6722
+ "ol",
6723
+ "optgroup",
6724
+ "option",
6725
+ "output",
6726
+ "p",
6727
+ "picture",
6728
+ "pre",
6729
+ "progress",
6730
+ "q",
6731
+ "rp",
6732
+ "rt",
6733
+ "ruby",
6734
+ "s",
6735
+ "samp",
6736
+ "search",
6737
+ "section",
6738
+ "select",
6739
+ "shadow",
6740
+ "slot",
6741
+ "small",
6742
+ "source",
6743
+ "spacer",
6744
+ "span",
6745
+ "strike",
6746
+ "strong",
6747
+ "style",
6748
+ "sub",
6749
+ "summary",
6750
+ "sup",
6751
+ "table",
6752
+ "tbody",
6753
+ "td",
6754
+ "template",
6755
+ "textarea",
6756
+ "tfoot",
6757
+ "th",
6758
+ "thead",
6759
+ "time",
6760
+ "tr",
6761
+ "track",
6762
+ "tt",
6763
+ "u",
6764
+ "ul",
6765
+ "var",
6766
+ "video",
6767
+ "wbr"
6768
+ ]);
6769
+ const svg$1 = freeze([
6770
+ "svg",
6771
+ "a",
6772
+ "altglyph",
6773
+ "altglyphdef",
6774
+ "altglyphitem",
6775
+ "animatecolor",
6776
+ "animatemotion",
6777
+ "animatetransform",
6778
+ "circle",
6779
+ "clippath",
6780
+ "defs",
6781
+ "desc",
6782
+ "ellipse",
6783
+ "enterkeyhint",
6784
+ "exportparts",
6785
+ "filter",
6786
+ "font",
6787
+ "g",
6788
+ "glyph",
6789
+ "glyphref",
6790
+ "hkern",
6791
+ "image",
6792
+ "inputmode",
6793
+ "line",
6794
+ "lineargradient",
6795
+ "marker",
6796
+ "mask",
6797
+ "metadata",
6798
+ "mpath",
6799
+ "part",
6800
+ "path",
6801
+ "pattern",
6802
+ "polygon",
6803
+ "polyline",
6804
+ "radialgradient",
6805
+ "rect",
6806
+ "stop",
6807
+ "style",
6808
+ "switch",
6809
+ "symbol",
6810
+ "text",
6811
+ "textpath",
6812
+ "title",
6813
+ "tref",
6814
+ "tspan",
6815
+ "view",
6816
+ "vkern"
6817
+ ]);
6818
+ const svgFilters = freeze([
6819
+ "feBlend",
6820
+ "feColorMatrix",
6821
+ "feComponentTransfer",
6822
+ "feComposite",
6823
+ "feConvolveMatrix",
6824
+ "feDiffuseLighting",
6825
+ "feDisplacementMap",
6826
+ "feDistantLight",
6827
+ "feDropShadow",
6828
+ "feFlood",
6829
+ "feFuncA",
6830
+ "feFuncB",
6831
+ "feFuncG",
6832
+ "feFuncR",
6833
+ "feGaussianBlur",
6834
+ "feImage",
6835
+ "feMerge",
6836
+ "feMergeNode",
6837
+ "feMorphology",
6838
+ "feOffset",
6839
+ "fePointLight",
6840
+ "feSpecularLighting",
6841
+ "feSpotLight",
6842
+ "feTile",
6843
+ "feTurbulence"
6844
+ ]);
6845
+ const svgDisallowed = freeze([
6846
+ "animate",
6847
+ "color-profile",
6848
+ "cursor",
6849
+ "discard",
6850
+ "font-face",
6851
+ "font-face-format",
6852
+ "font-face-name",
6853
+ "font-face-src",
6854
+ "font-face-uri",
6855
+ "foreignobject",
6856
+ "hatch",
6857
+ "hatchpath",
6858
+ "mesh",
6859
+ "meshgradient",
6860
+ "meshpatch",
6861
+ "meshrow",
6862
+ "missing-glyph",
6863
+ "script",
6864
+ "set",
6865
+ "solidcolor",
6866
+ "unknown",
6867
+ "use"
6868
+ ]);
6869
+ const mathMl$1 = freeze([
6870
+ "math",
6871
+ "menclose",
6872
+ "merror",
6873
+ "mfenced",
6874
+ "mfrac",
6875
+ "mglyph",
6876
+ "mi",
6877
+ "mlabeledtr",
6878
+ "mmultiscripts",
6879
+ "mn",
6880
+ "mo",
6881
+ "mover",
6882
+ "mpadded",
6883
+ "mphantom",
6884
+ "mroot",
6885
+ "mrow",
6886
+ "ms",
6887
+ "mspace",
6888
+ "msqrt",
6889
+ "mstyle",
6890
+ "msub",
6891
+ "msup",
6892
+ "msubsup",
6893
+ "mtable",
6894
+ "mtd",
6895
+ "mtext",
6896
+ "mtr",
6897
+ "munder",
6898
+ "munderover",
6899
+ "mprescripts"
6900
+ ]);
6901
+ const mathMlDisallowed = freeze([
6902
+ "maction",
6903
+ "maligngroup",
6904
+ "malignmark",
6905
+ "mlongdiv",
6906
+ "mscarries",
6907
+ "mscarry",
6908
+ "msgroup",
6909
+ "mstack",
6910
+ "msline",
6911
+ "msrow",
6912
+ "semantics",
6913
+ "annotation",
6914
+ "annotation-xml",
6915
+ "mprescripts",
6916
+ "none"
6917
+ ]);
6918
+ const text = freeze(["#text"]);
6919
+ const html = freeze([
6920
+ "accept",
6921
+ "action",
6922
+ "align",
6923
+ "alt",
6924
+ "autocapitalize",
6925
+ "autocomplete",
6926
+ "autopictureinpicture",
6927
+ "autoplay",
6928
+ "background",
6929
+ "bgcolor",
6930
+ "border",
6931
+ "capture",
6932
+ "cellpadding",
6933
+ "cellspacing",
6934
+ "checked",
6935
+ "cite",
6936
+ "class",
6937
+ "clear",
6938
+ "color",
6939
+ "cols",
6940
+ "colspan",
6941
+ "controls",
6942
+ "controlslist",
6943
+ "coords",
6944
+ "crossorigin",
6945
+ "datetime",
6946
+ "decoding",
6947
+ "default",
6948
+ "dir",
6949
+ "disabled",
6950
+ "disablepictureinpicture",
6951
+ "disableremoteplayback",
6952
+ "download",
6953
+ "draggable",
6954
+ "enctype",
6955
+ "enterkeyhint",
6956
+ "exportparts",
6957
+ "face",
6958
+ "for",
6959
+ "headers",
6960
+ "height",
6961
+ "hidden",
6962
+ "high",
6963
+ "href",
6964
+ "hreflang",
6965
+ "id",
6966
+ "inert",
6967
+ "inputmode",
6968
+ "integrity",
6969
+ "ismap",
6970
+ "kind",
6971
+ "label",
6972
+ "lang",
6973
+ "list",
6974
+ "loading",
6975
+ "loop",
6976
+ "low",
6977
+ "max",
6978
+ "maxlength",
6979
+ "media",
6980
+ "method",
6981
+ "min",
6982
+ "minlength",
6983
+ "multiple",
6984
+ "muted",
6985
+ "name",
6986
+ "nonce",
6987
+ "noshade",
6988
+ "novalidate",
6989
+ "nowrap",
6990
+ "open",
6991
+ "optimum",
6992
+ "part",
6993
+ "pattern",
6994
+ "placeholder",
6995
+ "playsinline",
6996
+ "popover",
6997
+ "popovertarget",
6998
+ "popovertargetaction",
6999
+ "poster",
7000
+ "preload",
7001
+ "pubdate",
7002
+ "radiogroup",
7003
+ "readonly",
7004
+ "rel",
7005
+ "required",
7006
+ "rev",
7007
+ "reversed",
7008
+ "role",
7009
+ "rows",
7010
+ "rowspan",
7011
+ "spellcheck",
7012
+ "scope",
7013
+ "selected",
7014
+ "shape",
7015
+ "size",
7016
+ "sizes",
7017
+ "slot",
7018
+ "span",
7019
+ "srclang",
7020
+ "start",
7021
+ "src",
7022
+ "srcset",
7023
+ "step",
7024
+ "style",
7025
+ "summary",
7026
+ "tabindex",
7027
+ "title",
7028
+ "translate",
7029
+ "type",
7030
+ "usemap",
7031
+ "valign",
7032
+ "value",
7033
+ "width",
7034
+ "wrap",
7035
+ "xmlns"
7036
+ ]);
7037
+ const svg = freeze([
7038
+ "accent-height",
7039
+ "accumulate",
7040
+ "additive",
7041
+ "alignment-baseline",
7042
+ "amplitude",
7043
+ "ascent",
7044
+ "attributename",
7045
+ "attributetype",
7046
+ "azimuth",
7047
+ "basefrequency",
7048
+ "baseline-shift",
7049
+ "begin",
7050
+ "bias",
7051
+ "by",
7052
+ "class",
7053
+ "clip",
7054
+ "clippathunits",
7055
+ "clip-path",
7056
+ "clip-rule",
7057
+ "color",
7058
+ "color-interpolation",
7059
+ "color-interpolation-filters",
7060
+ "color-profile",
7061
+ "color-rendering",
7062
+ "cx",
7063
+ "cy",
7064
+ "d",
7065
+ "dx",
7066
+ "dy",
7067
+ "diffuseconstant",
7068
+ "direction",
7069
+ "display",
7070
+ "divisor",
7071
+ "dur",
7072
+ "edgemode",
7073
+ "elevation",
7074
+ "end",
7075
+ "exponent",
7076
+ "fill",
7077
+ "fill-opacity",
7078
+ "fill-rule",
7079
+ "filter",
7080
+ "filterunits",
7081
+ "flood-color",
7082
+ "flood-opacity",
7083
+ "font-family",
7084
+ "font-size",
7085
+ "font-size-adjust",
7086
+ "font-stretch",
7087
+ "font-style",
7088
+ "font-variant",
7089
+ "font-weight",
7090
+ "fx",
7091
+ "fy",
7092
+ "g1",
7093
+ "g2",
7094
+ "glyph-name",
7095
+ "glyphref",
7096
+ "gradientunits",
7097
+ "gradienttransform",
7098
+ "height",
7099
+ "href",
7100
+ "id",
7101
+ "image-rendering",
7102
+ "in",
7103
+ "in2",
7104
+ "intercept",
7105
+ "k",
7106
+ "k1",
7107
+ "k2",
7108
+ "k3",
7109
+ "k4",
7110
+ "kerning",
7111
+ "keypoints",
7112
+ "keysplines",
7113
+ "keytimes",
7114
+ "lang",
7115
+ "lengthadjust",
7116
+ "letter-spacing",
7117
+ "kernelmatrix",
7118
+ "kernelunitlength",
7119
+ "lighting-color",
7120
+ "local",
7121
+ "marker-end",
7122
+ "marker-mid",
7123
+ "marker-start",
7124
+ "markerheight",
7125
+ "markerunits",
7126
+ "markerwidth",
7127
+ "maskcontentunits",
7128
+ "maskunits",
7129
+ "max",
7130
+ "mask",
7131
+ "mask-type",
7132
+ "media",
7133
+ "method",
7134
+ "mode",
7135
+ "min",
7136
+ "name",
7137
+ "numoctaves",
7138
+ "offset",
7139
+ "operator",
7140
+ "opacity",
7141
+ "order",
7142
+ "orient",
7143
+ "orientation",
7144
+ "origin",
7145
+ "overflow",
7146
+ "paint-order",
7147
+ "path",
7148
+ "pathlength",
7149
+ "patterncontentunits",
7150
+ "patterntransform",
7151
+ "patternunits",
7152
+ "points",
7153
+ "preservealpha",
7154
+ "preserveaspectratio",
7155
+ "primitiveunits",
7156
+ "r",
7157
+ "rx",
7158
+ "ry",
7159
+ "radius",
7160
+ "refx",
7161
+ "refy",
7162
+ "repeatcount",
7163
+ "repeatdur",
7164
+ "restart",
7165
+ "result",
7166
+ "rotate",
7167
+ "scale",
7168
+ "seed",
7169
+ "shape-rendering",
7170
+ "slope",
7171
+ "specularconstant",
7172
+ "specularexponent",
7173
+ "spreadmethod",
7174
+ "startoffset",
7175
+ "stddeviation",
7176
+ "stitchtiles",
7177
+ "stop-color",
7178
+ "stop-opacity",
7179
+ "stroke-dasharray",
7180
+ "stroke-dashoffset",
7181
+ "stroke-linecap",
7182
+ "stroke-linejoin",
7183
+ "stroke-miterlimit",
7184
+ "stroke-opacity",
7185
+ "stroke",
7186
+ "stroke-width",
7187
+ "style",
7188
+ "surfacescale",
7189
+ "systemlanguage",
7190
+ "tabindex",
7191
+ "tablevalues",
7192
+ "targetx",
7193
+ "targety",
7194
+ "transform",
7195
+ "transform-origin",
7196
+ "text-anchor",
7197
+ "text-decoration",
7198
+ "text-rendering",
7199
+ "textlength",
7200
+ "type",
7201
+ "u1",
7202
+ "u2",
7203
+ "unicode",
7204
+ "values",
7205
+ "viewbox",
7206
+ "visibility",
7207
+ "version",
7208
+ "vert-adv-y",
7209
+ "vert-origin-x",
7210
+ "vert-origin-y",
7211
+ "width",
7212
+ "word-spacing",
7213
+ "wrap",
7214
+ "writing-mode",
7215
+ "xchannelselector",
7216
+ "ychannelselector",
7217
+ "x",
7218
+ "x1",
7219
+ "x2",
7220
+ "xmlns",
7221
+ "y",
7222
+ "y1",
7223
+ "y2",
7224
+ "z",
7225
+ "zoomandpan"
7226
+ ]);
7227
+ const mathMl = freeze([
7228
+ "accent",
7229
+ "accentunder",
7230
+ "align",
7231
+ "bevelled",
7232
+ "close",
7233
+ "columnalign",
7234
+ "columnlines",
7235
+ "columnspacing",
7236
+ "columnspan",
7237
+ "denomalign",
7238
+ "depth",
7239
+ "dir",
7240
+ "display",
7241
+ "displaystyle",
7242
+ "encoding",
7243
+ "fence",
7244
+ "frame",
7245
+ "height",
7246
+ "href",
7247
+ "id",
7248
+ "largeop",
7249
+ "length",
7250
+ "linethickness",
7251
+ "lquote",
7252
+ "lspace",
7253
+ "mathbackground",
7254
+ "mathcolor",
7255
+ "mathsize",
7256
+ "mathvariant",
7257
+ "maxsize",
7258
+ "minsize",
7259
+ "movablelimits",
7260
+ "notation",
7261
+ "numalign",
7262
+ "open",
7263
+ "rowalign",
7264
+ "rowlines",
7265
+ "rowspacing",
7266
+ "rowspan",
7267
+ "rspace",
7268
+ "rquote",
7269
+ "scriptlevel",
7270
+ "scriptminsize",
7271
+ "scriptsizemultiplier",
7272
+ "selection",
7273
+ "separator",
7274
+ "separators",
7275
+ "stretchy",
7276
+ "subscriptshift",
7277
+ "supscriptshift",
7278
+ "symmetric",
7279
+ "voffset",
7280
+ "width",
7281
+ "xmlns"
7282
+ ]);
7283
+ const xml = freeze([
7284
+ "xlink:href",
7285
+ "xml:id",
7286
+ "xlink:title",
7287
+ "xml:space",
7288
+ "xmlns:xlink"
7289
+ ]);
7290
+ const MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm);
7291
+ const ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
7292
+ const TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm);
7293
+ const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/);
7294
+ const ARIA_ATTR = seal(/^aria-[\-\w]+$/);
7295
+ const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i);
7296
+ const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
7297
+ const ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g);
7298
+ const DOCTYPE_NAME = seal(/^html$/i);
7299
+ const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
7300
+ var EXPRESSIONS = /* @__PURE__ */ Object.freeze({
7301
+ __proto__: null,
7302
+ ARIA_ATTR,
7303
+ ATTR_WHITESPACE,
7304
+ CUSTOM_ELEMENT,
7305
+ DATA_ATTR,
7306
+ DOCTYPE_NAME,
7307
+ ERB_EXPR,
7308
+ IS_ALLOWED_URI,
7309
+ IS_SCRIPT_OR_DATA,
7310
+ MUSTACHE_EXPR,
7311
+ TMPLIT_EXPR
7312
+ });
7313
+ const NODE_TYPE = {
7314
+ element: 1,
7315
+ text: 3,
7316
+ progressingInstruction: 7,
7317
+ comment: 8,
7318
+ document: 9
7319
+ };
7320
+ const getGlobal = function getGlobal() {
7321
+ return typeof window === "undefined" ? null : window;
7322
+ };
7323
+ /**
7324
+ * Creates a no-op policy for internal use only.
7325
+ * Don't export this function outside this module!
7326
+ * @param trustedTypes The policy factory.
7327
+ * @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).
7328
+ * @return The policy created (or null, if Trusted Types
7329
+ * are not supported or creating the policy failed).
7330
+ */
7331
+ const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {
7332
+ if (typeof trustedTypes !== "object" || typeof trustedTypes.createPolicy !== "function") return null;
7333
+ let suffix = null;
7334
+ const ATTR_NAME = "data-tt-policy-suffix";
7335
+ if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) suffix = purifyHostElement.getAttribute(ATTR_NAME);
7336
+ const policyName = "dompurify" + (suffix ? "#" + suffix : "");
7337
+ try {
7338
+ return trustedTypes.createPolicy(policyName, {
7339
+ createHTML(html) {
7340
+ return html;
7341
+ },
7342
+ createScriptURL(scriptUrl) {
7343
+ return scriptUrl;
7344
+ }
7345
+ });
7346
+ } catch (_) {
7347
+ console.warn("TrustedTypes policy " + policyName + " could not be created.");
7348
+ return null;
7349
+ }
7350
+ };
7351
+ const _createHooksMap = function _createHooksMap() {
7352
+ return {
7353
+ afterSanitizeAttributes: [],
7354
+ afterSanitizeElements: [],
7355
+ afterSanitizeShadowDOM: [],
7356
+ beforeSanitizeAttributes: [],
7357
+ beforeSanitizeElements: [],
7358
+ beforeSanitizeShadowDOM: [],
7359
+ uponSanitizeAttribute: [],
7360
+ uponSanitizeElement: [],
7361
+ uponSanitizeShadowNode: []
7362
+ };
7363
+ };
7364
+ function createDOMPurify() {
7365
+ let window = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal();
7366
+ const DOMPurify = (root) => createDOMPurify(root);
7367
+ DOMPurify.version = "3.4.2";
7368
+ DOMPurify.removed = [];
7369
+ if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
7370
+ DOMPurify.isSupported = false;
7371
+ return DOMPurify;
7372
+ }
7373
+ let { document } = window;
7374
+ const originalDocument = document;
7375
+ const currentScript = originalDocument.currentScript;
7376
+ const { DocumentFragment, HTMLTemplateElement, Node, Element, NodeFilter, NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap, HTMLFormElement, DOMParser, trustedTypes } = window;
7377
+ const ElementPrototype = Element.prototype;
7378
+ const cloneNode = lookupGetter(ElementPrototype, "cloneNode");
7379
+ const remove = lookupGetter(ElementPrototype, "remove");
7380
+ const getNextSibling = lookupGetter(ElementPrototype, "nextSibling");
7381
+ const getChildNodes = lookupGetter(ElementPrototype, "childNodes");
7382
+ const getParentNode = lookupGetter(ElementPrototype, "parentNode");
7383
+ if (typeof HTMLTemplateElement === "function") {
7384
+ const template = document.createElement("template");
7385
+ if (template.content && template.content.ownerDocument) document = template.content.ownerDocument;
7386
+ }
7387
+ let trustedTypesPolicy;
7388
+ let emptyHTML = "";
7389
+ const { implementation, createNodeIterator, createDocumentFragment, getElementsByTagName } = document;
7390
+ const { importNode } = originalDocument;
7391
+ let hooks = _createHooksMap();
7392
+ /**
7393
+ * Expose whether this browser supports running the full DOMPurify.
7394
+ */
7395
+ DOMPurify.isSupported = typeof entries === "function" && typeof getParentNode === "function" && implementation && implementation.createHTMLDocument !== void 0;
7396
+ const { MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR, DATA_ATTR, ARIA_ATTR, IS_SCRIPT_OR_DATA, ATTR_WHITESPACE, CUSTOM_ELEMENT } = EXPRESSIONS;
7397
+ let { IS_ALLOWED_URI: IS_ALLOWED_URI$1 } = EXPRESSIONS;
7398
+ /**
7399
+ * We consider the elements and attributes below to be safe. Ideally
7400
+ * don't add any new ones but feel free to remove unwanted ones.
7401
+ */
7402
+ let ALLOWED_TAGS = null;
7403
+ const DEFAULT_ALLOWED_TAGS = addToSet({}, [
7404
+ ...html$1,
7405
+ ...svg$1,
7406
+ ...svgFilters,
7407
+ ...mathMl$1,
7408
+ ...text
7409
+ ]);
7410
+ let ALLOWED_ATTR = null;
7411
+ const DEFAULT_ALLOWED_ATTR = addToSet({}, [
7412
+ ...html,
7413
+ ...svg,
7414
+ ...mathMl,
7415
+ ...xml
7416
+ ]);
7417
+ let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {
7418
+ tagNameCheck: {
7419
+ writable: true,
7420
+ configurable: false,
7421
+ enumerable: true,
7422
+ value: null
7423
+ },
7424
+ attributeNameCheck: {
7425
+ writable: true,
7426
+ configurable: false,
7427
+ enumerable: true,
7428
+ value: null
7429
+ },
7430
+ allowCustomizedBuiltInElements: {
7431
+ writable: true,
7432
+ configurable: false,
7433
+ enumerable: true,
7434
+ value: false
7435
+ }
7436
+ }));
7437
+ let FORBID_TAGS = null;
7438
+ let FORBID_ATTR = null;
7439
+ const EXTRA_ELEMENT_HANDLING = Object.seal(create(null, {
7440
+ tagCheck: {
7441
+ writable: true,
7442
+ configurable: false,
7443
+ enumerable: true,
7444
+ value: null
7445
+ },
7446
+ attributeCheck: {
7447
+ writable: true,
7448
+ configurable: false,
7449
+ enumerable: true,
7450
+ value: null
7451
+ }
7452
+ }));
7453
+ let ALLOW_ARIA_ATTR = true;
7454
+ let ALLOW_DATA_ATTR = true;
7455
+ let ALLOW_UNKNOWN_PROTOCOLS = false;
7456
+ let ALLOW_SELF_CLOSE_IN_ATTR = true;
7457
+ let SAFE_FOR_TEMPLATES = false;
7458
+ let SAFE_FOR_XML = true;
7459
+ let WHOLE_DOCUMENT = false;
7460
+ let SET_CONFIG = false;
7461
+ let FORCE_BODY = false;
7462
+ let RETURN_DOM = false;
7463
+ let RETURN_DOM_FRAGMENT = false;
7464
+ let RETURN_TRUSTED_TYPE = false;
7465
+ let SANITIZE_DOM = true;
7466
+ let SANITIZE_NAMED_PROPS = false;
7467
+ const SANITIZE_NAMED_PROPS_PREFIX = "user-content-";
7468
+ let KEEP_CONTENT = true;
7469
+ let IN_PLACE = false;
7470
+ let USE_PROFILES = {};
7471
+ let FORBID_CONTENTS = null;
7472
+ const DEFAULT_FORBID_CONTENTS = addToSet({}, [
7473
+ "annotation-xml",
7474
+ "audio",
7475
+ "colgroup",
7476
+ "desc",
7477
+ "foreignobject",
7478
+ "head",
7479
+ "iframe",
7480
+ "math",
7481
+ "mi",
7482
+ "mn",
7483
+ "mo",
7484
+ "ms",
7485
+ "mtext",
7486
+ "noembed",
7487
+ "noframes",
7488
+ "noscript",
7489
+ "plaintext",
7490
+ "script",
7491
+ "style",
7492
+ "svg",
7493
+ "template",
7494
+ "thead",
7495
+ "title",
7496
+ "video",
7497
+ "xmp"
7498
+ ]);
7499
+ let DATA_URI_TAGS = null;
7500
+ const DEFAULT_DATA_URI_TAGS = addToSet({}, [
7501
+ "audio",
7502
+ "video",
7503
+ "img",
7504
+ "source",
7505
+ "image",
7506
+ "track"
7507
+ ]);
7508
+ let URI_SAFE_ATTRIBUTES = null;
7509
+ const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, [
7510
+ "alt",
7511
+ "class",
7512
+ "for",
7513
+ "id",
7514
+ "label",
7515
+ "name",
7516
+ "pattern",
7517
+ "placeholder",
7518
+ "role",
7519
+ "summary",
7520
+ "title",
7521
+ "value",
7522
+ "style",
7523
+ "xmlns"
7524
+ ]);
7525
+ const MATHML_NAMESPACE = "http://www.w3.org/1998/Math/MathML";
7526
+ const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
7527
+ const HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
7528
+ let NAMESPACE = HTML_NAMESPACE;
7529
+ let IS_EMPTY_INPUT = false;
7530
+ let ALLOWED_NAMESPACES = null;
7531
+ const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [
7532
+ MATHML_NAMESPACE,
7533
+ SVG_NAMESPACE,
7534
+ HTML_NAMESPACE
7535
+ ], stringToString);
7536
+ let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, [
7537
+ "mi",
7538
+ "mo",
7539
+ "mn",
7540
+ "ms",
7541
+ "mtext"
7542
+ ]);
7543
+ let HTML_INTEGRATION_POINTS = addToSet({}, ["annotation-xml"]);
7544
+ const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, [
7545
+ "title",
7546
+ "style",
7547
+ "font",
7548
+ "a",
7549
+ "script"
7550
+ ]);
7551
+ let PARSER_MEDIA_TYPE = null;
7552
+ const SUPPORTED_PARSER_MEDIA_TYPES = ["application/xhtml+xml", "text/html"];
7553
+ const DEFAULT_PARSER_MEDIA_TYPE = "text/html";
7554
+ let transformCaseFunc = null;
7555
+ let CONFIG = null;
7556
+ const formElement = document.createElement("form");
7557
+ const isRegexOrFunction = function isRegexOrFunction(testValue) {
7558
+ return testValue instanceof RegExp || testValue instanceof Function;
7559
+ };
7560
+ /**
7561
+ * _parseConfig
7562
+ *
7563
+ * @param cfg optional config literal
7564
+ */
7565
+ const _parseConfig = function _parseConfig() {
7566
+ let cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
7567
+ if (CONFIG && CONFIG === cfg) return;
7568
+ if (!cfg || typeof cfg !== "object") cfg = {};
7569
+ cfg = clone(cfg);
7570
+ PARSER_MEDIA_TYPE = SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;
7571
+ transformCaseFunc = PARSER_MEDIA_TYPE === "application/xhtml+xml" ? stringToString : stringToLowerCase;
7572
+ ALLOWED_TAGS = objectHasOwnProperty(cfg, "ALLOWED_TAGS") && arrayIsArray(cfg.ALLOWED_TAGS) ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;
7573
+ ALLOWED_ATTR = objectHasOwnProperty(cfg, "ALLOWED_ATTR") && arrayIsArray(cfg.ALLOWED_ATTR) ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;
7574
+ ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, "ALLOWED_NAMESPACES") && arrayIsArray(cfg.ALLOWED_NAMESPACES) ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;
7575
+ URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, "ADD_URI_SAFE_ATTR") && arrayIsArray(cfg.ADD_URI_SAFE_ATTR) ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR, transformCaseFunc) : DEFAULT_URI_SAFE_ATTRIBUTES;
7576
+ DATA_URI_TAGS = objectHasOwnProperty(cfg, "ADD_DATA_URI_TAGS") && arrayIsArray(cfg.ADD_DATA_URI_TAGS) ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS, transformCaseFunc) : DEFAULT_DATA_URI_TAGS;
7577
+ FORBID_CONTENTS = objectHasOwnProperty(cfg, "FORBID_CONTENTS") && arrayIsArray(cfg.FORBID_CONTENTS) ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;
7578
+ FORBID_TAGS = objectHasOwnProperty(cfg, "FORBID_TAGS") && arrayIsArray(cfg.FORBID_TAGS) ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : clone({});
7579
+ FORBID_ATTR = objectHasOwnProperty(cfg, "FORBID_ATTR") && arrayIsArray(cfg.FORBID_ATTR) ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : clone({});
7580
+ USE_PROFILES = objectHasOwnProperty(cfg, "USE_PROFILES") ? cfg.USE_PROFILES && typeof cfg.USE_PROFILES === "object" ? clone(cfg.USE_PROFILES) : cfg.USE_PROFILES : false;
7581
+ ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false;
7582
+ ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false;
7583
+ ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false;
7584
+ ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false;
7585
+ SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false;
7586
+ SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false;
7587
+ WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false;
7588
+ RETURN_DOM = cfg.RETURN_DOM || false;
7589
+ RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false;
7590
+ RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false;
7591
+ FORCE_BODY = cfg.FORCE_BODY || false;
7592
+ SANITIZE_DOM = cfg.SANITIZE_DOM !== false;
7593
+ SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false;
7594
+ KEEP_CONTENT = cfg.KEEP_CONTENT !== false;
7595
+ IN_PLACE = cfg.IN_PLACE || false;
7596
+ IS_ALLOWED_URI$1 = isRegex(cfg.ALLOWED_URI_REGEXP) ? cfg.ALLOWED_URI_REGEXP : IS_ALLOWED_URI;
7597
+ NAMESPACE = typeof cfg.NAMESPACE === "string" ? cfg.NAMESPACE : HTML_NAMESPACE;
7598
+ MATHML_TEXT_INTEGRATION_POINTS = objectHasOwnProperty(cfg, "MATHML_TEXT_INTEGRATION_POINTS") && cfg.MATHML_TEXT_INTEGRATION_POINTS && typeof cfg.MATHML_TEXT_INTEGRATION_POINTS === "object" ? clone(cfg.MATHML_TEXT_INTEGRATION_POINTS) : addToSet({}, [
7599
+ "mi",
7600
+ "mo",
7601
+ "mn",
7602
+ "ms",
7603
+ "mtext"
7604
+ ]);
7605
+ HTML_INTEGRATION_POINTS = objectHasOwnProperty(cfg, "HTML_INTEGRATION_POINTS") && cfg.HTML_INTEGRATION_POINTS && typeof cfg.HTML_INTEGRATION_POINTS === "object" ? clone(cfg.HTML_INTEGRATION_POINTS) : addToSet({}, ["annotation-xml"]);
7606
+ const customElementHandling = objectHasOwnProperty(cfg, "CUSTOM_ELEMENT_HANDLING") && cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING === "object" ? clone(cfg.CUSTOM_ELEMENT_HANDLING) : create(null);
7607
+ CUSTOM_ELEMENT_HANDLING = create(null);
7608
+ if (objectHasOwnProperty(customElementHandling, "tagNameCheck") && isRegexOrFunction(customElementHandling.tagNameCheck)) CUSTOM_ELEMENT_HANDLING.tagNameCheck = customElementHandling.tagNameCheck;
7609
+ if (objectHasOwnProperty(customElementHandling, "attributeNameCheck") && isRegexOrFunction(customElementHandling.attributeNameCheck)) CUSTOM_ELEMENT_HANDLING.attributeNameCheck = customElementHandling.attributeNameCheck;
7610
+ if (objectHasOwnProperty(customElementHandling, "allowCustomizedBuiltInElements") && typeof customElementHandling.allowCustomizedBuiltInElements === "boolean") CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = customElementHandling.allowCustomizedBuiltInElements;
7611
+ if (SAFE_FOR_TEMPLATES) ALLOW_DATA_ATTR = false;
7612
+ if (RETURN_DOM_FRAGMENT) RETURN_DOM = true;
7613
+ if (USE_PROFILES) {
7614
+ ALLOWED_TAGS = addToSet({}, text);
7615
+ ALLOWED_ATTR = create(null);
7616
+ if (USE_PROFILES.html === true) {
7617
+ addToSet(ALLOWED_TAGS, html$1);
7618
+ addToSet(ALLOWED_ATTR, html);
7619
+ }
7620
+ if (USE_PROFILES.svg === true) {
7621
+ addToSet(ALLOWED_TAGS, svg$1);
7622
+ addToSet(ALLOWED_ATTR, svg);
7623
+ addToSet(ALLOWED_ATTR, xml);
7624
+ }
7625
+ if (USE_PROFILES.svgFilters === true) {
7626
+ addToSet(ALLOWED_TAGS, svgFilters);
7627
+ addToSet(ALLOWED_ATTR, svg);
7628
+ addToSet(ALLOWED_ATTR, xml);
7629
+ }
7630
+ if (USE_PROFILES.mathMl === true) {
7631
+ addToSet(ALLOWED_TAGS, mathMl$1);
7632
+ addToSet(ALLOWED_ATTR, mathMl);
7633
+ addToSet(ALLOWED_ATTR, xml);
7634
+ }
7635
+ }
7636
+ EXTRA_ELEMENT_HANDLING.tagCheck = null;
7637
+ EXTRA_ELEMENT_HANDLING.attributeCheck = null;
7638
+ if (objectHasOwnProperty(cfg, "ADD_TAGS")) {
7639
+ if (typeof cfg.ADD_TAGS === "function") EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS;
7640
+ else if (arrayIsArray(cfg.ADD_TAGS)) {
7641
+ if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) ALLOWED_TAGS = clone(ALLOWED_TAGS);
7642
+ addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
7643
+ }
7644
+ }
7645
+ if (objectHasOwnProperty(cfg, "ADD_ATTR")) {
7646
+ if (typeof cfg.ADD_ATTR === "function") EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR;
7647
+ else if (arrayIsArray(cfg.ADD_ATTR)) {
7648
+ if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) ALLOWED_ATTR = clone(ALLOWED_ATTR);
7649
+ addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
7650
+ }
7651
+ }
7652
+ if (objectHasOwnProperty(cfg, "ADD_URI_SAFE_ATTR") && arrayIsArray(cfg.ADD_URI_SAFE_ATTR)) addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);
7653
+ if (objectHasOwnProperty(cfg, "FORBID_CONTENTS") && arrayIsArray(cfg.FORBID_CONTENTS)) {
7654
+ if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) FORBID_CONTENTS = clone(FORBID_CONTENTS);
7655
+ addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
7656
+ }
7657
+ if (objectHasOwnProperty(cfg, "ADD_FORBID_CONTENTS") && arrayIsArray(cfg.ADD_FORBID_CONTENTS)) {
7658
+ if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) FORBID_CONTENTS = clone(FORBID_CONTENTS);
7659
+ addToSet(FORBID_CONTENTS, cfg.ADD_FORBID_CONTENTS, transformCaseFunc);
7660
+ }
7661
+ if (KEEP_CONTENT) ALLOWED_TAGS["#text"] = true;
7662
+ if (WHOLE_DOCUMENT) addToSet(ALLOWED_TAGS, [
7663
+ "html",
7664
+ "head",
7665
+ "body"
7666
+ ]);
7667
+ if (ALLOWED_TAGS.table) {
7668
+ addToSet(ALLOWED_TAGS, ["tbody"]);
7669
+ delete FORBID_TAGS.tbody;
7670
+ }
7671
+ if (cfg.TRUSTED_TYPES_POLICY) {
7672
+ if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== "function") throw typeErrorCreate("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
7673
+ if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== "function") throw typeErrorCreate("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
7674
+ trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
7675
+ emptyHTML = trustedTypesPolicy.createHTML("");
7676
+ } else {
7677
+ if (trustedTypesPolicy === void 0) trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
7678
+ if (trustedTypesPolicy !== null && typeof emptyHTML === "string") emptyHTML = trustedTypesPolicy.createHTML("");
7679
+ }
7680
+ if (freeze) freeze(cfg);
7681
+ CONFIG = cfg;
7682
+ };
7683
+ const ALL_SVG_TAGS = addToSet({}, [
7684
+ ...svg$1,
7685
+ ...svgFilters,
7686
+ ...svgDisallowed
7687
+ ]);
7688
+ const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
7689
+ /**
7690
+ * @param element a DOM element whose namespace is being checked
7691
+ * @returns Return false if the element has a
7692
+ * namespace that a spec-compliant parser would never
7693
+ * return. Return true otherwise.
7694
+ */
7695
+ const _checkValidNamespace = function _checkValidNamespace(element) {
7696
+ let parent = getParentNode(element);
7697
+ if (!parent || !parent.tagName) parent = {
7698
+ namespaceURI: NAMESPACE,
7699
+ tagName: "template"
7700
+ };
7701
+ const tagName = stringToLowerCase(element.tagName);
7702
+ const parentTagName = stringToLowerCase(parent.tagName);
7703
+ if (!ALLOWED_NAMESPACES[element.namespaceURI]) return false;
7704
+ if (element.namespaceURI === SVG_NAMESPACE) {
7705
+ if (parent.namespaceURI === HTML_NAMESPACE) return tagName === "svg";
7706
+ if (parent.namespaceURI === MATHML_NAMESPACE) return tagName === "svg" && (parentTagName === "annotation-xml" || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
7707
+ return Boolean(ALL_SVG_TAGS[tagName]);
7708
+ }
7709
+ if (element.namespaceURI === MATHML_NAMESPACE) {
7710
+ if (parent.namespaceURI === HTML_NAMESPACE) return tagName === "math";
7711
+ if (parent.namespaceURI === SVG_NAMESPACE) return tagName === "math" && HTML_INTEGRATION_POINTS[parentTagName];
7712
+ return Boolean(ALL_MATHML_TAGS[tagName]);
7713
+ }
7714
+ if (element.namespaceURI === HTML_NAMESPACE) {
7715
+ if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) return false;
7716
+ if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) return false;
7717
+ return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
7718
+ }
7719
+ if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && ALLOWED_NAMESPACES[element.namespaceURI]) return true;
7720
+ return false;
7721
+ };
7722
+ /**
7723
+ * _forceRemove
7724
+ *
7725
+ * @param node a DOM node
7726
+ */
7727
+ const _forceRemove = function _forceRemove(node) {
7728
+ arrayPush(DOMPurify.removed, { element: node });
7729
+ try {
7730
+ getParentNode(node).removeChild(node);
7731
+ } catch (_) {
7732
+ remove(node);
7733
+ }
7734
+ };
7735
+ /**
7736
+ * _removeAttribute
7737
+ *
7738
+ * @param name an Attribute name
7739
+ * @param element a DOM node
7740
+ */
7741
+ const _removeAttribute = function _removeAttribute(name, element) {
7742
+ try {
7743
+ arrayPush(DOMPurify.removed, {
7744
+ attribute: element.getAttributeNode(name),
7745
+ from: element
7746
+ });
7747
+ } catch (_) {
7748
+ arrayPush(DOMPurify.removed, {
7749
+ attribute: null,
7750
+ from: element
7751
+ });
7752
+ }
7753
+ element.removeAttribute(name);
7754
+ if (name === "is") if (RETURN_DOM || RETURN_DOM_FRAGMENT) try {
7755
+ _forceRemove(element);
7756
+ } catch (_) {}
7757
+ else try {
7758
+ element.setAttribute(name, "");
7759
+ } catch (_) {}
7760
+ };
7761
+ /**
7762
+ * _initDocument
7763
+ *
7764
+ * @param dirty - a string of dirty markup
7765
+ * @return a DOM, filled with the dirty markup
7766
+ */
7767
+ const _initDocument = function _initDocument(dirty) {
7768
+ let doc = null;
7769
+ let leadingWhitespace = null;
7770
+ if (FORCE_BODY) dirty = "<remove></remove>" + dirty;
7771
+ else {
7772
+ const matches = stringMatch(dirty, /^[\r\n\t ]+/);
7773
+ leadingWhitespace = matches && matches[0];
7774
+ }
7775
+ if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && NAMESPACE === HTML_NAMESPACE) dirty = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + dirty + "</body></html>";
7776
+ const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;
7777
+ if (NAMESPACE === HTML_NAMESPACE) try {
7778
+ doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
7779
+ } catch (_) {}
7780
+ if (!doc || !doc.documentElement) {
7781
+ doc = implementation.createDocument(NAMESPACE, "template", null);
7782
+ try {
7783
+ doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;
7784
+ } catch (_) {}
7785
+ }
7786
+ const body = doc.body || doc.documentElement;
7787
+ if (dirty && leadingWhitespace) body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);
7788
+ if (NAMESPACE === HTML_NAMESPACE) return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? "html" : "body")[0];
7789
+ return WHOLE_DOCUMENT ? doc.documentElement : body;
7790
+ };
7791
+ /**
7792
+ * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.
7793
+ *
7794
+ * @param root The root element or node to start traversing on.
7795
+ * @return The created NodeIterator
7796
+ */
7797
+ const _createNodeIterator = function _createNodeIterator(root) {
7798
+ return createNodeIterator.call(root.ownerDocument || root, root, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);
7799
+ };
7800
+ /**
7801
+ * _isClobbered
7802
+ *
7803
+ * @param element element to check for clobbering attacks
7804
+ * @return true if clobbered, false if safe
7805
+ */
7806
+ const _isClobbered = function _isClobbered(element) {
7807
+ return element instanceof HTMLFormElement && (typeof element.nodeName !== "string" || typeof element.textContent !== "string" || typeof element.removeChild !== "function" || !(element.attributes instanceof NamedNodeMap) || typeof element.removeAttribute !== "function" || typeof element.setAttribute !== "function" || typeof element.namespaceURI !== "string" || typeof element.insertBefore !== "function" || typeof element.hasChildNodes !== "function");
7808
+ };
7809
+ /**
7810
+ * Checks whether the given object is a DOM node.
7811
+ *
7812
+ * @param value object to check whether it's a DOM node
7813
+ * @return true is object is a DOM node
7814
+ */
7815
+ const _isNode = function _isNode(value) {
7816
+ return typeof Node === "function" && value instanceof Node;
7817
+ };
7818
+ function _executeHooks(hooks, currentNode, data) {
7819
+ arrayForEach(hooks, (hook) => {
7820
+ hook.call(DOMPurify, currentNode, data, CONFIG);
7821
+ });
7822
+ }
7823
+ /**
7824
+ * _sanitizeElements
7825
+ *
7826
+ * @protect nodeName
7827
+ * @protect textContent
7828
+ * @protect removeChild
7829
+ * @param currentNode to check for permission to exist
7830
+ * @return true if node was killed, false if left alive
7831
+ */
7832
+ const _sanitizeElements = function _sanitizeElements(currentNode) {
7833
+ let content = null;
7834
+ _executeHooks(hooks.beforeSanitizeElements, currentNode, null);
7835
+ if (_isClobbered(currentNode)) {
7836
+ _forceRemove(currentNode);
7837
+ return true;
7838
+ }
7839
+ const tagName = transformCaseFunc(currentNode.nodeName);
7840
+ _executeHooks(hooks.uponSanitizeElement, currentNode, {
7841
+ tagName,
7842
+ allowedTags: ALLOWED_TAGS
7843
+ });
7844
+ if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w!]/g, currentNode.innerHTML) && regExpTest(/<[/\w!]/g, currentNode.textContent)) {
7845
+ _forceRemove(currentNode);
7846
+ return true;
7847
+ }
7848
+ if (SAFE_FOR_XML && currentNode.namespaceURI === HTML_NAMESPACE && tagName === "style" && _isNode(currentNode.firstElementChild)) {
7849
+ _forceRemove(currentNode);
7850
+ return true;
7851
+ }
7852
+ if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {
7853
+ _forceRemove(currentNode);
7854
+ return true;
7855
+ }
7856
+ if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) {
7857
+ _forceRemove(currentNode);
7858
+ return true;
7859
+ }
7860
+ if (FORBID_TAGS[tagName] || !(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && !ALLOWED_TAGS[tagName]) {
7861
+ if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {
7862
+ if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) return false;
7863
+ if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) return false;
7864
+ }
7865
+ if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
7866
+ const parentNode = getParentNode(currentNode) || currentNode.parentNode;
7867
+ const childNodes = getChildNodes(currentNode) || currentNode.childNodes;
7868
+ if (childNodes && parentNode) {
7869
+ const childCount = childNodes.length;
7870
+ for (let i = childCount - 1; i >= 0; --i) {
7871
+ const childClone = cloneNode(childNodes[i], true);
7872
+ parentNode.insertBefore(childClone, getNextSibling(currentNode));
7873
+ }
7874
+ }
7875
+ }
7876
+ _forceRemove(currentNode);
7877
+ return true;
7878
+ }
7879
+ if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {
7880
+ _forceRemove(currentNode);
7881
+ return true;
7882
+ }
7883
+ if ((tagName === "noscript" || tagName === "noembed" || tagName === "noframes") && regExpTest(/<\/no(script|embed|frames)/i, currentNode.innerHTML)) {
7884
+ _forceRemove(currentNode);
7885
+ return true;
7886
+ }
7887
+ if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
7888
+ content = currentNode.textContent;
7889
+ arrayForEach([
7890
+ MUSTACHE_EXPR,
7891
+ ERB_EXPR,
7892
+ TMPLIT_EXPR
7893
+ ], (expr) => {
7894
+ content = stringReplace(content, expr, " ");
7895
+ });
7896
+ if (currentNode.textContent !== content) {
7897
+ arrayPush(DOMPurify.removed, { element: currentNode.cloneNode() });
7898
+ currentNode.textContent = content;
7899
+ }
7900
+ }
7901
+ _executeHooks(hooks.afterSanitizeElements, currentNode, null);
7902
+ return false;
7903
+ };
7904
+ /**
7905
+ * _isValidAttribute
7906
+ *
7907
+ * @param lcTag Lowercase tag name of containing element.
7908
+ * @param lcName Lowercase attribute name.
7909
+ * @param value Attribute value.
7910
+ * @return Returns true if `value` is valid, otherwise false.
7911
+ */
7912
+ const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {
7913
+ if (FORBID_ATTR[lcName]) return false;
7914
+ if (SANITIZE_DOM && (lcName === "id" || lcName === "name") && (value in document || value in formElement)) return false;
7915
+ const nameIsPermitted = ALLOWED_ATTR[lcName] || EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function && EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag);
7916
+ if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName));
7917
+ else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName));
7918
+ else if (!nameIsPermitted || FORBID_ATTR[lcName]) if (_isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName, lcTag)) || lcName === "is" && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value)));
7919
+ else return false;
7920
+ else if (URI_SAFE_ATTRIBUTES[lcName]);
7921
+ else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, "")));
7922
+ else if ((lcName === "src" || lcName === "xlink:href" || lcName === "href") && lcTag !== "script" && stringIndexOf(value, "data:") === 0 && DATA_URI_TAGS[lcTag]);
7923
+ else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, "")));
7924
+ else if (value) return false;
7925
+ return true;
7926
+ };
7927
+ const RESERVED_CUSTOM_ELEMENT_NAMES = addToSet({}, [
7928
+ "annotation-xml",
7929
+ "color-profile",
7930
+ "font-face",
7931
+ "font-face-format",
7932
+ "font-face-name",
7933
+ "font-face-src",
7934
+ "font-face-uri",
7935
+ "missing-glyph"
7936
+ ]);
7937
+ /**
7938
+ * _isBasicCustomElement
7939
+ * checks if at least one dash is included in tagName, and it's not the first char
7940
+ * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name
7941
+ *
7942
+ * @param tagName name of the tag of the node to sanitize
7943
+ * @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.
7944
+ */
7945
+ const _isBasicCustomElement = function _isBasicCustomElement(tagName) {
7946
+ return !RESERVED_CUSTOM_ELEMENT_NAMES[stringToLowerCase(tagName)] && regExpTest(CUSTOM_ELEMENT, tagName);
7947
+ };
7948
+ /**
7949
+ * _sanitizeAttributes
7950
+ *
7951
+ * @protect attributes
7952
+ * @protect nodeName
7953
+ * @protect removeAttribute
7954
+ * @protect setAttribute
7955
+ *
7956
+ * @param currentNode to sanitize
7957
+ */
7958
+ const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {
7959
+ _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);
7960
+ const { attributes } = currentNode;
7961
+ if (!attributes || _isClobbered(currentNode)) return;
7962
+ const hookEvent = {
7963
+ attrName: "",
7964
+ attrValue: "",
7965
+ keepAttr: true,
7966
+ allowedAttributes: ALLOWED_ATTR,
7967
+ forceKeepAttr: void 0
7968
+ };
7969
+ let l = attributes.length;
7970
+ while (l--) {
7971
+ const { name, namespaceURI, value: attrValue } = attributes[l];
7972
+ const lcName = transformCaseFunc(name);
7973
+ const initValue = attrValue;
7974
+ let value = name === "value" ? initValue : stringTrim(initValue);
7975
+ hookEvent.attrName = lcName;
7976
+ hookEvent.attrValue = value;
7977
+ hookEvent.keepAttr = true;
7978
+ hookEvent.forceKeepAttr = void 0;
7979
+ _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);
7980
+ value = hookEvent.attrValue;
7981
+ if (SANITIZE_NAMED_PROPS && (lcName === "id" || lcName === "name") && stringIndexOf(value, SANITIZE_NAMED_PROPS_PREFIX) !== 0) {
7982
+ _removeAttribute(name, currentNode);
7983
+ value = SANITIZE_NAMED_PROPS_PREFIX + value;
7984
+ }
7985
+ if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, value)) {
7986
+ _removeAttribute(name, currentNode);
7987
+ continue;
7988
+ }
7989
+ if (lcName === "attributename" && stringMatch(value, "href")) {
7990
+ _removeAttribute(name, currentNode);
7991
+ continue;
7992
+ }
7993
+ if (hookEvent.forceKeepAttr) continue;
7994
+ if (!hookEvent.keepAttr) {
7995
+ _removeAttribute(name, currentNode);
7996
+ continue;
7997
+ }
7998
+ if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value)) {
7999
+ _removeAttribute(name, currentNode);
8000
+ continue;
8001
+ }
8002
+ if (SAFE_FOR_TEMPLATES) arrayForEach([
8003
+ MUSTACHE_EXPR,
8004
+ ERB_EXPR,
8005
+ TMPLIT_EXPR
8006
+ ], (expr) => {
8007
+ value = stringReplace(value, expr, " ");
8008
+ });
8009
+ const lcTag = transformCaseFunc(currentNode.nodeName);
8010
+ if (!_isValidAttribute(lcTag, lcName, value)) {
8011
+ _removeAttribute(name, currentNode);
8012
+ continue;
8013
+ }
8014
+ if (trustedTypesPolicy && typeof trustedTypes === "object" && typeof trustedTypes.getAttributeType === "function") if (namespaceURI);
8015
+ else switch (trustedTypes.getAttributeType(lcTag, lcName)) {
8016
+ case "TrustedHTML":
8017
+ value = trustedTypesPolicy.createHTML(value);
8018
+ break;
8019
+ case "TrustedScriptURL":
8020
+ value = trustedTypesPolicy.createScriptURL(value);
8021
+ break;
8022
+ }
8023
+ if (value !== initValue) try {
8024
+ if (namespaceURI) currentNode.setAttributeNS(namespaceURI, name, value);
8025
+ else currentNode.setAttribute(name, value);
8026
+ if (_isClobbered(currentNode)) _forceRemove(currentNode);
8027
+ else arrayPop(DOMPurify.removed);
8028
+ } catch (_) {
8029
+ _removeAttribute(name, currentNode);
8030
+ }
8031
+ }
8032
+ _executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
8033
+ };
8034
+ /**
8035
+ * _sanitizeShadowDOM
8036
+ *
8037
+ * @param fragment to iterate over recursively
8038
+ */
8039
+ const _sanitizeShadowDOM2 = function _sanitizeShadowDOM(fragment) {
8040
+ let shadowNode = null;
8041
+ const shadowIterator = _createNodeIterator(fragment);
8042
+ _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);
8043
+ while (shadowNode = shadowIterator.nextNode()) {
8044
+ _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);
8045
+ _sanitizeElements(shadowNode);
8046
+ _sanitizeAttributes(shadowNode);
8047
+ if (shadowNode.content instanceof DocumentFragment) _sanitizeShadowDOM2(shadowNode.content);
8048
+ }
8049
+ _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);
8050
+ };
8051
+ DOMPurify.sanitize = function(dirty) {
8052
+ let cfg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
8053
+ let body = null;
8054
+ let importedNode = null;
8055
+ let currentNode = null;
8056
+ let returnNode = null;
8057
+ IS_EMPTY_INPUT = !dirty;
8058
+ if (IS_EMPTY_INPUT) dirty = "<!-->";
8059
+ if (typeof dirty !== "string" && !_isNode(dirty)) {
8060
+ dirty = stringifyValue(dirty);
8061
+ if (typeof dirty !== "string") throw typeErrorCreate("dirty is not a string, aborting");
8062
+ }
8063
+ if (!DOMPurify.isSupported) return dirty;
8064
+ if (!SET_CONFIG) _parseConfig(cfg);
8065
+ DOMPurify.removed = [];
8066
+ if (typeof dirty === "string") IN_PLACE = false;
8067
+ if (IN_PLACE) {
8068
+ const nn = dirty.nodeName;
8069
+ if (typeof nn === "string") {
8070
+ const tagName = transformCaseFunc(nn);
8071
+ if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place");
8072
+ }
8073
+ } else if (dirty instanceof Node) {
8074
+ body = _initDocument("<!---->");
8075
+ importedNode = body.ownerDocument.importNode(dirty, true);
8076
+ if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === "BODY") body = importedNode;
8077
+ else if (importedNode.nodeName === "HTML") body = importedNode;
8078
+ else body.appendChild(importedNode);
8079
+ } else {
8080
+ if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && dirty.indexOf("<") === -1) return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;
8081
+ body = _initDocument(dirty);
8082
+ if (!body) return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : "";
8083
+ }
8084
+ if (body && FORCE_BODY) _forceRemove(body.firstChild);
8085
+ const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);
8086
+ while (currentNode = nodeIterator.nextNode()) {
8087
+ _sanitizeElements(currentNode);
8088
+ _sanitizeAttributes(currentNode);
8089
+ if (currentNode.content instanceof DocumentFragment) _sanitizeShadowDOM2(currentNode.content);
8090
+ }
8091
+ if (IN_PLACE) return dirty;
8092
+ if (RETURN_DOM) {
8093
+ if (SAFE_FOR_TEMPLATES) {
8094
+ body.normalize();
8095
+ let html = body.innerHTML;
8096
+ arrayForEach([
8097
+ MUSTACHE_EXPR,
8098
+ ERB_EXPR,
8099
+ TMPLIT_EXPR
8100
+ ], (expr) => {
8101
+ html = stringReplace(html, expr, " ");
8102
+ });
8103
+ body.innerHTML = html;
8104
+ }
8105
+ if (RETURN_DOM_FRAGMENT) {
8106
+ returnNode = createDocumentFragment.call(body.ownerDocument);
8107
+ while (body.firstChild) returnNode.appendChild(body.firstChild);
8108
+ } else returnNode = body;
8109
+ if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) returnNode = importNode.call(originalDocument, returnNode, true);
8110
+ return returnNode;
8111
+ }
8112
+ let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
8113
+ if (WHOLE_DOCUMENT && ALLOWED_TAGS["!doctype"] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) serializedHTML = "<!DOCTYPE " + body.ownerDocument.doctype.name + ">\n" + serializedHTML;
8114
+ if (SAFE_FOR_TEMPLATES) arrayForEach([
8115
+ MUSTACHE_EXPR,
8116
+ ERB_EXPR,
8117
+ TMPLIT_EXPR
8118
+ ], (expr) => {
8119
+ serializedHTML = stringReplace(serializedHTML, expr, " ");
8120
+ });
8121
+ return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;
8122
+ };
8123
+ DOMPurify.setConfig = function() {
8124
+ _parseConfig(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {});
8125
+ SET_CONFIG = true;
8126
+ };
8127
+ DOMPurify.clearConfig = function() {
8128
+ CONFIG = null;
8129
+ SET_CONFIG = false;
8130
+ };
8131
+ DOMPurify.isValidAttribute = function(tag, attr, value) {
8132
+ if (!CONFIG) _parseConfig({});
8133
+ return _isValidAttribute(transformCaseFunc(tag), transformCaseFunc(attr), value);
8134
+ };
8135
+ DOMPurify.addHook = function(entryPoint, hookFunction) {
8136
+ if (typeof hookFunction !== "function") return;
8137
+ arrayPush(hooks[entryPoint], hookFunction);
8138
+ };
8139
+ DOMPurify.removeHook = function(entryPoint, hookFunction) {
8140
+ if (hookFunction !== void 0) {
8141
+ const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);
8142
+ return index === -1 ? void 0 : arraySplice(hooks[entryPoint], index, 1)[0];
8143
+ }
8144
+ return arrayPop(hooks[entryPoint]);
8145
+ };
8146
+ DOMPurify.removeHooks = function(entryPoint) {
8147
+ hooks[entryPoint] = [];
8148
+ };
8149
+ DOMPurify.removeAllHooks = function() {
8150
+ hooks = _createHooksMap();
8151
+ };
8152
+ return DOMPurify;
8153
+ }
8154
+ var purify = createDOMPurify();
6198
8155
  //#endregion
6199
8156
  //#region src/components/base/markdown/markdown.vue
6200
8157
  const _hoisted_1$32 = {
@@ -6259,7 +8216,8 @@ var markdown_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ def
6259
8216
  const renderedHtml = computed(() => {
6260
8217
  if (!localValue.value) return "";
6261
8218
  try {
6262
- return marked.parse(localValue.value);
8219
+ const html = marked.parse(localValue.value);
8220
+ return purify.sanitize(html);
6263
8221
  } catch (e) {
6264
8222
  console.error("Markdown parse error:", e);
6265
8223
  return localValue.value;
@@ -6338,7 +8296,7 @@ var markdown_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ def
6338
8296
  ], 2);
6339
8297
  };
6340
8298
  }
6341
- }), [["__scopeId", "data-v-068d968a"]]);
8299
+ }), [["__scopeId", "data-v-2a88fddd"]]);
6342
8300
  //#endregion
6343
8301
  //#region src/components/base/chat-page/chat-page.vue
6344
8302
  const _hoisted_1$31 = { class: "yd-chat-page__header" };
@@ -6356,14 +8314,14 @@ const _hoisted_9$7 = { class: "yd-chat-page__sidebar-header" };
6356
8314
  const _hoisted_10$7 = { class: "yd-chat-page__conversation-list" };
6357
8315
  const _hoisted_11$7 = ["onClick"];
6358
8316
  const _hoisted_12$4 = { class: "yd-chat-page__conv-info" };
6359
- const _hoisted_13$3 = { class: "yd-chat-page__conv-title" };
6360
- const _hoisted_14$2 = ["onClick"];
6361
- const _hoisted_15$2 = { class: "yd-chat-page__content" };
6362
- const _hoisted_16$2 = {
8317
+ const _hoisted_13$4 = { class: "yd-chat-page__conv-title" };
8318
+ const _hoisted_14$3 = ["onClick"];
8319
+ const _hoisted_15$3 = { class: "yd-chat-page__content" };
8320
+ const _hoisted_16$3 = {
6363
8321
  key: 0,
6364
8322
  class: "yd-chat-page__welcome"
6365
8323
  };
6366
- const _hoisted_17$1 = { class: "yd-chat-page__welcome-suggestions" };
8324
+ const _hoisted_17$2 = { class: "yd-chat-page__welcome-suggestions" };
6367
8325
  const _hoisted_18$1 = {
6368
8326
  key: 0,
6369
8327
  class: "yd-chat-page__message-avatar"
@@ -6373,7 +8331,7 @@ const _hoisted_20$1 = {
6373
8331
  key: 0,
6374
8332
  class: "yd-chat-page__reasoning"
6375
8333
  };
6376
- const _hoisted_21 = { class: "yd-chat-page__reasoning-content" };
8334
+ const _hoisted_21$1 = { class: "yd-chat-page__reasoning-content" };
6377
8335
  const _hoisted_22 = { class: "yd-chat-page__message-bubble" };
6378
8336
  const _hoisted_23 = { class: "yd-chat-page__message-actions" };
6379
8337
  const _hoisted_24 = ["onClick", "title"];
@@ -6575,7 +8533,7 @@ var chat_page_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ de
6575
8533
  width: "18",
6576
8534
  height: "18"
6577
8535
  }, [createElementVNode("path", { d: "M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z" })])], -1)),
6578
- createElementVNode("div", _hoisted_12$4, [createElementVNode("div", _hoisted_13$3, toDisplayString(conv.title), 1)]),
8536
+ createElementVNode("div", _hoisted_12$4, [createElementVNode("div", _hoisted_13$4, toDisplayString(conv.title), 1)]),
6579
8537
  createElementVNode("button", {
6580
8538
  class: "yd-chat-page__conv-delete",
6581
8539
  onClick: ($event) => handleDeleteConversation(conv.id, $event)
@@ -6584,11 +8542,11 @@ var chat_page_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ de
6584
8542
  fill: "currentColor",
6585
8543
  width: "14",
6586
8544
  height: "14"
6587
- }, [createElementVNode("path", { d: "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z" })], -1)])], 8, _hoisted_14$2)
8545
+ }, [createElementVNode("path", { d: "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z" })], -1)])], 8, _hoisted_14$3)
6588
8546
  ], 10, _hoisted_11$7);
6589
8547
  }), 128))])], 4)) : createCommentVNode("v-if", true),
6590
8548
  createCommentVNode(" Chat Area "),
6591
- createElementVNode("main", _hoisted_15$2, [
8549
+ createElementVNode("main", _hoisted_15$3, [
6592
8550
  createCommentVNode(" Messages "),
6593
8551
  createElementVNode("div", {
6594
8552
  ref_key: "conversationRef",
@@ -6596,7 +8554,7 @@ var chat_page_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ de
6596
8554
  class: "yd-chat-page__messages"
6597
8555
  }, [
6598
8556
  createCommentVNode(" Welcome Screen "),
6599
- allMessages.value.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_16$2, [
8557
+ allMessages.value.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_16$3, [
6600
8558
  _cache[20] || (_cache[20] = createElementVNode("div", { class: "yd-chat-page__welcome-icon" }, [createElementVNode("svg", {
6601
8559
  viewBox: "0 0 24 24",
6602
8560
  fill: "currentColor",
@@ -6604,7 +8562,7 @@ var chat_page_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ de
6604
8562
  height: "64"
6605
8563
  }, [createElementVNode("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" })])], -1)),
6606
8564
  _cache[21] || (_cache[21] = createElementVNode("h2", { class: "yd-chat-page__welcome-title" }, "How can I help you today?", -1)),
6607
- createElementVNode("div", _hoisted_17$1, [
8565
+ createElementVNode("div", _hoisted_17$2, [
6608
8566
  createVNode(button_default, { onClick: _cache[3] || (_cache[3] = ($event) => handleSend("Help me write a poem", [])) }, {
6609
8567
  default: withCtx(() => [..._cache[17] || (_cache[17] = [createTextVNode("Help me write a poem", -1)])]),
6610
8568
  _: 1
@@ -6637,7 +8595,7 @@ var chat_page_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ de
6637
8595
  fill: "currentColor",
6638
8596
  width: "14",
6639
8597
  height: "14"
6640
- }, [createElementVNode("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm0-4h-2V7h2v8z" })]), createElementVNode("span", null, "思考中")], -1)), createElementVNode("div", _hoisted_21, toDisplayString(msg.reasoning), 1)])) : createCommentVNode("v-if", true),
8598
+ }, [createElementVNode("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm0-4h-2V7h2v8z" })]), createElementVNode("span", null, "思考中")], -1)), createElementVNode("div", _hoisted_21$1, toDisplayString(msg.reasoning), 1)])) : createCommentVNode("v-if", true),
6641
8599
  createCommentVNode(" Message Content with Markdown "),
6642
8600
  createElementVNode("div", _hoisted_22, [
6643
8601
  createVNode(markdown_default, {
@@ -8643,10 +10601,10 @@ const _hoisted_10$3 = {
8643
10601
  };
8644
10602
  const _hoisted_11$3 = ["src", "alt"];
8645
10603
  const _hoisted_12$3 = ["onMouseenter", "onMouseleave"];
8646
- const _hoisted_13$2 = ["data-many"];
8647
- const _hoisted_14$1 = ["onClick"];
8648
- const _hoisted_15$1 = ["onClick"];
8649
- const _hoisted_16$1 = ["onClick"];
10604
+ const _hoisted_13$3 = ["data-many"];
10605
+ const _hoisted_14$2 = ["onClick"];
10606
+ const _hoisted_15$2 = ["onClick"];
10607
+ const _hoisted_16$2 = ["onClick"];
8650
10608
  var menu_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
8651
10609
  name: "YdMenu",
8652
10610
  __name: "menu",
@@ -9048,8 +11006,8 @@ var menu_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineC
9048
11006
  key: 1,
9049
11007
  class: normalizeClass([e("badge"), e(`badge--${sub.badgeType || "primary"}`)])
9050
11008
  }, toDisplayString(sub.badge), 3)) : createCommentVNode("v-if", true)
9051
- ], 10, _hoisted_14$1);
9052
- }), 128))], 10, _hoisted_13$2)], 2)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createCommentVNode(" Level 2 item (standalone) "), createElementVNode("div", {
11009
+ ], 10, _hoisted_14$2);
11010
+ }), 128))], 10, _hoisted_13$3)], 2)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createCommentVNode(" Level 2 item (standalone) "), createElementVNode("div", {
9053
11011
  class: normalizeClass(e("dropdown-group")),
9054
11012
  onClick: ($event) => handleSelect(child)
9055
11013
  }, [createElementVNode("div", { class: normalizeClass([e("dropdown-item"), {
@@ -9065,7 +11023,7 @@ var menu_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineC
9065
11023
  key: 1,
9066
11024
  class: normalizeClass([e("badge"), e(`badge--${child.badgeType || "primary"}`)])
9067
11025
  }, toDisplayString(child.badge), 3)) : createCommentVNode("v-if", true)
9068
- ], 2)], 10, _hoisted_15$1)], 2112))], 64);
11026
+ ], 2)], 10, _hoisted_15$2)], 2112))], 64);
9069
11027
  }), 128))], 2)], 46, _hoisted_12$3)) : createCommentVNode("v-if", true)]),
9070
11028
  _: 2
9071
11029
  }, 1024)]))], 2112))
@@ -9078,7 +11036,7 @@ var menu_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineC
9078
11036
  }, [item.icon ? (openBlock(), createElementBlock("span", {
9079
11037
  key: 0,
9080
11038
  class: normalizeClass(e("icon"))
9081
- }, toDisplayString(item.icon), 3)) : createCommentVNode("v-if", true), createElementVNode("span", { class: normalizeClass(e("label")) }, toDisplayString(item.label), 3)], 10, _hoisted_16$1)], 2112))], 64);
11039
+ }, toDisplayString(item.icon), 3)) : createCommentVNode("v-if", true), createElementVNode("span", { class: normalizeClass(e("label")) }, toDisplayString(item.label), 3)], 10, _hoisted_16$2)], 2112))], 64);
9082
11040
  }), 128))], 10, _hoisted_1$22);
9083
11041
  };
9084
11042
  }
@@ -9253,7 +11211,11 @@ var layout_sidebar_default = /* @__PURE__ */ export_helper_default(/* @__PURE__
9253
11211
  type: Boolean,
9254
11212
  default: false
9255
11213
  },
9256
- roles: { default: [] }
11214
+ roles: { default: [] },
11215
+ showCollapseTrigger: {
11216
+ type: Boolean,
11217
+ default: true
11218
+ }
9257
11219
  },
9258
11220
  emits: [
9259
11221
  "collapse",
@@ -9291,6 +11253,10 @@ var layout_sidebar_default = /* @__PURE__ */ export_helper_default(/* @__PURE__
9291
11253
  onMounted(() => {
9292
11254
  localWidth.value = props.expandedWidth;
9293
11255
  });
11256
+ onUnmounted(() => {
11257
+ document.removeEventListener("mousemove", handleDragMove);
11258
+ document.removeEventListener("mouseup", handleDragEnd);
11259
+ });
9294
11260
  watch(() => props.expandedWidth, (val) => {
9295
11261
  if (val && val !== localWidth.value) localWidth.value = val;
9296
11262
  });
@@ -9363,7 +11329,7 @@ var layout_sidebar_default = /* @__PURE__ */ export_helper_default(/* @__PURE__
9363
11329
  createCommentVNode(" Logo 区域 "),
9364
11330
  createElementVNode("div", {
9365
11331
  class: normalizeClass(el("logo").value),
9366
- onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("collapse", !__props.collapsed))
11332
+ onClick: _cache[0] || (_cache[0] = ($event) => __props.showCollapseTrigger && _ctx.$emit("collapse", !__props.collapsed))
9367
11333
  }, [renderSlot(_ctx.$slots, "logo", {}, () => [__props.logo ? (openBlock(), createElementBlock("img", {
9368
11334
  key: 0,
9369
11335
  src: __props.logo,
@@ -9448,10 +11414,10 @@ var layout_sidebar_default = /* @__PURE__ */ export_helper_default(/* @__PURE__
9448
11414
  class: normalizeClass(el("search-empty").value)
9449
11415
  }, " 无匹配结果 ", 2)) : createCommentVNode("v-if", true)], true)], 2),
9450
11416
  createCommentVNode(" 底部支持信息 "),
9451
- __props.footerText && !__props.collapsed ? (openBlock(), createElementBlock("div", {
11417
+ (__props.footerText || _ctx.$slots.footer) && !__props.collapsed ? (openBlock(), createElementBlock("div", {
9452
11418
  key: 1,
9453
11419
  class: normalizeClass(el("footer").value)
9454
- }, [createElementVNode("div", { class: normalizeClass(el("footer-content").value) }, toDisplayString(__props.footerText), 3)], 2)) : createCommentVNode("v-if", true),
11420
+ }, [renderSlot(_ctx.$slots, "footer", {}, () => [createElementVNode("div", { class: normalizeClass(el("footer-content").value) }, toDisplayString(__props.footerText), 3)], true)], 2)) : createCommentVNode("v-if", true),
9455
11421
  createCommentVNode(" 拖拽调整手柄 "),
9456
11422
  __props.resizable && !__props.collapsed && !__props.isMobile ? (openBlock(), createElementBlock("div", {
9457
11423
  key: 2,
@@ -9461,7 +11427,7 @@ var layout_sidebar_default = /* @__PURE__ */ export_helper_default(/* @__PURE__
9461
11427
  ], 6);
9462
11428
  };
9463
11429
  }
9464
- }), [["__scopeId", "data-v-38d5b5bc"]]);
11430
+ }), [["__scopeId", "data-v-c55533fa"]]);
9465
11431
  //#endregion
9466
11432
  //#region src/components/navigation/tabs/tabs.vue
9467
11433
  const _hoisted_1$20 = [
@@ -10464,35 +12430,27 @@ var layout_header_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ *
10464
12430
  type: Boolean,
10465
12431
  default: false
10466
12432
  },
10467
- headerHeight: { default: 56 }
10468
- },
10469
- emits: [
10470
- "tab-change",
10471
- "tab-close",
10472
- "tab-add",
10473
- "tab-reorder",
10474
- "update:modelTabs",
10475
- "language-change",
10476
- "user-command",
10477
- "notification-click",
10478
- "settings-click",
10479
- "toggle-sider"
10480
- ],
10481
- setup(__props, { emit: __emit }) {
10482
- const props = __props;
10483
- const emit = __emit;
10484
- const isMobile = computed(() => {
10485
- if (typeof window === "undefined") return false;
10486
- return window.innerWidth < 768;
10487
- });
10488
- const languageItems = [{
12433
+ headerHeight: { default: 56 },
12434
+ showSettings: {
12435
+ type: Boolean,
12436
+ default: true
12437
+ },
12438
+ showLanguage: {
12439
+ type: Boolean,
12440
+ default: true
12441
+ },
12442
+ showNotification: {
12443
+ type: Boolean,
12444
+ default: true
12445
+ },
12446
+ languageItems: { default: () => [{
10489
12447
  key: "zh",
10490
12448
  label: "简体中文"
10491
12449
  }, {
10492
12450
  key: "en",
10493
12451
  label: "English"
10494
- }];
10495
- const userMenuItems = [
12452
+ }] },
12453
+ userMenuItems: { default: () => [
10496
12454
  {
10497
12455
  key: "profile",
10498
12456
  label: "个人中心"
@@ -10513,7 +12471,27 @@ var layout_header_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ *
10513
12471
  key: "logout",
10514
12472
  label: "退出登录"
10515
12473
  }
10516
- ];
12474
+ ] }
12475
+ },
12476
+ emits: [
12477
+ "tab-change",
12478
+ "tab-close",
12479
+ "tab-add",
12480
+ "tab-reorder",
12481
+ "update:modelTabs",
12482
+ "language-change",
12483
+ "user-command",
12484
+ "notification-click",
12485
+ "settings-click",
12486
+ "toggle-sider"
12487
+ ],
12488
+ setup(__props, { emit: __emit }) {
12489
+ const props = __props;
12490
+ const emit = __emit;
12491
+ const isMobile = computed(() => {
12492
+ if (typeof window === "undefined") return false;
12493
+ return window.innerWidth < 768;
12494
+ });
10517
12495
  const mobileUserMenuItems = computed(() => [
10518
12496
  {
10519
12497
  key: "language",
@@ -10573,7 +12551,7 @@ var layout_header_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ *
10573
12551
  return [];
10574
12552
  });
10575
12553
  const currentLanguageLabel = computed(() => {
10576
- return languageItems.find((item) => item.key === props.currentLanguage)?.label || "中文";
12554
+ return props.languageItems.find((item) => item.key === props.currentLanguage)?.label || "中文";
10577
12555
  });
10578
12556
  const headerClasses = computed(() => cn("yd-layout-header", `yd-layout-header--${props.theme}`));
10579
12557
  function el(name) {
@@ -10676,7 +12654,7 @@ var layout_header_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ *
10676
12654
  !isMobile.value ? (openBlock(), createElementBlock("div", {
10677
12655
  key: 1,
10678
12656
  class: normalizeClass(el("tabs"))
10679
- }, [renderSlot(_ctx.$slots, "tabs", {}, () => [__props.tabs.length > 0 ? (openBlock(), createBlock(tabs_default, {
12657
+ }, [renderSlot(_ctx.$slots, "prefix", {}, void 0, true), renderSlot(_ctx.$slots, "tabs", {}, () => [__props.tabs.length > 0 ? (openBlock(), createBlock(tabs_default, {
10680
12658
  key: 0,
10681
12659
  "model-value": __props.activeTab,
10682
12660
  "model-tabs": normalizedModelTabs.value,
@@ -10698,9 +12676,12 @@ var layout_header_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ *
10698
12676
  key: 2,
10699
12677
  class: normalizeClass(el("actions"))
10700
12678
  }, [
12679
+ createCommentVNode(" 自定义操作按钮区域 "),
12680
+ renderSlot(_ctx.$slots, "actions", {}, void 0, true),
10701
12681
  createCommentVNode(" 语言切换 "),
10702
- renderSlot(_ctx.$slots, "language", {}, () => [createVNode(dropdown_default, {
10703
- items: languageItems,
12682
+ renderSlot(_ctx.$slots, "language", {}, () => [__props.showLanguage ? (openBlock(), createBlock(dropdown_default, {
12683
+ key: 0,
12684
+ items: __props.languageItems,
10704
12685
  placement: "bottom",
10705
12686
  trigger: "hover",
10706
12687
  onSelect: handleLanguageSelect
@@ -10733,9 +12714,10 @@ var layout_header_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ *
10733
12714
  createElementVNode("path", { d: "M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" })
10734
12715
  ], -1)])], 10, _hoisted_1$18)]),
10735
12716
  _: 1
10736
- })], true),
12717
+ }, 8, ["items"])) : createCommentVNode("v-if", true)], true),
10737
12718
  createCommentVNode(" 消息通知 "),
10738
- renderSlot(_ctx.$slots, "notification", {}, () => [createElementVNode("div", {
12719
+ renderSlot(_ctx.$slots, "notification", {}, () => [__props.showNotification ? (openBlock(), createElementBlock("div", {
12720
+ key: 0,
10739
12721
  class: normalizeClass(el("action-btn")),
10740
12722
  onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("notification-click"))
10741
12723
  }, [createVNode(badge_default, {
@@ -10755,11 +12737,11 @@ var layout_header_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ *
10755
12737
  "stroke-linejoin": "round"
10756
12738
  }, [createElementVNode("path", { d: "M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9" }), createElementVNode("path", { d: "M13.73 21a2 2 0 0 1-3.46 0" })], -1)])]),
10757
12739
  _: 1
10758
- }, 8, ["value", "show"])], 2)], true),
12740
+ }, 8, ["value", "show"])], 2)) : createCommentVNode("v-if", true)], true),
10759
12741
  createCommentVNode(" 用户中心 "),
10760
12742
  renderSlot(_ctx.$slots, "user", {}, () => [__props.userInfo ? (openBlock(), createBlock(dropdown_default, {
10761
12743
  key: 0,
10762
- items: userMenuItems,
12744
+ items: __props.userMenuItems,
10763
12745
  placement: "bottom",
10764
12746
  trigger: "hover",
10765
12747
  onSelect: handleUserCommand
@@ -10785,9 +12767,9 @@ var layout_header_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ *
10785
12767
  }, [createElementVNode("polyline", { points: "6 9 12 15 18 9" })], -1))
10786
12768
  ], 2)]),
10787
12769
  _: 1
10788
- })) : createCommentVNode("v-if", true)], true),
12770
+ }, 8, ["items"])) : createCommentVNode("v-if", true)], true),
10789
12771
  createCommentVNode(" 设置 "),
10790
- renderSlot(_ctx.$slots, "settings", {}, () => [createElementVNode("div", {
12772
+ __props.showSettings ? renderSlot(_ctx.$slots, "settings", { key: 0 }, () => [createElementVNode("div", {
10791
12773
  class: normalizeClass(el("action-btn")),
10792
12774
  onClick: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("settings-click"))
10793
12775
  }, [..._cache[7] || (_cache[7] = [createElementVNode("svg", {
@@ -10804,7 +12786,7 @@ var layout_header_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ *
10804
12786
  cx: "12",
10805
12787
  cy: "12",
10806
12788
  r: "3"
10807
- }), createElementVNode("path", { d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z" })], -1)])], 2)], true)
12789
+ }), createElementVNode("path", { d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z" })], -1)])], 2)], true) : createCommentVNode("v-if", true)
10808
12790
  ], 2)) : (openBlock(), createElementBlock(Fragment, { key: 3 }, [createCommentVNode(" 移动端:仅头像 "), createElementVNode("div", { class: normalizeClass(el("user")) }, [__props.userInfo ? (openBlock(), createBlock(dropdown_default, {
10809
12791
  key: 0,
10810
12792
  items: mobileUserMenuItems.value,
@@ -10825,15 +12807,24 @@ var layout_header_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ *
10825
12807
  ], 6);
10826
12808
  };
10827
12809
  }
10828
- }), [["__scopeId", "data-v-1d3c26d9"]]);
12810
+ }), [["__scopeId", "data-v-0e3d094c"]]);
10829
12811
  var layout_content_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
10830
12812
  name: "YdLayoutContent",
10831
12813
  __name: "layout-content",
10832
- props: { style: {} },
12814
+ props: {
12815
+ style: { default: () => ({}) },
12816
+ class: { default: "" },
12817
+ padding: { default: 16 }
12818
+ },
10833
12819
  setup(__props) {
10834
12820
  const props = __props;
10835
- const contentClasses = computed(() => cn("yd-layout-content"));
10836
- const contentStyle = computed(() => ({ ...props.style }));
12821
+ const contentClasses = computed(() => cn("yd-layout-content", props.class));
12822
+ const contentStyle = computed(() => {
12823
+ return {
12824
+ padding: typeof props.padding === "number" ? `${props.padding}px` : props.padding,
12825
+ ...props.style
12826
+ };
12827
+ });
10837
12828
  return (_ctx, _cache) => {
10838
12829
  return openBlock(), createElementBlock("main", {
10839
12830
  class: normalizeClass(contentClasses.value),
@@ -10841,7 +12832,7 @@ var layout_content_default = /* @__PURE__ */ export_helper_default(/* @__PURE__
10841
12832
  }, [renderSlot(_ctx.$slots, "default", {}, void 0, true)], 6);
10842
12833
  };
10843
12834
  }
10844
- }), [["__scopeId", "data-v-254cc3f6"]]);
12835
+ }), [["__scopeId", "data-v-bedd80a3"]]);
10845
12836
  //#endregion
10846
12837
  //#region src/components/data-display/watermark/watermark.vue
10847
12838
  const _hoisted_1$17 = ["src"];
@@ -11165,20 +13156,197 @@ const DEFAULT_LAYOUT_SIZE = {
11165
13156
  siderCollapsedWidth: 48,
11166
13157
  headerHeight: 40
11167
13158
  };
13159
+ /**
13160
+ * 默认设置项列表
13161
+ */
13162
+ const DEFAULT_SETTINGS = [
13163
+ {
13164
+ key: "theme",
13165
+ label: "主题",
13166
+ type: "theme"
13167
+ },
13168
+ {
13169
+ key: "siderWidth",
13170
+ label: "侧边栏宽度",
13171
+ type: "siderWidth"
13172
+ },
13173
+ {
13174
+ key: "collapsed",
13175
+ label: "折叠侧边栏",
13176
+ type: "collapsed"
13177
+ },
13178
+ {
13179
+ key: "waterfall",
13180
+ label: "菜单模式",
13181
+ type: "waterfall"
13182
+ },
13183
+ {
13184
+ key: "footerText",
13185
+ label: "底部支持",
13186
+ type: "footerText"
13187
+ }
13188
+ ];
13189
+ /**
13190
+ * 最小化设置
13191
+ */
13192
+ const MINIMAL_SETTINGS = [{
13193
+ key: "theme",
13194
+ label: "主题",
13195
+ type: "theme"
13196
+ }];
13197
+ /**
13198
+ * 完整设置
13199
+ */
13200
+ const FULL_SETTINGS = [
13201
+ {
13202
+ key: "theme",
13203
+ label: "主题",
13204
+ type: "theme"
13205
+ },
13206
+ {
13207
+ key: "siderWidth",
13208
+ label: "侧边栏宽度",
13209
+ type: "siderWidth"
13210
+ },
13211
+ {
13212
+ key: "collapsed",
13213
+ label: "折叠侧边栏",
13214
+ type: "collapsed"
13215
+ },
13216
+ {
13217
+ key: "waterfall",
13218
+ label: "菜单模式",
13219
+ type: "waterfall"
13220
+ },
13221
+ {
13222
+ key: "footerText",
13223
+ label: "底部支持",
13224
+ type: "footerText"
13225
+ }
13226
+ ];
13227
+ /**
13228
+ * 设置预设映射
13229
+ */
13230
+ const SETTINGS_PRESETS = {
13231
+ default: DEFAULT_SETTINGS,
13232
+ minimal: MINIMAL_SETTINGS,
13233
+ full: FULL_SETTINGS,
13234
+ none: []
13235
+ };
13236
+ /**
13237
+ * 示例菜单数据 - 通用管理后台
13238
+ */
13239
+ const DEFAULT_MENU_ITEMS = [
13240
+ {
13241
+ key: "dashboard",
13242
+ label: "工作台",
13243
+ icon: "home",
13244
+ path: "/dashboard"
13245
+ },
13246
+ {
13247
+ key: "system",
13248
+ label: "系统管理",
13249
+ icon: "setting",
13250
+ children: [
13251
+ {
13252
+ key: "system-user",
13253
+ label: "用户管理",
13254
+ path: "/system/user"
13255
+ },
13256
+ {
13257
+ key: "system-role",
13258
+ label: "角色管理",
13259
+ path: "/system/role"
13260
+ },
13261
+ {
13262
+ key: "system-menu",
13263
+ label: "菜单管理",
13264
+ path: "/system/menu"
13265
+ }
13266
+ ]
13267
+ },
13268
+ {
13269
+ key: "order",
13270
+ label: "订单管理",
13271
+ icon: "order",
13272
+ children: [{
13273
+ key: "order-list",
13274
+ label: "订单列表",
13275
+ path: "/order/list"
13276
+ }, {
13277
+ key: "order-refund",
13278
+ label: "退款管理",
13279
+ path: "/order/refund"
13280
+ }]
13281
+ }
13282
+ ];
13283
+ /**
13284
+ * 最小化菜单
13285
+ */
13286
+ const MINIMAL_MENU_ITEMS = [{
13287
+ key: "home",
13288
+ label: "首页",
13289
+ icon: "home",
13290
+ path: "/"
13291
+ }];
13292
+ /**
13293
+ * 完整菜单
13294
+ */
13295
+ const FULL_MENU_ITEMS = DEFAULT_MENU_ITEMS;
13296
+ /**
13297
+ * 菜单预设映射
13298
+ */
13299
+ const MENU_PRESETS = {
13300
+ default: DEFAULT_MENU_ITEMS,
13301
+ minimal: MINIMAL_MENU_ITEMS,
13302
+ full: FULL_MENU_ITEMS,
13303
+ none: []
13304
+ };
13305
+ /**
13306
+ * 示例标签页数据
13307
+ */
13308
+ const DEFAULT_TABS = [{
13309
+ key: "home",
13310
+ label: "工作台",
13311
+ path: "/dashboard",
13312
+ closable: false
13313
+ }];
13314
+ /**
13315
+ * 最小化标签页
13316
+ */
13317
+ const MINIMAL_TABS = [];
13318
+ /**
13319
+ * 完整标签页
13320
+ */
13321
+ const FULL_TABS = DEFAULT_TABS;
13322
+ /**
13323
+ * 标签页预设映射
13324
+ */
13325
+ const TABS_PRESETS = {
13326
+ default: DEFAULT_TABS,
13327
+ minimal: MINIMAL_TABS,
13328
+ full: FULL_TABS,
13329
+ none: []
13330
+ };
11168
13331
  //#endregion
11169
13332
  //#region src/components/layout/layout/layout.vue
11170
13333
  const _hoisted_1$15 = ["data-theme"];
11171
13334
  const _hoisted_2$10 = { class: "yd-layout-settings" };
11172
13335
  const _hoisted_3$7 = { class: "yd-layout-settings__item" };
11173
13336
  const _hoisted_4$6 = { class: "yd-layout-settings__row" };
11174
- const _hoisted_5$3 = { class: "yd-layout-settings__item" };
11175
- const _hoisted_6$3 = { class: "yd-layout-settings__row" };
11176
- const _hoisted_7$2 = { class: "yd-layout-settings__item" };
11177
- const _hoisted_8$2 = { class: "yd-layout-settings__row" };
13337
+ const _hoisted_5$3 = { class: "yd-layout-settings__label" };
13338
+ const _hoisted_6$3 = { class: "yd-layout-settings__item" };
13339
+ const _hoisted_7$2 = { class: "yd-layout-settings__row" };
13340
+ const _hoisted_8$2 = { class: "yd-layout-settings__label" };
11178
13341
  const _hoisted_9$2 = { class: "yd-layout-settings__item" };
11179
13342
  const _hoisted_10$2 = { class: "yd-layout-settings__row" };
11180
- const _hoisted_11$2 = { class: "yd-layout-settings__item" };
11181
- const _hoisted_12$2 = { class: "yd-layout-settings__row" };
13343
+ const _hoisted_11$2 = { class: "yd-layout-settings__label" };
13344
+ const _hoisted_12$2 = { class: "yd-layout-settings__item" };
13345
+ const _hoisted_13$2 = { class: "yd-layout-settings__row" };
13346
+ const _hoisted_14$1 = { class: "yd-layout-settings__label" };
13347
+ const _hoisted_15$1 = { class: "yd-layout-settings__item" };
13348
+ const _hoisted_16$1 = { class: "yd-layout-settings__row" };
13349
+ const _hoisted_17$1 = { class: "yd-layout-settings__label" };
11182
13350
  const MOBILE_BREAKPOINT = 768;
11183
13351
  var layout_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
11184
13352
  name: "YdLayout",
@@ -11200,7 +13368,9 @@ var layout_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
11200
13368
  modelTabs: { default: () => [] },
11201
13369
  activeTab: { default: "" },
11202
13370
  userInfo: {},
13371
+ notificationCount: { default: 0 },
11203
13372
  contentPadding: { default: 16 },
13373
+ contentClass: { default: "" },
11204
13374
  hasSider: {
11205
13375
  type: Boolean,
11206
13376
  default: true
@@ -11228,7 +13398,62 @@ var layout_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
11228
13398
  type: Boolean,
11229
13399
  default: true
11230
13400
  },
11231
- watermark: { default: void 0 }
13401
+ watermark: { default: void 0 },
13402
+ showSettings: {
13403
+ type: Boolean,
13404
+ default: true
13405
+ },
13406
+ settings: { default: () => DEFAULT_SETTINGS },
13407
+ menuPreset: {},
13408
+ tabsPreset: {},
13409
+ settingsPreset: {},
13410
+ preset: {},
13411
+ searchable: {
13412
+ type: Boolean,
13413
+ default: false
13414
+ },
13415
+ roles: { default: [] },
13416
+ showCollapseTrigger: {
13417
+ type: Boolean,
13418
+ default: true
13419
+ },
13420
+ showLanguage: {
13421
+ type: Boolean,
13422
+ default: true
13423
+ },
13424
+ showNotification: {
13425
+ type: Boolean,
13426
+ default: true
13427
+ },
13428
+ languageItems: { default: () => [{
13429
+ key: "zh",
13430
+ label: "简体中文"
13431
+ }, {
13432
+ key: "en",
13433
+ label: "English"
13434
+ }] },
13435
+ userMenuItems: { default: () => [
13436
+ {
13437
+ key: "profile",
13438
+ label: "个人中心"
13439
+ },
13440
+ {
13441
+ key: "message",
13442
+ label: "消息中心"
13443
+ },
13444
+ {
13445
+ key: "settings",
13446
+ label: "个人设置"
13447
+ },
13448
+ {
13449
+ key: "divider",
13450
+ label: "-"
13451
+ },
13452
+ {
13453
+ key: "logout",
13454
+ label: "退出登录"
13455
+ }
13456
+ ] }
11232
13457
  },
11233
13458
  emits: [
11234
13459
  "update:collapsed",
@@ -11241,6 +13466,7 @@ var layout_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
11241
13466
  "update:modelTabs",
11242
13467
  "language-change",
11243
13468
  "user-command",
13469
+ "notification-click",
11244
13470
  "settings-click",
11245
13471
  "update:theme",
11246
13472
  "theme-change",
@@ -11249,7 +13475,7 @@ var layout_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
11249
13475
  "update:headerHeight",
11250
13476
  "header-height-change"
11251
13477
  ],
11252
- setup(__props, { emit: __emit }) {
13478
+ setup(__props, { expose: __expose, emit: __emit }) {
11253
13479
  const props = __props;
11254
13480
  const emit = __emit;
11255
13481
  const internalCollapsed = ref(props.collapsed);
@@ -11282,6 +13508,25 @@ var layout_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
11282
13508
  const mergedWaterfall = computed(() => internalWaterfall.value);
11283
13509
  const mergedPopupAlign = computed(() => internalPopupAlign.value);
11284
13510
  const mergedFooterText = computed(() => internalFooterText.value);
13511
+ const resolvedMenuItems = computed(() => {
13512
+ if (props.menuItems && props.menuItems.length > 0) return props.menuItems;
13513
+ const menuPreset = props.menuPreset || props.preset;
13514
+ if (menuPreset) return MENU_PRESETS[menuPreset] || [];
13515
+ return [];
13516
+ });
13517
+ const resolvedTabs = computed(() => {
13518
+ if (props.tabs && props.tabs.length > 0) return props.tabs;
13519
+ if (props.modelTabs && props.modelTabs.length > 0) return props.modelTabs;
13520
+ const tabsPresetValue = props.tabsPreset || props.preset;
13521
+ if (tabsPresetValue) return TABS_PRESETS[tabsPresetValue] || [];
13522
+ return [];
13523
+ });
13524
+ const resolvedSettings = computed(() => {
13525
+ if (props.settings && props.settings.length > 0) return props.settings;
13526
+ const settingsPresetValue = props.settingsPreset || props.preset;
13527
+ if (settingsPresetValue) return SETTINGS_PRESETS[settingsPresetValue] || DEFAULT_SETTINGS;
13528
+ return DEFAULT_SETTINGS;
13529
+ });
11285
13530
  const layoutClasses = computed(() => cn("yd-layout", `yd-layout--${mergedTheme.value}`, mergedCollapsed.value && "yd-layout--collapsed"));
11286
13531
  const mainClasses = computed(() => cn("yd-layout__main"));
11287
13532
  const mainStyle = computed(() => ({ marginLeft: `${siderCurrentWidth.value}px` }));
@@ -11380,6 +13625,26 @@ var layout_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
11380
13625
  watch(internalPopupAlign, (val) => {
11381
13626
  emit("update:popupAlign", val);
11382
13627
  });
13628
+ __expose({
13629
+ toggleCollapsed: () => handleCollapse(!mergedCollapsed.value),
13630
+ setCollapsed: (collapsed) => handleCollapse(collapsed),
13631
+ getCollapsed: () => mergedCollapsed.value,
13632
+ getTheme: () => mergedTheme.value,
13633
+ setTheme: (theme) => {
13634
+ internalTheme.value = theme;
13635
+ },
13636
+ getSiderWidth: () => mergedSiderWidth.value,
13637
+ setSiderWidth: (width) => {
13638
+ internalSiderWidth.value = width;
13639
+ },
13640
+ getHeaderHeight: () => mergedHeaderHeight.value,
13641
+ openSettings: () => {
13642
+ settingsVisible.value = true;
13643
+ },
13644
+ closeSettings: () => {
13645
+ settingsVisible.value = false;
13646
+ }
13647
+ });
11383
13648
  return (_ctx, _cache) => {
11384
13649
  return openBlock(), createElementBlock("div", {
11385
13650
  class: normalizeClass(layoutClasses.value),
@@ -11393,7 +13658,7 @@ var layout_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
11393
13658
  title: __props.title,
11394
13659
  collapsed: mergedCollapsed.value,
11395
13660
  theme: mergedTheme.value,
11396
- "menu-items": __props.menuItems,
13661
+ "menu-items": resolvedMenuItems.value,
11397
13662
  "active-key": __props.activeKey,
11398
13663
  "collapsed-width": __props.siderCollapsedWidth,
11399
13664
  "expanded-width": mergedSiderWidth.value,
@@ -11402,18 +13667,29 @@ var layout_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
11402
13667
  "popup-align": mergedPopupAlign.value,
11403
13668
  "footer-text": mergedFooterText.value,
11404
13669
  resizable: __props.siderResizable,
13670
+ searchable: __props.searchable,
13671
+ roles: __props.roles,
13672
+ "show-collapse-trigger": __props.showCollapseTrigger,
11405
13673
  onCollapse: handleCollapse,
11406
13674
  onMenuClick: handleMenuClick,
11407
13675
  onWidthChange: handleSiderWidthChange
11408
- }, createSlots({ _: 2 }, [_ctx.$slots.logo ? {
11409
- name: "logo",
11410
- fn: withCtx(() => [renderSlot(_ctx.$slots, "logo", {}, void 0, true)]),
11411
- key: "0"
11412
- } : void 0, _ctx.$slots.sider ? {
11413
- name: "sider",
11414
- fn: withCtx(() => [renderSlot(_ctx.$slots, "sider", {}, void 0, true)]),
11415
- key: "1"
11416
- } : void 0]), 1032, [
13676
+ }, createSlots({ _: 2 }, [
13677
+ _ctx.$slots.logo ? {
13678
+ name: "logo",
13679
+ fn: withCtx(() => [renderSlot(_ctx.$slots, "logo", {}, void 0, true)]),
13680
+ key: "0"
13681
+ } : void 0,
13682
+ _ctx.$slots.sider ? {
13683
+ name: "sider",
13684
+ fn: withCtx(() => [renderSlot(_ctx.$slots, "sider", {}, void 0, true)]),
13685
+ key: "1"
13686
+ } : void 0,
13687
+ _ctx.$slots["sidebar-footer"] ? {
13688
+ name: "footer",
13689
+ fn: withCtx(() => [renderSlot(_ctx.$slots, "sidebar-footer", {}, void 0, true)]),
13690
+ key: "2"
13691
+ } : void 0
13692
+ ]), 1032, [
11417
13693
  "logo",
11418
13694
  "title",
11419
13695
  "collapsed",
@@ -11426,7 +13702,10 @@ var layout_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
11426
13702
  "waterfall",
11427
13703
  "popup-align",
11428
13704
  "footer-text",
11429
- "resizable"
13705
+ "resizable",
13706
+ "searchable",
13707
+ "roles",
13708
+ "show-collapse-trigger"
11430
13709
  ])) : createCommentVNode("v-if", true),
11431
13710
  createCommentVNode(" 主内容区 "),
11432
13711
  createElementVNode("div", {
@@ -11437,14 +13716,20 @@ var layout_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
11437
13716
  __props.hasHeader ? (openBlock(), createBlock(layout_header_default, {
11438
13717
  key: 0,
11439
13718
  theme: mergedTheme.value,
11440
- tabs: __props.tabs,
11441
- "model-tabs": __props.modelTabs,
13719
+ tabs: resolvedTabs.value,
13720
+ "model-tabs": resolvedTabs.value,
11442
13721
  "active-tab": __props.activeTab,
11443
13722
  "user-info": __props.userInfo,
11444
13723
  "sider-width": mergedCollapsed.value ? __props.siderCollapsedWidth : mergedSiderWidth.value,
11445
13724
  "header-height": mergedHeaderHeight.value,
11446
13725
  "is-mobile": isMobileMode.value,
11447
13726
  fixed: __props.headerFixed,
13727
+ "show-settings": __props.showSettings,
13728
+ "notification-count": __props.notificationCount,
13729
+ "show-language": __props.showLanguage,
13730
+ "show-notification": __props.showNotification,
13731
+ "language-items": __props.languageItems,
13732
+ "user-menu-items": __props.userMenuItems,
11448
13733
  onTabChange: handleTabChange,
11449
13734
  onTabClose: handleTabClose,
11450
13735
  onTabAdd: handleTabAdd,
@@ -11452,9 +13737,14 @@ var layout_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
11452
13737
  "onUpdate:modelTabs": handleModelTabsUpdate,
11453
13738
  onLanguageChange: handleLanguageChange,
11454
13739
  onUserCommand: handleUserCommand,
11455
- onToggleSider: handleCollapse,
13740
+ onNotificationClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("notification-click")),
13741
+ onToggleSider: _cache[1] || (_cache[1] = ($event) => handleCollapse(true)),
11456
13742
  onSettingsClick: handleSettingsClick
11457
- }, createSlots({ _: 2 }, [_ctx.$slots.header ? {
13743
+ }, createSlots({
13744
+ prefix: withCtx(() => [renderSlot(_ctx.$slots, "header-prefix", {}, void 0, true)]),
13745
+ actions: withCtx(() => [renderSlot(_ctx.$slots, "header-actions", {}, void 0, true)]),
13746
+ _: 2
13747
+ }, [_ctx.$slots.header ? {
11458
13748
  name: "header",
11459
13749
  fn: withCtx(() => [renderSlot(_ctx.$slots, "header", {}, void 0, true)]),
11460
13750
  key: "0"
@@ -11467,22 +13757,32 @@ var layout_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
11467
13757
  "sider-width",
11468
13758
  "header-height",
11469
13759
  "is-mobile",
11470
- "fixed"
13760
+ "fixed",
13761
+ "show-settings",
13762
+ "notification-count",
13763
+ "show-language",
13764
+ "show-notification",
13765
+ "language-items",
13766
+ "user-menu-items"
11471
13767
  ])) : createCommentVNode("v-if", true),
11472
13768
  createCommentVNode(" 内容区 "),
11473
13769
  __props.hasContent && __props.watermark ? (openBlock(), createBlock(watermark_default, normalizeProps(mergeProps({ key: 1 }, __props.watermark)), {
11474
- default: withCtx(() => [createVNode(layout_content_default, { style: normalizeStyle(contentStyle.value) }, {
13770
+ default: withCtx(() => [createVNode(layout_content_default, {
13771
+ class: normalizeClass(__props.contentClass),
13772
+ style: normalizeStyle(contentStyle.value)
13773
+ }, {
11475
13774
  default: withCtx(() => [renderSlot(_ctx.$slots, "default", {}, void 0, true)]),
11476
13775
  _: 3
11477
- }, 8, ["style"])]),
13776
+ }, 8, ["class", "style"])]),
11478
13777
  _: 3
11479
13778
  }, 16)) : __props.hasContent ? (openBlock(), createBlock(layout_content_default, {
11480
13779
  key: 2,
13780
+ class: normalizeClass(__props.contentClass),
11481
13781
  style: normalizeStyle(contentStyle.value)
11482
13782
  }, {
11483
13783
  default: withCtx(() => [renderSlot(_ctx.$slots, "default", {}, void 0, true)]),
11484
13784
  _: 3
11485
- }, 8, ["style"])) : createCommentVNode("v-if", true)
13785
+ }, 8, ["class", "style"])) : createCommentVNode("v-if", true)
11486
13786
  ], 6),
11487
13787
  createCommentVNode(" 移动端遮罩层 "),
11488
13788
  maskVisible.value ? (openBlock(), createElementBlock("div", {
@@ -11492,16 +13792,15 @@ var layout_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
11492
13792
  })) : createCommentVNode("v-if", true),
11493
13793
  createVNode(drawer_default, {
11494
13794
  modelValue: settingsVisible.value,
11495
- "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => settingsVisible.value = $event),
13795
+ "onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => settingsVisible.value = $event),
11496
13796
  title: "设置",
11497
13797
  placement: "right",
11498
13798
  width: 320,
11499
13799
  closable: true,
11500
13800
  "mask-closable": true
11501
13801
  }, {
11502
- default: withCtx(() => [createElementVNode("div", _hoisted_2$10, [
11503
- createCommentVNode(" 主题切换 "),
11504
- createElementVNode("div", _hoisted_3$7, [createElementVNode("div", _hoisted_4$6, [_cache[15] || (_cache[15] = createElementVNode("span", { class: "yd-layout-settings__label" }, "主题", -1)), createVNode(space_default, {
13802
+ default: withCtx(() => [createElementVNode("div", _hoisted_2$10, [(openBlock(true), createElementBlock(Fragment, null, renderList(resolvedSettings.value, (item) => {
13803
+ return openBlock(), createElementBlock(Fragment, { key: item.key }, [createCommentVNode(" 自定义设置项 "), item.type === "custom" && item.slot ? renderSlot(_ctx.$slots, item.slot, { key: 0 }, void 0, true) : item.type === "theme" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [createCommentVNode(" 主题设置 "), createElementVNode("div", _hoisted_3$7, [createElementVNode("div", _hoisted_4$6, [createElementVNode("span", _hoisted_5$3, toDisplayString(item.label), 1), createVNode(space_default, {
11505
13804
  size: 4,
11506
13805
  direction: "horizontal"
11507
13806
  }, {
@@ -11509,32 +13808,30 @@ var layout_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
11509
13808
  createVNode(button_default, {
11510
13809
  size: "small",
11511
13810
  variant: internalTheme.value === "light" ? "primary" : "text",
11512
- onClick: _cache[0] || (_cache[0] = ($event) => internalTheme.value = "light")
13811
+ onClick: _cache[2] || (_cache[2] = ($event) => internalTheme.value = "light")
11513
13812
  }, {
11514
- default: withCtx(() => [..._cache[12] || (_cache[12] = [createTextVNode(" 浅色 ", -1)])]),
13813
+ default: withCtx(() => [..._cache[14] || (_cache[14] = [createTextVNode(" 浅色 ", -1)])]),
11515
13814
  _: 1
11516
13815
  }, 8, ["variant"]),
11517
13816
  createVNode(button_default, {
11518
13817
  size: "small",
11519
13818
  variant: internalTheme.value === "dark" ? "primary" : "text",
11520
- onClick: _cache[1] || (_cache[1] = ($event) => internalTheme.value = "dark")
13819
+ onClick: _cache[3] || (_cache[3] = ($event) => internalTheme.value = "dark")
11521
13820
  }, {
11522
- default: withCtx(() => [..._cache[13] || (_cache[13] = [createTextVNode(" 深色 ", -1)])]),
13821
+ default: withCtx(() => [..._cache[15] || (_cache[15] = [createTextVNode(" 深色 ", -1)])]),
11523
13822
  _: 1
11524
13823
  }, 8, ["variant"]),
11525
13824
  createVNode(button_default, {
11526
13825
  size: "small",
11527
13826
  variant: internalTheme.value === "corporate" ? "primary" : "text",
11528
- onClick: _cache[2] || (_cache[2] = ($event) => internalTheme.value = "corporate")
13827
+ onClick: _cache[4] || (_cache[4] = ($event) => internalTheme.value = "corporate")
11529
13828
  }, {
11530
- default: withCtx(() => [..._cache[14] || (_cache[14] = [createTextVNode(" 公司 ", -1)])]),
13829
+ default: withCtx(() => [..._cache[16] || (_cache[16] = [createTextVNode(" 公司 ", -1)])]),
11531
13830
  _: 1
11532
13831
  }, 8, ["variant"])
11533
13832
  ]),
11534
13833
  _: 1
11535
- })])]),
11536
- createCommentVNode(" 侧边栏宽度 "),
11537
- createElementVNode("div", _hoisted_5$3, [createElementVNode("div", _hoisted_6$3, [_cache[19] || (_cache[19] = createElementVNode("span", { class: "yd-layout-settings__label" }, "侧边栏宽度", -1)), createVNode(space_default, {
13834
+ })])])], 2112)) : item.type === "siderWidth" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [createCommentVNode(" 侧边栏宽度设置 "), createElementVNode("div", _hoisted_6$3, [createElementVNode("div", _hoisted_7$2, [createElementVNode("span", _hoisted_8$2, toDisplayString(item.label), 1), createVNode(space_default, {
11538
13835
  size: 4,
11539
13836
  direction: "horizontal"
11540
13837
  }, {
@@ -11542,37 +13839,33 @@ var layout_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
11542
13839
  createVNode(button_default, {
11543
13840
  size: "small",
11544
13841
  variant: internalSiderWidth.value === 160 ? "primary" : "text",
11545
- onClick: _cache[3] || (_cache[3] = ($event) => internalSiderWidth.value = 160)
13842
+ onClick: _cache[5] || (_cache[5] = ($event) => internalSiderWidth.value = 160)
11546
13843
  }, {
11547
- default: withCtx(() => [..._cache[16] || (_cache[16] = [createTextVNode(" 窄 ", -1)])]),
13844
+ default: withCtx(() => [..._cache[17] || (_cache[17] = [createTextVNode(" 窄 ", -1)])]),
11548
13845
  _: 1
11549
13846
  }, 8, ["variant"]),
11550
13847
  createVNode(button_default, {
11551
13848
  size: "small",
11552
13849
  variant: internalSiderWidth.value === 200 ? "primary" : "text",
11553
- onClick: _cache[4] || (_cache[4] = ($event) => internalSiderWidth.value = 200)
13850
+ onClick: _cache[6] || (_cache[6] = ($event) => internalSiderWidth.value = 200)
11554
13851
  }, {
11555
- default: withCtx(() => [..._cache[17] || (_cache[17] = [createTextVNode(" 中 ", -1)])]),
13852
+ default: withCtx(() => [..._cache[18] || (_cache[18] = [createTextVNode(" 中 ", -1)])]),
11556
13853
  _: 1
11557
13854
  }, 8, ["variant"]),
11558
13855
  createVNode(button_default, {
11559
13856
  size: "small",
11560
13857
  variant: internalSiderWidth.value === 240 ? "primary" : "text",
11561
- onClick: _cache[5] || (_cache[5] = ($event) => internalSiderWidth.value = 240)
13858
+ onClick: _cache[7] || (_cache[7] = ($event) => internalSiderWidth.value = 240)
11562
13859
  }, {
11563
- default: withCtx(() => [..._cache[18] || (_cache[18] = [createTextVNode(" 宽 ", -1)])]),
13860
+ default: withCtx(() => [..._cache[19] || (_cache[19] = [createTextVNode(" 宽 ", -1)])]),
11564
13861
  _: 1
11565
13862
  }, 8, ["variant"])
11566
13863
  ]),
11567
13864
  _: 1
11568
- })])]),
11569
- createCommentVNode(" 折叠侧边栏 "),
11570
- createElementVNode("div", _hoisted_7$2, [createElementVNode("div", _hoisted_8$2, [_cache[20] || (_cache[20] = createElementVNode("span", { class: "yd-layout-settings__label" }, "折叠侧边栏", -1)), createVNode(switch_default, {
13865
+ })])])], 2112)) : item.type === "collapsed" ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [createCommentVNode(" 折叠侧边栏设置 "), createElementVNode("div", _hoisted_9$2, [createElementVNode("div", _hoisted_10$2, [createElementVNode("span", _hoisted_11$2, toDisplayString(item.label), 1), createVNode(switch_default, {
11571
13866
  modelValue: internalCollapsed.value,
11572
- "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => internalCollapsed.value = $event)
11573
- }, null, 8, ["modelValue"])])]),
11574
- createCommentVNode(" 菜单模式 "),
11575
- createElementVNode("div", _hoisted_9$2, [createElementVNode("div", _hoisted_10$2, [_cache[24] || (_cache[24] = createElementVNode("span", { class: "yd-layout-settings__label" }, "菜单模式", -1)), createVNode(space_default, {
13867
+ "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => internalCollapsed.value = $event)
13868
+ }, null, 8, ["modelValue"])])])], 2112)) : item.type === "waterfall" ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [createCommentVNode(" 菜单模式设置 "), createElementVNode("div", _hoisted_12$2, [createElementVNode("div", _hoisted_13$2, [createElementVNode("span", _hoisted_14$1, toDisplayString(item.label), 1), createVNode(space_default, {
11576
13869
  size: 4,
11577
13870
  direction: "horizontal"
11578
13871
  }, {
@@ -11580,51 +13873,49 @@ var layout_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
11580
13873
  createVNode(button_default, {
11581
13874
  size: "small",
11582
13875
  variant: !internalWaterfall.value ? "primary" : "text",
11583
- onClick: _cache[7] || (_cache[7] = ($event) => internalWaterfall.value = false)
13876
+ onClick: _cache[9] || (_cache[9] = ($event) => internalWaterfall.value = false)
11584
13877
  }, {
11585
- default: withCtx(() => [..._cache[21] || (_cache[21] = [createTextVNode(" 传统 ", -1)])]),
13878
+ default: withCtx(() => [..._cache[20] || (_cache[20] = [createTextVNode(" 传统 ", -1)])]),
11586
13879
  _: 1
11587
13880
  }, 8, ["variant"]),
11588
13881
  createVNode(button_default, {
11589
13882
  size: "small",
11590
13883
  variant: internalWaterfall.value && internalPopupAlign.value === "container" ? "primary" : "text",
11591
- onClick: _cache[8] || (_cache[8] = ($event) => {
13884
+ onClick: _cache[10] || (_cache[10] = ($event) => {
11592
13885
  internalWaterfall.value = true;
11593
13886
  internalPopupAlign.value = "container";
11594
13887
  })
11595
13888
  }, {
11596
- default: withCtx(() => [..._cache[22] || (_cache[22] = [createTextVNode(" 容器 ", -1)])]),
13889
+ default: withCtx(() => [..._cache[21] || (_cache[21] = [createTextVNode(" 容器 ", -1)])]),
11597
13890
  _: 1
11598
13891
  }, 8, ["variant"]),
11599
13892
  createVNode(button_default, {
11600
13893
  size: "small",
11601
13894
  variant: internalWaterfall.value && internalPopupAlign.value === "trigger" ? "primary" : "text",
11602
- onClick: _cache[9] || (_cache[9] = ($event) => {
13895
+ onClick: _cache[11] || (_cache[11] = ($event) => {
11603
13896
  internalWaterfall.value = true;
11604
13897
  internalPopupAlign.value = "trigger";
11605
13898
  })
11606
13899
  }, {
11607
- default: withCtx(() => [..._cache[23] || (_cache[23] = [createTextVNode(" 浮动 ", -1)])]),
13900
+ default: withCtx(() => [..._cache[22] || (_cache[22] = [createTextVNode(" 浮动 ", -1)])]),
11608
13901
  _: 1
11609
13902
  }, 8, ["variant"])
11610
13903
  ]),
11611
13904
  _: 1
11612
- })])]),
11613
- createCommentVNode(" 底部支持 "),
11614
- createElementVNode("div", _hoisted_11$2, [createElementVNode("div", _hoisted_12$2, [_cache[25] || (_cache[25] = createElementVNode("span", { class: "yd-layout-settings__label" }, "底部支持", -1)), createVNode(input_default, {
13905
+ })])])], 2112)) : item.type === "footerText" ? (openBlock(), createElementBlock(Fragment, { key: 5 }, [createCommentVNode(" 底部支持设置 "), createElementVNode("div", _hoisted_15$1, [createElementVNode("div", _hoisted_16$1, [createElementVNode("span", _hoisted_17$1, toDisplayString(item.label), 1), createVNode(input_default, {
11615
13906
  modelValue: internalFooterText.value,
11616
- "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => internalFooterText.value = $event),
13907
+ "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => internalFooterText.value = $event),
11617
13908
  placeholder: "显示在侧边栏底部",
11618
13909
  clearable: "",
11619
13910
  style: { "width": "140px" }
11620
- }, null, 8, ["modelValue"])])])
11621
- ])]),
11622
- _: 1
13911
+ }, null, 8, ["modelValue"])])])], 2112)) : createCommentVNode("v-if", true)], 64);
13912
+ }), 128))])]),
13913
+ _: 3
11623
13914
  }, 8, ["modelValue"])
11624
13915
  ], 14, _hoisted_1$15);
11625
13916
  };
11626
13917
  }
11627
- }), [["__scopeId", "data-v-2a960b8a"]]);
13918
+ }), [["__scopeId", "data-v-904a9ea8"]]);
11628
13919
  var card_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
11629
13920
  name: "YdCard",
11630
13921
  inheritAttrs: false,
@@ -11753,44 +14044,45 @@ var tooltip_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defi
11753
14044
  }), [["__scopeId", "data-v-65560d25"]]);
11754
14045
  //#endregion
11755
14046
  //#region src/components/data-display/table/table.vue
11756
- const _hoisted_1$14 = { key: 0 };
11757
- const _hoisted_2$9 = [
14047
+ const _hoisted_1$14 = ["aria-label"];
14048
+ const _hoisted_2$9 = { key: 0 };
14049
+ const _hoisted_3$6 = [
11758
14050
  "draggable",
11759
14051
  "onDragstart",
11760
14052
  "onDragover",
11761
14053
  "onDrop"
11762
14054
  ];
11763
- const _hoisted_3$6 = ["onClick"];
11764
- const _hoisted_4$5 = ["onMousedown"];
11765
- const _hoisted_5$2 = ["onClick"];
14055
+ const _hoisted_4$5 = ["onClick"];
14056
+ const _hoisted_5$2 = ["onMousedown"];
11766
14057
  const _hoisted_6$2 = ["onClick"];
11767
- const _hoisted_7$1 = [
14058
+ const _hoisted_7$1 = ["onClick"];
14059
+ const _hoisted_8$1 = [
11768
14060
  "title",
11769
14061
  "onMouseenter",
11770
14062
  "onMouseleave"
11771
14063
  ];
11772
- const _hoisted_8$1 = ["colspan"];
11773
- const _hoisted_9$1 = [
14064
+ const _hoisted_9$1 = ["colspan"];
14065
+ const _hoisted_10$1 = [
11774
14066
  "draggable",
11775
14067
  "onDragstart",
11776
14068
  "onDragover",
11777
14069
  "onDrop"
11778
14070
  ];
11779
- const _hoisted_10$1 = ["onClick"];
11780
- const _hoisted_11$1 = ["onMousedown"];
11781
- const _hoisted_12$1 = ["onClick"];
14071
+ const _hoisted_11$1 = ["onClick"];
14072
+ const _hoisted_12$1 = ["onMousedown"];
11782
14073
  const _hoisted_13$1 = ["onClick"];
11783
- const _hoisted_14 = [
14074
+ const _hoisted_14 = ["onClick"];
14075
+ const _hoisted_15 = [
11784
14076
  "title",
11785
14077
  "onMouseenter",
11786
14078
  "onMouseleave"
11787
14079
  ];
11788
- const _hoisted_15 = ["colspan"];
11789
- const _hoisted_16 = { key: 0 };
11790
- const _hoisted_17 = ["colspan"];
11791
- const _hoisted_18 = ["disabled"];
11792
- const _hoisted_19 = ["onClick"];
11793
- const _hoisted_20 = ["disabled"];
14080
+ const _hoisted_16 = ["colspan"];
14081
+ const _hoisted_17 = { key: 0 };
14082
+ const _hoisted_18 = ["colspan"];
14083
+ const _hoisted_19 = ["disabled"];
14084
+ const _hoisted_20 = ["onClick"];
14085
+ const _hoisted_21 = ["disabled"];
11794
14086
  var table_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
11795
14087
  name: "YdTable",
11796
14088
  __name: "table",
@@ -12176,7 +14468,12 @@ var table_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
12176
14468
  exportToJSON
12177
14469
  });
12178
14470
  return (_ctx, _cache) => {
12179
- return openBlock(), createElementBlock("div", { class: normalizeClass(tableClasses.value) }, [
14471
+ return openBlock(), createElementBlock("div", {
14472
+ class: normalizeClass(tableClasses.value),
14473
+ role: "table",
14474
+ "aria-busy": "loading",
14475
+ "aria-label": _ctx.ariaLabel || "数据表格"
14476
+ }, [
12180
14477
  createCommentVNode(" Loading overlay "),
12181
14478
  __props.loading ? (openBlock(), createElementBlock("div", {
12182
14479
  key: 0,
@@ -12189,7 +14486,7 @@ var table_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
12189
14486
  __props.skeleton ? (openBlock(), createElementBlock("div", {
12190
14487
  key: 1,
12191
14488
  class: normalizeClass(e("skeleton-wrapper"))
12192
- }, [createElementVNode("table", { class: normalizeClass(e("skeleton-table")) }, [__props.stickyHeader || __props.columns.length > 0 ? (openBlock(), createElementBlock("thead", _hoisted_1$14, [createElementVNode("tr", { class: normalizeClass(e("skeleton-header-row")) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (col, index) => {
14489
+ }, [createElementVNode("table", { class: normalizeClass(e("skeleton-table")) }, [__props.stickyHeader || __props.columns.length > 0 ? (openBlock(), createElementBlock("thead", _hoisted_2$9, [createElementVNode("tr", { class: normalizeClass(e("skeleton-header-row")) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (col, index) => {
12193
14490
  return openBlock(), createElementBlock("th", {
12194
14491
  key: index,
12195
14492
  class: normalizeClass(e("skeleton-cell")),
@@ -12265,14 +14562,14 @@ var table_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
12265
14562
  key: 0,
12266
14563
  class: normalizeClass(e("sort-btn")),
12267
14564
  onClick: ($event) => handleSort(col.key, $event)
12268
- }, [createElementVNode("span", { class: normalizeClass([e("sort-icon"), { [e("sort-icon--active")]: isColumnSorted(col.key) }]) }, [getSortPriority(col.key) > 0 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(toDisplayString(getSortPriority(col.key)), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(isColumnSorted(col.key) ? getSortOrder(col.key) === "asc" ? "↑" : "↓" : "↕"), 1)], 64))], 2)], 10, _hoisted_3$6)) : createCommentVNode("v-if", true)], 2),
14565
+ }, [createElementVNode("span", { class: normalizeClass([e("sort-icon"), { [e("sort-icon--active")]: isColumnSorted(col.key) }]) }, [getSortPriority(col.key) > 0 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(toDisplayString(getSortPriority(col.key)), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(isColumnSorted(col.key) ? getSortOrder(col.key) === "asc" ? "↑" : "↓" : "↕"), 1)], 64))], 2)], 10, _hoisted_4$5)) : createCommentVNode("v-if", true)], 2),
12269
14566
  createCommentVNode(" Resize handle "),
12270
14567
  col.resizable ? (openBlock(), createElementBlock("div", {
12271
14568
  key: 0,
12272
14569
  class: normalizeClass(e("resize-handle")),
12273
14570
  onMousedown: withModifiers(($event) => startResize($event, col.key), ["stop"])
12274
- }, null, 42, _hoisted_4$5)) : createCommentVNode("v-if", true)
12275
- ], 46, _hoisted_2$9);
14571
+ }, null, 42, _hoisted_5$2)) : createCommentVNode("v-if", true)
14572
+ ], 46, _hoisted_3$6);
12276
14573
  }), 128))], 2)) : createCommentVNode("v-if", true),
12277
14574
  createCommentVNode(" Visible rows "),
12278
14575
  (openBlock(true), createElementBlock(Fragment, null, renderList(visibleRows.value, (row, index) => {
@@ -12300,7 +14597,7 @@ var table_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
12300
14597
  }, [createElementVNode("span", {
12301
14598
  class: normalizeClass([e("expand-icon"), { [e("expand-icon--expanded")]: expandedRows.value.has(startIndex.value + index) }]),
12302
14599
  onClick: withModifiers(($event) => toggleExpand(startIndex.value + index), ["stop"])
12303
- }, toDisplayString(expandedRows.value.has(startIndex.value + index) ? "▾" : "▸"), 11, _hoisted_6$2)], 2)) : createCommentVNode("v-if", true), (openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (col) => {
14600
+ }, toDisplayString(expandedRows.value.has(startIndex.value + index) ? "▾" : "▸"), 11, _hoisted_7$1)], 2)) : createCommentVNode("v-if", true), (openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (col) => {
12304
14601
  return openBlock(), createElementBlock("div", {
12305
14602
  key: col.key,
12306
14603
  class: normalizeClass([
@@ -12321,8 +14618,8 @@ var table_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
12321
14618
  row,
12322
14619
  column: col,
12323
14620
  index: startIndex.value + index
12324
- }, () => [createTextVNode(toDisplayString(row[col.key]), 1)], true)], 46, _hoisted_7$1);
12325
- }), 128))], 14, _hoisted_5$2),
14621
+ }, () => [createTextVNode(toDisplayString(row[col.key]), 1)], true)], 46, _hoisted_8$1);
14622
+ }), 128))], 14, _hoisted_6$2),
12326
14623
  createCommentVNode(" Expand row "),
12327
14624
  __props.expandable && expandedRows.value.has(startIndex.value + index) ? (openBlock(), createElementBlock("div", {
12328
14625
  key: 0,
@@ -12338,7 +14635,7 @@ var table_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
12338
14635
  }, [renderSlot(_ctx.$slots, "expand", {
12339
14636
  row,
12340
14637
  index: startIndex.value + index
12341
- }, void 0, true)], 10, _hoisted_8$1)], 6)) : createCommentVNode("v-if", true)
14638
+ }, void 0, true)], 10, _hoisted_9$1)], 6)) : createCommentVNode("v-if", true)
12342
14639
  ], 64);
12343
14640
  }), 128)),
12344
14641
  displayData.value.length === 0 && !__props.loading ? (openBlock(), createElementBlock("div", {
@@ -12382,14 +14679,14 @@ var table_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
12382
14679
  key: 0,
12383
14680
  class: normalizeClass(e("sort-btn")),
12384
14681
  onClick: ($event) => handleSort(col.key, $event)
12385
- }, [createElementVNode("span", { class: normalizeClass([e("sort-icon"), { [e("sort-icon--active")]: isColumnSorted(col.key) }]) }, [getSortPriority(col.key) > 0 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(toDisplayString(getSortPriority(col.key)), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(isColumnSorted(col.key) ? getSortOrder(col.key) === "asc" ? "↑" : "↓" : "↕"), 1)], 64))], 2)], 10, _hoisted_10$1)) : createCommentVNode("v-if", true)], 2),
14682
+ }, [createElementVNode("span", { class: normalizeClass([e("sort-icon"), { [e("sort-icon--active")]: isColumnSorted(col.key) }]) }, [getSortPriority(col.key) > 0 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(toDisplayString(getSortPriority(col.key)), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(isColumnSorted(col.key) ? getSortOrder(col.key) === "asc" ? "↑" : "↓" : "↕"), 1)], 64))], 2)], 10, _hoisted_11$1)) : createCommentVNode("v-if", true)], 2),
12386
14683
  createCommentVNode(" Resize handle "),
12387
14684
  col.resizable ? (openBlock(), createElementBlock("div", {
12388
14685
  key: 0,
12389
14686
  class: normalizeClass(e("resize-handle")),
12390
14687
  onMousedown: withModifiers(($event) => startResize($event, col.key), ["stop"])
12391
- }, null, 42, _hoisted_11$1)) : createCommentVNode("v-if", true)
12392
- ], 46, _hoisted_9$1);
14688
+ }, null, 42, _hoisted_12$1)) : createCommentVNode("v-if", true)
14689
+ ], 46, _hoisted_10$1);
12393
14690
  }), 128))])], 2), createElementVNode("tbody", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(displayData.value, (row, index) => {
12394
14691
  return openBlock(), createElementBlock(Fragment, { key: index }, [
12395
14692
  createElementVNode("tr", {
@@ -12405,7 +14702,7 @@ var table_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
12405
14702
  }, [createElementVNode("span", {
12406
14703
  class: normalizeClass([e("expand-icon"), { [e("expand-icon--expanded")]: expandedRows.value.has(index) }]),
12407
14704
  onClick: withModifiers(($event) => toggleExpand(index), ["stop"])
12408
- }, toDisplayString(expandedRows.value.has(index) ? "▾" : "▸"), 11, _hoisted_13$1)], 2)) : createCommentVNode("v-if", true), (openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (col) => {
14705
+ }, toDisplayString(expandedRows.value.has(index) ? "▾" : "▸"), 11, _hoisted_14)], 2)) : createCommentVNode("v-if", true), (openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (col) => {
12409
14706
  return openBlock(), createElementBlock("td", {
12410
14707
  key: col.key,
12411
14708
  class: normalizeClass([
@@ -12421,8 +14718,8 @@ var table_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
12421
14718
  row,
12422
14719
  column: col,
12423
14720
  index
12424
- }, () => [createTextVNode(toDisplayString(row[col.key]), 1)], true)], 42, _hoisted_14);
12425
- }), 128))], 10, _hoisted_12$1),
14721
+ }, () => [createTextVNode(toDisplayString(row[col.key]), 1)], true)], 42, _hoisted_15);
14722
+ }), 128))], 10, _hoisted_13$1),
12426
14723
  createCommentVNode(" Expand row "),
12427
14724
  __props.expandable && expandedRows.value.has(index) ? (openBlock(), createElementBlock("tr", {
12428
14725
  key: 0,
@@ -12433,12 +14730,12 @@ var table_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
12433
14730
  }, [renderSlot(_ctx.$slots, "expand", {
12434
14731
  row,
12435
14732
  index
12436
- }, void 0, true)], 10, _hoisted_15)], 2)) : createCommentVNode("v-if", true)
14733
+ }, void 0, true)], 10, _hoisted_16)], 2)) : createCommentVNode("v-if", true)
12437
14734
  ], 64);
12438
- }), 128)), displayData.value.length === 0 && !__props.loading ? (openBlock(), createElementBlock("tr", _hoisted_16, [createElementVNode("td", {
14735
+ }), 128)), displayData.value.length === 0 && !__props.loading ? (openBlock(), createElementBlock("tr", _hoisted_17, [createElementVNode("td", {
12439
14736
  class: normalizeClass(e("empty")),
12440
14737
  colspan: __props.columns.length + (__props.expandable ? 1 : 0)
12441
- }, [renderSlot(_ctx.$slots, "empty", {}, () => [createVNode(empty_default, { description: __props.emptyText }, null, 8, ["description"])], true)], 10, _hoisted_17)])) : createCommentVNode("v-if", true)])], 2)], 64))], 38),
14738
+ }, [renderSlot(_ctx.$slots, "empty", {}, () => [createVNode(empty_default, { description: __props.emptyText }, null, 8, ["description"])], true)], 10, _hoisted_18)])) : createCommentVNode("v-if", true)])], 2)], 64))], 38),
12442
14739
  createCommentVNode(" Export toolbar "),
12443
14740
  __props.exportable ? (openBlock(), createElementBlock("div", {
12444
14741
  key: 2,
@@ -12466,7 +14763,7 @@ var table_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
12466
14763
  class: normalizeClass(e("page-btn")),
12467
14764
  disabled: currentPage.value === 1,
12468
14765
  onClick: _cache[3] || (_cache[3] = ($event) => handlePageChange(currentPage.value - 1))
12469
- }, " ‹ ", 10, _hoisted_18),
14766
+ }, " ‹ ", 10, _hoisted_19),
12470
14767
  (openBlock(true), createElementBlock(Fragment, null, renderList(visiblePages.value, (page) => {
12471
14768
  return openBlock(), createElementBlock(Fragment, { key: page }, [page === "..." ? (openBlock(), createElementBlock("button", {
12472
14769
  key: 0,
@@ -12476,13 +14773,13 @@ var table_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
12476
14773
  key: 1,
12477
14774
  class: normalizeClass([e("page-btn"), { [e("page-btn--active")]: page === currentPage.value }]),
12478
14775
  onClick: ($event) => handlePageChange(page)
12479
- }, toDisplayString(page), 11, _hoisted_19))], 64);
14776
+ }, toDisplayString(page), 11, _hoisted_20))], 64);
12480
14777
  }), 128)),
12481
14778
  createElementVNode("button", {
12482
14779
  class: normalizeClass(e("page-btn")),
12483
14780
  disabled: currentPage.value === totalPages.value,
12484
14781
  onClick: _cache[4] || (_cache[4] = ($event) => handlePageChange(currentPage.value + 1))
12485
- }, " › ", 10, _hoisted_20),
14782
+ }, " › ", 10, _hoisted_21),
12486
14783
  createElementVNode("span", { class: normalizeClass(e("page-info")) }, "共 " + toDisplayString(total.value) + " 条", 3)
12487
14784
  ], 2)) : createCommentVNode("v-if", true),
12488
14785
  createCommentVNode(" Cell overflow tooltip "),
@@ -12494,10 +14791,10 @@ var table_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
12494
14791
  }, toDisplayString(tooltipContent.value), 7)) : createCommentVNode("v-if", true)]),
12495
14792
  _: 1
12496
14793
  })
12497
- ], 2);
14794
+ ], 10, _hoisted_1$14);
12498
14795
  };
12499
14796
  }
12500
- }), [["__scopeId", "data-v-0736270c"]]);
14797
+ }), [["__scopeId", "data-v-eba68bff"]]);
12501
14798
  //#endregion
12502
14799
  //#region src/components/data-display/progress/progress.vue
12503
14800
  const _hoisted_1$13 = ["stroke-width"];
@@ -15564,25 +17861,6 @@ function useLoading(initialValue = false) {
15564
17861
  };
15565
17862
  }
15566
17863
  //#endregion
15567
- //#region src/types/index.ts
15568
- /** 是否为数组 */
15569
- const isArray = Array.isArray;
15570
- /** 是否为对象 */
15571
- const isObject = (val) => val !== null && typeof val === "object" && !isArray(val);
15572
- /** 是否为日期 */
15573
- const isDate = (val) => val instanceof Date;
15574
- /** 是否为函数 */
15575
- const isFunction = (val) => typeof val === "function";
15576
- /** 是否为空 */
15577
- const isEmpty = (val) => {
15578
- if (val === null || val === void 0) return true;
15579
- if (isArray(val) || typeof val === "string") return val.length === 0;
15580
- if (isObject(val)) return Object.keys(val).length === 0;
15581
- return false;
15582
- };
15583
- /** 是否为 Promise */
15584
- const isPromise = (val) => val instanceof Promise || typeof val === "object" && typeof val?.["then"] === "function";
15585
- //#endregion
15586
17864
  //#region src/styles/themes/index.ts
15587
17865
  /**
15588
17866
  * Theme definitions
@@ -16656,4 +18934,4 @@ var router_exports = /* @__PURE__ */ __exportAll({
16656
18934
  setRouter: () => setRouter
16657
18935
  });
16658
18936
  //#endregion
16659
- export { ANIMATION_DURATION, COMPONENT_PREFIX, CSS_PREFIX, DEBOUNCE_DEFAULTS, DEFAULT_LAYOUT_SIZE, Message, Notification, THROTTLE_DEFAULTS, YdAdminResolver, ai_loader_default as YdAiLoader, anchor_default as YdAnchor, auto_complete_default as YdAutoComplete, avatar_default as YdAvatar, badge_default as YdBadge, breadcrumb_default as YdBreadcrumb, button_default as YdButton, calendar_default as YdCalendar, captcha_default as YdCaptcha, card_default as YdCard, cascader_default as YdCascader, chat_bubble_default as YdChatBubble, chat_page_default as YdChatPage, checkbox_default as YdCheckbox, checkbox_group_default as YdCheckboxGroup, code_block_default as YdCodeBlock, collapse_default as YdCollapse, color_picker_default as YdColorPicker, config_provider_default as YdConfigProvider, context_menu_default as YdContextMenu, conversation_default as YdConversation, crud_page_default as YdCrudPage, date_picker_default as YdDatePicker, date_range_picker_default as YdDateRangePicker, divider_default as YdDivider, drawer_default as YdDrawer, dropdown_default as YdDropdown, empty_default as YdEmpty, flow_chart_default as YdFlowChart, form_default as YdForm, form_item_default as YdFormItem, icon_default as YdIcon, image_default as YdImage, image_preview_group_default as YdImagePreviewGroup, input_default as YdInput, input_number_default as YdInputNumber, layout_default as YdLayout, layout_content_default as YdLayoutContent, layout_header_default as YdLayoutHeader, layout_sidebar_default as YdLayoutSidebar, list_default as YdList, loading_bar_default as YdLoadingBar, login_default as YdLogin, login_centered_default as YdLoginCentered, markdown_default as YdMarkdown, menu_default as YdMenu, modal_default as YdModal, model_selector_default as YdModelSelector, pagination_default as YdPagination, pin_input_default as YdPinInput, popconfirm_default as YdPopconfirm, progress_default as YdProgress, prompt_input_default as YdPromptInput, radio_default as YdRadio, radio_group_default as YdRadioGroup, rate_default as YdRate, reasoning_default as YdReasoning, result_default as YdResult, router_exports as YdRouter, SchemaForm_default as YdSchemaForm, select_default as YdSelect, skeleton_default as YdSkeleton, slider_default as YdSlider, sources_default as YdSources, space_default as YdSpace, spin_default as YdSpin, statistic_default as YdStatistic, stepper_default as YdStepper, steps_default as YdSteps, streaming_text_default as YdStreamingText, suggestion_default as YdSuggestion, switch_default as YdSwitch, table_default as YdTable, tabs_default as YdTabs, tag_default as YdTag, textarea_default as YdTextarea, time_picker_default as YdTimePicker, timeline_default as YdTimeline, tooltip_default as YdTooltip, transfer_default as YdTransfer, tree_default as YdTree, tree_select_default as YdTreeSelect, upload_default as YdUpload, watermark_default as YdWatermark, Z_INDEX, buildBreadcrumb, changeLocale, checkRoutePermission, clearKeyCache, cn, convertToSimpleRoute, createSecureStorage, createWatermark, debounce, decrypt, deepClone, dt, dynamicRouter, encrypt, filterMenuItems, findMenuItem, findMenuPath, flattenMenuItems, generateId, generateRouteTitle, generateSessionKey, getBreadcrumbPaths, getCurrentLocale, getIcon, getIconRegistry, getKeySource, i18n, initSecureStorage, isArray, isDate, isEmpty, isEmptyObject, isFunction, isObject, isPathMatch, isPromise, isStorageReady, joinPath, loadingBar, menuToRoutes, nf, normalizePath, registerIcon, registerLazyLocale, removeWatermark, resetStorageKey, rotateStorageKey, searchMenuItems, secureLocal, secureSession, secureStoragePlugin, setLocale, setSessionStorageEncryptionKey, setStorageEncryptionKey, setupI18n, signData, storageReady, supportedLocales, t, tc, themes, throttle, useConfig, useFormSchema, useFormValidate, useLoading, useLoadingBar, useLoginForm, useNamespace, verifyData };
18937
+ export { ANIMATION_DURATION, COMPONENT_PREFIX, CSS_PREFIX, DEBOUNCE_DEFAULTS, DEFAULT_LAYOUT_SIZE, DEFAULT_MENU_ITEMS, DEFAULT_SETTINGS, DEFAULT_TABS, FULL_MENU_ITEMS, FULL_SETTINGS, FULL_TABS, MENU_PRESETS, MINIMAL_MENU_ITEMS, MINIMAL_SETTINGS, MINIMAL_TABS, Message, Notification, SETTINGS_PRESETS, TABS_PRESETS, THROTTLE_DEFAULTS, YdAdminResolver, ai_loader_default as YdAiLoader, anchor_default as YdAnchor, auto_complete_default as YdAutoComplete, avatar_default as YdAvatar, badge_default as YdBadge, breadcrumb_default as YdBreadcrumb, button_default as YdButton, calendar_default as YdCalendar, captcha_default as YdCaptcha, card_default as YdCard, cascader_default as YdCascader, chat_bubble_default as YdChatBubble, chat_page_default as YdChatPage, checkbox_default as YdCheckbox, checkbox_group_default as YdCheckboxGroup, code_block_default as YdCodeBlock, collapse_default as YdCollapse, color_picker_default as YdColorPicker, config_provider_default as YdConfigProvider, context_menu_default as YdContextMenu, conversation_default as YdConversation, crud_page_default as YdCrudPage, date_picker_default as YdDatePicker, date_range_picker_default as YdDateRangePicker, divider_default as YdDivider, drawer_default as YdDrawer, dropdown_default as YdDropdown, empty_default as YdEmpty, flow_chart_default as YdFlowChart, form_default as YdForm, form_item_default as YdFormItem, icon_default as YdIcon, image_default as YdImage, image_preview_group_default as YdImagePreviewGroup, input_default as YdInput, input_number_default as YdInputNumber, layout_default as YdLayout, layout_content_default as YdLayoutContent, layout_header_default as YdLayoutHeader, layout_sidebar_default as YdLayoutSidebar, list_default as YdList, loading_bar_default as YdLoadingBar, login_default as YdLogin, login_centered_default as YdLoginCentered, markdown_default as YdMarkdown, menu_default as YdMenu, modal_default as YdModal, model_selector_default as YdModelSelector, pagination_default as YdPagination, pin_input_default as YdPinInput, popconfirm_default as YdPopconfirm, progress_default as YdProgress, prompt_input_default as YdPromptInput, radio_default as YdRadio, radio_group_default as YdRadioGroup, rate_default as YdRate, reasoning_default as YdReasoning, result_default as YdResult, router_exports as YdRouter, SchemaForm_default as YdSchemaForm, select_default as YdSelect, skeleton_default as YdSkeleton, slider_default as YdSlider, sources_default as YdSources, space_default as YdSpace, spin_default as YdSpin, statistic_default as YdStatistic, stepper_default as YdStepper, steps_default as YdSteps, streaming_text_default as YdStreamingText, suggestion_default as YdSuggestion, switch_default as YdSwitch, table_default as YdTable, tabs_default as YdTabs, tag_default as YdTag, textarea_default as YdTextarea, time_picker_default as YdTimePicker, timeline_default as YdTimeline, tooltip_default as YdTooltip, transfer_default as YdTransfer, tree_default as YdTree, tree_select_default as YdTreeSelect, upload_default as YdUpload, watermark_default as YdWatermark, Z_INDEX, buildBreadcrumb, changeLocale, checkRoutePermission, clearKeyCache, cn, convertToSimpleRoute, createSecureStorage, createWatermark, debounce, decrypt, deepClone, dt, dynamicRouter, encrypt, filterMenuItems, findMenuItem, findMenuPath, flattenMenuItems, generateId, generateRouteTitle, generateSessionKey, getBreadcrumbPaths, getCurrentLocale, getIcon, getIconRegistry, getKeySource, i18n, initSecureStorage, isEmptyObject, isPathMatch, isStorageReady, joinPath, loadingBar, menuToRoutes, nf, normalizePath, registerIcon, registerLazyLocale, removeWatermark, resetStorageKey, rotateStorageKey, searchMenuItems, secureLocal, secureSession, secureStoragePlugin, setLocale, setSessionStorageEncryptionKey, setStorageEncryptionKey, setupI18n, signData, storageReady, supportedLocales, t, tc, themes, throttle, useConfig, useFormSchema, useFormValidate, useLoading, useLoadingBar, useLoginForm, useNamespace, verifyData };