@cling-se/widget 0.14.4 → 0.14.6

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 (129) hide show
  1. package/dist/AddClientCallout-C7abPZ87.js +46 -0
  2. package/dist/AnswerModal-CsA2pl2P.js +3874 -0
  3. package/dist/AttachmentItem-Da1-7xwf.js +78 -0
  4. package/dist/BaseDatePicker-k9zlSi5J.js +3183 -0
  5. package/dist/BaseUpload-BUrXX3fT.js +1977 -0
  6. package/dist/BlockMedia-CYI07qAn.js +76 -0
  7. package/dist/CCallout-Qwae66vo.js +59 -0
  8. package/dist/CCurrencyDropdown-Y_u0hgBx.js +246 -0
  9. package/dist/CDropdownItem-CXJ4xD8W.js +538 -0
  10. package/dist/CField.vue_vue_type_style_index_0_lang-l0sNRNKZ.js +1 -0
  11. package/dist/CFormField--m3PvQuT.js +241 -0
  12. package/dist/CPhoneFormat-Qg6MkDVP.js +62 -0
  13. package/dist/CPriceInput-Dlx44UrR.js +112 -0
  14. package/dist/CTabs.vue_vue_type_style_index_0_scoped_b7262014_lang-l0sNRNKZ.js +1 -0
  15. package/dist/ClientAutocomplete-BKKc_br6.js +78 -0
  16. package/dist/ClientModal-CVZFb1Br.js +625 -0
  17. package/dist/ColorPicker-Bo3s3Esp.js +2879 -0
  18. package/dist/CompanyModal-DadjAioS.js +141 -0
  19. package/dist/ContentWrapper-BC3ZBQW9.js +183 -0
  20. package/dist/CoverBlockSettings-B484eE4g.js +275 -0
  21. package/dist/DocAnswer-CcYryOWI.js +36 -0
  22. package/dist/DocDetails-BigsoEWL.js +246 -0
  23. package/dist/DocForm-DlN0eNWt.js +7273 -0
  24. package/dist/DocFormSend-TqKo210I.js +143 -0
  25. package/dist/DocLinks-DSo54vDn.js +38 -0
  26. package/dist/DocModalBase-XlM1SThW.js +28 -0
  27. package/dist/DocPrint-tD0Vd9Sw.js +240 -0
  28. package/dist/DocReceipt-CDHPrhXM.js +210 -0
  29. package/dist/DocSendReminder-C62RhltH.js +137 -0
  30. package/dist/DocTextEditor-VjhV9IRp.js +17181 -0
  31. package/dist/DocTimeline-LcW4z3nC.js +481 -0
  32. package/dist/DocumentClient-CqbTRdpB.js +136 -0
  33. package/dist/DocumentLayout-Dbf8_01r.js +4909 -0
  34. package/dist/DocumentLogotype-DXYnBedV.js +87 -0
  35. package/dist/DocumentVoided-vH1Ti5lZ.js +25 -0
  36. package/dist/EmbedInput-D9qP8OnY.js +113 -0
  37. package/dist/EmbedSettings-DISuNqJT.js +72 -0
  38. package/dist/ErrorCallout-CCtCVwSh.js +28 -0
  39. package/dist/FilePreviewModal-BjhNyb6L.js +81 -0
  40. package/dist/Flag-Dhukv9_J.js +114 -0
  41. package/dist/HeaderSettings-CK4SkB1x.js +392 -0
  42. package/dist/ImageSelectModal-DnvPZzXx.js +84 -0
  43. package/dist/ImageUploadWrapper-B7cNMu5a.js +1604 -0
  44. package/dist/Index-B3HoK_cZ.js +84 -0
  45. package/dist/Index-B3aucNji.js +25 -0
  46. package/dist/Index-B9H5MMHb.js +62 -0
  47. package/dist/Index-BAYdvT-t.js +754 -0
  48. package/dist/Index-BLeQprjq.js +46 -0
  49. package/dist/Index-BOyvQlng.js +154 -0
  50. package/dist/Index-BVsw2tak.js +70 -0
  51. package/dist/Index-BY1UKGEO.js +98 -0
  52. package/dist/Index-Bh0kMSsA.js +107 -0
  53. package/dist/Index-BlQSM7tC.js +144 -0
  54. package/dist/Index-BpcJBGGd.js +642 -0
  55. package/dist/Index-Bs8wprXw.js +58 -0
  56. package/dist/Index-BvZZAvFd.js +21 -0
  57. package/dist/Index-CFo-3Y5Q.js +26 -0
  58. package/dist/Index-CNvp5K3L.js +559 -0
  59. package/dist/Index-CPJVx14x.js +171 -0
  60. package/dist/Index-CQ325eVT.js +140 -0
  61. package/dist/Index-CWrDtcfT.js +49 -0
  62. package/dist/Index-CyJnSvDR.js +223 -0
  63. package/dist/Index-D6bc7lg4.js +52 -0
  64. package/dist/Index-DCR8ev4U.js +33 -0
  65. package/dist/Index-DGQSB9cH.js +24 -0
  66. package/dist/Index-DXAvlq74.js +292 -0
  67. package/dist/Index-D_rfst8y.js +45 -0
  68. package/dist/Index-Dm8xMFGg.js +61 -0
  69. package/dist/Index-DtSSgtxB.js +55 -0
  70. package/dist/Index-DuTw9vhb.js +77 -0
  71. package/dist/Index-Dw26jtGV.js +31 -0
  72. package/dist/Index-OxN73_fO.js +32 -0
  73. package/dist/Index-S-FHG7_k.js +2402 -0
  74. package/dist/Index-ZFkitzfq.js +69 -0
  75. package/dist/Index-dyWK9jgr.js +25 -0
  76. package/dist/Index-gb11ngPS.js +57 -0
  77. package/dist/Index-lKk_XKJ3.js +150 -0
  78. package/dist/InputToggleRow-DSSvhPKA.js +57 -0
  79. package/dist/ManualPopover-lpJYSkw5.js +58 -0
  80. package/dist/MediaWrapper-BQ22FA2B.js +23 -0
  81. package/dist/NotBindingText-JxwzZLPP.js +32 -0
  82. package/dist/PackageGroup-BLSMSUDz.js +699 -0
  83. package/dist/PdfTerms-DtutjM5Y.js +36 -0
  84. package/dist/PdfViewer-BsxcZI_x.js +374 -0
  85. package/dist/PlainHtml-BMPZs2fT.js +20 -0
  86. package/dist/PriceHeader-BRYY01H2.js +339 -0
  87. package/dist/SearchApi-6001iFxU.js +161 -0
  88. package/dist/Setup-cw6jMI9M.js +50 -0
  89. package/dist/SmartList-q6H-uLbm.js +83 -0
  90. package/dist/TermsSettings-DWvaPneu.js +102 -0
  91. package/dist/ThemeColorRow-BXWnvfz-.js +67 -0
  92. package/dist/ToggleBinding-DydtwpNG.js +38 -0
  93. package/dist/UploadModal-D_EDKHGD.js +95 -0
  94. package/dist/VideoPlayerInput-B9yzUeBW.js +93 -0
  95. package/dist/VideoPlayerSettings-Bvp9l0yj.js +61 -0
  96. package/dist/VideoSelectModal-DY3N4JiS.js +100 -0
  97. package/dist/anime.es-BrPTThYb.js +858 -0
  98. package/dist/answerDocumentMixin-BYZPU_R-.js +51 -0
  99. package/dist/color-TdtKxwVa.js +19 -0
  100. package/dist/debounce-BPnlzNwd.js +84 -0
  101. package/dist/dom-CJxkno7i.js +91 -0
  102. package/dist/favicon.ico +0 -0
  103. package/dist/focusDrawerMixin-DC9Oa1i7.js +22 -0
  104. package/dist/formComponentsInstall-CEW6TK6z.js +2499 -0
  105. package/dist/formDrawerState-CAzvSMiQ.js +20 -0
  106. package/dist/formValidationMixin-D7zXxCpC.js +49 -0
  107. package/dist/i18nMessages-Chz_lxGG.js +17 -0
  108. package/dist/index-B9WDC3Xe.js +166 -0
  109. package/dist/index-BCMaUC5r.js +3916 -0
  110. package/dist/index-BDMI4NVY.js +492 -0
  111. package/dist/index-BbscgdRg.js +81 -0
  112. package/dist/index-CLUljEDI.js +347 -0
  113. package/dist/index-SxyZvewN.js +102 -0
  114. package/dist/index.es.js +35 -0
  115. package/dist/index.umd.js +3148 -0
  116. package/dist/main-CQBEuZk9.js +56739 -0
  117. package/dist/mapFormMixin-DlFcgwhm.js +72 -0
  118. package/dist/omit-BWy0Zhd3.js +31 -0
  119. package/dist/publicSenderState-CvOcFv2U.js +21 -0
  120. package/dist/splitpanes-BHUVsCZF.js +382 -0
  121. package/dist/style.css +4 -0
  122. package/dist/throttle-BrC8eGjQ.js +18 -0
  123. package/dist/tinycolor-PhFP695w.js +633 -0
  124. package/dist/tippy.esm-7dmKOUvu.js +1799 -0
  125. package/dist/utils-NBLgNGHR.js +108 -0
  126. package/dist/vuedraggable.umd-ByfH7ZxC.js +3161 -0
  127. package/dist/vuex.esm-DKGl8mcw.js +467 -0
  128. package/package.json +1 -1
  129. package/vite.config.ts +0 -1
@@ -0,0 +1,143 @@
1
+ import { i as s, S as l } from "./formComponentsInstall-CEW6TK6z.js";
2
+ import { V as n, m as r, a as i, g as u, C as c, n as m } from "./main-CQBEuZk9.js";
3
+ n.use(s);
4
+ const a = n.observable({
5
+ canEdit: !1,
6
+ isForm: !0,
7
+ setFormValue: null,
8
+ removeFormValue: null
9
+ }), d = {
10
+ name: "DocFormSend",
11
+ components: {
12
+ SendForm: l
13
+ },
14
+ provide: () => ({ viewSettings: a, allowSenderSign: !1 }),
15
+ // TODO maybe not needed
16
+ props: {
17
+ // consumer options
18
+ showName: {
19
+ type: Boolean,
20
+ default: !0
21
+ },
22
+ showSave: {
23
+ type: Boolean,
24
+ default: !0
25
+ },
26
+ showSchedule: {
27
+ type: Boolean,
28
+ default: !0
29
+ },
30
+ allowManualDelivery: {
31
+ type: Boolean,
32
+ default: !1
33
+ },
34
+ allowEditClients: {
35
+ type: Boolean,
36
+ default: !0
37
+ },
38
+ contentSlot: {
39
+ type: String,
40
+ default: null
41
+ },
42
+ footerSlot: {
43
+ type: String,
44
+ default: null
45
+ },
46
+ // widget internals
47
+ setFormValue: {
48
+ type: Function,
49
+ default: null
50
+ },
51
+ removeFormValue: {
52
+ type: Function,
53
+ default: null
54
+ },
55
+ closeFunc: {
56
+ type: Function,
57
+ default: null
58
+ },
59
+ beforeSave: {
60
+ type: Function,
61
+ default: null
62
+ },
63
+ beforeSend: {
64
+ type: Function,
65
+ default: null
66
+ }
67
+ },
68
+ data() {
69
+ return {
70
+ document: null
71
+ };
72
+ },
73
+ computed: {
74
+ ...r({
75
+ company: "application/company",
76
+ can: "application/can",
77
+ rawDoc: "forms/document",
78
+ isPosting: "documents2/isPosting"
79
+ })
80
+ },
81
+ watch: {
82
+ rawDoc: {
83
+ immediate: !0,
84
+ handler() {
85
+ this.initDoc();
86
+ }
87
+ }
88
+ },
89
+ async created() {
90
+ this.setDocValue && (a.setFormValue = this.setDocValue), this.removeDocValue && (a.removeFormValue = this.removeDocValue);
91
+ },
92
+ methods: {
93
+ ...i({
94
+ saveDocument: u.SAVE_DYNDOC_FORM
95
+ // loadCompanyUser: global.LOAD_COMPANY_USER,
96
+ }),
97
+ async initDoc() {
98
+ if (!this.rawDoc)
99
+ throw new Error("Missing initiated form document");
100
+ this.document = new c({
101
+ data: this.rawDoc,
102
+ can: this.can,
103
+ getters: this.$store.getters,
104
+ updateSender: !0
105
+ });
106
+ },
107
+ setDocValue({ key: t, value: e }) {
108
+ return this.setFormValue({ key: t, value: e });
109
+ },
110
+ removeDocValue(t) {
111
+ return this.removeFormValue(t);
112
+ },
113
+ async onSaveDocument({ doSend: t = !1 } = {}) {
114
+ let e = !1;
115
+ typeof this.beforeSave == "function" && (e = await this.beforeSave(this.document)), t && typeof this.beforeSend == "function" && (e = await this.beforeSend(this.document)), !(e || !await this.saveDocument({ doSend: t })) && this.close();
116
+ },
117
+ close() {
118
+ this.closeFunc();
119
+ }
120
+ }
121
+ };
122
+ var f = function() {
123
+ var e = this, o = e._self._c;
124
+ return e.document ? o("SendForm", { staticClass: "h-full w-full", attrs: { _document: e.document, _value: {
125
+ expiresAt: "data.expiresAt",
126
+ personalMessage: "data.personalMessage",
127
+ defaultAnswerMethod: "data.defaultAnswerMethod",
128
+ clients: "clients",
129
+ reminders: "data.reminders",
130
+ name: "data.name"
131
+ }, "show-name": e.showName, "show-save": e.showSave, "show-schedule": e.showSchedule, "allow-edit-clients": e.allowEditClients, "allow-manual-delivery": e.allowManualDelivery, "set-form-value": e.setDocValue, "remove-form-value": e.removeDocValue, "on-save-document": e.onSaveDocument, "use-scroll": "" } }, [e.contentSlot ? o("div", { attrs: { slot: "content" }, domProps: { innerHTML: e._s(e.contentSlot) }, slot: "content" }) : e._e(), e.footerSlot ? o("div", { attrs: { slot: "footer" }, domProps: { innerHTML: e._s(e.footerSlot) }, slot: "footer" }) : e._e()]) : o("div", { staticClass: "grid h-full w-full place-items-center" }, [o("CIcon", { staticClass: "animate-spin text-gray-400", attrs: { type: "loader", size: 28 } })], 1);
132
+ }, p = [], h = /* @__PURE__ */ m(
133
+ d,
134
+ f,
135
+ p,
136
+ !1,
137
+ null,
138
+ null
139
+ );
140
+ const S = h.exports;
141
+ export {
142
+ S as default
143
+ };
@@ -0,0 +1,38 @@
1
+ import { C as o } from "./index-SxyZvewN.js";
2
+ import { n as s } from "./main-CQBEuZk9.js";
3
+ const t = {
4
+ name: "DocLinks",
5
+ components: {
6
+ ClientLinks: o
7
+ },
8
+ props: {
9
+ document: {
10
+ type: Object,
11
+ required: !0
12
+ },
13
+ closeFunc: {
14
+ type: Function,
15
+ default: null
16
+ }
17
+ },
18
+ methods: {
19
+ close() {
20
+ this.closeFunc && this.closeFunc();
21
+ }
22
+ }
23
+ };
24
+ var c = function() {
25
+ var e = this, n = e._self._c;
26
+ return n("div", { staticClass: "h-full w-full overflow-auto" }, [n("ClientLinks", { attrs: { id: e.document.id }, on: { close: e.close } })], 1);
27
+ }, l = [], r = /* @__PURE__ */ s(
28
+ t,
29
+ c,
30
+ l,
31
+ !1,
32
+ null,
33
+ null
34
+ );
35
+ const f = r.exports;
36
+ export {
37
+ f as default
38
+ };
@@ -0,0 +1,28 @@
1
+ import { n as o } from "./main-CQBEuZk9.js";
2
+ const s = {
3
+ name: "DocModalBase",
4
+ components: {},
5
+ props: {
6
+ showClose: {
7
+ type: Boolean,
8
+ default: !1
9
+ }
10
+ }
11
+ };
12
+ var a = function() {
13
+ var e = this, t = e._self._c;
14
+ return t("div", { staticClass: "doc-modal-base" }, [e.showClose ? t("CButton", { staticClass: "absolute right-4 top-4 text-gray-500", attrs: { circle: "", icon: "x" }, on: { click: function(l) {
15
+ return e.$parent.$emit("close");
16
+ } } }) : e._e(), e._t("default")], 2);
17
+ }, n = [], r = /* @__PURE__ */ o(
18
+ s,
19
+ a,
20
+ n,
21
+ !1,
22
+ null,
23
+ "76fb32f6"
24
+ );
25
+ const i = r.exports;
26
+ export {
27
+ i as D
28
+ };
@@ -0,0 +1,240 @@
1
+ import { n as d, J as h, c, I as l, K as p, L as a, M as m } from "./main-CQBEuZk9.js";
2
+ const u = {
3
+ i18nOptions: {
4
+ namespaces: "documentPrint",
5
+ messages: {
6
+ en: {
7
+ title: "Print options",
8
+ appendAttachments: "Append attachments",
9
+ appendAttachmentsSub: "Append attachments",
10
+ hideDocumentAttachmentBlocks: "Hide document attachment blocks",
11
+ hideDocumentAttachmentBlocksTooltip: "Hide blocks with the type of attachments.",
12
+ showVerification: "Include verification",
13
+ showVerificationSub: "Signature verification.",
14
+ showLast4ssn: "Include the last 4 digits of the personal identification number from the BankID signature.",
15
+ showEvents: "Show events",
16
+ buttonText: "Download PDF",
17
+ preparingPdf: "Preparing PDF...",
18
+ preparingPdfDone: "PDF is complete",
19
+ preparingPdfError: "Could not create PDF. Try again."
20
+ },
21
+ sv: {
22
+ title: "Utskriftsinställningar",
23
+ appendAttachments: "Bifoga bilagor",
24
+ appendAttachmentsSub: "Inkludera bilagor i slutet av PDF:en.",
25
+ hideDocumentAttachmentBlocks: "Göm dokumentblock som är bilagor",
26
+ hideDocumentAttachmentBlocksTooltip: "Dölj blocken av typen bilagor.",
27
+ showVerification: "Inkludera verifikat",
28
+ showVerificationSub: "Signaturverifikat.",
29
+ showLast4ssn: "Inkludera de sista 4-siffrorna i personnummret från BankID-signaturen",
30
+ showEvents: "Visa händelser",
31
+ buttonText: "Ladda ner PDF",
32
+ preparingPdf: "Förbereder PDF...",
33
+ preparingPdfDone: "PDF är redo",
34
+ preparingPdfError: "Kunde inte skapa PDF. Pröva igen."
35
+ }
36
+ }
37
+ },
38
+ name: "DocumentPrint",
39
+ components: {
40
+ CCheckbox: h
41
+ },
42
+ props: {
43
+ document: {
44
+ type: Object,
45
+ required: !0
46
+ },
47
+ isSuperUser: {
48
+ type: Boolean,
49
+ required: !1
50
+ }
51
+ },
52
+ data() {
53
+ return {
54
+ options: {
55
+ appendAttachments: !0,
56
+ hideDocumentAttachmentBlocks: !1,
57
+ showVerification: !0,
58
+ showEvents: !0,
59
+ showLast4ssn: !0,
60
+ forceDoCreatePdf: !1,
61
+ // Only for superuser
62
+ compressImages: !1,
63
+ // Only for superuser
64
+ debugPage: !1,
65
+ // Only for superuser
66
+ extraTimeout: 0
67
+ // Only for superuser
68
+ },
69
+ showMoreOptions: !1,
70
+ omitAttachmentBlockTooltip: {
71
+ content: '<svg style="margin-top: 2px;" width="193" height="122" viewBox="0 0 193 122" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="193" height="122" rx="5" fill="white"/><text fill="black" xml:space="preserve" style="white-space: pre" font-family="Inter" font-size="11" font-weight="bold" letter-spacing="0em"><tspan x="13" y="25.5">' + this.$t("_common:attachment_plural").capitalize() + `</tspan></text><path d="M14 33H25.2941L30 38.225V52H14V33Z" fill="#FFC4C4"/><path opacity="0.34" d="M14 60H25.5L30 64.5V79H14V60Z" fill="#42A4FF"/><text fill="black" xml:space="preserve" style="white-space: pre" font-family="Inter" font-size="11" letter-spacing="0em"><tspan x="41" y="46.5">${this.$t("_common:file").capitalize()} #1</tspan></text><text fill="black" xml:space="preserve" style="white-space: pre" font-family="Inter" font-size="11" letter-spacing="0em"><tspan x="41" y="73.5">${this.$t("_common:file").capitalize()} #2</tspan></text><rect x="13" y="87" width="61" height="12" fill="#E2E2E2"/><rect x="13" y="103" width="168" height="6" fill="#E2E2E2"/><rect x="13" y="112" width="151" height="6" fill="#E2E2E2"/><rect x="13" y="3" width="97" height="6" fill="#E2E2E2"/><rect x="14" y="47" width="16" height="5" fill="#FF1515"/><rect x="14" y="74" width="16" height="5" fill="#42A4FF"/></svg><div style="max-width: 193px; padding: 2px 0 8px 0;">
72
+ ${this.$t("hideDocumentAttachmentBlocksTooltip")}
73
+ </div>`,
74
+ placement: "left",
75
+ boundariesElement() {
76
+ return this.$parent.$el;
77
+ },
78
+ html: !0
79
+ }
80
+ };
81
+ },
82
+ computed: {
83
+ extraTimeout: {
84
+ get() {
85
+ return this.options.extraTimeout || null;
86
+ },
87
+ set(s) {
88
+ s ? this.options.extraTimeout = parseInt(s, 10) : this.options.extraTimeout = 0;
89
+ }
90
+ },
91
+ allowVerification() {
92
+ return this.document && this.document.allowVerification;
93
+ },
94
+ showAdminOptions() {
95
+ return c.showAdminSettings || this.isSuperUser;
96
+ },
97
+ hasBankIdSignatures() {
98
+ var e;
99
+ const { clients: s, senderClient: t } = this.document;
100
+ return t != null && t.socialNo && ((e = t.answerMethod) == null ? void 0 : e.accept) === "bankId" ? !0 : s.some(
101
+ (i) => {
102
+ var n;
103
+ return i.socialNo && ((n = i.answerMethod) == null ? void 0 : n.accept) === "bankId";
104
+ }
105
+ );
106
+ }
107
+ },
108
+ created() {
109
+ Object.assign(
110
+ this.options,
111
+ JSON.parse(l.getItem("print-settings"))
112
+ ), this.allowVerification || (this.options.showVerification = !1), this.$watch("options", {
113
+ deep: !0,
114
+ handler(s) {
115
+ l.setItem("print-settings", JSON.stringify(s)), !s.showVerification && !s.showEvents && (this.options.showEvents = !0), !s.showVerification && !s.showLast4ssn && (this.options.showLast4ssn = !0);
116
+ }
117
+ });
118
+ },
119
+ methods: {
120
+ async generatePdf() {
121
+ if (!this.document || !this.document.publicId)
122
+ return;
123
+ const { data: s } = await p.addDocument(this.document.publicId, {
124
+ ...this.options,
125
+ brand: c.brand
126
+ // this.$brand not defined on init
127
+ // locale: this.$i18n.locale,
128
+ // timeZone: this.$get(Intl.DateTimeFormat().resolvedOptions(), 'timeZone') || '',
129
+ });
130
+ let t, e;
131
+ const i = async () => {
132
+ const { data: o } = await p.get(s) || {};
133
+ ({ status: t, url: e } = o);
134
+ }, n = async () => {
135
+ try {
136
+ if (await i(), t === "canceled")
137
+ throw new Error(
138
+ `Canceled preparing document pdf for publicId: ${this.document.publicId}`
139
+ );
140
+ if (t === "completed" && e) {
141
+ const o = () => {
142
+ const r = window.open(e, "_blank");
143
+ return r ? (r.focus(), !0) : !1;
144
+ };
145
+ return o() || a({
146
+ type: "success",
147
+ message: this.$t("preparingPdfDone"),
148
+ time: null,
149
+ // won't close notification after default 6 sec
150
+ closeButton: !0,
151
+ actions: {
152
+ submit: {
153
+ text: this.$t("_common:download"),
154
+ callback: o
155
+ }
156
+ }
157
+ }), "close";
158
+ }
159
+ return await m(3e3), n();
160
+ } catch (o) {
161
+ return a({
162
+ type: "error",
163
+ message: this.$t("preparingPdfError")
164
+ }), this.$error(o, { showMessage: !1 }), "close";
165
+ }
166
+ };
167
+ await a({
168
+ type: "spinner",
169
+ message: this.$t("preparingPdf"),
170
+ time: n,
171
+ closeButton: !0
172
+ }), this.$emit("close");
173
+ }
174
+ }
175
+ };
176
+ var f = function() {
177
+ var t = this, e = t._self._c;
178
+ return e("div", [e("div", { staticClass: "options-wrapper" }, [e("div", { staticClass: "pb-4 text-lg font-semibold" }, [t._v(t._s(t.$t("title")))]), e("div", { staticClass: "print-options" }, [e("div", { staticClass: "select-none pb-1 text-sm font-medium text-gray-800" }, [t._v(" " + t._s(t.$t("_common:document")) + " ")]), e("div", { staticClass: "option-item" }, [e("div", { staticClass: "option-item__inner bg-gray-100 hover:bg-gray-200", class: { disabled: !t.document.attachedFiles.length }, on: { click: function(i) {
179
+ t.options.appendAttachments = !t.options.appendAttachments;
180
+ } } }, [e("CCheckbox", { staticStyle: { flex: "0 0 30px" }, attrs: { value: t.document.attachedFiles.length ? t.options.appendAttachments : !1, type: "secondary", size: "small" } }), e("div", [e("div", [t._v(t._s(t.$t("appendAttachments")))]), e("div", { staticClass: "has-text-grey-dark", staticStyle: { "font-size": "13px" } }, [t._v(" " + t._s(t.$tc("_common:attachment", { count: t.document.attachedFiles.length })) + " ")])])], 1), e("div", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: t.omitAttachmentBlockTooltip, expression: "omitAttachmentBlockTooltip" }] }, [e("div", { staticClass: "option-item__inner border-t-2 border-white bg-gray-100 hover:bg-gray-200", class: {
181
+ disabled: !t.document.getAllNodesWithType("attachments").length
182
+ }, on: { click: function(i) {
183
+ t.options.hideDocumentAttachmentBlocks = !t.options.hideDocumentAttachmentBlocks;
184
+ } } }, [e("CCheckbox", { staticStyle: { flex: "0 0 30px" }, attrs: { value: t.document.getAllNodesWithType("attachments").length ? t.options.hideDocumentAttachmentBlocks : !1, type: "secondary", size: "small" } }), e("div", [e("div", [t._v(t._s(t.$t("hideDocumentAttachmentBlocks")))]), e("div", { staticClass: "has-text-grey-dark", staticStyle: { "font-size": "13px" } }, [t._v(" " + t._s(t.$tc("_common:block", { count: t.document.getAllNodesWithType("attachments").length })) + " ")])])], 1)])]), e("div", { staticStyle: { height: "1.25rem" } }), e("div", { staticClass: "select-none pb-1 text-sm font-medium text-gray-800" }, [t._v(" " + t._s(t.$t("_common:verification").capitalize()) + " ")]), e("div", { staticClass: "option-item", class: { disabled: !t.allowVerification } }, [e("div", { staticClass: "option-item__inner bg-gray-100 hover:bg-gray-200", on: { click: function(i) {
185
+ t.options.showVerification = !t.options.showVerification;
186
+ } } }, [e("CCheckbox", { staticStyle: { flex: "0 0 30px" }, attrs: { value: t.options.showVerification, type: "secondary", size: "small" } }), e("div", [e("div", [t._v(t._s(t.$t("showVerification")))]), e("div", { staticClass: "has-text-grey-dark", staticStyle: { "font-size": "13px" } }, [t._v(" " + t._s(t.$t("showVerificationSub")) + " ")])])], 1), t.options.showVerification ? e("div", { staticClass: "option-item__inner border-t-2 border-white bg-gray-100 pl-8 hover:bg-gray-200", on: { click: function(i) {
187
+ t.options.showEvents = !t.options.showEvents;
188
+ } } }, [e("CCheckbox", { staticStyle: { flex: "0 0 30px" }, attrs: { value: t.options.showEvents, type: "secondary", size: "small" } }), e("div", [e("div", [t._v(t._s(t.$t("showEvents")))])])], 1) : t._e(), t.options.showVerification && t.hasBankIdSignatures ? e("div", [e("div", { staticClass: "mb-1 mt-3 inline-flex cursor-pointer select-none items-center rounded p-2 text-xs font-medium leading-none text-gray-500 hover:bg-gray-100", on: { click: function(i) {
189
+ t.showMoreOptions = !t.showMoreOptions;
190
+ } } }, [t._v(" " + t._s(t.$t("_common:more").capitalize()) + " "), e("CIcon", { staticClass: "ml-0.5 transition-transform", class: { "rotate-90": t.showMoreOptions }, attrs: { type: "chevron-right", "stroke-width": "2.25", size: "12" } })], 1), e("Animation", [t.showMoreOptions ? e("div", { staticClass: "option-item__inner bg-gray-100 hover:bg-gray-200", on: { click: function(i) {
191
+ t.options.showLast4ssn = !t.options.showLast4ssn;
192
+ } } }, [e("CCheckbox", { staticStyle: { flex: "0 0 30px" }, attrs: { value: t.options.showLast4ssn, type: "secondary", size: "small" } }), e("div", [e("div", [t._v(t._s(t.$t("showLast4ssn")))])])], 1) : t._e()])], 1) : t._e()]), t.showAdminOptions ? e("div", [e("div", { staticStyle: { height: "1.25rem" } }), e("div", { staticClass: "select-none pb-1 text-sm font-medium text-gray-800" }, [t._v(" Superuser + VPN ")]), e("div", { staticClass: "option-item__inner border-t-2 border-white bg-gray-100 text-xs opacity-80 hover:bg-gray-200", on: { click: function(i) {
193
+ t.options.forceDoCreatePdf = !t.options.forceDoCreatePdf;
194
+ } } }, [e("CCheckbox", { staticClass: "py-2", attrs: { value: t.options.forceDoCreatePdf, size: "small" } }, [t._v(" Force re-create PDF ")])], 1), e("div", { staticClass: "option-item__inner border-t-2 border-white bg-gray-100 text-xs opacity-80 hover:bg-gray-200", on: { click: function(i) {
195
+ t.options.compressImages = !t.options.compressImages;
196
+ } } }, [e("CCheckbox", { staticStyle: { flex: "0 0 30px" }, attrs: { value: t.options.compressImages, type: "secondary", size: "small" } }), t._m(0)], 1), e("div", { staticClass: "option-item__inner border-t-2 border-white bg-gray-100 text-xs opacity-80 hover:bg-gray-200", on: { click: function(i) {
197
+ t.options.debugPage = !t.options.debugPage;
198
+ } } }, [e("CCheckbox", { staticClass: "py-2", attrs: { value: t.options.debugPage, size: "small" } }, [t._v(" Debug page output ")])], 1), e("div", { staticClass: "border-t-2 border-white bg-gray-100 text-xs opacity-80 hover:bg-gray-200" }, [e("CInput", { attrs: { type: "number", filled: "", size: "small", placeholder: "Optional extra timeout (ms)" }, model: { value: t.extraTimeout, callback: function(i) {
199
+ t.extraTimeout = t._n(i);
200
+ }, expression: "extraTimeout" } })], 1)]) : t._e()])]), e("CButton", { attrs: { type: "secondary", size: "medium", wide: "" }, on: { click: t.generatePdf } }, [t._v(" " + t._s(t.$t("buttonText")) + " ")])], 1);
201
+ }, g = [function() {
202
+ var s = this, t = s._self._c;
203
+ return t("div", [t("div", [s._v("Compress images")])]);
204
+ }], v = /* @__PURE__ */ d(
205
+ u,
206
+ f,
207
+ g,
208
+ !1,
209
+ null,
210
+ "46bff44c"
211
+ );
212
+ const b = v.exports, w = {
213
+ name: "DocPrint",
214
+ components: {
215
+ DocumentPrint: b
216
+ },
217
+ props: {
218
+ document: {
219
+ type: Object,
220
+ required: !0
221
+ }
222
+ }
223
+ };
224
+ var y = function() {
225
+ var t = this, e = t._self._c;
226
+ return e("div", { staticClass: "h-full w-full overflow-auto px-8 py-12" }, [e("DocumentPrint", { attrs: { document: t.document }, on: { close: function(i) {
227
+ return t.$router.push("/");
228
+ } } })], 1);
229
+ }, _ = [], x = /* @__PURE__ */ d(
230
+ w,
231
+ y,
232
+ _,
233
+ !1,
234
+ null,
235
+ null
236
+ );
237
+ const C = x.exports;
238
+ export {
239
+ C as default
240
+ };
@@ -0,0 +1,210 @@
1
+ import { g as p, n as u } from "./main-CQBEuZk9.js";
2
+ import { m as g, a as _ } from "./vuex.esm-DKGl8mcw.js";
3
+ const f = {
4
+ sv: {
5
+ title: "Verifikat på signering",
6
+ waitingForSign: "Väntar på signatur",
7
+ signMethod: "Signeringsmetod",
8
+ remaining: "{{count}} st signaturer kvarstår innan dokumentet är helt signerat.",
9
+ confirmChangeMessage: "Vill du verkligen byta signeringsmetod för {{- name}}?",
10
+ bankIdHint: "Identifiering och signering säkerställd med BankID."
11
+ },
12
+ en: {
13
+ title: "Signature verification",
14
+ waitingForSign: "Waiting for signature",
15
+ signMethod: "Sign method",
16
+ remaining: "{{count}} signatures are remaining before the document is completely signed.",
17
+ confirmChangeMessage: "Do you really want to change sign method for {{- name}}?",
18
+ bankIdHint: "Identity and signature confirmed with BankID"
19
+ }
20
+ }, x = {
21
+ name: "DocumentReceipt",
22
+ i18nOptions: {
23
+ namespaces: "documentReceipt",
24
+ messages: f
25
+ },
26
+ props: {
27
+ document: {
28
+ type: Object,
29
+ required: !0
30
+ },
31
+ allowSignMethodUpdate: {
32
+ type: Boolean,
33
+ default: !0
34
+ }
35
+ },
36
+ computed: {
37
+ ...g({
38
+ feature: "application/feature"
39
+ }),
40
+ signees() {
41
+ const { senderClient: a, clients: t } = this.document;
42
+ return [
43
+ ...a ? [a] : [],
44
+ ...(t || []).map((n, s) => ({ ...n, index: s }))
45
+ ].filter(
46
+ (n) => {
47
+ var s;
48
+ return ["signee", "approver"].includes(n.documentRole) || ((s = n.answer) == null ? void 0 : s.didAccept);
49
+ }
50
+ ).map(
51
+ ({
52
+ name: n = "",
53
+ companyName: s,
54
+ email: o,
55
+ socialNo: c = null,
56
+ answerMethod: i,
57
+ answer: d,
58
+ documentRole: m,
59
+ index: l
60
+ }) => ({
61
+ name: n || s || o,
62
+ socialNo: c,
63
+ method: (i == null ? void 0 : i.accept) || "",
64
+ documentRole: m,
65
+ ...d,
66
+ index: l
67
+ })
68
+ );
69
+ },
70
+ waitingFor() {
71
+ return this.document.recipients.reduce(
72
+ (a, t) => {
73
+ var e;
74
+ return t.answer || !["signee", "approver"].includes(t.documentRole) || ((e = t.answerMethod) == null ? void 0 : e.accept) === "inPerson" ? a : [...a, t];
75
+ },
76
+ []
77
+ );
78
+ },
79
+ documentName() {
80
+ return this.document.name || "";
81
+ },
82
+ sentByName() {
83
+ var a, t;
84
+ return ((t = (a = this.document.sender) == null ? void 0 : a.user) == null ? void 0 : t.name) || "";
85
+ },
86
+ signOptions() {
87
+ var a;
88
+ return ((a = this.document) == null ? void 0 : a.signOptions) || [];
89
+ }
90
+ },
91
+ methods: {
92
+ ..._({
93
+ showMessage: p.SHOW_MESSAGE,
94
+ updateDocument: p.UPDATE_DOCUMENT2
95
+ }),
96
+ getIconType(a) {
97
+ return a === "signee" ? "pen-tool" : a === "recipient" ? "eye" : a === "approver" ? "check" : "shield";
98
+ },
99
+ getBrowserString({ browser: a, os: t, device: e }) {
100
+ return [a == null ? void 0 : a.name, t == null ? void 0 : t.name, e == null ? void 0 : e.model].filter((n) => !!n).join(", ");
101
+ },
102
+ onUpdate(a, t) {
103
+ this.showMessage({
104
+ displayType: "dialog",
105
+ type: "secondary",
106
+ title: this.$t("_common:change", {
107
+ thing: this.$t("_common:signMethod.title").toLowerCase()
108
+ }),
109
+ message: this.$t("confirmChangeMessage", { name: a.name }),
110
+ actions: {
111
+ cancel: {
112
+ text: this.$t("_common:cancel"),
113
+ callback: "cancel"
114
+ },
115
+ submit: {
116
+ text: this.$t("actions:updateDocumentDialog.submit"),
117
+ callback: () => this.updateSignMethod(a.index, t)
118
+ }
119
+ }
120
+ });
121
+ },
122
+ async updateSignMethod(a, t) {
123
+ const { id: e } = this.document || {}, n = { [`clients.${a}.answerMethod.accept`]: t };
124
+ await this.updateDocument({
125
+ id: e,
126
+ body: n,
127
+ params: { type: "paths" }
128
+ });
129
+ }
130
+ }
131
+ };
132
+ var h = function() {
133
+ var t = this, e = t._self._c;
134
+ return e("div", { staticClass: "rounded-lg border border-gray-200 bg-gray-100 px-1 pb-1 pt-4 text-gray-600" }, [e("div", { staticClass: "relative mb-1 leading-5" }, [e("div", { staticClass: "pb-1 pl-4" }, [e("div", { staticClass: "font-medium text-black" }, [t._v(t._s(t.$t("title")))]), e("div", { staticClass: "data-label" }, [t._v(t._s(t.documentName))]), e("div", { staticClass: "grid grid-cols-3 gap-2 pb-1 pt-4", staticStyle: { "grid-template-columns": "repeat(auto-fit, minmax(200px, 1fr))" } }, [t._l([
135
+ [t.$t("_common:sentByName"), t.sentByName],
136
+ [
137
+ t.$t("_components:status.sent"),
138
+ t.$formatDate(t.document.sentAt, "Pp")
139
+ ],
140
+ [
141
+ t.$t("_components:replyBy"),
142
+ t.document.status === "sent" && t.$formatDate(t.document.expiresAt)
143
+ ],
144
+ [
145
+ t.$t("_components:status.accepted"),
146
+ t.$formatDate(t.document.acceptedAt, "Pp")
147
+ ]
148
+ ], function([n, s], o) {
149
+ return [s ? e("div", { key: o }, [e("div", { staticClass: "text-xs text-gray-900", domProps: { textContent: t._s(n) } }), e("div", { staticClass: "mr-1.5 text-gray-600", domProps: { textContent: t._s(s) } })]) : t._e()];
150
+ })], 2)]), t.waitingFor.length ? e("div", { staticClass: "ml-3 mt-2 inline-flex items-center rounded-full border border-orange-200/90 bg-orange-50 px-1 py-0.5 text-xs font-medium text-black/80" }, [e("CIcon", { staticClass: "text-orange-500/80", attrs: { type: "info", size: "14" } }), e("div", { staticClass: "px-1.5" }, [t._v(" " + t._s(t.$t("remaining", { count: t.waitingFor.length })) + " ")])], 1) : t._e(), e("CIcon", { staticClass: "absolute right-5 top-1 text-gray-500", attrs: { type: "lock", size: "18" } })], 1), e("div", { staticClass: "flex flex-col gap-2 p-2" }, t._l(t.signees, function(n, s) {
151
+ var o, c;
152
+ return e("div", { key: s, staticClass: "relative rounded-md border border-gray-200 bg-white text-gray-700" }, [e("div", { staticClass: "px-4 py-3" }, [n.didAccept && n.method === "bankId" ? e("CIcon", { staticClass: "absolute right-4 top-3", attrs: { type: "bankIdColor", size: "22" } }) : n.didAccept ? e("CIcon", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: t.$t(`_common:documentRole.${n.documentRole}.label`), expression: "$t(`_common:documentRole.${signee.documentRole}.label`)" }], staticClass: "lock-icon absolute right-6 top-4 opacity-70", attrs: { size: 18, type: t.getIconType(n.documentRole) } }) : t._e(), n.didAccept === !1 ? e("div", { staticClass: "absolute right-3 top-3 inline-flex rounded-full border border-red-400/50 bg-red-200 px-2 py-0.5 text-xs font-medium text-red-700" }, [t._v(" " + t._s(t.$t("_common:denied").capitalize()) + " ")]) : !n.didAccept && n.method !== "inPerson" ? e("div", { staticClass: "absolute right-3 top-3 inline-flex rounded-full border border-orange-200/70 bg-orange-50 px-2 py-0.5 text-xs font-medium text-black/80" }, [t._v(" " + t._s(t.$t("waitingForSign")) + " ")]) : t._e(), e("div", { staticClass: "pb-1 text-[15px] font-medium text-black" }, [t._v(" " + t._s(((o = n.response) == null ? void 0 : o.name) || n.name) + " ")]), e("div", { staticClass: "grid grid-cols-3 gap-2 py-1", staticStyle: { "grid-template-columns": "repeat(auto-fit, minmax(190px, 1fr))" } }, [t._l([
153
+ [t.$t("_common:socialNo").capitalize(), n.socialNo],
154
+ [
155
+ t.$t("signMethod"),
156
+ t.$t(`_common:signMethod.${n.method}`),
157
+ "signMethod"
158
+ ],
159
+ [
160
+ `${t.$t("_common:date").capitalize()} & ${t.$t("_common:time")}`,
161
+ t.$formatDate(n.didAnswerAt, "Pp")
162
+ ],
163
+ ["IP-" + t.$t("_common:address"), n.ip],
164
+ [
165
+ `${t.$t("_common:browser")}, OS & ${t.$t("_common:device")}`,
166
+ t.getBrowserString(n)
167
+ ]
168
+ ], function([i, d, m], l) {
169
+ return [d ? e("div", { key: l, staticClass: "text-[13px]" }, [e("div", { staticClass: "text-gray-900", domProps: { textContent: t._s(i) } }), e("div", { staticClass: "flex items-center" }, [e("div", { staticClass: "mr-1.5 text-gray-500", domProps: { textContent: t._s(d) } }), m === "signMethod" && n.method && t.allowSignMethodUpdate && t.signOptions.length > 1 && t.document.status !== "accepted" && n.didAccept === void 0 ? e("CDropdown", { attrs: { "append-to-body": !0, "menu-styling": { width: "180px" } } }, [e("div", { staticClass: "text-primary-500 text-xs font-medium underline", attrs: { slot: "trigger" }, domProps: { textContent: t._s(t.$t("_common:change")) }, slot: "trigger" }), t._l(t.signOptions, function(r) {
170
+ return e("CDropdownItem", { key: r, attrs: { "icon-right": n.method === r ? "check" : "" }, on: { click: function(D) {
171
+ n.method !== r && t.onUpdate(n, r);
172
+ } } }, [t._v(" " + t._s(t.$t(`_common:signMethod.${r}`)) + " ")]);
173
+ })], 2) : t._e()], 1)]) : t._e()];
174
+ })], 2)], 1), n.signatureDataURL ? e("div", { staticClass: "mx-4 h-20 border-t border-gray-100 py-6" }, [e("img", { staticClass: "h-full", attrs: { src: n.signatureDataURL } })]) : n.didAccept && n.method === "bankId" ? e("div", { staticClass: "mx-4 mb-4 flex items-center rounded-md bg-gray-300 p-1.5 text-white/90", staticStyle: { border: "1px solid #35677e" }, style: "background: linear-gradient(45deg,hsl(200deg 35% 17%),hsl(199deg 25% 30%));" }, [e("div", { staticClass: "ml-0.5 mr-2 flex h-9 w-9 items-center justify-center rounded-md border border-[#275369] bg-[#183e4f]" }, [e("CIcon", { attrs: { type: "bankId", size: "22" } })], 1), e("div", [e("div", { staticClass: "text-xs font-medium", domProps: { textContent: t._s(t.$t("bankIdHint")) } }), e("div", { staticClass: "text-xs opacity-70" }, [t._v(" " + t._s(((c = n.response) == null ? void 0 : c.name) || n.name) + " · " + t._s(n.socialNo) + " ")])])]) : t._e()]);
175
+ }), 0)]);
176
+ }, y = [], b = /* @__PURE__ */ u(
177
+ x,
178
+ h,
179
+ y,
180
+ !1,
181
+ null,
182
+ null
183
+ );
184
+ const v = b.exports, C = {
185
+ name: "DocReceipt",
186
+ components: {
187
+ DocumentReceipt: v
188
+ },
189
+ props: {
190
+ document: {
191
+ type: Object,
192
+ required: !0
193
+ }
194
+ }
195
+ };
196
+ var $ = function() {
197
+ var t = this, e = t._self._c;
198
+ return e("div", [e("DocumentReceipt", { attrs: { document: t.document, "allow-sign-method-update": !1 } })], 1);
199
+ }, k = [], w = /* @__PURE__ */ u(
200
+ C,
201
+ $,
202
+ k,
203
+ !1,
204
+ null,
205
+ null
206
+ );
207
+ const M = w.exports;
208
+ export {
209
+ M as default
210
+ };