build-dxf 0.1.14 → 0.1.16

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 (58) hide show
  1. package/package.json +1 -1
  2. package/src/DomEventRegister.js +472 -0
  3. package/src/build.js +3065 -3352
  4. package/src/index.css +1 -131
  5. package/src/index.js +10 -10
  6. package/src/index2.js +2 -155
  7. package/src/index3.js +6295 -2640
  8. package/src/utils/DxfSystem/DxfSystem.d.ts +0 -3
  9. package/src/utils/DxfSystem/components/CorrectionDxf.d.ts +26 -2
  10. package/src/utils/DxfSystem/components/Dxf.d.ts +3 -2
  11. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/ClippingLine.d.ts +1 -2
  12. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/CommandFlowComponent.d.ts +7 -2
  13. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DeleteSelectLine.d.ts +1 -1
  14. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DrawDoorLine.d.ts +2 -3
  15. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DrawLine.d.ts +3 -5
  16. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DrawWindow.d.ts +2 -3
  17. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/MergeLine.d.ts +1 -1
  18. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/PointDrag.d.ts +2 -3
  19. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/SelectAll.d.ts +1 -1
  20. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/{IntersectionConnectionLine.d.ts → TwoLineConnectionLine.d.ts} +3 -3
  21. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/{ConnectionLine.d.ts → TwoPointConnection.d.ts} +3 -3
  22. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/{VerticalCorrection.d.ts → VerticalCorr.d.ts} +2 -12
  23. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/{DeleteSelectWindow.d.ts → VerticalCorrContinue.d.ts} +10 -8
  24. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/VerticalReferenceLine.d.ts +1 -1
  25. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/ViewAngle.d.ts +1 -1
  26. package/src/utils/DxfSystem/plugin/Editor/components/index.d.ts +1 -1
  27. package/src/utils/DxfSystem/plugin/RenderPlugin/components/Renderer.d.ts +1 -0
  28. package/src/utils/DxfSystem/plugin/RenderPlugin/index.d.ts +1 -2
  29. package/src/utils/DxfSystem/type.d.ts +2 -0
  30. package/src/utils/DxfSystem/utils/DoorFind.d.ts +36 -0
  31. package/src/utils/{modelScenario → DxfSystem/utils}/SceneAutoGenerat.d.ts +3 -1
  32. package/src/utils/DxfSystem/utils/index.d.ts +1 -5
  33. package/src/utils/LineSegment.d.ts +9 -0
  34. package/src/utils/Map.d.ts +1 -0
  35. package/src/utils/MaxiCircles.d.ts +13 -0
  36. package/src/utils/MiniCircles.d.ts +33 -0
  37. package/src/utils/Point.d.ts +1 -1
  38. package/src/utils/{PointVirtualGrid/index.d.ts → PointVirtualGrid.d.ts} +5 -5
  39. package/src/utils/Polygon.d.ts +11 -0
  40. package/src/utils/UndirectedGraph.d.ts +4 -0
  41. package/src/utils/index.d.ts +4 -2
  42. package/src/bin/Main.js +0 -269
  43. package/src/bin/mini_cycles.js +0 -15
  44. package/src/bin/mini_cycles.wasm +0 -0
  45. package/src/bin/mini_cycles.wasm.map +0 -1
  46. package/src/bin/wasm_mini_cycles.js +0 -296
  47. package/src/index4.js +0 -4261
  48. package/src/utils/DxfSystem/components/DoorsAnalysis.d.ts +0 -115
  49. package/src/utils/DxfSystem/plugin/RenderPlugin/pages/Dxf.vue.d.ts +0 -21
  50. package/src/utils/DxfSystem/utils/closedPathArea.d.ts +0 -2
  51. package/src/utils/DxfSystem/utils/findClosedPolygons.d.ts +0 -14
  52. package/src/utils/DxfSystem/utils/findLargestCircle.d.ts +0 -14
  53. package/src/utils/DxfSystem/utils/mergeSmallestCircle.d.ts +0 -14
  54. package/src/utils/DxfSystem/utils/smallestCircle.d.ts +0 -6
  55. package/src/utils/deepClone.d.ts +0 -6
  56. package/src/utils/drawLinePathToPng.d.ts +0 -7
  57. /package/src/utils/{Lines.d.ts → DxfSystem/utils/Lines.d.ts} +0 -0
  58. /package/src/utils/{LoadModel.d.ts → DxfSystem/utils/LoadModel.d.ts} +0 -0
package/src/index4.js DELETED
@@ -1,4261 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- import * as THREE from "three";
5
- import { Vector2 } from "three";
6
- import { CSS3DObject, CSS3DSprite, CSS3DRenderer } from "three/addons/renderers/CSS3DRenderer.js";
7
- import { CSS2DObject, CSS2DRenderer } from "three/addons/renderers/CSS2DRenderer.js";
8
- import { OrbitControls } from "three/addons/controls/OrbitControls.js";
9
- import * as TWEEN from "@tweenjs/tween.js";
10
- import { C as Component, a as Point, V as Variable } from "./build.js";
11
- import { getCurrentInstance, inject, ref, computed, unref, shallowRef, watchEffect, readonly, getCurrentScope, onScopeDispose, onMounted, nextTick, isRef, warn, provide, defineComponent, createElementBlock, openBlock, mergeProps, renderSlot, createElementVNode, watch, toRef, onUnmounted, useSlots, Text, createBlock, resolveDynamicComponent, withCtx, createCommentVNode, Fragment, normalizeClass, reactive, toRaw, withDirectives, withModifiers, vModelCheckbox, createTextVNode, toDisplayString, normalizeStyle, toRefs } from "vue";
12
- class DomContainer extends Component {
13
- static name = "DomContainer";
14
- domElement = document.createElement("div");
15
- canvas = document.createElement("canvas");
16
- html2DRenderer = document.createElement("div");
17
- html3DRenderer = document.createElement("div");
18
- constructor() {
19
- super();
20
- this.domElement.id = "build-dxf-container";
21
- this.domElement.appendChild(this.canvas);
22
- this.domElement.appendChild(this.html3DRenderer);
23
- this.domElement.appendChild(this.html2DRenderer);
24
- Object.assign(this.domElement.style, {
25
- width: "100%",
26
- height: "100%",
27
- position: "relative",
28
- userSelect: "none"
29
- });
30
- Object.assign(this.html3DRenderer.style, {
31
- position: "absolute",
32
- left: 0,
33
- top: 0,
34
- // zIndex: 9,
35
- width: "100%",
36
- height: "100%"
37
- });
38
- Object.assign(this.html2DRenderer.style, {
39
- position: "absolute",
40
- left: 0,
41
- top: 0,
42
- // zIndex: 10,
43
- width: "100%",
44
- height: "100%"
45
- });
46
- }
47
- }
48
- const circlePng = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3wgaExY5fZXYlgAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUHAAASFUlEQVR42u1bS48bR5KOR2ZV8dHsh97WeD2Y82IxEI996YMAw/9jftb8j8ECPVgBgz74QP+AgS0YMNAtW61+kyxWZkbsIbPIYrHYLcmaxQK7BFJksyiy4osvIiPjAfD/j//bD/ySX/aXv/wFW9+LD6zmQxvP9y3461//qv+rAGgJXi96YDVBaAoo96z6OnwpMPALCl4Lxem1Sa9N6zWn1WZBLWQAAN94br6ur0sTtN8DAn4hjVNDMNtYWWvZw/HYQrHDvZ5h8IBgADx4BQ/inPNlWfrJZOIAwAFA1XiuXzdBCb8XCPwdwjfpbJLAeVoFABRjgN7O0VGR93qFZVswY27IZMhoAMEg4NIEFDSogBcJVQihEucWpXPl5eW8nExO5gBQprVIqwYptEzkk8wCP0N4bFDdNDTdS2tweHg4GI6GwyIrBsbagWHuE1GPiQogyhAxIwRGQEp3KqoaVNWpqhORUkTKEPxcJEzdwk1nZTm9PD6eTgCmADADgHkComowogbio0HAzxCeGlSvBe8DwPDo8Gg03B+OcpuPTGZGhs0OMw+JaYCEPSIuECAnjAyAyAAEAFHQAAJeQSsRXajKXCTMQpBp8OHOeXfjnLspp+XNf16e38JkcgsrMGog1sziY0DAzxDeJMHzJPjOeHw4evFitJ/n/b3M2n02Zt8Ys8tEO0g8JMI+EfUQMUdECwAGERkBUREAVFUVBEB9YkGlqqWqzIPoVEK4CyFce++vnXNXVbW4nE5nV8fHx1cAcAsAd4kRVcMsPgoE/AThuSF8DwAGALD7+vXr/cFg56Ao8kfWmsfGmANm3mPmXSIaEtEAEQsiyhHRYtQ8AwAhIAFG+WsPr6BeRb2qViJSqupcRO5CCLchhOsQwqV37sPCVR8W5eLD2dnlxWRycg0ANw021M7yQRDwE4XPk/A7Y4C9p99992gw6D/JsvyJtfaJYfOIDR8w8S4S7TBTn4gKQMgIySKiAQBGREKA5AMVQUE17fGquuYPVHQhKvMQwp2I3obgr0IIH7xz55Vz78v5/P31zc35mzdvLgDgOplF+bEg4EfSvrb3PgCMxoeHBy/29x/3er1neZ4/s9Y+ZeYnxpgDIt5jpiFRFB4RLSFZQGBCJEAkROyMBGsmJBBEVbyIOlWpRHQuItPEhMsEwm8L535dlOWvt7e3vx0fH38AgKtkEmXDL2x1jOYTbD4KPz48ePno0dNer/c8y7IX1trnxpinzHxgmPeIeUhEfUTMicgSESMiQ9I6IiIg1tI3I0GI8kcg4oOESIOIOEIpAlKPkHoUTaqIPoUyQjRARK9fv8bj4+PO8LkRQa49+IF9vmnzo/F4fPDi5bNn/V7/RZ7nL7M8e2mNfWGMeWqtfcTMu8w8ZOYeM+dEZJnIIDEzERERxn8RiRDT30jxD4zvE+HqQYjIiMhIZBAxLiIb/QmadA0JAMgY/cPLl+Ht27fS2BGWUeOrV6/ghx9+uB+AV69e1dqv9/geAAwBYH88/vPTQX/4VZ5lL22WvTTWvjDWPEmOb5eZ+8xcMHPGRIZqsVfCR6kiBIgtSZeyE0L9SYisIYhvcVq1L0nPQIQICCiGSJ49f+5//vln3xUktUEwD+z1S+1/9+13B0Vv8DTLsufGZi+MNc+N4SfMZp+Jdpi5IKKMiAwhEq6EjSJESQBT8IeIbQ8Q1RStAFUVVBUQEVQVURAFdYkXABAgkAGDAKCgIKoQVNWPRrtuPB67yWTSBYJuZUDSftvud4+Ojh7t7u0+L4reyyzLXlobac+GDzgGOz0iyonIEBEnzSMz1xQHIoKoWQJEjH8nQBARID0T4dr7tcSw2jZWrABIThUoBVUKAAGRQp7n7p///Gc7XN4wBfOA9vswhtFoNDrIsuxJZuxTY8wTZn7EzHtMPGSiHhFlzGSImFYU7xByyYLuDSg5Qai131yogAKa3OjSiRbxP7AwQ9o6oVKVMoRi/vr16/nx8XHZCpCkyQLu0D43orzdb//j28eDweB5ludfWWu/MsY8N8Y8MswjMqbPRDkxGSamhlMDYoZa80sGNEDZDs72BUtjAlSorQobJ1NV1Xh0VoAKARbD4XBxdnbm2hFizQJzT5zfG48Ph0XR38sy+8gwPzKGD5YRHlOPo80zEy9dd1PYpqDwgA9oaj/Z/cYCABARRCRlBlrtnlqoamA2uyK6EOFZZsytz7Lbx48f36XgaN7FAm5pnxqOb/fPf/73R4NB8SzLiq+Wds+8b4zZYeaCiQ0l1a/ZehK8DUQ3C6Ly7mcDtEHDVjC3llhRjYcqUChFZT4cDsuzs7NFOzB69erV2i6wHvKOx/0sy0bGZHuN2H6HiPqEmCGSQcJa+C0CIiBSS5Dk8Bo/W8vV1v7qQUCkICJASFFNAKgKgKhERKyqVlULIhow00gC77E1e5m1u/v7jy+TUmcJBKpBMB2ZHQsAxdHOft/abIeZR8Q0IsKdFN7mSGRTTIMNT32vjW9oOKp0zQRq4WttqyqoyDKEi2GBAMpyx0AAAlUlJDIoYik65QExjTjQyNpsVBT5MDnMrJGyQwBQ6mCABYB8OLR9a3jIzDuMNCTiKDwuw1taBTG0XWAiwC6/0Pr8NtOJn0vX1r537TXGwJJMikV6kQm8w8zDPLeDw8PDXgLANJOyppXUZACwYxgXbLM+MQ+IeBifqUDEDAlNI2Jd3kxkdn1TDWE3tB8p394K2wxoPogARNZ9AylFv4+KhASKWkeKFhFzXDFhQMYMhr1hFwDQCcDOUZFbMj0m7hNBDxGLOplB7RgWCRAQENZt/YHtbGMX2BAe148vbeeoqC3Q184OlgmLQBiZQNSzhS0eYsDSCeb5MGND6cRFBRHlAGAofjnhalNeJrUeEroLBIDoDBXWBUdFEJUGQWp2bP0NREStASAkI0CW4r0XTNRj5rwFAAFAoDVXmwAgshmhyZAwxzqTQ2Tqszw24o9t2l2uewIcomg+a/4BI7UR2maDnVtm4zexETYbJLSImCVzyIkoPzw8tO26RNcuYKwlg4QZImaYChuUMjm12poCNm15g+ZbGYCAHekY1foHNn1D/L+aPrNpHomKlO7TAIBFxIwIM2a21lrTLsp0AUDLc/dqUTOhsSlgGxDotPVuM4COEiG2hIfNLbL7jFH7V0IAQopHZ4QohzGGG/TfOA6vQKAlEOu1vPVIrFuClsBdr9ffw/YJdSMWQIQ1++/aKTa+GDEmXQEYARmAGHizLkkdOUKkmI5YfrCp2I8rNmCHoCt81vxABxu2s+P+3C52X0BI4QQDtz+CbQBgvFneBv3kipvec6V1CAJ9WKMPyp8OUvfjpiGEzRij/aEJgIKIKKgoaDuLop8kvq5Tepn56TjldZnAx77fcXdr5XZVFQFRAN6Qx7S+RgFAgkJQhQCylliUeAOrxNWmOldprFq72HBoS3pra+9vJUGa39UWfO11t/QxoQyxvgAAAWpZ/ELa2WLTFh4AAogGUPUaS1UhrQRC4x6hpc2Gs9g43KStTes9TB/IBHVca4MVQVptn3UyHQAk5gjVq6gTEKcqzrtlEbUTgGVzggvOiUiVanRVA4jlb9xH35Xnbnhz0JVJJGao6hoW25IgbYDuMQ1NDBAAiHVG0EpFq6BS3cKtb+cH2yYQAXCu0hAWolKq6iIB4VU1RKWrqip23XQtWLysAF3b1mqrXzOELgC2AbK+msUUFVX1oupAdSGipaiWwYVqcjJxjU6TrQxw8/l84Xd3SwkyT7X6BZA6VQ21Y0w/CqqrFHY0g6jplZ0IaNPXag3KWshwb0I00Xs7KCpNBEKkviwkVZglhLlzruwqoVPLBwQAcCcnJwvn3SxImInKTEXnEpngRCRIrNt9lMZUFFQlJjZElk5ENf2dlqounzfXA7+1qqcFEVlWlkVkJiIzH/ysAcDDDACA0lVuLiFMNeidsEw1FicrIvIqYhRRN7S/RlNZ7rIiKQBqOchtSdEmE7aDsgRHRURFREQlqKoT1VJEZyoy9SHcBR+ml5eX8w4ANnyAJAAW8/l82u8Pbq31Nyx8GyRMSWmuqoWIWiLlmKHFNTMQESCiKDTpZqBxT+ID4GG6twBJm0GqJktsr1GRmUi48yI3IYRb59x0Mpl0AQDUtQsAQPnmzZuZc9Vt8P4mhHAjIrciMpMQSlVxIhJUVURENWpgReUl/ddp3qR6UxCR+r1ujUstuOja/0+rfvi0c6VeArkOwV97567v7spmB0noMoEmCD59cDabzW6zLL8yNlyGEPaIaESEPRTJsU6OQKzZUeNmSQQk5fe6tF+f99ssuN8RRv8hDe3X1FdVLyKViMyDyF0QuQ4hXHnnr6qqunnz5rjdL7BsmqBW40ATgPnx8eWtc9W18/4yhHApQa5CSEyIP+iT9YnULAhhQ9Mbjk42r20sbX9HZEpilUa5VUQkiIgTkbmI3IlPbTTeXzjnLmazWbNrpBkIQRcDtOEI5wCTu+l0/8pau2OId4hpgAF7iJTXeYKUHDDL4yURisg9pS5IMQLcG+93275AtLil4wsi4kIIZeoeuQ4SLoL3586587KqLo+Pj28a9QD/UG2wfZSkt2/f8jd/+hNbYywjWYhpJlPX5ht5g41cyLaTizbjBNi2dW46vqTzWngfQqh7Cu9S28x77927qnKnZVW++3B1/f6Xn3++TJ1kdfOUNHuGlgD88MMP8OrVq66yEz178oSyImMiNtzo1IDY6kbrIGjz+NxVAq737Xv29VYMIJqOdBJ3PZUQQqhiM2W4CyFchRDOvfe/OudOF4vF2d3t3a//9fe/f2h0jzXtf1ke7+oP2Ego/PLLL/D1H75Gaw2vta0kwXE9y1KHyG0gNw45m5pv2X0Uetk1ldxNSP6nDCFMQwhX3vtz7/2v3rvTxcKdzmazd3/729/OU8PUNGnft7W/AUCDBRun7bdv3+Ifv/63uuxdt33QlhmAhsC6pPna+9qgfyNCTHRPB1pRXWpeQtrqFrXD8yFchiR81Hx1Wpbzs9OL0/dnv5zV1C+bpfF2p9hGj9AWEAAA9MeffoJvvvlGOXV7NAweoTPDq0s5oXmA2MqA5fYGDUdXb3MuCT8TkdsQ/GWT9tVicTqfz9+dn5+///7k+4sk/Hwb9bcC0DKF9hSH/Pjjj5pAECRaDTEoaqzXLlMZUh/a66AN1k9tqwsrhq+IvtJ4ley97hi99iFc+ODfe+/fOefOqqo6nc9nZ+fXH347+cdJl93LtmbJTgDuMYUahPD1118HIoonK8SAAEEV/CoLo6KgITnvsGp+jMK2/pZ0kAki6lOkWYnIIm1xdyGEW+9Tl6j3773z76qqOquq8nQ+L88+fPjw/uQfJxct4f026t8LQAcI7ZGW8NNPP4WXL196IvCq6ADUQUxAxCXqFMCpqgMAL7LMMHmNmg0i6uISJyIuneIWjZPcNIRwE728XIQQzr1zv4bgzypXnS0W5dl8Xr47PT09//777y86+oVlG/U/p1m6ORhRpGbpncPDw939/f2DoigOsix7ZIzZZ+Z9Zt5l4h2i1CofS1Sx0oRoGp1dAOt9wjGTszzP60yC3AXxNyHItfPuwrtwUVbzD9Pb6UXqGL/u6Bj/qNmBz2mX58Z0SN01Pnr97etRvxjs5Vm2Z43dY2t2mXnERENC7CNRj5ByJMgA0CAgA9aHsUZzU90uL1pKnBm4C0HuvA/Xwftr593VbDG7ujn77epkMrlJgk9bwxMfPTjxOQMT7db5BhDjnW+/fbxT5MWOzezIGDNk5iETD4gpltkJcwSyiMtOjWU6btkhrroIIQ5MSJBp8O6u8v7WufLm8u7m9uTNST0jMGuM0bTniOCLDUzcMy/UHJIq0uoDQP/o9dFgWAz7bO3AMPUMmx4SFYSUEYFFRKOAGCvfdYs8+NQZvvAhlEFkHhZutnCL2fn53XQyOZk1xmXK1mzAZ80N/Z6hKdwCRNYcnIIxFEc7R3me57m1NqfU6EwUu8viEVQEBEQk+BDABecqF9zicj5fTE5OmsNSZWuCbKMh+lMnxz57brBlEtiouzeHqWpAmqN0BgDMeDymoiioLMtYkZqAAEzqhIy7Z7X7fz9rWuxfMTiJHazgjoFJbk2PbhZmNld7aHKtxPU/Pjj5kUBsG6HFlvDQAYJC98jsF58h/lcNT0PH4ei+wek2CLBl6uOLD0//NxKXqwa3BaHgAAAAAElFTkSuQmCC";
49
- THREE.Object3D.DEFAULT_UP = new THREE.Vector3(0, 0, 1);
50
- const circleTexture = new THREE.TextureLoader().load(circlePng);
51
- const _Renderer = class _Renderer extends Component {
52
- scene;
53
- camera;
54
- renderer;
55
- orbitControls;
56
- resizeObserver;
57
- description;
58
- html2DRenderer;
59
- html3DRenderer;
60
- container = new THREE.Group();
61
- onUpdate;
62
- onResize;
63
- width = 0;
64
- height = 0;
65
- tweenTaskList = [];
66
- constructor(description) {
67
- super();
68
- this.description = description;
69
- const {
70
- scene = new THREE.Scene(),
71
- camera = new THREE.PerspectiveCamera(45, 1, 0.01, 1e3)
72
- } = description;
73
- this.camera = camera;
74
- this.scene = scene;
75
- scene.add(this.container);
76
- this.renderer = new THREE.WebGLRenderer({
77
- canvas: this.description.canvas,
78
- antialias: true
79
- });
80
- this.renderer.setPixelRatio(window.devicePixelRatio);
81
- if (description.htmlRenderer) {
82
- if (description.htmlRenderer["2d"]) {
83
- this.html2DRenderer = new CSS2DRenderer();
84
- Object.assign(this.html2DRenderer.domElement.style, { position: "absolute", left: "0px", top: "0px" });
85
- description.htmlRenderer["2d"].appendChild(this.html2DRenderer.domElement);
86
- }
87
- if (description.htmlRenderer["3d"]) {
88
- this.html3DRenderer = new CSS3DRenderer();
89
- Object.assign(this.html3DRenderer.domElement.style, { position: "absolute", left: "0px", top: "0px" });
90
- description.htmlRenderer["3d"].appendChild(this.html3DRenderer.domElement);
91
- }
92
- }
93
- if (description.orbitControls) {
94
- this.orbitControls = new OrbitControls(this.camera, description.orbitControls.domElement);
95
- Object.assign(this.orbitControls, description.orbitControls);
96
- }
97
- if (this.description.resizeObserver) {
98
- const dom = this.description.resizeObserver;
99
- this.resizeObserver = new ResizeObserver(() => {
100
- const camera2 = this.camera;
101
- const { width, height } = dom.getBoundingClientRect();
102
- this.renderer.setSize(width, height);
103
- if (this.html2DRenderer) this.html2DRenderer.setSize(width, height);
104
- if (this.html3DRenderer) this.html3DRenderer.setSize(width, height);
105
- if (this.orbitControls) {
106
- if (camera2 instanceof THREE.PerspectiveCamera) {
107
- camera2.aspect = width / height;
108
- } else if (camera2 instanceof THREE.OrthographicCamera) {
109
- camera2.left = -width * 0.5;
110
- camera2.right = width * 0.5;
111
- camera2.top = height * 0.5;
112
- camera2.bottom = -height * 0.5;
113
- }
114
- camera2.updateProjectionMatrix();
115
- }
116
- this.width = width;
117
- this.height = height;
118
- this.onResize && this.onResize(width, height);
119
- this.dispatchEvent({ type: "resize", width, height });
120
- });
121
- this.resizeObserver.observe(dom);
122
- }
123
- this.renderer.setAnimationLoop(() => {
124
- if (this.html2DRenderer) this.html2DRenderer.render(this.scene, this.camera);
125
- if (this.html3DRenderer) this.html3DRenderer.render(this.scene, this.camera);
126
- this.render();
127
- if (this.orbitControls && this.orbitControls.enabled) this.orbitControls.update();
128
- this.tweenTaskList.forEach((tween) => tween.update());
129
- this.onUpdate && this.onUpdate();
130
- this.parent?.components.forEach((c) => c.dispatchEvent({ type: "update" }));
131
- });
132
- this.scene.add(new THREE.AmbientLight(16777215, 0.5));
133
- this.scene.background = new THREE.Color(3355443);
134
- const directLight = new THREE.DirectionalLight(16777215, 4);
135
- directLight.position.set(100, -100, 100);
136
- this.scene.add(directLight);
137
- }
138
- render() {
139
- this.renderer.render(this.scene, this.camera);
140
- }
141
- /**
142
- * 世界坐标转屏幕坐标
143
- * @param worldPosition
144
- * @param camera
145
- * @param renderer
146
- * @returns
147
- */
148
- worldToScreenPosition(worldPosition) {
149
- const vector = new THREE.Vector3();
150
- vector.copy(worldPosition);
151
- vector.project(this.camera);
152
- const x = (vector.x * 0.5 + 0.5) * this.renderer.domElement.clientWidth;
153
- const z = (-vector.z * 0.5 + 0.5) * this.renderer.domElement.clientHeight;
154
- return new THREE.Vector2(x, z);
155
- }
156
- cameraPositionRecord = [];
157
- /**
158
- * 相机
159
- * @param position
160
- * @param lookAt
161
- * @param onEnd
162
- */
163
- cameraTo(position, lookAt, onEnd) {
164
- this.cameraPositionRecord.push([
165
- this.camera.position.clone(),
166
- this.camera.quaternion.clone()
167
- ]);
168
- const tween = new TWEEN.Tween(this.camera.position);
169
- tween.to(position, 600);
170
- tween.start();
171
- tween.onUpdate(() => {
172
- this.camera.lookAt(lookAt);
173
- });
174
- tween.onComplete(() => {
175
- const i = this.tweenTaskList.indexOf(tween);
176
- this.tweenTaskList.splice(i, 1);
177
- onEnd && onEnd();
178
- });
179
- this.tweenTaskList.push(tween);
180
- }
181
- cameraBack() {
182
- if (this.cameraPositionRecord.length) {
183
- const [pos, quat] = this.cameraPositionRecord.pop();
184
- this.camera.position.copy(pos);
185
- this.camera.quaternion.copy(quat);
186
- }
187
- }
188
- /**
189
- * 创建点
190
- * @param pos
191
- */
192
- createPointMesh(pos, size = 0.02, parameters, parent = this.container) {
193
- const box = new THREE.Mesh(
194
- new THREE.SphereGeometry(size),
195
- new THREE.MeshBasicMaterial(parameters)
196
- );
197
- if (pos instanceof Point) box.position.set(pos.x, pos.y, 0);
198
- else if (pos instanceof THREE.Vector3) box.position.copy(pos);
199
- parent.add(box);
200
- return box;
201
- }
202
- /**
203
- * 创建文本
204
- * @param text
205
- * @param pos
206
- * @param style
207
- */
208
- createText(text, pos, style, parent = this.container) {
209
- const div = document.createElement("div");
210
- div.innerHTML = text;
211
- div.style.pointerEvents = "none";
212
- Object.assign(div.style, { fontSize: "10px", color: "#ffffff", ...style });
213
- const css2DObject = new _Renderer.CSS2DObject(div);
214
- if (pos instanceof Point) css2DObject.position.set(pos.x, pos.y, 0);
215
- else if (pos instanceof THREE.Vector3) css2DObject.position.copy(pos);
216
- parent.add(css2DObject);
217
- return css2DObject;
218
- }
219
- /**
220
- * 创建几何缓冲区
221
- * @param map
222
- * @param count
223
- */
224
- createLineSegments(map, count, parameters, parent = this.container) {
225
- if (Array.isArray(map)) {
226
- const position = map.flatMap((line) => line?.points?.flatMap((p) => [p.x, p.y, 0]));
227
- return this.createLineSegments({ position }, map.length * 2, parameters, parent);
228
- }
229
- const geometry = new THREE.BufferGeometry();
230
- Object.keys(map).forEach((key) => {
231
- const value = map[key];
232
- geometry.setAttribute(key, new THREE.BufferAttribute(new Float32Array(value), value.length / count));
233
- });
234
- const lineSegmentList = new THREE.LineSegments(geometry, new THREE.LineBasicMaterial({ ...parameters }));
235
- parent.add(lineSegmentList);
236
- return lineSegmentList;
237
- }
238
- /** 创建点
239
- * @param point
240
- * @param parameters
241
- * @param parent
242
- * @returns
243
- */
244
- createCircle(point, parameters, parent) {
245
- const vertices = [];
246
- if (Array.isArray(point)) point.forEach((p) => vertices.push(p.x, p.y, 0));
247
- else vertices.push(point.x, point.y, 0);
248
- const geometry = new THREE.BufferGeometry();
249
- geometry.setAttribute("position", new THREE.Float32BufferAttribute(vertices, 3));
250
- const material = new THREE.PointsMaterial({
251
- color: 16777215,
252
- sizeAttenuation: false,
253
- size: 12,
254
- map: circleTexture,
255
- transparent: true,
256
- ...parameters
257
- });
258
- const points = new THREE.Points(geometry, material);
259
- parent && parent.add(points);
260
- return points;
261
- }
262
- destroy() {
263
- if (this.resizeObserver) {
264
- this.renderer.dispose();
265
- this.resizeObserver.disconnect();
266
- this.resizeObserver = void 0;
267
- }
268
- }
269
- };
270
- __publicField(_Renderer, "name", "Renderer");
271
- __publicField(_Renderer, "CSS2DObject", CSS2DObject);
272
- __publicField(_Renderer, "CSS3DObject", CSS3DObject);
273
- __publicField(_Renderer, "CSS3DSprite", CSS3DSprite);
274
- __publicField(_Renderer, "Group", THREE.Group);
275
- __publicField(_Renderer, "Object3D", THREE.Object3D);
276
- __publicField(_Renderer, "Mesh", THREE.Mesh);
277
- __publicField(_Renderer, "Line", THREE.Line);
278
- __publicField(_Renderer, "LineSegments", THREE.LineSegments);
279
- __publicField(_Renderer, "Points", THREE.Points);
280
- let Renderer = _Renderer;
281
- class DomEventRegister extends Component {
282
- static name = "DomEventRegister";
283
- cancelDefaultBehaviorList = [];
284
- pointer = new Vector2();
285
- _isMouseEnter = false;
286
- set isMouseEnter(isMouseEnter) {
287
- if (this._isMouseEnter === isMouseEnter) return;
288
- this._isMouseEnter = isMouseEnter;
289
- }
290
- get isMouseEnter() {
291
- return this._isMouseEnter;
292
- }
293
- _mouseMoveEventProxylock = false;
294
- set mouseMoveEventProxylock(lock) {
295
- this._mouseMoveEventProxylock = lock;
296
- if (lock) {
297
- this._isMouseEnter = false;
298
- }
299
- }
300
- get mouseMoveEventProxylock() {
301
- return this._mouseMoveEventProxylock;
302
- }
303
- /**
304
- * 组件被添加到父组件上时调用
305
- */
306
- onAddFromParent() {
307
- this.initMouseMoveEventProxy();
308
- this.initKeyEvent();
309
- this.initWheelEvent();
310
- this.autoBodyCursor();
311
- }
312
- /**
313
- * 初始化鼠标事件代理(判断鼠标是否在domElement上)
314
- */
315
- initMouseMoveEventProxy() {
316
- const domContainer = this.parent?.findComponentByType(DomContainer), domElement = domContainer.domElement, variable = this.parent?.findComponentByType(Variable), globalMousemoveFun = (e) => {
317
- if (this._mouseMoveEventProxylock) return;
318
- const rect = domElement.getBoundingClientRect(), offsetX = e.clientX - rect.left, offsetY = e.clientY - rect.top;
319
- if (offsetX >= 0 && offsetY >= 0 && offsetX <= rect.width && offsetY <= rect.height) {
320
- this.pointer.set(offsetX, offsetY);
321
- this.dispatchEvent({
322
- type: "mousemove",
323
- x: offsetX,
324
- y: offsetY,
325
- moveX: e.movementX,
326
- moveY: e.movementY
327
- });
328
- this.isMouseEnter = true;
329
- } else {
330
- this.isMouseEnter = false;
331
- }
332
- }, globalMousedownFun = (e) => {
333
- if (!this.isMouseEnter) return;
334
- const rect = domElement.getBoundingClientRect(), offsetX = e.clientX - rect.left, offsetY = e.clientY - rect.top;
335
- this.pointer.set(offsetX, offsetY);
336
- variable.set("currentMouseDown", "mouse_" + e.button);
337
- this.dispatchEvent({
338
- type: "mousedown",
339
- x: offsetX,
340
- y: offsetY
341
- });
342
- }, globalMouseupFun = (e) => {
343
- if (!this.isMouseEnter) return;
344
- variable.set("currentMouseUp", "mouse_" + e.button);
345
- };
346
- document.addEventListener("mousemove", globalMousemoveFun);
347
- document.addEventListener("mousedown", globalMousedownFun);
348
- document.addEventListener("mouseup", globalMouseupFun);
349
- this.addEventRecord("destory", () => {
350
- document.removeEventListener("mousemove", globalMousemoveFun);
351
- document.removeEventListener("mousedown", globalMousedownFun);
352
- document.removeEventListener("mouseup", globalMouseupFun);
353
- });
354
- }
355
- /**
356
- * 初始化键盘事件
357
- */
358
- initKeyEvent() {
359
- const variable = this.parent?.findComponentByType(Variable);
360
- document.body.tabIndex = 1;
361
- const onKeyup = (e) => {
362
- if (!this.isMouseEnter) return;
363
- const key = e.key.toLocaleLowerCase();
364
- variable.set("currentKeyUp", key);
365
- for (let i = 0; i < this.cancelDefaultBehaviorList.length; i++) {
366
- const element = this.cancelDefaultBehaviorList[i];
367
- if (element(e)) e.preventDefault();
368
- }
369
- };
370
- document.body.addEventListener("keyup", onKeyup);
371
- const onKeydown = (e) => {
372
- if (!this.isMouseEnter) return;
373
- const key = e.key.toLocaleLowerCase();
374
- variable.set("currentKeyDown", key);
375
- for (let i = 0; i < this.cancelDefaultBehaviorList.length; i++) {
376
- const element = this.cancelDefaultBehaviorList[i];
377
- if (element(e)) e.preventDefault();
378
- }
379
- };
380
- document.body.addEventListener("keydown", onKeydown);
381
- const onFocus = () => variable.set("focus", true);
382
- document.body.addEventListener("focus", onFocus);
383
- const onBlur = () => variable.set("focus", false);
384
- document.body.addEventListener("blur", onBlur);
385
- this.addEventRecord("destory", () => {
386
- document.body.removeEventListener("keyup", onKeyup);
387
- document.body.removeEventListener("keydown", onKeydown);
388
- document.body.removeEventListener("focus", onFocus);
389
- document.body.removeEventListener("blur", onBlur);
390
- });
391
- }
392
- /**
393
- * 初始化滚轮事件
394
- */
395
- initWheelEvent() {
396
- const variable = this.parent?.findComponentByType(Variable);
397
- const onWheel = (e) => variable.set("currentWheel", e.wheelDelta);
398
- document.body.addEventListener("wheel", onWheel);
399
- this.addEventRecord("destory", () => {
400
- document.body.removeEventListener("wheel", onWheel);
401
- });
402
- }
403
- /**
404
- * 根据domElement的cursor自动设置body的cursor
405
- */
406
- autoBodyCursor() {
407
- const domContainer = this.parent?.findComponentByType(DomContainer), domElement = domContainer.domElement;
408
- let bodyCursor = null;
409
- this.addEventListener("update", () => {
410
- if (this._mouseMoveEventProxylock) return;
411
- if (this.isMouseEnter) {
412
- if (bodyCursor === null) {
413
- bodyCursor = document.body.style.cursor;
414
- }
415
- document.body.style.cursor = domElement.style.cursor;
416
- } else {
417
- if (bodyCursor !== null) {
418
- document.body.style.cursor = bodyCursor;
419
- bodyCursor = null;
420
- }
421
- }
422
- });
423
- this.addEventRecord("destory", () => {
424
- document.body.style.cursor = bodyCursor ?? "";
425
- });
426
- }
427
- /**
428
- *
429
- * @param callBack
430
- */
431
- addCancelDefaultBehavior(callBack) {
432
- this.cancelDefaultBehaviorList.push(callBack);
433
- return this;
434
- }
435
- /**
436
- *
437
- * @param el
438
- * @param callBack
439
- * @param offset
440
- * @param condition
441
- */
442
- static dragMoveHelper(el, callBack, offset = { x: 0, y: 0 }, condition = () => true) {
443
- function onMousedown() {
444
- if (!condition()) return;
445
- const move = (e) => {
446
- offset.x += e.movementX;
447
- offset.y += e.movementY;
448
- callBack({ ...offset }, e.movementX, e.movementY);
449
- };
450
- const end = () => {
451
- document.removeEventListener("mousemove", move);
452
- document.removeEventListener("mouseup", end);
453
- };
454
- document.addEventListener("mousemove", move);
455
- document.addEventListener("mouseup", end);
456
- }
457
- el.addEventListener("mousedown", onMousedown);
458
- callBack({ ...offset }, 0, 0);
459
- return () => {
460
- el.removeEventListener("mousedown", onMousedown);
461
- };
462
- }
463
- destroy() {
464
- this.canceEventRecord("destory");
465
- }
466
- }
467
- const configProviderContextKey = Symbol();
468
- const defaultNamespace = "el";
469
- const statePrefix = "is-";
470
- const _bem = (namespace, block, blockSuffix, element, modifier) => {
471
- let cls = `${namespace}-${block}`;
472
- if (blockSuffix) {
473
- cls += `-${blockSuffix}`;
474
- }
475
- if (element) {
476
- cls += `__${element}`;
477
- }
478
- if (modifier) {
479
- cls += `--${modifier}`;
480
- }
481
- return cls;
482
- };
483
- const namespaceContextKey = Symbol("namespaceContextKey");
484
- const useGetDerivedNamespace = (namespaceOverrides) => {
485
- const derivedNamespace = namespaceOverrides || (getCurrentInstance() ? inject(namespaceContextKey, ref(defaultNamespace)) : ref(defaultNamespace));
486
- const namespace = computed(() => {
487
- return unref(derivedNamespace) || defaultNamespace;
488
- });
489
- return namespace;
490
- };
491
- const useNamespace = (block, namespaceOverrides) => {
492
- const namespace = useGetDerivedNamespace(namespaceOverrides);
493
- const b = (blockSuffix = "") => _bem(namespace.value, block, blockSuffix, "", "");
494
- const e = (element) => element ? _bem(namespace.value, block, "", element, "") : "";
495
- const m = (modifier) => modifier ? _bem(namespace.value, block, "", "", modifier) : "";
496
- const be = (blockSuffix, element) => blockSuffix && element ? _bem(namespace.value, block, blockSuffix, element, "") : "";
497
- const em = (element, modifier) => element && modifier ? _bem(namespace.value, block, "", element, modifier) : "";
498
- const bm = (blockSuffix, modifier) => blockSuffix && modifier ? _bem(namespace.value, block, blockSuffix, "", modifier) : "";
499
- const bem = (blockSuffix, element, modifier) => blockSuffix && element && modifier ? _bem(namespace.value, block, blockSuffix, element, modifier) : "";
500
- const is = (name, ...args) => {
501
- const state = args.length >= 1 ? args[0] : true;
502
- return name && state ? `${statePrefix}${name}` : "";
503
- };
504
- const cssVar = (object) => {
505
- const styles = {};
506
- for (const key in object) {
507
- if (object[key]) {
508
- styles[`--${namespace.value}-${key}`] = object[key];
509
- }
510
- }
511
- return styles;
512
- };
513
- const cssVarBlock = (object) => {
514
- const styles = {};
515
- for (const key in object) {
516
- if (object[key]) {
517
- styles[`--${namespace.value}-${block}-${key}`] = object[key];
518
- }
519
- }
520
- return styles;
521
- };
522
- const cssVarName = (name) => `--${namespace.value}-${name}`;
523
- const cssVarBlockName = (name) => `--${namespace.value}-${block}-${name}`;
524
- return {
525
- namespace,
526
- b,
527
- e,
528
- m,
529
- be,
530
- em,
531
- bm,
532
- bem,
533
- is,
534
- cssVar,
535
- cssVarName,
536
- cssVarBlock,
537
- cssVarBlockName
538
- };
539
- };
540
- /**
541
- * @vue/shared v3.5.18
542
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
543
- * @license MIT
544
- **/
545
- !!(process.env.NODE_ENV !== "production") ? Object.freeze({}) : {};
546
- !!(process.env.NODE_ENV !== "production") ? Object.freeze([]) : [];
547
- const NOOP = () => {
548
- };
549
- const hasOwnProperty$a = Object.prototype.hasOwnProperty;
550
- const hasOwn = (val, key) => hasOwnProperty$a.call(val, key);
551
- const isArray$1 = Array.isArray;
552
- const isFunction$1 = (val) => typeof val === "function";
553
- const isString$1 = (val) => typeof val === "string";
554
- const isObject$1 = (val) => val !== null && typeof val === "object";
555
- var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
556
- var freeSelf = typeof self == "object" && self && self.Object === Object && self;
557
- var root = freeGlobal || freeSelf || Function("return this")();
558
- var Symbol$1 = root.Symbol;
559
- var objectProto$c = Object.prototype;
560
- var hasOwnProperty$9 = objectProto$c.hasOwnProperty;
561
- var nativeObjectToString$1 = objectProto$c.toString;
562
- var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : void 0;
563
- function getRawTag(value) {
564
- var isOwn = hasOwnProperty$9.call(value, symToStringTag$1), tag = value[symToStringTag$1];
565
- try {
566
- value[symToStringTag$1] = void 0;
567
- var unmasked = true;
568
- } catch (e) {
569
- }
570
- var result = nativeObjectToString$1.call(value);
571
- if (unmasked) {
572
- if (isOwn) {
573
- value[symToStringTag$1] = tag;
574
- } else {
575
- delete value[symToStringTag$1];
576
- }
577
- }
578
- return result;
579
- }
580
- var objectProto$b = Object.prototype;
581
- var nativeObjectToString = objectProto$b.toString;
582
- function objectToString(value) {
583
- return nativeObjectToString.call(value);
584
- }
585
- var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
586
- var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : void 0;
587
- function baseGetTag(value) {
588
- if (value == null) {
589
- return value === void 0 ? undefinedTag : nullTag;
590
- }
591
- return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
592
- }
593
- function isObjectLike(value) {
594
- return value != null && typeof value == "object";
595
- }
596
- var symbolTag$1 = "[object Symbol]";
597
- function isSymbol(value) {
598
- return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag$1;
599
- }
600
- function arrayMap(array, iteratee) {
601
- var index = -1, length = array == null ? 0 : array.length, result = Array(length);
602
- while (++index < length) {
603
- result[index] = iteratee(array[index], index, array);
604
- }
605
- return result;
606
- }
607
- var isArray = Array.isArray;
608
- var symbolProto$1 = Symbol$1 ? Symbol$1.prototype : void 0, symbolToString = symbolProto$1 ? symbolProto$1.toString : void 0;
609
- function baseToString(value) {
610
- if (typeof value == "string") {
611
- return value;
612
- }
613
- if (isArray(value)) {
614
- return arrayMap(value, baseToString) + "";
615
- }
616
- if (isSymbol(value)) {
617
- return symbolToString ? symbolToString.call(value) : "";
618
- }
619
- var result = value + "";
620
- return result == "0" && 1 / value == -Infinity ? "-0" : result;
621
- }
622
- function isObject(value) {
623
- var type = typeof value;
624
- return value != null && (type == "object" || type == "function");
625
- }
626
- function identity$1(value) {
627
- return value;
628
- }
629
- var asyncTag = "[object AsyncFunction]", funcTag$1 = "[object Function]", genTag = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
630
- function isFunction(value) {
631
- if (!isObject(value)) {
632
- return false;
633
- }
634
- var tag = baseGetTag(value);
635
- return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;
636
- }
637
- var coreJsData = root["__core-js_shared__"];
638
- var maskSrcKey = (function() {
639
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
640
- return uid ? "Symbol(src)_1." + uid : "";
641
- })();
642
- function isMasked(func) {
643
- return !!maskSrcKey && maskSrcKey in func;
644
- }
645
- var funcProto$1 = Function.prototype;
646
- var funcToString$1 = funcProto$1.toString;
647
- function toSource(func) {
648
- if (func != null) {
649
- try {
650
- return funcToString$1.call(func);
651
- } catch (e) {
652
- }
653
- try {
654
- return func + "";
655
- } catch (e) {
656
- }
657
- }
658
- return "";
659
- }
660
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
661
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
662
- var funcProto = Function.prototype, objectProto$a = Object.prototype;
663
- var funcToString = funcProto.toString;
664
- var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
665
- var reIsNative = RegExp(
666
- "^" + funcToString.call(hasOwnProperty$8).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
667
- );
668
- function baseIsNative(value) {
669
- if (!isObject(value) || isMasked(value)) {
670
- return false;
671
- }
672
- var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
673
- return pattern.test(toSource(value));
674
- }
675
- function getValue(object, key) {
676
- return object == null ? void 0 : object[key];
677
- }
678
- function getNative(object, key) {
679
- var value = getValue(object, key);
680
- return baseIsNative(value) ? value : void 0;
681
- }
682
- var WeakMap = getNative(root, "WeakMap");
683
- function apply(func, thisArg, args) {
684
- switch (args.length) {
685
- case 0:
686
- return func.call(thisArg);
687
- case 1:
688
- return func.call(thisArg, args[0]);
689
- case 2:
690
- return func.call(thisArg, args[0], args[1]);
691
- case 3:
692
- return func.call(thisArg, args[0], args[1], args[2]);
693
- }
694
- return func.apply(thisArg, args);
695
- }
696
- var HOT_COUNT = 800, HOT_SPAN = 16;
697
- var nativeNow = Date.now;
698
- function shortOut(func) {
699
- var count = 0, lastCalled = 0;
700
- return function() {
701
- var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
702
- lastCalled = stamp;
703
- if (remaining > 0) {
704
- if (++count >= HOT_COUNT) {
705
- return arguments[0];
706
- }
707
- } else {
708
- count = 0;
709
- }
710
- return func.apply(void 0, arguments);
711
- };
712
- }
713
- function constant(value) {
714
- return function() {
715
- return value;
716
- };
717
- }
718
- var defineProperty = (function() {
719
- try {
720
- var func = getNative(Object, "defineProperty");
721
- func({}, "", {});
722
- return func;
723
- } catch (e) {
724
- }
725
- })();
726
- var baseSetToString = !defineProperty ? identity$1 : function(func, string) {
727
- return defineProperty(func, "toString", {
728
- "configurable": true,
729
- "enumerable": false,
730
- "value": constant(string),
731
- "writable": true
732
- });
733
- };
734
- var setToString = shortOut(baseSetToString);
735
- var MAX_SAFE_INTEGER$1 = 9007199254740991;
736
- var reIsUint = /^(?:0|[1-9]\d*)$/;
737
- function isIndex(value, length) {
738
- var type = typeof value;
739
- length = length == null ? MAX_SAFE_INTEGER$1 : length;
740
- return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
741
- }
742
- function baseAssignValue(object, key, value) {
743
- if (key == "__proto__" && defineProperty) {
744
- defineProperty(object, key, {
745
- "configurable": true,
746
- "enumerable": true,
747
- "value": value,
748
- "writable": true
749
- });
750
- } else {
751
- object[key] = value;
752
- }
753
- }
754
- function eq(value, other) {
755
- return value === other || value !== value && other !== other;
756
- }
757
- var objectProto$9 = Object.prototype;
758
- var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
759
- function assignValue(object, key, value) {
760
- var objValue = object[key];
761
- if (!(hasOwnProperty$7.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) {
762
- baseAssignValue(object, key, value);
763
- }
764
- }
765
- var nativeMax = Math.max;
766
- function overRest(func, start, transform) {
767
- start = nativeMax(start === void 0 ? func.length - 1 : start, 0);
768
- return function() {
769
- var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length);
770
- while (++index < length) {
771
- array[index] = args[start + index];
772
- }
773
- index = -1;
774
- var otherArgs = Array(start + 1);
775
- while (++index < start) {
776
- otherArgs[index] = args[index];
777
- }
778
- otherArgs[start] = transform(array);
779
- return apply(func, this, otherArgs);
780
- };
781
- }
782
- var MAX_SAFE_INTEGER = 9007199254740991;
783
- function isLength(value) {
784
- return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
785
- }
786
- function isArrayLike(value) {
787
- return value != null && isLength(value.length) && !isFunction(value);
788
- }
789
- var objectProto$8 = Object.prototype;
790
- function isPrototype(value) {
791
- var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$8;
792
- return value === proto;
793
- }
794
- function baseTimes(n, iteratee) {
795
- var index = -1, result = Array(n);
796
- while (++index < n) {
797
- result[index] = iteratee(index);
798
- }
799
- return result;
800
- }
801
- var argsTag$2 = "[object Arguments]";
802
- function baseIsArguments(value) {
803
- return isObjectLike(value) && baseGetTag(value) == argsTag$2;
804
- }
805
- var objectProto$7 = Object.prototype;
806
- var hasOwnProperty$6 = objectProto$7.hasOwnProperty;
807
- var propertyIsEnumerable$1 = objectProto$7.propertyIsEnumerable;
808
- var isArguments = baseIsArguments(/* @__PURE__ */ (function() {
809
- return arguments;
810
- })()) ? baseIsArguments : function(value) {
811
- return isObjectLike(value) && hasOwnProperty$6.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee");
812
- };
813
- function stubFalse() {
814
- return false;
815
- }
816
- var freeExports$1 = typeof exports == "object" && exports && !exports.nodeType && exports;
817
- var freeModule$1 = freeExports$1 && typeof module == "object" && module && !module.nodeType && module;
818
- var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;
819
- var Buffer2 = moduleExports$1 ? root.Buffer : void 0;
820
- var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0;
821
- var isBuffer = nativeIsBuffer || stubFalse;
822
- var argsTag$1 = "[object Arguments]", arrayTag$1 = "[object Array]", boolTag$1 = "[object Boolean]", dateTag$1 = "[object Date]", errorTag$1 = "[object Error]", funcTag = "[object Function]", mapTag$2 = "[object Map]", numberTag$1 = "[object Number]", objectTag$2 = "[object Object]", regexpTag$1 = "[object RegExp]", setTag$2 = "[object Set]", stringTag$1 = "[object String]", weakMapTag$1 = "[object WeakMap]";
823
- var arrayBufferTag$1 = "[object ArrayBuffer]", dataViewTag$2 = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
824
- var typedArrayTags = {};
825
- typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
826
- typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] = typedArrayTags[arrayBufferTag$1] = typedArrayTags[boolTag$1] = typedArrayTags[dataViewTag$2] = typedArrayTags[dateTag$1] = typedArrayTags[errorTag$1] = typedArrayTags[funcTag] = typedArrayTags[mapTag$2] = typedArrayTags[numberTag$1] = typedArrayTags[objectTag$2] = typedArrayTags[regexpTag$1] = typedArrayTags[setTag$2] = typedArrayTags[stringTag$1] = typedArrayTags[weakMapTag$1] = false;
827
- function baseIsTypedArray(value) {
828
- return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
829
- }
830
- function baseUnary(func) {
831
- return function(value) {
832
- return func(value);
833
- };
834
- }
835
- var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
836
- var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
837
- var moduleExports = freeModule && freeModule.exports === freeExports;
838
- var freeProcess = moduleExports && freeGlobal.process;
839
- var nodeUtil = (function() {
840
- try {
841
- var types = freeModule && freeModule.require && freeModule.require("util").types;
842
- if (types) {
843
- return types;
844
- }
845
- return freeProcess && freeProcess.binding && freeProcess.binding("util");
846
- } catch (e) {
847
- }
848
- })();
849
- var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
850
- var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
851
- var objectProto$6 = Object.prototype;
852
- var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
853
- function arrayLikeKeys(value, inherited) {
854
- var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
855
- for (var key in value) {
856
- if (hasOwnProperty$5.call(value, key) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
857
- (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
858
- isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
859
- isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
860
- isIndex(key, length)))) {
861
- result.push(key);
862
- }
863
- }
864
- return result;
865
- }
866
- function overArg(func, transform) {
867
- return function(arg) {
868
- return func(transform(arg));
869
- };
870
- }
871
- var nativeKeys = overArg(Object.keys, Object);
872
- var objectProto$5 = Object.prototype;
873
- var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
874
- function baseKeys(object) {
875
- if (!isPrototype(object)) {
876
- return nativeKeys(object);
877
- }
878
- var result = [];
879
- for (var key in Object(object)) {
880
- if (hasOwnProperty$4.call(object, key) && key != "constructor") {
881
- result.push(key);
882
- }
883
- }
884
- return result;
885
- }
886
- function keys(object) {
887
- return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
888
- }
889
- var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/;
890
- function isKey(value, object) {
891
- if (isArray(value)) {
892
- return false;
893
- }
894
- var type = typeof value;
895
- if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) {
896
- return true;
897
- }
898
- return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
899
- }
900
- var nativeCreate = getNative(Object, "create");
901
- function hashClear() {
902
- this.__data__ = nativeCreate ? nativeCreate(null) : {};
903
- this.size = 0;
904
- }
905
- function hashDelete(key) {
906
- var result = this.has(key) && delete this.__data__[key];
907
- this.size -= result ? 1 : 0;
908
- return result;
909
- }
910
- var HASH_UNDEFINED$2 = "__lodash_hash_undefined__";
911
- var objectProto$4 = Object.prototype;
912
- var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
913
- function hashGet(key) {
914
- var data = this.__data__;
915
- if (nativeCreate) {
916
- var result = data[key];
917
- return result === HASH_UNDEFINED$2 ? void 0 : result;
918
- }
919
- return hasOwnProperty$3.call(data, key) ? data[key] : void 0;
920
- }
921
- var objectProto$3 = Object.prototype;
922
- var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
923
- function hashHas(key) {
924
- var data = this.__data__;
925
- return nativeCreate ? data[key] !== void 0 : hasOwnProperty$2.call(data, key);
926
- }
927
- var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
928
- function hashSet(key, value) {
929
- var data = this.__data__;
930
- this.size += this.has(key) ? 0 : 1;
931
- data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED$1 : value;
932
- return this;
933
- }
934
- function Hash(entries) {
935
- var index = -1, length = entries == null ? 0 : entries.length;
936
- this.clear();
937
- while (++index < length) {
938
- var entry = entries[index];
939
- this.set(entry[0], entry[1]);
940
- }
941
- }
942
- Hash.prototype.clear = hashClear;
943
- Hash.prototype["delete"] = hashDelete;
944
- Hash.prototype.get = hashGet;
945
- Hash.prototype.has = hashHas;
946
- Hash.prototype.set = hashSet;
947
- function listCacheClear() {
948
- this.__data__ = [];
949
- this.size = 0;
950
- }
951
- function assocIndexOf(array, key) {
952
- var length = array.length;
953
- while (length--) {
954
- if (eq(array[length][0], key)) {
955
- return length;
956
- }
957
- }
958
- return -1;
959
- }
960
- var arrayProto = Array.prototype;
961
- var splice = arrayProto.splice;
962
- function listCacheDelete(key) {
963
- var data = this.__data__, index = assocIndexOf(data, key);
964
- if (index < 0) {
965
- return false;
966
- }
967
- var lastIndex = data.length - 1;
968
- if (index == lastIndex) {
969
- data.pop();
970
- } else {
971
- splice.call(data, index, 1);
972
- }
973
- --this.size;
974
- return true;
975
- }
976
- function listCacheGet(key) {
977
- var data = this.__data__, index = assocIndexOf(data, key);
978
- return index < 0 ? void 0 : data[index][1];
979
- }
980
- function listCacheHas(key) {
981
- return assocIndexOf(this.__data__, key) > -1;
982
- }
983
- function listCacheSet(key, value) {
984
- var data = this.__data__, index = assocIndexOf(data, key);
985
- if (index < 0) {
986
- ++this.size;
987
- data.push([key, value]);
988
- } else {
989
- data[index][1] = value;
990
- }
991
- return this;
992
- }
993
- function ListCache(entries) {
994
- var index = -1, length = entries == null ? 0 : entries.length;
995
- this.clear();
996
- while (++index < length) {
997
- var entry = entries[index];
998
- this.set(entry[0], entry[1]);
999
- }
1000
- }
1001
- ListCache.prototype.clear = listCacheClear;
1002
- ListCache.prototype["delete"] = listCacheDelete;
1003
- ListCache.prototype.get = listCacheGet;
1004
- ListCache.prototype.has = listCacheHas;
1005
- ListCache.prototype.set = listCacheSet;
1006
- var Map = getNative(root, "Map");
1007
- function mapCacheClear() {
1008
- this.size = 0;
1009
- this.__data__ = {
1010
- "hash": new Hash(),
1011
- "map": new (Map || ListCache)(),
1012
- "string": new Hash()
1013
- };
1014
- }
1015
- function isKeyable(value) {
1016
- var type = typeof value;
1017
- return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
1018
- }
1019
- function getMapData(map, key) {
1020
- var data = map.__data__;
1021
- return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
1022
- }
1023
- function mapCacheDelete(key) {
1024
- var result = getMapData(this, key)["delete"](key);
1025
- this.size -= result ? 1 : 0;
1026
- return result;
1027
- }
1028
- function mapCacheGet(key) {
1029
- return getMapData(this, key).get(key);
1030
- }
1031
- function mapCacheHas(key) {
1032
- return getMapData(this, key).has(key);
1033
- }
1034
- function mapCacheSet(key, value) {
1035
- var data = getMapData(this, key), size = data.size;
1036
- data.set(key, value);
1037
- this.size += data.size == size ? 0 : 1;
1038
- return this;
1039
- }
1040
- function MapCache(entries) {
1041
- var index = -1, length = entries == null ? 0 : entries.length;
1042
- this.clear();
1043
- while (++index < length) {
1044
- var entry = entries[index];
1045
- this.set(entry[0], entry[1]);
1046
- }
1047
- }
1048
- MapCache.prototype.clear = mapCacheClear;
1049
- MapCache.prototype["delete"] = mapCacheDelete;
1050
- MapCache.prototype.get = mapCacheGet;
1051
- MapCache.prototype.has = mapCacheHas;
1052
- MapCache.prototype.set = mapCacheSet;
1053
- var FUNC_ERROR_TEXT = "Expected a function";
1054
- function memoize(func, resolver) {
1055
- if (typeof func != "function" || resolver != null && typeof resolver != "function") {
1056
- throw new TypeError(FUNC_ERROR_TEXT);
1057
- }
1058
- var memoized = function() {
1059
- var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
1060
- if (cache.has(key)) {
1061
- return cache.get(key);
1062
- }
1063
- var result = func.apply(this, args);
1064
- memoized.cache = cache.set(key, result) || cache;
1065
- return result;
1066
- };
1067
- memoized.cache = new (memoize.Cache || MapCache)();
1068
- return memoized;
1069
- }
1070
- memoize.Cache = MapCache;
1071
- var MAX_MEMOIZE_SIZE = 500;
1072
- function memoizeCapped(func) {
1073
- var result = memoize(func, function(key) {
1074
- if (cache.size === MAX_MEMOIZE_SIZE) {
1075
- cache.clear();
1076
- }
1077
- return key;
1078
- });
1079
- var cache = result.cache;
1080
- return result;
1081
- }
1082
- var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
1083
- var reEscapeChar = /\\(\\)?/g;
1084
- var stringToPath = memoizeCapped(function(string) {
1085
- var result = [];
1086
- if (string.charCodeAt(0) === 46) {
1087
- result.push("");
1088
- }
1089
- string.replace(rePropName, function(match, number, quote, subString) {
1090
- result.push(quote ? subString.replace(reEscapeChar, "$1") : number || match);
1091
- });
1092
- return result;
1093
- });
1094
- function toString(value) {
1095
- return value == null ? "" : baseToString(value);
1096
- }
1097
- function castPath(value, object) {
1098
- if (isArray(value)) {
1099
- return value;
1100
- }
1101
- return isKey(value, object) ? [value] : stringToPath(toString(value));
1102
- }
1103
- function toKey(value) {
1104
- if (typeof value == "string" || isSymbol(value)) {
1105
- return value;
1106
- }
1107
- var result = value + "";
1108
- return result == "0" && 1 / value == -Infinity ? "-0" : result;
1109
- }
1110
- function baseGet(object, path) {
1111
- path = castPath(path, object);
1112
- var index = 0, length = path.length;
1113
- while (object != null && index < length) {
1114
- object = object[toKey(path[index++])];
1115
- }
1116
- return index && index == length ? object : void 0;
1117
- }
1118
- function get(object, path, defaultValue) {
1119
- var result = object == null ? void 0 : baseGet(object, path);
1120
- return result === void 0 ? defaultValue : result;
1121
- }
1122
- function arrayPush(array, values) {
1123
- var index = -1, length = values.length, offset = array.length;
1124
- while (++index < length) {
1125
- array[offset + index] = values[index];
1126
- }
1127
- return array;
1128
- }
1129
- var spreadableSymbol = Symbol$1 ? Symbol$1.isConcatSpreadable : void 0;
1130
- function isFlattenable(value) {
1131
- return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
1132
- }
1133
- function baseFlatten(array, depth, predicate, isStrict, result) {
1134
- var index = -1, length = array.length;
1135
- predicate || (predicate = isFlattenable);
1136
- result || (result = []);
1137
- while (++index < length) {
1138
- var value = array[index];
1139
- if (predicate(value)) {
1140
- {
1141
- arrayPush(result, value);
1142
- }
1143
- } else {
1144
- result[result.length] = value;
1145
- }
1146
- }
1147
- return result;
1148
- }
1149
- function flatten(array) {
1150
- var length = array == null ? 0 : array.length;
1151
- return length ? baseFlatten(array) : [];
1152
- }
1153
- function flatRest(func) {
1154
- return setToString(overRest(func, void 0, flatten), func + "");
1155
- }
1156
- function stackClear() {
1157
- this.__data__ = new ListCache();
1158
- this.size = 0;
1159
- }
1160
- function stackDelete(key) {
1161
- var data = this.__data__, result = data["delete"](key);
1162
- this.size = data.size;
1163
- return result;
1164
- }
1165
- function stackGet(key) {
1166
- return this.__data__.get(key);
1167
- }
1168
- function stackHas(key) {
1169
- return this.__data__.has(key);
1170
- }
1171
- var LARGE_ARRAY_SIZE = 200;
1172
- function stackSet(key, value) {
1173
- var data = this.__data__;
1174
- if (data instanceof ListCache) {
1175
- var pairs = data.__data__;
1176
- if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
1177
- pairs.push([key, value]);
1178
- this.size = ++data.size;
1179
- return this;
1180
- }
1181
- data = this.__data__ = new MapCache(pairs);
1182
- }
1183
- data.set(key, value);
1184
- this.size = data.size;
1185
- return this;
1186
- }
1187
- function Stack(entries) {
1188
- var data = this.__data__ = new ListCache(entries);
1189
- this.size = data.size;
1190
- }
1191
- Stack.prototype.clear = stackClear;
1192
- Stack.prototype["delete"] = stackDelete;
1193
- Stack.prototype.get = stackGet;
1194
- Stack.prototype.has = stackHas;
1195
- Stack.prototype.set = stackSet;
1196
- function arrayFilter(array, predicate) {
1197
- var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
1198
- while (++index < length) {
1199
- var value = array[index];
1200
- if (predicate(value, index, array)) {
1201
- result[resIndex++] = value;
1202
- }
1203
- }
1204
- return result;
1205
- }
1206
- function stubArray() {
1207
- return [];
1208
- }
1209
- var objectProto$2 = Object.prototype;
1210
- var propertyIsEnumerable = objectProto$2.propertyIsEnumerable;
1211
- var nativeGetSymbols = Object.getOwnPropertySymbols;
1212
- var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
1213
- if (object == null) {
1214
- return [];
1215
- }
1216
- object = Object(object);
1217
- return arrayFilter(nativeGetSymbols(object), function(symbol) {
1218
- return propertyIsEnumerable.call(object, symbol);
1219
- });
1220
- };
1221
- function baseGetAllKeys(object, keysFunc, symbolsFunc) {
1222
- var result = keysFunc(object);
1223
- return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
1224
- }
1225
- function getAllKeys(object) {
1226
- return baseGetAllKeys(object, keys, getSymbols);
1227
- }
1228
- var DataView = getNative(root, "DataView");
1229
- var Promise$1 = getNative(root, "Promise");
1230
- var Set$1 = getNative(root, "Set");
1231
- var mapTag$1 = "[object Map]", objectTag$1 = "[object Object]", promiseTag = "[object Promise]", setTag$1 = "[object Set]", weakMapTag = "[object WeakMap]";
1232
- var dataViewTag$1 = "[object DataView]";
1233
- var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(Promise$1), setCtorString = toSource(Set$1), weakMapCtorString = toSource(WeakMap);
1234
- var getTag = baseGetTag;
1235
- if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag$1 || Map && getTag(new Map()) != mapTag$1 || Promise$1 && getTag(Promise$1.resolve()) != promiseTag || Set$1 && getTag(new Set$1()) != setTag$1 || WeakMap && getTag(new WeakMap()) != weakMapTag) {
1236
- getTag = function(value) {
1237
- var result = baseGetTag(value), Ctor = result == objectTag$1 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
1238
- if (ctorString) {
1239
- switch (ctorString) {
1240
- case dataViewCtorString:
1241
- return dataViewTag$1;
1242
- case mapCtorString:
1243
- return mapTag$1;
1244
- case promiseCtorString:
1245
- return promiseTag;
1246
- case setCtorString:
1247
- return setTag$1;
1248
- case weakMapCtorString:
1249
- return weakMapTag;
1250
- }
1251
- }
1252
- return result;
1253
- };
1254
- }
1255
- var Uint8Array2 = root.Uint8Array;
1256
- var HASH_UNDEFINED = "__lodash_hash_undefined__";
1257
- function setCacheAdd(value) {
1258
- this.__data__.set(value, HASH_UNDEFINED);
1259
- return this;
1260
- }
1261
- function setCacheHas(value) {
1262
- return this.__data__.has(value);
1263
- }
1264
- function SetCache(values) {
1265
- var index = -1, length = values == null ? 0 : values.length;
1266
- this.__data__ = new MapCache();
1267
- while (++index < length) {
1268
- this.add(values[index]);
1269
- }
1270
- }
1271
- SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
1272
- SetCache.prototype.has = setCacheHas;
1273
- function arraySome(array, predicate) {
1274
- var index = -1, length = array == null ? 0 : array.length;
1275
- while (++index < length) {
1276
- if (predicate(array[index], index, array)) {
1277
- return true;
1278
- }
1279
- }
1280
- return false;
1281
- }
1282
- function cacheHas(cache, key) {
1283
- return cache.has(key);
1284
- }
1285
- var COMPARE_PARTIAL_FLAG$3 = 1, COMPARE_UNORDERED_FLAG$1 = 2;
1286
- function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
1287
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3, arrLength = array.length, othLength = other.length;
1288
- if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
1289
- return false;
1290
- }
1291
- var arrStacked = stack.get(array);
1292
- var othStacked = stack.get(other);
1293
- if (arrStacked && othStacked) {
1294
- return arrStacked == other && othStacked == array;
1295
- }
1296
- var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG$1 ? new SetCache() : void 0;
1297
- stack.set(array, other);
1298
- stack.set(other, array);
1299
- while (++index < arrLength) {
1300
- var arrValue = array[index], othValue = other[index];
1301
- if (customizer) {
1302
- var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
1303
- }
1304
- if (compared !== void 0) {
1305
- if (compared) {
1306
- continue;
1307
- }
1308
- result = false;
1309
- break;
1310
- }
1311
- if (seen) {
1312
- if (!arraySome(other, function(othValue2, othIndex) {
1313
- if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
1314
- return seen.push(othIndex);
1315
- }
1316
- })) {
1317
- result = false;
1318
- break;
1319
- }
1320
- } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
1321
- result = false;
1322
- break;
1323
- }
1324
- }
1325
- stack["delete"](array);
1326
- stack["delete"](other);
1327
- return result;
1328
- }
1329
- function mapToArray(map) {
1330
- var index = -1, result = Array(map.size);
1331
- map.forEach(function(value, key) {
1332
- result[++index] = [key, value];
1333
- });
1334
- return result;
1335
- }
1336
- function setToArray(set) {
1337
- var index = -1, result = Array(set.size);
1338
- set.forEach(function(value) {
1339
- result[++index] = value;
1340
- });
1341
- return result;
1342
- }
1343
- var COMPARE_PARTIAL_FLAG$2 = 1, COMPARE_UNORDERED_FLAG = 2;
1344
- var boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", mapTag = "[object Map]", numberTag = "[object Number]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]";
1345
- var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]";
1346
- var symbolProto = Symbol$1 ? Symbol$1.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
1347
- function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
1348
- switch (tag) {
1349
- case dataViewTag:
1350
- if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
1351
- return false;
1352
- }
1353
- object = object.buffer;
1354
- other = other.buffer;
1355
- case arrayBufferTag:
1356
- if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) {
1357
- return false;
1358
- }
1359
- return true;
1360
- case boolTag:
1361
- case dateTag:
1362
- case numberTag:
1363
- return eq(+object, +other);
1364
- case errorTag:
1365
- return object.name == other.name && object.message == other.message;
1366
- case regexpTag:
1367
- case stringTag:
1368
- return object == other + "";
1369
- case mapTag:
1370
- var convert = mapToArray;
1371
- case setTag:
1372
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG$2;
1373
- convert || (convert = setToArray);
1374
- if (object.size != other.size && !isPartial) {
1375
- return false;
1376
- }
1377
- var stacked = stack.get(object);
1378
- if (stacked) {
1379
- return stacked == other;
1380
- }
1381
- bitmask |= COMPARE_UNORDERED_FLAG;
1382
- stack.set(object, other);
1383
- var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
1384
- stack["delete"](object);
1385
- return result;
1386
- case symbolTag:
1387
- if (symbolValueOf) {
1388
- return symbolValueOf.call(object) == symbolValueOf.call(other);
1389
- }
1390
- }
1391
- return false;
1392
- }
1393
- var COMPARE_PARTIAL_FLAG$1 = 1;
1394
- var objectProto$1 = Object.prototype;
1395
- var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
1396
- function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
1397
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG$1, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
1398
- if (objLength != othLength && !isPartial) {
1399
- return false;
1400
- }
1401
- var index = objLength;
1402
- while (index--) {
1403
- var key = objProps[index];
1404
- if (!(isPartial ? key in other : hasOwnProperty$1.call(other, key))) {
1405
- return false;
1406
- }
1407
- }
1408
- var objStacked = stack.get(object);
1409
- var othStacked = stack.get(other);
1410
- if (objStacked && othStacked) {
1411
- return objStacked == other && othStacked == object;
1412
- }
1413
- var result = true;
1414
- stack.set(object, other);
1415
- stack.set(other, object);
1416
- var skipCtor = isPartial;
1417
- while (++index < objLength) {
1418
- key = objProps[index];
1419
- var objValue = object[key], othValue = other[key];
1420
- if (customizer) {
1421
- var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
1422
- }
1423
- if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
1424
- result = false;
1425
- break;
1426
- }
1427
- skipCtor || (skipCtor = key == "constructor");
1428
- }
1429
- if (result && !skipCtor) {
1430
- var objCtor = object.constructor, othCtor = other.constructor;
1431
- if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
1432
- result = false;
1433
- }
1434
- }
1435
- stack["delete"](object);
1436
- stack["delete"](other);
1437
- return result;
1438
- }
1439
- var COMPARE_PARTIAL_FLAG = 1;
1440
- var argsTag = "[object Arguments]", arrayTag = "[object Array]", objectTag = "[object Object]";
1441
- var objectProto = Object.prototype;
1442
- var hasOwnProperty = objectProto.hasOwnProperty;
1443
- function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
1444
- var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
1445
- objTag = objTag == argsTag ? objectTag : objTag;
1446
- othTag = othTag == argsTag ? objectTag : othTag;
1447
- var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
1448
- if (isSameTag && isBuffer(object)) {
1449
- if (!isBuffer(other)) {
1450
- return false;
1451
- }
1452
- objIsArr = true;
1453
- objIsObj = false;
1454
- }
1455
- if (isSameTag && !objIsObj) {
1456
- stack || (stack = new Stack());
1457
- return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
1458
- }
1459
- if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
1460
- var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
1461
- if (objIsWrapped || othIsWrapped) {
1462
- var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
1463
- stack || (stack = new Stack());
1464
- return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
1465
- }
1466
- }
1467
- if (!isSameTag) {
1468
- return false;
1469
- }
1470
- stack || (stack = new Stack());
1471
- return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
1472
- }
1473
- function baseIsEqual(value, other, bitmask, customizer, stack) {
1474
- if (value === other) {
1475
- return true;
1476
- }
1477
- if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
1478
- return value !== value && other !== other;
1479
- }
1480
- return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
1481
- }
1482
- function baseHasIn(object, key) {
1483
- return object != null && key in Object(object);
1484
- }
1485
- function hasPath(object, path, hasFunc) {
1486
- path = castPath(path, object);
1487
- var index = -1, length = path.length, result = false;
1488
- while (++index < length) {
1489
- var key = toKey(path[index]);
1490
- if (!(result = object != null && hasFunc(object, key))) {
1491
- break;
1492
- }
1493
- object = object[key];
1494
- }
1495
- if (result || ++index != length) {
1496
- return result;
1497
- }
1498
- length = object == null ? 0 : object.length;
1499
- return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object));
1500
- }
1501
- function hasIn(object, path) {
1502
- return object != null && hasPath(object, path, baseHasIn);
1503
- }
1504
- function fromPairs(pairs) {
1505
- var index = -1, length = pairs == null ? 0 : pairs.length, result = {};
1506
- while (++index < length) {
1507
- var pair = pairs[index];
1508
- result[pair[0]] = pair[1];
1509
- }
1510
- return result;
1511
- }
1512
- function isEqual(value, other) {
1513
- return baseIsEqual(value, other);
1514
- }
1515
- function isNil(value) {
1516
- return value == null;
1517
- }
1518
- function baseSet(object, path, value, customizer) {
1519
- if (!isObject(object)) {
1520
- return object;
1521
- }
1522
- path = castPath(path, object);
1523
- var index = -1, length = path.length, lastIndex = length - 1, nested = object;
1524
- while (nested != null && ++index < length) {
1525
- var key = toKey(path[index]), newValue = value;
1526
- if (key === "__proto__" || key === "constructor" || key === "prototype") {
1527
- return object;
1528
- }
1529
- if (index != lastIndex) {
1530
- var objValue = nested[key];
1531
- newValue = void 0;
1532
- if (newValue === void 0) {
1533
- newValue = isObject(objValue) ? objValue : isIndex(path[index + 1]) ? [] : {};
1534
- }
1535
- }
1536
- assignValue(nested, key, newValue);
1537
- nested = nested[key];
1538
- }
1539
- return object;
1540
- }
1541
- function basePickBy(object, paths, predicate) {
1542
- var index = -1, length = paths.length, result = {};
1543
- while (++index < length) {
1544
- var path = paths[index], value = baseGet(object, path);
1545
- if (predicate(value, path)) {
1546
- baseSet(result, castPath(path, object), value);
1547
- }
1548
- }
1549
- return result;
1550
- }
1551
- function basePick(object, paths) {
1552
- return basePickBy(object, paths, function(value, path) {
1553
- return hasIn(object, path);
1554
- });
1555
- }
1556
- var pick = flatRest(function(object, paths) {
1557
- return object == null ? {} : basePick(object, paths);
1558
- });
1559
- const isUndefined = (val) => val === void 0;
1560
- const isBoolean = (val) => typeof val === "boolean";
1561
- const isNumber = (val) => typeof val === "number";
1562
- const isElement = (e) => {
1563
- if (typeof Element === "undefined")
1564
- return false;
1565
- return e instanceof Element;
1566
- };
1567
- const isPropAbsent = (prop) => isNil(prop);
1568
- const isStringNumber = (val) => {
1569
- if (!isString$1(val)) {
1570
- return false;
1571
- }
1572
- return !Number.isNaN(Number(val));
1573
- };
1574
- var __defProp$9 = Object.defineProperty;
1575
- var __defProps$6 = Object.defineProperties;
1576
- var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
1577
- var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
1578
- var __hasOwnProp$b = Object.prototype.hasOwnProperty;
1579
- var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
1580
- var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1581
- var __spreadValues$9 = (a, b) => {
1582
- for (var prop in b || (b = {}))
1583
- if (__hasOwnProp$b.call(b, prop))
1584
- __defNormalProp$9(a, prop, b[prop]);
1585
- if (__getOwnPropSymbols$b)
1586
- for (var prop of __getOwnPropSymbols$b(b)) {
1587
- if (__propIsEnum$b.call(b, prop))
1588
- __defNormalProp$9(a, prop, b[prop]);
1589
- }
1590
- return a;
1591
- };
1592
- var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
1593
- function computedEager(fn, options) {
1594
- var _a2;
1595
- const result = shallowRef();
1596
- watchEffect(() => {
1597
- result.value = fn();
1598
- }, __spreadProps$6(__spreadValues$9({}, options), {
1599
- flush: (_a2 = void 0) != null ? _a2 : "sync"
1600
- }));
1601
- return readonly(result);
1602
- }
1603
- var _a;
1604
- const isClient = typeof window !== "undefined";
1605
- const isString = (val) => typeof val === "string";
1606
- const noop = () => {
1607
- };
1608
- const isIOS = isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
1609
- function resolveUnref(r) {
1610
- return typeof r === "function" ? r() : unref(r);
1611
- }
1612
- function identity(arg) {
1613
- return arg;
1614
- }
1615
- function tryOnScopeDispose(fn) {
1616
- if (getCurrentScope()) {
1617
- onScopeDispose(fn);
1618
- return true;
1619
- }
1620
- return false;
1621
- }
1622
- function tryOnMounted(fn, sync = true) {
1623
- if (getCurrentInstance())
1624
- onMounted(fn);
1625
- else if (sync)
1626
- fn();
1627
- else
1628
- nextTick(fn);
1629
- }
1630
- function useTimeoutFn(cb, interval, options = {}) {
1631
- const {
1632
- immediate = true
1633
- } = options;
1634
- const isPending = ref(false);
1635
- let timer = null;
1636
- function clear() {
1637
- if (timer) {
1638
- clearTimeout(timer);
1639
- timer = null;
1640
- }
1641
- }
1642
- function stop() {
1643
- isPending.value = false;
1644
- clear();
1645
- }
1646
- function start(...args) {
1647
- clear();
1648
- isPending.value = true;
1649
- timer = setTimeout(() => {
1650
- isPending.value = false;
1651
- timer = null;
1652
- cb(...args);
1653
- }, resolveUnref(interval));
1654
- }
1655
- if (immediate) {
1656
- isPending.value = true;
1657
- if (isClient)
1658
- start();
1659
- }
1660
- tryOnScopeDispose(stop);
1661
- return {
1662
- isPending: readonly(isPending),
1663
- start,
1664
- stop
1665
- };
1666
- }
1667
- const initial = {
1668
- current: 0
1669
- };
1670
- const zIndex = ref(0);
1671
- const defaultInitialZIndex = 2e3;
1672
- const ZINDEX_INJECTION_KEY = Symbol("elZIndexContextKey");
1673
- const zIndexContextKey = Symbol("zIndexContextKey");
1674
- const useZIndex = (zIndexOverrides) => {
1675
- const increasingInjection = getCurrentInstance() ? inject(ZINDEX_INJECTION_KEY, initial) : initial;
1676
- const zIndexInjection = zIndexOverrides || (getCurrentInstance() ? inject(zIndexContextKey, void 0) : void 0);
1677
- const initialZIndex = computed(() => {
1678
- const zIndexFromInjection = unref(zIndexInjection);
1679
- return isNumber(zIndexFromInjection) ? zIndexFromInjection : defaultInitialZIndex;
1680
- });
1681
- const currentZIndex = computed(() => initialZIndex.value + zIndex.value);
1682
- const nextZIndex = () => {
1683
- increasingInjection.current++;
1684
- zIndex.value = increasingInjection.current;
1685
- return currentZIndex.value;
1686
- };
1687
- if (!isClient && !inject(ZINDEX_INJECTION_KEY)) ;
1688
- return {
1689
- initialZIndex,
1690
- currentZIndex,
1691
- nextZIndex
1692
- };
1693
- };
1694
- var English = {
1695
- name: "en",
1696
- el: {
1697
- breadcrumb: {
1698
- label: "Breadcrumb"
1699
- },
1700
- colorpicker: {
1701
- confirm: "OK",
1702
- clear: "Clear",
1703
- defaultLabel: "color picker",
1704
- description: "current color is {color}. press enter to select a new color.",
1705
- alphaLabel: "pick alpha value"
1706
- },
1707
- datepicker: {
1708
- now: "Now",
1709
- today: "Today",
1710
- cancel: "Cancel",
1711
- clear: "Clear",
1712
- confirm: "OK",
1713
- dateTablePrompt: "Use the arrow keys and enter to select the day of the month",
1714
- monthTablePrompt: "Use the arrow keys and enter to select the month",
1715
- yearTablePrompt: "Use the arrow keys and enter to select the year",
1716
- selectedDate: "Selected date",
1717
- selectDate: "Select date",
1718
- selectTime: "Select time",
1719
- startDate: "Start Date",
1720
- startTime: "Start Time",
1721
- endDate: "End Date",
1722
- endTime: "End Time",
1723
- prevYear: "Previous Year",
1724
- nextYear: "Next Year",
1725
- prevMonth: "Previous Month",
1726
- nextMonth: "Next Month",
1727
- year: "",
1728
- month1: "January",
1729
- month2: "February",
1730
- month3: "March",
1731
- month4: "April",
1732
- month5: "May",
1733
- month6: "June",
1734
- month7: "July",
1735
- month8: "August",
1736
- month9: "September",
1737
- month10: "October",
1738
- month11: "November",
1739
- month12: "December",
1740
- week: "week",
1741
- weeks: {
1742
- sun: "Sun",
1743
- mon: "Mon",
1744
- tue: "Tue",
1745
- wed: "Wed",
1746
- thu: "Thu",
1747
- fri: "Fri",
1748
- sat: "Sat"
1749
- },
1750
- weeksFull: {
1751
- sun: "Sunday",
1752
- mon: "Monday",
1753
- tue: "Tuesday",
1754
- wed: "Wednesday",
1755
- thu: "Thursday",
1756
- fri: "Friday",
1757
- sat: "Saturday"
1758
- },
1759
- months: {
1760
- jan: "Jan",
1761
- feb: "Feb",
1762
- mar: "Mar",
1763
- apr: "Apr",
1764
- may: "May",
1765
- jun: "Jun",
1766
- jul: "Jul",
1767
- aug: "Aug",
1768
- sep: "Sep",
1769
- oct: "Oct",
1770
- nov: "Nov",
1771
- dec: "Dec"
1772
- }
1773
- },
1774
- inputNumber: {
1775
- decrease: "decrease number",
1776
- increase: "increase number"
1777
- },
1778
- select: {
1779
- loading: "Loading",
1780
- noMatch: "No matching data",
1781
- noData: "No data",
1782
- placeholder: "Select"
1783
- },
1784
- mention: {
1785
- loading: "Loading"
1786
- },
1787
- dropdown: {
1788
- toggleDropdown: "Toggle Dropdown"
1789
- },
1790
- cascader: {
1791
- noMatch: "No matching data",
1792
- loading: "Loading",
1793
- placeholder: "Select",
1794
- noData: "No data"
1795
- },
1796
- pagination: {
1797
- goto: "Go to",
1798
- pagesize: "/page",
1799
- total: "Total {total}",
1800
- pageClassifier: "",
1801
- page: "Page",
1802
- prev: "Go to previous page",
1803
- next: "Go to next page",
1804
- currentPage: "page {pager}",
1805
- prevPages: "Previous {pager} pages",
1806
- nextPages: "Next {pager} pages",
1807
- deprecationWarning: "Deprecated usages detected, please refer to the el-pagination documentation for more details"
1808
- },
1809
- dialog: {
1810
- close: "Close this dialog"
1811
- },
1812
- drawer: {
1813
- close: "Close this dialog"
1814
- },
1815
- messagebox: {
1816
- title: "Message",
1817
- confirm: "OK",
1818
- cancel: "Cancel",
1819
- error: "Illegal input",
1820
- close: "Close this dialog"
1821
- },
1822
- upload: {
1823
- deleteTip: "press delete to remove",
1824
- delete: "Delete",
1825
- preview: "Preview",
1826
- continue: "Continue"
1827
- },
1828
- slider: {
1829
- defaultLabel: "slider between {min} and {max}",
1830
- defaultRangeStartLabel: "pick start value",
1831
- defaultRangeEndLabel: "pick end value"
1832
- },
1833
- table: {
1834
- emptyText: "No Data",
1835
- confirmFilter: "Confirm",
1836
- resetFilter: "Reset",
1837
- clearFilter: "All",
1838
- sumText: "Sum"
1839
- },
1840
- tour: {
1841
- next: "Next",
1842
- previous: "Previous",
1843
- finish: "Finish"
1844
- },
1845
- tree: {
1846
- emptyText: "No Data"
1847
- },
1848
- transfer: {
1849
- noMatch: "No matching data",
1850
- noData: "No data",
1851
- titles: ["List 1", "List 2"],
1852
- filterPlaceholder: "Enter keyword",
1853
- noCheckedFormat: "{total} items",
1854
- hasCheckedFormat: "{checked}/{total} checked"
1855
- },
1856
- image: {
1857
- error: "FAILED"
1858
- },
1859
- pageHeader: {
1860
- title: "Back"
1861
- },
1862
- popconfirm: {
1863
- confirmButtonText: "Yes",
1864
- cancelButtonText: "No"
1865
- },
1866
- carousel: {
1867
- leftArrow: "Carousel arrow left",
1868
- rightArrow: "Carousel arrow right",
1869
- indicator: "Carousel switch to index {index}"
1870
- }
1871
- }
1872
- };
1873
- const buildTranslator = (locale) => (path, option) => translate(path, option, unref(locale));
1874
- const translate = (path, option, locale) => get(locale, path, path).replace(/\{(\w+)\}/g, (_, key) => {
1875
- var _a2;
1876
- return `${(_a2 = option == null ? void 0 : option[key]) != null ? _a2 : `{${key}}`}`;
1877
- });
1878
- const buildLocaleContext = (locale) => {
1879
- const lang = computed(() => unref(locale).name);
1880
- const localeRef = isRef(locale) ? locale : ref(locale);
1881
- return {
1882
- lang,
1883
- locale: localeRef,
1884
- t: buildTranslator(locale)
1885
- };
1886
- };
1887
- const localeContextKey = Symbol("localeContextKey");
1888
- const useLocale = (localeOverrides) => {
1889
- const locale = localeOverrides || inject(localeContextKey, ref());
1890
- return buildLocaleContext(computed(() => locale.value || English));
1891
- };
1892
- const epPropKey = "__epPropKey";
1893
- const definePropType = (val) => val;
1894
- const isEpProp = (val) => isObject$1(val) && !!val[epPropKey];
1895
- const buildProp = (prop, key) => {
1896
- if (!isObject$1(prop) || isEpProp(prop))
1897
- return prop;
1898
- const { values, required, default: defaultValue, type, validator } = prop;
1899
- const _validator = values || validator ? (val) => {
1900
- let valid = false;
1901
- let allowedValues = [];
1902
- if (values) {
1903
- allowedValues = Array.from(values);
1904
- if (hasOwn(prop, "default")) {
1905
- allowedValues.push(defaultValue);
1906
- }
1907
- valid || (valid = allowedValues.includes(val));
1908
- }
1909
- if (validator)
1910
- valid || (valid = validator(val));
1911
- if (!valid && allowedValues.length > 0) {
1912
- const allowValuesText = [...new Set(allowedValues)].map((value) => JSON.stringify(value)).join(", ");
1913
- warn(`Invalid prop: validation failed${key ? ` for prop "${key}"` : ""}. Expected one of [${allowValuesText}], got value ${JSON.stringify(val)}.`);
1914
- }
1915
- return valid;
1916
- } : void 0;
1917
- const epProp = {
1918
- type,
1919
- required: !!required,
1920
- validator: _validator,
1921
- [epPropKey]: true
1922
- };
1923
- if (hasOwn(prop, "default"))
1924
- epProp.default = defaultValue;
1925
- return epProp;
1926
- };
1927
- const buildProps = (props) => fromPairs(Object.entries(props).map(([key, option]) => [
1928
- key,
1929
- buildProp(option, key)
1930
- ]));
1931
- const componentSizes = ["", "default", "small", "large"];
1932
- const useSizeProp = buildProp({
1933
- type: String,
1934
- values: componentSizes,
1935
- required: false
1936
- });
1937
- const SIZE_INJECTION_KEY = Symbol("size");
1938
- const useGlobalSize = () => {
1939
- const injectedSize = inject(SIZE_INJECTION_KEY, {});
1940
- return computed(() => {
1941
- return unref(injectedSize.size) || "";
1942
- });
1943
- };
1944
- const emptyValuesContextKey = Symbol("emptyValuesContextKey");
1945
- const useEmptyValuesProps = buildProps({
1946
- emptyValues: Array,
1947
- valueOnClear: {
1948
- type: definePropType([
1949
- String,
1950
- Number,
1951
- Boolean,
1952
- Function
1953
- ]),
1954
- default: void 0,
1955
- validator: (val) => isFunction$1(val) ? !val() : !val
1956
- }
1957
- });
1958
- const keysOf = (arr) => Object.keys(arr);
1959
- const globalConfig = ref();
1960
- function useGlobalConfig(key, defaultValue = void 0) {
1961
- const config = getCurrentInstance() ? inject(configProviderContextKey, globalConfig) : globalConfig;
1962
- if (key) {
1963
- return computed(() => {
1964
- var _a2, _b;
1965
- return (_b = (_a2 = config.value) == null ? void 0 : _a2[key]) != null ? _b : defaultValue;
1966
- });
1967
- } else {
1968
- return config;
1969
- }
1970
- }
1971
- function useGlobalComponentSettings(block, sizeFallback) {
1972
- const config = useGlobalConfig();
1973
- const ns = useNamespace(block, computed(() => {
1974
- var _a2;
1975
- return ((_a2 = config.value) == null ? void 0 : _a2.namespace) || defaultNamespace;
1976
- }));
1977
- const locale = useLocale(computed(() => {
1978
- var _a2;
1979
- return (_a2 = config.value) == null ? void 0 : _a2.locale;
1980
- }));
1981
- const zIndex2 = useZIndex(computed(() => {
1982
- var _a2;
1983
- return ((_a2 = config.value) == null ? void 0 : _a2.zIndex) || defaultInitialZIndex;
1984
- }));
1985
- const size = computed(() => {
1986
- var _a2;
1987
- return unref(sizeFallback) || ((_a2 = config.value) == null ? void 0 : _a2.size) || "";
1988
- });
1989
- provideGlobalConfig(computed(() => unref(config) || {}));
1990
- return {
1991
- ns,
1992
- locale,
1993
- zIndex: zIndex2,
1994
- size
1995
- };
1996
- }
1997
- const provideGlobalConfig = (config, app, global2 = false) => {
1998
- var _a2;
1999
- const inSetup = !!getCurrentInstance();
2000
- const oldConfig = inSetup ? useGlobalConfig() : void 0;
2001
- const provideFn = (_a2 = void 0) != null ? _a2 : inSetup ? provide : void 0;
2002
- if (!provideFn) {
2003
- return;
2004
- }
2005
- const context = computed(() => {
2006
- const cfg = unref(config);
2007
- if (!(oldConfig == null ? void 0 : oldConfig.value))
2008
- return cfg;
2009
- return mergeConfig(oldConfig.value, cfg);
2010
- });
2011
- provideFn(configProviderContextKey, context);
2012
- provideFn(localeContextKey, computed(() => context.value.locale));
2013
- provideFn(namespaceContextKey, computed(() => context.value.namespace));
2014
- provideFn(zIndexContextKey, computed(() => context.value.zIndex));
2015
- provideFn(SIZE_INJECTION_KEY, {
2016
- size: computed(() => context.value.size || "")
2017
- });
2018
- provideFn(emptyValuesContextKey, computed(() => ({
2019
- emptyValues: context.value.emptyValues,
2020
- valueOnClear: context.value.valueOnClear
2021
- })));
2022
- if (global2 || !globalConfig.value) {
2023
- globalConfig.value = context.value;
2024
- }
2025
- return context;
2026
- };
2027
- const mergeConfig = (a, b) => {
2028
- const keys2 = [.../* @__PURE__ */ new Set([...keysOf(a), ...keysOf(b)])];
2029
- const obj = {};
2030
- for (const key of keys2) {
2031
- obj[key] = b[key] !== void 0 ? b[key] : a[key];
2032
- }
2033
- return obj;
2034
- };
2035
- const UPDATE_MODEL_EVENT = "update:modelValue";
2036
- const CHANGE_EVENT = "change";
2037
- const INPUT_EVENT = "input";
2038
- var _export_sfc = (sfc, props) => {
2039
- const target = sfc.__vccOpts || sfc;
2040
- for (const [key, val] of props) {
2041
- target[key] = val;
2042
- }
2043
- return target;
2044
- };
2045
- function addUnit(value, defaultUnit = "px") {
2046
- if (!value)
2047
- return "";
2048
- if (isNumber(value) || isStringNumber(value)) {
2049
- return `${value}${defaultUnit}`;
2050
- } else if (isString$1(value)) {
2051
- return value;
2052
- }
2053
- }
2054
- class ElementPlusError extends Error {
2055
- constructor(m) {
2056
- super(m);
2057
- this.name = "ElementPlusError";
2058
- }
2059
- }
2060
- function throwError(scope, m) {
2061
- throw new ElementPlusError(`[${scope}] ${m}`);
2062
- }
2063
- function debugWarn(scope, message) {
2064
- }
2065
- const withInstall = (main, extra) => {
2066
- main.install = (app) => {
2067
- for (const comp of [main, ...Object.values(extra != null ? extra : {})]) {
2068
- app.component(comp.name, comp);
2069
- }
2070
- };
2071
- if (extra) {
2072
- for (const [key, comp] of Object.entries(extra)) {
2073
- main[key] = comp;
2074
- }
2075
- }
2076
- return main;
2077
- };
2078
- const withInstallFunction = (fn, name) => {
2079
- fn.install = (app) => {
2080
- fn._context = app._context;
2081
- app.config.globalProperties[name] = fn;
2082
- };
2083
- return fn;
2084
- };
2085
- const withNoopInstall = (component) => {
2086
- component.install = NOOP;
2087
- return component;
2088
- };
2089
- const iconProps = buildProps({
2090
- size: {
2091
- type: definePropType([Number, String])
2092
- },
2093
- color: {
2094
- type: String
2095
- }
2096
- });
2097
- const __default__$5 = defineComponent({
2098
- name: "ElIcon",
2099
- inheritAttrs: false
2100
- });
2101
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
2102
- ...__default__$5,
2103
- props: iconProps,
2104
- setup(__props) {
2105
- const props = __props;
2106
- const ns = useNamespace("icon");
2107
- const style = computed(() => {
2108
- const { size, color } = props;
2109
- if (!size && !color)
2110
- return {};
2111
- return {
2112
- fontSize: isUndefined(size) ? void 0 : addUnit(size),
2113
- "--color": color
2114
- };
2115
- });
2116
- return (_ctx, _cache) => {
2117
- return openBlock(), createElementBlock("i", mergeProps({
2118
- class: unref(ns).b(),
2119
- style: unref(style)
2120
- }, _ctx.$attrs), [
2121
- renderSlot(_ctx.$slots, "default")
2122
- ], 16);
2123
- };
2124
- }
2125
- });
2126
- var Icon = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__file", "icon.vue"]]);
2127
- const ElIcon = withInstall(Icon);
2128
- /*! Element Plus Icons Vue v2.3.2 */
2129
- var _sfc_main6 = /* @__PURE__ */ defineComponent({
2130
- name: "ArrowDown",
2131
- __name: "arrow-down",
2132
- setup(__props) {
2133
- return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
2134
- xmlns: "http://www.w3.org/2000/svg",
2135
- viewBox: "0 0 1024 1024"
2136
- }, [
2137
- createElementVNode("path", {
2138
- fill: "currentColor",
2139
- d: "M831.872 340.864 512 652.672 192.128 340.864a30.59 30.59 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.59 30.59 0 0 0-42.752 0z"
2140
- })
2141
- ]));
2142
- }
2143
- }), arrow_down_default = _sfc_main6;
2144
- var _sfc_main49 = /* @__PURE__ */ defineComponent({
2145
- name: "CircleCheck",
2146
- __name: "circle-check",
2147
- setup(__props) {
2148
- return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
2149
- xmlns: "http://www.w3.org/2000/svg",
2150
- viewBox: "0 0 1024 1024"
2151
- }, [
2152
- createElementVNode("path", {
2153
- fill: "currentColor",
2154
- d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"
2155
- }),
2156
- createElementVNode("path", {
2157
- fill: "currentColor",
2158
- d: "M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752z"
2159
- })
2160
- ]));
2161
- }
2162
- }), circle_check_default = _sfc_main49;
2163
- var _sfc_main50 = /* @__PURE__ */ defineComponent({
2164
- name: "CircleCloseFilled",
2165
- __name: "circle-close-filled",
2166
- setup(__props) {
2167
- return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
2168
- xmlns: "http://www.w3.org/2000/svg",
2169
- viewBox: "0 0 1024 1024"
2170
- }, [
2171
- createElementVNode("path", {
2172
- fill: "currentColor",
2173
- d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336z"
2174
- })
2175
- ]));
2176
- }
2177
- }), circle_close_filled_default = _sfc_main50;
2178
- var _sfc_main51 = /* @__PURE__ */ defineComponent({
2179
- name: "CircleClose",
2180
- __name: "circle-close",
2181
- setup(__props) {
2182
- return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
2183
- xmlns: "http://www.w3.org/2000/svg",
2184
- viewBox: "0 0 1024 1024"
2185
- }, [
2186
- createElementVNode("path", {
2187
- fill: "currentColor",
2188
- d: "m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"
2189
- }),
2190
- createElementVNode("path", {
2191
- fill: "currentColor",
2192
- d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"
2193
- })
2194
- ]));
2195
- }
2196
- }), circle_close_default = _sfc_main51;
2197
- var _sfc_main56 = /* @__PURE__ */ defineComponent({
2198
- name: "Close",
2199
- __name: "close",
2200
- setup(__props) {
2201
- return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
2202
- xmlns: "http://www.w3.org/2000/svg",
2203
- viewBox: "0 0 1024 1024"
2204
- }, [
2205
- createElementVNode("path", {
2206
- fill: "currentColor",
2207
- d: "M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"
2208
- })
2209
- ]));
2210
- }
2211
- }), close_default = _sfc_main56;
2212
- var _sfc_main133 = /* @__PURE__ */ defineComponent({
2213
- name: "Hide",
2214
- __name: "hide",
2215
- setup(__props) {
2216
- return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
2217
- xmlns: "http://www.w3.org/2000/svg",
2218
- viewBox: "0 0 1024 1024"
2219
- }, [
2220
- createElementVNode("path", {
2221
- fill: "currentColor",
2222
- d: "M876.8 156.8c0-9.6-3.2-16-9.6-22.4s-12.8-9.6-22.4-9.6-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176S0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4s3.2 16 9.6 22.4 12.8 9.6 22.4 9.6 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4m-646.4 528Q115.2 579.2 76.8 512q43.2-72 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4m140.8-96Q352 555.2 352 512c0-44.8 16-83.2 48-112s67.2-48 112-48c28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6q-43.2 72-153.6 172.8c-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176S1024 528 1024 512s-48.001-73.6-134.401-176"
2223
- }),
2224
- createElementVNode("path", {
2225
- fill: "currentColor",
2226
- d: "M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112s-67.2 48-112 48"
2227
- })
2228
- ]));
2229
- }
2230
- }), hide_default = _sfc_main133;
2231
- var _sfc_main143 = /* @__PURE__ */ defineComponent({
2232
- name: "InfoFilled",
2233
- __name: "info-filled",
2234
- setup(__props) {
2235
- return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
2236
- xmlns: "http://www.w3.org/2000/svg",
2237
- viewBox: "0 0 1024 1024"
2238
- }, [
2239
- createElementVNode("path", {
2240
- fill: "currentColor",
2241
- d: "M512 64a448 448 0 1 1 0 896.064A448 448 0 0 1 512 64m67.2 275.072c33.28 0 60.288-23.104 60.288-57.344s-27.072-57.344-60.288-57.344c-33.28 0-60.16 23.104-60.16 57.344s26.88 57.344 60.16 57.344M590.912 699.2c0-6.848 2.368-24.64 1.024-34.752l-52.608 60.544c-10.88 11.456-24.512 19.392-30.912 17.28a12.99 12.99 0 0 1-8.256-14.72l87.68-276.992c7.168-35.136-12.544-67.2-54.336-71.296-44.096 0-108.992 44.736-148.48 101.504 0 6.784-1.28 23.68.064 33.792l52.544-60.608c10.88-11.328 23.552-19.328 29.952-17.152a12.8 12.8 0 0 1 7.808 16.128L388.48 728.576c-10.048 32.256 8.96 63.872 55.04 71.04 67.84 0 107.904-43.648 147.456-100.416z"
2242
- })
2243
- ]));
2244
- }
2245
- }), info_filled_default = _sfc_main143;
2246
- var _sfc_main150 = /* @__PURE__ */ defineComponent({
2247
- name: "Loading",
2248
- __name: "loading",
2249
- setup(__props) {
2250
- return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
2251
- xmlns: "http://www.w3.org/2000/svg",
2252
- viewBox: "0 0 1024 1024"
2253
- }, [
2254
- createElementVNode("path", {
2255
- fill: "currentColor",
2256
- d: "M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248m452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248M828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0"
2257
- })
2258
- ]));
2259
- }
2260
- }), loading_default = _sfc_main150;
2261
- var _sfc_main249 = /* @__PURE__ */ defineComponent({
2262
- name: "SuccessFilled",
2263
- __name: "success-filled",
2264
- setup(__props) {
2265
- return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
2266
- xmlns: "http://www.w3.org/2000/svg",
2267
- viewBox: "0 0 1024 1024"
2268
- }, [
2269
- createElementVNode("path", {
2270
- fill: "currentColor",
2271
- d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.27 38.27 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"
2272
- })
2273
- ]));
2274
- }
2275
- }), success_filled_default = _sfc_main249;
2276
- var _sfc_main283 = /* @__PURE__ */ defineComponent({
2277
- name: "View",
2278
- __name: "view",
2279
- setup(__props) {
2280
- return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
2281
- xmlns: "http://www.w3.org/2000/svg",
2282
- viewBox: "0 0 1024 1024"
2283
- }, [
2284
- createElementVNode("path", {
2285
- fill: "currentColor",
2286
- d: "M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288m0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.19 160.19 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"
2287
- })
2288
- ]));
2289
- }
2290
- }), view_default = _sfc_main283;
2291
- var _sfc_main287 = /* @__PURE__ */ defineComponent({
2292
- name: "WarningFilled",
2293
- __name: "warning-filled",
2294
- setup(__props) {
2295
- return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
2296
- xmlns: "http://www.w3.org/2000/svg",
2297
- viewBox: "0 0 1024 1024"
2298
- }, [
2299
- createElementVNode("path", {
2300
- fill: "currentColor",
2301
- d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.43 58.43 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.43 58.43 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4"
2302
- })
2303
- ]));
2304
- }
2305
- }), warning_filled_default = _sfc_main287;
2306
- const iconPropType = definePropType([
2307
- String,
2308
- Object,
2309
- Function
2310
- ]);
2311
- const TypeComponents = {
2312
- Close: close_default
2313
- };
2314
- const TypeComponentsMap = {
2315
- primary: info_filled_default,
2316
- success: success_filled_default,
2317
- warning: warning_filled_default,
2318
- error: circle_close_filled_default,
2319
- info: info_filled_default
2320
- };
2321
- const ValidateComponentsMap = {
2322
- validating: loading_default,
2323
- success: circle_check_default,
2324
- error: circle_close_default
2325
- };
2326
- const ariaProps = buildProps({
2327
- ariaLabel: String,
2328
- ariaOrientation: {
2329
- type: String,
2330
- values: ["horizontal", "vertical", "undefined"]
2331
- },
2332
- ariaControls: String
2333
- });
2334
- const useAriaProps = (arias) => {
2335
- return pick(ariaProps, arias);
2336
- };
2337
- const defaultIdInjection = {
2338
- prefix: Math.floor(Math.random() * 1e4),
2339
- current: 0
2340
- };
2341
- const ID_INJECTION_KEY = Symbol("elIdInjection");
2342
- const useIdInjection = () => {
2343
- return getCurrentInstance() ? inject(ID_INJECTION_KEY, defaultIdInjection) : defaultIdInjection;
2344
- };
2345
- const useId = (deterministicId) => {
2346
- const idInjection = useIdInjection();
2347
- const namespace = useGetDerivedNamespace();
2348
- const idRef = computedEager(() => unref(deterministicId) || `${namespace.value}-id-${idInjection.prefix}-${idInjection.current++}`);
2349
- return idRef;
2350
- };
2351
- const formContextKey = Symbol("formContextKey");
2352
- const formItemContextKey = Symbol("formItemContextKey");
2353
- const useFormItem = () => {
2354
- const form = inject(formContextKey, void 0);
2355
- const formItem = inject(formItemContextKey, void 0);
2356
- return {
2357
- form,
2358
- formItem
2359
- };
2360
- };
2361
- const useFormItemInputId = (props, {
2362
- formItemContext,
2363
- disableIdGeneration,
2364
- disableIdManagement
2365
- }) => {
2366
- if (!disableIdGeneration) {
2367
- disableIdGeneration = ref(false);
2368
- }
2369
- if (!disableIdManagement) {
2370
- disableIdManagement = ref(false);
2371
- }
2372
- const instance = getCurrentInstance();
2373
- const inLabel = () => {
2374
- let parent = instance == null ? void 0 : instance.parent;
2375
- while (parent) {
2376
- if (parent.type.name === "ElFormItem") {
2377
- return false;
2378
- }
2379
- if (parent.type.name === "ElLabelWrap") {
2380
- return true;
2381
- }
2382
- parent = parent.parent;
2383
- }
2384
- return false;
2385
- };
2386
- const inputId = ref();
2387
- let idUnwatch = void 0;
2388
- const isLabeledByFormItem = computed(() => {
2389
- var _a2;
2390
- return !!(!(props.label || props.ariaLabel) && formItemContext && formItemContext.inputIds && ((_a2 = formItemContext.inputIds) == null ? void 0 : _a2.length) <= 1);
2391
- });
2392
- onMounted(() => {
2393
- idUnwatch = watch([toRef(props, "id"), disableIdGeneration], ([id, disableIdGeneration2]) => {
2394
- const newId = id != null ? id : !disableIdGeneration2 ? useId().value : void 0;
2395
- if (newId !== inputId.value) {
2396
- if ((formItemContext == null ? void 0 : formItemContext.removeInputId) && !inLabel()) {
2397
- inputId.value && formItemContext.removeInputId(inputId.value);
2398
- if (!(disableIdManagement == null ? void 0 : disableIdManagement.value) && !disableIdGeneration2 && newId) {
2399
- formItemContext.addInputId(newId);
2400
- }
2401
- }
2402
- inputId.value = newId;
2403
- }
2404
- }, { immediate: true });
2405
- });
2406
- onUnmounted(() => {
2407
- idUnwatch && idUnwatch();
2408
- if (formItemContext == null ? void 0 : formItemContext.removeInputId) {
2409
- inputId.value && formItemContext.removeInputId(inputId.value);
2410
- }
2411
- });
2412
- return {
2413
- isLabeledByFormItem,
2414
- inputId
2415
- };
2416
- };
2417
- const useProp = (name) => {
2418
- const vm = getCurrentInstance();
2419
- return computed(() => {
2420
- var _a2, _b;
2421
- return (_b = (_a2 = vm == null ? void 0 : vm.proxy) == null ? void 0 : _a2.$props) == null ? void 0 : _b[name];
2422
- });
2423
- };
2424
- const useFormSize = (fallback, ignore = {}) => {
2425
- const emptyRef = ref(void 0);
2426
- const size = ignore.prop ? emptyRef : useProp("size");
2427
- const globalConfig2 = ignore.global ? emptyRef : useGlobalSize();
2428
- const form = ignore.form ? { size: void 0 } : inject(formContextKey, void 0);
2429
- const formItem = ignore.formItem ? { size: void 0 } : inject(formItemContextKey, void 0);
2430
- return computed(() => size.value || unref(fallback) || (formItem == null ? void 0 : formItem.size) || (form == null ? void 0 : form.size) || globalConfig2.value || "");
2431
- };
2432
- const useFormDisabled = (fallback) => {
2433
- const disabled = useProp("disabled");
2434
- const form = inject(formContextKey, void 0);
2435
- return computed(() => disabled.value || unref(fallback) || (form == null ? void 0 : form.disabled) || false);
2436
- };
2437
- const buttonGroupContextKey = Symbol("buttonGroupContextKey");
2438
- const useDeprecated = ({ from, replacement, scope, version, ref: ref2, type = "API" }, condition) => {
2439
- watch(() => unref(condition), (val) => {
2440
- }, {
2441
- immediate: true
2442
- });
2443
- };
2444
- const useButton = (props, emit) => {
2445
- useDeprecated({
2446
- from: "type.text",
2447
- replacement: "link",
2448
- version: "3.0.0",
2449
- scope: "props",
2450
- ref: "https://element-plus.org/en-US/component/button.html#button-attributes"
2451
- }, computed(() => props.type === "text"));
2452
- const buttonGroupContext = inject(buttonGroupContextKey, void 0);
2453
- const globalConfig2 = useGlobalConfig("button");
2454
- const { form } = useFormItem();
2455
- const _size = useFormSize(computed(() => buttonGroupContext == null ? void 0 : buttonGroupContext.size));
2456
- const _disabled = useFormDisabled();
2457
- const _ref = ref();
2458
- const slots = useSlots();
2459
- const _type = computed(() => {
2460
- var _a2;
2461
- return props.type || (buttonGroupContext == null ? void 0 : buttonGroupContext.type) || ((_a2 = globalConfig2.value) == null ? void 0 : _a2.type) || "";
2462
- });
2463
- const autoInsertSpace = computed(() => {
2464
- var _a2, _b, _c;
2465
- return (_c = (_b = props.autoInsertSpace) != null ? _b : (_a2 = globalConfig2.value) == null ? void 0 : _a2.autoInsertSpace) != null ? _c : false;
2466
- });
2467
- const _plain = computed(() => {
2468
- var _a2, _b, _c;
2469
- return (_c = (_b = props.plain) != null ? _b : (_a2 = globalConfig2.value) == null ? void 0 : _a2.plain) != null ? _c : false;
2470
- });
2471
- const _round = computed(() => {
2472
- var _a2, _b, _c;
2473
- return (_c = (_b = props.round) != null ? _b : (_a2 = globalConfig2.value) == null ? void 0 : _a2.round) != null ? _c : false;
2474
- });
2475
- const _props = computed(() => {
2476
- if (props.tag === "button") {
2477
- return {
2478
- ariaDisabled: _disabled.value || props.loading,
2479
- disabled: _disabled.value || props.loading,
2480
- autofocus: props.autofocus,
2481
- type: props.nativeType
2482
- };
2483
- }
2484
- return {};
2485
- });
2486
- const shouldAddSpace = computed(() => {
2487
- var _a2;
2488
- const defaultSlot = (_a2 = slots.default) == null ? void 0 : _a2.call(slots);
2489
- if (autoInsertSpace.value && (defaultSlot == null ? void 0 : defaultSlot.length) === 1) {
2490
- const slot = defaultSlot[0];
2491
- if ((slot == null ? void 0 : slot.type) === Text) {
2492
- const text = slot.children;
2493
- return new RegExp("^\\p{Unified_Ideograph}{2}$", "u").test(text.trim());
2494
- }
2495
- }
2496
- return false;
2497
- });
2498
- const handleClick = (evt) => {
2499
- if (_disabled.value || props.loading) {
2500
- evt.stopPropagation();
2501
- return;
2502
- }
2503
- if (props.nativeType === "reset") {
2504
- form == null ? void 0 : form.resetFields();
2505
- }
2506
- emit("click", evt);
2507
- };
2508
- return {
2509
- _disabled,
2510
- _size,
2511
- _type,
2512
- _ref,
2513
- _props,
2514
- _plain,
2515
- _round,
2516
- shouldAddSpace,
2517
- handleClick
2518
- };
2519
- };
2520
- const buttonTypes = [
2521
- "default",
2522
- "primary",
2523
- "success",
2524
- "warning",
2525
- "info",
2526
- "danger",
2527
- "text",
2528
- ""
2529
- ];
2530
- const buttonNativeTypes = ["button", "submit", "reset"];
2531
- const buttonProps = buildProps({
2532
- size: useSizeProp,
2533
- disabled: Boolean,
2534
- type: {
2535
- type: String,
2536
- values: buttonTypes,
2537
- default: ""
2538
- },
2539
- icon: {
2540
- type: iconPropType
2541
- },
2542
- nativeType: {
2543
- type: String,
2544
- values: buttonNativeTypes,
2545
- default: "button"
2546
- },
2547
- loading: Boolean,
2548
- loadingIcon: {
2549
- type: iconPropType,
2550
- default: () => loading_default
2551
- },
2552
- plain: {
2553
- type: Boolean,
2554
- default: void 0
2555
- },
2556
- text: Boolean,
2557
- link: Boolean,
2558
- bg: Boolean,
2559
- autofocus: Boolean,
2560
- round: {
2561
- type: Boolean,
2562
- default: void 0
2563
- },
2564
- circle: Boolean,
2565
- color: String,
2566
- dark: Boolean,
2567
- autoInsertSpace: {
2568
- type: Boolean,
2569
- default: void 0
2570
- },
2571
- tag: {
2572
- type: definePropType([String, Object]),
2573
- default: "button"
2574
- }
2575
- });
2576
- const buttonEmits = {
2577
- click: (evt) => evt instanceof MouseEvent
2578
- };
2579
- function bound01(n, max) {
2580
- if (isOnePointZero(n)) {
2581
- n = "100%";
2582
- }
2583
- var isPercent = isPercentage(n);
2584
- n = max === 360 ? n : Math.min(max, Math.max(0, parseFloat(n)));
2585
- if (isPercent) {
2586
- n = parseInt(String(n * max), 10) / 100;
2587
- }
2588
- if (Math.abs(n - max) < 1e-6) {
2589
- return 1;
2590
- }
2591
- if (max === 360) {
2592
- n = (n < 0 ? n % max + max : n % max) / parseFloat(String(max));
2593
- } else {
2594
- n = n % max / parseFloat(String(max));
2595
- }
2596
- return n;
2597
- }
2598
- function clamp01(val) {
2599
- return Math.min(1, Math.max(0, val));
2600
- }
2601
- function isOnePointZero(n) {
2602
- return typeof n === "string" && n.indexOf(".") !== -1 && parseFloat(n) === 1;
2603
- }
2604
- function isPercentage(n) {
2605
- return typeof n === "string" && n.indexOf("%") !== -1;
2606
- }
2607
- function boundAlpha(a) {
2608
- a = parseFloat(a);
2609
- if (isNaN(a) || a < 0 || a > 1) {
2610
- a = 1;
2611
- }
2612
- return a;
2613
- }
2614
- function convertToPercentage(n) {
2615
- if (n <= 1) {
2616
- return "".concat(Number(n) * 100, "%");
2617
- }
2618
- return n;
2619
- }
2620
- function pad2(c) {
2621
- return c.length === 1 ? "0" + c : String(c);
2622
- }
2623
- function rgbToRgb(r, g, b) {
2624
- return {
2625
- r: bound01(r, 255) * 255,
2626
- g: bound01(g, 255) * 255,
2627
- b: bound01(b, 255) * 255
2628
- };
2629
- }
2630
- function rgbToHsl(r, g, b) {
2631
- r = bound01(r, 255);
2632
- g = bound01(g, 255);
2633
- b = bound01(b, 255);
2634
- var max = Math.max(r, g, b);
2635
- var min = Math.min(r, g, b);
2636
- var h = 0;
2637
- var s = 0;
2638
- var l = (max + min) / 2;
2639
- if (max === min) {
2640
- s = 0;
2641
- h = 0;
2642
- } else {
2643
- var d = max - min;
2644
- s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
2645
- switch (max) {
2646
- case r:
2647
- h = (g - b) / d + (g < b ? 6 : 0);
2648
- break;
2649
- case g:
2650
- h = (b - r) / d + 2;
2651
- break;
2652
- case b:
2653
- h = (r - g) / d + 4;
2654
- break;
2655
- }
2656
- h /= 6;
2657
- }
2658
- return { h, s, l };
2659
- }
2660
- function hue2rgb(p, q, t) {
2661
- if (t < 0) {
2662
- t += 1;
2663
- }
2664
- if (t > 1) {
2665
- t -= 1;
2666
- }
2667
- if (t < 1 / 6) {
2668
- return p + (q - p) * (6 * t);
2669
- }
2670
- if (t < 1 / 2) {
2671
- return q;
2672
- }
2673
- if (t < 2 / 3) {
2674
- return p + (q - p) * (2 / 3 - t) * 6;
2675
- }
2676
- return p;
2677
- }
2678
- function hslToRgb(h, s, l) {
2679
- var r;
2680
- var g;
2681
- var b;
2682
- h = bound01(h, 360);
2683
- s = bound01(s, 100);
2684
- l = bound01(l, 100);
2685
- if (s === 0) {
2686
- g = l;
2687
- b = l;
2688
- r = l;
2689
- } else {
2690
- var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
2691
- var p = 2 * l - q;
2692
- r = hue2rgb(p, q, h + 1 / 3);
2693
- g = hue2rgb(p, q, h);
2694
- b = hue2rgb(p, q, h - 1 / 3);
2695
- }
2696
- return { r: r * 255, g: g * 255, b: b * 255 };
2697
- }
2698
- function rgbToHsv(r, g, b) {
2699
- r = bound01(r, 255);
2700
- g = bound01(g, 255);
2701
- b = bound01(b, 255);
2702
- var max = Math.max(r, g, b);
2703
- var min = Math.min(r, g, b);
2704
- var h = 0;
2705
- var v = max;
2706
- var d = max - min;
2707
- var s = max === 0 ? 0 : d / max;
2708
- if (max === min) {
2709
- h = 0;
2710
- } else {
2711
- switch (max) {
2712
- case r:
2713
- h = (g - b) / d + (g < b ? 6 : 0);
2714
- break;
2715
- case g:
2716
- h = (b - r) / d + 2;
2717
- break;
2718
- case b:
2719
- h = (r - g) / d + 4;
2720
- break;
2721
- }
2722
- h /= 6;
2723
- }
2724
- return { h, s, v };
2725
- }
2726
- function hsvToRgb(h, s, v) {
2727
- h = bound01(h, 360) * 6;
2728
- s = bound01(s, 100);
2729
- v = bound01(v, 100);
2730
- var i = Math.floor(h);
2731
- var f = h - i;
2732
- var p = v * (1 - s);
2733
- var q = v * (1 - f * s);
2734
- var t = v * (1 - (1 - f) * s);
2735
- var mod = i % 6;
2736
- var r = [v, q, p, p, t, v][mod];
2737
- var g = [t, v, v, q, p, p][mod];
2738
- var b = [p, p, t, v, v, q][mod];
2739
- return { r: r * 255, g: g * 255, b: b * 255 };
2740
- }
2741
- function rgbToHex(r, g, b, allow3Char) {
2742
- var hex = [
2743
- pad2(Math.round(r).toString(16)),
2744
- pad2(Math.round(g).toString(16)),
2745
- pad2(Math.round(b).toString(16))
2746
- ];
2747
- if (allow3Char && hex[0].startsWith(hex[0].charAt(1)) && hex[1].startsWith(hex[1].charAt(1)) && hex[2].startsWith(hex[2].charAt(1))) {
2748
- return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
2749
- }
2750
- return hex.join("");
2751
- }
2752
- function rgbaToHex(r, g, b, a, allow4Char) {
2753
- var hex = [
2754
- pad2(Math.round(r).toString(16)),
2755
- pad2(Math.round(g).toString(16)),
2756
- pad2(Math.round(b).toString(16)),
2757
- pad2(convertDecimalToHex(a))
2758
- ];
2759
- if (allow4Char && hex[0].startsWith(hex[0].charAt(1)) && hex[1].startsWith(hex[1].charAt(1)) && hex[2].startsWith(hex[2].charAt(1)) && hex[3].startsWith(hex[3].charAt(1))) {
2760
- return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
2761
- }
2762
- return hex.join("");
2763
- }
2764
- function convertDecimalToHex(d) {
2765
- return Math.round(parseFloat(d) * 255).toString(16);
2766
- }
2767
- function convertHexToDecimal(h) {
2768
- return parseIntFromHex(h) / 255;
2769
- }
2770
- function parseIntFromHex(val) {
2771
- return parseInt(val, 16);
2772
- }
2773
- function numberInputToObject(color) {
2774
- return {
2775
- r: color >> 16,
2776
- g: (color & 65280) >> 8,
2777
- b: color & 255
2778
- };
2779
- }
2780
- var names = {
2781
- aliceblue: "#f0f8ff",
2782
- antiquewhite: "#faebd7",
2783
- aqua: "#00ffff",
2784
- aquamarine: "#7fffd4",
2785
- azure: "#f0ffff",
2786
- beige: "#f5f5dc",
2787
- bisque: "#ffe4c4",
2788
- black: "#000000",
2789
- blanchedalmond: "#ffebcd",
2790
- blue: "#0000ff",
2791
- blueviolet: "#8a2be2",
2792
- brown: "#a52a2a",
2793
- burlywood: "#deb887",
2794
- cadetblue: "#5f9ea0",
2795
- chartreuse: "#7fff00",
2796
- chocolate: "#d2691e",
2797
- coral: "#ff7f50",
2798
- cornflowerblue: "#6495ed",
2799
- cornsilk: "#fff8dc",
2800
- crimson: "#dc143c",
2801
- cyan: "#00ffff",
2802
- darkblue: "#00008b",
2803
- darkcyan: "#008b8b",
2804
- darkgoldenrod: "#b8860b",
2805
- darkgray: "#a9a9a9",
2806
- darkgreen: "#006400",
2807
- darkgrey: "#a9a9a9",
2808
- darkkhaki: "#bdb76b",
2809
- darkmagenta: "#8b008b",
2810
- darkolivegreen: "#556b2f",
2811
- darkorange: "#ff8c00",
2812
- darkorchid: "#9932cc",
2813
- darkred: "#8b0000",
2814
- darksalmon: "#e9967a",
2815
- darkseagreen: "#8fbc8f",
2816
- darkslateblue: "#483d8b",
2817
- darkslategray: "#2f4f4f",
2818
- darkslategrey: "#2f4f4f",
2819
- darkturquoise: "#00ced1",
2820
- darkviolet: "#9400d3",
2821
- deeppink: "#ff1493",
2822
- deepskyblue: "#00bfff",
2823
- dimgray: "#696969",
2824
- dimgrey: "#696969",
2825
- dodgerblue: "#1e90ff",
2826
- firebrick: "#b22222",
2827
- floralwhite: "#fffaf0",
2828
- forestgreen: "#228b22",
2829
- fuchsia: "#ff00ff",
2830
- gainsboro: "#dcdcdc",
2831
- ghostwhite: "#f8f8ff",
2832
- goldenrod: "#daa520",
2833
- gold: "#ffd700",
2834
- gray: "#808080",
2835
- green: "#008000",
2836
- greenyellow: "#adff2f",
2837
- grey: "#808080",
2838
- honeydew: "#f0fff0",
2839
- hotpink: "#ff69b4",
2840
- indianred: "#cd5c5c",
2841
- indigo: "#4b0082",
2842
- ivory: "#fffff0",
2843
- khaki: "#f0e68c",
2844
- lavenderblush: "#fff0f5",
2845
- lavender: "#e6e6fa",
2846
- lawngreen: "#7cfc00",
2847
- lemonchiffon: "#fffacd",
2848
- lightblue: "#add8e6",
2849
- lightcoral: "#f08080",
2850
- lightcyan: "#e0ffff",
2851
- lightgoldenrodyellow: "#fafad2",
2852
- lightgray: "#d3d3d3",
2853
- lightgreen: "#90ee90",
2854
- lightgrey: "#d3d3d3",
2855
- lightpink: "#ffb6c1",
2856
- lightsalmon: "#ffa07a",
2857
- lightseagreen: "#20b2aa",
2858
- lightskyblue: "#87cefa",
2859
- lightslategray: "#778899",
2860
- lightslategrey: "#778899",
2861
- lightsteelblue: "#b0c4de",
2862
- lightyellow: "#ffffe0",
2863
- lime: "#00ff00",
2864
- limegreen: "#32cd32",
2865
- linen: "#faf0e6",
2866
- magenta: "#ff00ff",
2867
- maroon: "#800000",
2868
- mediumaquamarine: "#66cdaa",
2869
- mediumblue: "#0000cd",
2870
- mediumorchid: "#ba55d3",
2871
- mediumpurple: "#9370db",
2872
- mediumseagreen: "#3cb371",
2873
- mediumslateblue: "#7b68ee",
2874
- mediumspringgreen: "#00fa9a",
2875
- mediumturquoise: "#48d1cc",
2876
- mediumvioletred: "#c71585",
2877
- midnightblue: "#191970",
2878
- mintcream: "#f5fffa",
2879
- mistyrose: "#ffe4e1",
2880
- moccasin: "#ffe4b5",
2881
- navajowhite: "#ffdead",
2882
- navy: "#000080",
2883
- oldlace: "#fdf5e6",
2884
- olive: "#808000",
2885
- olivedrab: "#6b8e23",
2886
- orange: "#ffa500",
2887
- orangered: "#ff4500",
2888
- orchid: "#da70d6",
2889
- palegoldenrod: "#eee8aa",
2890
- palegreen: "#98fb98",
2891
- paleturquoise: "#afeeee",
2892
- palevioletred: "#db7093",
2893
- papayawhip: "#ffefd5",
2894
- peachpuff: "#ffdab9",
2895
- peru: "#cd853f",
2896
- pink: "#ffc0cb",
2897
- plum: "#dda0dd",
2898
- powderblue: "#b0e0e6",
2899
- purple: "#800080",
2900
- rebeccapurple: "#663399",
2901
- red: "#ff0000",
2902
- rosybrown: "#bc8f8f",
2903
- royalblue: "#4169e1",
2904
- saddlebrown: "#8b4513",
2905
- salmon: "#fa8072",
2906
- sandybrown: "#f4a460",
2907
- seagreen: "#2e8b57",
2908
- seashell: "#fff5ee",
2909
- sienna: "#a0522d",
2910
- silver: "#c0c0c0",
2911
- skyblue: "#87ceeb",
2912
- slateblue: "#6a5acd",
2913
- slategray: "#708090",
2914
- slategrey: "#708090",
2915
- snow: "#fffafa",
2916
- springgreen: "#00ff7f",
2917
- steelblue: "#4682b4",
2918
- tan: "#d2b48c",
2919
- teal: "#008080",
2920
- thistle: "#d8bfd8",
2921
- tomato: "#ff6347",
2922
- turquoise: "#40e0d0",
2923
- violet: "#ee82ee",
2924
- wheat: "#f5deb3",
2925
- white: "#ffffff",
2926
- whitesmoke: "#f5f5f5",
2927
- yellow: "#ffff00",
2928
- yellowgreen: "#9acd32"
2929
- };
2930
- function inputToRGB(color) {
2931
- var rgb = { r: 0, g: 0, b: 0 };
2932
- var a = 1;
2933
- var s = null;
2934
- var v = null;
2935
- var l = null;
2936
- var ok = false;
2937
- var format = false;
2938
- if (typeof color === "string") {
2939
- color = stringInputToObject(color);
2940
- }
2941
- if (typeof color === "object") {
2942
- if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
2943
- rgb = rgbToRgb(color.r, color.g, color.b);
2944
- ok = true;
2945
- format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
2946
- } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
2947
- s = convertToPercentage(color.s);
2948
- v = convertToPercentage(color.v);
2949
- rgb = hsvToRgb(color.h, s, v);
2950
- ok = true;
2951
- format = "hsv";
2952
- } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
2953
- s = convertToPercentage(color.s);
2954
- l = convertToPercentage(color.l);
2955
- rgb = hslToRgb(color.h, s, l);
2956
- ok = true;
2957
- format = "hsl";
2958
- }
2959
- if (Object.prototype.hasOwnProperty.call(color, "a")) {
2960
- a = color.a;
2961
- }
2962
- }
2963
- a = boundAlpha(a);
2964
- return {
2965
- ok,
2966
- format: color.format || format,
2967
- r: Math.min(255, Math.max(rgb.r, 0)),
2968
- g: Math.min(255, Math.max(rgb.g, 0)),
2969
- b: Math.min(255, Math.max(rgb.b, 0)),
2970
- a
2971
- };
2972
- }
2973
- var CSS_INTEGER = "[-\\+]?\\d+%?";
2974
- var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
2975
- var CSS_UNIT = "(?:".concat(CSS_NUMBER, ")|(?:").concat(CSS_INTEGER, ")");
2976
- var PERMISSIVE_MATCH3 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
2977
- var PERMISSIVE_MATCH4 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
2978
- var matchers = {
2979
- CSS_UNIT: new RegExp(CSS_UNIT),
2980
- rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
2981
- rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
2982
- hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
2983
- hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
2984
- hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
2985
- hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
2986
- hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
2987
- hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
2988
- hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
2989
- hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
2990
- };
2991
- function stringInputToObject(color) {
2992
- color = color.trim().toLowerCase();
2993
- if (color.length === 0) {
2994
- return false;
2995
- }
2996
- var named = false;
2997
- if (names[color]) {
2998
- color = names[color];
2999
- named = true;
3000
- } else if (color === "transparent") {
3001
- return { r: 0, g: 0, b: 0, a: 0, format: "name" };
3002
- }
3003
- var match = matchers.rgb.exec(color);
3004
- if (match) {
3005
- return { r: match[1], g: match[2], b: match[3] };
3006
- }
3007
- match = matchers.rgba.exec(color);
3008
- if (match) {
3009
- return { r: match[1], g: match[2], b: match[3], a: match[4] };
3010
- }
3011
- match = matchers.hsl.exec(color);
3012
- if (match) {
3013
- return { h: match[1], s: match[2], l: match[3] };
3014
- }
3015
- match = matchers.hsla.exec(color);
3016
- if (match) {
3017
- return { h: match[1], s: match[2], l: match[3], a: match[4] };
3018
- }
3019
- match = matchers.hsv.exec(color);
3020
- if (match) {
3021
- return { h: match[1], s: match[2], v: match[3] };
3022
- }
3023
- match = matchers.hsva.exec(color);
3024
- if (match) {
3025
- return { h: match[1], s: match[2], v: match[3], a: match[4] };
3026
- }
3027
- match = matchers.hex8.exec(color);
3028
- if (match) {
3029
- return {
3030
- r: parseIntFromHex(match[1]),
3031
- g: parseIntFromHex(match[2]),
3032
- b: parseIntFromHex(match[3]),
3033
- a: convertHexToDecimal(match[4]),
3034
- format: named ? "name" : "hex8"
3035
- };
3036
- }
3037
- match = matchers.hex6.exec(color);
3038
- if (match) {
3039
- return {
3040
- r: parseIntFromHex(match[1]),
3041
- g: parseIntFromHex(match[2]),
3042
- b: parseIntFromHex(match[3]),
3043
- format: named ? "name" : "hex"
3044
- };
3045
- }
3046
- match = matchers.hex4.exec(color);
3047
- if (match) {
3048
- return {
3049
- r: parseIntFromHex(match[1] + match[1]),
3050
- g: parseIntFromHex(match[2] + match[2]),
3051
- b: parseIntFromHex(match[3] + match[3]),
3052
- a: convertHexToDecimal(match[4] + match[4]),
3053
- format: named ? "name" : "hex8"
3054
- };
3055
- }
3056
- match = matchers.hex3.exec(color);
3057
- if (match) {
3058
- return {
3059
- r: parseIntFromHex(match[1] + match[1]),
3060
- g: parseIntFromHex(match[2] + match[2]),
3061
- b: parseIntFromHex(match[3] + match[3]),
3062
- format: named ? "name" : "hex"
3063
- };
3064
- }
3065
- return false;
3066
- }
3067
- function isValidCSSUnit(color) {
3068
- return Boolean(matchers.CSS_UNIT.exec(String(color)));
3069
- }
3070
- var TinyColor = (
3071
- /** @class */
3072
- (function() {
3073
- function TinyColor2(color, opts) {
3074
- if (color === void 0) {
3075
- color = "";
3076
- }
3077
- if (opts === void 0) {
3078
- opts = {};
3079
- }
3080
- var _a2;
3081
- if (color instanceof TinyColor2) {
3082
- return color;
3083
- }
3084
- if (typeof color === "number") {
3085
- color = numberInputToObject(color);
3086
- }
3087
- this.originalInput = color;
3088
- var rgb = inputToRGB(color);
3089
- this.originalInput = color;
3090
- this.r = rgb.r;
3091
- this.g = rgb.g;
3092
- this.b = rgb.b;
3093
- this.a = rgb.a;
3094
- this.roundA = Math.round(100 * this.a) / 100;
3095
- this.format = (_a2 = opts.format) !== null && _a2 !== void 0 ? _a2 : rgb.format;
3096
- this.gradientType = opts.gradientType;
3097
- if (this.r < 1) {
3098
- this.r = Math.round(this.r);
3099
- }
3100
- if (this.g < 1) {
3101
- this.g = Math.round(this.g);
3102
- }
3103
- if (this.b < 1) {
3104
- this.b = Math.round(this.b);
3105
- }
3106
- this.isValid = rgb.ok;
3107
- }
3108
- TinyColor2.prototype.isDark = function() {
3109
- return this.getBrightness() < 128;
3110
- };
3111
- TinyColor2.prototype.isLight = function() {
3112
- return !this.isDark();
3113
- };
3114
- TinyColor2.prototype.getBrightness = function() {
3115
- var rgb = this.toRgb();
3116
- return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1e3;
3117
- };
3118
- TinyColor2.prototype.getLuminance = function() {
3119
- var rgb = this.toRgb();
3120
- var R;
3121
- var G;
3122
- var B;
3123
- var RsRGB = rgb.r / 255;
3124
- var GsRGB = rgb.g / 255;
3125
- var BsRGB = rgb.b / 255;
3126
- if (RsRGB <= 0.03928) {
3127
- R = RsRGB / 12.92;
3128
- } else {
3129
- R = Math.pow((RsRGB + 0.055) / 1.055, 2.4);
3130
- }
3131
- if (GsRGB <= 0.03928) {
3132
- G = GsRGB / 12.92;
3133
- } else {
3134
- G = Math.pow((GsRGB + 0.055) / 1.055, 2.4);
3135
- }
3136
- if (BsRGB <= 0.03928) {
3137
- B = BsRGB / 12.92;
3138
- } else {
3139
- B = Math.pow((BsRGB + 0.055) / 1.055, 2.4);
3140
- }
3141
- return 0.2126 * R + 0.7152 * G + 0.0722 * B;
3142
- };
3143
- TinyColor2.prototype.getAlpha = function() {
3144
- return this.a;
3145
- };
3146
- TinyColor2.prototype.setAlpha = function(alpha) {
3147
- this.a = boundAlpha(alpha);
3148
- this.roundA = Math.round(100 * this.a) / 100;
3149
- return this;
3150
- };
3151
- TinyColor2.prototype.isMonochrome = function() {
3152
- var s = this.toHsl().s;
3153
- return s === 0;
3154
- };
3155
- TinyColor2.prototype.toHsv = function() {
3156
- var hsv = rgbToHsv(this.r, this.g, this.b);
3157
- return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this.a };
3158
- };
3159
- TinyColor2.prototype.toHsvString = function() {
3160
- var hsv = rgbToHsv(this.r, this.g, this.b);
3161
- var h = Math.round(hsv.h * 360);
3162
- var s = Math.round(hsv.s * 100);
3163
- var v = Math.round(hsv.v * 100);
3164
- return this.a === 1 ? "hsv(".concat(h, ", ").concat(s, "%, ").concat(v, "%)") : "hsva(".concat(h, ", ").concat(s, "%, ").concat(v, "%, ").concat(this.roundA, ")");
3165
- };
3166
- TinyColor2.prototype.toHsl = function() {
3167
- var hsl = rgbToHsl(this.r, this.g, this.b);
3168
- return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this.a };
3169
- };
3170
- TinyColor2.prototype.toHslString = function() {
3171
- var hsl = rgbToHsl(this.r, this.g, this.b);
3172
- var h = Math.round(hsl.h * 360);
3173
- var s = Math.round(hsl.s * 100);
3174
- var l = Math.round(hsl.l * 100);
3175
- return this.a === 1 ? "hsl(".concat(h, ", ").concat(s, "%, ").concat(l, "%)") : "hsla(".concat(h, ", ").concat(s, "%, ").concat(l, "%, ").concat(this.roundA, ")");
3176
- };
3177
- TinyColor2.prototype.toHex = function(allow3Char) {
3178
- if (allow3Char === void 0) {
3179
- allow3Char = false;
3180
- }
3181
- return rgbToHex(this.r, this.g, this.b, allow3Char);
3182
- };
3183
- TinyColor2.prototype.toHexString = function(allow3Char) {
3184
- if (allow3Char === void 0) {
3185
- allow3Char = false;
3186
- }
3187
- return "#" + this.toHex(allow3Char);
3188
- };
3189
- TinyColor2.prototype.toHex8 = function(allow4Char) {
3190
- if (allow4Char === void 0) {
3191
- allow4Char = false;
3192
- }
3193
- return rgbaToHex(this.r, this.g, this.b, this.a, allow4Char);
3194
- };
3195
- TinyColor2.prototype.toHex8String = function(allow4Char) {
3196
- if (allow4Char === void 0) {
3197
- allow4Char = false;
3198
- }
3199
- return "#" + this.toHex8(allow4Char);
3200
- };
3201
- TinyColor2.prototype.toHexShortString = function(allowShortChar) {
3202
- if (allowShortChar === void 0) {
3203
- allowShortChar = false;
3204
- }
3205
- return this.a === 1 ? this.toHexString(allowShortChar) : this.toHex8String(allowShortChar);
3206
- };
3207
- TinyColor2.prototype.toRgb = function() {
3208
- return {
3209
- r: Math.round(this.r),
3210
- g: Math.round(this.g),
3211
- b: Math.round(this.b),
3212
- a: this.a
3213
- };
3214
- };
3215
- TinyColor2.prototype.toRgbString = function() {
3216
- var r = Math.round(this.r);
3217
- var g = Math.round(this.g);
3218
- var b = Math.round(this.b);
3219
- return this.a === 1 ? "rgb(".concat(r, ", ").concat(g, ", ").concat(b, ")") : "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(this.roundA, ")");
3220
- };
3221
- TinyColor2.prototype.toPercentageRgb = function() {
3222
- var fmt = function(x) {
3223
- return "".concat(Math.round(bound01(x, 255) * 100), "%");
3224
- };
3225
- return {
3226
- r: fmt(this.r),
3227
- g: fmt(this.g),
3228
- b: fmt(this.b),
3229
- a: this.a
3230
- };
3231
- };
3232
- TinyColor2.prototype.toPercentageRgbString = function() {
3233
- var rnd = function(x) {
3234
- return Math.round(bound01(x, 255) * 100);
3235
- };
3236
- return this.a === 1 ? "rgb(".concat(rnd(this.r), "%, ").concat(rnd(this.g), "%, ").concat(rnd(this.b), "%)") : "rgba(".concat(rnd(this.r), "%, ").concat(rnd(this.g), "%, ").concat(rnd(this.b), "%, ").concat(this.roundA, ")");
3237
- };
3238
- TinyColor2.prototype.toName = function() {
3239
- if (this.a === 0) {
3240
- return "transparent";
3241
- }
3242
- if (this.a < 1) {
3243
- return false;
3244
- }
3245
- var hex = "#" + rgbToHex(this.r, this.g, this.b, false);
3246
- for (var _i = 0, _a2 = Object.entries(names); _i < _a2.length; _i++) {
3247
- var _b = _a2[_i], key = _b[0], value = _b[1];
3248
- if (hex === value) {
3249
- return key;
3250
- }
3251
- }
3252
- return false;
3253
- };
3254
- TinyColor2.prototype.toString = function(format) {
3255
- var formatSet = Boolean(format);
3256
- format = format !== null && format !== void 0 ? format : this.format;
3257
- var formattedString = false;
3258
- var hasAlpha = this.a < 1 && this.a >= 0;
3259
- var needsAlphaFormat = !formatSet && hasAlpha && (format.startsWith("hex") || format === "name");
3260
- if (needsAlphaFormat) {
3261
- if (format === "name" && this.a === 0) {
3262
- return this.toName();
3263
- }
3264
- return this.toRgbString();
3265
- }
3266
- if (format === "rgb") {
3267
- formattedString = this.toRgbString();
3268
- }
3269
- if (format === "prgb") {
3270
- formattedString = this.toPercentageRgbString();
3271
- }
3272
- if (format === "hex" || format === "hex6") {
3273
- formattedString = this.toHexString();
3274
- }
3275
- if (format === "hex3") {
3276
- formattedString = this.toHexString(true);
3277
- }
3278
- if (format === "hex4") {
3279
- formattedString = this.toHex8String(true);
3280
- }
3281
- if (format === "hex8") {
3282
- formattedString = this.toHex8String();
3283
- }
3284
- if (format === "name") {
3285
- formattedString = this.toName();
3286
- }
3287
- if (format === "hsl") {
3288
- formattedString = this.toHslString();
3289
- }
3290
- if (format === "hsv") {
3291
- formattedString = this.toHsvString();
3292
- }
3293
- return formattedString || this.toHexString();
3294
- };
3295
- TinyColor2.prototype.toNumber = function() {
3296
- return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);
3297
- };
3298
- TinyColor2.prototype.clone = function() {
3299
- return new TinyColor2(this.toString());
3300
- };
3301
- TinyColor2.prototype.lighten = function(amount) {
3302
- if (amount === void 0) {
3303
- amount = 10;
3304
- }
3305
- var hsl = this.toHsl();
3306
- hsl.l += amount / 100;
3307
- hsl.l = clamp01(hsl.l);
3308
- return new TinyColor2(hsl);
3309
- };
3310
- TinyColor2.prototype.brighten = function(amount) {
3311
- if (amount === void 0) {
3312
- amount = 10;
3313
- }
3314
- var rgb = this.toRgb();
3315
- rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100))));
3316
- rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100))));
3317
- rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100))));
3318
- return new TinyColor2(rgb);
3319
- };
3320
- TinyColor2.prototype.darken = function(amount) {
3321
- if (amount === void 0) {
3322
- amount = 10;
3323
- }
3324
- var hsl = this.toHsl();
3325
- hsl.l -= amount / 100;
3326
- hsl.l = clamp01(hsl.l);
3327
- return new TinyColor2(hsl);
3328
- };
3329
- TinyColor2.prototype.tint = function(amount) {
3330
- if (amount === void 0) {
3331
- amount = 10;
3332
- }
3333
- return this.mix("white", amount);
3334
- };
3335
- TinyColor2.prototype.shade = function(amount) {
3336
- if (amount === void 0) {
3337
- amount = 10;
3338
- }
3339
- return this.mix("black", amount);
3340
- };
3341
- TinyColor2.prototype.desaturate = function(amount) {
3342
- if (amount === void 0) {
3343
- amount = 10;
3344
- }
3345
- var hsl = this.toHsl();
3346
- hsl.s -= amount / 100;
3347
- hsl.s = clamp01(hsl.s);
3348
- return new TinyColor2(hsl);
3349
- };
3350
- TinyColor2.prototype.saturate = function(amount) {
3351
- if (amount === void 0) {
3352
- amount = 10;
3353
- }
3354
- var hsl = this.toHsl();
3355
- hsl.s += amount / 100;
3356
- hsl.s = clamp01(hsl.s);
3357
- return new TinyColor2(hsl);
3358
- };
3359
- TinyColor2.prototype.greyscale = function() {
3360
- return this.desaturate(100);
3361
- };
3362
- TinyColor2.prototype.spin = function(amount) {
3363
- var hsl = this.toHsl();
3364
- var hue = (hsl.h + amount) % 360;
3365
- hsl.h = hue < 0 ? 360 + hue : hue;
3366
- return new TinyColor2(hsl);
3367
- };
3368
- TinyColor2.prototype.mix = function(color, amount) {
3369
- if (amount === void 0) {
3370
- amount = 50;
3371
- }
3372
- var rgb1 = this.toRgb();
3373
- var rgb2 = new TinyColor2(color).toRgb();
3374
- var p = amount / 100;
3375
- var rgba = {
3376
- r: (rgb2.r - rgb1.r) * p + rgb1.r,
3377
- g: (rgb2.g - rgb1.g) * p + rgb1.g,
3378
- b: (rgb2.b - rgb1.b) * p + rgb1.b,
3379
- a: (rgb2.a - rgb1.a) * p + rgb1.a
3380
- };
3381
- return new TinyColor2(rgba);
3382
- };
3383
- TinyColor2.prototype.analogous = function(results, slices) {
3384
- if (results === void 0) {
3385
- results = 6;
3386
- }
3387
- if (slices === void 0) {
3388
- slices = 30;
3389
- }
3390
- var hsl = this.toHsl();
3391
- var part = 360 / slices;
3392
- var ret = [this];
3393
- for (hsl.h = (hsl.h - (part * results >> 1) + 720) % 360; --results; ) {
3394
- hsl.h = (hsl.h + part) % 360;
3395
- ret.push(new TinyColor2(hsl));
3396
- }
3397
- return ret;
3398
- };
3399
- TinyColor2.prototype.complement = function() {
3400
- var hsl = this.toHsl();
3401
- hsl.h = (hsl.h + 180) % 360;
3402
- return new TinyColor2(hsl);
3403
- };
3404
- TinyColor2.prototype.monochromatic = function(results) {
3405
- if (results === void 0) {
3406
- results = 6;
3407
- }
3408
- var hsv = this.toHsv();
3409
- var h = hsv.h;
3410
- var s = hsv.s;
3411
- var v = hsv.v;
3412
- var res = [];
3413
- var modification = 1 / results;
3414
- while (results--) {
3415
- res.push(new TinyColor2({ h, s, v }));
3416
- v = (v + modification) % 1;
3417
- }
3418
- return res;
3419
- };
3420
- TinyColor2.prototype.splitcomplement = function() {
3421
- var hsl = this.toHsl();
3422
- var h = hsl.h;
3423
- return [
3424
- this,
3425
- new TinyColor2({ h: (h + 72) % 360, s: hsl.s, l: hsl.l }),
3426
- new TinyColor2({ h: (h + 216) % 360, s: hsl.s, l: hsl.l })
3427
- ];
3428
- };
3429
- TinyColor2.prototype.onBackground = function(background) {
3430
- var fg = this.toRgb();
3431
- var bg = new TinyColor2(background).toRgb();
3432
- var alpha = fg.a + bg.a * (1 - fg.a);
3433
- return new TinyColor2({
3434
- r: (fg.r * fg.a + bg.r * bg.a * (1 - fg.a)) / alpha,
3435
- g: (fg.g * fg.a + bg.g * bg.a * (1 - fg.a)) / alpha,
3436
- b: (fg.b * fg.a + bg.b * bg.a * (1 - fg.a)) / alpha,
3437
- a: alpha
3438
- });
3439
- };
3440
- TinyColor2.prototype.triad = function() {
3441
- return this.polyad(3);
3442
- };
3443
- TinyColor2.prototype.tetrad = function() {
3444
- return this.polyad(4);
3445
- };
3446
- TinyColor2.prototype.polyad = function(n) {
3447
- var hsl = this.toHsl();
3448
- var h = hsl.h;
3449
- var result = [this];
3450
- var increment = 360 / n;
3451
- for (var i = 1; i < n; i++) {
3452
- result.push(new TinyColor2({ h: (h + i * increment) % 360, s: hsl.s, l: hsl.l }));
3453
- }
3454
- return result;
3455
- };
3456
- TinyColor2.prototype.equals = function(color) {
3457
- return this.toRgbString() === new TinyColor2(color).toRgbString();
3458
- };
3459
- return TinyColor2;
3460
- })()
3461
- );
3462
- function darken(color, amount = 20) {
3463
- return color.mix("#141414", amount).toString();
3464
- }
3465
- function useButtonCustomStyle(props) {
3466
- const _disabled = useFormDisabled();
3467
- const ns = useNamespace("button");
3468
- return computed(() => {
3469
- let styles = {};
3470
- let buttonColor = props.color;
3471
- if (buttonColor) {
3472
- const match = buttonColor.match(/var\((.*?)\)/);
3473
- if (match) {
3474
- buttonColor = window.getComputedStyle(window.document.documentElement).getPropertyValue(match[1]);
3475
- }
3476
- const color = new TinyColor(buttonColor);
3477
- const activeBgColor = props.dark ? color.tint(20).toString() : darken(color, 20);
3478
- if (props.plain) {
3479
- styles = ns.cssVarBlock({
3480
- "bg-color": props.dark ? darken(color, 90) : color.tint(90).toString(),
3481
- "text-color": buttonColor,
3482
- "border-color": props.dark ? darken(color, 50) : color.tint(50).toString(),
3483
- "hover-text-color": `var(${ns.cssVarName("color-white")})`,
3484
- "hover-bg-color": buttonColor,
3485
- "hover-border-color": buttonColor,
3486
- "active-bg-color": activeBgColor,
3487
- "active-text-color": `var(${ns.cssVarName("color-white")})`,
3488
- "active-border-color": activeBgColor
3489
- });
3490
- if (_disabled.value) {
3491
- styles[ns.cssVarBlockName("disabled-bg-color")] = props.dark ? darken(color, 90) : color.tint(90).toString();
3492
- styles[ns.cssVarBlockName("disabled-text-color")] = props.dark ? darken(color, 50) : color.tint(50).toString();
3493
- styles[ns.cssVarBlockName("disabled-border-color")] = props.dark ? darken(color, 80) : color.tint(80).toString();
3494
- }
3495
- } else {
3496
- const hoverBgColor = props.dark ? darken(color, 30) : color.tint(30).toString();
3497
- const textColor = color.isDark() ? `var(${ns.cssVarName("color-white")})` : `var(${ns.cssVarName("color-black")})`;
3498
- styles = ns.cssVarBlock({
3499
- "bg-color": buttonColor,
3500
- "text-color": textColor,
3501
- "border-color": buttonColor,
3502
- "hover-bg-color": hoverBgColor,
3503
- "hover-text-color": textColor,
3504
- "hover-border-color": hoverBgColor,
3505
- "active-bg-color": activeBgColor,
3506
- "active-border-color": activeBgColor
3507
- });
3508
- if (_disabled.value) {
3509
- const disabledButtonColor = props.dark ? darken(color, 50) : color.tint(50).toString();
3510
- styles[ns.cssVarBlockName("disabled-bg-color")] = disabledButtonColor;
3511
- styles[ns.cssVarBlockName("disabled-text-color")] = props.dark ? "rgba(255, 255, 255, 0.5)" : `var(${ns.cssVarName("color-white")})`;
3512
- styles[ns.cssVarBlockName("disabled-border-color")] = disabledButtonColor;
3513
- }
3514
- }
3515
- }
3516
- return styles;
3517
- });
3518
- }
3519
- const __default__$4 = defineComponent({
3520
- name: "ElButton"
3521
- });
3522
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
3523
- ...__default__$4,
3524
- props: buttonProps,
3525
- emits: buttonEmits,
3526
- setup(__props, { expose, emit }) {
3527
- const props = __props;
3528
- const buttonStyle = useButtonCustomStyle(props);
3529
- const ns = useNamespace("button");
3530
- const {
3531
- _ref,
3532
- _size,
3533
- _type,
3534
- _disabled,
3535
- _props,
3536
- _plain,
3537
- _round,
3538
- shouldAddSpace,
3539
- handleClick
3540
- } = useButton(props, emit);
3541
- const buttonKls = computed(() => [
3542
- ns.b(),
3543
- ns.m(_type.value),
3544
- ns.m(_size.value),
3545
- ns.is("disabled", _disabled.value),
3546
- ns.is("loading", props.loading),
3547
- ns.is("plain", _plain.value),
3548
- ns.is("round", _round.value),
3549
- ns.is("circle", props.circle),
3550
- ns.is("text", props.text),
3551
- ns.is("link", props.link),
3552
- ns.is("has-bg", props.bg)
3553
- ]);
3554
- expose({
3555
- ref: _ref,
3556
- size: _size,
3557
- type: _type,
3558
- disabled: _disabled,
3559
- shouldAddSpace
3560
- });
3561
- return (_ctx, _cache) => {
3562
- return openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), mergeProps({
3563
- ref_key: "_ref",
3564
- ref: _ref
3565
- }, unref(_props), {
3566
- class: unref(buttonKls),
3567
- style: unref(buttonStyle),
3568
- onClick: unref(handleClick)
3569
- }), {
3570
- default: withCtx(() => [
3571
- _ctx.loading ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
3572
- _ctx.$slots.loading ? renderSlot(_ctx.$slots, "loading", { key: 0 }) : (openBlock(), createBlock(unref(ElIcon), {
3573
- key: 1,
3574
- class: normalizeClass(unref(ns).is("loading"))
3575
- }, {
3576
- default: withCtx(() => [
3577
- (openBlock(), createBlock(resolveDynamicComponent(_ctx.loadingIcon)))
3578
- ]),
3579
- _: 1
3580
- }, 8, ["class"]))
3581
- ], 64)) : _ctx.icon || _ctx.$slots.icon ? (openBlock(), createBlock(unref(ElIcon), { key: 1 }, {
3582
- default: withCtx(() => [
3583
- _ctx.icon ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.icon), { key: 0 })) : renderSlot(_ctx.$slots, "icon", { key: 1 })
3584
- ]),
3585
- _: 3
3586
- })) : createCommentVNode("v-if", true),
3587
- _ctx.$slots.default ? (openBlock(), createElementBlock("span", {
3588
- key: 2,
3589
- class: normalizeClass({ [unref(ns).em("text", "expand")]: unref(shouldAddSpace) })
3590
- }, [
3591
- renderSlot(_ctx.$slots, "default")
3592
- ], 2)) : createCommentVNode("v-if", true)
3593
- ]),
3594
- _: 3
3595
- }, 16, ["class", "style", "onClick"]);
3596
- };
3597
- }
3598
- });
3599
- var Button = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__file", "button.vue"]]);
3600
- const buttonGroupProps = {
3601
- size: buttonProps.size,
3602
- type: buttonProps.type
3603
- };
3604
- const __default__$3 = defineComponent({
3605
- name: "ElButtonGroup"
3606
- });
3607
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
3608
- ...__default__$3,
3609
- props: buttonGroupProps,
3610
- setup(__props) {
3611
- const props = __props;
3612
- provide(buttonGroupContextKey, reactive({
3613
- size: toRef(props, "size"),
3614
- type: toRef(props, "type")
3615
- }));
3616
- const ns = useNamespace("button");
3617
- return (_ctx, _cache) => {
3618
- return openBlock(), createElementBlock("div", {
3619
- class: normalizeClass(unref(ns).b("group"))
3620
- }, [
3621
- renderSlot(_ctx.$slots, "default")
3622
- ], 2);
3623
- };
3624
- }
3625
- });
3626
- var ButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__file", "button-group.vue"]]);
3627
- const ElButton = withInstall(Button, {
3628
- ButtonGroup
3629
- });
3630
- withNoopInstall(ButtonGroup);
3631
- const checkboxProps = {
3632
- modelValue: {
3633
- type: [Number, String, Boolean],
3634
- default: void 0
3635
- },
3636
- label: {
3637
- type: [String, Boolean, Number, Object],
3638
- default: void 0
3639
- },
3640
- value: {
3641
- type: [String, Boolean, Number, Object],
3642
- default: void 0
3643
- },
3644
- indeterminate: Boolean,
3645
- disabled: Boolean,
3646
- checked: Boolean,
3647
- name: {
3648
- type: String,
3649
- default: void 0
3650
- },
3651
- trueValue: {
3652
- type: [String, Number],
3653
- default: void 0
3654
- },
3655
- falseValue: {
3656
- type: [String, Number],
3657
- default: void 0
3658
- },
3659
- trueLabel: {
3660
- type: [String, Number],
3661
- default: void 0
3662
- },
3663
- falseLabel: {
3664
- type: [String, Number],
3665
- default: void 0
3666
- },
3667
- id: {
3668
- type: String,
3669
- default: void 0
3670
- },
3671
- border: Boolean,
3672
- size: useSizeProp,
3673
- tabindex: [String, Number],
3674
- validateEvent: {
3675
- type: Boolean,
3676
- default: true
3677
- },
3678
- ...useAriaProps(["ariaControls"])
3679
- };
3680
- const checkboxEmits = {
3681
- [UPDATE_MODEL_EVENT]: (val) => isString$1(val) || isNumber(val) || isBoolean(val),
3682
- change: (val) => isString$1(val) || isNumber(val) || isBoolean(val)
3683
- };
3684
- const checkboxGroupContextKey = Symbol("checkboxGroupContextKey");
3685
- const useCheckboxDisabled = ({
3686
- model,
3687
- isChecked
3688
- }) => {
3689
- const checkboxGroup = inject(checkboxGroupContextKey, void 0);
3690
- const isLimitDisabled = computed(() => {
3691
- var _a2, _b;
3692
- const max = (_a2 = checkboxGroup == null ? void 0 : checkboxGroup.max) == null ? void 0 : _a2.value;
3693
- const min = (_b = checkboxGroup == null ? void 0 : checkboxGroup.min) == null ? void 0 : _b.value;
3694
- return !isUndefined(max) && model.value.length >= max && !isChecked.value || !isUndefined(min) && model.value.length <= min && isChecked.value;
3695
- });
3696
- const isDisabled = useFormDisabled(computed(() => (checkboxGroup == null ? void 0 : checkboxGroup.disabled.value) || isLimitDisabled.value));
3697
- return {
3698
- isDisabled,
3699
- isLimitDisabled
3700
- };
3701
- };
3702
- const useCheckboxEvent = (props, {
3703
- model,
3704
- isLimitExceeded,
3705
- hasOwnLabel,
3706
- isDisabled,
3707
- isLabeledByFormItem
3708
- }) => {
3709
- const checkboxGroup = inject(checkboxGroupContextKey, void 0);
3710
- const { formItem } = useFormItem();
3711
- const { emit } = getCurrentInstance();
3712
- function getLabeledValue(value) {
3713
- var _a2, _b, _c, _d;
3714
- return [true, props.trueValue, props.trueLabel].includes(value) ? (_b = (_a2 = props.trueValue) != null ? _a2 : props.trueLabel) != null ? _b : true : (_d = (_c = props.falseValue) != null ? _c : props.falseLabel) != null ? _d : false;
3715
- }
3716
- function emitChangeEvent(checked, e) {
3717
- emit(CHANGE_EVENT, getLabeledValue(checked), e);
3718
- }
3719
- function handleChange(e) {
3720
- if (isLimitExceeded.value)
3721
- return;
3722
- const target = e.target;
3723
- emit(CHANGE_EVENT, getLabeledValue(target.checked), e);
3724
- }
3725
- async function onClickRoot(e) {
3726
- if (isLimitExceeded.value)
3727
- return;
3728
- if (!hasOwnLabel.value && !isDisabled.value && isLabeledByFormItem.value) {
3729
- const eventTargets = e.composedPath();
3730
- const hasLabel = eventTargets.some((item) => item.tagName === "LABEL");
3731
- if (!hasLabel) {
3732
- model.value = getLabeledValue([false, props.falseValue, props.falseLabel].includes(model.value));
3733
- await nextTick();
3734
- emitChangeEvent(model.value, e);
3735
- }
3736
- }
3737
- }
3738
- const validateEvent = computed(() => (checkboxGroup == null ? void 0 : checkboxGroup.validateEvent) || props.validateEvent);
3739
- watch(() => props.modelValue, () => {
3740
- if (validateEvent.value) {
3741
- formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn());
3742
- }
3743
- });
3744
- return {
3745
- handleChange,
3746
- onClickRoot
3747
- };
3748
- };
3749
- const useCheckboxModel = (props) => {
3750
- const selfModel = ref(false);
3751
- const { emit } = getCurrentInstance();
3752
- const checkboxGroup = inject(checkboxGroupContextKey, void 0);
3753
- const isGroup = computed(() => isUndefined(checkboxGroup) === false);
3754
- const isLimitExceeded = ref(false);
3755
- const model = computed({
3756
- get() {
3757
- var _a2, _b;
3758
- return isGroup.value ? (_a2 = checkboxGroup == null ? void 0 : checkboxGroup.modelValue) == null ? void 0 : _a2.value : (_b = props.modelValue) != null ? _b : selfModel.value;
3759
- },
3760
- set(val) {
3761
- var _a2, _b;
3762
- if (isGroup.value && isArray$1(val)) {
3763
- isLimitExceeded.value = ((_a2 = checkboxGroup == null ? void 0 : checkboxGroup.max) == null ? void 0 : _a2.value) !== void 0 && val.length > (checkboxGroup == null ? void 0 : checkboxGroup.max.value) && val.length > model.value.length;
3764
- isLimitExceeded.value === false && ((_b = checkboxGroup == null ? void 0 : checkboxGroup.changeEvent) == null ? void 0 : _b.call(checkboxGroup, val));
3765
- } else {
3766
- emit(UPDATE_MODEL_EVENT, val);
3767
- selfModel.value = val;
3768
- }
3769
- }
3770
- });
3771
- return {
3772
- model,
3773
- isGroup,
3774
- isLimitExceeded
3775
- };
3776
- };
3777
- const useCheckboxStatus = (props, slots, { model }) => {
3778
- const checkboxGroup = inject(checkboxGroupContextKey, void 0);
3779
- const isFocused = ref(false);
3780
- const actualValue = computed(() => {
3781
- if (!isPropAbsent(props.value)) {
3782
- return props.value;
3783
- }
3784
- return props.label;
3785
- });
3786
- const isChecked = computed(() => {
3787
- const value = model.value;
3788
- if (isBoolean(value)) {
3789
- return value;
3790
- } else if (isArray$1(value)) {
3791
- if (isObject$1(actualValue.value)) {
3792
- return value.map(toRaw).some((o) => isEqual(o, actualValue.value));
3793
- } else {
3794
- return value.map(toRaw).includes(actualValue.value);
3795
- }
3796
- } else if (value !== null && value !== void 0) {
3797
- return value === props.trueValue || value === props.trueLabel;
3798
- } else {
3799
- return !!value;
3800
- }
3801
- });
3802
- const checkboxButtonSize = useFormSize(computed(() => {
3803
- var _a2;
3804
- return (_a2 = checkboxGroup == null ? void 0 : checkboxGroup.size) == null ? void 0 : _a2.value;
3805
- }), {
3806
- prop: true
3807
- });
3808
- const checkboxSize = useFormSize(computed(() => {
3809
- var _a2;
3810
- return (_a2 = checkboxGroup == null ? void 0 : checkboxGroup.size) == null ? void 0 : _a2.value;
3811
- }));
3812
- const hasOwnLabel = computed(() => {
3813
- return !!slots.default || !isPropAbsent(actualValue.value);
3814
- });
3815
- return {
3816
- checkboxButtonSize,
3817
- isChecked,
3818
- isFocused,
3819
- checkboxSize,
3820
- hasOwnLabel,
3821
- actualValue
3822
- };
3823
- };
3824
- const useCheckbox = (props, slots) => {
3825
- const { formItem: elFormItem } = useFormItem();
3826
- const { model, isGroup, isLimitExceeded } = useCheckboxModel(props);
3827
- const {
3828
- isFocused,
3829
- isChecked,
3830
- checkboxButtonSize,
3831
- checkboxSize,
3832
- hasOwnLabel,
3833
- actualValue
3834
- } = useCheckboxStatus(props, slots, { model });
3835
- const { isDisabled } = useCheckboxDisabled({ model, isChecked });
3836
- const { inputId, isLabeledByFormItem } = useFormItemInputId(props, {
3837
- formItemContext: elFormItem,
3838
- disableIdGeneration: hasOwnLabel,
3839
- disableIdManagement: isGroup
3840
- });
3841
- const { handleChange, onClickRoot } = useCheckboxEvent(props, {
3842
- model,
3843
- isLimitExceeded,
3844
- hasOwnLabel,
3845
- isDisabled,
3846
- isLabeledByFormItem
3847
- });
3848
- const setStoreValue = () => {
3849
- function addToStore() {
3850
- var _a2, _b;
3851
- if (isArray$1(model.value) && !model.value.includes(actualValue.value)) {
3852
- model.value.push(actualValue.value);
3853
- } else {
3854
- model.value = (_b = (_a2 = props.trueValue) != null ? _a2 : props.trueLabel) != null ? _b : true;
3855
- }
3856
- }
3857
- props.checked && addToStore();
3858
- };
3859
- setStoreValue();
3860
- useDeprecated({
3861
- from: "label act as value",
3862
- replacement: "value",
3863
- version: "3.0.0",
3864
- scope: "el-checkbox",
3865
- ref: "https://element-plus.org/en-US/component/checkbox.html"
3866
- }, computed(() => isGroup.value && isPropAbsent(props.value)));
3867
- useDeprecated({
3868
- from: "true-label",
3869
- replacement: "true-value",
3870
- version: "3.0.0",
3871
- scope: "el-checkbox",
3872
- ref: "https://element-plus.org/en-US/component/checkbox.html"
3873
- }, computed(() => !!props.trueLabel));
3874
- useDeprecated({
3875
- from: "false-label",
3876
- replacement: "false-value",
3877
- version: "3.0.0",
3878
- scope: "el-checkbox",
3879
- ref: "https://element-plus.org/en-US/component/checkbox.html"
3880
- }, computed(() => !!props.falseLabel));
3881
- return {
3882
- inputId,
3883
- isLabeledByFormItem,
3884
- isChecked,
3885
- isDisabled,
3886
- isFocused,
3887
- checkboxButtonSize,
3888
- checkboxSize,
3889
- hasOwnLabel,
3890
- model,
3891
- actualValue,
3892
- handleChange,
3893
- onClickRoot
3894
- };
3895
- };
3896
- const __default__$2 = defineComponent({
3897
- name: "ElCheckbox"
3898
- });
3899
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
3900
- ...__default__$2,
3901
- props: checkboxProps,
3902
- emits: checkboxEmits,
3903
- setup(__props) {
3904
- const props = __props;
3905
- const slots = useSlots();
3906
- const {
3907
- inputId,
3908
- isLabeledByFormItem,
3909
- isChecked,
3910
- isDisabled,
3911
- isFocused,
3912
- checkboxSize,
3913
- hasOwnLabel,
3914
- model,
3915
- actualValue,
3916
- handleChange,
3917
- onClickRoot
3918
- } = useCheckbox(props, slots);
3919
- const ns = useNamespace("checkbox");
3920
- const compKls = computed(() => {
3921
- return [
3922
- ns.b(),
3923
- ns.m(checkboxSize.value),
3924
- ns.is("disabled", isDisabled.value),
3925
- ns.is("bordered", props.border),
3926
- ns.is("checked", isChecked.value)
3927
- ];
3928
- });
3929
- const spanKls = computed(() => {
3930
- return [
3931
- ns.e("input"),
3932
- ns.is("disabled", isDisabled.value),
3933
- ns.is("checked", isChecked.value),
3934
- ns.is("indeterminate", props.indeterminate),
3935
- ns.is("focus", isFocused.value)
3936
- ];
3937
- });
3938
- return (_ctx, _cache) => {
3939
- return openBlock(), createBlock(resolveDynamicComponent(!unref(hasOwnLabel) && unref(isLabeledByFormItem) ? "span" : "label"), {
3940
- class: normalizeClass(unref(compKls)),
3941
- "aria-controls": _ctx.indeterminate ? _ctx.ariaControls : null,
3942
- onClick: unref(onClickRoot)
3943
- }, {
3944
- default: withCtx(() => {
3945
- var _a2, _b, _c, _d;
3946
- return [
3947
- createElementVNode("span", {
3948
- class: normalizeClass(unref(spanKls))
3949
- }, [
3950
- _ctx.trueValue || _ctx.falseValue || _ctx.trueLabel || _ctx.falseLabel ? withDirectives((openBlock(), createElementBlock("input", {
3951
- key: 0,
3952
- id: unref(inputId),
3953
- "onUpdate:modelValue": ($event) => isRef(model) ? model.value = $event : null,
3954
- class: normalizeClass(unref(ns).e("original")),
3955
- type: "checkbox",
3956
- indeterminate: _ctx.indeterminate,
3957
- name: _ctx.name,
3958
- tabindex: _ctx.tabindex,
3959
- disabled: unref(isDisabled),
3960
- "true-value": (_b = (_a2 = _ctx.trueValue) != null ? _a2 : _ctx.trueLabel) != null ? _b : true,
3961
- "false-value": (_d = (_c = _ctx.falseValue) != null ? _c : _ctx.falseLabel) != null ? _d : false,
3962
- onChange: unref(handleChange),
3963
- onFocus: ($event) => isFocused.value = true,
3964
- onBlur: ($event) => isFocused.value = false,
3965
- onClick: withModifiers(() => {
3966
- }, ["stop"])
3967
- }, null, 42, ["id", "onUpdate:modelValue", "indeterminate", "name", "tabindex", "disabled", "true-value", "false-value", "onChange", "onFocus", "onBlur", "onClick"])), [
3968
- [vModelCheckbox, unref(model)]
3969
- ]) : withDirectives((openBlock(), createElementBlock("input", {
3970
- key: 1,
3971
- id: unref(inputId),
3972
- "onUpdate:modelValue": ($event) => isRef(model) ? model.value = $event : null,
3973
- class: normalizeClass(unref(ns).e("original")),
3974
- type: "checkbox",
3975
- indeterminate: _ctx.indeterminate,
3976
- disabled: unref(isDisabled),
3977
- value: unref(actualValue),
3978
- name: _ctx.name,
3979
- tabindex: _ctx.tabindex,
3980
- onChange: unref(handleChange),
3981
- onFocus: ($event) => isFocused.value = true,
3982
- onBlur: ($event) => isFocused.value = false,
3983
- onClick: withModifiers(() => {
3984
- }, ["stop"])
3985
- }, null, 42, ["id", "onUpdate:modelValue", "indeterminate", "disabled", "value", "name", "tabindex", "onChange", "onFocus", "onBlur", "onClick"])), [
3986
- [vModelCheckbox, unref(model)]
3987
- ]),
3988
- createElementVNode("span", {
3989
- class: normalizeClass(unref(ns).e("inner"))
3990
- }, null, 2)
3991
- ], 2),
3992
- unref(hasOwnLabel) ? (openBlock(), createElementBlock("span", {
3993
- key: 0,
3994
- class: normalizeClass(unref(ns).e("label"))
3995
- }, [
3996
- renderSlot(_ctx.$slots, "default"),
3997
- !_ctx.$slots.default ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
3998
- createTextVNode(toDisplayString(_ctx.label), 1)
3999
- ], 64)) : createCommentVNode("v-if", true)
4000
- ], 2)) : createCommentVNode("v-if", true)
4001
- ];
4002
- }),
4003
- _: 3
4004
- }, 8, ["class", "aria-controls", "onClick"]);
4005
- };
4006
- }
4007
- });
4008
- var Checkbox = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "checkbox.vue"]]);
4009
- const __default__$1 = defineComponent({
4010
- name: "ElCheckboxButton"
4011
- });
4012
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
4013
- ...__default__$1,
4014
- props: checkboxProps,
4015
- emits: checkboxEmits,
4016
- setup(__props) {
4017
- const props = __props;
4018
- const slots = useSlots();
4019
- const {
4020
- isFocused,
4021
- isChecked,
4022
- isDisabled,
4023
- checkboxButtonSize,
4024
- model,
4025
- actualValue,
4026
- handleChange
4027
- } = useCheckbox(props, slots);
4028
- const checkboxGroup = inject(checkboxGroupContextKey, void 0);
4029
- const ns = useNamespace("checkbox");
4030
- const activeStyle = computed(() => {
4031
- var _a2, _b, _c, _d;
4032
- const fillValue = (_b = (_a2 = checkboxGroup == null ? void 0 : checkboxGroup.fill) == null ? void 0 : _a2.value) != null ? _b : "";
4033
- return {
4034
- backgroundColor: fillValue,
4035
- borderColor: fillValue,
4036
- color: (_d = (_c = checkboxGroup == null ? void 0 : checkboxGroup.textColor) == null ? void 0 : _c.value) != null ? _d : "",
4037
- boxShadow: fillValue ? `-1px 0 0 0 ${fillValue}` : void 0
4038
- };
4039
- });
4040
- const labelKls = computed(() => {
4041
- return [
4042
- ns.b("button"),
4043
- ns.bm("button", checkboxButtonSize.value),
4044
- ns.is("disabled", isDisabled.value),
4045
- ns.is("checked", isChecked.value),
4046
- ns.is("focus", isFocused.value)
4047
- ];
4048
- });
4049
- return (_ctx, _cache) => {
4050
- var _a2, _b, _c, _d;
4051
- return openBlock(), createElementBlock("label", {
4052
- class: normalizeClass(unref(labelKls))
4053
- }, [
4054
- _ctx.trueValue || _ctx.falseValue || _ctx.trueLabel || _ctx.falseLabel ? withDirectives((openBlock(), createElementBlock("input", {
4055
- key: 0,
4056
- "onUpdate:modelValue": ($event) => isRef(model) ? model.value = $event : null,
4057
- class: normalizeClass(unref(ns).be("button", "original")),
4058
- type: "checkbox",
4059
- name: _ctx.name,
4060
- tabindex: _ctx.tabindex,
4061
- disabled: unref(isDisabled),
4062
- "true-value": (_b = (_a2 = _ctx.trueValue) != null ? _a2 : _ctx.trueLabel) != null ? _b : true,
4063
- "false-value": (_d = (_c = _ctx.falseValue) != null ? _c : _ctx.falseLabel) != null ? _d : false,
4064
- onChange: unref(handleChange),
4065
- onFocus: ($event) => isFocused.value = true,
4066
- onBlur: ($event) => isFocused.value = false,
4067
- onClick: withModifiers(() => {
4068
- }, ["stop"])
4069
- }, null, 42, ["onUpdate:modelValue", "name", "tabindex", "disabled", "true-value", "false-value", "onChange", "onFocus", "onBlur", "onClick"])), [
4070
- [vModelCheckbox, unref(model)]
4071
- ]) : withDirectives((openBlock(), createElementBlock("input", {
4072
- key: 1,
4073
- "onUpdate:modelValue": ($event) => isRef(model) ? model.value = $event : null,
4074
- class: normalizeClass(unref(ns).be("button", "original")),
4075
- type: "checkbox",
4076
- name: _ctx.name,
4077
- tabindex: _ctx.tabindex,
4078
- disabled: unref(isDisabled),
4079
- value: unref(actualValue),
4080
- onChange: unref(handleChange),
4081
- onFocus: ($event) => isFocused.value = true,
4082
- onBlur: ($event) => isFocused.value = false,
4083
- onClick: withModifiers(() => {
4084
- }, ["stop"])
4085
- }, null, 42, ["onUpdate:modelValue", "name", "tabindex", "disabled", "value", "onChange", "onFocus", "onBlur", "onClick"])), [
4086
- [vModelCheckbox, unref(model)]
4087
- ]),
4088
- _ctx.$slots.default || _ctx.label ? (openBlock(), createElementBlock("span", {
4089
- key: 2,
4090
- class: normalizeClass(unref(ns).be("button", "inner")),
4091
- style: normalizeStyle(unref(isChecked) ? unref(activeStyle) : void 0)
4092
- }, [
4093
- renderSlot(_ctx.$slots, "default", {}, () => [
4094
- createTextVNode(toDisplayString(_ctx.label), 1)
4095
- ])
4096
- ], 6)) : createCommentVNode("v-if", true)
4097
- ], 2);
4098
- };
4099
- }
4100
- });
4101
- var CheckboxButton = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "checkbox-button.vue"]]);
4102
- const checkboxGroupProps = buildProps({
4103
- modelValue: {
4104
- type: definePropType(Array),
4105
- default: () => []
4106
- },
4107
- disabled: Boolean,
4108
- min: Number,
4109
- max: Number,
4110
- size: useSizeProp,
4111
- fill: String,
4112
- textColor: String,
4113
- tag: {
4114
- type: String,
4115
- default: "div"
4116
- },
4117
- validateEvent: {
4118
- type: Boolean,
4119
- default: true
4120
- },
4121
- ...useAriaProps(["ariaLabel"])
4122
- });
4123
- const checkboxGroupEmits = {
4124
- [UPDATE_MODEL_EVENT]: (val) => isArray$1(val),
4125
- change: (val) => isArray$1(val)
4126
- };
4127
- const __default__ = defineComponent({
4128
- name: "ElCheckboxGroup"
4129
- });
4130
- const _sfc_main = /* @__PURE__ */ defineComponent({
4131
- ...__default__,
4132
- props: checkboxGroupProps,
4133
- emits: checkboxGroupEmits,
4134
- setup(__props, { emit }) {
4135
- const props = __props;
4136
- const ns = useNamespace("checkbox");
4137
- const { formItem } = useFormItem();
4138
- const { inputId: groupId, isLabeledByFormItem } = useFormItemInputId(props, {
4139
- formItemContext: formItem
4140
- });
4141
- const changeEvent = async (value) => {
4142
- emit(UPDATE_MODEL_EVENT, value);
4143
- await nextTick();
4144
- emit(CHANGE_EVENT, value);
4145
- };
4146
- const modelValue = computed({
4147
- get() {
4148
- return props.modelValue;
4149
- },
4150
- set(val) {
4151
- changeEvent(val);
4152
- }
4153
- });
4154
- provide(checkboxGroupContextKey, {
4155
- ...pick(toRefs(props), [
4156
- "size",
4157
- "min",
4158
- "max",
4159
- "disabled",
4160
- "validateEvent",
4161
- "fill",
4162
- "textColor"
4163
- ]),
4164
- modelValue,
4165
- changeEvent
4166
- });
4167
- watch(() => props.modelValue, (newVal, oldValue) => {
4168
- if (props.validateEvent && !isEqual(newVal, oldValue)) {
4169
- formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn());
4170
- }
4171
- });
4172
- return (_ctx, _cache) => {
4173
- var _a2;
4174
- return openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), {
4175
- id: unref(groupId),
4176
- class: normalizeClass(unref(ns).b("group")),
4177
- role: "group",
4178
- "aria-label": !unref(isLabeledByFormItem) ? _ctx.ariaLabel || "checkbox-group" : void 0,
4179
- "aria-labelledby": unref(isLabeledByFormItem) ? (_a2 = unref(formItem)) == null ? void 0 : _a2.labelId : void 0
4180
- }, {
4181
- default: withCtx(() => [
4182
- renderSlot(_ctx.$slots, "default")
4183
- ]),
4184
- _: 3
4185
- }, 8, ["id", "class", "aria-label", "aria-labelledby"]);
4186
- };
4187
- }
4188
- });
4189
- var CheckboxGroup = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "checkbox-group.vue"]]);
4190
- const ElCheckbox = withInstall(Checkbox, {
4191
- CheckboxButton,
4192
- CheckboxGroup
4193
- });
4194
- withNoopInstall(CheckboxButton);
4195
- withNoopInstall(CheckboxGroup);
4196
- export {
4197
- useId as $,
4198
- hide_default as A,
4199
- isNil as B,
4200
- debugWarn as C,
4201
- DomEventRegister as D,
4202
- ElButton as E,
4203
- ElIcon as F,
4204
- circle_close_default as G,
4205
- isObject$1 as H,
4206
- CHANGE_EVENT as I,
4207
- INPUT_EVENT as J,
4208
- withInstall as K,
4209
- throwError as L,
4210
- addUnit as M,
4211
- NOOP as N,
4212
- isElement as O,
4213
- useZIndex as P,
4214
- formItemContextKey as Q,
4215
- Renderer as R,
4216
- buildProp as S,
4217
- isBoolean as T,
4218
- UPDATE_MODEL_EVENT as U,
4219
- ValidateComponentsMap as V,
4220
- isArray$1 as W,
4221
- useGetDerivedNamespace as X,
4222
- useIdInjection as Y,
4223
- computedEager as Z,
4224
- _export_sfc as _,
4225
- DomContainer as a,
4226
- useEmptyValuesProps as a0,
4227
- provideGlobalConfig as a1,
4228
- arrow_down_default as a2,
4229
- useLocale as a3,
4230
- withNoopInstall as a4,
4231
- useGlobalComponentSettings as a5,
4232
- TypeComponentsMap as a6,
4233
- TypeComponents as a7,
4234
- useTimeoutFn as a8,
4235
- withInstallFunction as a9,
4236
- ElCheckbox as b,
4237
- isString as c,
4238
- isClient as d,
4239
- tryOnMounted as e,
4240
- isIOS as f,
4241
- identity as g,
4242
- buildProps as h,
4243
- isArray as i,
4244
- isNumber as j,
4245
- isString$1 as k,
4246
- definePropType as l,
4247
- iconPropType as m,
4248
- noop as n,
4249
- useSizeProp as o,
4250
- fromPairs as p,
4251
- isFunction$1 as q,
4252
- resolveUnref as r,
4253
- useNamespace as s,
4254
- tryOnScopeDispose as t,
4255
- useAriaProps as u,
4256
- useFormSize as v,
4257
- useFormDisabled as w,
4258
- useFormItem as x,
4259
- useFormItemInputId as y,
4260
- view_default as z
4261
- };