@cling-se/widget 0.9.2 → 0.9.4

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-d472aa84.js +57 -0
  2. package/dist/{AnswerModal-8f918a49.js → AnswerModal-06487437.js} +7 -5
  3. package/dist/{AttachmentItem-79618446.js → AttachmentItem-d98488ee.js} +5 -7
  4. package/dist/BaseDatePicker-8c098701.js +3156 -0
  5. package/dist/{BaseInput-9f376e4e.js → BaseInput-2723d613.js} +4 -4
  6. package/dist/{BaseUpload-9a3d655d.js → BaseUpload-996d74b3.js} +27 -26
  7. package/dist/BlockMedia-00907fb6.js +72 -0
  8. package/dist/CCallout-ffa95028.js +52 -0
  9. package/dist/CDropdownItem-74672842.js +610 -0
  10. package/dist/CField-06dd50f1.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-f49d85e0.js +83 -0
  13. package/dist/ClientAutocomplete-f65643dd.js +80 -0
  14. package/dist/ClientModal-d276aabd.js +547 -0
  15. package/dist/ColorPicker-4f6b70af.js +2881 -0
  16. package/dist/{CompanyModal-5dfa4486.js → CompanyModal-30c54ce3.js} +12 -11
  17. package/dist/{ContentWrapper-3ac57cb2.js → ContentWrapper-d5653fef.js} +21 -14
  18. package/dist/{CoverBlockSettings-323ef519.js → CoverBlockSettings-2335f3a8.js} +7 -7
  19. package/dist/DocForm-9ca24de4.js +6772 -0
  20. package/dist/DocFormSend-d0c6fa1d.js +135 -0
  21. package/dist/{DocModalBase-4058a890.js → DocModalBase-f4915a62.js} +1 -1
  22. package/dist/{DocReceipt-390f75e3.js → DocReceipt-d192000e.js} +1 -1
  23. package/dist/{DocSendReminder-afc52d3d.js → DocSendReminder-06d5b34c.js} +1 -1
  24. package/dist/{DocTextEditor-0be1aea9.js → DocTextEditor-c6d1df3c.js} +16 -12
  25. package/dist/{DocTimeline-c421dead.js → DocTimeline-b4c20f93.js} +11 -11
  26. package/dist/DocumentClient-c2319f00.js +145 -0
  27. package/dist/{DocumentLogotype-5230c7bd.js → DocumentLogotype-1efd1ce9.js} +3 -3
  28. package/dist/{EmbedInput-8092d310.js → EmbedInput-654c0477.js} +10 -11
  29. package/dist/{EmbedSettings-bbea9894.js → EmbedSettings-b81ec734.js} +10 -11
  30. package/dist/ErrorCallout-60d0b3ab.js +30 -0
  31. package/dist/{FilePreviewModal-67088d0f.js → FilePreviewModal-895bd1bd.js} +6 -7
  32. package/dist/FormInputRow-9819eb71.js +2045 -0
  33. package/dist/{HeaderSettings-e02a5832.js → HeaderSettings-c6dac755.js} +23 -19
  34. package/dist/{ImageSelectModal-a9912356.js → ImageSelectModal-7cece54e.js} +20 -18
  35. package/dist/{ImageUploadWrapper-1310e96e.js → ImageUploadWrapper-53afd31d.js} +3 -3
  36. package/dist/{Index-f3eae2af.js → Index-01c63c88.js} +2 -2
  37. package/dist/{Index-90566113.js → Index-1a7e98d7.js} +8 -8
  38. package/dist/{Index-0ac00646.js → Index-1d361d01.js} +6 -7
  39. package/dist/{Index-9cd881f2.js → Index-2535f58f.js} +2 -2
  40. package/dist/{Index-f4bb1f71.js → Index-34c84bab.js} +8 -9
  41. package/dist/{Index-f03edd3d.js → Index-5cc51230.js} +7 -8
  42. package/dist/{Index-648a786a.js → Index-5e35f4a2.js} +3 -3
  43. package/dist/{Index-6df9883f.js → Index-60fc8a6e.js} +5 -6
  44. package/dist/{Index-de45c9c3.js → Index-61f7dc92.js} +2 -2
  45. package/dist/{Index-26f9a008.js → Index-63805642.js} +73 -118
  46. package/dist/{Index-ca8aedde.js → Index-66c8cbfa.js} +11 -12
  47. package/dist/{Index-a9ed7c39.js → Index-6ef78b7a.js} +4 -6
  48. package/dist/{Index-8a22c5cd.js → Index-701f0d05.js} +1 -1
  49. package/dist/{Index-6ee090c3.js → Index-7443e91c.js} +16 -17
  50. package/dist/{Index-1ae93acd.js → Index-82574a41.js} +6 -7
  51. package/dist/{Index-35f3bca9.js → Index-82b5de12.js} +6 -7
  52. package/dist/{Index-d02a530a.js → Index-8bca2d87.js} +8 -9
  53. package/dist/{Index-57ce8eee.js → Index-9233cc83.js} +22 -15
  54. package/dist/{Index-faeeff50.js → Index-98e8bb86.js} +21 -16
  55. package/dist/{Index-17e60907.js → Index-9aaf8b90.js} +33 -31
  56. package/dist/{Index-0d81bade.js → Index-b020a80c.js} +6 -7
  57. package/dist/{Index-28c78ddc.js → Index-b14d0f03.js} +6 -7
  58. package/dist/{Index-d3e59202.js → Index-b15cfd62.js} +10 -10
  59. package/dist/{Index-0a22673f.js → Index-c4de05aa.js} +7 -7
  60. package/dist/{Index-87497c7c.js → Index-c67218ce.js} +7 -7
  61. package/dist/{Index-2b684213.js → Index-c7e68382.js} +6 -7
  62. package/dist/{Index-e1bd4ea9.js → Index-caf5cf44.js} +54 -44
  63. package/dist/{Index-2d5fe047.js → Index-cd76b120.js} +6 -7
  64. package/dist/Index-d45a1eff.js +28 -0
  65. package/dist/{Index-876daf3e.js → Index-d8879ca9.js} +2 -2
  66. package/dist/{Index-1f966c82.js → Index-e45a0c32.js} +27 -20
  67. package/dist/{Index-d11146a6.js → Index-e749f6f1.js} +6 -6
  68. package/dist/{Index-15591118.js → Index-e80f5f9c.js} +11 -11
  69. package/dist/{Index-e30b3de9.js → Index-f935c492.js} +6 -7
  70. package/dist/{InputToggleRow-c58dde03.js → InputToggleRow-9d8a7da4.js} +1 -1
  71. package/dist/IsPremiumPreStep-3a087524.js +1919 -0
  72. package/dist/{MediaWrapper-afc29574.js → MediaWrapper-d4a4b66f.js} +4 -4
  73. package/dist/{NotBindingText-e3a49f8a.js → NotBindingText-b199006c.js} +2 -2
  74. package/dist/{PackageGroup-150a9942.js → PackageGroup-37ac99b1.js} +24 -17
  75. package/dist/{PdfTerms-fcc835f4.js → PdfTerms-8b52bb6e.js} +6 -7
  76. package/dist/{PdfViewer-b1118475.js → PdfViewer-38bd8439.js} +2 -2
  77. package/dist/{PlainHtml-47791667.js → PlainHtml-9174cbf6.js} +1 -1
  78. package/dist/PriceHeader-e357afe9.js +336 -0
  79. package/dist/SearchApi-2e286be6.js +148 -0
  80. package/dist/{TermsSettings-c97df867.js → TermsSettings-c74eec79.js} +6 -6
  81. package/dist/{ThemeColorRow-014a0526.js → ThemeColorRow-3558367b.js} +7 -6
  82. package/dist/{ToggleBinding-342beacc.js → ToggleBinding-6c9c1ac3.js} +8 -9
  83. package/dist/{UploadModal-aed5f8c9.js → UploadModal-6d0abd77.js} +21 -22
  84. package/dist/{VideoPlayerInput-7ebb49d7.js → VideoPlayerInput-77cd86aa.js} +5 -6
  85. package/dist/{VideoPlayerSettings-0a027a8e.js → VideoPlayerSettings-b7eb781c.js} +13 -14
  86. package/dist/{VideoSelectModal-5c1a8ddc.js → VideoSelectModal-d2299552.js} +10 -10
  87. package/dist/anime.es-e284c852.js +858 -0
  88. package/dist/answerDocumentMixin-66023e62.js +54 -0
  89. package/dist/color-71c20583.js +15 -0
  90. package/dist/{cssMode-b59b5164.js → cssMode-8552fc56.js} +15 -14
  91. package/dist/focusDrawerMixin-67462262.js +68 -0
  92. package/dist/formComponentsInstall-ad9c2a83.js +2491 -0
  93. package/dist/formValidationMixin-4920ab53.js +4984 -0
  94. package/dist/{freemarker2-5b426d60.js → freemarker2-7e10a65d.js} +19 -18
  95. package/dist/{handlebars-9a256dec.js → handlebars-8045bfa8.js} +18 -17
  96. package/dist/{html-4322f199.js → html-8afcb633.js} +14 -13
  97. package/dist/{htmlMode-d8a0ed16.js → htmlMode-1a2d1b48.js} +19 -18
  98. package/dist/index-3d6d7a03.js +490 -0
  99. package/dist/index-805c56e4.js +4 -0
  100. package/dist/{index-c2f8c4f3.js → index-bf93d7c2.js} +13 -12
  101. package/dist/index-c48c5eb4.js +14 -0
  102. package/dist/{index-7359c27c.js → index-f805bfce.js} +21 -15
  103. package/dist/index.es.js +3 -3
  104. package/dist/index.umd.js +713 -600
  105. package/dist/{javascript-7f9828c0.js → javascript-dad5561e.js} +11 -10
  106. package/dist/{jsonMode-e07cde60.js → jsonMode-ce09245f.js} +19 -18
  107. package/dist/{liquid-b47f65fb.js → liquid-05247459.js} +11 -10
  108. package/dist/{main-154fab72.js → main-04025a56.js} +19557 -20415
  109. package/dist/mapFormMixin-8d073f99.js +66 -0
  110. package/dist/{publicSenderState-51ca0439.js → publicSenderState-97108de1.js} +1 -1
  111. package/dist/{python-f3873309.js → python-3f3513c5.js} +11 -10
  112. package/dist/{razor-4071ec1b.js → razor-1f3e9c4e.js} +14 -13
  113. package/dist/regions-29ee6964.js +1250 -0
  114. package/dist/simplebar.min-3af55aab.js +2429 -0
  115. package/dist/style.css +4 -0
  116. package/dist/template-42a1d852.js +526 -0
  117. package/dist/throttle-a2c1f34d.js +18 -0
  118. package/dist/tinycolor-88fa380f.js +634 -0
  119. package/dist/{tsMode-71160e05.js → tsMode-4c026047.js} +15 -14
  120. package/dist/{typescript-80a61e6a.js → typescript-baf56f67.js} +11 -10
  121. package/dist/{utils-72915af5.js → utils-6670dea6.js} +5 -5
  122. package/dist/vuedraggable.umd-d7138234.js +3179 -0
  123. package/dist/{xml-021490f1.js → xml-ffc6146a.js} +11 -10
  124. package/package.json +3 -2
  125. package/stats.html +1 -1
  126. package/dist/DocForm-5ff2cbbb.js +0 -22074
  127. package/dist/DocFormSend-06ffa19c.js +0 -113
  128. package/dist/Index-2b5c1367.js +0 -29
  129. package/dist/PriceHeader-1dfa95fd.js +0 -329
  130. package/dist/formComponentsInstall-e33d6795.js +0 -11121
  131. package/dist/index-51b2742c.js +0 -11
  132. package/dist/throttle-f479e1f1.js +0 -18
@@ -0,0 +1,547 @@
1
+ import { v as p, H as h, I as v, n as u, b as c, g as d, J as y, t as C } from "./main-04025a56.js";
2
+ import { m as f, b, a as _ } from "./vuex.esm-4a0fff7c.js";
3
+ import { w as $ } from "./CDropdownItem-74672842.js";
4
+ import { C as w } from "./ClientAutocomplete-f65643dd.js";
5
+ import { v as r } from "./index-805c56e4.js";
6
+ import "./SearchApi-2e286be6.js";
7
+ function g(n) {
8
+ if (typeof n > "u")
9
+ throw Error("Missing param inputParam");
10
+ let e = n;
11
+ Number.isInteger(e) && (e = e.toString());
12
+ let t = 0;
13
+ const i = e.length, a = i % 2;
14
+ let o, s;
15
+ for (o = 0; o < i; o += 1)
16
+ s = parseInt(e.charAt(o), 10), o % 2 === a && (s *= 2), s > 9 && (s -= 9), t += s;
17
+ return t % 10 === 0;
18
+ }
19
+ function m(n) {
20
+ let e = n.replace(/ /g, "");
21
+ return e = e.replace(/-/g, ""), !g(e) || (e = [e.slice(0, 6), "-", e.slice(6)].join(""), !e.match(/^(\d{6})-(\d{4})$/)) ? !1 : e;
22
+ }
23
+ function l(n) {
24
+ if (typeof n > "u" || n === null || n === "")
25
+ return !1;
26
+ let e = n.trim().replace(/[^0-9]+/g, "");
27
+ if (e.length !== 10 && e.length !== 12)
28
+ return !1;
29
+ if (e.length === 10) {
30
+ const a = e.substring(0, 2), o = (/* @__PURE__ */ new Date()).getFullYear(), s = parseInt(o.toString().substring(2, 2), 10);
31
+ parseInt(a, 10) === 19 || parseInt(a, 10) === 20 || (parseInt(a, 10) >= 0 && parseInt(a, 10) <= s ? e = `20${e}` : e = `19${e}`);
32
+ }
33
+ return (/* @__PURE__ */ new Date()).getFullYear() - parseInt(e.substring(0, 4), 10) < 16 ? !1 : g(e.substring(2)) ? e : !1;
34
+ }
35
+ const x = {
36
+ sv: {
37
+ title: "Mottagare",
38
+ createButton: "Lägg till mottagare",
39
+ updateButton: "Spara mottagare",
40
+ individual: "Privatperson",
41
+ reference: "Referens",
42
+ workAddressSubLabel: "Där arbetet utförs",
43
+ showMore: "Visa fler fält",
44
+ seperateWorkAddress: {
45
+ false: "Arbetsadress som ovan",
46
+ true: "Annan"
47
+ },
48
+ placeholders: {
49
+ name: "Mottagarens namn",
50
+ companyName: "Företagets namn",
51
+ socialNo: "10 eller 12 siffror",
52
+ orgNo: "Företagets org-nr",
53
+ reference: "Er referens",
54
+ cellphone: "Mobilnummer",
55
+ address: "Gatuadress"
56
+ },
57
+ validations: {
58
+ name: {
59
+ required: "Vem är din kund?"
60
+ },
61
+ orgNo: {
62
+ personalNumber: "Personnumret är inte giltigt"
63
+ },
64
+ realOrgNo: {
65
+ realOrgNo: "Organisationsnumret är inte giltigt"
66
+ },
67
+ reference: {
68
+ required: "Vem är din referens?"
69
+ },
70
+ email: {
71
+ required: "E-post saknas",
72
+ email: "E-posten är ogiltig"
73
+ }
74
+ },
75
+ signMethod: {
76
+ button: {
77
+ title: "Standard - knapptryck",
78
+ content: "Bevisnivå: IP-adress, tidpunkt och enhet."
79
+ },
80
+ bankId: {
81
+ title: "BankId",
82
+ content: "Samma säkerhetsgrad som bankerna har."
83
+ },
84
+ signature: {
85
+ title: "Standard",
86
+ content: "Bevisnivå: IP-adress, tidpunkt och enhet."
87
+ },
88
+ inPerson: {
89
+ title: "Fysisk underskrift",
90
+ content: "Signatur på utskrivet dokument"
91
+ }
92
+ }
93
+ },
94
+ en: {
95
+ title: "Recipient",
96
+ createButton: "Add recipient",
97
+ updateButton: "Save recipient",
98
+ individual: "Individual",
99
+ reference: "Contact",
100
+ workAddressSubLabel: "Where work is going to be performed",
101
+ showMore: "Show additional fields",
102
+ seperateWorkAddress: {
103
+ false: "Work address same as above",
104
+ true: "Other"
105
+ },
106
+ placeholders: {
107
+ name: "Recipient name",
108
+ companyName: "Company name",
109
+ socialNo: "10 or 12 numbers",
110
+ orgNo: "Company registration number",
111
+ reference: "Name",
112
+ cellphone: "Cellphone",
113
+ address: "Street"
114
+ },
115
+ validations: {
116
+ name: {
117
+ required: "Who's your contact person?"
118
+ },
119
+ orgNo: {
120
+ personalNumber: "Invalid social security number"
121
+ },
122
+ realOrgNo: {
123
+ realOrgNo: "Invalid organisation number"
124
+ },
125
+ reference: {
126
+ required: "Missing contact name"
127
+ },
128
+ email: {
129
+ required: "Email missing",
130
+ email: "Invalid email"
131
+ }
132
+ },
133
+ signMethod: {
134
+ button: {
135
+ title: "Standard - button",
136
+ content: "Level of proof: IP address, timestamp and device."
137
+ },
138
+ bankId: {
139
+ title: "BankID",
140
+ content: "Same level of proof as the banks use."
141
+ },
142
+ signature: {
143
+ title: "Signature",
144
+ content: "Level of proof: IP address, timestamp and device."
145
+ },
146
+ inPerson: {
147
+ title: "In person",
148
+ content: "Signature on print document"
149
+ }
150
+ }
151
+ }
152
+ };
153
+ const { mapFields: k } = p({
154
+ getterType: "forms/getField",
155
+ mutationType: "forms/updateField"
156
+ }), S = {
157
+ name: "FormClient",
158
+ i18nOptions: {
159
+ namespaces: "formClient",
160
+ messages: x
161
+ },
162
+ components: {
163
+ ClientAutocomplete: w,
164
+ Animation: h
165
+ },
166
+ mixins: [$],
167
+ props: {
168
+ requireReference: {
169
+ type: Boolean,
170
+ default: !0
171
+ },
172
+ searchEnabled: {
173
+ type: Boolean,
174
+ default: !1
175
+ },
176
+ validateOrgNo: {
177
+ type: Boolean,
178
+ default: !1
179
+ },
180
+ simpleForm: {
181
+ type: Boolean,
182
+ default: !1
183
+ },
184
+ inputFocusOnMount: {
185
+ type: String,
186
+ default: ""
187
+ },
188
+ // Optional field with prop sync, if within the context of documents
189
+ documentRole: {
190
+ type: String,
191
+ default: ""
192
+ },
193
+ // Optional field with prop sync, if within the context of documents
194
+ answerMethod: {
195
+ type: Object,
196
+ default: null
197
+ },
198
+ isPublicForm: {
199
+ type: Boolean,
200
+ default: !1
201
+ }
202
+ },
203
+ validations() {
204
+ return [this.name, this.orgNo, this.reference, this.email, this.cellphone].some((e) => !!e) ? {
205
+ orgNo: {
206
+ personalNumber(e) {
207
+ return !this.validateOrgNo || !e ? !0 : this.isIndivid ? l(e) : m(e) || l(e);
208
+ }
209
+ },
210
+ reference: {
211
+ required: r.requiredIf((e) => e.requireReference && !e.isIndivid)
212
+ },
213
+ email: {
214
+ email: r.email
215
+ }
216
+ } : {
217
+ name: {
218
+ required: r.required
219
+ },
220
+ orgNo: {
221
+ required: r.requiredIf((e) => e.type === "company")
222
+ },
223
+ cellphone: {
224
+ required: r.requiredIf((e) => !e.isIndivid)
225
+ },
226
+ reference: {
227
+ required: r.requiredIf((e) => !e.isIndivid)
228
+ },
229
+ email: {
230
+ required: r.requiredIf((e) => !e.isIndivid)
231
+ }
232
+ };
233
+ },
234
+ watch: {
235
+ type(n) {
236
+ v.setItem("defaultClientType", n);
237
+ }
238
+ },
239
+ computed: {
240
+ ...k({
241
+ id: "endCustomer.id",
242
+ type: "endCustomer.customerType",
243
+ name: "endCustomer.name",
244
+ realOrgNo: "endCustomer.org_no",
245
+ reference: "endCustomer.reference",
246
+ email: "endCustomer.email",
247
+ street: "endCustomer.street",
248
+ zip: "endCustomer.zip",
249
+ city: "endCustomer.city",
250
+ cellphone: "endCustomer.cellphone",
251
+ cellphoneRegion: "endCustomer.cellphoneRegion",
252
+ separateWorkAddress: "endCustomer.separateWorkAddress",
253
+ workStreet: "endCustomer.workStreet",
254
+ workZip: "endCustomer.workZip",
255
+ workCity: "endCustomer.workCity",
256
+ reverseVat: "endCustomer.reverseVat",
257
+ doUpdateEndCustomer: "endCustomer.doUpdateEndCustomer"
258
+ }),
259
+ ...f({
260
+ isPosting: "endCustomers/isPosting",
261
+ companyRegion: "application/companyRegion",
262
+ feature: "application/feature"
263
+ }),
264
+ messages() {
265
+ return {
266
+ name: {
267
+ required: this.$t("validations.name.required")
268
+ },
269
+ orgNo: {
270
+ personalNumber: this.$t("validations.orgNo.personalNumber")
271
+ },
272
+ realOrgNo: {
273
+ personalNumber: this.$t("validations.realOrgNo.realOrgNo")
274
+ },
275
+ reference: {
276
+ required: this.$t("validations.reference.required")
277
+ },
278
+ email: {
279
+ required: this.$t("validations.email.required"),
280
+ email: this.$t("validations.email.email")
281
+ }
282
+ };
283
+ },
284
+ orgNo: {
285
+ get() {
286
+ return this.realOrgNo;
287
+ },
288
+ set(n) {
289
+ const e = this.isIndivid ? l(n) : m(n) || l(n);
290
+ return this.validateOrgNo && e ? (this.realOrgNo = e, !0) : (this.realOrgNo = n, !0);
291
+ }
292
+ },
293
+ isIndivid() {
294
+ return this.type === "individual";
295
+ }
296
+ },
297
+ mounted() {
298
+ this.$refs[this.inputFocusOnMount] ? this.$refs[this.inputFocusOnMount].$el.querySelector("input").focus() : this.$refs.name.$el.querySelector("input").focus();
299
+ },
300
+ methods: {
301
+ validateForm() {
302
+ return this.$v.$touch(), this.$v.$invalid ? !1 : (this.$emit("submit", !0), !0);
303
+ }
304
+ }
305
+ };
306
+ var N = function() {
307
+ var e = this, t = e._self._c;
308
+ return t("div", { staticClass: "form-client" }, [e.simpleForm ? t("form", { on: { submit: function(i) {
309
+ return i.preventDefault(), e.validateForm.apply(null, arguments);
310
+ } } }, [t("div", { staticClass: "flex flex-wrap items-center pb-6 space-between" }, [t("div", { staticClass: "flex-grow", staticStyle: { "font-weight": "600", "font-size": "20px" } }, [e._v(" " + e._s(e.$t("_common:recipient").capitalize()) + " ")]), t("div", { staticClass: "type-toggle" }, [t("div", { staticClass: "type-toggle-button", class: { active: e.type === "individual" }, on: { click: function(i) {
311
+ e.type = "individual";
312
+ } } }, [e._v(" " + e._s(e.$t("individual")) + " ")]), t("div", { staticClass: "type-toggle-button", class: { active: e.type === "company" }, on: { click: function(i) {
313
+ e.type = "company";
314
+ } } }, [e._v(" " + e._s(e.$t("_common:company").capitalize()) + " ")])])]), t("CField", { staticStyle: { "margin-bottom": "1.5rem" }, attrs: { label: e.isIndivid ? e.$t("_common:name").capitalize() : e.$t("_common:company").capitalize(), validator: e.$v.name, messages: e.messages.name, "label-position": "inside" } }, [t("ClientAutocomplete", { ref: "name", attrs: { placeholder: e.isIndivid ? e.$t("placeholders.name") : e.$t("placeholders.companyName"), "search-enabled": e.searchEnabled, "show-loading": !0 }, on: { setClient: function(i) {
315
+ return e.$emit("setClient", i);
316
+ } }, model: { value: e.name, callback: function(i) {
317
+ e.name = i;
318
+ }, expression: "name" } })], 1), t("Animation", [e.isIndivid ? e._e() : t("CField", { staticClass: "pb-4", attrs: { validator: e.$v.reference, messages: e.messages.reference, label: e.$t("reference").capitalize(), "label-position": "inside" } }, [t("CInput", { ref: "reference", attrs: { placeholder: e.$t("placeholders.reference") }, model: { value: e.reference, callback: function(i) {
319
+ e.reference = i;
320
+ }, expression: "reference" } })], 1)], 1), t("CField", { staticStyle: { "margin-bottom": "1.5rem" }, attrs: { validator: e.$v.email, messages: e.messages.email, label: e.$t("_common:email").capitalize(), "label-position": "inside" } }, [t("CInput", { ref: "email", attrs: { placeholder: e.$t("_common:email").capitalize() }, model: { value: e.email, callback: function(i) {
321
+ e.email = typeof i == "string" ? i.trim() : i;
322
+ }, expression: "email" } })], 1), t("CPhoneInput", { ref: "cellphone", staticStyle: { "margin-bottom": "1.5rem" }, attrs: { label: e.$t("_common:cellphone").capitalize(), placeholder: e.$t("placeholders.cellphone"), region: e.cellphoneRegion, "default-region": e.companyRegion, "label-position": "inside" }, on: { "update:region": function(i) {
323
+ e.cellphoneRegion = i;
324
+ } }, model: { value: e.cellphone, callback: function(i) {
325
+ e.cellphone = i;
326
+ }, expression: "cellphone" } }), e.documentRole ? t("CDropdown", { staticStyle: { "margin-bottom": "1rem" }, attrs: { expanded: "" } }, [t("CButton", { staticClass: "is-left", staticStyle: { width: "100%" }, attrs: { slot: "trigger", "dropdown-icon": !0, "icon-props": {
327
+ stroke: "hsl(0, 0%, 50%)"
328
+ }, "icon-left": e.documentRole === "signee" ? "pen-tool" : "eye", type: "none", pattern: "secondary" }, slot: "trigger" }, [t("div", { staticStyle: { "line-height": "1.25", padding: "4px 0" } }, [t("div", [e._v(e._s(e.$t(`_common:documentRole.${e.documentRole}.description`)))]), t("div", { staticStyle: { "font-size": "12px", opacity: "0.7" } }, [e._v(" " + e._s(e.$t(`_common:documentRole.${e.documentRole}.label`)) + " ")])])]), e._l(["signee", "recipient", "approver"], function(i) {
329
+ return t("CDropdownItem", { key: i, attrs: { "icon-left": i === "signee" ? "pen-tool" : "eye", "icon-props": {
330
+ stroke: "hsl(0, 0%, 50%)"
331
+ } }, on: { click: function(a) {
332
+ return e.$emit("update:document-role", i);
333
+ } } }, [t("div", { staticStyle: { "line-height": "1.25", padding: "4px 0" } }, [t("div", [e._v(e._s(e.$t(`_common:documentRole.${i}.description`)))]), t("div", { staticStyle: { "font-size": "12px", opacity: "0.7" } }, [e._v(" " + e._s(e.$t(`_common:documentRole.${i}.label`)) + " ")])])]);
334
+ })], 2) : e._e(), t("CButton", { attrs: { type: "secondary", pattern: "tertiary", size: "small", "icon-left": "arrow-right" }, on: { click: function(i) {
335
+ return e.$emit("show-more");
336
+ } } }, [e._v(" " + e._s(e.$t("showMore").capitalize()) + " ")]), t("CButton", { staticClass: "mt-4", staticStyle: { padding: "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: { loading: e.isPosting, "native-type": "submit", type: "secondary", wide: "", size: "medium" } }, [e._v(" " + e._s(e.$t(`${e.id ? "update" : "create"}Button`)) + " ")])], 1) : t("div", { class: { "column-only": e.windowWidth <= 600 } }, [t("div", { staticClass: "flex items-center justify-center", staticStyle: { "margin-bottom": "2.5rem" } }, [t("div", { staticClass: "type-toggle" }, [t("div", { staticClass: "type-toggle-button", class: { active: e.type === "individual" }, on: { click: function(i) {
337
+ e.type = "individual";
338
+ } } }, [e._v(" " + e._s(e.$t("individual")) + " ")]), t("div", { staticClass: "type-toggle-button", class: { active: e.type === "company" }, on: { click: function(i) {
339
+ e.type = "company";
340
+ } } }, [e._v(" " + e._s(e.$t("_common:company").capitalize()) + " ")])])]), t("CField", { staticClass: "flex", attrs: { grouped: "" } }, [t("CField", { attrs: { label: e.isIndivid ? e.$t("_common:name").capitalize() : e.$t("_common:company").capitalize(), validator: e.$v.name, messages: e.messages.name, "label-position": "inside", expanded: "" } }, [t("ClientAutocomplete", { ref: "name", attrs: { placeholder: e.isIndivid ? e.$t("placeholders.name") : e.$t("placeholders.companyName"), "show-loading": !0, "search-enabled": e.searchEnabled }, on: { setClient: function(i) {
341
+ return e.$emit("setClient", i);
342
+ } }, model: { value: e.name, callback: function(i) {
343
+ e.name = i;
344
+ }, expression: "name" } })], 1), t("CField", { attrs: { label: e.isIndivid ? e.$t("_common:socialNo").capitalize() : e.$t("_common:orgNoShort").capitalize(), validator: e.$v.orgNo, messages: e.isIndivid ? e.messages.orgNo : e.messages.realOrgNo, "label-position": "inside", expanded: "" } }, [t("CInput", { ref: "orgNo", attrs: { placeholder: e.isIndivid ? e.$t("placeholders.socialNo") : e.$t("placeholders.orgNo") }, model: { value: e.orgNo, callback: function(i) {
345
+ e.orgNo = i;
346
+ }, expression: "orgNo" } })], 1)], 1), t("Animation", [e.type && !e.isIndivid ? t("CField", { staticClass: "pb-4", attrs: { validator: e.$v.reference, messages: e.messages.reference, label: e.$t("_common:reference").capitalize(), "label-position": "inside" } }, [t("CInput", { ref: "reference", attrs: { placeholder: e.$t("placeholders.reference") }, model: { value: e.reference, callback: function(i) {
347
+ e.reference = i;
348
+ }, expression: "reference" } })], 1) : e._e(), e.type && !e.isIndivid && e.feature("reverseVat") && e.feature("regionSE") ? t("CField", { staticStyle: { "padding-left": "0.5em", "margin-bottom": "2rem" } }, [t("CCheckbox", { attrs: { size: "normal" }, model: { value: e.reverseVat, callback: function(i) {
349
+ e.reverseVat = i;
350
+ }, expression: "reverseVat" } }, [e._v(" " + e._s(e.$t("_common:vat.reverseVat")) + " ")])], 1) : e._e()], 1), t("CField", { staticClass: "flex", attrs: { grouped: "" } }, [t("CField", { attrs: { validator: e.$v.email, messages: e.messages.email, label: e.$t("_common:email").capitalize(), "label-position": "inside", expanded: "" } }, [t("CInput", { ref: "email", attrs: { placeholder: e.$t("_common:email").capitalize() }, model: { value: e.email, callback: function(i) {
351
+ e.email = typeof i == "string" ? i.trim() : i;
352
+ }, expression: "email" } })], 1), t("CPhoneInput", { staticStyle: { "margin-bottom": "1.5rem" }, attrs: { label: e.$t("_common:cellphone").capitalize(), placeholder: e.$t("placeholders.cellphone"), region: e.cellphoneRegion, "default-region": e.companyRegion, "label-position": "inside" }, on: { "update:region": function(i) {
353
+ e.cellphoneRegion = i;
354
+ } }, model: { value: e.cellphone, callback: function(i) {
355
+ e.cellphone = i;
356
+ }, expression: "cellphone" } })], 1), t("CField", { attrs: { label: e.$t("_common:address").capitalize(), "label-position": "inside" } }, [t("CInput", { ref: "street", attrs: { placeholder: e.$t("placeholders.address") }, model: { value: e.street, callback: function(i) {
357
+ e.street = i;
358
+ }, expression: "street" } })], 1), t("CField", { staticClass: "flex force-two", attrs: { grouped: "" } }, [t("CField", { attrs: { expanded: "" } }, [t("CInput", { ref: "zip", attrs: { placeholder: e.$t("_common:zip").capitalize() }, model: { value: e.zip, callback: function(i) {
359
+ e.zip = i;
360
+ }, expression: "zip" } })], 1), t("CField", { attrs: { expanded: "" } }, [t("CInput", { ref: "city", attrs: { placeholder: e.$t("_common:city").capitalize() }, model: { value: e.city, callback: function(i) {
361
+ e.city = i;
362
+ }, expression: "city" } })], 1)], 1), t("CField", { staticClass: "flex" }, [t("CRadio", { staticStyle: { "margin-bottom": "0.5em" }, attrs: { "native-value": !1, type: "secondary", size: "small" }, model: { value: e.separateWorkAddress, callback: function(i) {
363
+ e.separateWorkAddress = i;
364
+ }, expression: "separateWorkAddress" } }, [e._v(" " + e._s(e.$t("seperateWorkAddress.false")) + " ")]), t("CRadio", { staticStyle: { "margin-bottom": "0.5em" }, attrs: { "native-value": !0, type: "secondary", size: "small" }, model: { value: e.separateWorkAddress, callback: function(i) {
365
+ e.separateWorkAddress = i;
366
+ }, expression: "separateWorkAddress" } }, [e._v(" " + e._s(e.$t("seperateWorkAddress.true")) + " ")])], 1), t("Animation", [e.type && e.separateWorkAddress ? t("div", [t("CField", { attrs: { label: e.$t("_common:addressWork").capitalize() + ` ( ${e.$t("workAddressSubLabel")} )` } }, [t("CInput", { ref: "workStreet", attrs: { placeholder: e.$t("placeholders.address") }, model: { value: e.workStreet, callback: function(i) {
367
+ e.workStreet = i;
368
+ }, expression: "workStreet" } })], 1), t("CField", { staticClass: "flex force-two", attrs: { grouped: "" } }, [t("CField", { attrs: { expanded: "" } }, [t("CInput", { ref: "workZip", attrs: { placeholder: e.$t("_common:zip").capitalize(), expanded: "" }, model: { value: e.workZip, callback: function(i) {
369
+ e.workZip = i;
370
+ }, expression: "workZip" } })], 1), t("CField", { attrs: { expanded: "" } }, [t("CInput", { ref: "workCity", attrs: { placeholder: e.$t("_common:city").capitalize(), expanded: "" }, model: { value: e.workCity, callback: function(i) {
371
+ e.workCity = i;
372
+ }, expression: "workCity" } })], 1)], 1)], 1) : e._e()]), e.documentRole || e.answerMethod ? t("CField", { staticClass: "flex pt-4", attrs: { grouped: "" } }, [e.documentRole ? t("div", { staticClass: "dropdown-field-wrapper" }, [t("div", { staticClass: "my-1 text-sm text-gray-600" }, [e._v(" " + e._s(e.$t("_common:documentRole.title")) + " ")]), t("CDropdown", { staticStyle: { "margin-bottom": "1rem" }, attrs: { expanded: "" } }, [t("CButton", { staticClass: "is-left", staticStyle: { width: "100%" }, attrs: { slot: "trigger", "dropdown-icon": !0, "icon-props": {
373
+ stroke: "hsl(0, 0%, 50%)"
374
+ }, "icon-left": e.documentRole === "signee" ? "pen-tool" : "eye", type: "none", pattern: "secondary" }, slot: "trigger" }, [t("div", { staticStyle: { "line-height": "1.25", padding: "4px 0" } }, [t("div", [e._v(e._s(e.$t(`_common:documentRole.${e.documentRole}.description`)))]), t("div", { staticStyle: { "font-size": "12px", opacity: "0.7" } }, [e._v(" " + e._s(e.$t(`_common:documentRole.${e.documentRole}.label`)) + " ")])])]), e._l(["signee", "recipient", "approver"], function(i) {
375
+ return t("CDropdownItem", { key: i, attrs: { "icon-left": i === "signee" ? "pen-tool" : "eye", "icon-props": {
376
+ stroke: "hsl(0, 0%, 50%)"
377
+ } }, on: { click: function(a) {
378
+ return e.$emit("update:document-role", i);
379
+ } } }, [t("div", { staticStyle: { "line-height": "1.25", padding: "4px 0" } }, [t("div", [e._v(e._s(e.$t(`_common:documentRole.${i}.description`)))]), t("div", { staticStyle: { "font-size": "12px", opacity: "0.7" } }, [e._v(" " + e._s(e.$t(`_common:documentRole.${i}.label`)) + " ")])])]);
380
+ })], 2)], 1) : e._e(), e.answerMethod ? t("div", { staticClass: "dropdown-field-wrapper" }, [t("div", { staticClass: "my-1 text-sm text-gray-600" }, [e._v(" " + e._s(e.$t("_common:signMethod.title")) + " ")]), t("CDropdown", { staticStyle: { "margin-bottom": "1rem" }, attrs: { expanded: "" } }, [t("CButton", { staticClass: "is-left", attrs: { slot: "trigger", "dropdown-icon": !0, type: "none", pattern: "secondary", wide: "" }, slot: "trigger" }, [t("div", { staticStyle: { "line-height": "1.25", padding: "4px 0" } }, [t("div", [e._v(e._s(e.$t(`signMethod.${e.answerMethod.accept}.title`)))]), t("div", { staticClass: "truncate", staticStyle: { "font-size": "12px", opacity: "0.7" } }, [e._v(" " + e._s(e.$t(`signMethod.${e.answerMethod.accept}.content`)) + " ")])])]), e._l([
381
+ ...!e.isPublicForm && e.feature("bankId") ? ["bankId"] : [],
382
+ "signature",
383
+ "inPerson"
384
+ ], function(i) {
385
+ return t("CDropdownItem", { key: i, on: { click: function(a) {
386
+ return e.$emit("update:answer-method", { ...e.answerMethod, accept: i });
387
+ } } }, [t("div", { staticStyle: { "line-height": "1.25", padding: "4px 0" } }, [t("div", [e._v(e._s(e.$t(`signMethod.${i}.title`)))]), t("div", { staticClass: "max-w-[12rem] truncate", staticStyle: { "font-size": "12px", opacity: "0.7", "text-wrap": "wrap" } }, [e._v(" " + e._s(e.$t(`signMethod.${i}.content`)) + " ")])])]);
388
+ })], 2)], 1) : e._e()]) : e._e(), t("div", { staticStyle: { "margin-top": "3rem" } }, [t("CButton", { staticStyle: { padding: "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: { loading: e.isPosting, type: "secondary", wide: "" }, on: { click: e.validateForm } }, [e._v(e._s(e.$t(`${e.id ? "update" : "create"}Button`)))])], 1)], 1)]);
389
+ }, I = [], F = /* @__PURE__ */ u(
390
+ S,
391
+ N,
392
+ I,
393
+ !1,
394
+ null,
395
+ "0a4c270d",
396
+ null,
397
+ null
398
+ );
399
+ const z = F.exports, { mapFields: M } = p({
400
+ getterType: "forms/getField",
401
+ mutationType: "forms/updateField"
402
+ }), R = {
403
+ name: "ClientModal",
404
+ i18nOptions: {
405
+ namespaces: "components",
406
+ keyPrefix: "account.documentForm.clients"
407
+ },
408
+ components: {
409
+ FormClient: z
410
+ },
411
+ props: {
412
+ documentClientIndex: {
413
+ type: Number,
414
+ default: 0
415
+ },
416
+ signOrder: {
417
+ type: Number,
418
+ default: 0
419
+ },
420
+ inputFocusOnMount: {
421
+ type: String,
422
+ default: ""
423
+ },
424
+ forceExpand: {
425
+ type: Boolean,
426
+ default: !1
427
+ },
428
+ // Optional prop if this modal is mounted from public form
429
+ isPublicForm: {
430
+ type: Boolean,
431
+ default: !1
432
+ }
433
+ },
434
+ data() {
435
+ return {
436
+ storedNewClient: {
437
+ documentRole: "signee",
438
+ answerMethod: {
439
+ accept: "signature",
440
+ deny: "button"
441
+ }
442
+ },
443
+ isLoading: !1,
444
+ hasChanged: !1,
445
+ showMore: !1
446
+ };
447
+ },
448
+ computed: {
449
+ ...M({
450
+ endCustomer: "endCustomer"
451
+ }),
452
+ ...b("forms", {
453
+ formData: (n) => n.document2
454
+ }),
455
+ ...f({
456
+ can: "application/can",
457
+ defaultClientType: "endCustomers/defaultClientType"
458
+ })
459
+ },
460
+ created() {
461
+ this.forceExpand && (this.showMore = !0);
462
+ const n = c(this.formData, `clients[${this.documentClientIndex}]`, {});
463
+ this.loadForm(n), ["endCustomer", "storedNewClient"].forEach((e) => this.$watch(e, {
464
+ deep: !0,
465
+ handler() {
466
+ this.hasChanged = !0;
467
+ }
468
+ }));
469
+ },
470
+ methods: {
471
+ ..._({
472
+ saveClient: d.FORM_SUBMIT_ENDCUSTOMER,
473
+ setFormValue: d.SET_FORM_VALUE,
474
+ showMessage: d.SHOW_MESSAGE
475
+ }),
476
+ loadForm(n = {}) {
477
+ this.storedNewClient = Object.assign(this.storedNewClient, n), this.endCustomer = y({
478
+ type: this.defaultClientType(),
479
+ ...n
480
+ });
481
+ },
482
+ async onSave() {
483
+ this.isLoading = !0;
484
+ let n = c(this.endCustomer, "id");
485
+ if (!this.isPublicForm) {
486
+ let e = !1;
487
+ this.endCustomer && (this.endCustomer.id ? this.can("endCustomers", "modify", this.endCustomer.id) && (e = !0) : this.can("endCustomers", "create") && (e = !0)), e && (n = await this.saveClient());
488
+ }
489
+ this.setFormValue({
490
+ key: `document2.clients[${this.documentClientIndex}]`,
491
+ value: C(
492
+ { ...this.endCustomer, ...n && { id: n } },
493
+ { ...this.storedNewClient, signOrder: this.signOrder }
494
+ )
495
+ }), this.$emit("close"), this.isLoading = !1;
496
+ },
497
+ close() {
498
+ return !this.hasChanged || !this.showMore ? this.$emit("close") : this.showMessage({
499
+ displayType: "dialog",
500
+ type: "danger",
501
+ title: this.$t("unsavedDialog.title"),
502
+ message: this.$t("unsavedDialog.message"),
503
+ actions: {
504
+ cancel: {
505
+ text: this.$t("unsavedDialog.cancel"),
506
+ callback: "cancel"
507
+ },
508
+ submit: {
509
+ text: this.$t("unsavedDialog.submit"),
510
+ callback: () => this.$emit("close")
511
+ }
512
+ }
513
+ });
514
+ }
515
+ }
516
+ };
517
+ var O = function() {
518
+ var e = this, t = e._self._c;
519
+ return t("div", { staticClass: "font-primary bg-black bg-opacity-10 fixed inset-0 sm:py-4 z-[1000] grid place-items-center overflow-auto max-sm:w-full max-sm:min-h-full max-sm:block max-sm:overflow-auto", on: { "&click": function(i) {
520
+ return i.target !== i.currentTarget ? null : e.close.apply(null, arguments);
521
+ } } }, [t("div", { staticClass: "relative flex flex-col items-center p-10 mx-auto text-lg bg-white rounded-xl max-sm:w-full max-sm:h-initial max-sm:min-h-full max-sm:rounded-none" }, [t("CButton", { staticClass: "absolute z-2 top-4 right-4", class: e.showMore ? "" : "sm:!hidden", attrs: { pattern: "tertiary", type: "none", circle: "", icon: "x" }, on: { click: e.close } }), t("FormClient", { staticClass: "max-w-full p-0", class: [e.showMore ? "w-[520px]" : "w-[360px]"], attrs: { "search-enabled": !0, "require-reference": !1, "simple-form": !e.showMore, "input-focus-on-mount": e.inputFocusOnMount, "document-role": e.storedNewClient.documentRole, "answer-method": e.storedNewClient.answerMethod, "is-public-form": e.isPublicForm }, on: { "update:documentRole": function(i) {
522
+ return e.$set(e.storedNewClient, "documentRole", i);
523
+ }, "update:document-role": function(i) {
524
+ return e.$set(e.storedNewClient, "documentRole", i);
525
+ }, "update:answerMethod": function(i) {
526
+ return e.$set(e.storedNewClient, "answerMethod", i);
527
+ }, "update:answer-method": function(i) {
528
+ return e.$set(e.storedNewClient, "answerMethod", i);
529
+ }, setClient: function(i) {
530
+ return e.loadForm(i);
531
+ }, submit: e.onSave, "show-more": function(i) {
532
+ e.showMore = !0;
533
+ } } })], 1)]);
534
+ }, A = [], q = /* @__PURE__ */ u(
535
+ R,
536
+ O,
537
+ A,
538
+ !1,
539
+ null,
540
+ null,
541
+ null,
542
+ null
543
+ );
544
+ const T = q.exports;
545
+ export {
546
+ T as default
547
+ };