@cling-se/widget 0.14.4 → 0.14.5

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 (134) hide show
  1. package/.eslintrc.cjs +4 -4
  2. package/README.md +40 -40
  3. package/dist/AddClientCallout-BMc-v9rJ.js +46 -0
  4. package/dist/AnswerModal-Cu0Ke5pl.js +3874 -0
  5. package/dist/AttachmentItem-Co8pVvtv.js +78 -0
  6. package/dist/BaseDatePicker-P5iq-XAp.js +3183 -0
  7. package/dist/BaseUpload-BDWnWTxr.js +1977 -0
  8. package/dist/BlockMedia-B_UiePCr.js +76 -0
  9. package/dist/CCallout-Bbp9ya9n.js +59 -0
  10. package/dist/CCurrencyDropdown-Cw39vJWw.js +246 -0
  11. package/dist/CDropdownItem-BjYnhZJr.js +538 -0
  12. package/dist/CField.vue_vue_type_style_index_0_lang-l0sNRNKZ.js +1 -0
  13. package/dist/CFormField-CeJ58aN2.js +241 -0
  14. package/dist/CPhoneFormat-BZnmeEeW.js +62 -0
  15. package/dist/CPriceInput-B07d19qq.js +112 -0
  16. package/dist/CTabs.vue_vue_type_style_index_0_scoped_e02a6440_lang-l0sNRNKZ.js +1 -0
  17. package/dist/ClientAutocomplete-9iM1pR9l.js +78 -0
  18. package/dist/ClientModal-fw8f6UvL.js +625 -0
  19. package/dist/ColorPicker-uu6vKe8o.js +2879 -0
  20. package/dist/CompanyModal-5t4yhKL4.js +141 -0
  21. package/dist/ContentWrapper-DwcOQ21l.js +183 -0
  22. package/dist/CoverBlockSettings-cCCXzAZ0.js +275 -0
  23. package/dist/DocAnswer-9lbgqHRX.js +36 -0
  24. package/dist/DocDetails-CoLL_tHs.js +246 -0
  25. package/dist/DocForm-DUjcuHJe.js +7273 -0
  26. package/dist/DocFormSend-LawcXcM2.js +143 -0
  27. package/dist/DocLinks-pJT9HpjR.js +38 -0
  28. package/dist/DocModalBase-xUoskL63.js +28 -0
  29. package/dist/DocPrint-ClEJBiAg.js +240 -0
  30. package/dist/DocReceipt-x_YsXPnG.js +210 -0
  31. package/dist/DocSendReminder-Dbz8CkAz.js +137 -0
  32. package/dist/DocTextEditor-AqBE7jZj.js +17181 -0
  33. package/dist/DocTimeline-hq2asPzr.js +481 -0
  34. package/dist/DocumentClient-TmtHqfiw.js +136 -0
  35. package/dist/DocumentLayout-CRAp8mfk.js +4909 -0
  36. package/dist/DocumentLogotype-emSjQ21f.js +87 -0
  37. package/dist/DocumentVoided-BOjiWBK6.js +25 -0
  38. package/dist/EmbedInput-B3LFGEee.js +113 -0
  39. package/dist/EmbedSettings-BYPJTGQf.js +72 -0
  40. package/dist/ErrorCallout-CwgYHBkg.js +28 -0
  41. package/dist/FilePreviewModal-81sSrDGg.js +81 -0
  42. package/dist/Flag-DGFvUTQZ.js +114 -0
  43. package/dist/HeaderSettings-BGpkzcbj.js +392 -0
  44. package/dist/ImageSelectModal-Cimviyuy.js +84 -0
  45. package/dist/ImageUploadWrapper-qJDHCf8T.js +1604 -0
  46. package/dist/Index-18w_qMQH.js +25 -0
  47. package/dist/Index-9_R8_myc.js +77 -0
  48. package/dist/Index-BKoXW7GK.js +84 -0
  49. package/dist/Index-BL3-tRGt.js +642 -0
  50. package/dist/Index-BNfAA-ZJ.js +154 -0
  51. package/dist/Index-BOxSvAug.js +144 -0
  52. package/dist/Index-BQgW1jlH.js +45 -0
  53. package/dist/Index-BXAqgXVi.js +150 -0
  54. package/dist/Index-BgK_WC0d.js +140 -0
  55. package/dist/Index-BkUzlQaQ.js +107 -0
  56. package/dist/Index-BpyYa9LR.js +171 -0
  57. package/dist/Index-ByzGXUoc.js +292 -0
  58. package/dist/Index-C1lsSfnX.js +52 -0
  59. package/dist/Index-C9sq_RDg.js +223 -0
  60. package/dist/Index-CDEh3GAi.js +26 -0
  61. package/dist/Index-CEG-Hiv6.js +69 -0
  62. package/dist/Index-CMUg61_b.js +33 -0
  63. package/dist/Index-CObGPoQv.js +62 -0
  64. package/dist/Index-CPNUsaOS.js +57 -0
  65. package/dist/Index-CegW1Rim.js +98 -0
  66. package/dist/Index-CoSt-Bws.js +31 -0
  67. package/dist/Index-CpDgldnz.js +70 -0
  68. package/dist/Index-CqImx-rG.js +55 -0
  69. package/dist/Index-CrOD4_xj.js +58 -0
  70. package/dist/Index-DBCNVVm5.js +24 -0
  71. package/dist/Index-DGG1S8uJ.js +559 -0
  72. package/dist/Index-DRWS2z82.js +2402 -0
  73. package/dist/Index-DXRgZZNj.js +61 -0
  74. package/dist/Index-DY5gAUnE.js +754 -0
  75. package/dist/Index-Dr7mVlBb.js +49 -0
  76. package/dist/Index-Dx944wv-.js +21 -0
  77. package/dist/Index-Eq3JlTKK.js +46 -0
  78. package/dist/Index-Sr3emNkE.js +25 -0
  79. package/dist/Index-VshOfaom.js +32 -0
  80. package/dist/InputToggleRow-CQsaayf-.js +57 -0
  81. package/dist/ManualPopover-CFXm5cQy.js +58 -0
  82. package/dist/MediaWrapper-Cn0Yr4ce.js +23 -0
  83. package/dist/NotBindingText-CNiszGqn.js +32 -0
  84. package/dist/PackageGroup-BVys9ouj.js +699 -0
  85. package/dist/PdfTerms-Bbns-jMY.js +36 -0
  86. package/dist/PdfViewer-B1zzZU4Y.js +374 -0
  87. package/dist/PlainHtml-CARRbTxi.js +20 -0
  88. package/dist/PriceHeader-CqeC9Lhb.js +339 -0
  89. package/dist/SearchApi-bB9FLxUq.js +161 -0
  90. package/dist/Setup-p3Du_uf8.js +50 -0
  91. package/dist/SmartList-P5ZfTWBb.js +83 -0
  92. package/dist/TermsSettings-CQ8TGwBV.js +102 -0
  93. package/dist/ThemeColorRow-DMWVlFRU.js +67 -0
  94. package/dist/ToggleBinding-BPaYWgqP.js +38 -0
  95. package/dist/UploadModal-9O4HTVZm.js +95 -0
  96. package/dist/VideoPlayerInput-5KybfY7N.js +93 -0
  97. package/dist/VideoPlayerSettings-xSW8tcTZ.js +61 -0
  98. package/dist/VideoSelectModal-BbaNAxGH.js +100 -0
  99. package/dist/anime.es-BrPTThYb.js +858 -0
  100. package/dist/answerDocumentMixin-S-Bmv15G.js +51 -0
  101. package/dist/color-TdtKxwVa.js +19 -0
  102. package/dist/debounce-B_0g8OVh.js +84 -0
  103. package/dist/dom-CJxkno7i.js +91 -0
  104. package/dist/favicon.ico +0 -0
  105. package/dist/focusDrawerMixin-DhsqWZUo.js +22 -0
  106. package/dist/formComponentsInstall-UG7a9vjZ.js +2499 -0
  107. package/dist/formDrawerState-BMQrWaBt.js +20 -0
  108. package/dist/formValidationMixin-DUu0omWT.js +49 -0
  109. package/dist/i18nMessages-Chz_lxGG.js +17 -0
  110. package/dist/index-B3R_uKML.js +347 -0
  111. package/dist/index-B4aiQXsr.js +166 -0
  112. package/dist/index-C50JSDKO.js +3916 -0
  113. package/dist/index-CJ9AvuZH.js +102 -0
  114. package/dist/index-Czyda2Ej.js +492 -0
  115. package/dist/index-myOYAnwV.js +81 -0
  116. package/dist/index.es.js +35 -0
  117. package/dist/index.umd.js +3148 -0
  118. package/dist/main-B9t0ybqW.js +56739 -0
  119. package/dist/mapFormMixin-ETYhBLl2.js +72 -0
  120. package/dist/omit-DtTfKAed.js +31 -0
  121. package/dist/publicSenderState-DD1lN9CR.js +21 -0
  122. package/dist/splitpanes-BHUVsCZF.js +382 -0
  123. package/dist/style.css +4 -0
  124. package/dist/throttle-qziKkJJX.js +18 -0
  125. package/dist/tinycolor-CMC8Xp7x.js +633 -0
  126. package/dist/tippy.esm-DjbYjfS2.js +1799 -0
  127. package/dist/utils-C5Rg0fQC.js +108 -0
  128. package/dist/vuedraggable.umd-CE3WmaEQ.js +3161 -0
  129. package/dist/vuex.esm-DKGl8mcw.js +467 -0
  130. package/package.json +1 -1
  131. package/tsconfig.json +26 -26
  132. package/tsconfig.node.json +10 -10
  133. package/tsconfig.paths.json +17 -17
  134. package/vite.config.ts +61 -61
@@ -0,0 +1,72 @@
1
+ import { b as r } from "./main-B9t0ybqW.js";
2
+ const f = (a = [], { event: o = "input", type: c = void 0, useEmit: d = !0, setFnName: l } = {}) => ({
3
+ inheritAttrs: !1,
4
+ props: {
5
+ _document: {
6
+ type: Object,
7
+ default: () => ({})
8
+ },
9
+ _value: {
10
+ type: Object,
11
+ default: () => ({})
12
+ }
13
+ },
14
+ inject: {
15
+ viewSettings: {
16
+ default: () => ({
17
+ canEdit: !1,
18
+ isForm: !1,
19
+ setFormValue: null,
20
+ removeFormValue: null,
21
+ isPublicForm: !1
22
+ })
23
+ },
24
+ containerType: {
25
+ default: () => ({})
26
+ }
27
+ },
28
+ computed: {
29
+ canEdit() {
30
+ return r(this, "viewSettings.canEdit");
31
+ },
32
+ device() {
33
+ return r(this, "containerType.device", "");
34
+ },
35
+ isForm() {
36
+ return r(this, "viewSettings.isForm");
37
+ },
38
+ ...a.reduce((i, e) => {
39
+ const t = e, s = {
40
+ get() {
41
+ return this._value ? r(this._document, (this._value || {})[e]) : r(this.$attrs, e);
42
+ },
43
+ set(u) {
44
+ this.setField({ field: e, value: u, type: c });
45
+ }
46
+ };
47
+ return i[t] = s, i;
48
+ }, {})
49
+ },
50
+ methods: {
51
+ // Setter method exposed to host component, in case extra setter options are needed
52
+ // Providing either 'key' or 'field' optional, but one required
53
+ // key > field
54
+ // 'field' refers to name of computed field registered for the mixin
55
+ setField({ key: i, field: e, value: t, options: s, type: u }) {
56
+ const n = i || (this._value || {})[e];
57
+ if (!n)
58
+ return;
59
+ const m = l ? this[l] : this.viewSettings.setFormValue;
60
+ !d && typeof m == "function" ? m({ key: n, value: t, options: s }) : o ? (u === "number" && Number.isNaN(parseFloat(t)) && (t = null), this.$emit(o, { key: n, value: t, options: s })) : this.$emit({ key: n, value: t, options: s });
61
+ },
62
+ // Forward of document remove method
63
+ // Note: does not yet support emit option like the setter
64
+ removeField(i) {
65
+ var e, t;
66
+ (t = (e = this.viewSettings) == null ? void 0 : e.removeFormValue) == null || t.call(e, i);
67
+ }
68
+ }
69
+ });
70
+ export {
71
+ f as m
72
+ };
@@ -0,0 +1,31 @@
1
+ import { W as l, _ as o, X as i, Y as _, k as u, Z as f, $ as v, a0 as c, a1 as m, a2 as O, a3 as g } from "./main-B9t0ybqW.js";
2
+ var C = l;
3
+ function L(t) {
4
+ return C(t) ? void 0 : t;
5
+ }
6
+ var b = L, F = o;
7
+ function A(t) {
8
+ var e = t == null ? 0 : t.length;
9
+ return e ? F(t, 1) : [];
10
+ }
11
+ var E = A, P = E, R = i, $ = _;
12
+ function d(t) {
13
+ return $(R(t, void 0, P), t + "");
14
+ }
15
+ var y = d, S = f, D = O, G = v, M = g, N = c, T = b, h = y, j = m, p = 1, x = 2, I = 4, K = h(function(t, e) {
16
+ var a = {};
17
+ if (t == null)
18
+ return a;
19
+ var s = !1;
20
+ e = S(e, function(n) {
21
+ return n = M(n, t), s || (s = n.length > 1), n;
22
+ }), N(t, j(t), a), s && (a = D(a, p | x | I, T));
23
+ for (var r = e.length; r--; )
24
+ G(a, e[r]);
25
+ return a;
26
+ }), U = K;
27
+ const k = /* @__PURE__ */ u(U);
28
+ export {
29
+ y as _,
30
+ k as o
31
+ };
@@ -0,0 +1,21 @@
1
+ import { I as a, V as c } from "./main-B9t0ybqW.js";
2
+ const e = JSON.parse(a.getItem("publicSender")), s = c.observable({
3
+ company: {
4
+ name: "",
5
+ LogotypePublicId: null,
6
+ ...e ? e.company : {}
7
+ },
8
+ user: {
9
+ email: "",
10
+ firstname: "",
11
+ lastname: "",
12
+ cellphone: "",
13
+ ...e ? e.user : {}
14
+ }
15
+ }), r = ({ company: n, user: t }) => {
16
+ Object.assign(s.company, n), Object.assign(s.user, t), a.setItem("publicSender", JSON.stringify(s));
17
+ };
18
+ export {
19
+ r as a,
20
+ s
21
+ };
@@ -0,0 +1,382 @@
1
+ var _ = Object.defineProperty, M = Object.defineProperties, g = Object.getOwnPropertyDescriptors, u = Object.getOwnPropertySymbols, v = Object.prototype.hasOwnProperty, P = Object.prototype.propertyIsEnumerable, m = (e, t, i) => t in e ? _(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i, y = (e, t) => {
2
+ for (var i in t || (t = {}))
3
+ v.call(t, i) && m(e, i, t[i]);
4
+ if (u)
5
+ for (var i of u(t))
6
+ P.call(t, i) && m(e, i, t[i]);
7
+ return e;
8
+ }, C = (e, t) => M(e, g(t)), w = (e, t) => {
9
+ var i = {};
10
+ for (var s in e)
11
+ v.call(e, s) && t.indexOf(s) < 0 && (i[s] = e[s]);
12
+ if (e != null && u)
13
+ for (var s of u(e))
14
+ t.indexOf(s) < 0 && P.call(e, s) && (i[s] = e[s]);
15
+ return i;
16
+ };
17
+ function S(e, t, i, s, n, a, r, h) {
18
+ var o = typeof e == "function" ? e.options : e;
19
+ t && (o.render = t, o.staticRenderFns = i, o._compiled = !0);
20
+ var l;
21
+ if (n && (l = n), l)
22
+ if (o.functional) {
23
+ o._injectStyles = l;
24
+ var c = o.render;
25
+ o.render = function(x, p) {
26
+ return l.call(p), c(x, p);
27
+ };
28
+ } else {
29
+ var d = o.beforeCreate;
30
+ o.beforeCreate = d ? [].concat(d, l) : [l];
31
+ }
32
+ return {
33
+ exports: e,
34
+ options: o
35
+ };
36
+ }
37
+ const b = {
38
+ name: "splitpanes",
39
+ props: {
40
+ horizontal: { type: Boolean },
41
+ pushOtherPanes: { type: Boolean, default: !0 },
42
+ dblClickSplitter: { type: Boolean, default: !0 },
43
+ rtl: { type: Boolean, default: !1 },
44
+ firstSplitter: { type: Boolean }
45
+ },
46
+ provide() {
47
+ return {
48
+ requestUpdate: this.requestUpdate,
49
+ onPaneAdd: this.onPaneAdd,
50
+ onPaneRemove: this.onPaneRemove,
51
+ onPaneClick: this.onPaneClick
52
+ };
53
+ },
54
+ data: () => ({
55
+ container: null,
56
+ ready: !1,
57
+ panes: [],
58
+ touch: {
59
+ mouseDown: !1,
60
+ dragging: !1,
61
+ activeSplitter: null
62
+ },
63
+ splitterTaps: {
64
+ splitter: null,
65
+ timeoutId: null
66
+ }
67
+ }),
68
+ computed: {
69
+ panesCount() {
70
+ return this.panes.length;
71
+ },
72
+ indexedPanes() {
73
+ return this.panes.reduce((e, t) => (e[t.id] = t) && e, {});
74
+ }
75
+ },
76
+ methods: {
77
+ updatePaneComponents() {
78
+ this.panes.forEach((e) => {
79
+ e.update && e.update({
80
+ [this.horizontal ? "height" : "width"]: `${this.indexedPanes[e.id].size}%`
81
+ });
82
+ });
83
+ },
84
+ bindEvents() {
85
+ document.addEventListener("mousemove", this.onMouseMove, { passive: !1 }), document.addEventListener("mouseup", this.onMouseUp), "ontouchstart" in window && (document.addEventListener("touchmove", this.onMouseMove, { passive: !1 }), document.addEventListener("touchend", this.onMouseUp));
86
+ },
87
+ unbindEvents() {
88
+ document.removeEventListener("mousemove", this.onMouseMove, { passive: !1 }), document.removeEventListener("mouseup", this.onMouseUp), "ontouchstart" in window && (document.removeEventListener("touchmove", this.onMouseMove, { passive: !1 }), document.removeEventListener("touchend", this.onMouseUp));
89
+ },
90
+ onMouseDown(e, t) {
91
+ this.bindEvents(), this.touch.mouseDown = !0, this.touch.activeSplitter = t;
92
+ },
93
+ onMouseMove(e) {
94
+ this.touch.mouseDown && (e.preventDefault(), this.touch.dragging = !0, this.calculatePanesSize(this.getCurrentMouseDrag(e)), this.$emit("resize", this.panes.map((t) => ({ min: t.min, max: t.max, size: t.size }))));
95
+ },
96
+ onMouseUp() {
97
+ this.touch.dragging && this.$emit("resized", this.panes.map((e) => ({ min: e.min, max: e.max, size: e.size }))), this.touch.mouseDown = !1, setTimeout(() => {
98
+ this.touch.dragging = !1, this.unbindEvents();
99
+ }, 100);
100
+ },
101
+ onSplitterClick(e, t) {
102
+ "ontouchstart" in window && (e.preventDefault(), this.dblClickSplitter && (this.splitterTaps.splitter === t ? (clearTimeout(this.splitterTaps.timeoutId), this.splitterTaps.timeoutId = null, this.onSplitterDblClick(e, t), this.splitterTaps.splitter = null) : (this.splitterTaps.splitter = t, this.splitterTaps.timeoutId = setTimeout(() => {
103
+ this.splitterTaps.splitter = null;
104
+ }, 500)))), this.touch.dragging || this.$emit("splitter-click", this.panes[t]);
105
+ },
106
+ onSplitterDblClick(e, t) {
107
+ let i = 0;
108
+ this.panes = this.panes.map((s, n) => (s.size = n === t ? s.max : s.min, n !== t && (i += s.min), s)), this.panes[t].size -= i, this.$emit("pane-maximize", this.panes[t]);
109
+ },
110
+ onPaneClick(e, t) {
111
+ this.$emit("pane-click", this.indexedPanes[t]);
112
+ },
113
+ getCurrentMouseDrag(e) {
114
+ const t = this.container.getBoundingClientRect(), { clientX: i, clientY: s } = "ontouchstart" in window && e.touches ? e.touches[0] : e;
115
+ return {
116
+ x: i - t.left,
117
+ y: s - t.top
118
+ };
119
+ },
120
+ getCurrentDragPercentage(e) {
121
+ e = e[this.horizontal ? "y" : "x"];
122
+ const t = this.container[this.horizontal ? "clientHeight" : "clientWidth"];
123
+ return this.rtl && !this.horizontal && (e = t - e), e * 100 / t;
124
+ },
125
+ calculatePanesSize(e) {
126
+ const t = this.touch.activeSplitter;
127
+ let i = {
128
+ prevPanesSize: this.sumPrevPanesSize(t),
129
+ nextPanesSize: this.sumNextPanesSize(t),
130
+ prevReachedMinPanes: 0,
131
+ nextReachedMinPanes: 0
132
+ };
133
+ const s = 0 + (this.pushOtherPanes ? 0 : i.prevPanesSize), n = 100 - (this.pushOtherPanes ? 0 : i.nextPanesSize), a = Math.max(Math.min(this.getCurrentDragPercentage(e), n), s);
134
+ let r = [t, t + 1], h = this.panes[r[0]] || null, o = this.panes[r[1]] || null;
135
+ const l = h.max < 100 && a >= h.max + i.prevPanesSize, c = o.max < 100 && a <= 100 - (o.max + this.sumNextPanesSize(t + 1));
136
+ if (l || c) {
137
+ l ? (h.size = h.max, o.size = Math.max(100 - h.max - i.prevPanesSize - i.nextPanesSize, 0)) : (h.size = Math.max(100 - o.max - i.prevPanesSize - this.sumNextPanesSize(t + 1), 0), o.size = o.max);
138
+ return;
139
+ }
140
+ if (this.pushOtherPanes) {
141
+ const d = this.doPushOtherPanes(i, a);
142
+ if (!d)
143
+ return;
144
+ ({ sums: i, panesToResize: r } = d), h = this.panes[r[0]] || null, o = this.panes[r[1]] || null;
145
+ }
146
+ h !== null && (h.size = Math.min(Math.max(a - i.prevPanesSize - i.prevReachedMinPanes, h.min), h.max)), o !== null && (o.size = Math.min(Math.max(100 - a - i.nextPanesSize - i.nextReachedMinPanes, o.min), o.max));
147
+ },
148
+ doPushOtherPanes(e, t) {
149
+ const i = this.touch.activeSplitter, s = [i, i + 1];
150
+ return t < e.prevPanesSize + this.panes[s[0]].min && (s[0] = this.findPrevExpandedPane(i).index, e.prevReachedMinPanes = 0, s[0] < i && this.panes.forEach((n, a) => {
151
+ a > s[0] && a <= i && (n.size = n.min, e.prevReachedMinPanes += n.min);
152
+ }), e.prevPanesSize = this.sumPrevPanesSize(s[0]), s[0] === void 0) ? (e.prevReachedMinPanes = 0, this.panes[0].size = this.panes[0].min, this.panes.forEach((n, a) => {
153
+ a > 0 && a <= i && (n.size = n.min, e.prevReachedMinPanes += n.min);
154
+ }), this.panes[s[1]].size = 100 - e.prevReachedMinPanes - this.panes[0].min - e.prevPanesSize - e.nextPanesSize, null) : t > 100 - e.nextPanesSize - this.panes[s[1]].min && (s[1] = this.findNextExpandedPane(i).index, e.nextReachedMinPanes = 0, s[1] > i + 1 && this.panes.forEach((n, a) => {
155
+ a > i && a < s[1] && (n.size = n.min, e.nextReachedMinPanes += n.min);
156
+ }), e.nextPanesSize = this.sumNextPanesSize(s[1] - 1), s[1] === void 0) ? (e.nextReachedMinPanes = 0, this.panes[this.panesCount - 1].size = this.panes[this.panesCount - 1].min, this.panes.forEach((n, a) => {
157
+ a < this.panesCount - 1 && a >= i + 1 && (n.size = n.min, e.nextReachedMinPanes += n.min);
158
+ }), this.panes[s[0]].size = 100 - e.prevPanesSize - e.nextReachedMinPanes - this.panes[this.panesCount - 1].min - e.nextPanesSize, null) : { sums: e, panesToResize: s };
159
+ },
160
+ sumPrevPanesSize(e) {
161
+ return this.panes.reduce((t, i, s) => t + (s < e ? i.size : 0), 0);
162
+ },
163
+ sumNextPanesSize(e) {
164
+ return this.panes.reduce((t, i, s) => t + (s > e + 1 ? i.size : 0), 0);
165
+ },
166
+ findPrevExpandedPane(e) {
167
+ return [...this.panes].reverse().find((i) => i.index < e && i.size > i.min) || {};
168
+ },
169
+ findNextExpandedPane(e) {
170
+ return this.panes.find((i) => i.index > e + 1 && i.size > i.min) || {};
171
+ },
172
+ checkSplitpanesNodes() {
173
+ Array.from(this.container.children).forEach((t) => {
174
+ const i = t.classList.contains("splitpanes__pane"), s = t.classList.contains("splitpanes__splitter");
175
+ if (!i && !s) {
176
+ t.parentNode.removeChild(t), console.warn("Splitpanes: Only <pane> elements are allowed at the root of <splitpanes>. One of your DOM nodes was removed.");
177
+ return;
178
+ }
179
+ });
180
+ },
181
+ addSplitter(e, t, i = !1) {
182
+ const s = e - 1, n = document.createElement("div");
183
+ n.classList.add("splitpanes__splitter"), i || (n.onmousedown = (a) => this.onMouseDown(a, s), typeof window < "u" && "ontouchstart" in window && (n.ontouchstart = (a) => this.onMouseDown(a, s)), n.onclick = (a) => this.onSplitterClick(a, s + 1)), this.dblClickSplitter && (n.ondblclick = (a) => this.onSplitterDblClick(a, s + 1)), t.parentNode.insertBefore(n, t);
184
+ },
185
+ removeSplitter(e) {
186
+ e.onmousedown = void 0, e.onclick = void 0, e.ondblclick = void 0, e.parentNode.removeChild(e);
187
+ },
188
+ redoSplitters() {
189
+ const e = Array.from(this.container.children);
190
+ e.forEach((i) => {
191
+ i.className.includes("splitpanes__splitter") && this.removeSplitter(i);
192
+ });
193
+ let t = 0;
194
+ e.forEach((i) => {
195
+ i.className.includes("splitpanes__pane") && (!t && this.firstSplitter ? this.addSplitter(t, i, !0) : t && this.addSplitter(t, i), t++);
196
+ });
197
+ },
198
+ requestUpdate(e) {
199
+ var t = e, { target: i } = t, s = w(t, ["target"]);
200
+ const n = this.indexedPanes[i._uid];
201
+ Object.entries(s).forEach(([a, r]) => n[a] = r);
202
+ },
203
+ onPaneAdd(e) {
204
+ let t = -1;
205
+ Array.from(e.$el.parentNode.children).some((n) => (n.className.includes("splitpanes__pane") && t++, n === e.$el));
206
+ const i = parseFloat(e.minSize), s = parseFloat(e.maxSize);
207
+ this.panes.splice(t, 0, {
208
+ id: e._uid,
209
+ index: t,
210
+ min: isNaN(i) ? 0 : i,
211
+ max: isNaN(s) ? 100 : s,
212
+ size: e.size === null ? null : parseFloat(e.size),
213
+ givenSize: e.size,
214
+ update: e.update
215
+ }), this.panes.forEach((n, a) => n.index = a), this.ready && this.$nextTick(() => {
216
+ this.redoSplitters(), this.resetPaneSizes({ addedPane: this.panes[t] }), this.$emit("pane-add", { index: t, panes: this.panes.map((n) => ({ min: n.min, max: n.max, size: n.size })) });
217
+ });
218
+ },
219
+ onPaneRemove(e) {
220
+ const t = this.panes.findIndex((s) => s.id === e._uid), i = this.panes.splice(t, 1)[0];
221
+ this.panes.forEach((s, n) => s.index = n), this.$nextTick(() => {
222
+ this.redoSplitters(), this.resetPaneSizes({ removedPane: C(y({}, i), { index: t }) }), this.$emit("pane-remove", { removed: i, panes: this.panes.map((s) => ({ min: s.min, max: s.max, size: s.size })) });
223
+ });
224
+ },
225
+ resetPaneSizes(e = {}) {
226
+ !e.addedPane && !e.removedPane ? this.initialPanesSizing() : this.panes.some((t) => t.givenSize !== null || t.min || t.max < 100) ? this.equalizeAfterAddOrRemove(e) : this.equalize(), this.ready && this.$emit("resized", this.panes.map((t) => ({ min: t.min, max: t.max, size: t.size })));
227
+ },
228
+ equalize() {
229
+ const e = 100 / this.panesCount;
230
+ let t = 0, i = [], s = [];
231
+ this.panes.forEach((n) => {
232
+ n.size = Math.max(Math.min(e, n.max), n.min), t -= n.size, n.size >= n.max && i.push(n.id), n.size <= n.min && s.push(n.id);
233
+ }), t > 0.1 && this.readjustSizes(t, i, s);
234
+ },
235
+ initialPanesSizing() {
236
+ 100 / this.panesCount;
237
+ let e = 100, t = [], i = [], s = 0;
238
+ this.panes.forEach((a) => {
239
+ e -= a.size, a.size !== null && s++, a.size >= a.max && t.push(a.id), a.size <= a.min && i.push(a.id);
240
+ });
241
+ let n = 100;
242
+ e > 0.1 && (this.panes.forEach((a) => {
243
+ a.size === null && (a.size = Math.max(Math.min(e / (this.panesCount - s), a.max), a.min)), n -= a.size;
244
+ }), n > 0.1 && this.readjustSizes(e, t, i));
245
+ },
246
+ equalizeAfterAddOrRemove({ addedPane: e, removedPane: t } = {}) {
247
+ let i = 100 / this.panesCount, s = 0, n = [], a = [];
248
+ e && e.givenSize !== null && (i = (100 - e.givenSize) / (this.panesCount - 1)), this.panes.forEach((r) => {
249
+ s -= r.size, r.size >= r.max && n.push(r.id), r.size <= r.min && a.push(r.id);
250
+ }), !(Math.abs(s) < 0.1) && (this.panes.forEach((r) => {
251
+ e && e.givenSize !== null && e.id === r.id || (r.size = Math.max(Math.min(i, r.max), r.min)), s -= r.size, r.size >= r.max && n.push(r.id), r.size <= r.min && a.push(r.id);
252
+ }), s > 0.1 && this.readjustSizes(s, n, a));
253
+ },
254
+ readjustSizes(e, t, i) {
255
+ let s;
256
+ e > 0 ? s = e / (this.panesCount - t.length) : s = e / (this.panesCount - i.length), this.panes.forEach((n, a) => {
257
+ if (e > 0 && !t.includes(n.id)) {
258
+ const r = Math.max(Math.min(n.size + s, n.max), n.min), h = r - n.size;
259
+ e -= h, n.size = r;
260
+ } else if (!i.includes(n.id)) {
261
+ const r = Math.max(Math.min(n.size + s, n.max), n.min), h = r - n.size;
262
+ e -= h, n.size = r;
263
+ }
264
+ n.update({
265
+ [this.horizontal ? "height" : "width"]: `${this.indexedPanes[n.id].size}%`
266
+ });
267
+ }), Math.abs(e) > 0.1 && this.$nextTick(() => {
268
+ this.ready && console.warn("Splitpanes: Could not resize panes correctly due to their constraints.");
269
+ });
270
+ }
271
+ },
272
+ watch: {
273
+ panes: {
274
+ deep: !0,
275
+ immediate: !1,
276
+ handler() {
277
+ this.updatePaneComponents();
278
+ }
279
+ },
280
+ horizontal() {
281
+ this.updatePaneComponents();
282
+ },
283
+ firstSplitter() {
284
+ this.redoSplitters();
285
+ },
286
+ dblClickSplitter(e) {
287
+ [...this.container.querySelectorAll(".splitpanes__splitter")].forEach((i, s) => {
288
+ i.ondblclick = e ? (n) => this.onSplitterDblClick(n, s) : void 0;
289
+ });
290
+ }
291
+ },
292
+ beforeDestroy() {
293
+ this.ready = !1;
294
+ },
295
+ mounted() {
296
+ this.container = this.$refs.container, this.checkSplitpanesNodes(), this.redoSplitters(), this.resetPaneSizes(), this.$emit("ready"), this.ready = !0;
297
+ },
298
+ render(e) {
299
+ return e("div", {
300
+ ref: "container",
301
+ class: [
302
+ "splitpanes",
303
+ `splitpanes--${this.horizontal ? "horizontal" : "vertical"}`,
304
+ {
305
+ "splitpanes--dragging": this.touch.dragging
306
+ }
307
+ ]
308
+ }, this.$slots.default);
309
+ }
310
+ };
311
+ let E, R;
312
+ const f = {};
313
+ var k = /* @__PURE__ */ S(b, E, R, !1, N);
314
+ function N(e) {
315
+ for (let t in f)
316
+ this[t] = f[t];
317
+ }
318
+ var j = /* @__PURE__ */ function() {
319
+ return k.exports;
320
+ }(), O = function() {
321
+ var e = this, t = e.$createElement, i = e._self._c || t;
322
+ return i("div", { staticClass: "splitpanes__pane", style: e.style, on: { click: function(s) {
323
+ return e.onPaneClick(s, e._uid);
324
+ } } }, [e._t("default")], 2);
325
+ }, D = [];
326
+ const $ = {
327
+ name: "pane",
328
+ inject: ["requestUpdate", "onPaneAdd", "onPaneRemove", "onPaneClick"],
329
+ props: {
330
+ size: { type: [Number, String], default: null },
331
+ minSize: { type: [Number, String], default: 0 },
332
+ maxSize: { type: [Number, String], default: 100 }
333
+ },
334
+ data: () => ({
335
+ style: {}
336
+ }),
337
+ mounted() {
338
+ this.onPaneAdd(this);
339
+ },
340
+ beforeDestroy() {
341
+ this.onPaneRemove(this);
342
+ },
343
+ methods: {
344
+ update(e) {
345
+ this.style = e;
346
+ }
347
+ },
348
+ computed: {
349
+ sizeNumber() {
350
+ return this.size || this.size === 0 ? parseFloat(this.size) : null;
351
+ },
352
+ minSizeNumber() {
353
+ return parseFloat(this.minSize);
354
+ },
355
+ maxSizeNumber() {
356
+ return parseFloat(this.maxSize);
357
+ }
358
+ },
359
+ watch: {
360
+ sizeNumber(e) {
361
+ this.requestUpdate({ target: this, size: e });
362
+ },
363
+ minSizeNumber(e) {
364
+ this.requestUpdate({ target: this, min: e });
365
+ },
366
+ maxSizeNumber(e) {
367
+ this.requestUpdate({ target: this, max: e });
368
+ }
369
+ }
370
+ }, z = {};
371
+ var T = /* @__PURE__ */ S($, O, D, !1, q);
372
+ function q(e) {
373
+ for (let t in z)
374
+ this[t] = z[t];
375
+ }
376
+ var U = /* @__PURE__ */ function() {
377
+ return T.exports;
378
+ }();
379
+ export {
380
+ U as p,
381
+ j as s
382
+ };