@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
@@ -0,0 +1,488 @@
1
+ import { m as v } from "./mapFormMixin-D3BihYWW.js";
2
+ import { B as A } from "./BlockMedia-CW5wgipC.js";
3
+ import { aa as u, A as C, _ as b, o as n, d as s, s as i, n as f, l as w, v as r, f as l, B as T, z as N, b as h, c as _, F as V, b2 as F, e as x, Z as P } from "./main-Cb-nyil1.js";
4
+ import { u as B } from "./DocumentLayout-CKSi42ev.js";
5
+ import { t as D } from "./template-BvaNnq-g.js";
6
+ import { s as L } from "./dom-CkTGWrfu.js";
7
+ import { T as j } from "./DocTextEditor-Dm-cTZpA.js";
8
+ import { i as z } from "./i18nMessages-Chz_lxGG.js";
9
+ const M = {
10
+ name: "SummaryBottom",
11
+ mixins: [v([])],
12
+ props: {
13
+ base: {
14
+ type: Object,
15
+ default: null
16
+ },
17
+ options: {
18
+ type: Array,
19
+ default: () => []
20
+ },
21
+ backgroundColor: {
22
+ type: String,
23
+ default: "#4c576d"
24
+ },
25
+ documentCurrency: {
26
+ type: String,
27
+ required: !0
28
+ },
29
+ vatType: {
30
+ type: String,
31
+ required: !0
32
+ }
33
+ },
34
+ setup() {
35
+ return { docWidth: B() };
36
+ },
37
+ data() {
38
+ return {
39
+ get: u,
40
+ tinycolor: D
41
+ };
42
+ },
43
+ computed: {
44
+ prices() {
45
+ return u(this, "base.prices") || {};
46
+ },
47
+ isIndivid() {
48
+ return u(this.prices, "helpers.isIndivid", !0);
49
+ },
50
+ showIncVat() {
51
+ return this.isIndivid;
52
+ },
53
+ priceTotal() {
54
+ return this.isIndivid ? u(this.prices, "total", null) : u(this.prices, "subTotal", null);
55
+ },
56
+ priceType() {
57
+ return this.prices.type || ["fixed"];
58
+ },
59
+ currency() {
60
+ return this.prices.currency || this.documentCurrency;
61
+ },
62
+ openAccMaxPrice() {
63
+ return this.prices.maxTotal || null;
64
+ },
65
+ houseWorkType() {
66
+ return u(this.prices, "region.houseWorkType", null);
67
+ },
68
+ isReverseVat() {
69
+ return u(this.prices, "region.reverseVat", !1);
70
+ },
71
+ priceTypeString() {
72
+ return this.priceType.includes("openAccMaxPrice") ? this._document.$t("price.openAccMaxPrice") : this.priceType.includes("openAcc") ? this._document.$t("price.openAcc") : this._document.$t("price.price").capitalize();
73
+ },
74
+ priceDeductionVatString() {
75
+ let e = "";
76
+ if (this.isReverseVat && !this.showIncVat) {
77
+ const o = this.priceFormat(0, {
78
+ currency: this.currency,
79
+ showZero: !0
80
+ });
81
+ return e = this._document.$t("summaryBottom.reverseVat", { amount: o }), e;
82
+ }
83
+ return this.houseWorkType && (e = this._document.$t("deduction.afterType", {
84
+ type: this.$t(`deduction.${this.houseWorkType}_percentage`)
85
+ })), this.showIncVat && (e += ` ${this._document.$t("vat.incVat", {
86
+ thing: this._document.$t(`vat.${this.vatType}`)
87
+ })}`), this.showIncVat || (e += ` ${this._document.$t("vat.exVat", {
88
+ thing: this._document.$t(`vat.${this.vatType}`)
89
+ })}`), e.capitalize();
90
+ },
91
+ backgroundSecondary() {
92
+ if (!this.isSmallScreen) return { backgroundColor: "transparent" };
93
+ const e = this.backgroundColor.match(/(\d*\.)?\d+/g)[0], o = this.backgroundColor.match(/(\d*\.)?\d+/g)[1], t = this.backgroundColor.match(/(\d*\.)?\d+/g)[2], c = this.backgroundColor.match(/(\d*\.)?\d+/g)[3];
94
+ return {
95
+ backgroundColor: `hsla(${e}, ${o ** 0.9}%, ${t ** 0.9}%, ${c})`
96
+ };
97
+ },
98
+ isSmallScreen() {
99
+ return this.docWidth <= 576;
100
+ }
101
+ },
102
+ methods: {
103
+ priceFormat: C,
104
+ scrollToPricing() {
105
+ const e = document.querySelector("#price");
106
+ e && L(e);
107
+ }
108
+ }
109
+ }, I = { class: "summary-bottom-root" }, W = { class: "price-type-string data-text" }, H = {
110
+ key: 0,
111
+ class: "price-deduction-text"
112
+ }, E = {
113
+ key: 0,
114
+ class: "open-acc-wrapper"
115
+ }, $ = {
116
+ key: 0,
117
+ class: "open-acc-item"
118
+ }, O = { class: "open-acc-link" }, U = {
119
+ class: "data-text",
120
+ style: { "font-size": "calc(2 * var(--rem))", "font-weight": "900", "letter-spacing": "1px", "line-height": "1", "padding-bottom": "calc(0.3 * var(--rem))" }
121
+ }, q = {
122
+ key: 2,
123
+ class: "label-text caps price-deduction-text",
124
+ style: { "margin-top": "4px" }
125
+ }, Z = {
126
+ key: 1,
127
+ class: "flex w-full items-center justify-end",
128
+ style: { height: "108px" }
129
+ }, R = { style: { "text-align": "right", padding: "calc(2 * var(--rem))" } }, G = { style: { "font-size": "calc(1.5 * var(--rem))", "font-weight": "900" } }, J = { style: { "background-color": "hsla(0, 0%, 0%, 0.15)", paadding: "calc(1 * var(--rem)) calc(2 * var(--rem))", height: "100%", display: "inline-flex" } }, K = {
130
+ key: 0,
131
+ style: { padding: "calc(2 * var(--rem))", display: "inline-flex", "align-items": "center", "justify-content": "center", "font-weight": "900", "font-size": "calc(2.5 * var(--rem))" }
132
+ }, Q = {
133
+ key: 1,
134
+ style: { display: "flex", "flex-direction": "column", "align-items": "flex-start", "justify-content": "center", padding: "calc(1 * var(--rem)) calc(1 * var(--rem))", "text-align": "left" }
135
+ }, X = { style: { "font-weight": "900", "font-size": "calc(1.5 * var(--rem))" } };
136
+ function Y(e, o, t, c, d, a) {
137
+ return n(), s("section", I, [
138
+ i("div", {
139
+ style: w([
140
+ {
141
+ backgroundColor: t.backgroundColor,
142
+ color: d.tinycolor.readability(t.backgroundColor, "#FFF") > 2.2 ? "#FFF" : "#000"
143
+ },
144
+ t.options.length && {
145
+ overflow: "hidden",
146
+ padding: 0
147
+ }
148
+ ]),
149
+ class: "summary-bottom"
150
+ }, [
151
+ t.options.length ? (n(), s("div", Z, [
152
+ i("div", R, [
153
+ i("div", G, r(e._document.$t("price.proposal")), 1),
154
+ i("div", null, r(e._document.$t("summaryBottom.chooseFrom")), 1)
155
+ ]),
156
+ i("div", J, [
157
+ t.base ? (n(), s("div", Q, [
158
+ i("div", X, r(a.priceFormat(t.base.prices.total, {
159
+ currency: a.currency,
160
+ decimals: 2,
161
+ hideZeroDecimals: !0
162
+ })), 1),
163
+ i("div", null, " + " + r(e._document.$tc("summaryBottom.option", { count: t.options.length })), 1)
164
+ ])) : (n(), s("div", K, r(e._document.$t("summaryBottom.noOfOptions", {
165
+ count: t.options.length
166
+ })), 1))
167
+ ]),
168
+ o[1] || (o[1] = i("div", { style: { "background-color": "hsla(0, 0%, 0%, 0.4)", overflow: "hidden", width: "calc(1.5 * var(--rem))", display: "flex", "flex-direction": "column", "justify-content": "center", "align-items": "center", height: "100%", color: "hsla(0, 0%, 100%, 0.2)" } }, null, -1))
169
+ ])) : (n(), s("div", {
170
+ key: 0,
171
+ class: f([[
172
+ {
173
+ column: a.isSmallScreen,
174
+ sm: a.isSmallScreen
175
+ }
176
+ ], "flex w-full justify-between"]),
177
+ style: { position: "relative" }
178
+ }, [
179
+ i("div", {
180
+ class: f(["flex w-full flex-col", [{ "fixed-price-type-string": a.isSmallScreen }]]),
181
+ style: w([{ "background-color": "hsl(224, 57%, 39%)" }, [a.backgroundSecondary]])
182
+ }, [
183
+ i("div", W, r(a.priceTypeString), 1),
184
+ a.isSmallScreen ? l("", !0) : (n(), s("div", H, r(a.priceDeductionVatString), 1))
185
+ ], 6),
186
+ a.priceType.some((m) => ["openAcc", "openAccMaxPrice"].includes(m)) ? (n(), s("div", E, [
187
+ a.openAccMaxPrice ? (n(), s("div", $, [
188
+ i("div", null, r(e._document.$t("price.maxPrice").capitalize()) + " " + r(e._document.$t("vat.exVat", {
189
+ thing: e._document.$t(`vat.${t.vatType}`)
190
+ })) + ": ", 1),
191
+ i("div", null, r(a.priceFormat(a.openAccMaxPrice, { currency: a.currency })), 1)
192
+ ])) : l("", !0),
193
+ i("div", O, [
194
+ T(r(e._document.$t("see").capitalize()) + " ", 1),
195
+ i("span", {
196
+ style: { color: "inherit", cursor: "pointer" },
197
+ onClick: o[0] || (o[0] = (...m) => a.scrollToPricing && a.scrollToPricing(...m))
198
+ }, [
199
+ i("u", null, r(e._document.$t("price.price_plural")), 1)
200
+ ]),
201
+ T(" " + r(e._document.$t("summaryBottom.forDetails")), 1)
202
+ ])
203
+ ])) : (n(), s("div", {
204
+ key: 1,
205
+ class: f([[{ "justify-end": !a.isSmallScreen }], "flex w-full items-center"])
206
+ }, [
207
+ i("div", U, r(a.priceType.includes("approx") ? e._document.$t("approx").capitalize() : "") + " " + r(a.priceFormat(a.priceTotal, {
208
+ currency: a.currency,
209
+ decimals: 2,
210
+ hideZeroDecimals: !0
211
+ })), 1)
212
+ ], 2)),
213
+ a.isSmallScreen ? (n(), s("div", q, r(a.priceDeductionVatString), 1)) : l("", !0)
214
+ ], 2))
215
+ ], 4)
216
+ ]);
217
+ }
218
+ const ee = /* @__PURE__ */ b(M, [["render", Y], ["__scopeId", "data-v-7ac386a1"]]), te = {
219
+ name: "SummaryTop",
220
+ i18nOptions: {
221
+ namespaces: "summaryTop",
222
+ messages: z
223
+ },
224
+ components: {
225
+ TextEditor: j,
226
+ DocumentLogotype: N(
227
+ () => import("./DocumentLogotype-DbQlvQ-y.js")
228
+ )
229
+ },
230
+ emits: ["update:logotype", "update:doc-name"],
231
+ mixins: [v([])],
232
+ props: {
233
+ showLogo: {
234
+ type: Boolean,
235
+ default: !0
236
+ },
237
+ logotype: {
238
+ type: String,
239
+ default: null
240
+ },
241
+ companyLogotype: {
242
+ type: String,
243
+ default: null
244
+ },
245
+ senderName: {
246
+ type: String,
247
+ default: null
248
+ },
249
+ docName: {
250
+ type: String,
251
+ default: null
252
+ },
253
+ docType: {
254
+ type: String,
255
+ required: !0
256
+ },
257
+ docNumber: {
258
+ type: [Number, String],
259
+ default: null
260
+ },
261
+ sentAt: {
262
+ type: [String, Number],
263
+ default: null
264
+ // required: true,
265
+ },
266
+ expiresAt: {
267
+ type: String,
268
+ default: null
269
+ },
270
+ estimatedTime: {
271
+ type: String,
272
+ default: null
273
+ },
274
+ validator: {
275
+ type: Object,
276
+ default: () => ({})
277
+ },
278
+ hasHover: {
279
+ type: Boolean,
280
+ default: !1
281
+ }
282
+ },
283
+ setup() {
284
+ return { docWidth: B() };
285
+ }
286
+ }, oe = { class: "summary-top flex w-full justify-center" }, ae = { class: "doc-summary-top-wrapper" }, ie = {
287
+ class: "flex w-full justify-between",
288
+ style: { "margin-bottom": "calc(2.5 * var(--rem))" }
289
+ }, re = {
290
+ key: 1,
291
+ class: "company-name"
292
+ }, ne = { class: "top-right-text-wrapper" }, se = { key: 0 }, ce = { key: 1 }, le = { class: "title-text" }, de = ["innerHTML"], me = { class: "flex w-full justify-between" }, ue = {
293
+ key: 0,
294
+ class: "data-group"
295
+ }, pe = { class: "label-text caps" }, ye = { class: "data-text" }, he = {
296
+ key: 1,
297
+ class: "data-group"
298
+ }, ge = { class: "label-text caps" }, fe = { class: "data-text" }, _e = {
299
+ key: 0,
300
+ class: "data-group"
301
+ }, ve = { class: "label-text caps" }, be = { class: "data-text" };
302
+ function ke(e, o, t, c, d, a) {
303
+ const m = h("DocumentLogotype"), g = h("TextEditor");
304
+ return n(), s("section", oe, [
305
+ i("div", ae, [
306
+ o[2] || (o[2] = i("div", { class: "doc-summary-top-wrapper__background" }, null, -1)),
307
+ i("div", ie, [
308
+ t.showLogo && (t.logotype || t.companyLogotype) || e.canEdit ? (n(), _(m, {
309
+ key: 0,
310
+ "model-value": t.logotype,
311
+ "show-logo": t.showLogo,
312
+ "company-logotype": t.companyLogotype,
313
+ "has-hover": t.hasHover,
314
+ "onUpdate:modelValue": o[0] || (o[0] = (p) => e.$emit("update:logotype", p))
315
+ }, null, 8, ["model-value", "show-logo", "company-logotype", "has-hover"])) : (n(), s("div", re, r(t.senderName), 1)),
316
+ i("div", ne, [
317
+ t.sentAt ? (n(), s("div", se, r(e.$formatDate(t.sentAt)), 1)) : l("", !0),
318
+ t.docNumber ? (n(), s("div", ce, " #" + r(t.docNumber), 1)) : l("", !0)
319
+ ])
320
+ ]),
321
+ i("div", le, [
322
+ e.canEdit ? (n(), _(g, {
323
+ key: 1,
324
+ ref: "editor",
325
+ "model-value": t.docName,
326
+ placeholder: e.$t("name.placeholder"),
327
+ extensions: {
328
+ bulletList: !1,
329
+ heading: [1, 2, 3],
330
+ bold: !1,
331
+ link: !1,
332
+ underline: !1,
333
+ blockquote: !0,
334
+ table: !1
335
+ },
336
+ unstyled: "",
337
+ class: "no-drag",
338
+ static: "",
339
+ style: { "will-change": "opacity" },
340
+ "onUpdate:modelValue": o[1] || (o[1] = (p) => e.$emit("update:doc-name", p))
341
+ }, null, 8, ["model-value", "placeholder"])) : (n(), s("div", {
342
+ key: 0,
343
+ class: "quill-custom",
344
+ innerHTML: t.docName
345
+ }, null, 8, de))
346
+ ]),
347
+ i("div", me, [
348
+ t.expiresAt ? (n(), s("div", ue, [
349
+ i("div", pe, r(e._document.$t("replyBy")), 1),
350
+ i("div", ye, r(e.$formatDate(t.expiresAt)), 1)
351
+ ])) : l("", !0),
352
+ t.docType !== "document" ? (n(), s("div", he, [
353
+ i("div", ge, r(e._document.$t("document").capitalize()), 1),
354
+ i("div", fe, r(e._document.$t(`series.${t.docType}`).capitalize()), 1)
355
+ ])) : l("", !0),
356
+ c.docWidth >= 576 ? (n(), s(V, { key: 2 }, [
357
+ t.estimatedTime ? (n(), s("div", _e, [
358
+ i("div", ve, r(e.$t("estimatedTime")), 1),
359
+ i("div", be, r(e._document.$t("approx")) + " " + r(t.estimatedTime), 1)
360
+ ])) : l("", !0)
361
+ ], 64)) : l("", !0)
362
+ ])
363
+ ])
364
+ ]);
365
+ }
366
+ const Se = /* @__PURE__ */ b(te, [["render", ke], ["__scopeId", "data-v-8f85211e"]]), we = {
367
+ name: "PriceHeader",
368
+ components: {
369
+ SummaryTop: Se,
370
+ SummaryBottom: ee,
371
+ BlockMedia: A
372
+ },
373
+ emits: ["input"],
374
+ mixins: [
375
+ v([
376
+ "media",
377
+ "backgroundColor",
378
+ "documentName",
379
+ "showPriceSummary",
380
+ "showLogo",
381
+ "logotype"
382
+ ])
383
+ ],
384
+ props: {
385
+ _document: {
386
+ type: Object,
387
+ default: () => ({})
388
+ },
389
+ _value: {
390
+ type: Object,
391
+ default: () => ({})
392
+ },
393
+ hasHover: {
394
+ type: Boolean,
395
+ default: !1
396
+ }
397
+ },
398
+ computed: {
399
+ internalName: {
400
+ get() {
401
+ var e;
402
+ return this.documentName || `<p data-typography="title">${((e = this._document.data) == null ? void 0 : e.name) || ""}</p>`;
403
+ },
404
+ set(e) {
405
+ this.documentName = e, this.$emit("input", {
406
+ key: "data.name",
407
+ value: F(e).trim().slice(0, 255)
408
+ });
409
+ }
410
+ },
411
+ company() {
412
+ return this._document.sender.company;
413
+ },
414
+ prices() {
415
+ return this._document.prices;
416
+ },
417
+ estimatedTimeString() {
418
+ var t, c;
419
+ const { value: e, unitType: o } = ((c = (t = this._document) == null ? void 0 : t.data) == null ? void 0 : c.estimatedTime) || {};
420
+ return !e || !o ? null : this.$tc(`${o}`, { count: e });
421
+ },
422
+ sendAtShowDate() {
423
+ const { sentAt: e, scheduledFirstDelivery: o } = this._document;
424
+ return e || (o ? o.sendAt : null);
425
+ },
426
+ summaryBottom() {
427
+ var c;
428
+ let e = {
429
+ show: !1,
430
+ backgroundColor: this.backgroundColor || this._document.theme.priceSummaryBackground,
431
+ documentCurrency: this._document.currency,
432
+ vatType: this._document.vatType
433
+ }, { showPriceSummary: o } = this;
434
+ typeof o != "boolean" && ({ showPriceSummary: o } = this._document.theme);
435
+ const t = ((c = this._document.packageGroups) == null ? void 0 : c.packages) || [];
436
+ return t.length > 1 ? e = {
437
+ ...e,
438
+ show: o,
439
+ base: { prices: this.prices },
440
+ options: t.filter(({ toggable: d }) => d).map(({ prices: d }) => ({ prices: d }))
441
+ } : e = {
442
+ ...e,
443
+ show: o && this._document.readPrices && (this.prices.total || this.prices.type.some(
444
+ (d) => ["openAccMaxPrice", "openAcc"].includes(d)
445
+ )),
446
+ base: { prices: this.prices }
447
+ }, this.canEdit && o && (e.show = !0), e.documentCurrency || (e.show = !1), e;
448
+ }
449
+ }
450
+ }, Te = { class: "doc-jumbotron-wrapper" };
451
+ function xe(e, o, t, c, d, a) {
452
+ var k, S;
453
+ const m = h("BlockMedia"), g = h("SummaryTop"), p = h("SummaryBottom");
454
+ return n(), s("div", null, [
455
+ i("div", Te, [
456
+ x(m, {
457
+ media: {
458
+ ...e.media,
459
+ resourceUrl: ((k = e.media) == null ? void 0 : k.resourceUrl) || t._document.theme.background,
460
+ overlayColor: ((S = e.media) == null ? void 0 : S.overlayColor) || t._document.theme.backgroundFilter
461
+ },
462
+ class: "price-media-wrapper"
463
+ }, null, 8, ["media"]),
464
+ x(g, {
465
+ "show-logo": e.showLogo,
466
+ "onUpdate:showLogo": o[0] || (o[0] = (y) => e.showLogo = y),
467
+ logotype: e.logotype,
468
+ "onUpdate:logotype": o[1] || (o[1] = (y) => e.logotype = y),
469
+ "doc-name": a.internalName,
470
+ "onUpdate:docName": o[2] || (o[2] = (y) => a.internalName = y),
471
+ _document: t._document,
472
+ "company-logotype": a.company.logotype,
473
+ "sender-name": a.company.name,
474
+ "doc-type": t._document.docNumber.series,
475
+ "doc-number": t._document.docNumber.value,
476
+ "sent-at": a.sendAtShowDate,
477
+ "expires-at": t._document.expiresAt,
478
+ "estimated-time": a.estimatedTimeString,
479
+ "has-hover": t.hasHover
480
+ }, null, 8, ["show-logo", "logotype", "doc-name", "_document", "company-logotype", "sender-name", "doc-type", "doc-number", "sent-at", "expires-at", "estimated-time", "has-hover"])
481
+ ]),
482
+ a.summaryBottom.show ? (n(), _(p, P({ key: 0 }, a.summaryBottom, { _document: t._document }), null, 16, ["_document"])) : l("", !0)
483
+ ]);
484
+ }
485
+ const Le = /* @__PURE__ */ b(we, [["render", xe], ["__scopeId", "data-v-3628151e"]]);
486
+ export {
487
+ Le as default
488
+ };
@@ -0,0 +1,137 @@
1
+ import { m as u, U as h, V as f, W as d, _ as p, S as m } from "./main-Cb-nyil1.js";
2
+ import { d as y } from "./debounce-DNl99Gyo.js";
3
+ const g = {
4
+ name: "SearchApi",
5
+ props: {
6
+ customSearch: {
7
+ type: Object,
8
+ default: () => ({})
9
+ }
10
+ },
11
+ data() {
12
+ return {
13
+ defaultSearch: {
14
+ project: !0,
15
+ endCustomer: !1,
16
+ article: !1,
17
+ extensionArticle: !1,
18
+ // Articles in any authenticated CRM
19
+ document: !1
20
+ },
21
+ isLoading: !1,
22
+ emptyQuery: null,
23
+ // String to track last query that was empty, if a new query starts with this string we do not have to search again
24
+ hasSearchedAll: !1
25
+ // Helper to keep track when some search types have not yet searched due min query length
26
+ };
27
+ },
28
+ computed: {
29
+ ...u({
30
+ allAuthenticatedCRMs: "settings/allAuthenticatedCRMs",
31
+ can: "application/can"
32
+ }),
33
+ typesToFetch() {
34
+ return Object.keys(this.customSearch).length ? Object.keys(this.customSearch).filter(
35
+ (t) => this.customSearch[t]
36
+ ) : Object.keys(this.defaultSearch).filter(
37
+ (t) => this.defaultSearch[t]
38
+ );
39
+ }
40
+ },
41
+ methods: {
42
+ canFetchType(t) {
43
+ return t === "endCustomer" ? this.can("endCustomers", "read") : !0;
44
+ },
45
+ async fetch({ query: t, start: a = null, end: r = null }) {
46
+ const e = this.typesToFetch.reduce(
47
+ (i, n) => ({ ...i, [n]: [] }),
48
+ {}
49
+ ), s = t.toLowerCase();
50
+ if (this.emptyQuery && s && s.startsWith(this.emptyQuery) || (this.emptyQuery = null, this.hasSearchedAll = !0, !s)) return e;
51
+ try {
52
+ const i = [], n = Object.keys(this.defaultSearch);
53
+ (this.typesToFetch || []).forEach((c) => {
54
+ n.includes(c) && i.push(
55
+ (async () => {
56
+ let o = [];
57
+ c === "document" ? o = await this.fetchDocuments(s, a, r) : c === "extensionArticle" ? o = await this.fetchExtensionArticles(s, a, r) : o = await this.fetchType(c, s, a, r), e[c] = o;
58
+ })()
59
+ );
60
+ }), await Promise.all(i);
61
+ } finally {
62
+ this.isLoading = !1;
63
+ }
64
+ return Object.keys(e).every(
65
+ (i) => e[i].length === 0
66
+ ) && this.hasSearchedAll && (this.emptyQuery = s), e;
67
+ },
68
+ async fetchType(t, a, r, e) {
69
+ if (!this.canFetchType(t)) return [];
70
+ const { data: s } = await h("search", {
71
+ type: t,
72
+ query: a,
73
+ ...r !== null && e !== null && { start: r, end: e }
74
+ });
75
+ return s;
76
+ },
77
+ async fetchDocuments(t, a, r) {
78
+ const e = t.replace(/[-[\]{}()*+?.,\\/^$|#]/g, "\\$&"), s = {
79
+ $or: [
80
+ { "data.name": { $regex: e, $options: "i" } },
81
+ { "docNumber.value": { $regex: e, $options: "i" } },
82
+ {
83
+ clients: {
84
+ $elemMatch: {
85
+ $or: ["name", "email", "socialNo", "orgNo"].map((n) => ({
86
+ [n]: { $regex: e, $options: "i" }
87
+ }))
88
+ }
89
+ }
90
+ }
91
+ ]
92
+ }, { data: l } = await f("/document", {
93
+ params: {
94
+ lean: !0,
95
+ filter: encodeURIComponent(JSON.stringify(s)),
96
+ fields: "clients,data.name,projectId,docNumber,createdAt",
97
+ ...a !== null && r !== null && { skip: a, limit: r - a }
98
+ }
99
+ }), { items: i = [] } = l || {};
100
+ return i;
101
+ },
102
+ async fetchExtensionArticles(t) {
103
+ const a = [];
104
+ return await Promise.all(
105
+ this.allAuthenticatedCRMs.map(async (r) => {
106
+ try {
107
+ if (r === "pipedrive" && t.length < 2) {
108
+ this.hasSearchedAll = !1;
109
+ return;
110
+ }
111
+ const { data: e } = await d.search(r, {
112
+ query: t,
113
+ type: "article"
114
+ });
115
+ e && Array.isArray(e) && a.push(...e);
116
+ } catch {
117
+ }
118
+ })
119
+ ), a;
120
+ },
121
+ triggerSearch: y(async function({ q: a, cb: r, start: e, end: s }) {
122
+ this.isLoading = !0;
123
+ const l = await this.fetch({ query: a, start: e, end: s });
124
+ return this.isLoading = !1, r(l);
125
+ }, 500)
126
+ }
127
+ };
128
+ function S(t, a, r, e, s, l) {
129
+ return m(t.$slots, "default", {
130
+ fetch: ({ q: i, cb: n, start: c = null, end: o = null }) => (s.isLoading = !0, l.triggerSearch({ q: i, cb: n, start: c, end: o })),
131
+ isLoading: s.isLoading
132
+ });
133
+ }
134
+ const w = /* @__PURE__ */ p(g, [["render", S]]);
135
+ export {
136
+ w as S
137
+ };