@cling-se/widget 0.9.1 → 0.9.3

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 (132) hide show
  1. package/dist/AddClientCallout-746899d9.js +57 -0
  2. package/dist/{AnswerModal-c22c6729.js → AnswerModal-fdfea0f8.js} +7 -5
  3. package/dist/{AttachmentItem-ab7c264b.js → AttachmentItem-5671c64d.js} +5 -7
  4. package/dist/BaseDatePicker-a9240306.js +3156 -0
  5. package/dist/{BaseInput-2b048506.js → BaseInput-d3c3688b.js} +4 -4
  6. package/dist/{BaseUpload-869cbd9a.js → BaseUpload-8e7a2b72.js} +3 -3
  7. package/dist/BlockMedia-b613a2a4.js +72 -0
  8. package/dist/CCallout-e9ff903a.js +52 -0
  9. package/dist/CDropdownItem-05d84f95.js +610 -0
  10. package/dist/CField-cd4dcae9.js +183 -0
  11. package/dist/CField.vue_vue_type_style_index_0_lang-4ed993c7.js +1 -0
  12. package/dist/CSlider.vue_vue_type_style_index_0_lang-383db616.js +83 -0
  13. package/dist/ClientAutocomplete-421a2216.js +80 -0
  14. package/dist/ClientModal-11341b1c.js +547 -0
  15. package/dist/ColorPicker-f90939b5.js +2881 -0
  16. package/dist/{CompanyModal-26243605.js → CompanyModal-2bfd21b8.js} +12 -11
  17. package/dist/{ContentWrapper-315b8ac7.js → ContentWrapper-4aae35b2.js} +21 -14
  18. package/dist/{CoverBlockSettings-ff4d5ccc.js → CoverBlockSettings-1f917be3.js} +7 -7
  19. package/dist/DocForm-0891c6b2.js +6767 -0
  20. package/dist/DocFormSend-2b35999d.js +135 -0
  21. package/dist/{DocModalBase-3d81e120.js → DocModalBase-225e2f2d.js} +1 -1
  22. package/dist/{DocReceipt-c9c5aefc.js → DocReceipt-1391c17a.js} +1 -1
  23. package/dist/{DocSendReminder-ab8e6f0f.js → DocSendReminder-c488842d.js} +1 -1
  24. package/dist/{DocTextEditor-88987249.js → DocTextEditor-2538e1ab.js} +16 -12
  25. package/dist/{DocTimeline-8e8a1b51.js → DocTimeline-69ada0de.js} +11 -11
  26. package/dist/DocumentClient-74b8f25b.js +145 -0
  27. package/dist/{DocumentLogotype-a777ea0d.js → DocumentLogotype-e89b53fb.js} +3 -3
  28. package/dist/{EmbedInput-4b92adae.js → EmbedInput-b7fefe5e.js} +10 -11
  29. package/dist/{EmbedSettings-0701c838.js → EmbedSettings-4957252f.js} +10 -11
  30. package/dist/ErrorCallout-42e45ec0.js +30 -0
  31. package/dist/{FilePreviewModal-fa0f4b2c.js → FilePreviewModal-75693619.js} +6 -7
  32. package/dist/FormInputRow-09d450e3.js +2045 -0
  33. package/dist/{HeaderSettings-3b1f470a.js → HeaderSettings-9b69eada.js} +23 -19
  34. package/dist/{ImageSelectModal-24b1d738.js → ImageSelectModal-94d4dc7f.js} +20 -18
  35. package/dist/{ImageUploadWrapper-f9d3ab48.js → ImageUploadWrapper-a144b042.js} +2 -2
  36. package/dist/{Index-a6d8cb6c.js → Index-00ef9241.js} +10 -10
  37. package/dist/{Index-17041bc1.js → Index-023c3119.js} +6 -7
  38. package/dist/{Index-1df9e104.js → Index-1bafafca.js} +2 -2
  39. package/dist/{Index-e9dcaa48.js → Index-2cb8fa22.js} +73 -118
  40. package/dist/{Index-9797765e.js → Index-304c45be.js} +21 -16
  41. package/dist/{Index-ec4600d0.js → Index-35387450.js} +52 -42
  42. package/dist/Index-37a9183b.js +28 -0
  43. package/dist/{Index-d21e1d0d.js → Index-3dff19dd.js} +7 -7
  44. package/dist/{Index-53f58582.js → Index-3ee2e944.js} +2 -2
  45. package/dist/{Index-41e37657.js → Index-42e26b46.js} +11 -11
  46. package/dist/{Index-36b91cfc.js → Index-4440fe3d.js} +6 -7
  47. package/dist/{Index-36fc26f9.js → Index-4563d3fa.js} +33 -31
  48. package/dist/{Index-9262d0cb.js → Index-53da7be8.js} +3 -3
  49. package/dist/{Index-bfc7f353.js → Index-62936c19.js} +16 -17
  50. package/dist/{Index-9a0239fe.js → Index-693005f0.js} +6 -7
  51. package/dist/{Index-5c0744c1.js → Index-78f13416.js} +6 -7
  52. package/dist/{Index-a01c2862.js → Index-90492f19.js} +5 -6
  53. package/dist/{Index-8bb9f798.js → Index-96f39afc.js} +6 -7
  54. package/dist/{Index-ee9ff714.js → Index-97d1f2f3.js} +8 -8
  55. package/dist/{Index-41e93dd5.js → Index-9a243eb8.js} +2 -2
  56. package/dist/{Index-01f77191.js → Index-9ffe9766.js} +11 -12
  57. package/dist/{Index-be520920.js → Index-a37beb03.js} +1 -1
  58. package/dist/{Index-e5ebcd2f.js → Index-a554b58c.js} +6 -7
  59. package/dist/{Index-aa1323ee.js → Index-a86ea774.js} +8 -9
  60. package/dist/{Index-c070cd5e.js → Index-abb8c6e4.js} +6 -6
  61. package/dist/{Index-74d98d97.js → Index-b7def77a.js} +8 -9
  62. package/dist/{Index-6f5192b8.js → Index-bcc478b3.js} +7 -8
  63. package/dist/{Index-033cd5ed.js → Index-cec7d4f1.js} +22 -15
  64. package/dist/{Index-560f7a0f.js → Index-d68a28da.js} +7 -7
  65. package/dist/{Index-5ba3dd14.js → Index-dbe97658.js} +2 -2
  66. package/dist/{Index-a5b8ec5c.js → Index-ec8d534f.js} +4 -6
  67. package/dist/{Index-013c4412.js → Index-f2b66b79.js} +6 -7
  68. package/dist/{Index-8ad015e2.js → Index-f453850f.js} +6 -7
  69. package/dist/{Index-78391f8b.js → Index-f9b5f03c.js} +27 -20
  70. package/dist/{InputToggleRow-9aa959ff.js → InputToggleRow-68320d9f.js} +1 -1
  71. package/dist/IsPremiumPreStep-0c7032a3.js +1919 -0
  72. package/dist/{MediaWrapper-03b27562.js → MediaWrapper-c50879c2.js} +4 -4
  73. package/dist/{NotBindingText-fb4e9ecb.js → NotBindingText-8f2d9244.js} +2 -2
  74. package/dist/{PackageGroup-821d41fa.js → PackageGroup-2c49e99b.js} +24 -17
  75. package/dist/{PdfTerms-4a29bcc9.js → PdfTerms-94153a5f.js} +6 -7
  76. package/dist/{PdfViewer-374bfe41.js → PdfViewer-701ad40e.js} +2 -2
  77. package/dist/{PlainHtml-65923dd4.js → PlainHtml-04a6d7f9.js} +1 -1
  78. package/dist/PriceHeader-7f92d5a7.js +336 -0
  79. package/dist/SearchApi-ffe5b697.js +148 -0
  80. package/dist/{TermsSettings-4a40aaa2.js → TermsSettings-b1bf19e9.js} +6 -6
  81. package/dist/{ThemeColorRow-72b7a35b.js → ThemeColorRow-913497f6.js} +7 -6
  82. package/dist/{ToggleBinding-00c37a9d.js → ToggleBinding-6518935d.js} +8 -9
  83. package/dist/{UploadModal-761770b9.js → UploadModal-3c399d25.js} +21 -22
  84. package/dist/{VideoPlayerInput-6692fe27.js → VideoPlayerInput-b54845a4.js} +5 -6
  85. package/dist/{VideoPlayerSettings-2b7a8a39.js → VideoPlayerSettings-496e9e79.js} +13 -14
  86. package/dist/{VideoSelectModal-4596e9b4.js → VideoSelectModal-3a566398.js} +10 -10
  87. package/dist/anime.es-e284c852.js +858 -0
  88. package/dist/answerDocumentMixin-0e5e4dbb.js +54 -0
  89. package/dist/color-71c20583.js +15 -0
  90. package/dist/{cssMode-34bf902e.js → cssMode-c0865919.js} +15 -14
  91. package/dist/focusDrawerMixin-298861bc.js +68 -0
  92. package/dist/formComponentsInstall-1be6791d.js +2491 -0
  93. package/dist/formValidationMixin-df38771c.js +4984 -0
  94. package/dist/{freemarker2-61453951.js → freemarker2-85dde97c.js} +19 -18
  95. package/dist/{handlebars-24c80c6f.js → handlebars-6aa1e52b.js} +18 -17
  96. package/dist/{html-fc291ba3.js → html-f0c735cd.js} +14 -13
  97. package/dist/{htmlMode-bb27a86a.js → htmlMode-7b3bd7c9.js} +19 -18
  98. package/dist/{index-afe3eb26.js → index-1ef6f423.js} +21 -15
  99. package/dist/index-30808a2c.js +490 -0
  100. package/dist/{index-053f9545.js → index-431938de.js} +13 -12
  101. package/dist/index-6d08eac3.js +14 -0
  102. package/dist/index-805c56e4.js +4 -0
  103. package/dist/index.es.js +3 -3
  104. package/dist/index.umd.js +713 -600
  105. package/dist/{javascript-584c9812.js → javascript-9c54ad9e.js} +11 -10
  106. package/dist/{jsonMode-f03e810a.js → jsonMode-1d1176fa.js} +19 -18
  107. package/dist/{liquid-2157b417.js → liquid-0738c73d.js} +11 -10
  108. package/dist/{main-e2129a84.js → main-2d9b8259.js} +19557 -20415
  109. package/dist/mapFormMixin-308bbdab.js +66 -0
  110. package/dist/{publicSenderState-11d47322.js → publicSenderState-9eecb11f.js} +1 -1
  111. package/dist/{python-7f1728ff.js → python-588c9e64.js} +11 -10
  112. package/dist/{razor-54008302.js → razor-fbaa1d21.js} +14 -13
  113. package/dist/regions-29ee6964.js +1250 -0
  114. package/dist/simplebar.min-75960401.js +2429 -0
  115. package/dist/style.css +4 -0
  116. package/dist/template-b877debf.js +526 -0
  117. package/dist/throttle-d7bed81a.js +18 -0
  118. package/dist/tinycolor-ef496244.js +634 -0
  119. package/dist/{tsMode-6bcf5f10.js → tsMode-c1de8e10.js} +15 -14
  120. package/dist/{typescript-f225fd6d.js → typescript-737827aa.js} +11 -10
  121. package/dist/{utils-c4dbd526.js → utils-69c41ae9.js} +5 -5
  122. package/dist/vuedraggable.umd-67b8cddf.js +3179 -0
  123. package/dist/{xml-8680011c.js → xml-30e811a1.js} +11 -10
  124. package/package.json +4 -4
  125. package/stats.html +1 -1
  126. package/dist/DocForm-b6cc1bdf.js +0 -22074
  127. package/dist/DocFormSend-1c7e370d.js +0 -113
  128. package/dist/Index-0f345bed.js +0 -29
  129. package/dist/PriceHeader-4fb21725.js +0 -329
  130. package/dist/formComponentsInstall-0d5f842a.js +0 -11121
  131. package/dist/index-3a6d34e0.js +0 -11
  132. package/dist/throttle-7fc52dc7.js +0 -18
@@ -0,0 +1,2491 @@
1
+ import { b as H, m as f } from "./vuex.esm-4a0fff7c.js";
2
+ import { s as q } from "./simplebar.min-75960401.js";
3
+ import { m as u } from "./mapFormMixin-308bbdab.js";
4
+ import { B as O } from "./BaseDatePicker-a9240306.js";
5
+ import { E as j } from "./ErrorCallout-42e45ec0.js";
6
+ import { n as r, ao as I, ap as v, x as K, b as d, aq as W, k as X, ar as U, as as Q, l as T, at as P, au as R, c as M, av as y } from "./main-2d9b8259.js";
7
+ import Y from "./AddClientCallout-746899d9.js";
8
+ import G from "./ClientModal-11341b1c.js";
9
+ import { c as J, r as Z, g as ee, C as p, b as h, e as m } from "./CDropdownItem-05d84f95.js";
10
+ import { S as te } from "./CSlider.vue_vue_type_style_index_0_lang-383db616.js";
11
+ import { C as _ } from "./CCallout-e9ff903a.js";
12
+ import { C as z } from "./CField-cd4dcae9.js";
13
+ import { r as o } from "./regions-29ee6964.js";
14
+ const ie = {
15
+ name: "DocumentSendReminderItem",
16
+ props: {
17
+ label: {
18
+ type: String,
19
+ required: !0
20
+ },
21
+ value: {
22
+ type: [Number, String],
23
+ default: 0
24
+ },
25
+ done: {
26
+ type: Boolean,
27
+ default: !1
28
+ }
29
+ }
30
+ };
31
+ var se = function() {
32
+ var e = this, i = e._self._c;
33
+ return i("div", { staticClass: "flex items-center bg-gray-100 mb-4 rounded-md px-4 py-2 select-none text-sm font-medium min-h-[2.5em]" }, [i("div", { staticClass: "text-gray-700 flex-auto mr-6 select-none" }, [e._v(" " + e._s(e.label) + " ")]), i("div", { staticClass: "flex items-center justify-center flex-nowrap text-sm" }, [e.done ? i("span", { staticClass: "text-green-500" }, [i("BaseIcon", { attrs: { type: "check", size: "18" } }), e._v(" " + e._s(e.$t("sent")) + " ")], 1) : [i("CButton", { staticClass: "bg-white !h-6 !w-6", attrs: { icon: "minus", size: "small", circle: "", raised: "" }, on: { click: function(s) {
34
+ e.$emit("input", Math.max(e.value - 1, 0));
35
+ } } }), i("div", { staticClass: "py-4 text-gray-800 font-medium text-center min-w-[8ch] text-sm" }, [e.value ? [e._v(" " + e._s(e.$tc("day", { count: Number(e.value) })) + " ")] : i("span", { staticClass: "text-gray-500 text-xs" }, [e._v(" " + e._s(e.$t("disabled").capitalize()) + " ")])], 2), i("CButton", { staticClass: "bg-white !w-6 !h-6", attrs: { icon: "plus", size: "small", circle: "", raised: "" }, on: { click: function(s) {
36
+ return e.$emit("input", e.value + 1);
37
+ } } })]], 2)]);
38
+ }, ne = [], ae = /* @__PURE__ */ r(
39
+ ie,
40
+ se,
41
+ ne,
42
+ !1,
43
+ null,
44
+ null,
45
+ null,
46
+ null
47
+ );
48
+ const re = ae.exports, oe = {
49
+ name: "DocumentSendReminders",
50
+ i18nOptions: {
51
+ namespaces: "documentSendReminders",
52
+ messages: {
53
+ en: {
54
+ description: "Edit when smart reminders should be sent to client",
55
+ notViewed: "Not viewed after",
56
+ notAnswered: "No reply after",
57
+ expires: "When expiration date is within"
58
+ },
59
+ sv: {
60
+ description: "Ställ in när smarta påminnelser ska skickas ut till mottagaren",
61
+ notViewed: "Inte öppnat efter",
62
+ notAnswered: "Inte svarat efter",
63
+ expires: "När giltighetstiden är inom"
64
+ }
65
+ }
66
+ },
67
+ components: {
68
+ DocumentSendReminderItem: re
69
+ },
70
+ mixins: [u()],
71
+ props: {
72
+ setFormValue: {
73
+ type: Function,
74
+ required: !0
75
+ },
76
+ removeFormValue: {
77
+ type: Function,
78
+ required: !0
79
+ }
80
+ },
81
+ computed: {
82
+ reminders() {
83
+ const t = {
84
+ first: null,
85
+ notViewed: null,
86
+ notAnswered: null,
87
+ expires: null
88
+ };
89
+ return this._document.reminders.forEach((e, i) => {
90
+ e.type === "first" ? t.first = { ...e, index: i } : e.type === "viewed" ? t.notViewed = { ...e, index: i } : e.type === "expires" ? t.expires = { ...e, index: i } : t.notAnswered = { ...e, index: i };
91
+ }), t;
92
+ }
93
+ },
94
+ methods: {
95
+ getDefaultReminders() {
96
+ if (!this._document.template)
97
+ return [];
98
+ const t = this._document.template.getDefaultData({ path: "properties.data.properties.reminders" });
99
+ return t && Array.isArray(t) ? t : [];
100
+ },
101
+ setReminder(t, e) {
102
+ let i = "sendDays";
103
+ if (typeof e == "string" && (i = "sendAt"), !e) {
104
+ this.removeFormValue(`data.reminders[${t.index}]`);
105
+ return;
106
+ }
107
+ if (typeof t == "string") {
108
+ let s = this.getDefaultReminders().find((n) => n.type === t);
109
+ if (s || (s = I.default.find((n) => n.type === t)), !s)
110
+ throw new Error("Could not find default reminder");
111
+ s[i] = e, this.setFormValue({ key: "data.reminders", value: s });
112
+ return;
113
+ }
114
+ this.setFormValue({ key: `data.reminders[${t.index}].${i}`, value: e });
115
+ }
116
+ }
117
+ };
118
+ var le = function() {
119
+ var e = this, i = e._self._c;
120
+ return i("div", { staticStyle: { "background-color": "white", "border-radius": "0.5rem", padding: "2rem", "font-size": "16px" } }, [i("div", { staticStyle: { "font-size": "1.25em", "font-weight": "700", "margin-bottom": "0.25em", "text-align": "center" } }, [e._v(" " + e._s(e.$t("_common:reminder_plural").capitalize()) + " ")]), i("div", { staticClass: "text-center has-text-grey-dark", staticStyle: { "max-width": "20rem", margin: "0 auto 2rem auto" } }, [e._v(" " + e._s(e.$t("description")) + " ")]), e._l([
121
+ { type: "notViewed", fallbackKey: "viewed" },
122
+ { type: "notAnswered", fallbackKey: "reminder" },
123
+ { type: "expires", fallbackKey: "expires" }
124
+ ], function(s, n) {
125
+ return i("DocumentSendReminderItem", { key: n, attrs: { label: e.$t(s.type), value: e.reminders[s.type] ? e.reminders[s.type].sendDays : 0, done: e.reminders[s.type] && e.reminders[s.type].status === "successful" }, on: { input: function(a) {
126
+ return e.setReminder(e.reminders[s.type] || s.fallbackKey, a);
127
+ } } });
128
+ }), i("div", { staticClass: "flex items-center justify-center w-full", staticStyle: { "margin-top": "2.5rem" } }, [i("CButton", { attrs: { type: "secondary", expanded: "" }, on: { click: function(s) {
129
+ return e.$emit("close");
130
+ } } }, [e._v(" " + e._s(e.$t("_common:save")) + " ")])], 1)], 2);
131
+ }, de = [], ce = /* @__PURE__ */ r(
132
+ oe,
133
+ le,
134
+ de,
135
+ !1,
136
+ null,
137
+ null,
138
+ null,
139
+ null
140
+ );
141
+ const ue = ce.exports;
142
+ function N(t, e) {
143
+ const i = new Date(t.getTime());
144
+ return i.setDate(t.getDate() + (7 + e - t.getDay() - 1) % 7 + 1), i.setHours(8, 0, 0, 0), i;
145
+ }
146
+ function E(t) {
147
+ const e = new Date(t.getTime());
148
+ return e.setDate(e.getDate() + 1), e.setHours(10, 0, 0, 0), e;
149
+ }
150
+ let b = E(/* @__PURE__ */ new Date()), C = N(/* @__PURE__ */ new Date(), 1);
151
+ const me = {
152
+ name: "DocumentSendLater",
153
+ i18nOptions: {
154
+ namespaces: "documentSendLater",
155
+ messages: {
156
+ en: {
157
+ title: "Schedule Delivery",
158
+ tomorrowMorning: "Tomorrow morning",
159
+ mondayMorning: "Monday morning",
160
+ custom: {
161
+ title: "Set time & date",
162
+ invalid: "Time & date can't be in the past"
163
+ }
164
+ },
165
+ sv: {
166
+ title: "Skicka med schemaläggning",
167
+ tomorrowMorning: "Imorgon förmiddag",
168
+ mondayMorning: "Måndag morgon",
169
+ custom: {
170
+ title: "Välj datum & tid",
171
+ invalid: "Välj en tid & datum längre fram i tiden."
172
+ }
173
+ }
174
+ }
175
+ },
176
+ components: {
177
+ BaseDatePicker: O
178
+ },
179
+ props: {
180
+ _document: {
181
+ type: Object,
182
+ default: () => ({})
183
+ },
184
+ setFormValue: {
185
+ type: Function,
186
+ required: !0
187
+ },
188
+ removeFormValue: {
189
+ type: Function,
190
+ required: !0
191
+ },
192
+ onSaveDocument: {
193
+ type: Function,
194
+ required: !0
195
+ }
196
+ },
197
+ data() {
198
+ return {
199
+ sendAt: v(/* @__PURE__ */ new Date(), 5),
200
+ showCustom: !1,
201
+ backupSentFlag: !1
202
+ // needed since doc/project flags not instant on double clicks
203
+ };
204
+ },
205
+ validations: {
206
+ sendAt: {
207
+ minValue: (t) => t > v(/* @__PURE__ */ new Date(), 2).toISOString()
208
+ // two minutes as safety
209
+ }
210
+ },
211
+ computed: {
212
+ ...H("forms", {
213
+ formData: (t) => t.document2.data
214
+ }),
215
+ ...f({
216
+ deliveryTypes: "forms/deliveryTypes",
217
+ isPostingDocument: "documents2/isPosting",
218
+ feature: "application/feature"
219
+ }),
220
+ tomorrowMorning() {
221
+ return b.toISOString();
222
+ },
223
+ mondayMorning() {
224
+ return C.toISOString();
225
+ },
226
+ reminderDeliveryTypes() {
227
+ const t = ["email"];
228
+ return this.feature("sms") && t.push("sms"), this.deliveryTypes ? [
229
+ ...this.deliveryTypes.sms && this.feature("sms") ? ["sms"] : [],
230
+ ...this.deliveryTypes.email ? ["email"] : []
231
+ ] : t;
232
+ }
233
+ },
234
+ created() {
235
+ b = E(/* @__PURE__ */ new Date()), C = N(/* @__PURE__ */ new Date(), 1);
236
+ },
237
+ methods: {
238
+ setTime(t) {
239
+ const e = t.split(":"), i = new Date(this.sendAt).setHours(e[0], e[1]);
240
+ i && (this.sendAt = new Date(i).toISOString());
241
+ },
242
+ setDate(t) {
243
+ const e = new Date(this.sendAt), i = new Date(t).setHours(e.getHours(), e.getMinutes());
244
+ this.sendAt = new Date(i).toISOString();
245
+ },
246
+ async onSendAt(t) {
247
+ try {
248
+ if (this.$v.$invalid || this.isPostingDocument || this.backupSentFlag)
249
+ return;
250
+ this.backupSentFlag = !0;
251
+ const e = {
252
+ type: "first",
253
+ status: "new",
254
+ sendDays: 0,
255
+ sendAt: t,
256
+ deliveryTypes: this.reminderDeliveryTypes,
257
+ tries: 0
258
+ }, i = this.formData.reminders.findIndex((n) => n.type === "first"), s = i >= 0 ? `data.reminders[${i}]` : "data.reminders";
259
+ this.setFormValue({ key: s, value: e }), await this.onSaveDocument({ doSend: !0 }), this.backupSentFlag = !1;
260
+ } catch (e) {
261
+ K(e);
262
+ } finally {
263
+ this.backupSentFlag = !1;
264
+ }
265
+ }
266
+ }
267
+ };
268
+ var pe = function() {
269
+ var e = this, i = e._self._c;
270
+ return i("div", { staticClass: "bg-white rounded-xl overflow-hidden" }, [i("div", { staticClass: "px-6 pt-8 pb-3" }, [i("div", { staticClass: "text-md font-semibold text-center" }, [e._v(" " + e._s(e.$t("title")) + " ")]), i("div", { staticClass: "pt-8" }, e._l([
271
+ [e.tomorrowMorning, "tomorrowMorning"],
272
+ [e.mondayMorning, "mondayMorning"]
273
+ ], function(s, n) {
274
+ return i("div", { key: n, staticClass: "bg-gray-50 border border-gray-200 p-4 rounded-md mb-4 cursor-pointer flex items-center justify-between text-sm hover:bg-gray-100 hover:border-gray-300 active:bg-gray-200 active:border-gray-400 select-none", on: { click: () => e.onSendAt(s[0]) } }, [i("div", { staticClass: "font-medium" }, [e._v(e._s(e.$t(s[1])))]), i("div", { staticClass: "text-gray-500" }, [e._v(" " + e._s(e.$formatDate(s[0], "p, d MMM")) + " ")])]);
275
+ }), 0)]), i("div", { staticClass: "px-8 py-6 bg-gray-100 border-t border-gray-200", class: e.showCustom ? "" : "cursor-pointer hover:bg-gray-200", on: { click: function(s) {
276
+ e.showCustom = !0;
277
+ } } }, [i("div", { staticClass: "flex items-center text-sm" }, [i("BaseIcon", { staticClass: "text-primary-500 mr-2", attrs: { type: "calendar", size: "18" } }), i("div", { staticClass: "font-medium", domProps: { textContent: e._s(e.$t("custom.title")) } })], 1), i("Animation", [i("div", { directives: [{ name: "show", rawName: "v-show", value: e.showCustom, expression: "showCustom" }], staticClass: "mt-4" }, [i("div", { staticClass: "grid grid-cols-2 gap-4" }, [i("BaseDatePicker", { attrs: { value: e.sendAt }, on: { input: e.setDate } }), i("CInput", { attrs: { value: e.$formatDate(e.sendAt, "HH:mm"), clearable: !1, type: "time" }, on: { input: e.setTime } })], 1), e.$v.$invalid ? i("div", { staticClass: "error-wrapper" }, [i("BaseIcon", { staticClass: "mr-2 text-primary-500", attrs: { type: "calendar" } }), e._v(" " + e._s(e.$t("custom.invalid")) + " ")], 1) : e._e(), i("CButton", { staticStyle: { "margin-top": "1.5rem" }, attrs: { loading: e.isPostingDocument || e.isPostingProject, type: "secondary", wide: "" }, on: { click: function(s) {
278
+ return e.onSendAt(e.sendAt);
279
+ } } }, [e._v(" " + e._s(e.$t("_common:send")) + " " + e._s(e.$formatDate(e.sendAt, "d MMM - p")) + " ")])], 1)])], 1)]);
280
+ }, he = [], fe = /* @__PURE__ */ r(
281
+ me,
282
+ pe,
283
+ he,
284
+ !1,
285
+ null,
286
+ "b3422e2b",
287
+ null,
288
+ null
289
+ );
290
+ const ge = fe.exports;
291
+ const ve = {
292
+ name: "ClientSendListItem",
293
+ props: {
294
+ client: {
295
+ type: Object,
296
+ default: () => ({})
297
+ },
298
+ isOrder: {
299
+ type: Boolean,
300
+ default: !1
301
+ },
302
+ isSender: {
303
+ type: Boolean,
304
+ default: !1
305
+ },
306
+ compact: {
307
+ type: Boolean,
308
+ default: !1
309
+ },
310
+ rightButton: {
311
+ // TODO temporary in order to disable sender sign for widget context
312
+ type: Boolean,
313
+ default: !0
314
+ }
315
+ },
316
+ data() {
317
+ return {
318
+ isHover: !1,
319
+ isDropdownOpen: !1
320
+ };
321
+ }
322
+ };
323
+ var ye = function() {
324
+ var s;
325
+ var e = this, i = e._self._c;
326
+ return i("div", { staticClass: "flex items-center rc-card", class: {
327
+ "is-hover": e.isHover,
328
+ "has-controls": e.isOrder
329
+ }, staticStyle: { "padding-left": "8px" }, on: { click: function(n) {
330
+ e.rightButton && e.isSender ? e.$refs.dropdown.toggle() : e.$emit("open");
331
+ }, "&mouseover": function(n) {
332
+ e.isHover = !0;
333
+ }, "&mouseleave": function(n) {
334
+ e.isHover = !1;
335
+ } } }, [e.compact ? i("div", { staticStyle: { "font-size": "14px" } }, [i("div", [e._v(e._s(e.client.name || e.client.companyName))]), e.client.name && e.client.companyName ? i("div", { staticStyle: { "font-size": "12px", "font-weight": "500" } }, [e._v(" " + e._s(e.client.companyName) + " ")]) : e._e(), e.client.documentRole ? i("div", { staticClass: "text-gray-700", staticStyle: { "font-size": "13px", "margin-top": "4px" } }, [e._v(" " + e._s(e.$t(`_common:documentRole.${e.client.documentRole}.description`)) + " ")]) : e._e(), e.isOrder ? i("div", { staticClass: "compact-order" }, [i("BaseIcon", { staticClass: "compact-order-button", attrs: { size: "16", type: "chevron-up" }, on: { click: function(n) {
336
+ return n.preventDefault(), n.stopPropagation(), e.$emit("move", -1);
337
+ } } }), i("div", { staticClass: "rc-order", staticStyle: { width: "20px", height: "20px" } }, [e._v(" " + e._s(e.client.signOrder) + " ")]), i("BaseIcon", { staticClass: "compact-order-button", attrs: { size: "16", type: "chevron-down" }, on: { click: function(n) {
338
+ return n.preventDefault(), n.stopPropagation(), e.$emit("move", 1);
339
+ } } })], 1) : e._e()]) : [i("div", { staticStyle: { width: "34px", flex: "0 0 34px", display: "inline-flex", "justify-content": "center" } }, [e.isOrder ? i("div", { staticStyle: { position: "relative", display: "inline-block" } }, [i("CButton", { staticClass: "rc-order__button up", attrs: { type: "none", pattern: "primary", circle: "", raised: "", size: "small", icon: "minus" }, on: { click: function(n) {
340
+ return n.preventDefault(), n.stopPropagation(), e.$emit("move", -1);
341
+ } } }), i("CButton", { staticClass: "rc-order__button down", attrs: { type: "none", pattern: "primary", circle: "", raised: "", size: "small", icon: "plus" }, on: { click: function(n) {
342
+ return n.preventDefault(), n.stopPropagation(), e.$emit("move", 1);
343
+ } } }), i("div", { staticClass: "rc-order" }, [e._v(" " + e._s(e.client.signOrder) + " ")])], 1) : i("BaseIcon", { staticClass: "text-primary-500", staticStyle: { "margin-right": "8px", flex: "0 0 18px" }, attrs: { type: e.isSender ? "send" : ["signee", "approver"].includes(e.client.documentRole) ? "pen-tool" : "eye", size: "18" } })], 1), i("div", { staticClass: "rc-data truncate-text" }, [e.client.name || e.client.companyName ? i("div", { staticStyle: { "font-weight": "500" } }, [e._v(" " + e._s(e.client.name || e.client.companyName) + " ")]) : e.isSender ? i("div", { staticClass: "text-gray-500" }, [e._v(" " + e._s(e.$t("_common:empty", { thing: e.$t("_common:reference") })) + " ")]) : i("div", { staticClass: "text-gray-500" }, [e._v(" " + e._s(e.$t("_common:missing", { thing: e.$t("_common:name") })) + " ")]), i("div", { staticClass: "text-gray-700", staticStyle: { "font-size": "12px" } }, [e.isSender ? [e.isSender ? i("span", [e._v(" " + e._s(e.$t("_common:documentRole.sender.description")) + " ")]) : e._e(), e.client.documentRole === "signee" ? i("span", [e._v(" " + e._s(e.$t(`_common:documentRole.${e.client.documentRole}.description`)) + " ")]) : e._e()] : [((s = e.client.answerMethod) == null ? void 0 : s.accept) === "inPerson" ? i("span", { staticClass: "text-red-500" }, [e._v(" " + e._s(e.$t("_common:signMethod.title")) + ": "), i("span", [e._v(" " + e._s(e.$t("_common:signMethod.inPerson")) + " ")])]) : e._e(), e.client.documentRole ? i("span", [e._v(" " + e._s(e.$t(`_common:documentRole.${e.client.documentRole}.description`)) + " ")]) : e._e(), e.client.email ? i("span", [e._v(e._s(e.client.email))]) : e._e(), e.client.cellphone ? i("span", [e._v(e._s(e.client.cellphone))]) : e._e()]], 2)])], e.rightButton ? i("transition", { attrs: { name: "fade-100" } }, [e.isHover || e.isDropdownOpen ? [e.isSender ? i("CDropdown", { ref: "dropdown", staticStyle: { position: "absolute", right: "0.5rem" }, attrs: { position: "is-bottom-left", "menu-styling": {
344
+ width: "220px"
345
+ } }, on: { "active-change": function(n) {
346
+ e.isDropdownOpen = n;
347
+ } }, nativeOn: { click: function(n) {
348
+ n.stopPropagation();
349
+ } } }, [i("CButton", { attrs: { slot: "trigger", circle: "", size: "small", type: "none", pattern: "secondary", raised: "", icon: "more-horizontal" }, slot: "trigger" }), e._t("dropdownOptions")], 2) : i("CButton", { staticStyle: { position: "absolute", right: "0.5rem" }, attrs: { circle: "", size: "small", icon: "x", type: "none", pattern: "secondary", raised: "" }, on: { click: function(n) {
350
+ return n.stopPropagation(), e.$emit("remove");
351
+ } } })] : e._e()], 2) : e._e()], 2);
352
+ }, _e = [], be = /* @__PURE__ */ r(
353
+ ve,
354
+ ye,
355
+ _e,
356
+ !1,
357
+ null,
358
+ "48008ee1",
359
+ null,
360
+ null
361
+ );
362
+ const L = be.exports;
363
+ const Ce = {
364
+ name: "SenderBlockItem",
365
+ i18nOptions: {
366
+ namespaces: "senderBlockItem",
367
+ messages: {
368
+ en: {
369
+ toggle: {
370
+ label: "Sign the document",
371
+ description: "Toggle to add your own signature to the document."
372
+ }
373
+ },
374
+ sv: {
375
+ toggle: {
376
+ label: "Signera dokumentet",
377
+ description: "Aktivera för att lägga till din signatur på dokumentet."
378
+ }
379
+ }
380
+ }
381
+ },
382
+ components: {
383
+ RecipientBlockItem: L
384
+ },
385
+ mixins: [
386
+ u(
387
+ ["senderClient"],
388
+ { useEmit: !1, setFnName: "setFormValue" }
389
+ )
390
+ ],
391
+ props: {
392
+ setFormValue: {
393
+ type: Function,
394
+ required: !0
395
+ },
396
+ defaultAddSenderClient: {
397
+ type: Boolean,
398
+ default: !1
399
+ }
400
+ },
401
+ inject: {
402
+ allowSenderSign: {
403
+ default: !0
404
+ }
405
+ },
406
+ data() {
407
+ return {
408
+ senderClientData: null
409
+ };
410
+ },
411
+ computed: {
412
+ ...f({
413
+ feature: "application/feature"
414
+ })
415
+ },
416
+ created() {
417
+ this.generateSenderClient(), this._document.id || this._document.isDirty("senderClient") ? this.toggleSenderSign(!!this.senderClient) : this.defaultAddSenderClient && this.toggleSenderSign(!0);
418
+ },
419
+ methods: {
420
+ get: d,
421
+ generateSenderClient() {
422
+ const { company: t, user: e } = this._document.sender || {}, i = d(this._document, "data.defaultAnswerMethod");
423
+ this.senderClientData = {
424
+ ...W(),
425
+ documentRole: "recipient",
426
+ ...i && { answerMethod: i },
427
+ ...this.senderClient,
428
+ // latest sender values in the document
429
+ type: "company",
430
+ companyName: t.name,
431
+ name: e.name,
432
+ email: e.email,
433
+ cellphone: e.cellphone
434
+ };
435
+ },
436
+ toggleSenderSign(t) {
437
+ this.senderClientData.documentRole = t ? "signee" : "recipient", this.senderClient = t ? this.senderClientData : null, this._document.setDirty("senderClient");
438
+ },
439
+ setSenderMethod(t) {
440
+ const e = {
441
+ ...this.senderClient,
442
+ answerMethod: {
443
+ accept: t,
444
+ deny: "button"
445
+ }
446
+ };
447
+ this.senderClient = e, this.senderClientData = { ...e };
448
+ }
449
+ }
450
+ };
451
+ var we = function() {
452
+ var e = this, i = e._self._c;
453
+ return e.senderClientData ? i("RecipientBlockItem", { staticClass: "first-of-group last-of-group", staticStyle: { display: "inline-flex", width: "auto", "padding-right": "2em", "min-width": "220px" }, attrs: { client: e.senderClientData, "right-button": e.allowSenderSign, "is-sender": !0 } }, [i("template", { slot: "dropdownOptions" }, [i("CDropdownItem", { attrs: { value: !!e.senderClient, "close-on-click": !1, toggle: "" }, on: { input: e.toggleSenderSign } }, [e._v(" " + e._s(e.$t("toggle.label")) + " ")]), e.senderClient ? [i("CDropdownItem", { attrs: { separator: "" } }), i("div", { staticClass: "has-text-grey", staticStyle: { "font-size": "13px", padding: "0.5rem 0 0.25rem 1rem", "font-weight": "500" } }, [e._v(" " + e._s(e.$t("_common:signMethod.title")) + " ")]), e._l([
454
+ "login",
455
+ "signature",
456
+ ...e.feature("bankId") ? ["bankId"] : []
457
+ ], function(s) {
458
+ return i("CDropdownItem", { key: s, attrs: { "icon-right": e.get(e.senderClient, "answerMethod.accept") === s ? "check" : "" }, on: { click: function(n) {
459
+ return e.setSenderMethod(s);
460
+ } } }, [e._v(" " + e._s(e.$t(`_common:signMethod.${s}`)) + " ")]);
461
+ })] : i("div", { staticClass: "has-background-grey-lightest-2 has-text-grey-darker", staticStyle: { padding: "0.5rem", margin: "0.5rem", "font-size": "13px", "border-radius": "4px", "line-height": "1.25", "font-weight": "500" } }, [e._v(" " + e._s(e.$t("toggle.description")) + " ")])], 2)], 2) : e._e();
462
+ }, xe = [], $e = /* @__PURE__ */ r(
463
+ Ce,
464
+ we,
465
+ xe,
466
+ !1,
467
+ null,
468
+ "45490d84",
469
+ null,
470
+ null
471
+ );
472
+ const Se = $e.exports, ke = {
473
+ sv: {
474
+ title: "Skicka dokument",
475
+ nameLabel: "Dokumentnamn",
476
+ namePlaceholder: "Namn",
477
+ sendAs: "Skicka som",
478
+ validityPeriod: "Giltighetstid",
479
+ manualDelivery: "Manuell leverans",
480
+ manualDeliveryTooltip: "Skicka ut dokument till din mottagare själv. Du kan dela en länk eller en PDF.",
481
+ scheduledTooltip: "Schemalägg utskick",
482
+ clientsAreMissingContactInfo: "En eller flera mottagare saknar e-post eller mobiltelefon-nr. Dokumentet kommer inte att kunna skickas till dem.",
483
+ missingDeliveryMethod: "Välj en eller fler leveransmetoder",
484
+ sendButton: "Skicka dokument",
485
+ signMethod: {
486
+ title: "Signeringsmetod",
487
+ tooltip: "Hur ska din mottagare signera?",
488
+ button: {
489
+ title: "Standard - knapptryck",
490
+ content: "Bevisnivå: IP-adress, tidpunkt och enhet."
491
+ },
492
+ bankId: {
493
+ title: "BankId",
494
+ content: "Samma säkerhetsgrad som bankerna har."
495
+ },
496
+ signature: {
497
+ title: "Standard",
498
+ content: "Bevisnivå: IP-adress, tidpunkt och enhet."
499
+ },
500
+ inPerson: {
501
+ title: "Fysisk underskrift",
502
+ content: "Signatur på utskrivet dokument"
503
+ }
504
+ }
505
+ },
506
+ en: {
507
+ title: "Send document",
508
+ nameLabel: "Document name",
509
+ namePlaceholder: "Name",
510
+ sendAs: "Send as",
511
+ validityPeriod: "Expiration",
512
+ manualDelivery: "Manual delivery",
513
+ manualDeliveryTooltip: "Share the document with your recipient yourself. You can share a link or a PDF.",
514
+ scheduledTooltip: "Schedule delivery",
515
+ clientsAreMissingContactInfo: "Note that one or more recipients are missing an email or cellphone number. The document will not be sent to them.",
516
+ missingDeliveryMethod: "Please select one or more delivery methods",
517
+ sendButton: "Send document",
518
+ signMethod: {
519
+ title: "Signing method",
520
+ tooltip: "How do you want your client to sign?",
521
+ button: {
522
+ title: "Standard - button",
523
+ content: "Level of proof: IP address, timestamp and device."
524
+ },
525
+ bankId: {
526
+ title: "BankID",
527
+ content: "Same level of proof as the banks use."
528
+ },
529
+ signature: {
530
+ title: "Signature",
531
+ content: "Level of proof: IP address, timestamp and device."
532
+ },
533
+ inPerson: {
534
+ title: "In person",
535
+ content: "Signature on print document"
536
+ }
537
+ }
538
+ }
539
+ }, De = {
540
+ sv: {
541
+ addFirstButton: "Lägg till mottagare",
542
+ addButton: "Lägg till mottagare",
543
+ signOrder: {
544
+ label: "Signeringsordning",
545
+ tooltip: "Signeringsordning låter dig bestämma i vilken ordning dina mottagare tar emot och signerar dokumentet."
546
+ }
547
+ },
548
+ en: {
549
+ addFirstButton: "Add recipient",
550
+ addButton: "Add recipient",
551
+ signOrder: {
552
+ label: "Signing order",
553
+ tooltip: "Signing order lets you decide the order in which your recipients receive and sign your documents."
554
+ }
555
+ }
556
+ };
557
+ const Ve = {
558
+ name: "RecipientBlock",
559
+ i18nOptions: {
560
+ namespaces: "recipientBlock",
561
+ messages: De
562
+ },
563
+ components: {
564
+ AddClientCallout: Y,
565
+ RecipientBlockItem: L,
566
+ SenderBlockItem: Se
567
+ },
568
+ mixins: [
569
+ u(
570
+ ["clients"],
571
+ {
572
+ useEmit: !1,
573
+ setFnName: "setFormValue"
574
+ }
575
+ )
576
+ ],
577
+ props: {
578
+ compact: {
579
+ type: Boolean,
580
+ default: !1
581
+ },
582
+ setFormValue: {
583
+ type: Function,
584
+ required: !0
585
+ },
586
+ removeFormValue: {
587
+ type: Function,
588
+ required: !0
589
+ },
590
+ defaultAddSenderClient: {
591
+ type: Boolean,
592
+ default: !1
593
+ },
594
+ isPublicForm: {
595
+ type: Boolean,
596
+ default: !1
597
+ }
598
+ },
599
+ computed: {
600
+ sortedClients() {
601
+ return [...this.clients].map((t, e) => ({ ...t, index: e })).sort((t, e) => t.signOrder - e.signOrder);
602
+ },
603
+ maxSignOrder() {
604
+ if (!this.useSignOrder || this.sortedClients.length === 0)
605
+ return 0;
606
+ const { signOrder: t } = this.sortedClients[this.sortedClients.length - 1];
607
+ return t;
608
+ },
609
+ useSignOrder() {
610
+ return d(this._document, "useSignOrder", !1);
611
+ }
612
+ },
613
+ methods: {
614
+ onMoveRecipient({ index: t, direction: e }) {
615
+ this.clients = X(this.clients).set(
616
+ {
617
+ ...this.clients[t],
618
+ signOrder: Math.max(this.clients[t].signOrder + e, 0)
619
+ },
620
+ t
621
+ );
622
+ },
623
+ toggleSignOrder(t) {
624
+ let e = [];
625
+ if (t) {
626
+ const i = !this.clients.every(({ signOrder: s }) => !s);
627
+ this.clients = this.clients.map((s, n) => ({
628
+ ...s,
629
+ signOrder: i ? s.signOrder : n + 1
630
+ }));
631
+ } else
632
+ e = d(this._document, "template.reminders", []), e.length || (e = I.default);
633
+ this.setFormValue({ key: "data.reminders", value: e }), this.setFormValue({ key: "useSignOrder", value: t });
634
+ },
635
+ removeClient(t) {
636
+ this.removeFormValue(`clients[${t}]`);
637
+ },
638
+ openClientModal(t = 0) {
639
+ const e = d(this, `clients[${t}].signOrder`);
640
+ this.$modal.show(
641
+ G,
642
+ {
643
+ documentClientIndex: t,
644
+ ...this.useSignOrder && {
645
+ signOrder: U(e) === "number" ? e : this.maxSignOrder + 1
646
+ },
647
+ isPublicForm: this.isPublicForm
648
+ }
649
+ );
650
+ },
651
+ setClient(t) {
652
+ this.setFormValue({ key: `clients[${this.clients.length}]`, value: t });
653
+ }
654
+ }
655
+ };
656
+ var Fe = function() {
657
+ var e = this, i = e._self._c;
658
+ return i("div", [e.compact ? e._e() : [i("div", { staticClass: "text-gray-900 text-xs font-medium pb-0.5" }, [e._v(" " + e._s(e.$t("_common:from").capitalize()) + ": ")]), i("SenderBlockItem", { attrs: { _document: e._document, _value: { senderClient: "senderClient" }, "set-form-value": e.setFormValue, "default-add-sender-client": e.defaultAddSenderClient } })], i("div", { staticClass: "block-title flex text-gray-500 text-xs pb-0.5 pt-2", class: { "block-title__line": !e.compact } }, [e.compact ? e._e() : i("div", { staticClass: "text-gray-900 font-medium" }, [e._v(" " + e._s(e.$t("_common:to").capitalize()) + ": ")]), e.clients && e.clients.length ? i("div", { staticClass: "inline-flex items-center justify-end ml-auto" }, [i("BaseIcon", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: e.$t("signOrder.tooltip"), expression: "$t('signOrder.tooltip')" }], staticClass: "mr-1", attrs: { type: "info", size: "14" } }), i("div", { staticClass: "font-medium mr-2" }, [e._v(" " + e._s(e.$t("signOrder.label")) + " ")]), i("CSwitch", { staticClass: "!mr-0", attrs: { value: e.useSignOrder, size: "tiny", type: "success" }, on: { input: e.toggleSignOrder } })], 1) : e._e()]), e.clients && e.clients.length ? [e.useSignOrder ? i("transition-group", { staticClass: "list-move", attrs: { name: "list-move" } }, [e._l(e.sortedClients, function(s, n) {
659
+ return [n > 0 && s.signOrder !== e.sortedClients[n - 1].signOrder ? i("div", { key: n, staticClass: "h-2 pl-6" }, [i("div", { staticClass: "h-full w-0.5 rounded-sm bg-primary-500" })]) : e._e(), i("div", { key: s._uniqueId, staticClass: "mt-px mb-0.5" }, [i("RecipientBlockItem", { class: {
660
+ "first-of-group": n === 0 || n > 0 && s.signOrder !== e.sortedClients[n - 1].signOrder,
661
+ "last-of-group": n === e.sortedClients.length - 1 || e.sortedClients[n + 1] && s.signOrder !== e.sortedClients[n + 1].signOrder
662
+ }, attrs: { client: s, "is-order": e.useSignOrder, compact: e.compact }, on: { move: function(a) {
663
+ return e.onMoveRecipient({ index: s.index, direction: a });
664
+ }, open: function(a) {
665
+ return e.openClientModal(s.index);
666
+ }, remove: function(a) {
667
+ return e.removeClient(s.index);
668
+ } } })], 1)];
669
+ })], 2) : e._l(e.clients, function(s, n) {
670
+ return i("RecipientBlockItem", { key: s._uniqueId, staticClass: "mt-px mb-0.5", class: {
671
+ "first-of-group": n === 0,
672
+ "last-of-group": n === e.clients.length - 1
673
+ }, attrs: { "is-order": e.useSignOrder, compact: e.compact, client: s }, on: { open: function(a) {
674
+ return e.openClientModal(n);
675
+ }, remove: function(a) {
676
+ return e.removeClient(n);
677
+ } } });
678
+ }), e.compact ? e._e() : i("CButton", { staticClass: "is-thinner !text-sm", attrs: { type: "secondary", pattern: "tertiary", "icon-left": "plus", size: "normal" }, on: { click: function(s) {
679
+ return e.openClientModal(e.clients.length);
680
+ } } }, [e._v(" " + e._s(e.$t("addButton")) + " ")])] : e.$view === "widget" || this.viewSettings.isPublicForm ? i("CButton", { staticClass: "font-medium !px-4", attrs: { type: "secondary", raised: "", size: "small", taller: "", "icon-left": "person" }, on: { click: function(s) {
681
+ return e.openClientModal(e.clients.length);
682
+ } } }, [e._v(" " + e._s(e.$t("addFirstButton")) + " ")]) : e.compact ? e._e() : i("AddClientCallout", { attrs: { compact: !0 }, on: { add: function(s) {
683
+ return e.openClientModal(e.clients.length);
684
+ }, setClient: e.setClient } })], 2);
685
+ }, Ae = [], Be = /* @__PURE__ */ r(
686
+ Ve,
687
+ Fe,
688
+ Ae,
689
+ !1,
690
+ null,
691
+ "ae1def56",
692
+ null,
693
+ null
694
+ );
695
+ const Oe = Be.exports;
696
+ const Ie = {
697
+ name: "SendForm",
698
+ i18nOptions: {
699
+ namespaces: "sendForm",
700
+ messages: ke
701
+ },
702
+ components: {
703
+ Simplebar: q,
704
+ BaseDatePicker: O,
705
+ RecipientBlock: Oe,
706
+ ErrorCallout: j
707
+ },
708
+ mixins: [
709
+ u(
710
+ [
711
+ "expiresAt",
712
+ "clients",
713
+ "defaultAnswerMethod",
714
+ "reminders",
715
+ "name"
716
+ ],
717
+ {
718
+ useEmit: !1,
719
+ setFnName: "setFormValue"
720
+ }
721
+ )
722
+ ],
723
+ props: {
724
+ showName: {
725
+ type: Boolean,
726
+ default: !0
727
+ },
728
+ showSave: {
729
+ type: Boolean,
730
+ default: !0
731
+ },
732
+ showSchedule: {
733
+ type: Boolean,
734
+ default: !0
735
+ },
736
+ allowManualDelivery: {
737
+ type: Boolean,
738
+ default: !0
739
+ },
740
+ setFormValue: {
741
+ type: Function,
742
+ required: !0
743
+ },
744
+ removeFormValue: {
745
+ type: Function,
746
+ required: !0
747
+ },
748
+ useScroll: {
749
+ type: Boolean,
750
+ default: !1
751
+ },
752
+ onSaveDocument: {
753
+ type: Function,
754
+ required: !0
755
+ }
756
+ },
757
+ data() {
758
+ return {
759
+ localIsPosting: !1,
760
+ clientHoverIndex: null
761
+ };
762
+ },
763
+ computed: {
764
+ ...f({
765
+ deliveryTypes: "forms/deliveryTypes",
766
+ isPostingDocument: "documents2/isPosting",
767
+ documentSenderSign: "settings/documentSenderSign",
768
+ // todo: could be moved to load form action
769
+ getCompanySetting: "settings/getCompanySetting",
770
+ feature: "application/feature"
771
+ }),
772
+ isPosting() {
773
+ return this.isPostingDocument || this.localIsPosting;
774
+ },
775
+ isPublicForm() {
776
+ return !!(this.viewSettings && this.viewSettings.isPublicForm);
777
+ },
778
+ useSignOrder() {
779
+ var t;
780
+ return ((t = this._document) == null ? void 0 : t.useSignOrder) || !1;
781
+ },
782
+ noOfReminders() {
783
+ return Object.values(this.reminders || []).reduce((t, e) => e && (e.sendDays || e.sendAt) && e.type !== "first" ? t + 1 : t, 0);
784
+ },
785
+ smsActivated() {
786
+ return this.deliveryTypes.sms;
787
+ },
788
+ emailActivated() {
789
+ return this.deliveryTypes.email;
790
+ },
791
+ isManualDelivery() {
792
+ return !this.smsActivated && !this.emailActivated;
793
+ },
794
+ sendTypesText() {
795
+ return this.emailActivated || this.smsActivated ? [
796
+ ...this.emailActivated ? [this.$t("_common:email").capitalize()] : [],
797
+ ...this.smsActivated ? [this.$t("_common:sms")] : []
798
+ ].join(" & ") : this._document.isDirty("isManualDelivery") && this.clients.length ? this.$t("manualDelivery") : " ";
799
+ },
800
+ clientsAreMissingContactInfo() {
801
+ return this.isManualDelivery ? !1 : this.clients.some((t) => !(t.email || t.cellphone));
802
+ },
803
+ signMethods() {
804
+ return [
805
+ ...this.feature("bankId") ? [{
806
+ value: "bankId",
807
+ title: this.$t("signMethod.bankId.title"),
808
+ content: this.$t("signMethod.bankId.content")
809
+ }] : [],
810
+ {
811
+ value: "signature",
812
+ title: this.$t("signMethod.signature.title"),
813
+ content: this.$t("signMethod.signature.content")
814
+ }
815
+ ];
816
+ }
817
+ },
818
+ created() {
819
+ var t;
820
+ if (!this.expiresAt && !this._document.isDirty("expiresAt")) {
821
+ const e = this.getCompanySetting("defaultExpireDays");
822
+ if (e && Number.isInteger(e) && e > 0) {
823
+ const i = /* @__PURE__ */ new Date();
824
+ i.setDate(i.getDate() + e), this.setField({
825
+ field: "expiresAt",
826
+ value: i.toISOString(),
827
+ options: { ignoreChanges: !0 }
828
+ });
829
+ }
830
+ }
831
+ ((t = this.defaultAnswerMethod) == null ? void 0 : t.accept) === "button" && this.setAnswerMethod("signature", { ignoreChanges: !0 });
832
+ },
833
+ validations() {
834
+ const t = {
835
+ clients: {
836
+ required: (e) => e && e.length
837
+ }
838
+ };
839
+ return !this.allowManualDelivery && this.clients.length && (t.isManualDelivery = {
840
+ checked: (e) => !e
841
+ }), t;
842
+ },
843
+ methods: {
844
+ async doSaveDocument({ doSend: t }) {
845
+ try {
846
+ this.localIsPosting = !0, await this.onSaveDocument({ doSend: t });
847
+ } catch (e) {
848
+ throw e;
849
+ } finally {
850
+ this.localIsPosting = !1;
851
+ }
852
+ },
853
+ async doSendDocument() {
854
+ var t;
855
+ this.$v.$touch(), !this.$v.$invalid && (["denied", "expired", "voided"].includes((t = this._document) == null ? void 0 : t.status) && this.resetDeniedDocument(), await this.doSaveDocument({ doSend: !0 }));
856
+ },
857
+ setDeliveryMethod(t, e) {
858
+ const i = this.deliveryTypes;
859
+ i[t] = e;
860
+ const s = Object.keys(i).filter((n) => i[n]);
861
+ (this.clients || []).forEach((n, a) => {
862
+ this.setFormValue({ key: `clients[${a}].deliveryTypes`, value: s });
863
+ });
864
+ },
865
+ setAnswerMethod(t, e = {}) {
866
+ this.setField({
867
+ field: "defaultAnswerMethod",
868
+ value: { ...this.defaultAnswerMethod, accept: t },
869
+ options: e
870
+ }), (this.clients || []).forEach((i, s) => {
871
+ var n;
872
+ ((n = i.answerMethod) == null ? void 0 : n.accept) !== "inPerson" && this.setField({
873
+ key: `clients[${s}].answerMethod.accept`,
874
+ value: t,
875
+ options: e
876
+ });
877
+ });
878
+ },
879
+ openReminders() {
880
+ this.useSignOrder || this.$modal.show(
881
+ ue,
882
+ {
883
+ _document: this._document,
884
+ setFormValue: this.setFormValue,
885
+ removeFormValue: this.removeFormValue
886
+ },
887
+ {
888
+ adaptive: !0,
889
+ height: "auto",
890
+ width: "90%",
891
+ maxWidth: 360
892
+ }
893
+ );
894
+ },
895
+ openSendLater() {
896
+ this.$v.$touch(), !this.$v.$invalid && this.$modal.show(
897
+ ge,
898
+ {
899
+ _document: this._document,
900
+ setFormValue: this.setFormValue,
901
+ removeFormValue: this.removeFormValue,
902
+ onSaveDocument: this.doSaveDocument
903
+ },
904
+ {
905
+ adaptive: !0,
906
+ height: "auto",
907
+ width: "90%",
908
+ maxWidth: 360
909
+ }
910
+ );
911
+ },
912
+ resetDeniedDocument() {
913
+ (this.clients || []).forEach((t, e) => {
914
+ this.setFormValue({ key: `clients[${e}].answer`, value: null });
915
+ }), this.setFormValue({ key: "data.rejectReasons", value: [] }), this.setFormValue({ key: "status", value: "sent" });
916
+ }
917
+ }
918
+ };
919
+ var Te = function() {
920
+ var s;
921
+ var e = this, i = e._self._c;
922
+ return i("div", { staticClass: "flex flex-col h-full @container" }, [i(e.useScroll ? "Simplebar" : "div", { tag: "component", staticClass: "main-container" }, [i("div", { staticClass: "relative pt-6 px-4 pb-4 @md:px-8 @md:pb-8 @xl:px-16 @xl:pb-16" }, [i("div", { staticClass: "pb-4 text-lg font-bold" }, [e._v(" " + e._s(e.$t("title")) + " ")]), e.showName ? i("div", { staticClass: "mb-6" }, [i("div", { staticClass: "text-gray-900 text-xs font-medium pb-0.5" }, [e._v(" " + e._s(e.$t("nameLabel")) + " ")]), i("CInput", { attrs: { placeholder: e.$t("namePlaceholder"), filled: "" }, model: { value: e.name, callback: function(n) {
923
+ e.name = n;
924
+ }, expression: "name" } })], 1) : e._e(), i("div", { staticClass: "mb-6" }, [i("RecipientBlock", { attrs: { _value: {
925
+ clients: "clients"
926
+ }, _document: e._document, "set-form-value": e.setFormValue, "remove-form-value": e.removeFormValue, "default-add-sender-client": e.documentSenderSign, "is-public-form": e.isPublicForm } })], 1), e._t("default"), e.defaultAnswerMethod && e.signMethods.length > 1 ? i("div", { staticClass: "mb-8" }, [i("div", { staticClass: "block-title text-gray-900 text-xs font-medium pb-0.5" }, [e._v(" " + e._s(e.$t("signMethod.title")) + " "), i("BaseIcon", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: e.$t("signMethod.tooltip"), expression: "$t('signMethod.tooltip')" }], staticClass: "ml-px text-gray-500", attrs: { type: "info", size: "14" } })], 1), i("div", { staticClass: "cb-card-group" }, e._l(e.signMethods, function(n) {
927
+ return i("div", { key: n.value, staticClass: "flex border-2 border-transparent hover:bg-gray-200 hover:border-gray-300/30 cb-card", class: { checked: e.defaultAnswerMethod.accept === n.value }, on: { click: function(a) {
928
+ e.defaultAnswerMethod.accept !== n.value && e.setAnswerMethod(n.value);
929
+ } } }, [i("CRadio", { staticClass: "mr-3 pointer-events-none sign-radio", attrs: { value: e.defaultAnswerMethod.accept, "native-value": n.value, type: "secondary", size: "small" } }), i("div", { staticClass: "flex-grow" }, [i("div", { staticClass: "cb-card-title" }, [e._v(e._s(n.title))]), i("div", { directives: [{ name: "show", rawName: "v-show", value: e.defaultAnswerMethod.accept === n.value, expression: "defaultAnswerMethod.accept === signMethod.value" }], staticClass: "cb-card-body" }, [e._v(" " + e._s(n.content) + " ")])])], 1);
930
+ }), 0)]) : e._e(), i("div", { staticClass: "grid items-center gap-2", staticStyle: { "grid-template-columns": "repeat(auto-fit, minmax(200px, 1fr))" } }, [i("div", [i("BaseDatePicker", { staticClass: "relative psuedo-input", attrs: { "custom-el": !0, direction: "end", tabindex: "0" }, model: { value: e.expiresAt, callback: function(n) {
931
+ e.expiresAt = n;
932
+ }, expression: "expiresAt" } }, [i("div", { staticClass: "psuedo-input-label" }, [e._v(e._s(e.$t("validityPeriod")))]), i("div", [e._v(e._s(e.expiresAt ? e.$formatDate(e.expiresAt) : e.$t("_common:disabled").capitalize()))]), e.expiresAt ? i("CButton", { staticClass: "absolute right-3 top-3", attrs: { icon: "x", size: "small", type: "none", pattern: "secondary" }, on: { click: function(n) {
933
+ n.preventDefault(), n.stopPropagation(), e.expiresAt = void 0, e._document.setDirty("expiresAt");
934
+ } } }) : e._e()], 1)], 1), i("CDropdown", { staticStyle: { flex: "1 0 200px" }, attrs: { disabled: !e.clients.length, "mobile-label": e.$t("sendAs"), expanded: "" } }, [i("div", { staticClass: "psuedo-input", attrs: { slot: "trigger", tabindex: "0" }, slot: "trigger" }, [i("div", { staticClass: "psuedo-input-label" }, [e._v(e._s(e.$t("sendAs")))]), i("div", { domProps: { innerHTML: e._s(e.sendTypesText) } })]), i("CDropdownItem", { attrs: { value: e.emailActivated, "close-on-click": !1, toggle: "" }, on: { click: function(n) {
935
+ return e.setDeliveryMethod("email", !e.emailActivated);
936
+ } } }, [e._v(" " + e._s(e.$t("_common:email").capitalize()) + " ")]), e.feature("sms") ? i("CDropdownItem", { attrs: { value: e.smsActivated, "close-on-click": !1, toggle: "" }, on: { click: function(n) {
937
+ return e.setDeliveryMethod("sms", !e.smsActivated);
938
+ } } }, [e._v(" " + e._s(e.$t("_common:sms")) + " ")]) : e._e(), e.allowManualDelivery ? i("CDropdownItem", { attrs: { value: "", tooltip: {
939
+ content: e.$t("manualDeliveryTooltip")
940
+ } }, domProps: { textContent: e._s(e.$t("manualDelivery")) }, on: { click: () => {
941
+ e.setDeliveryMethod("sms", !1), e.setDeliveryMethod("email", !1), e._document.setDirty("isManualDelivery");
942
+ } } }) : e._e()], 1), !e.useSignOrder && !e.isManualDelivery ? i("div", { staticClass: "relative psuedo-input", attrs: { tabindex: "0" }, on: { click: e.openReminders } }, [i("div", { staticClass: "psuedo-input-label" }, [e._v(e._s(e.$t("_common:reminder_plural").capitalize()))]), i("div", [e._v(" " + e._s(e.noOfReminders ? `${e.noOfReminders} ${e.$i18n.lang === "sv" ? e.$t("_common:unitType.unit") : ""}` : e.$t("_common:disabled").capitalize()) + " ")]), e.noOfReminders ? i("CButton", { staticClass: "absolute right-3 top-3", attrs: { icon: "x", size: "small", type: "none", pattern: "secondary" }, on: { click: function(n) {
943
+ n.preventDefault(), n.stopPropagation(), e.reminders = [];
944
+ } } }) : e._e()], 1) : e._e()], 1), e.clientsAreMissingContactInfo || (s = e.$v.isManualDelivery) != null && s.$invalid ? i("ErrorCallout", { attrs: { message: e.clientsAreMissingContactInfo ? e.$t("clientsAreMissingContactInfo") : e.$t("missingDeliveryMethod"), size: "small" } }) : e._e(), e._t("content")], 2)]), i("div", { staticClass: "px-4 pb-4 @md:px-8 @xl:px-16" }, [e._t("send", function() {
945
+ return [i("div", { staticClass: "flex" }, [e.showSave ? i("CButton", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: e.$t("_common:save", { thing: e.$t("_common:document").toLowerCase() }), expression: "$t('_common:save', { thing: $t('_common:document').toLowerCase() })" }], staticClass: "w-12 mr-2", attrs: { loading: e.isPosting, type: "none", icon: "save", pattern: "secondary" }, on: { click: function(n) {
946
+ return e.doSaveDocument({ doSend: !1 });
947
+ } } }) : e._e(), e.showSchedule && !e.useSignOrder && !e.isManualDelivery ? i("CButton", { staticClass: "mr-2 w-12 @md:w-auto", staticStyle: { padding: "14px 16px", "border-radius": "8px", height: "initial", "font-size": "14px", "font-weight": "600" }, attrs: { disabled: e.isPosting || !e.clients.length, type: "none", pattern: "secondary" }, on: { click: e.openSendLater } }, [i("span", { staticClass: "!hidden @md:!block", domProps: { textContent: e._s(e.$t("scheduledTooltip")) } }), i("BaseIcon", { staticClass: "@md:!hidden", attrs: { type: "calendar", size: "16" } })], 1) : e._e(), i("div", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: e.$v.$invalid ? {
948
+ content: e.clients.length ? e.$t("missingDeliveryMethod") : e.$t(
949
+ "components:account.documentForm.clients.errorMessage"
950
+ )
951
+ } : {}, expression: `
952
+ $v.$invalid
953
+ ? {
954
+ content: !clients.length
955
+ ? $t(
956
+ 'components:account.documentForm.clients.errorMessage'
957
+ )
958
+ : $t('missingDeliveryMethod')
959
+ }
960
+ : {}
961
+ ` }], staticClass: "flex-auto" }, [i("CButton", { staticStyle: { padding: "14px 16px", "border-radius": "8px", height: "100%", "font-size": "14px", "font-weight": "600", "box-shadow": "0 2px 4px -1px rgba(0,0,0,0.1)" }, attrs: { disabled: e.$v.$invalid, loading: e.isPosting, type: "secondary", wide: "" }, on: { click: function(n) {
962
+ return e.doSendDocument();
963
+ } } }, [e._v(" " + e._s(e.$t("sendButton")) + " ")])], 1)], 1)];
964
+ }), e._t("footer")], 2)], 1);
965
+ }, Pe = [], Re = /* @__PURE__ */ r(
966
+ Ie,
967
+ Te,
968
+ Pe,
969
+ !1,
970
+ null,
971
+ "d9f1ecda",
972
+ null,
973
+ null
974
+ );
975
+ const li = Re.exports, Me = {
976
+ name: "CFormField",
977
+ components: {
978
+ CField: z
979
+ },
980
+ extends: Q,
981
+ computed: {
982
+ type() {
983
+ return this.hasErrors ? "is-danger" : this.isValid ? "is-success" : null;
984
+ },
985
+ customClass() {
986
+ return this.hasErrors ? "text-red-500" : this.isValid ? "text-green-500" : null;
987
+ }
988
+ }
989
+ };
990
+ var ze = function() {
991
+ var e = this, i = e._self._c;
992
+ return i("CField", e._b({ attrs: { label: e.label, "custom-class": e.customClass, type: e.type, message: e.firstErrorMessage } }, "CField", { ...e.$attrs, ...e.$props }, !1), [e._t("default")], 2);
993
+ }, Ne = [], Ee = /* @__PURE__ */ r(
994
+ Me,
995
+ ze,
996
+ Ne,
997
+ !1,
998
+ null,
999
+ null,
1000
+ null,
1001
+ null
1002
+ );
1003
+ const Le = Ee.exports, He = {
1004
+ name: "CSkeleton",
1005
+ functional: !0,
1006
+ props: {
1007
+ active: {
1008
+ type: Boolean,
1009
+ default: !0
1010
+ },
1011
+ animated: {
1012
+ type: Boolean,
1013
+ default: !1
1014
+ },
1015
+ width: [Number, String],
1016
+ height: [Number, String],
1017
+ circle: Boolean,
1018
+ rounded: {
1019
+ type: Boolean,
1020
+ default: !0
1021
+ },
1022
+ count: {
1023
+ type: Number,
1024
+ default: 1
1025
+ },
1026
+ hidden: {
1027
+ type: [Boolean, String],
1028
+ default: !1
1029
+ },
1030
+ color: {
1031
+ type: String,
1032
+ default: null
1033
+ }
1034
+ },
1035
+ render(t, e) {
1036
+ if (!e.props.active)
1037
+ return;
1038
+ const i = [], s = e.props.width, n = e.props.height;
1039
+ for (let a = 0; a < e.props.count; a++)
1040
+ i.push(t("div", {
1041
+ staticClass: "c-skeleton-item",
1042
+ class: { "is-rounded": e.props.rounded },
1043
+ key: a,
1044
+ style: {
1045
+ height: n === void 0 ? null : isNaN(n) ? n : n + "px",
1046
+ width: s === void 0 ? null : isNaN(s) ? s : s + "px",
1047
+ borderRadius: e.props.circle ? "50%" : null,
1048
+ background: e.props.color ? e.props.color : null
1049
+ }
1050
+ }));
1051
+ return t(
1052
+ "div",
1053
+ {
1054
+ staticStyle: e.data.staticStyle,
1055
+ staticClass: "c-skeleton",
1056
+ class: [e.data.staticClass, {
1057
+ "is-animated": e.props.animated,
1058
+ "is-invisible": e.props.hidden
1059
+ }]
1060
+ },
1061
+ i
1062
+ );
1063
+ }
1064
+ }, qe = null, je = null;
1065
+ var Ke = /* @__PURE__ */ r(
1066
+ He,
1067
+ qe,
1068
+ je,
1069
+ !1,
1070
+ null,
1071
+ null,
1072
+ null,
1073
+ null
1074
+ );
1075
+ const w = Ke.exports, We = {
1076
+ name: "CAutocomplete",
1077
+ components: {
1078
+ CInput: T
1079
+ },
1080
+ mixins: [P],
1081
+ inheritAttrs: !1,
1082
+ props: {
1083
+ value: [Number, String],
1084
+ data: {
1085
+ type: Array,
1086
+ default: () => []
1087
+ },
1088
+ field: {
1089
+ type: String,
1090
+ default: "value"
1091
+ },
1092
+ keepFirst: Boolean,
1093
+ clearOnSelect: Boolean,
1094
+ openOnFocus: Boolean,
1095
+ customFormatter: Function,
1096
+ checkInfiniteScroll: Boolean,
1097
+ keepOpen: Boolean,
1098
+ clearable: Boolean,
1099
+ maxHeight: [String, Number],
1100
+ dropdownPosition: {
1101
+ type: String,
1102
+ default: "auto"
1103
+ },
1104
+ iconRight: String,
1105
+ iconRightClickable: Boolean,
1106
+ appendToBody: Boolean
1107
+ },
1108
+ data() {
1109
+ return {
1110
+ selected: null,
1111
+ hovered: null,
1112
+ isActive: !1,
1113
+ newValue: this.value,
1114
+ newAutocomplete: this.autocomplete || "off",
1115
+ isListInViewportVertically: !0,
1116
+ hasFocus: !1,
1117
+ style: {},
1118
+ _isAutocomplete: !0,
1119
+ _elementRef: "input",
1120
+ _bodyEl: void 0
1121
+ // Used to append to body
1122
+ };
1123
+ },
1124
+ computed: {
1125
+ /**
1126
+ * White-listed items to not close when clicked.
1127
+ * Add input, dropdown and all children.
1128
+ */
1129
+ whiteList() {
1130
+ const t = [];
1131
+ if (t.push(this.$refs.input.$el.querySelector("input")), t.push(this.$refs.dropdown), this.$refs.dropdown !== void 0) {
1132
+ const e = this.$refs.dropdown.querySelectorAll("*");
1133
+ for (const i of e)
1134
+ t.push(i);
1135
+ }
1136
+ if (this.$parent.$data._isTaginput) {
1137
+ t.push(this.$parent.$el);
1138
+ const e = this.$parent.$el.querySelectorAll("*");
1139
+ for (const i of e)
1140
+ t.push(i);
1141
+ }
1142
+ return t;
1143
+ },
1144
+ /**
1145
+ * Check if exists default slot
1146
+ */
1147
+ hasDefaultSlot() {
1148
+ return !!this.$scopedSlots.default;
1149
+ },
1150
+ /**
1151
+ * Check if exists "empty" slot
1152
+ */
1153
+ hasEmptySlot() {
1154
+ return !!this.$slots.empty;
1155
+ },
1156
+ /**
1157
+ * Check if exists "header" slot
1158
+ */
1159
+ hasHeaderSlot() {
1160
+ return !!this.$slots.header;
1161
+ },
1162
+ /**
1163
+ * Check if exists "footer" slot
1164
+ */
1165
+ hasFooterSlot() {
1166
+ return !!this.$slots.footer;
1167
+ },
1168
+ /**
1169
+ * Apply dropdownPosition property
1170
+ */
1171
+ isOpenedTop() {
1172
+ return this.dropdownPosition === "top" || this.dropdownPosition === "auto" && !this.isListInViewportVertically;
1173
+ },
1174
+ newIconRight() {
1175
+ return this.clearable && this.newValue ? "close-circle" : this.iconRight;
1176
+ },
1177
+ newIconRightClickable() {
1178
+ return this.clearable ? !0 : this.iconRightClickable;
1179
+ },
1180
+ contentStyle() {
1181
+ return {
1182
+ maxHeight: this.maxHeight === void 0 ? null : isNaN(this.maxHeight) ? this.maxHeight : `${this.maxHeight}px`
1183
+ };
1184
+ },
1185
+ isDropdownOpen() {
1186
+ return this.isActive && (this.data.length > 0 || this.hasEmptySlot || this.hasHeaderSlot);
1187
+ }
1188
+ },
1189
+ watch: {
1190
+ /**
1191
+ * When dropdown is toggled, check the visibility to know when
1192
+ * to open upwards.
1193
+ */
1194
+ isActive(t) {
1195
+ this.dropdownPosition === "auto" && (t ? this.calcDropdownInViewportVertical() : setTimeout(() => {
1196
+ this.calcDropdownInViewportVertical();
1197
+ }, 100)), t && this.$nextTick(() => this.setHovered(null));
1198
+ },
1199
+ /**
1200
+ * When updating input's value
1201
+ * 1. Emit changes
1202
+ * 2. If value isn't the same as selected, set null
1203
+ * 3. Close dropdown if value is clear or else open it
1204
+ */
1205
+ newValue(t) {
1206
+ this.$emit("input", t);
1207
+ const e = this.getValue(this.selected);
1208
+ e && e !== t && this.setSelected(null, !1), this.hasFocus && (!this.openOnFocus || t) && (this.isActive = !!t);
1209
+ },
1210
+ /**
1211
+ * When v-model is changed:
1212
+ * 1. Update internal value.
1213
+ * 2. If it's invalid, validate again.
1214
+ */
1215
+ value(t) {
1216
+ this.newValue = t;
1217
+ },
1218
+ /**
1219
+ * Select first option if "keep-first
1220
+ */
1221
+ data(t) {
1222
+ this.keepFirst && this.selectFirstOption(t);
1223
+ }
1224
+ },
1225
+ created() {
1226
+ typeof window < "u" && (document.addEventListener("click", this.clickedOutside), this.dropdownPosition === "auto" && window.addEventListener("resize", this.calcDropdownInViewportVertical));
1227
+ },
1228
+ mounted() {
1229
+ if (this.checkInfiniteScroll && this.$refs.dropdown && this.$refs.dropdown.querySelector(".dropdown-content")) {
1230
+ const t = this.$refs.dropdown.querySelector(".dropdown-content");
1231
+ t.addEventListener("scroll", () => this.checkIfReachedTheEndOfScroll(t));
1232
+ }
1233
+ this.appendToBody && (this.$data._bodyEl = J(this.$refs.dropdown), this.updateAppendToBody());
1234
+ },
1235
+ beforeDestroy() {
1236
+ typeof window < "u" && (document.removeEventListener("click", this.clickedOutside), this.dropdownPosition === "auto" && window.removeEventListener("resize", this.calcDropdownInViewportVertical)), this.checkInfiniteScroll && this.$refs.dropdown && this.$refs.dropdown.querySelector(".dropdown-content") && this.$refs.dropdown.querySelector(".dropdown-content").removeEventListener("scroll", this.checkIfReachedTheEndOfScroll), this.appendToBody && Z(this.$data._bodyEl);
1237
+ },
1238
+ methods: {
1239
+ /**
1240
+ * Set which option is currently hovered.
1241
+ */
1242
+ setHovered(t) {
1243
+ t !== void 0 && (this.hovered = t);
1244
+ },
1245
+ /**
1246
+ * Set which option is currently selected, update v-model,
1247
+ * update input value and close dropdown.
1248
+ */
1249
+ setSelected(t, e = !0) {
1250
+ t !== void 0 && (this.selected = t, this.$emit("select", this.selected), this.selected !== null && (this.newValue = this.clearOnSelect ? "" : this.getValue(this.selected), this.setHovered(this.clearOnSelect ? null : this.hovered)), e && this.$nextTick(() => {
1251
+ this.isActive = !1;
1252
+ }), this.checkValidity());
1253
+ },
1254
+ /**
1255
+ * Select first option
1256
+ */
1257
+ selectFirstOption(t) {
1258
+ this.$nextTick(() => {
1259
+ t.length ? (this.openOnFocus || this.newValue !== "" && this.hovered !== t[0]) && this.setHovered(t[0]) : this.setHovered(null);
1260
+ });
1261
+ },
1262
+ /**
1263
+ * Enter key listener.
1264
+ * Select the hovered option.
1265
+ */
1266
+ enterPressed(t) {
1267
+ this.isDropdownOpen && (t.preventDefault(), this.hovered !== null && this.setSelected(this.hovered, !this.keepOpen));
1268
+ },
1269
+ /**
1270
+ * Tab key listener.
1271
+ * Select hovered option if it exists, close dropdown, then allow
1272
+ * native handling to move to next tabbable element.
1273
+ */
1274
+ tabPressed() {
1275
+ if (this.hovered === null) {
1276
+ this.isActive = !1;
1277
+ return;
1278
+ }
1279
+ this.setSelected(this.hovered, !this.keepOpen);
1280
+ },
1281
+ /**
1282
+ * Close dropdown if clicked outside.
1283
+ */
1284
+ clickedOutside(t) {
1285
+ var i;
1286
+ const e = ((i = t.path) == null ? void 0 : i[0]) || t.target;
1287
+ this.whiteList.indexOf(e) < 0 && (this.isActive = !1);
1288
+ },
1289
+ /**
1290
+ * Return display text for the input.
1291
+ * If object, get value from path, or else just the value.
1292
+ */
1293
+ getValue(t) {
1294
+ if (t !== null)
1295
+ return typeof this.customFormatter < "u" ? this.customFormatter(t) : typeof t == "object" ? ee(t, this.field) : t;
1296
+ },
1297
+ /**
1298
+ * Check if the scroll list inside the dropdown
1299
+ * reached it's end.
1300
+ */
1301
+ checkIfReachedTheEndOfScroll(t) {
1302
+ t.clientHeight !== t.scrollHeight && t.scrollTop + t.clientHeight >= t.scrollHeight && this.$emit("infinite-scroll");
1303
+ },
1304
+ /**
1305
+ * Calculate if the dropdown is vertically visible when activated,
1306
+ * otherwise it is openened upwards.
1307
+ */
1308
+ calcDropdownInViewportVertical() {
1309
+ this.$nextTick(() => {
1310
+ if (this.$refs.dropdown === void 0)
1311
+ return;
1312
+ const t = this.$refs.dropdown.getBoundingClientRect();
1313
+ this.isListInViewportVertically = t.top >= 0 && t.bottom <= (window.innerHeight || document.documentElement.clientHeight), this.appendToBody && this.updateAppendToBody();
1314
+ });
1315
+ },
1316
+ /**
1317
+ * Arrows keys listener.
1318
+ * If dropdown is active, set hovered option, or else just open.
1319
+ */
1320
+ keyArrows(t) {
1321
+ const e = t === "down" ? 1 : -1;
1322
+ if (this.isActive) {
1323
+ let i = this.data.indexOf(this.hovered) + e;
1324
+ i = i > this.data.length - 1 ? this.data.length : i, i = i < 0 ? 0 : i, this.setHovered(this.data[i]);
1325
+ const s = this.$refs.dropdown.querySelector(".dropdown-content"), n = s.querySelectorAll("a.dropdown-item:not(.is-disabled)")[i];
1326
+ if (!n)
1327
+ return;
1328
+ const a = s.scrollTop, l = s.scrollTop + s.clientHeight - n.clientHeight;
1329
+ n.offsetTop < a ? s.scrollTop = n.offsetTop : n.offsetTop >= l && (s.scrollTop = n.offsetTop - s.clientHeight + n.clientHeight);
1330
+ } else
1331
+ this.isActive = !0;
1332
+ },
1333
+ /**
1334
+ * Focus listener.
1335
+ * If value is the same as selected, select all text.
1336
+ */
1337
+ focused(t) {
1338
+ this.getValue(this.selected) === this.newValue && this.$el.querySelector("input").select(), this.openOnFocus && (this.isActive = !0, this.keepFirst && this.selectFirstOption(this.data)), this.hasFocus = !0, this.$emit("focus", t);
1339
+ },
1340
+ /**
1341
+ * Blur listener.
1342
+ */
1343
+ onBlur(t) {
1344
+ this.hasFocus = !1, this.$emit("blur", t);
1345
+ },
1346
+ onInput(t) {
1347
+ const e = this.getValue(this.selected);
1348
+ e && e === this.newValue || (this.$emit("typing", this.newValue), this.checkValidity());
1349
+ },
1350
+ rightIconClick(t) {
1351
+ this.clearable ? this.newValue = "" : this.$emit("icon-right-click", t);
1352
+ },
1353
+ checkValidity() {
1354
+ this.useHtml5Validation && this.$nextTick(() => {
1355
+ this.checkHtml5Validity();
1356
+ });
1357
+ },
1358
+ updateAppendToBody() {
1359
+ const t = this.$refs.dropdown, e = this.$refs.input.$el;
1360
+ if (t && e) {
1361
+ const i = this.$data._bodyEl;
1362
+ i.classList.forEach((l) => i.classList.remove(l)), i.classList.add("autocomplete"), i.classList.add("control"), this.expandend && i.classList.add("is-expandend");
1363
+ const s = e.getBoundingClientRect();
1364
+ let n = s.top + window.scrollY;
1365
+ const a = s.left + window.scrollX;
1366
+ this.isOpenedTop ? n -= t.clientHeight : n += e.clientHeight, this.style = {
1367
+ position: "absolute",
1368
+ top: `${n}px`,
1369
+ left: `${a}px`,
1370
+ width: `${e.clientWidth}px`,
1371
+ maxWidth: `${e.clientWidth}px`,
1372
+ zIndex: "99"
1373
+ };
1374
+ }
1375
+ }
1376
+ }
1377
+ };
1378
+ var Xe = function() {
1379
+ var e = this, i = e._self._c;
1380
+ return i("div", { staticClass: "autocomplete control", class: { "is-expanded": e.expanded } }, [i("CInput", e._b({ ref: "input", attrs: { size: e.size, loading: e.loading, rounded: e.rounded, icon: e.icon, "icon-right": e.newIconRight, "icon-right-clickable": e.newIconRightClickable, "icon-pack": e.iconPack, maxlength: e.maxlength, autocomplete: e.newAutocomplete, "use-html5-validation": !1, type: "text" }, on: { input: e.onInput, focus: e.focused, blur: e.onBlur, "icon-right-click": e.rightIconClick, "icon-click": (s) => e.$emit("icon-click", s) }, nativeOn: { keyup: function(s) {
1381
+ if (!s.type.indexOf("key") && e._k(s.keyCode, "esc", 27, s.key, ["Esc", "Escape"]))
1382
+ return null;
1383
+ s.preventDefault(), e.isActive = !1;
1384
+ }, keydown: [function(s) {
1385
+ return !s.type.indexOf("key") && e._k(s.keyCode, "tab", 9, s.key, "Tab") ? null : e.tabPressed.apply(null, arguments);
1386
+ }, function(s) {
1387
+ return !s.type.indexOf("key") && e._k(s.keyCode, "enter", 13, s.key, "Enter") ? null : e.enterPressed.apply(null, arguments);
1388
+ }, function(s) {
1389
+ return !s.type.indexOf("key") && e._k(s.keyCode, "up", 38, s.key, ["Up", "ArrowUp"]) ? null : (s.preventDefault(), e.keyArrows("up"));
1390
+ }, function(s) {
1391
+ return !s.type.indexOf("key") && e._k(s.keyCode, "down", 40, s.key, ["Down", "ArrowDown"]) ? null : (s.preventDefault(), e.keyArrows("down"));
1392
+ }] }, model: { value: e.newValue, callback: function(s) {
1393
+ e.newValue = s;
1394
+ }, expression: "newValue" } }, "CInput", e.$attrs, !1)), i("transition", { attrs: { name: "fade" } }, [i("div", { directives: [{ name: "show", rawName: "v-show", value: e.isDropdownOpen, expression: "isDropdownOpen" }], ref: "dropdown", staticClass: "dropdown-menu", class: { "is-opened-top": e.isOpenedTop && !e.appendToBody }, style: e.style }, [i("div", { directives: [{ name: "show", rawName: "v-show", value: e.isActive, expression: "isActive" }], staticClass: "dropdown-content", style: e.contentStyle }, [e.hasHeaderSlot ? i("div", { staticClass: "dropdown-item" }, [e._t("header")], 2) : e._e(), e._l(e.data, function(s, n) {
1395
+ return i("a", { key: n, staticClass: "dropdown-item", class: { "is-hovered": s === e.hovered }, on: { click: function(a) {
1396
+ return e.setSelected(s, void 0, a);
1397
+ } } }, [e.hasDefaultSlot ? e._t("default", null, { option: s, index: n }) : i("span", [e._v(" " + e._s(e.getValue(s, !0)) + " ")])], 2);
1398
+ }), e.data.length === 0 && e.hasEmptySlot ? i("div", { staticClass: "dropdown-item is-disabled" }, [e._t("empty")], 2) : e._e(), e.hasFooterSlot ? i("div", { staticClass: "dropdown-item" }, [e._t("footer")], 2) : e._e()], 2)])])], 1);
1399
+ }, Ue = [], Qe = /* @__PURE__ */ r(
1400
+ We,
1401
+ Xe,
1402
+ Ue,
1403
+ !1,
1404
+ null,
1405
+ null,
1406
+ null,
1407
+ null
1408
+ );
1409
+ const Ye = Qe.exports, Ge = {
1410
+ name: "CRadio",
1411
+ mixins: [R]
1412
+ };
1413
+ var Je = function() {
1414
+ var e = this, i = e._self._c;
1415
+ return i("label", { ref: "label", staticClass: "b-radio radio", class: [`is-${e.size}`, { "is-disabled": e.disabled }], attrs: { disabled: e.disabled }, on: { click: e.focus, keydown: function(s) {
1416
+ return !s.type.indexOf("key") && e._k(s.keyCode, "enter", 13, s.key, "Enter") ? null : (s.preventDefault(), e.$refs.label.click());
1417
+ } } }, [i("input", { directives: [{ name: "model", rawName: "v-model", value: e.computedValue, expression: "computedValue" }], ref: "input", attrs: { disabled: e.disabled, required: e.required, name: e.name, type: "radio" }, domProps: { value: e.nativeValue, checked: e._q(e.computedValue, e.nativeValue) }, on: { click: function(s) {
1418
+ s.stopPropagation();
1419
+ }, change: function(s) {
1420
+ e.computedValue = e.nativeValue;
1421
+ } } }), i("span", { staticClass: "check", class: `is-${e.type}` }), i("span", { staticClass: "control-label" }, [e._t("default")], 2)]);
1422
+ }, Ze = [], et = /* @__PURE__ */ r(
1423
+ Ge,
1424
+ Je,
1425
+ Ze,
1426
+ !1,
1427
+ null,
1428
+ null,
1429
+ null,
1430
+ null
1431
+ );
1432
+ const x = et.exports, tt = {
1433
+ name: "CRadioButton",
1434
+ mixins: [R],
1435
+ components: {
1436
+ CButton: M
1437
+ },
1438
+ props: {
1439
+ type: {
1440
+ type: String,
1441
+ default: "primary"
1442
+ },
1443
+ expanded: Boolean
1444
+ },
1445
+ data() {
1446
+ return {
1447
+ isFocused: !1
1448
+ };
1449
+ }
1450
+ };
1451
+ var it = function() {
1452
+ var e = this, i = e._self._c;
1453
+ return i("div", { staticClass: "control", class: { "is-expanded": e.expanded } }, [i("CButton", { ref: "label", staticClass: "c-radio radio button", class: [
1454
+ { "is-disabled": e.disabled, "is-focused": e.isFocused }
1455
+ ], attrs: { tag: "label", type: e.newValue === e.nativeValue ? e.type : null, size: e.size, disabled: e.disabled }, on: { click: e.focus, keydown: function(s) {
1456
+ return !s.type.indexOf("key") && e._k(s.keyCode, "enter", 13, s.key, "Enter") ? null : (s.preventDefault(), e.$refs.$el.label.click());
1457
+ } } }, [e._t("default"), i("input", { directives: [{ name: "model", rawName: "v-model", value: e.computedValue, expression: "computedValue" }], ref: "input", attrs: { disabled: e.disabled, required: e.required, name: e.name, type: "radio" }, domProps: { value: e.nativeValue, checked: e._q(e.computedValue, e.nativeValue) }, on: { click: function(s) {
1458
+ s.stopPropagation();
1459
+ }, focus: function(s) {
1460
+ e.isFocused = !0;
1461
+ }, blur: function(s) {
1462
+ e.isFocused = !1;
1463
+ }, change: function(s) {
1464
+ e.computedValue = e.nativeValue;
1465
+ } } })], 2)], 1);
1466
+ }, st = [], nt = /* @__PURE__ */ r(
1467
+ tt,
1468
+ it,
1469
+ st,
1470
+ !1,
1471
+ null,
1472
+ null,
1473
+ null,
1474
+ null
1475
+ );
1476
+ const $ = nt.exports, at = {
1477
+ name: "CSelect",
1478
+ mixins: [P],
1479
+ inheritAttrs: !1,
1480
+ props: {
1481
+ value: {
1482
+ type: [String, Number, Boolean, Object, Array, Function],
1483
+ default: null
1484
+ },
1485
+ placeholder: String,
1486
+ multiple: Boolean,
1487
+ selectClass: [String, Object, Array],
1488
+ nativeSize: [String, Number]
1489
+ },
1490
+ data() {
1491
+ return {
1492
+ selected: this.value,
1493
+ _elementRef: "select"
1494
+ };
1495
+ },
1496
+ computed: {
1497
+ computedValue: {
1498
+ get() {
1499
+ return this.selected;
1500
+ },
1501
+ set(t) {
1502
+ this.selected = t, this.$emit("input", t), !this.isValid && this.checkHtml5Validity();
1503
+ }
1504
+ },
1505
+ spanClasses() {
1506
+ return [
1507
+ this.size,
1508
+ this.statusType,
1509
+ {
1510
+ "is-fullwidth": this.expanded,
1511
+ "is-loading": this.loading,
1512
+ "is-multiple": this.multiple,
1513
+ "is-rounded": this.rounded,
1514
+ "is-empty": this.selected === null
1515
+ }
1516
+ ];
1517
+ }
1518
+ },
1519
+ watch: {
1520
+ /**
1521
+ * When v-model is changed:
1522
+ * 1. Set the selected option.
1523
+ * 2. If it's invalid, validate again.
1524
+ */
1525
+ value(t) {
1526
+ this.selected = t, !this.isValid && this.checkHtml5Validity();
1527
+ }
1528
+ }
1529
+ };
1530
+ var rt = function() {
1531
+ var e = this, i = e._self._c;
1532
+ return i("div", { staticClass: "control", class: { "is-expanded": e.expanded, "has-icons-left": e.icon } }, [i("span", { staticClass: "select", class: e.spanClasses }, [i("select", e._b({ directives: [{ name: "model", rawName: "v-model", value: e.computedValue, expression: "computedValue" }], ref: "select", class: e.selectClass, attrs: { multiple: e.multiple, size: e.nativeSize }, on: { blur: function(s) {
1533
+ e.$emit("blur", s) && e.checkHtml5Validity();
1534
+ }, focus: function(s) {
1535
+ return e.$emit("focus", s);
1536
+ }, change: function(s) {
1537
+ var n = Array.prototype.filter.call(s.target.options, function(a) {
1538
+ return a.selected;
1539
+ }).map(function(a) {
1540
+ var l = "_value" in a ? a._value : a.value;
1541
+ return l;
1542
+ });
1543
+ e.computedValue = s.target.multiple ? n : n[0];
1544
+ } } }, "select", e.$attrs, !1), [e.placeholder && e.computedValue == null ? i("option", { attrs: { disabled: "", hidden: "" }, domProps: { value: null } }, [e._v(" " + e._s(e.placeholder) + " ")]) : e._e(), e._t("default")], 2)])]);
1545
+ }, ot = [], lt = /* @__PURE__ */ r(
1546
+ at,
1547
+ rt,
1548
+ ot,
1549
+ !1,
1550
+ null,
1551
+ "e419c29c",
1552
+ null,
1553
+ null
1554
+ );
1555
+ const S = lt.exports, dt = {
1556
+ name: "CSwitch",
1557
+ props: {
1558
+ value: [String, Number, Boolean, Function, Object, Array, Date],
1559
+ nativeValue: [String, Number, Boolean, Function, Object, Array, Date],
1560
+ disabled: Boolean,
1561
+ type: String,
1562
+ name: String,
1563
+ required: Boolean,
1564
+ size: {
1565
+ size: String,
1566
+ default: "default"
1567
+ },
1568
+ trueValue: {
1569
+ type: [String, Number, Boolean, Function, Object, Array, Date],
1570
+ default: !0
1571
+ },
1572
+ falseValue: {
1573
+ type: [String, Number, Boolean, Function, Object, Array, Date],
1574
+ default: !1
1575
+ },
1576
+ rounded: {
1577
+ type: Boolean,
1578
+ default: !0
1579
+ },
1580
+ outlined: {
1581
+ type: Boolean,
1582
+ default: !1
1583
+ }
1584
+ },
1585
+ data() {
1586
+ return {
1587
+ newValue: this.value
1588
+ };
1589
+ },
1590
+ computed: {
1591
+ computedValue: {
1592
+ get() {
1593
+ return this.newValue;
1594
+ },
1595
+ set(t) {
1596
+ this.newValue = t, this.$emit("input", t);
1597
+ }
1598
+ },
1599
+ newClass() {
1600
+ return [
1601
+ `is-${this.size}`,
1602
+ {
1603
+ "is-disabled": this.disabled,
1604
+ "is-rounded": this.rounded,
1605
+ "is-outlined": this.outlined
1606
+ }
1607
+ ];
1608
+ }
1609
+ },
1610
+ watch: {
1611
+ /**
1612
+ * When v-model change, set internal value.
1613
+ */
1614
+ value(t) {
1615
+ this.newValue = t;
1616
+ }
1617
+ },
1618
+ methods: {
1619
+ focus() {
1620
+ this.$refs.input.focus();
1621
+ }
1622
+ }
1623
+ };
1624
+ var ct = function() {
1625
+ var e = this, i = e._self._c;
1626
+ return i("label", { ref: "label", staticClass: "switch", class: e.newClass, attrs: { disabled: e.disabled }, on: { click: e.focus, keydown: function(s) {
1627
+ return !s.type.indexOf("key") && e._k(s.keyCode, "enter", 13, s.key, "Enter") ? null : (s.preventDefault(), e.$refs.label.click());
1628
+ } } }, [i("input", { directives: [{ name: "model", rawName: "v-model", value: e.computedValue, expression: "computedValue" }], ref: "input", attrs: { disabled: e.disabled, name: e.name, required: e.required, "true-value": e.trueValue, "false-value": e.falseValue, type: "checkbox" }, domProps: { value: e.nativeValue, checked: Array.isArray(e.computedValue) ? e._i(e.computedValue, e.nativeValue) > -1 : e._q(e.computedValue, e.trueValue) }, on: { click: function(s) {
1629
+ s.stopPropagation();
1630
+ }, change: function(s) {
1631
+ var n = e.computedValue, a = s.target, l = a.checked ? e.trueValue : e.falseValue;
1632
+ if (Array.isArray(n)) {
1633
+ var g = e.nativeValue, c = e._i(n, g);
1634
+ a.checked ? c < 0 && (e.computedValue = n.concat([g])) : c > -1 && (e.computedValue = n.slice(0, c).concat(n.slice(c + 1)));
1635
+ } else
1636
+ e.computedValue = l;
1637
+ } } }), i("span", { staticClass: "check", class: [`is-${e.type}`] }), i("span", { staticClass: "control-label" }, [e._t("default")], 2)]);
1638
+ }, ut = [], mt = /* @__PURE__ */ r(
1639
+ dt,
1640
+ ct,
1641
+ ut,
1642
+ !1,
1643
+ null,
1644
+ "de7880d0",
1645
+ null,
1646
+ null
1647
+ );
1648
+ const k = mt.exports, pt = {
1649
+ name: "CSlotComponent",
1650
+ props: {
1651
+ component: {
1652
+ type: Object,
1653
+ required: !0
1654
+ },
1655
+ name: {
1656
+ type: String,
1657
+ default: "default"
1658
+ },
1659
+ scoped: {
1660
+ type: Boolean
1661
+ },
1662
+ props: {
1663
+ type: Object
1664
+ },
1665
+ tag: {
1666
+ type: String,
1667
+ default: "div"
1668
+ },
1669
+ event: {
1670
+ type: String,
1671
+ default: "hook:updated"
1672
+ }
1673
+ },
1674
+ methods: {
1675
+ refresh() {
1676
+ this.$forceUpdate();
1677
+ },
1678
+ isVueComponent() {
1679
+ return this.component && this.component._isVue;
1680
+ }
1681
+ },
1682
+ created() {
1683
+ this.isVueComponent() && this.component.$on(this.event, this.refresh);
1684
+ },
1685
+ beforeDestroy() {
1686
+ this.isVueComponent() && this.component.$off(this.event, this.refresh);
1687
+ },
1688
+ // eslint-disable-next-line consistent-return
1689
+ render(t) {
1690
+ if (this.isVueComponent())
1691
+ return t(
1692
+ this.tag,
1693
+ {},
1694
+ this.scoped ? this.component.$scopedSlots[this.name](this.props) : this.component.$slots[this.name]
1695
+ );
1696
+ }
1697
+ }, ht = {
1698
+ name: "CTabs",
1699
+ components: {
1700
+ CSlotComponent: pt
1701
+ },
1702
+ props: {
1703
+ value: [Number, String],
1704
+ expanded: Boolean,
1705
+ type: String,
1706
+ size: String,
1707
+ position: {
1708
+ type: String,
1709
+ validator(t) {
1710
+ return [
1711
+ "left",
1712
+ "right",
1713
+ "center"
1714
+ ].indexOf(t) > -1;
1715
+ },
1716
+ default: null
1717
+ },
1718
+ animated: {
1719
+ type: Boolean,
1720
+ default: !0
1721
+ },
1722
+ destroyOnHide: {
1723
+ type: Boolean,
1724
+ default: !1
1725
+ },
1726
+ vertical: Boolean,
1727
+ multiline: Boolean
1728
+ },
1729
+ data() {
1730
+ return {
1731
+ activeTab: 0,
1732
+ defaultSlots: [],
1733
+ contentHeight: 0,
1734
+ isTransitioning: !1,
1735
+ _isTabs: !0
1736
+ // Used internally by TabItem
1737
+ };
1738
+ },
1739
+ computed: {
1740
+ mainClasses() {
1741
+ return {
1742
+ "is-fullwidth": this.expanded,
1743
+ "is-vertical": this.vertical,
1744
+ "is-multiline": this.multiline,
1745
+ [`is-${this.position}`]: this.position && this.vertical
1746
+ };
1747
+ },
1748
+ navClasses() {
1749
+ return [
1750
+ this.type,
1751
+ {
1752
+ [`is-${this.size}`]: !!this.size,
1753
+ [`is-${this.position}`]: this.position && !this.vertical,
1754
+ "is-fullwidth": this.expanded,
1755
+ "is-toggle-rounded is-toggle": this.type === "is-toggle-rounded"
1756
+ }
1757
+ ];
1758
+ },
1759
+ tabItems() {
1760
+ return this.defaultSlots.filter((t) => t.componentInstance && t.componentInstance.$data && t.componentInstance.$data._isTabItem).map((t) => t.componentInstance);
1761
+ }
1762
+ },
1763
+ watch: {
1764
+ /**
1765
+ * When v-model is changed set the new active tab.
1766
+ */
1767
+ value(t) {
1768
+ const e = this.getIndexByValue(t, t);
1769
+ this.changeTab(e);
1770
+ },
1771
+ /**
1772
+ * When tab-items are updated, set active one.
1773
+ */
1774
+ tabItems() {
1775
+ if (this.activeTab < this.tabItems.length) {
1776
+ let t = this.activeTab;
1777
+ this.tabItems.map((e, i) => {
1778
+ e.isActive && (t = i, t < this.tabItems.length && (this.tabItems[t].isActive = !1));
1779
+ }), this.tabItems[this.activeTab].isActive = !0;
1780
+ } else
1781
+ this.activeTab > 0 && this.changeTab(this.activeTab - 1);
1782
+ }
1783
+ },
1784
+ mounted() {
1785
+ this.activeTab = this.getIndexByValue(this.value || 0), this.activeTab < this.tabItems.length && (this.tabItems[this.activeTab].isActive = !0), this.refreshSlots();
1786
+ },
1787
+ methods: {
1788
+ /**
1789
+ * Change the active tab and emit change event.
1790
+ */
1791
+ changeTab(t) {
1792
+ this.activeTab === t || this.tabItems[t] === void 0 || (this.activeTab < this.tabItems.length && this.tabItems[this.activeTab].deactivate(this.activeTab, t), this.tabItems[t].activate(this.activeTab, t), this.activeTab = t, this.$emit("change", this.getValueByIndex(t)));
1793
+ },
1794
+ /**
1795
+ * Tab click listener, emit input event and change active tab.
1796
+ */
1797
+ tabClick(t) {
1798
+ this.activeTab !== t && (this.$emit("input", this.getValueByIndex(t)), this.changeTab(t));
1799
+ },
1800
+ refreshSlots() {
1801
+ this.defaultSlots = this.$slots.default || [];
1802
+ },
1803
+ getIndexByValue(t) {
1804
+ const e = this.tabItems.map((i) => i.$options.propsData ? i.$options.propsData.value : void 0).indexOf(t);
1805
+ return e >= 0 ? e : t;
1806
+ },
1807
+ getValueByIndex(t) {
1808
+ const { propsData: e } = this.tabItems[t].$options;
1809
+ return e && e.value ? e.value : t;
1810
+ }
1811
+ }
1812
+ };
1813
+ var ft = function() {
1814
+ var e = this, i = e._self._c;
1815
+ return i("div", { staticClass: "c-tabs", class: e.mainClasses }, [i("nav", { staticClass: "tabs", class: e.navClasses }, [i("ul", e._l(e.tabItems, function(s, n) {
1816
+ return i("li", { directives: [{ name: "show", rawName: "v-show", value: s.visible, expression: "tabItem.visible" }], key: n, class: {
1817
+ "is-active": e.activeTab === n,
1818
+ "is-disabled": s.disabled
1819
+ } }, [s.$slots.header ? i("CSlotComponent", { attrs: { component: s, name: "header", tag: "a" }, nativeOn: { click: function(a) {
1820
+ return e.tabClick(n);
1821
+ } } }) : i("a", { on: { click: function(a) {
1822
+ return e.tabClick(n);
1823
+ } } }, [s.icon ? i("BaseIcon", { attrs: { size: e.size, type: s.icon } }) : e._e(), i("span", [e._v(e._s(s.label))])], 1)], 1);
1824
+ }), 0)]), i("section", { staticClass: "tab-content", class: { "is-transitioning": e.isTransitioning } }, [e._t("default")], 2)]);
1825
+ }, gt = [], vt = /* @__PURE__ */ r(
1826
+ ht,
1827
+ ft,
1828
+ gt,
1829
+ !1,
1830
+ null,
1831
+ "b0f4b11a",
1832
+ null,
1833
+ null
1834
+ );
1835
+ const D = vt.exports, yt = {
1836
+ name: "CTabItem",
1837
+ props: {
1838
+ label: String,
1839
+ icon: String,
1840
+ iconPack: String,
1841
+ disabled: Boolean,
1842
+ visible: {
1843
+ type: Boolean,
1844
+ default: !0
1845
+ },
1846
+ value: [String, Number]
1847
+ },
1848
+ data() {
1849
+ return {
1850
+ isActive: !1,
1851
+ transitionName: null,
1852
+ _isTabItem: !0
1853
+ // Used internally by Tab
1854
+ };
1855
+ },
1856
+ created() {
1857
+ if (!this.$parent.$data._isTabs)
1858
+ throw this.$destroy(), new Error("You should wrap bTabItem on a bTabs");
1859
+ this.$parent.refreshSlots();
1860
+ },
1861
+ beforeDestroy() {
1862
+ this.$parent.refreshSlots();
1863
+ },
1864
+ methods: {
1865
+ /**
1866
+ * Activate tab, alter animation name based on the index.
1867
+ */
1868
+ activate(t, e) {
1869
+ this.transitionName = e < t ? this.$parent.vertical ? "slide-down" : "slide-next" : this.$parent.vertical ? "slide-up" : "slide-prev", this.isActive = !0;
1870
+ },
1871
+ /**
1872
+ * Deactivate tab, alter animation name based on the index.
1873
+ */
1874
+ deactivate(t, e) {
1875
+ this.transitionName = e < t ? this.$parent.vertical ? "slide-down" : "slide-next" : this.$parent.vertical ? "slide-up" : "slide-prev", this.isActive = !1;
1876
+ }
1877
+ },
1878
+ render(t) {
1879
+ if (this.$parent.destroyOnHide && (!this.isActive || !this.visible))
1880
+ return;
1881
+ const e = t(
1882
+ "div",
1883
+ {
1884
+ directives: [
1885
+ {
1886
+ name: "show",
1887
+ value: this.isActive && this.visible
1888
+ }
1889
+ ],
1890
+ class: "tab-item"
1891
+ },
1892
+ this.$slots.default
1893
+ );
1894
+ return this.$parent.animated ? t(
1895
+ "transition",
1896
+ {
1897
+ props: {
1898
+ name: this.transitionName,
1899
+ mode: "out-in"
1900
+ },
1901
+ on: {
1902
+ "before-enter": () => {
1903
+ this.$parent.isTransitioning = !0;
1904
+ },
1905
+ "after-enter": () => {
1906
+ this.$parent.isTransitioning = !1;
1907
+ }
1908
+ }
1909
+ },
1910
+ [e]
1911
+ ) : e;
1912
+ }
1913
+ }, _t = null, bt = null;
1914
+ var Ct = /* @__PURE__ */ r(
1915
+ yt,
1916
+ _t,
1917
+ bt,
1918
+ !1,
1919
+ null,
1920
+ null,
1921
+ null,
1922
+ null
1923
+ );
1924
+ const V = Ct.exports, wt = {
1925
+ name: "CMessage",
1926
+ props: {
1927
+ type: {
1928
+ type: String,
1929
+ default: "secondary"
1930
+ },
1931
+ badge: {
1932
+ type: String,
1933
+ default: ""
1934
+ },
1935
+ text: {
1936
+ type: String,
1937
+ default: ""
1938
+ }
1939
+ }
1940
+ };
1941
+ var xt = function(e, i) {
1942
+ return e("div", { class: [i.data.class, i.data.staticClass], staticStyle: { padding: "0.75em 1em", display: "flex", "align-items": "flex-start", "border-radius": "0.6em", "background-color": "hsl(0, 0%, 95%)" }, style: { ...i.data.staticStyle } }, [e("div", { class: [
1943
+ `has-background-${i.props.type}`
1944
+ ], staticStyle: { display: "inline-block", padding: "0.5em", "border-radius": "0.45em", "font-weight": "700", color: "white", "line-height": "1", "font-size": "12px", "margin-right": "1.25em" } }, [i._v(" " + i._s(i.props.badge || i.parent.$t("components:cling.message.tip")) + " ")]), e("div", { staticStyle: { color: "hsl(0, 0%, 25%)" } }, [i.props.text ? [i._v(" " + i._s(i.props.text) + " ")] : i._e(), i._t("default")], 2)]);
1945
+ }, $t = [], St = /* @__PURE__ */ r(
1946
+ wt,
1947
+ xt,
1948
+ $t,
1949
+ !0,
1950
+ null,
1951
+ "1c984641",
1952
+ null,
1953
+ null
1954
+ );
1955
+ const F = St.exports, kt = {
1956
+ name: "FlagIcon",
1957
+ props: {
1958
+ region: {
1959
+ type: String,
1960
+ default: null
1961
+ },
1962
+ title: {
1963
+ type: String,
1964
+ default: null
1965
+ },
1966
+ isSquared: {
1967
+ type: Boolean,
1968
+ default: !1
1969
+ }
1970
+ },
1971
+ mounted() {
1972
+ var a, l;
1973
+ const t = "FLAG_ICONS", e = (l = (a = this.$el).getRootNode) == null ? void 0 : l.call(a), s = (e == null ? void 0 : e.toString()) === "[object ShadowRoot]" ? e : document.head;
1974
+ if (s.querySelector(`#${t}`))
1975
+ return;
1976
+ const n = document.createElement("link");
1977
+ n.id = t, n.rel = "stylesheet", n.type = "text/css", n.href = "https://www.unpkg.com/flag-icons@6.6.6/css/flag-icons.min.css", n.media = "all", s.appendChild(n);
1978
+ }
1979
+ };
1980
+ var Dt = function() {
1981
+ var e = this, i = e._self._c;
1982
+ return e.region ? i("span", { staticClass: "fi", class: [
1983
+ `fi-${this.region.toLowerCase()}`,
1984
+ {
1985
+ fis: this.isSquared
1986
+ }
1987
+ ], attrs: { title: e.title || e.region } }) : e._e();
1988
+ }, Vt = [], Ft = /* @__PURE__ */ r(
1989
+ kt,
1990
+ Dt,
1991
+ Vt,
1992
+ !1,
1993
+ null,
1994
+ null,
1995
+ null,
1996
+ null
1997
+ );
1998
+ const At = Ft.exports, Bt = {
1999
+ name: "CPhoneInput",
2000
+ components: {
2001
+ Flag: At,
2002
+ CInput: T,
2003
+ CDropdown: p,
2004
+ CDropdownItem: h,
2005
+ CButton: M,
2006
+ CField: z,
2007
+ SmartList: te
2008
+ },
2009
+ props: {
2010
+ value: {
2011
+ type: [String, Number],
2012
+ default: ""
2013
+ },
2014
+ region: {
2015
+ type: String,
2016
+ default: ""
2017
+ },
2018
+ // Region to fallback to if prefix is not found in value
2019
+ defaultRegion: {
2020
+ type: String,
2021
+ required: !0
2022
+ },
2023
+ label: {
2024
+ type: String,
2025
+ default: ""
2026
+ },
2027
+ labelPosition: {
2028
+ type: String,
2029
+ default: ""
2030
+ }
2031
+ },
2032
+ data() {
2033
+ return {
2034
+ internalPrefix: null,
2035
+ // Used to remember prefix when value is changed to empty
2036
+ searchQuery: ""
2037
+ };
2038
+ },
2039
+ computed: {
2040
+ defaultPrefix() {
2041
+ return o[this.internalRegion].callingCode;
2042
+ },
2043
+ currentRegion() {
2044
+ return this.getRegionByCallingCode(this.prefix);
2045
+ },
2046
+ internalRegion: {
2047
+ get() {
2048
+ if (this.region)
2049
+ return this.region;
2050
+ if (this.value) {
2051
+ const t = (Object.keys(o) || []).find((e) => o[e].callingCode && this.value && this.value.startsWith(o[e].callingCode));
2052
+ if (t)
2053
+ return t;
2054
+ }
2055
+ return this.internalPrefix ? this.getRegionByCallingCode(this.internalPrefix) : this.defaultRegion;
2056
+ },
2057
+ set(t) {
2058
+ this.$emit("update:region", t), this.updateValue({ prefix: o[t].callingCode });
2059
+ }
2060
+ },
2061
+ prefix() {
2062
+ if (!this.value)
2063
+ return this.internalPrefix || this.defaultPrefix;
2064
+ const t = (Object.keys(o) || []).find((e) => o[e].callingCode && this.value && this.value.startsWith(o[e].callingCode));
2065
+ return t ? o[t].callingCode : this.defaultPrefix;
2066
+ },
2067
+ phone: {
2068
+ get() {
2069
+ return this.prefix && this.value && this.value.startsWith(this.prefix) ? this.value.substring(this.prefix.length) : this.value;
2070
+ },
2071
+ set(t) {
2072
+ this.updateValue({ phone: t });
2073
+ }
2074
+ },
2075
+ sortedRegions() {
2076
+ return (Object.keys(o) || []).map((t) => ({ key: t, title: `${o[t].name} (${t})`, callingCode: o[t].callingCode })).sort((t, e) => t.title.localeCompare(e.title));
2077
+ }
2078
+ },
2079
+ methods: {
2080
+ getRegionByCallingCode(t) {
2081
+ return t ? (Object.keys(o) || []).find((i) => t === o[i].callingCode) : null;
2082
+ },
2083
+ updateValue({ prefix: t, phone: e }) {
2084
+ const i = t !== void 0 ? t : this.prefix || "", s = e !== void 0 ? e : this.phone || "", n = `${i}${s}`;
2085
+ n !== i ? (this.$emit("input", n), this.region || this.$emit("update:region", this.internalRegion), this.internalPrefix = null) : (this.internalPrefix = i, this.$emit("input", ""));
2086
+ }
2087
+ }
2088
+ };
2089
+ var Ot = function() {
2090
+ var e = this, i = e._self._c;
2091
+ return i("CField", { staticClass: "has-addons", attrs: { expanded: "" } }, [i("div", { staticClass: "control" }, [i("SmartList", { attrs: { query: e.searchQuery, items: e.sortedRegions }, scopedSlots: e._u([{ key: "default", fn: function({ items: s }) {
2092
+ return [i("CDropdown", { staticClass: "control", staticStyle: { height: "100%" }, attrs: { size: e.$attrs.size, disabled: e.$attrs.disabled, "menu-styling": {
2093
+ maxWidth: "300px"
2094
+ }, scrollable: !0, position: "is-bottom-right", "max-height": "240px" }, model: { value: e.internalRegion, callback: function(n) {
2095
+ e.internalRegion = n;
2096
+ }, expression: "internalRegion" } }, [i("CButton", { staticStyle: { height: "100%" }, attrs: { slot: "trigger", size: e.$attrs.size, type: "none", pattern: "secondary" }, slot: "trigger" }, [i("Flag", { staticStyle: { "margin-right": "0.35em" }, attrs: { region: e.internalRegion } }), e._v(" " + e._s(e.prefix) + " ")], 1), i("CInput", { staticStyle: { "margin-bottom": "0.25em" }, attrs: { slot: "header", placeholder: e.$t("_common:search"), filled: "" }, slot: "header", model: { value: e.searchQuery, callback: function(n) {
2097
+ e.searchQuery = n;
2098
+ }, expression: "searchQuery" } }), e._l(s, function({ key: n, title: a, callingCode: l }) {
2099
+ return i("CDropdownItem", { key: n, staticClass: "truncate-text", attrs: { value: n } }, [i("Flag", { staticStyle: { "margin-right": "0.75em", flex: "0 0 auto" }, attrs: { region: n, title: a } }), i("span", { staticClass: "truncate-text" }, [e._v(" " + e._s(a) + " (" + e._s(l) + ") ")])], 1);
2100
+ })], 2)];
2101
+ } }]) })], 1), i("CField", { staticClass: "control", attrs: { label: e.label, "label-position": e.labelPosition, expanded: "" } }, [i("CInput", e._b({ attrs: { size: e.$attrs.size, placeholder: e.$attrs.placeholder, type: "tel" }, model: { value: e.phone, callback: function(s) {
2102
+ e.phone = s;
2103
+ }, expression: "phone" } }, "CInput", { ...e.$attrs, ...e.$props }, !1))], 1)], 1);
2104
+ }, It = [], Tt = /* @__PURE__ */ r(
2105
+ Bt,
2106
+ Ot,
2107
+ It,
2108
+ !1,
2109
+ null,
2110
+ null,
2111
+ null,
2112
+ null
2113
+ );
2114
+ const A = Tt.exports, Pt = {
2115
+ name: "CSliderThumb",
2116
+ inheritAttrs: !1,
2117
+ props: {
2118
+ value: {
2119
+ type: Number,
2120
+ default: 0
2121
+ },
2122
+ type: {
2123
+ type: String,
2124
+ default: ""
2125
+ },
2126
+ tooltip: {
2127
+ type: Boolean,
2128
+ default: !0
2129
+ },
2130
+ customFormatter: Function
2131
+ },
2132
+ data() {
2133
+ return {
2134
+ isFocused: !1,
2135
+ dragging: !1,
2136
+ startX: 0,
2137
+ startPosition: 0,
2138
+ newPosition: null,
2139
+ oldValue: this.value
2140
+ };
2141
+ },
2142
+ computed: {
2143
+ disabled() {
2144
+ return this.$parent.disabled;
2145
+ },
2146
+ max() {
2147
+ return this.$parent.max;
2148
+ },
2149
+ min() {
2150
+ return this.$parent.min;
2151
+ },
2152
+ step() {
2153
+ return this.$parent.step;
2154
+ },
2155
+ precision() {
2156
+ return this.$parent.precision;
2157
+ },
2158
+ currentPosition() {
2159
+ return `${(this.value - this.min) / (this.max - this.min) * 100}%`;
2160
+ },
2161
+ wrapperStyle() {
2162
+ return { left: this.currentPosition };
2163
+ },
2164
+ tooltipLabel() {
2165
+ return typeof this.customFormatter < "u" ? this.customFormatter(this.value) : this.value.toString();
2166
+ }
2167
+ },
2168
+ methods: {
2169
+ onFocus() {
2170
+ this.isFocused = !0;
2171
+ },
2172
+ onBlur() {
2173
+ this.isFocused = !1;
2174
+ },
2175
+ onButtonDown(t) {
2176
+ this.disabled || (t.preventDefault(), this.onDragStart(t), typeof window < "u" && (document.addEventListener("mousemove", this.onDragging), document.addEventListener("touchmove", this.onDragging), document.addEventListener("mouseup", this.onDragEnd), document.addEventListener("touchend", this.onDragEnd), document.addEventListener("contextmenu", this.onDragEnd)));
2177
+ },
2178
+ onLeftKeyDown() {
2179
+ this.disabled || this.value === this.min || (this.newPosition = parseFloat(this.currentPosition) - this.step / (this.max - this.min) * 100, this.setPosition(this.newPosition), this.$parent.emitValue("change"));
2180
+ },
2181
+ onRightKeyDown() {
2182
+ this.disabled || this.value === this.max || (this.newPosition = parseFloat(this.currentPosition) + this.step / (this.max - this.min) * 100, this.setPosition(this.newPosition), this.$parent.emitValue("change"));
2183
+ },
2184
+ onHomeKeyDown() {
2185
+ this.disabled || this.value === this.min || (this.newPosition = 0, this.setPosition(this.newPosition), this.$parent.emitValue("change"));
2186
+ },
2187
+ onEndKeyDown() {
2188
+ this.disabled || this.value === this.max || (this.newPosition = 100, this.setPosition(this.newPosition), this.$parent.emitValue("change"));
2189
+ },
2190
+ onDragStart(t) {
2191
+ this.dragging = !0, this.$emit("dragstart"), t.type === "touchstart" && (t.clientX = t.touches[0].clientX), this.startX = t.clientX, this.startPosition = parseFloat(this.currentPosition), this.newPosition = this.startPosition;
2192
+ },
2193
+ onDragging(t) {
2194
+ if (this.dragging) {
2195
+ t.type === "touchmove" && (t.clientX = t.touches[0].clientX);
2196
+ const e = (t.clientX - this.startX) / this.$parent.sliderSize() * 100;
2197
+ this.newPosition = this.startPosition + e, this.setPosition(this.newPosition);
2198
+ }
2199
+ },
2200
+ onDragEnd() {
2201
+ this.dragging = !1, this.$emit("dragend"), this.value !== this.oldValue && this.$parent.emitValue("change"), this.setPosition(this.newPosition), typeof window < "u" && (document.removeEventListener("mousemove", this.onDragging), document.removeEventListener("touchmove", this.onDragging), document.removeEventListener("mouseup", this.onDragEnd), document.removeEventListener("touchend", this.onDragEnd), document.removeEventListener("contextmenu", this.onDragEnd));
2202
+ },
2203
+ setPosition(t) {
2204
+ if (t === null || isNaN(t))
2205
+ return;
2206
+ t < 0 ? t = 0 : t > 100 && (t = 100);
2207
+ const e = 100 / ((this.max - this.min) / this.step);
2208
+ let s = Math.round(t / e) * e / 100 * (this.max - this.min) + this.min;
2209
+ s = parseFloat(s.toFixed(this.precision)), this.$emit("input", s), !this.dragging && s !== this.oldValue && (this.oldValue = s);
2210
+ }
2211
+ }
2212
+ };
2213
+ var Rt = function() {
2214
+ var e = this, i = e._self._c;
2215
+ return i("div", { staticClass: "c-slider-thumb-wrapper", class: { "is-dragging": e.dragging }, style: e.wrapperStyle }, [i("div", e._b({ staticClass: "c-slider-thumb", attrs: { tabindex: e.disabled ? !1 : 0 }, on: { mousedown: e.onButtonDown, touchstart: e.onButtonDown, focus: e.onFocus, blur: e.onBlur, keydown: [function(s) {
2216
+ return !s.type.indexOf("key") && e._k(s.keyCode, "left", 37, s.key, ["Left", "ArrowLeft"]) || "button" in s && s.button !== 0 ? null : (s.preventDefault(), e.onLeftKeyDown.apply(null, arguments));
2217
+ }, function(s) {
2218
+ return !s.type.indexOf("key") && e._k(s.keyCode, "right", 39, s.key, ["Right", "ArrowRight"]) || "button" in s && s.button !== 2 ? null : (s.preventDefault(), e.onRightKeyDown.apply(null, arguments));
2219
+ }, function(s) {
2220
+ return !s.type.indexOf("key") && e._k(s.keyCode, "down", 40, s.key, ["Down", "ArrowDown"]) ? null : (s.preventDefault(), e.onLeftKeyDown.apply(null, arguments));
2221
+ }, function(s) {
2222
+ return !s.type.indexOf("key") && e._k(s.keyCode, "up", 38, s.key, ["Up", "ArrowUp"]) ? null : (s.preventDefault(), e.onRightKeyDown.apply(null, arguments));
2223
+ }, function(s) {
2224
+ return !s.type.indexOf("key") && e._k(s.keyCode, "home", void 0, s.key, void 0) ? null : (s.preventDefault(), e.onHomeKeyDown.apply(null, arguments));
2225
+ }, function(s) {
2226
+ return !s.type.indexOf("key") && e._k(s.keyCode, "end", void 0, s.key, void 0) ? null : (s.preventDefault(), e.onEndKeyDown.apply(null, arguments));
2227
+ }] } }, "div", e.$attrs, !1))]);
2228
+ }, Mt = [], zt = /* @__PURE__ */ r(
2229
+ Pt,
2230
+ Rt,
2231
+ Mt,
2232
+ !1,
2233
+ null,
2234
+ null,
2235
+ null,
2236
+ null
2237
+ );
2238
+ const Nt = zt.exports, Et = {
2239
+ name: "CSliderTick",
2240
+ props: {
2241
+ value: {
2242
+ type: Number,
2243
+ default: 0
2244
+ }
2245
+ },
2246
+ computed: {
2247
+ position() {
2248
+ const t = (this.value - this.$parent.min) / (this.$parent.max - this.$parent.min) * 100;
2249
+ return t >= 0 && t <= 100 ? t : 0;
2250
+ },
2251
+ hidden() {
2252
+ return this.value === this.$parent.min || this.value === this.$parent.max;
2253
+ }
2254
+ },
2255
+ created() {
2256
+ if (!this.$parent.$data._isSlider)
2257
+ throw this.$destroy(), new Error("You should wrap bSliderTick on a bSlider");
2258
+ },
2259
+ methods: {
2260
+ getTickStyle(t) {
2261
+ return { left: `${t}%` };
2262
+ }
2263
+ }
2264
+ };
2265
+ var Lt = function() {
2266
+ var e = this, i = e._self._c;
2267
+ return i("div", { staticClass: "c-slider-tick", class: { "is-tick-hidden": e.hidden }, style: e.getTickStyle(e.position) }, [e.$slots.default ? i("span", { staticClass: "c-slider-tick-label" }, [e._t("default")], 2) : e._e()]);
2268
+ }, Ht = [], qt = /* @__PURE__ */ r(
2269
+ Et,
2270
+ Lt,
2271
+ Ht,
2272
+ !1,
2273
+ null,
2274
+ null,
2275
+ null,
2276
+ null
2277
+ );
2278
+ const jt = qt.exports, Kt = {
2279
+ name: "CSlider",
2280
+ components: {
2281
+ CSliderThumb: Nt,
2282
+ CSliderTick: jt
2283
+ },
2284
+ props: {
2285
+ value: {
2286
+ type: [Number, Array],
2287
+ default: 0
2288
+ },
2289
+ min: {
2290
+ type: Number,
2291
+ default: 0
2292
+ },
2293
+ max: {
2294
+ type: Number,
2295
+ default: 100
2296
+ },
2297
+ step: {
2298
+ type: Number,
2299
+ default: 1
2300
+ },
2301
+ type: {
2302
+ type: String,
2303
+ default: "primary"
2304
+ },
2305
+ size: String,
2306
+ ticks: {
2307
+ type: Boolean,
2308
+ default: !1
2309
+ },
2310
+ tooltip: {
2311
+ type: Boolean,
2312
+ default: !0
2313
+ },
2314
+ tooltipType: String,
2315
+ rounded: {
2316
+ type: Boolean,
2317
+ default: !1
2318
+ },
2319
+ disabled: {
2320
+ type: Boolean,
2321
+ default: !1
2322
+ },
2323
+ lazy: {
2324
+ type: Boolean,
2325
+ default: !1
2326
+ },
2327
+ customFormatter: Function,
2328
+ ariaLabel: [String, Array],
2329
+ biggerSliderFocus: {
2330
+ type: Boolean,
2331
+ default: !1
2332
+ }
2333
+ },
2334
+ data() {
2335
+ return {
2336
+ value1: null,
2337
+ value2: null,
2338
+ dragging: !1,
2339
+ isRange: !1,
2340
+ _isSlider: !0
2341
+ // Used by Thumb and Tick
2342
+ };
2343
+ },
2344
+ computed: {
2345
+ newTooltipType() {
2346
+ return this.tooltipType ? this.tooltipType : this.type;
2347
+ },
2348
+ tickValues() {
2349
+ if (!this.ticks || this.min > this.max || this.step === 0)
2350
+ return [];
2351
+ const t = [];
2352
+ for (let e = this.min + this.step; e < this.max; e += this.step)
2353
+ t.push(e);
2354
+ return t;
2355
+ },
2356
+ minValue() {
2357
+ return Math.min(this.value1, this.value2);
2358
+ },
2359
+ maxValue() {
2360
+ return Math.max(this.value1, this.value2);
2361
+ },
2362
+ barSize() {
2363
+ return this.isRange ? `${100 * (this.maxValue - this.minValue) / (this.max - this.min)}%` : `${100 * (this.value1 - this.min) / (this.max - this.min)}%`;
2364
+ },
2365
+ barStart() {
2366
+ return this.isRange ? `${100 * (this.minValue - this.min) / (this.max - this.min)}%` : "0%";
2367
+ },
2368
+ precision() {
2369
+ const t = [this.min, this.max, this.step].map((e) => {
2370
+ const i = `${e}`.split(".")[1];
2371
+ return i ? i.length : 0;
2372
+ });
2373
+ return Math.max(...t);
2374
+ },
2375
+ barStyle() {
2376
+ return {
2377
+ width: this.barSize,
2378
+ left: this.barStart
2379
+ };
2380
+ },
2381
+ rootClasses() {
2382
+ return {
2383
+ "is-rounded": this.rounded,
2384
+ "is-dragging": this.dragging,
2385
+ "is-disabled": this.disabled,
2386
+ "slider-focus": this.biggerSliderFocus
2387
+ };
2388
+ }
2389
+ },
2390
+ watch: {
2391
+ /**
2392
+ * When v-model is changed set the new active step.
2393
+ */
2394
+ value(t) {
2395
+ this.setValues(t);
2396
+ },
2397
+ value1() {
2398
+ this.onInternalValueUpdate();
2399
+ },
2400
+ value2() {
2401
+ this.onInternalValueUpdate();
2402
+ },
2403
+ min() {
2404
+ this.setValues(this.value);
2405
+ },
2406
+ max() {
2407
+ this.setValues(this.value);
2408
+ }
2409
+ },
2410
+ created() {
2411
+ this.isThumbReversed = !1, this.isTrackClickDisabled = !1, this.setValues(this.value);
2412
+ },
2413
+ methods: {
2414
+ setValues(t) {
2415
+ if (!(this.min > this.max))
2416
+ if (Array.isArray(t)) {
2417
+ this.isRange = !0;
2418
+ const e = typeof t[0] != "number" || isNaN(t[0]) ? this.min : m(t[0], this.min, this.max), i = typeof t[1] != "number" || isNaN(t[1]) ? this.max : m(t[1], this.min, this.max);
2419
+ this.value1 = this.isThumbReversed ? i : e, this.value2 = this.isThumbReversed ? e : i;
2420
+ } else
2421
+ this.isRange = !1, this.value1 = isNaN(t) ? this.min : m(t, this.min, this.max), this.value2 = null;
2422
+ },
2423
+ onInternalValueUpdate() {
2424
+ this.isRange && (this.isThumbReversed = this.value1 > this.value2), (!this.lazy || !this.dragging) && this.emitValue("input"), this.dragging && this.emitValue("dragging");
2425
+ },
2426
+ sliderSize() {
2427
+ return this.$refs.slider.getBoundingClientRect().width;
2428
+ },
2429
+ onSliderClick(t) {
2430
+ if (this.disabled || this.isTrackClickDisabled)
2431
+ return;
2432
+ const e = this.$refs.slider.getBoundingClientRect().left, i = (t.clientX - e) / this.sliderSize() * 100, s = this.min + i * (this.max - this.min) / 100, n = Math.abs(s - this.value1);
2433
+ if (this.isRange) {
2434
+ const a = Math.abs(s - this.value2);
2435
+ if (n <= a) {
2436
+ if (n < this.step / 2)
2437
+ return;
2438
+ this.$refs.button1.setPosition(i);
2439
+ } else {
2440
+ if (a < this.step / 2)
2441
+ return;
2442
+ this.$refs.button2.setPosition(i);
2443
+ }
2444
+ } else {
2445
+ if (n < this.step / 2)
2446
+ return;
2447
+ this.$refs.button1.setPosition(i);
2448
+ }
2449
+ this.emitValue("change");
2450
+ },
2451
+ onDragStart() {
2452
+ this.dragging = !0, this.$emit("dragstart");
2453
+ },
2454
+ onDragEnd() {
2455
+ this.isTrackClickDisabled = !0, setTimeout(() => {
2456
+ this.isTrackClickDisabled = !1;
2457
+ }, 0), this.dragging = !1, this.$emit("dragend"), this.lazy && this.emitValue("input");
2458
+ },
2459
+ emitValue(t) {
2460
+ this.$emit(t, this.isRange ? [this.minValue, this.maxValue] : this.value1);
2461
+ }
2462
+ }
2463
+ };
2464
+ var Wt = function() {
2465
+ var e = this, i = e._self._c;
2466
+ return i("div", { staticClass: "c-slider", class: [`is-${e.size}`, `is-${e.type}`, e.rootClasses], on: { click: e.onSliderClick } }, [i("div", { ref: "slider", staticClass: "c-slider-track" }, [i("div", { staticClass: "c-slider-fill", style: e.barStyle }), e.ticks ? e._l(e.tickValues, function(s, n) {
2467
+ return i("CSliderTick", { key: n, attrs: { value: s } });
2468
+ }) : e._e(), e._t("default"), i("CSliderThumb", { ref: "button1", attrs: { type: `is-${e.newTooltipType}`, tooltip: e.tooltip, "custom-formatter": e.customFormatter, "aria-valuenow": e.value1, "aria-valuemin": e.min, "aria-valuemax": e.max, "aria-label": Array.isArray(e.ariaLabel) ? e.ariaLabel[0] : e.ariaLabel, "aria-disabled": e.disabled, role: "slider", "aria-orientation": "horizontal" }, on: { dragstart: e.onDragStart, dragend: e.onDragEnd }, model: { value: e.value1, callback: function(s) {
2469
+ e.value1 = s;
2470
+ }, expression: "value1" } }), e.isRange ? i("CSliderThumb", { ref: "button2", attrs: { type: e.newTooltipType, tooltip: e.tooltip, "custom-formatter": e.customFormatter, "aria-valuenow": e.value2, "aria-valuemin": e.min, "aria-valuemax": e.max, "aria-label": Array.isArray(e.ariaLabel) ? e.ariaLabel[1] : "", "aria-disabled": e.disabled, role: "slider", "aria-orientation": "horizontal" }, on: { dragstart: e.onDragStart, dragend: e.onDragEnd }, model: { value: e.value2, callback: function(s) {
2471
+ e.value2 = s;
2472
+ }, expression: "value2" } }) : e._e()], 2)]);
2473
+ }, Xt = [], Ut = /* @__PURE__ */ r(
2474
+ Kt,
2475
+ Wt,
2476
+ Xt,
2477
+ !1,
2478
+ null,
2479
+ null,
2480
+ null,
2481
+ null
2482
+ );
2483
+ const B = Ut.exports;
2484
+ function di(t) {
2485
+ t.component(w.name, w), t.component("CAutocomplete", Ye), t.component(y.name, y), t.component(x.name, x), t.component($.name, $), t.component(p.name, p), t.component(h.name, h), t.component(S.name, S), t.component(_.name, _), t.component(k.name, k), t.component(D.name, D), t.component(V.name, V), t.component("CField", Le), t.component(F.name, F), t.component(A.name, A), t.component(B.name, B);
2486
+ }
2487
+ export {
2488
+ Le as C,
2489
+ li as S,
2490
+ di as i
2491
+ };