@cling-se/widget 0.17.0 → 1.0.0-beta.2

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 (232) hide show
  1. package/dist/AddClientCallout-e8d19R3f.js +101 -0
  2. package/dist/AnswerModal-BGvB8IVV.js +3291 -0
  3. package/dist/AttachmentItem-CkHbAm4l.js +171 -0
  4. package/dist/BaseUpload-BiJBcWRu.js +2472 -0
  5. package/dist/BlockMedia-CW5wgipC.js +103 -0
  6. package/dist/CCallout-Cy2eeIYd.js +104 -0
  7. package/dist/{CCurrencyDropdown-C2rXt2cJ.js → CCurrencyDropdown-DE_3CTjm.js} +91 -53
  8. package/dist/CDropdownItem-Dmq5gYzA.js +751 -0
  9. package/dist/CFormField.vue_vue_type_script_setup_true_lang-D_U9coAY.js +292 -0
  10. package/dist/{CPhoneFormat-C8VPsiK6.js → CPhoneFormat-BS2nP9kc.js} +13 -21
  11. package/dist/CPhoneInput-Bf6329PO.js +207 -0
  12. package/dist/CPriceInput-d1yjuMQr.js +140 -0
  13. package/dist/CSelect-DgnT07Hk.js +98 -0
  14. package/dist/CSkeleton.vue_vue_type_script_setup_true_lang-Ckl--dyv.js +51 -0
  15. package/dist/ClientAutocomplete-9JzGcO9O.js +532 -0
  16. package/dist/ClientModal-BzWQtWSZ.js +1181 -0
  17. package/dist/ColorPicker-BvoFN8nu.js +1408 -0
  18. package/dist/CompanyModal-Bp4V_az9.js +250 -0
  19. package/dist/ContentWrapper-CuH6xKmo.js +265 -0
  20. package/dist/CoverBlockSettings-BA5L0Zee.js +861 -0
  21. package/dist/DocAnswer-BcNA_KEg.js +33 -0
  22. package/dist/DocDetails-CStEwWnU.js +448 -0
  23. package/dist/DocForm-BOoILf5E.js +6748 -0
  24. package/dist/DocFormSend-CQIf-HJY.js +171 -0
  25. package/dist/DocLinks-BRX5QzNe.js +36 -0
  26. package/dist/DocModalBase-D72yWj-x.js +29 -0
  27. package/dist/DocPrint-BI1LXUPE.js +399 -0
  28. package/dist/DocReceipt-DaZ4V76p.js +341 -0
  29. package/dist/DocSendReminder-DKGZlo7s.js +181 -0
  30. package/dist/DocTextEditor-Dm-cTZpA.js +19413 -0
  31. package/dist/DocTimeline-DCwofzuk.js +537 -0
  32. package/dist/DocumentClient-vJdxCB53.js +90 -0
  33. package/dist/DocumentLayout-CKSi42ev.js +1368 -0
  34. package/dist/DocumentLogotype-DbQlvQ-y.js +162 -0
  35. package/dist/DocumentVoided-CRX2WxWO.js +33 -0
  36. package/dist/EmbedInput-B-oeC4Wy.js +157 -0
  37. package/dist/EmbedSettings-B9Yka2yB.js +103 -0
  38. package/dist/ErrorCallout-B_ygH33E.js +34 -0
  39. package/dist/FilePreviewModal-Bf3ELTow.js +202 -0
  40. package/dist/Flag-BwTgCNHO.js +41 -0
  41. package/dist/HeaderSettings-DvC7nlyY.js +720 -0
  42. package/dist/ImageSelectModal-D3sP3lhR.js +119 -0
  43. package/dist/ImageUploadWrapper-RWNa-yIq.js +1585 -0
  44. package/dist/Index-0_3ULrWX.js +126 -0
  45. package/dist/Index-4NPe0sfX.js +629 -0
  46. package/dist/Index-B1uA0FF6.js +4 -0
  47. package/dist/Index-BBkCYm2q.js +201 -0
  48. package/dist/{Index-LzN6dktq.js → Index-BBwvo7S9.js} +10 -18
  49. package/dist/Index-BEMlsYwJ.js +68 -0
  50. package/dist/Index-BRBhJ6kz.js +21 -0
  51. package/dist/{Index-BPUYpfLJ.js → Index-BTFmHjUt.js} +47 -60
  52. package/dist/Index-BcUNnxLC.js +1098 -0
  53. package/dist/Index-Bo6ExBUL.js +93 -0
  54. package/dist/Index-BvMPCgdH.js +102 -0
  55. package/dist/Index-Bx5TOI9k.js +74 -0
  56. package/dist/Index-C7GZS8EI.js +16 -0
  57. package/dist/Index-CNWhm07R.js +25 -0
  58. package/dist/{Index-BUK-1yVR.js → Index-CQpznMKV.js} +9 -17
  59. package/dist/Index-CRzsnIij.js +159 -0
  60. package/dist/Index-CeSG1C41.js +140 -0
  61. package/dist/Index-CjfjdZj5.js +52 -0
  62. package/dist/Index-CskKmZpd.js +363 -0
  63. package/dist/Index-D5qwbCo1.js +28 -0
  64. package/dist/Index-D8Ae1Txt.js +228 -0
  65. package/dist/Index-DE8aenDB.js +3452 -0
  66. package/dist/Index-DI5EB5Rt.js +39 -0
  67. package/dist/Index-DaV57YPP.js +163 -0
  68. package/dist/Index-DbwkmoyM.js +38 -0
  69. package/dist/Index-Df9skok6.js +70 -0
  70. package/dist/{Index-BHJGfHm9.js → Index-DfLLA0ij.js} +313 -206
  71. package/dist/Index-Dw1CO5F9.js +76 -0
  72. package/dist/Index-PZXyOoVb.js +87 -0
  73. package/dist/{Index-BioOegOO.js → Index-ZUnH-BHj.js} +10 -18
  74. package/dist/Index-cjKGSiDi.js +136 -0
  75. package/dist/Index-m-goRuKD.js +49 -0
  76. package/dist/Index-rGeWbLcB.js +47 -0
  77. package/dist/Index-vrljNp6G.js +28 -0
  78. package/dist/Index.vue_vue_type_script_lang-aeVuChGF.js +671 -0
  79. package/dist/InputToggleRow-v6qAWPg6.js +99 -0
  80. package/dist/ManualPopover-BONBJIUA.js +57 -0
  81. package/dist/MediaWrapper-CXb2UGd9.js +18 -0
  82. package/dist/{NotBindingText-CM3FN0A6.js → NotBindingText-BqESO13N.js} +13 -17
  83. package/dist/PackageGroup-AIysVmyh.js +1058 -0
  84. package/dist/PdfTerms-BlhHdTu3.js +34 -0
  85. package/dist/PdfViewer-DwZ1rwlN.js +392 -0
  86. package/dist/PlainHtml.vue_vue_type_script_setup_true_lang-D6NNUTz0.js +17 -0
  87. package/dist/PriceHeader-C4XhnoA3.js +488 -0
  88. package/dist/SearchApi-B7lXgUY6.js +137 -0
  89. package/dist/SendForm-BcD0xSvB.js +7031 -0
  90. package/dist/Setup-C2qaYDei.js +47 -0
  91. package/dist/{SmartList-DhhjSWLO.js → SmartList-DqG7Q5t7.js} +16 -24
  92. package/dist/Sortable.vue_vue_type_script_setup_true_lang-CzMbr8AX.js +1303 -0
  93. package/dist/{TermsSettings-BEQwmkFH.js → TermsSettings-BOCONyM4.js} +169 -56
  94. package/dist/ThemeColorRow-sjGdMzGN.js +108 -0
  95. package/dist/ToggleBinding-7oq_oXPt.js +44 -0
  96. package/dist/UploadModal-C_X2NjVY.js +134 -0
  97. package/dist/VideoPlayerInput-BsUcmpl4.js +135 -0
  98. package/dist/VideoPlayerSettings-BXMmxaZQ.js +78 -0
  99. package/dist/VideoSelectModal-CW0OweCw.js +217 -0
  100. package/dist/{anime.es-BrPTThYb.js → anime.es-gdcpA-eY.js} +1 -2
  101. package/dist/{color-TdtKxwVa.js → color-HetJPhlA.js} +1 -2
  102. package/dist/{debounce-D0hKNU85.js → debounce-DNl99Gyo.js} +10 -10
  103. package/dist/dom-CkTGWrfu.js +69 -0
  104. package/dist/{focusDrawerMixin-C_aTLmK0.js → focusDrawerMixin-BwcErMDY.js} +1 -1
  105. package/dist/{formDrawerState-Da4mcbab.js → formDrawerState-DaurePnd.js} +2 -2
  106. package/dist/helpers-CPW--XIz.js +44 -0
  107. package/dist/index-BjiGCJPI.js +149 -0
  108. package/dist/index-CFNv6OvX.js +188 -0
  109. package/dist/index-Cx71On5Z.js +508 -0
  110. package/dist/index-DKMxIBz_.js +270 -0
  111. package/dist/index-DKf5SGLD.js +125 -0
  112. package/dist/index-E32WgUp9.js +3525 -0
  113. package/dist/index-kp-GC5I0.js +513 -0
  114. package/dist/index.es.js +2 -5
  115. package/dist/index.umd.js +285 -1485
  116. package/dist/{main-BgzLHIoo.js → main-Cb-nyil1.js} +41414 -42507
  117. package/dist/mapFormMixin-D3BihYWW.js +1544 -0
  118. package/dist/omit--YYr41Xp.js +31 -0
  119. package/dist/{publicSenderState-DB4BHByV.js → publicSenderState-CdRW_Wwp.js} +4 -4
  120. package/dist/splitpanes-D-ThFkeR.js +342 -0
  121. package/dist/style.css +1 -4
  122. package/dist/template-BvaNnq-g.js +1493 -0
  123. package/dist/{throttle-DT2UVOqm.js → throttle-D-bUGaVh.js} +2 -2
  124. package/dist/tippy.esm-BmKNqohP.js +1994 -0
  125. package/dist/useTermsModal-Dhf6_eYb.js +87 -0
  126. package/dist/{utils-nos8CB1L.js → utils-CBPcYdLv.js} +8 -11
  127. package/dist/validation-DOcUOoMe.js +40 -0
  128. package/package.json +18 -21
  129. package/dist/AddClientCallout-BJzBdba1.js +0 -48
  130. package/dist/AnswerModal-frHq1g4s.js +0 -3874
  131. package/dist/AttachmentItem-BaN0OrEV.js +0 -85
  132. package/dist/BaseDatePicker-B-AfdrSb.js +0 -3187
  133. package/dist/BaseUpload-CY3lTcte.js +0 -1977
  134. package/dist/BlockMedia-Bb5wQIDg.js +0 -76
  135. package/dist/CCallout-5quI6yyk.js +0 -58
  136. package/dist/CDropdownItem-CaoSQX6X.js +0 -640
  137. package/dist/CFormField-Dd2Y71JG.js +0 -240
  138. package/dist/CPhoneInput-BU1t6eo_.js +0 -138
  139. package/dist/CPriceInput-pv2aIVkH.js +0 -116
  140. package/dist/CSelect-CrM45B7V.js +0 -91
  141. package/dist/CSkeleton-BkvONMqL.js +0 -55
  142. package/dist/ClientAutocomplete-BRXIKQSk.js +0 -438
  143. package/dist/ClientModal-CvHAptV2.js +0 -666
  144. package/dist/ColorPicker-RgoXRrud.js +0 -2879
  145. package/dist/CompanyModal-OL4bD9Gk.js +0 -147
  146. package/dist/ContentWrapper-8HduCnR4.js +0 -190
  147. package/dist/CoverBlockSettings-DUv8AcdX.js +0 -659
  148. package/dist/DocAnswer-DiyFfpT2.js +0 -36
  149. package/dist/DocDetails-BxNRfBnK.js +0 -263
  150. package/dist/DocForm-MGp-o0pu.js +0 -5017
  151. package/dist/DocFormSend-q_QuVCqh.js +0 -146
  152. package/dist/DocLinks-DGDdp30U.js +0 -38
  153. package/dist/DocModalBase-qG4RqwBn.js +0 -28
  154. package/dist/DocPrint-Cln3kt0g.js +0 -240
  155. package/dist/DocReceipt-nbsJ-ukZ.js +0 -217
  156. package/dist/DocSendReminder-B3qdqduf.js +0 -140
  157. package/dist/DocTextEditor-CQDnjnRY.js +0 -17193
  158. package/dist/DocTimeline-CgKHoDcG.js +0 -485
  159. package/dist/DocumentClient-UZlnIlz5.js +0 -136
  160. package/dist/DocumentLayout-Dvr4zgyF.js +0 -4880
  161. package/dist/DocumentLogotype-mAVgMRHr.js +0 -92
  162. package/dist/DocumentVoided-BXYNrf_6.js +0 -25
  163. package/dist/EmbedInput-YRUrw3c6.js +0 -117
  164. package/dist/EmbedSettings-DvRreF7H.js +0 -74
  165. package/dist/ErrorCallout-DVknpLVY.js +0 -27
  166. package/dist/FilePreviewModal-DC56FaGy.js +0 -81
  167. package/dist/Flag-D5iZLESg.js +0 -46
  168. package/dist/HeaderSettings-DXZnZL7A.js +0 -440
  169. package/dist/ImageSelectModal-Bu4_xZga.js +0 -86
  170. package/dist/ImageUploadWrapper-CtZhkAm1.js +0 -1604
  171. package/dist/Index-B1dJO6Bk.js +0 -54
  172. package/dist/Index-B3pz1coY.js +0 -150
  173. package/dist/Index-BHgW8EHW.js +0 -2446
  174. package/dist/Index-BNucs2O-.js +0 -154
  175. package/dist/Index-BW-EtZ1z.js +0 -55
  176. package/dist/Index-BjKACpun.js +0 -66
  177. package/dist/Index-C94BL4uU.js +0 -294
  178. package/dist/Index-CB57haU8.js +0 -58
  179. package/dist/Index-CP17iXT6.js +0 -25
  180. package/dist/Index-CUSbvjoD.js +0 -62
  181. package/dist/Index-CVnD6jo5.js +0 -25
  182. package/dist/Index-Ci5zdPeT.js +0 -28
  183. package/dist/Index-CikqSMjb.js +0 -41
  184. package/dist/Index-CxO4tJ3U.js +0 -26
  185. package/dist/Index-D4J4BpHd.js +0 -230
  186. package/dist/Index-DAQQQlut.js +0 -754
  187. package/dist/Index-DNxSR72J.js +0 -73
  188. package/dist/Index-DPuKRwmu.js +0 -41
  189. package/dist/Index-DSy8QG8T.js +0 -32
  190. package/dist/Index-DX6_D-J-.js +0 -77
  191. package/dist/Index-Dk0KaIKg.js +0 -643
  192. package/dist/Index-Hkzoh9QR.js +0 -24
  193. package/dist/Index-KsHJxWAa.js +0 -94
  194. package/dist/Index-TtItTuv6.js +0 -33
  195. package/dist/Index-YAD39Qvg.js +0 -146
  196. package/dist/Index-eh909lAz.js +0 -107
  197. package/dist/Index-otowKI_C.js +0 -56
  198. package/dist/Index-t_oVV8Rc.js +0 -84
  199. package/dist/Index-vG96oEXZ.js +0 -144
  200. package/dist/InputToggleRow-CcqJDguN.js +0 -57
  201. package/dist/ManualPopover-BE2IN-XU.js +0 -60
  202. package/dist/MediaWrapper-lnGUFiyc.js +0 -23
  203. package/dist/PackageGroup-BsmxOMLW.js +0 -704
  204. package/dist/PdfTerms-BgYwZoAZ.js +0 -31
  205. package/dist/PdfViewer-C0lDpjte.js +0 -383
  206. package/dist/PlainHtml-5YwYVj1v.js +0 -27
  207. package/dist/PriceHeader-CxqhpGS-.js +0 -338
  208. package/dist/SearchApi-BndaIbri.js +0 -161
  209. package/dist/SendForm-D7U9fG-5.js +0 -1023
  210. package/dist/Setup-CmAK2_ZT.js +0 -50
  211. package/dist/ThemeColorRow-BlnhzebY.js +0 -69
  212. package/dist/ToggleBinding-t_58JFya.js +0 -42
  213. package/dist/UploadModal-T-WpYNsN.js +0 -95
  214. package/dist/VideoPlayerInput-DKHKjMgX.js +0 -97
  215. package/dist/VideoPlayerSettings-DDMlUvSt.js +0 -61
  216. package/dist/VideoSelectModal-B9bbP0dd.js +0 -104
  217. package/dist/answerDocumentMixin-DXI_E5Kx.js +0 -51
  218. package/dist/dom-CWsqMElk.js +0 -71
  219. package/dist/formValidationMixin-WZ2lGndu.js +0 -49
  220. package/dist/index-B2l57ilt.js +0 -102
  221. package/dist/index-COKDjmM2.js +0 -167
  222. package/dist/index-HtKGcIng.js +0 -2700
  223. package/dist/index-LQ7NztTt.js +0 -81
  224. package/dist/index-fx5gR8fM.js +0 -351
  225. package/dist/index-zXXJrTvv.js +0 -492
  226. package/dist/mapFormMixin-CQgSN7dv.js +0 -3028
  227. package/dist/omit-ScS7B6c5.js +0 -31
  228. package/dist/simplebar.min-B0cB_p8g.js +0 -71
  229. package/dist/splitpanes-BHUVsCZF.js +0 -382
  230. package/dist/tippy.esm-CR89mtdY.js +0 -1805
  231. package/dist/vuedraggable.umd-CkXXkt1b.js +0 -3161
  232. package/dist/vuex.esm-DKGl8mcw.js +0 -467
@@ -1,1023 +0,0 @@
1
- import { m as d } from "./mapFormMixin-CQgSN7dv.js";
2
- import { I as S, a as w } from "./index-HtKGcIng.js";
3
- import { aB as u, h as $, n as o, b as l, aC as b, v as k, z as D, aD as g, aE as M } from "./main-BgzLHIoo.js";
4
- import { B as f } from "./BaseDatePicker-B-AfdrSb.js";
5
- import { C as h, a as y, b as F } from "./CDropdownItem-CaoSQX6X.js";
6
- import { E as A } from "./ErrorCallout-DVknpLVY.js";
7
- import { C as O, a as I } from "./ClientModal-CvHAptV2.js";
8
- import { s as B } from "./simplebar.min-B0cB_p8g.js";
9
- import { b as P, m as c } from "./vuex.esm-DKGl8mcw.js";
10
- import V from "./AddClientCallout-BJzBdba1.js";
11
- function _(n, e) {
12
- const t = new Date(n.getTime());
13
- return t.setDate(
14
- n.getDate() + (7 + e - n.getDay() - 1) % 7 + 1
15
- ), t.setHours(8, 0, 0, 0), t;
16
- }
17
- function C(n) {
18
- const e = new Date(n.getTime());
19
- return e.setDate(e.getDate() + 1), e.setHours(10, 0, 0, 0), e;
20
- }
21
- let p = C(/* @__PURE__ */ new Date()), v = _(/* @__PURE__ */ new Date(), 1);
22
- const R = {
23
- name: "DocumentSendLater",
24
- i18nOptions: {
25
- namespaces: "documentSendLater",
26
- messages: {
27
- en: {
28
- title: "Schedule Delivery",
29
- tomorrowMorning: "Tomorrow morning",
30
- mondayMorning: "Monday morning",
31
- custom: {
32
- title: "Set time & date",
33
- invalid: "Time & date can't be in the past"
34
- }
35
- },
36
- sv: {
37
- title: "Skicka med schemaläggning",
38
- tomorrowMorning: "Imorgon förmiddag",
39
- mondayMorning: "Måndag morgon",
40
- custom: {
41
- title: "Välj datum & tid",
42
- invalid: "Välj en tid & datum längre fram i tiden."
43
- }
44
- }
45
- }
46
- },
47
- components: {
48
- BaseDatePicker: f
49
- },
50
- props: {
51
- _document: {
52
- type: Object,
53
- default: () => ({})
54
- },
55
- setFormValue: {
56
- type: Function,
57
- required: !0
58
- },
59
- removeFormValue: {
60
- type: Function,
61
- required: !0
62
- },
63
- onSaveDocument: {
64
- type: Function,
65
- required: !0
66
- }
67
- },
68
- data() {
69
- return {
70
- sendAt: u(/* @__PURE__ */ new Date(), 5).toISOString(),
71
- showCustom: !1,
72
- backupSentFlag: !1
73
- // needed since doc/project flags not instant on double clicks
74
- };
75
- },
76
- validations: {
77
- sendAt: {
78
- minValue: (n) => n > u(/* @__PURE__ */ new Date(), 2).toISOString()
79
- // two minutes as safety
80
- }
81
- },
82
- computed: {
83
- ...P("forms", {
84
- formData: (n) => n.document2.data
85
- }),
86
- ...c({
87
- deliveryTypes: "forms/deliveryTypes",
88
- isPostingDocument: "documents2/isPosting",
89
- feature: "application/feature"
90
- }),
91
- tomorrowMorning() {
92
- return p.toISOString();
93
- },
94
- mondayMorning() {
95
- return v.toISOString();
96
- },
97
- reminderDeliveryTypes() {
98
- const n = ["email"];
99
- return this.feature("sms") && n.push("sms"), this.deliveryTypes ? [
100
- ...this.deliveryTypes.sms && this.feature("sms") ? ["sms"] : [],
101
- ...this.deliveryTypes.email ? ["email"] : []
102
- ] : n;
103
- }
104
- },
105
- created() {
106
- p = C(/* @__PURE__ */ new Date()), v = _(/* @__PURE__ */ new Date(), 1);
107
- },
108
- methods: {
109
- setTime(n) {
110
- const e = n.split(":"), t = new Date(this.sendAt).setHours(e[0], e[1]);
111
- t && (this.sendAt = new Date(t).toISOString());
112
- },
113
- setDate(n) {
114
- const e = new Date(this.sendAt), t = new Date(n).setHours(e.getHours(), e.getMinutes());
115
- this.sendAt = new Date(t).toISOString();
116
- },
117
- async onSendAt(n) {
118
- try {
119
- if (this.$v.$invalid || this.isPostingDocument || this.backupSentFlag)
120
- return;
121
- this.backupSentFlag = !0;
122
- const e = {
123
- type: "first",
124
- status: "new",
125
- sendDays: 0,
126
- sendAt: n,
127
- deliveryTypes: this.reminderDeliveryTypes,
128
- tries: 0
129
- }, t = this.formData.reminders.findIndex(
130
- (i) => i.type === "first"
131
- ), s = t >= 0 ? `data.reminders[${t}]` : "data.reminders";
132
- this.setFormValue({ key: s, value: e }), await this.onSaveDocument({ doSend: !0 }), this.backupSentFlag = !1;
133
- } catch (e) {
134
- $(e);
135
- } finally {
136
- this.backupSentFlag = !1;
137
- }
138
- }
139
- }
140
- };
141
- var z = function() {
142
- var e = this, t = e._self._c;
143
- return t("div", { staticClass: "overflow-hidden rounded-xl bg-white" }, [t("div", { staticClass: "px-6 pb-3 pt-8" }, [t("div", { staticClass: "text-md text-center font-semibold" }, [e._v(" " + e._s(e.$t("title")) + " ")]), t("div", { staticClass: "pt-8" }, e._l([
144
- [e.tomorrowMorning, "tomorrowMorning"],
145
- [e.mondayMorning, "mondayMorning"]
146
- ], function(s, i) {
147
- return t("div", { key: i, staticClass: "mb-4 flex cursor-pointer select-none items-center justify-between rounded-md border border-gray-200 bg-gray-50 p-4 text-sm hover:border-gray-300 hover:bg-gray-100 active:border-gray-400 active:bg-gray-200", on: { click: () => e.onSendAt(s[0]) } }, [t("div", { staticClass: "font-medium" }, [e._v(e._s(e.$t(s[1])))]), t("div", { staticClass: "text-gray-500" }, [e._v(" " + e._s(e.$formatDate(s[0], "p, d MMM")) + " ")])]);
148
- }), 0)]), t("div", { staticClass: "border-t border-gray-200 bg-gray-100 px-8 py-6", class: e.showCustom ? "" : "cursor-pointer hover:bg-gray-200", on: { click: function(s) {
149
- e.showCustom = !0;
150
- } } }, [t("div", { staticClass: "flex items-center text-sm" }, [t("CIcon", { staticClass: "text-primary-500 mr-2", attrs: { type: "calendar", size: "18" } }), t("div", { staticClass: "font-medium", domProps: { textContent: e._s(e.$t("custom.title")) } })], 1), t("Animation", [t("div", { directives: [{ name: "show", rawName: "v-show", value: e.showCustom, expression: "showCustom" }], staticClass: "mt-4" }, [t("div", { staticClass: "grid grid-cols-2 gap-4" }, [t("BaseDatePicker", { attrs: { value: e.sendAt }, on: { input: e.setDate } }), t("CInput", { attrs: { value: e.$formatDate(e.sendAt, "HH:mm"), type: "time" }, on: { input: e.setTime } })], 1), e.$v.$invalid ? t("div", { staticClass: "error-wrapper" }, [t("CIcon", { staticClass: "text-primary-500 mr-2", attrs: { type: "calendar" } }), e._v(" " + e._s(e.$t("custom.invalid")) + " ")], 1) : e._e(), t("CButton", { staticStyle: { "margin-top": "calc(1.5 * var(--rem))" }, attrs: { loading: e.isPostingDocument, type: "secondary", wide: "" }, on: { click: function(s) {
151
- return e.onSendAt(e.sendAt);
152
- } } }, [e._v(" " + e._s(e.$t("_common:send")) + " " + e._s(e.$formatDate(e.sendAt, "d MMM - p")) + " ")])], 1)])], 1)]);
153
- }, T = [], E = /* @__PURE__ */ o(
154
- R,
155
- z,
156
- T,
157
- !1,
158
- null,
159
- "dcfae061"
160
- );
161
- const N = E.exports, L = {
162
- sv: {
163
- title: "Skicka dokument",
164
- nameLabel: "Dokumentnamn",
165
- namePlaceholder: "Namn",
166
- sendAs: "Skicka som",
167
- validityPeriod: "Giltighetstid",
168
- manualDelivery: "Manuell leverans",
169
- manualDeliveryTooltip: "Skicka ut dokument till din mottagare själv. Du kan dela en länk eller en PDF.",
170
- scheduledTooltip: "Schemalägg utskick",
171
- clientsAreMissingContactInfo: "En eller flera mottagare saknar e-post eller mobiltelefon-nr. Dokumentet kommer inte att kunna skickas till dem.",
172
- missingDeliveryMethod: "Välj en eller fler leveransmetoder",
173
- sendButton: "Skicka dokument",
174
- signMethod: {
175
- title: "Signeringsmetod",
176
- tooltip: "Hur ska din mottagare signera?",
177
- button: {
178
- title: "Standard - knapptryck",
179
- content: "Bevisnivå: IP-adress, tidpunkt och enhet."
180
- },
181
- bankId: {
182
- title: "BankId",
183
- content: "Samma säkerhetsgrad som bankerna har."
184
- },
185
- signature: {
186
- title: "Standard",
187
- content: "Bevisnivå: IP-adress, tidpunkt och enhet."
188
- },
189
- inPerson: {
190
- title: "Fysisk underskrift",
191
- content: "Signatur på utskrivet dokument"
192
- }
193
- }
194
- },
195
- en: {
196
- title: "Send document",
197
- nameLabel: "Document name",
198
- namePlaceholder: "Name",
199
- sendAs: "Send as",
200
- validityPeriod: "Expiration",
201
- manualDelivery: "Manual delivery",
202
- manualDeliveryTooltip: "Share the document with your recipient yourself. You can share a link or a PDF.",
203
- scheduledTooltip: "Schedule delivery",
204
- clientsAreMissingContactInfo: "Note that one or more recipients are missing an email or cellphone number. The document will not be sent to them.",
205
- missingDeliveryMethod: "Please select one or more delivery methods",
206
- sendButton: "Send document",
207
- signMethod: {
208
- title: "Signing method",
209
- tooltip: "How do you want your client to sign?",
210
- button: {
211
- title: "Standard - button",
212
- content: "Level of proof: IP address, timestamp and device."
213
- },
214
- bankId: {
215
- title: "BankID",
216
- content: "Same level of proof as the banks use."
217
- },
218
- signature: {
219
- title: "Signature",
220
- content: "Level of proof: IP address, timestamp and device."
221
- },
222
- inPerson: {
223
- title: "In person",
224
- content: "Signature on print document"
225
- }
226
- }
227
- }
228
- }, j = {
229
- sv: {
230
- addFirstButton: "Lägg till mottagare",
231
- addButton: "Lägg till mottagare",
232
- signOrder: {
233
- label: "Signeringsordning",
234
- tooltip: "Signeringsordning låter dig bestämma i vilken ordning dina mottagare tar emot och signerar dokumentet."
235
- }
236
- },
237
- en: {
238
- addFirstButton: "Add recipient",
239
- addButton: "Add recipient",
240
- signOrder: {
241
- label: "Signing order",
242
- tooltip: "Signing order lets you decide the order in which your recipients receive and sign your documents."
243
- }
244
- }
245
- }, H = {
246
- name: "ClientSendListItem",
247
- components: {
248
- CDropdown: h
249
- },
250
- props: {
251
- client: {
252
- type: Object,
253
- default: () => ({})
254
- },
255
- isOrder: {
256
- type: Boolean,
257
- default: !1
258
- },
259
- isSender: {
260
- type: Boolean,
261
- default: !1
262
- },
263
- compact: {
264
- type: Boolean,
265
- default: !1
266
- },
267
- allowEditClients: {
268
- type: Boolean,
269
- default: !0
270
- },
271
- rightButton: {
272
- // TODO temporary in order to disable sender sign for widget context
273
- type: Boolean,
274
- default: !0
275
- }
276
- },
277
- data() {
278
- return {
279
- isHover: !1,
280
- isDropdownOpen: !1
281
- };
282
- },
283
- methods: {
284
- onClick() {
285
- var n;
286
- if (this.rightButton && this.isSender)
287
- return (n = this.$refs.dropdown) == null ? void 0 : n.toggle();
288
- this.allowEditClients && this.$emit("open");
289
- }
290
- }
291
- };
292
- var q = function() {
293
- var s;
294
- var e = this, t = e._self._c;
295
- return t("div", { staticClass: "rc-card flex items-center", class: {
296
- "is-hover": e.isHover,
297
- "has-controls": e.isOrder
298
- }, staticStyle: { "padding-left": "8px" }, on: { click: e.onClick, "&mouseover": function(i) {
299
- e.isHover = !0;
300
- }, "&mouseleave": function(i) {
301
- e.isHover = !1;
302
- } } }, [e.compact ? t("div", { staticStyle: { "font-size": "14px" } }, [t("div", [e._v(e._s(e.client.name || e.client.companyName))]), e.client.name && e.client.companyName ? t("div", { staticStyle: { "font-size": "12px", "font-weight": "500" } }, [e._v(" " + e._s(e.client.companyName) + " ")]) : e._e(), e.client.documentRole ? t("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 ? t("div", { staticClass: "compact-order" }, [t("CIcon", { staticClass: "compact-order-button", attrs: { size: "16", type: "chevron-up" }, on: { click: function(i) {
303
- return i.preventDefault(), i.stopPropagation(), e.$emit("move", -1);
304
- } } }), t("div", { staticClass: "rc-order", staticStyle: { width: "20px", height: "20px" } }, [e._v(" " + e._s(e.client.signOrder) + " ")]), t("CIcon", { staticClass: "compact-order-button", attrs: { size: "16", type: "chevron-down" }, on: { click: function(i) {
305
- return i.preventDefault(), i.stopPropagation(), e.$emit("move", 1);
306
- } } })], 1) : e._e()]) : [t("div", { staticStyle: { width: "34px", flex: "0 0 34px", display: "inline-flex", "justify-content": "center" } }, [e.isOrder ? t("div", { staticStyle: { position: "relative", display: "inline-block" } }, [t("CButton", { staticClass: "rc-order__button up", attrs: { type: "none", pattern: "primary", circle: "", raised: "", size: "small", icon: "minus" }, on: { click: function(i) {
307
- return i.preventDefault(), i.stopPropagation(), e.$emit("move", -1);
308
- } } }), t("CButton", { staticClass: "rc-order__button down", attrs: { type: "none", pattern: "primary", circle: "", raised: "", size: "small", icon: "plus" }, on: { click: function(i) {
309
- return i.preventDefault(), i.stopPropagation(), e.$emit("move", 1);
310
- } } }), t("div", { staticClass: "rc-order" }, [e._v(" " + e._s(e.client.signOrder) + " ")])], 1) : t("CIcon", { 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), t("div", { staticClass: "rc-data truncate-text" }, [e.client.name || e.client.companyName ? t("div", { staticStyle: { "font-weight": "500" } }, [e._v(" " + e._s(e.client.name || e.client.companyName) + " ")]) : e.isSender ? t("div", { staticClass: "text-gray-500" }, [e._v(" " + e._s(e.$t("_common:empty", { thing: e.$t("_common:reference") })) + " ")]) : t("div", { staticClass: "text-gray-500" }, [e._v(" " + e._s(e.$t("_common:missing", { thing: e.$t("_common:name") })) + " ")]), t("div", { staticClass: "text-gray-700", staticStyle: { "font-size": "12px" } }, [e.isSender ? [e.isSender ? t("span", [e._v(" " + e._s(e.$t("_common:documentRole.sender.description")) + " ")]) : e._e(), e.client.documentRole === "signee" ? t("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" ? t("span", { staticClass: "text-red-500" }, [e._v(" " + e._s(e.$t("_common:signMethod.title")) + ": "), t("span", [e._v(" " + e._s(e.$t("_common:signMethod.inPerson")) + " ")])]) : e._e(), e.client.documentRole ? t("span", [e._v(" " + e._s(e.$t(`_common:documentRole.${e.client.documentRole}.description`)) + " ")]) : e._e(), e.client.email ? t("span", [e._v(e._s(e.client.email))]) : e._e(), e.client.cellphone ? t("span", [e._v(e._s(e.client.cellphone))]) : e._e()]], 2)])], e.rightButton ? t("transition", { attrs: { name: "fade-100" } }, [e.isHover || e.isDropdownOpen ? [e.isSender ? t("CDropdown", { ref: "dropdown", staticStyle: { position: "absolute", right: "calc(0.5 * var(--rem))" }, attrs: { position: "is-bottom-left", "menu-styling": {
311
- minWidth: "220px"
312
- }, "append-to-body": "" }, on: { "active-change": function(i) {
313
- e.isDropdownOpen = i;
314
- } }, nativeOn: { click: function(i) {
315
- i.stopPropagation();
316
- } }, scopedSlots: e._u([{ key: "trigger", fn: function() {
317
- return [t("CButton", { attrs: { circle: "", size: "small", type: "none", pattern: "secondary", raised: "", icon: "more-horizontal" } })];
318
- }, proxy: !0 }], null, !1, 383536082) }, [e._t("dropdownOptions")], 2) : e.allowEditClients ? t("CButton", { staticStyle: { position: "absolute", right: "calc(0.5 * var(--rem))" }, attrs: { circle: "", size: "small", icon: "x", type: "none", pattern: "secondary", raised: "" }, on: { click: function(i) {
319
- return i.stopPropagation(), e.$emit("remove");
320
- } } }) : e._e()] : e._e()], 2) : e._e()], 2);
321
- }, K = [], W = /* @__PURE__ */ o(
322
- H,
323
- q,
324
- K,
325
- !1,
326
- null,
327
- "31fc528c"
328
- );
329
- const x = W.exports, G = {
330
- name: "SenderBlockItem",
331
- i18nOptions: {
332
- namespaces: "senderBlockItem",
333
- messages: {
334
- en: {
335
- toggle: {
336
- label: "Sign the document",
337
- description: "Toggle to add your own signature to the document."
338
- }
339
- },
340
- sv: {
341
- toggle: {
342
- label: "Signera dokumentet",
343
- description: "Aktivera för att lägga till din signatur på dokumentet."
344
- }
345
- }
346
- }
347
- },
348
- components: {
349
- RecipientBlockItem: x,
350
- CDropdownItem: y
351
- },
352
- mixins: [
353
- d(["senderClient"], {
354
- useEmit: !1,
355
- setFnName: "setFormValue"
356
- })
357
- ],
358
- inject: {
359
- allowSenderSign: {
360
- default: !0
361
- }
362
- },
363
- props: {
364
- setFormValue: {
365
- type: Function,
366
- required: !0
367
- },
368
- defaultAddSenderClient: {
369
- type: Boolean,
370
- default: !1
371
- }
372
- },
373
- data() {
374
- return {
375
- senderClientData: null
376
- };
377
- },
378
- computed: {
379
- ...c({
380
- feature: "application/feature"
381
- })
382
- },
383
- created() {
384
- this.generateSenderClient(), this._document.id || this._document.isDirty("senderClient") ? this.toggleSenderSign(!!this.senderClient) : this.defaultAddSenderClient && this.toggleSenderSign(!0);
385
- },
386
- methods: {
387
- get: l,
388
- generateSenderClient() {
389
- const { company: n, user: e } = this._document.sender || {}, t = l(
390
- this._document,
391
- "data.defaultAnswerMethod"
392
- );
393
- this.senderClientData = {
394
- ...b(),
395
- documentRole: "recipient",
396
- ...t && { answerMethod: t },
397
- ...this.senderClient,
398
- // latest sender values in the document
399
- type: "company",
400
- companyName: n.name,
401
- name: e.name,
402
- email: e.email,
403
- cellphone: e.cellphone
404
- };
405
- },
406
- toggleSenderSign(n) {
407
- this.senderClientData.documentRole = n ? "signee" : "recipient", this.senderClient = n ? this.senderClientData : null, this._document.setDirty("senderClient");
408
- },
409
- setSenderMethod(n) {
410
- const e = {
411
- ...this.senderClient,
412
- answerMethod: {
413
- accept: n,
414
- deny: "button"
415
- }
416
- };
417
- this.senderClient = e, this.senderClientData = { ...e };
418
- }
419
- }
420
- };
421
- var Y = function() {
422
- var e = this, t = e._self._c;
423
- return e.senderClientData ? t("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 }, scopedSlots: e._u([{ key: "dropdownOptions", fn: function() {
424
- return [t("CDropdownItem", { attrs: { value: !!e.senderClient, "close-on-click": !1, toggle: "" }, on: { input: e.toggleSenderSign } }, [e._v(" " + e._s(e.$t("toggle.label")) + " ")]), e.senderClient ? [t("CDropdownItem", { attrs: { separator: "" } }), t("div", { staticClass: "text-gray-400", staticStyle: { "font-size": "13px", padding: "calc(0.5 * var(--rem)) 0 calc(0.25 * var(--rem))", "font-weight": "500" } }, [e._v(" " + e._s(e.$t("_common:signMethod.title")) + " ")]), e._l([
425
- "login",
426
- "signature",
427
- ...e.feature("bankId") ? ["bankId"] : []
428
- ], function(s) {
429
- return t("CDropdownItem", { key: s, attrs: { "icon-right": e.get(e.senderClient, "answerMethod.accept") === s ? "check" : "" }, on: { click: function(i) {
430
- return e.setSenderMethod(s);
431
- } } }, [e._v(" " + e._s(e.$t(`_common:signMethod.${s}`)) + " ")]);
432
- })] : t("div", { staticClass: "bg-gray-100 text-gray-700", staticStyle: { padding: "calc(0.5 * var(--rem))", margin: "calc(0.5 * var(--rem))", "font-size": "13px", "border-radius": "4px", "line-height": "1.25", "font-weight": "500" } }, [e._v(" " + e._s(e.$t("toggle.description")) + " ")])];
433
- }, proxy: !0 }], null, !1, 407561968) }) : e._e();
434
- }, J = [], Q = /* @__PURE__ */ o(
435
- G,
436
- Y,
437
- J,
438
- !1,
439
- null,
440
- "94b566c1"
441
- );
442
- const X = Q.exports, Z = {
443
- name: "RecipientBlock",
444
- i18nOptions: {
445
- namespaces: "recipientBlock",
446
- messages: j
447
- },
448
- components: {
449
- AddClientCallout: V,
450
- RecipientBlockItem: x,
451
- SenderBlockItem: X,
452
- CSwitch: F
453
- },
454
- mixins: [
455
- d(["clients"], {
456
- useEmit: !1,
457
- setFnName: "setFormValue"
458
- })
459
- ],
460
- props: {
461
- compact: {
462
- type: Boolean,
463
- default: !1
464
- },
465
- setFormValue: {
466
- type: Function,
467
- required: !0
468
- },
469
- removeFormValue: {
470
- type: Function,
471
- required: !0
472
- },
473
- defaultAddSenderClient: {
474
- type: Boolean,
475
- default: !1
476
- },
477
- allowEditClients: {
478
- type: Boolean,
479
- default: !0
480
- },
481
- isPublicForm: {
482
- type: Boolean,
483
- default: !1
484
- }
485
- },
486
- computed: {
487
- sortedClients() {
488
- return [...this.clients].map((n, e) => ({ ...n, index: e })).sort((n, e) => n.signOrder - e.signOrder);
489
- },
490
- maxSignOrder() {
491
- if (!this.useSignOrder || this.sortedClients.length === 0)
492
- return 0;
493
- const { signOrder: n } = this.sortedClients[this.sortedClients.length - 1];
494
- return n;
495
- },
496
- useSignOrder() {
497
- return l(this._document, "useSignOrder", !1);
498
- },
499
- getView() {
500
- return k.value;
501
- }
502
- },
503
- methods: {
504
- onMoveRecipient({ index: n, direction: e }) {
505
- this.clients = D(this.clients).set(
506
- {
507
- ...this.clients[n],
508
- signOrder: Math.max(this.clients[n].signOrder + e, 0)
509
- },
510
- n
511
- );
512
- },
513
- toggleSignOrder(n) {
514
- let e = [];
515
- if (n) {
516
- const t = !this.clients.every(
517
- ({ signOrder: s }) => !s
518
- );
519
- this.clients = this.clients.map((s, i) => ({
520
- ...s,
521
- signOrder: t ? s.signOrder : i + 1
522
- }));
523
- } else
524
- e = l(this._document, "template.reminders", []), e.length || (e = g.default);
525
- this.setFormValue({ key: "data.reminders", value: e }), this.setFormValue({ key: "useSignOrder", value: n });
526
- },
527
- removeClient(n) {
528
- this.removeFormValue(`clients[${n}]`);
529
- },
530
- openClientModal(n = 0) {
531
- var t;
532
- const e = l(this, `clients[${n}].signOrder`);
533
- this.$modal.show(O, {
534
- documentClientIndex: n,
535
- ...this.useSignOrder && {
536
- signOrder: M(e) === "number" ? e : this.maxSignOrder + 1
537
- },
538
- signOptions: (t = this._document) == null ? void 0 : t.signOptions,
539
- setFormValue: this.setFormValue,
540
- removeFormValue: this.removeFormValue,
541
- isPublicForm: this.isPublicForm
542
- });
543
- },
544
- setClient(n) {
545
- this.setFormValue({ key: `clients[${this.clients.length}]`, value: n });
546
- }
547
- }
548
- };
549
- var U = function() {
550
- var e = this, t = e._self._c;
551
- return t("div", [e.compact ? e._e() : [t("div", { staticClass: "pb-0.5 text-xs font-medium text-gray-900" }, [e._v(" " + e._s(e.$t("_common:from").capitalize()) + ": ")]), t("SenderBlockItem", { attrs: { _document: e._document, _value: { senderClient: "senderClient" }, "set-form-value": e.setFormValue, "default-add-sender-client": e.defaultAddSenderClient } })], t("div", { staticClass: "block-title flex pb-0.5 pt-2 text-xs text-gray-500", class: { "block-title__line": !e.compact } }, [e.compact ? e._e() : t("div", { staticClass: "font-medium text-gray-900" }, [e._v(" " + e._s(e.$t("_common:to").capitalize()) + ": ")]), e.clients && e.clients.length ? t("div", { staticClass: "ml-auto inline-flex items-center justify-end" }, [t("CIcon", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: e.$t("signOrder.tooltip"), expression: "$t('signOrder.tooltip')" }], staticClass: "mr-1", attrs: { type: "info", size: "14" } }), t("div", { staticClass: "mr-2 font-medium" }, [e._v(" " + e._s(e.$t("signOrder.label")) + " ")]), t("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 ? t("transition-group", { staticClass: "list-move", attrs: { name: "list-move" } }, [e._l(e.sortedClients, function(s, i) {
552
- return [i > 0 && s.signOrder !== e.sortedClients[i - 1].signOrder ? t("div", { key: i, staticClass: "h-2 pl-6" }, [t("div", { staticClass: "bg-primary-500 h-full w-0.5 rounded-sm" })]) : e._e(), t("div", { key: s._uniqueId, staticClass: "mb-0.5 mt-px" }, [t("RecipientBlockItem", { class: {
553
- "first-of-group": i === 0 || i > 0 && s.signOrder !== e.sortedClients[i - 1].signOrder,
554
- "last-of-group": i === e.sortedClients.length - 1 || e.sortedClients[i + 1] && s.signOrder !== e.sortedClients[i + 1].signOrder
555
- }, attrs: { client: s, "is-order": e.useSignOrder, compact: e.compact, "allow-edit-clients": e.allowEditClients }, on: { move: function(a) {
556
- return e.onMoveRecipient({ index: s.index, direction: a });
557
- }, open: function(a) {
558
- return e.openClientModal(s.index);
559
- }, remove: function(a) {
560
- return e.removeClient(s.index);
561
- } } })], 1)];
562
- })], 2) : e._l(e.clients, function(s, i) {
563
- return t("RecipientBlockItem", { key: s._uniqueId, staticClass: "mb-0.5 mt-px", class: {
564
- "first-of-group": i === 0,
565
- "last-of-group": i === e.clients.length - 1
566
- }, attrs: { "is-order": e.useSignOrder, compact: e.compact, "allow-edit-clients": e.allowEditClients, client: s }, on: { open: function(a) {
567
- return e.openClientModal(i);
568
- }, remove: function(a) {
569
- return e.removeClient(i);
570
- } } });
571
- }), !e.compact && e.allowEditClients ? t("CButton", { staticClass: "is-thinner !text-sm", attrs: { type: "secondary", pattern: "tertiary", "icon-left": "plus", size: "normal" }, on: { click: function(s) {
572
- return e.openClientModal(e.clients.length);
573
- } } }, [e._v(" " + e._s(e.$t("addButton")) + " ")]) : e._e()] : (e.getView === "widget" || e.viewSettings.isPublicForm) && e.allowEditClients ? t("CButton", { staticClass: "!px-4 font-medium", attrs: { type: "secondary", raised: "", size: "small", taller: "", "icon-left": "person" }, on: { click: function(s) {
574
- return e.openClientModal(e.clients.length);
575
- } } }, [e._v(" " + e._s(e.$t("addFirstButton")) + " ")]) : !e.compact && e.allowEditClients ? t("AddClientCallout", { attrs: { compact: !0 }, on: { add: function(s) {
576
- return e.openClientModal(e.clients.length);
577
- }, setClient: e.setClient } }) : e._e()], 2);
578
- }, ee = [], te = /* @__PURE__ */ o(
579
- Z,
580
- U,
581
- ee,
582
- !1,
583
- null,
584
- "e4291b52"
585
- );
586
- const ne = te.exports, se = {
587
- name: "DocumentSendReminderItem",
588
- props: {
589
- label: {
590
- type: String,
591
- required: !0
592
- },
593
- value: {
594
- type: [Number, String],
595
- default: 0
596
- },
597
- done: {
598
- type: Boolean,
599
- default: !1
600
- }
601
- }
602
- };
603
- var ie = function() {
604
- var e = this, t = e._self._c;
605
- return t("div", { staticClass: "mb-4 flex min-h-[2.5em] select-none items-center rounded-md bg-gray-100 px-4 py-2 text-sm font-medium" }, [t("div", { staticClass: "mr-6 flex-auto select-none text-gray-700" }, [e._v(" " + e._s(e.label) + " ")]), t("div", { staticClass: "flex flex-nowrap items-center justify-center text-sm" }, [e.done ? t("span", { staticClass: "text-green-500" }, [t("CIcon", { attrs: { type: "check", size: "18" } }), e._v(" " + e._s(e.$t("sent")) + " ")], 1) : [t("CButton", { staticClass: "!h-6 !w-6 bg-white", attrs: { icon: "minus", size: "small", circle: "", raised: "" }, on: { click: function(s) {
606
- e.$emit("input", Math.max(e.value - 1, 0));
607
- } } }), t("div", { staticClass: "min-w-[8ch] py-4 text-center text-sm font-medium text-gray-800" }, [e.value ? [e._v(" " + e._s(e.$tc("day", { count: Number(e.value) })) + " ")] : t("span", { staticClass: "text-xs text-gray-500" }, [e._v(" " + e._s(e.$t("disabled").capitalize()) + " ")])], 2), t("CButton", { staticClass: "!h-6 !w-6 bg-white", attrs: { icon: "plus", size: "small", circle: "", raised: "" }, on: { click: function(s) {
608
- return e.$emit("input", e.value + 1);
609
- } } })]], 2)]);
610
- }, re = [], ae = /* @__PURE__ */ o(
611
- se,
612
- ie,
613
- re,
614
- !1,
615
- null,
616
- null
617
- );
618
- const oe = ae.exports, le = {
619
- name: "DocumentSendReminders",
620
- i18nOptions: {
621
- namespaces: "documentSendReminders",
622
- messages: {
623
- en: {
624
- description: "Edit when smart reminders should be sent to client",
625
- notViewed: "Not viewed after",
626
- notAnswered: "No reply after",
627
- expires: "When expiration date is within"
628
- },
629
- sv: {
630
- description: "Ställ in när smarta påminnelser ska skickas ut till mottagaren",
631
- notViewed: "Inte öppnat efter",
632
- notAnswered: "Inte svarat efter",
633
- expires: "När giltighetstiden är inom"
634
- }
635
- }
636
- },
637
- components: {
638
- DocumentSendReminderItem: oe
639
- },
640
- mixins: [d()],
641
- props: {
642
- setFormValue: {
643
- type: Function,
644
- required: !0
645
- },
646
- removeFormValue: {
647
- type: Function,
648
- required: !0
649
- }
650
- },
651
- computed: {
652
- reminders() {
653
- const n = {
654
- first: null,
655
- notViewed: null,
656
- notAnswered: null,
657
- expires: null
658
- };
659
- return this._document.reminders.forEach((e, t) => {
660
- e.type === "first" ? n.first = { ...e, index: t } : e.type === "viewed" ? n.notViewed = { ...e, index: t } : e.type === "expires" ? n.expires = { ...e, index: t } : n.notAnswered = { ...e, index: t };
661
- }), n;
662
- }
663
- },
664
- methods: {
665
- getDefaultReminders() {
666
- if (!this._document.template)
667
- return [];
668
- const n = this._document.template.getDefaultData({
669
- path: "properties.data.properties.reminders"
670
- });
671
- return n && Array.isArray(n) ? n : [];
672
- },
673
- setReminder(n, e) {
674
- let t = "sendDays";
675
- if (typeof e == "string" && (t = "sendAt"), !e) {
676
- this.removeFormValue(`data.reminders[${n.index}]`);
677
- return;
678
- }
679
- if (typeof n == "string") {
680
- let s = this.getDefaultReminders().find(
681
- (i) => i.type === n
682
- );
683
- if (s || (s = g.default.find((i) => i.type === n)), !s)
684
- throw new Error("Could not find default reminder");
685
- s[t] = e, this.setFormValue({ key: "data.reminders", value: s });
686
- return;
687
- }
688
- this.setFormValue({
689
- key: `data.reminders[${n.index}].${t}`,
690
- value: e
691
- });
692
- }
693
- }
694
- };
695
- var de = function() {
696
- var e = this, t = e._self._c;
697
- return t("div", { staticStyle: { "background-color": "white", "border-radius": "calc(0.5 * var(--rem))", padding: "calc(2 * var(--rem))", "font-size": "16px" } }, [t("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()) + " ")]), t("div", { staticClass: "text-center text-gray-600", staticStyle: { "max-width": "calc(20 * var(--rem))", margin: "0 auto calc(2 * var(--rem)) auto" } }, [e._v(" " + e._s(e.$t("description")) + " ")]), e._l([
698
- { type: "notViewed", fallbackKey: "viewed" },
699
- { type: "notAnswered", fallbackKey: "reminder" },
700
- { type: "expires", fallbackKey: "expires" }
701
- ], function(s, i) {
702
- return t("DocumentSendReminderItem", { key: i, 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) {
703
- return e.setReminder(e.reminders[s.type] || s.fallbackKey, a);
704
- } } });
705
- }), t("div", { staticClass: "flex w-full items-center justify-center", staticStyle: { "margin-top": "calc(2.5 * var(--rem))" } }, [t("CButton", { attrs: { type: "secondary", expanded: "" }, on: { click: function(s) {
706
- return e.$emit("close");
707
- } } }, [e._v(" " + e._s(e.$t("_common:save")) + " ")])], 1)], 2);
708
- }, ce = [], me = /* @__PURE__ */ o(
709
- le,
710
- de,
711
- ce,
712
- !1,
713
- null,
714
- null
715
- );
716
- const ue = me.exports, pe = {
717
- name: "SendForm",
718
- i18nOptions: {
719
- namespaces: "sendForm",
720
- messages: L
721
- },
722
- components: {
723
- Simplebar: B,
724
- BaseDatePicker: f,
725
- RecipientBlock: ne,
726
- ErrorCallout: A,
727
- IsPremiumPreStep: S,
728
- IsPremium: w,
729
- CDropdown: h,
730
- CDropdownItem: y,
731
- CRadio: I
732
- },
733
- mixins: [
734
- d(
735
- ["expiresAt", "clients", "defaultAnswerMethod", "reminders", "name"],
736
- {
737
- useEmit: !1,
738
- setFnName: "setFormValue"
739
- }
740
- )
741
- ],
742
- props: {
743
- showName: {
744
- type: Boolean,
745
- default: !0
746
- },
747
- showSave: {
748
- type: Boolean,
749
- default: !0
750
- },
751
- showSchedule: {
752
- type: Boolean,
753
- default: !0
754
- },
755
- allowManualDelivery: {
756
- type: Boolean,
757
- default: !0
758
- },
759
- allowEditClients: {
760
- type: Boolean,
761
- default: !0
762
- },
763
- setFormValue: {
764
- type: Function,
765
- required: !0
766
- },
767
- removeFormValue: {
768
- type: Function,
769
- required: !0
770
- },
771
- useScroll: {
772
- type: Boolean,
773
- default: !1
774
- },
775
- onSaveDocument: {
776
- type: Function,
777
- required: !0
778
- }
779
- },
780
- data() {
781
- return {
782
- localIsPosting: !1,
783
- clientHoverIndex: null
784
- };
785
- },
786
- computed: {
787
- ...c({
788
- deliveryTypes: "forms/deliveryTypes",
789
- isPostingDocument: "documents2/isPosting",
790
- documentSenderSign: "settings/documentSenderSign",
791
- // todo: could be moved to load form action
792
- getCompanySetting: "settings/getCompanySetting",
793
- feature: "application/feature"
794
- }),
795
- isPosting() {
796
- return this.isPostingDocument || this.localIsPosting;
797
- },
798
- isPublicForm() {
799
- return !!(this.viewSettings && this.viewSettings.isPublicForm);
800
- },
801
- useSignOrder() {
802
- var n;
803
- return ((n = this._document) == null ? void 0 : n.useSignOrder) || !1;
804
- },
805
- noOfReminders() {
806
- return Object.values(this.reminders || []).reduce(
807
- (n, e) => e && (e.sendDays || e.sendAt) && e.type !== "first" ? n + 1 : n,
808
- 0
809
- );
810
- },
811
- smsActivated() {
812
- return this.deliveryTypes.sms;
813
- },
814
- emailActivated() {
815
- return this.deliveryTypes.email;
816
- },
817
- isManualDelivery() {
818
- return !this.smsActivated && !this.emailActivated;
819
- },
820
- sendTypesText() {
821
- return this.emailActivated || this.smsActivated ? [
822
- ...this.emailActivated ? [this.$t("_common:email").capitalize()] : [],
823
- ...this.smsActivated ? [this.$t("_common:sms")] : []
824
- ].join(" & ") : this._document.isDirty("isManualDelivery") && this.clients.length ? this.$t("manualDelivery") : " ";
825
- },
826
- clientsAreMissingContactInfo() {
827
- return this.isManualDelivery ? !1 : this.clients.some((n) => !(n.email || n.cellphone));
828
- },
829
- signMethods() {
830
- var n, e;
831
- return ((e = (n = this._document.signOptions) == null ? void 0 : n.filter((t) => t !== "inPerson")) == null ? void 0 : e.map((t) => ({
832
- value: t,
833
- title: this.$t(`signMethod.${t}.title`),
834
- content: this.$t(`signMethod.${t}.content`)
835
- }))) || [];
836
- }
837
- },
838
- created() {
839
- var n;
840
- if (!this.expiresAt && !this._document.isDirty("expiresAt")) {
841
- const e = this.getCompanySetting("defaultExpireDays");
842
- if (e && Number.isInteger(e) && e > 0) {
843
- const t = /* @__PURE__ */ new Date();
844
- t.setDate(t.getDate() + e), this.setField({
845
- field: "expiresAt",
846
- value: t.toISOString(),
847
- options: { ignoreChanges: !0 }
848
- });
849
- }
850
- }
851
- if (((n = this.defaultAnswerMethod) == null ? void 0 : n.accept) === "button") {
852
- const [e] = this._document.signOptions || ["signature"];
853
- this.setAnswerMethod(e, { ignoreChanges: !0 });
854
- }
855
- },
856
- validations() {
857
- const n = {
858
- clients: {
859
- required: (e) => e && e.length
860
- }
861
- };
862
- return !this.allowManualDelivery && this.clients.length && (n.isManualDelivery = {
863
- checked: (e) => !e
864
- }), n;
865
- },
866
- methods: {
867
- async doSaveDocument({ doSend: n }) {
868
- try {
869
- this.localIsPosting = !0, await this.onSaveDocument({ doSend: n });
870
- } finally {
871
- this.localIsPosting = !1;
872
- }
873
- },
874
- async doSendDocument() {
875
- var n;
876
- this.$v.$touch(), !this.$v.$invalid && (["denied", "expired", "voided"].includes((n = this._document) == null ? void 0 : n.status) && this.resetDeniedDocument(), await this.doSaveDocument({ doSend: !0 }));
877
- },
878
- setDeliveryMethod(n, e) {
879
- const t = this.deliveryTypes;
880
- t[n] = e;
881
- const s = Object.keys(t).filter((i) => t[i]);
882
- (this.clients || []).forEach((i, a) => {
883
- this.setFormValue({
884
- key: `clients[${a}].deliveryTypes`,
885
- value: s
886
- });
887
- });
888
- },
889
- setAnswerMethod(n, e = {}) {
890
- this.setField({
891
- field: "defaultAnswerMethod",
892
- value: { ...this.defaultAnswerMethod, accept: n },
893
- options: e
894
- }), (this.clients || []).forEach((t, s) => {
895
- var i;
896
- ((i = t.answerMethod) == null ? void 0 : i.accept) !== "inPerson" && this.setField({
897
- key: `clients[${s}].answerMethod.accept`,
898
- value: n,
899
- options: e
900
- });
901
- });
902
- },
903
- openReminders() {
904
- this.useSignOrder || this.$modal.show(
905
- ue,
906
- {
907
- _document: this._document,
908
- setFormValue: this.setFormValue,
909
- removeFormValue: this.removeFormValue
910
- },
911
- {
912
- adaptive: !0,
913
- height: "auto",
914
- width: "90%",
915
- maxWidth: 360
916
- }
917
- );
918
- },
919
- openSendLater() {
920
- this.$v.$touch(), !this.$v.$invalid && this.$modal.show(
921
- N,
922
- {
923
- _document: this._document,
924
- setFormValue: this.setFormValue,
925
- removeFormValue: this.removeFormValue,
926
- onSaveDocument: this.doSaveDocument
927
- },
928
- {
929
- adaptive: !0,
930
- height: "auto",
931
- width: "90%",
932
- maxWidth: 360
933
- }
934
- );
935
- },
936
- resetDeniedDocument() {
937
- (this.clients || []).forEach((n, e) => {
938
- this.setFormValue({ key: `clients[${e}].answer`, value: null });
939
- }), this.setFormValue({ key: "data.rejectReasons", value: [] }), this.setFormValue({ key: "status", value: "sent" });
940
- },
941
- shouldShowUpgradeModal({ canUseBankId: n, canUseSms: e }) {
942
- var t;
943
- return !!(this.smsActivated && !e || ((t = this.defaultAnswerMethod) == null ? void 0 : t.accept) === "bankId" && !n);
944
- }
945
- }
946
- };
947
- var ve = function() {
948
- var e = this, t = e._self._c;
949
- return t("IsPremium", { scopedSlots: e._u([{ key: "default", fn: function({ canUseBankId: s, canUseSms: i }) {
950
- var a;
951
- return [t("div", { staticClass: "@container flex h-full flex-col" }, [t(e.useScroll ? "Simplebar" : "div", { tag: "component", staticClass: "main-container" }, [t("div", { staticClass: "@md:px-8 @md:pb-8 @xl:px-16 @xl:pb-16 relative px-4 pb-4 pt-6" }, [t("div", { staticClass: "pb-4 text-lg font-bold" }, [e._v(" " + e._s(e.$t("title")) + " ")]), e.showName ? t("div", { staticClass: "mb-6" }, [t("div", { staticClass: "pb-0.5 text-xs font-medium text-gray-900" }, [e._v(" " + e._s(e.$t("nameLabel")) + " ")]), t("CInput", { attrs: { placeholder: e.$t("namePlaceholder"), filled: "" }, model: { value: e.name, callback: function(r) {
952
- e.name = r;
953
- }, expression: "name" } })], 1) : e._e(), t("div", { staticClass: "mb-6" }, [t("RecipientBlock", { attrs: { _value: {
954
- clients: "clients"
955
- }, _document: e._document, "set-form-value": e.setFormValue, "remove-form-value": e.removeFormValue, "default-add-sender-client": e.documentSenderSign, "allow-edit-clients": e.allowEditClients, "is-public-form": e.isPublicForm } })], 1), e._t("default"), e.defaultAnswerMethod && e.signMethods.length > 1 ? t("div", { staticClass: "mb-8" }, [t("div", { staticClass: "block-title pb-0.5 text-xs font-medium text-gray-900" }, [e._v(" " + e._s(e.$t("signMethod.title")) + " "), t("CIcon", { 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), t("div", { staticClass: "cb-card-group" }, e._l(e.signMethods, function(r) {
956
- return t("div", { key: r.value, staticClass: "cb-card flex border-2 border-transparent hover:border-gray-300/30 hover:bg-gray-200", class: {
957
- checked: e.defaultAnswerMethod.accept === r.value
958
- }, on: { click: function(m) {
959
- e.defaultAnswerMethod.accept !== r.value && e.setAnswerMethod(r.value);
960
- } } }, [t("CRadio", { staticClass: "sign-radio pointer-events-none mr-3", attrs: { value: e.defaultAnswerMethod.accept, "native-value": r.value, type: "secondary", size: "small" } }), t("div", { staticClass: "flex-grow" }, [t("div", { staticClass: "cb-card-title flex items-center justify-between" }, [e._v(" " + e._s(r.title) + " "), r.value === "bankId" && !s ? t("div", { staticClass: "bg-primary-500 ml-2 rounded-full px-1.5 py-1 text-[10px] font-semibold leading-none text-white" }, [e._v(" Pro ")]) : e._e()]), t("div", { directives: [{ name: "show", rawName: "v-show", value: e.defaultAnswerMethod.accept === r.value, expression: "defaultAnswerMethod.accept === signMethod.value" }], staticClass: "cb-card-body" }, [e._v(" " + e._s(r.content) + " ")])])], 1);
961
- }), 0)]) : e._e(), t("div", { staticClass: "grid items-center gap-2", staticStyle: { "grid-template-columns": "repeat(auto-fit, minmax(200px, 1fr))" } }, [t("div", [t("BaseDatePicker", { staticClass: "psuedo-input relative", attrs: { "custom-el": !0, direction: "end", tabindex: "0" }, model: { value: e.expiresAt, callback: function(r) {
962
- e.expiresAt = r;
963
- }, expression: "expiresAt" } }, [t("div", { staticClass: "psuedo-input-label" }, [e._v(e._s(e.$t("validityPeriod")))]), t("div", [e._v(" " + e._s(e.expiresAt ? e.$formatDate(e.expiresAt) : e.$t("_common:disabled").capitalize()) + " ")]), e.expiresAt ? t("CButton", { staticClass: "absolute right-3 top-3 z-10", attrs: { icon: "x", size: "small", type: "none", pattern: "secondary" }, on: { click: function(r) {
964
- r.preventDefault(), r.stopPropagation(), e.expiresAt = void 0, e._document.setDirty("expiresAt");
965
- } } }) : e._e()], 1)], 1), t("CDropdown", { staticStyle: { flex: "1 0 200px" }, attrs: { disabled: !e.clients.length, "mobile-label": e.$t("sendAs"), expanded: "" }, scopedSlots: e._u([{ key: "trigger", fn: function() {
966
- return [t("div", { staticClass: "psuedo-input", attrs: { tabindex: "0" } }, [t("div", { staticClass: "psuedo-input-label" }, [e._v(e._s(e.$t("sendAs")))]), t("div", { domProps: { innerHTML: e._s(e.sendTypesText) } })])];
967
- }, proxy: !0 }], null, !0) }, [t("CDropdownItem", { attrs: { value: e.emailActivated, "close-on-click": !1, toggle: "" }, on: { click: function(r) {
968
- return e.setDeliveryMethod("email", !e.emailActivated);
969
- } } }, [e._v(" " + e._s(e.$t("_common:email").capitalize()) + " ")]), e.feature("sms") ? t("CDropdownItem", { attrs: { value: e.smsActivated, "close-on-click": !1, toggle: "" }, on: { click: function(r) {
970
- return e.setDeliveryMethod("sms", !e.smsActivated);
971
- } } }, [e._v(" " + e._s(e.$t("_common:sms")) + " "), i ? e._e() : t("div", { staticClass: "bg-primary-500 ml-2 rounded-full px-1.5 py-1 text-[10px] font-semibold leading-none text-white" }, [e._v(" Pro ")])]) : e._e(), e.allowManualDelivery ? t("CDropdownItem", { attrs: { value: "", tooltip: {
972
- content: e.$t("manualDeliveryTooltip")
973
- } }, domProps: { textContent: e._s(e.$t("manualDelivery")) }, on: { click: () => {
974
- e.setDeliveryMethod("sms", !1), e.setDeliveryMethod("email", !1), e._document.setDirty("isManualDelivery");
975
- } } }) : e._e()], 1), !e.useSignOrder && !e.isManualDelivery ? t("div", { staticClass: "psuedo-input relative", attrs: { tabindex: "0" }, on: { click: e.openReminders } }, [t("div", { staticClass: "psuedo-input-label" }, [e._v(" " + e._s(e.$t("_common:reminder_plural").capitalize()) + " ")]), t("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 ? t("CButton", { staticClass: "absolute right-3 top-3", attrs: { icon: "x", size: "small", type: "none", pattern: "secondary" }, on: { click: function(r) {
976
- r.preventDefault(), r.stopPropagation(), e.reminders = [];
977
- } } }) : e._e()], 1) : e._e()], 1), e.clientsAreMissingContactInfo || (a = e.$v.isManualDelivery) != null && a.$invalid ? t("ErrorCallout", { attrs: { message: e.clientsAreMissingContactInfo ? e.$t("clientsAreMissingContactInfo") : e.$t("missingDeliveryMethod"), size: "small" } }) : e._e(), e._t("content")], 2)]), t("div", { staticClass: "@md:px-8 @xl:px-16 px-4 pb-4" }, [e._t("send-header"), e._t("send", function() {
978
- return [t("IsPremiumPreStep", { attrs: { feature: "bankIdAndSms" }, scopedSlots: e._u([{ key: "default", fn: function({ onClick: r }) {
979
- return [t("div", { staticClass: "flex" }, [e.showSave ? t("CButton", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: e.$t("_common:save", {
980
- thing: e.$t("_common:document").toLowerCase()
981
- }), expression: `
982
- $t('_common:save', {
983
- thing: $t('_common:document').toLowerCase()
984
- })
985
- ` }], staticClass: "mr-2 w-12", attrs: { loading: e.isPosting, type: "none", icon: "save", pattern: "secondary" }, on: { click: function(m) {
986
- return e.doSaveDocument({ doSend: !1 });
987
- } } }) : e._e(), e.showSchedule && !e.useSignOrder && !e.isManualDelivery ? t("CButton", { staticClass: "@md:w-auto mr-2 w-12", 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 } }, [t("span", { staticClass: "@md:!block !hidden", domProps: { textContent: e._s(e.$t("scheduledTooltip")) } }), t("CIcon", { staticClass: "@md:!hidden", attrs: { type: "calendar", size: "16" } })], 1) : e._e(), t("div", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: e.$v.$invalid ? {
988
- content: e.clients.length ? e.$t("missingDeliveryMethod") : e.$t(
989
- "components:account.documentForm.clients.errorMessage"
990
- )
991
- } : {}, expression: `
992
- $v.$invalid
993
- ? {
994
- content: !clients.length
995
- ? $t(
996
- 'components:account.documentForm.clients.errorMessage'
997
- )
998
- : $t('missingDeliveryMethod')
999
- }
1000
- : {}
1001
- ` }], staticClass: "flex-auto" }, [t("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(m) {
1002
- e.shouldShowUpgradeModal({ canUseBankId: s, canUseSms: i }) ? r({
1003
- data: {
1004
- bankIdBlocked: !s,
1005
- smsBlocked: !i
1006
- }
1007
- }) : e.doSendDocument();
1008
- } } }, [e._v(" " + e._s(e.$t("sendButton")) + " ")])], 1)], 1)];
1009
- } }], null, !0) })];
1010
- }), e._t("footer")], 2)], 1)];
1011
- } }], null, !0) });
1012
- }, ge = [], fe = /* @__PURE__ */ o(
1013
- pe,
1014
- ve,
1015
- ge,
1016
- !1,
1017
- null,
1018
- "7df6da42"
1019
- );
1020
- const De = fe.exports;
1021
- export {
1022
- De as S
1023
- };