@8wave/ai-elements 0.119.0-beta.30 → 0.119.0-beta.33

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 (143) hide show
  1. package/dist/_chunks/{PkChatbotFilePreview-DiuzVVKH.js → PkChatbotFilePreview-3i9jZIdS.js} +2 -2
  2. package/dist/_chunks/{PkChatbotFilePreview-DiuzVVKH.js.map → PkChatbotFilePreview-3i9jZIdS.js.map} +1 -1
  3. package/dist/_chunks/{PkStreamingMarkdown-DKyHYHUN.js → PkStreamingMarkdown-B1t1tBvW.js} +3 -3
  4. package/dist/_chunks/{PkStreamingMarkdown-DKyHYHUN.js.map → PkStreamingMarkdown-B1t1tBvW.js.map} +1 -1
  5. package/dist/_chunks/{PkToolEditSpreadsheet-CfJ3BWMe.js → PkToolEditSpreadsheet-Xzum_9NH.js} +2 -2
  6. package/dist/_chunks/{PkToolEditSpreadsheet-CfJ3BWMe.js.map → PkToolEditSpreadsheet-Xzum_9NH.js.map} +1 -1
  7. package/dist/_chunks/{PkToolRequestOAuthConnection-klmrRZWz.js → PkToolRequestOAuthConnection-W3ilzpr7.js} +2 -2
  8. package/dist/_chunks/{PkToolRequestOAuthConnection-klmrRZWz.js.map → PkToolRequestOAuthConnection-W3ilzpr7.js.map} +1 -1
  9. package/dist/_chunks/{PkToolShowArtifact-ChDm6ZEK.js → PkToolShowArtifact-DGGEb2LF.js} +2 -2
  10. package/dist/_chunks/{PkToolShowArtifact-ChDm6ZEK.js.map → PkToolShowArtifact-DGGEb2LF.js.map} +1 -1
  11. package/dist/_chunks/{PkToolShowCalendarEvent-CRVtR3oP.js → PkToolShowCalendarEvent-D8DMh3-P.js} +2 -2
  12. package/dist/_chunks/{PkToolShowCalendarEvent-CRVtR3oP.js.map → PkToolShowCalendarEvent-D8DMh3-P.js.map} +1 -1
  13. package/dist/_chunks/PkToolShowContactForm-Dn6CEXF_.js +158 -0
  14. package/dist/_chunks/PkToolShowContactForm-Dn6CEXF_.js.map +1 -0
  15. package/dist/_chunks/{PkToolShowDiagram-JpRMa4Jj.js → PkToolShowDiagram-WregKAJO.js} +3 -3
  16. package/dist/_chunks/{PkToolShowDiagram-JpRMa4Jj.js.map → PkToolShowDiagram-WregKAJO.js.map} +1 -1
  17. package/dist/_chunks/{PkToolShowForm-DnIwTGl4.js → PkToolShowForm-CbuToc8O.js} +2 -2
  18. package/dist/_chunks/{PkToolShowForm-DnIwTGl4.js.map → PkToolShowForm-CbuToc8O.js.map} +1 -1
  19. package/dist/_chunks/{PkToolShowImageGallery-Ab8fJ9jY.js → PkToolShowImageGallery-Dh0v2Df8.js} +4 -4
  20. package/dist/_chunks/{PkToolShowImageGallery-Ab8fJ9jY.js.map → PkToolShowImageGallery-Dh0v2Df8.js.map} +1 -1
  21. package/dist/_chunks/{PkToolShowLocation-D5d6bbP-.js → PkToolShowLocation-jRZtqoBO.js} +2 -2
  22. package/dist/_chunks/{PkToolShowLocation-D5d6bbP-.js.map → PkToolShowLocation-jRZtqoBO.js.map} +1 -1
  23. package/dist/_chunks/{PkToolShowProductList-DztzZVDd.js → PkToolShowProductList-bAis8u1t.js} +2 -2
  24. package/dist/_chunks/{PkToolShowProductList-DztzZVDd.js.map → PkToolShowProductList-bAis8u1t.js.map} +1 -1
  25. package/dist/_chunks/{PkToolShowSources-Bvg3f3GC.js → PkToolShowSources-D532Worv.js} +3 -3
  26. package/dist/_chunks/{PkToolShowSources-Bvg3f3GC.js.map → PkToolShowSources-D532Worv.js.map} +1 -1
  27. package/dist/_chunks/{PkToolShowVideo-DdoYLl7R.js → PkToolShowVideo-DcMzLibC.js} +3 -3
  28. package/dist/_chunks/{PkToolShowVideo-DdoYLl7R.js.map → PkToolShowVideo-DcMzLibC.js.map} +1 -1
  29. package/dist/_chunks/{PkToolShowWeather-CnpPZCLm.js → PkToolShowWeather-DTrZ7r1t.js} +2 -2
  30. package/dist/_chunks/{PkToolShowWeather-CnpPZCLm.js.map → PkToolShowWeather-DTrZ7r1t.js.map} +1 -1
  31. package/dist/_chunks/{PkToolShowWebPages-BooCEJrs.js → PkToolShowWebPages-RuwkZDMH.js} +3 -3
  32. package/dist/_chunks/{PkToolShowWebPages-BooCEJrs.js.map → PkToolShowWebPages-RuwkZDMH.js.map} +1 -1
  33. package/dist/_chunks/{chatImagePolicy-CfJt8_9Z.js → chatImagePolicy-BL4O14e9.js} +2 -2
  34. package/dist/_chunks/{chatImagePolicy-CfJt8_9Z.js.map → chatImagePolicy-BL4O14e9.js.map} +1 -1
  35. package/dist/_chunks/{index.es-oI6RqNZW.js → index.es-DkFMpDsf.js} +2 -2
  36. package/dist/_chunks/{index.es-oI6RqNZW.js.map → index.es-DkFMpDsf.js.map} +1 -1
  37. package/dist/_chunks/{src-DL9TKN-Z.js → src-CggZ5M7x.js} +46 -3
  38. package/dist/_chunks/src-CggZ5M7x.js.map +1 -0
  39. package/dist/_chunks/{useLightbox-1KKLemEE.js → useLightbox-3HiaRtzY.js} +2 -2
  40. package/dist/_chunks/{useLightbox-1KKLemEE.js.map → useLightbox-3HiaRtzY.js.map} +1 -1
  41. package/dist/ai-elements.es.js +836 -820
  42. package/dist/ai-elements.es.js.map +1 -1
  43. package/dist-vue/PkChatbot.js +1 -1
  44. package/dist-vue/PkChatbotAudioTranscript.js +1 -1
  45. package/dist-vue/PkChatbotEmptyState.js +1 -1
  46. package/dist-vue/PkChatbotFilePreview.js +1 -1
  47. package/dist-vue/PkChatbotInput.js +1 -1
  48. package/dist-vue/PkChatbotMessages.js +1 -1
  49. package/dist-vue/PkChatbotStepPayload.js +1 -1
  50. package/dist-vue/PkChatbotStepToolDetail.js +1 -1
  51. package/dist-vue/PkChatbotSteps.js +1 -1
  52. package/dist-vue/PkChatbotViewChat.js +1 -1
  53. package/dist-vue/PkChatbotViewConversations.js +1 -1
  54. package/dist-vue/PkChatbotViewFiles.js +1 -1
  55. package/dist-vue/PkChatbotViewProfile.js +1 -1
  56. package/dist-vue/_chunks/{PkChatbot-C18mnGJ9.js → PkChatbot-wODOAtOD.js} +8 -8
  57. package/dist-vue/_chunks/{PkChatbot-C18mnGJ9.js.map → PkChatbot-wODOAtOD.js.map} +1 -1
  58. package/dist-vue/_chunks/{PkChatbotAudioTranscript-0rvrhSRQ.js → PkChatbotAudioTranscript-CC9M-zDv.js} +2 -2
  59. package/dist-vue/_chunks/{PkChatbotAudioTranscript-0rvrhSRQ.js.map → PkChatbotAudioTranscript-CC9M-zDv.js.map} +1 -1
  60. package/dist-vue/_chunks/{PkChatbotEmptyState-BKiyP0Ga.js → PkChatbotEmptyState-Dx4mTkTX.js} +2 -2
  61. package/dist-vue/_chunks/{PkChatbotEmptyState-BKiyP0Ga.js.map → PkChatbotEmptyState-Dx4mTkTX.js.map} +1 -1
  62. package/dist-vue/_chunks/{PkChatbotFilePreview-D5H-RIk2.js → PkChatbotFilePreview-Lxgu89Hg.js} +2 -2
  63. package/dist-vue/_chunks/{PkChatbotFilePreview-D5H-RIk2.js.map → PkChatbotFilePreview-Lxgu89Hg.js.map} +1 -1
  64. package/dist-vue/_chunks/{PkChatbotInput-GvgsYsUw.js → PkChatbotInput-jj3qQl_f.js} +3 -3
  65. package/dist-vue/_chunks/{PkChatbotInput-GvgsYsUw.js.map → PkChatbotInput-jj3qQl_f.js.map} +1 -1
  66. package/dist-vue/_chunks/PkChatbotMessages-5wPl7-j-.js +876 -0
  67. package/dist-vue/_chunks/PkChatbotMessages-5wPl7-j-.js.map +1 -0
  68. package/dist-vue/_chunks/{PkChatbotStepPayload-Dm-HCHcG.js → PkChatbotStepPayload-f2mYAVpu.js} +2 -2
  69. package/dist-vue/_chunks/{PkChatbotStepPayload-Dm-HCHcG.js.map → PkChatbotStepPayload-f2mYAVpu.js.map} +1 -1
  70. package/dist-vue/_chunks/{PkChatbotStepToolDetail-Bpd_cZEO.js → PkChatbotStepToolDetail-BcYheOnU.js} +3 -3
  71. package/dist-vue/_chunks/{PkChatbotStepToolDetail-Bpd_cZEO.js.map → PkChatbotStepToolDetail-BcYheOnU.js.map} +1 -1
  72. package/dist-vue/_chunks/{PkChatbotSteps-C4qBM3_t.js → PkChatbotSteps-DKyF0ykL.js} +5 -5
  73. package/dist-vue/_chunks/{PkChatbotSteps-C4qBM3_t.js.map → PkChatbotSteps-DKyF0ykL.js.map} +1 -1
  74. package/dist-vue/_chunks/{PkChatbotViewChat-By2TY72m.js → PkChatbotViewChat-DZqXDwzk.js} +8 -8
  75. package/dist-vue/_chunks/{PkChatbotViewChat-By2TY72m.js.map → PkChatbotViewChat-DZqXDwzk.js.map} +1 -1
  76. package/dist-vue/_chunks/{PkChatbotViewConversations-CU5NfEO4.js → PkChatbotViewConversations-CXcToApC.js} +4 -4
  77. package/dist-vue/_chunks/{PkChatbotViewConversations-CU5NfEO4.js.map → PkChatbotViewConversations-CXcToApC.js.map} +1 -1
  78. package/dist-vue/_chunks/{PkChatbotViewFiles-CD-UZPT5.js → PkChatbotViewFiles-O8lhbXAX.js} +2 -2
  79. package/dist-vue/_chunks/{PkChatbotViewFiles-CD-UZPT5.js.map → PkChatbotViewFiles-O8lhbXAX.js.map} +1 -1
  80. package/dist-vue/_chunks/{PkChatbotViewProfile-DPlb_Wca.js → PkChatbotViewProfile-kryFJi0l.js} +2 -2
  81. package/dist-vue/_chunks/{PkChatbotViewProfile-DPlb_Wca.js.map → PkChatbotViewProfile-kryFJi0l.js.map} +1 -1
  82. package/dist-vue/_chunks/{PkStreamingMarkdown-CsHzdW69.js → PkStreamingMarkdown-CywawRVj.js} +3 -3
  83. package/dist-vue/_chunks/{PkStreamingMarkdown-CsHzdW69.js.map → PkStreamingMarkdown-CywawRVj.js.map} +1 -1
  84. package/dist-vue/_chunks/{PkSvgViewer-D6DJ2jVO.js → PkSvgViewer-DU8K_gAD.js} +2 -2
  85. package/dist-vue/_chunks/{PkSvgViewer-D6DJ2jVO.js.map → PkSvgViewer-DU8K_gAD.js.map} +1 -1
  86. package/dist-vue/_chunks/{PkToolEditSpreadsheet-D8Zp9gzW.js → PkToolEditSpreadsheet-BT4HueLs.js} +2 -2
  87. package/dist-vue/_chunks/{PkToolEditSpreadsheet-D8Zp9gzW.js.map → PkToolEditSpreadsheet-BT4HueLs.js.map} +1 -1
  88. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-DosWR9I4.js → PkToolRequestOAuthConnection-Ck2tRuls.js} +2 -2
  89. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-DosWR9I4.js.map → PkToolRequestOAuthConnection-Ck2tRuls.js.map} +1 -1
  90. package/dist-vue/_chunks/{PkToolShowArtifact-BVofKJ7b.js → PkToolShowArtifact-BiFJoOTT.js} +2 -2
  91. package/dist-vue/_chunks/{PkToolShowArtifact-BVofKJ7b.js.map → PkToolShowArtifact-BiFJoOTT.js.map} +1 -1
  92. package/dist-vue/_chunks/{PkToolShowCalendarEvent-u9O_Sl3-.js → PkToolShowCalendarEvent-CFODjoDV.js} +2 -2
  93. package/dist-vue/_chunks/{PkToolShowCalendarEvent-u9O_Sl3-.js.map → PkToolShowCalendarEvent-CFODjoDV.js.map} +1 -1
  94. package/dist-vue/_chunks/PkToolShowContactForm-B7DvA6O1.js +160 -0
  95. package/dist-vue/_chunks/PkToolShowContactForm-B7DvA6O1.js.map +1 -0
  96. package/dist-vue/_chunks/{PkToolShowDiagram-CaoB4k6y.js → PkToolShowDiagram-DGMwlxqB.js} +4 -4
  97. package/dist-vue/_chunks/{PkToolShowDiagram-CaoB4k6y.js.map → PkToolShowDiagram-DGMwlxqB.js.map} +1 -1
  98. package/dist-vue/_chunks/{PkToolShowForm-vYuaPtu0.js → PkToolShowForm-BZmAnMSD.js} +3 -3
  99. package/dist-vue/_chunks/{PkToolShowForm-vYuaPtu0.js.map → PkToolShowForm-BZmAnMSD.js.map} +1 -1
  100. package/dist-vue/_chunks/{PkToolShowImageGallery-ooygXk7j.js → PkToolShowImageGallery-BsYTRg_W.js} +4 -4
  101. package/dist-vue/_chunks/{PkToolShowImageGallery-ooygXk7j.js.map → PkToolShowImageGallery-BsYTRg_W.js.map} +1 -1
  102. package/dist-vue/_chunks/{PkToolShowLocation-DVMpFdRk.js → PkToolShowLocation-BipZrvw7.js} +2 -2
  103. package/dist-vue/_chunks/{PkToolShowLocation-DVMpFdRk.js.map → PkToolShowLocation-BipZrvw7.js.map} +1 -1
  104. package/dist-vue/_chunks/{PkToolShowProductList-D-HJ9a_h.js → PkToolShowProductList-D1_v79Xm.js} +2 -2
  105. package/dist-vue/_chunks/{PkToolShowProductList-D-HJ9a_h.js.map → PkToolShowProductList-D1_v79Xm.js.map} +1 -1
  106. package/dist-vue/_chunks/{PkToolShowSources-DJ35l3Z3.js → PkToolShowSources-Czu2IiGq.js} +3 -3
  107. package/dist-vue/_chunks/{PkToolShowSources-DJ35l3Z3.js.map → PkToolShowSources-Czu2IiGq.js.map} +1 -1
  108. package/dist-vue/_chunks/{PkToolShowVideo-xcg1gdIE.js → PkToolShowVideo-D3D2sTAP.js} +3 -3
  109. package/dist-vue/_chunks/{PkToolShowVideo-xcg1gdIE.js.map → PkToolShowVideo-D3D2sTAP.js.map} +1 -1
  110. package/dist-vue/_chunks/{PkToolShowWeather-DJxKxVp_.js → PkToolShowWeather-BD0w6BA1.js} +2 -2
  111. package/dist-vue/_chunks/{PkToolShowWeather-DJxKxVp_.js.map → PkToolShowWeather-BD0w6BA1.js.map} +1 -1
  112. package/dist-vue/_chunks/{PkToolShowWebPages-BuaRjavD.js → PkToolShowWebPages-DTq0811l.js} +3 -3
  113. package/dist-vue/_chunks/{PkToolShowWebPages-BuaRjavD.js.map → PkToolShowWebPages-DTq0811l.js.map} +1 -1
  114. package/dist-vue/_chunks/{createChatbotApiClient-G3Tt1I67.js → createChatbotApiClient-BlJ952Kb.js} +2 -2
  115. package/dist-vue/_chunks/{createChatbotApiClient-G3Tt1I67.js.map → createChatbotApiClient-BlJ952Kb.js.map} +1 -1
  116. package/dist-vue/_chunks/{mcpOAuthReport-3A9v_gW_.js → mcpOAuthReport-BHCMTtgf.js} +2 -2
  117. package/dist-vue/_chunks/{mcpOAuthReport-3A9v_gW_.js.map → mcpOAuthReport-BHCMTtgf.js.map} +1 -1
  118. package/dist-vue/_chunks/{src-DpkuiHam.js → src-BZRiAJsH.js} +46 -3
  119. package/dist-vue/_chunks/src-BZRiAJsH.js.map +1 -0
  120. package/dist-vue/_chunks/{useChatbotStore-C1sgxgD1.js → useChatbotStore-CueyhDPB.js} +4 -4
  121. package/dist-vue/_chunks/{useChatbotStore-C1sgxgD1.js.map → useChatbotStore-CueyhDPB.js.map} +1 -1
  122. package/dist-vue/_chunks/{useSafeLocalStorage-DLIc8pkn.js → useSafeLocalStorage-B1mX0eKb.js} +2 -2
  123. package/dist-vue/_chunks/{useSafeLocalStorage-DLIc8pkn.js.map → useSafeLocalStorage-B1mX0eKb.js.map} +1 -1
  124. package/dist-vue/_chunks/{utils-DsnEcdW3.js → utils-DmRXPCqa.js} +2 -2
  125. package/dist-vue/_chunks/{utils-DsnEcdW3.js.map → utils-DmRXPCqa.js.map} +1 -1
  126. package/dist-vue/api.js +1 -1
  127. package/dist-vue/composables.js +24 -8
  128. package/dist-vue/composables.js.map +1 -1
  129. package/dist-vue/index.js +2855 -2843
  130. package/dist-vue/index.js.map +1 -1
  131. package/dist-vue/locales.js +6 -2
  132. package/dist-vue/packages/components/src/chat/PkToolShowContactForm.d.ts +6 -0
  133. package/dist-vue/packages/models/src/schema/Member.d.ts +15 -0
  134. package/dist-vue/style.css +1 -1
  135. package/package.json +1 -1
  136. package/dist/_chunks/PkToolShowContactForm-CfCy-b8w.js +0 -120
  137. package/dist/_chunks/PkToolShowContactForm-CfCy-b8w.js.map +0 -1
  138. package/dist/_chunks/src-DL9TKN-Z.js.map +0 -1
  139. package/dist-vue/_chunks/PkChatbotMessages-CDLsj7qw.js +0 -876
  140. package/dist-vue/_chunks/PkChatbotMessages-CDLsj7qw.js.map +0 -1
  141. package/dist-vue/_chunks/PkToolShowContactForm-BzdIFTnC.js +0 -122
  142. package/dist-vue/_chunks/PkToolShowContactForm-BzdIFTnC.js.map +0 -1
  143. package/dist-vue/_chunks/src-DpkuiHam.js.map +0 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@8wave/ai-elements",
3
3
  "private": false,
4
- "version": "0.119.0-beta.30",
4
+ "version": "0.119.0-beta.33",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite --port 8082 --open --host",
@@ -1,120 +0,0 @@
1
- import { _ as e, b as t, d as n } from "./zod-Dd1GFq_6.js";
2
- import { $ as r, C as i, Ct as a, Dt as o, L as s, O as c, St as l, X as u, ct as d, h as f, it as p, m, r as h, t as g, v as _, x as v } from "./vue.runtime.esm-bundler-DKVd2gci.js";
3
- import { r as y } from "./vue-i18n-CooVjJjT.js";
4
- import { t as b } from "./PkStreamingMarkdown-DKyHYHUN.js";
5
- import { t as x } from "./index.es-dTcgyeM4.js";
6
- import { t as S } from "./VvButtonLocalized-DV-zbH9b.js";
7
- import { n as C, r as w, t as T } from "./index.es-oI6RqNZW.js";
8
- //#region ../../packages/components/src/chat/PkToolShowContactForm.vue?vue&type=script&setup=true&lang.ts
9
- c(), p(), a(), h();
10
- var E = { class: "border border-surface-3 rounded-xl w-full overflow-hidden bg-surface" }, D = { class: "px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8 min-h-40" }, O = { class: "font-bold" }, k = {
11
- key: 0,
12
- class: "p-sm"
13
- }, A = { class: "flex justify-between items-center gap-16 mt-xs" }, j = { class: "text-smaller text-word-3 flex items-center gap-8" }, M = {
14
- key: 1,
15
- class: "p-sm"
16
- }, N = { class: "flex items-center gap-sm" }, P = { class: "font-medium block text-word-1" }, F = { class: "text-word-3" }, I = /* @__PURE__ */ i({
17
- __name: "PkToolShowContactForm",
18
- props: {
19
- part: { type: null },
20
- submitted: { type: Boolean },
21
- loading: { type: Boolean },
22
- error: { type: String },
23
- readonly: { type: Boolean },
24
- privacyPolicyNotice: { type: null }
25
- },
26
- emits: ["submit"],
27
- setup(i, { emit: a }) {
28
- let { t: c } = y({ useScope: "global" }), p = i, h = m(() => p.part), I = m(() => h.value.input), L = w(m(() => `${h.value.toolCallId}-${h.value.type}-submitted`), !1), R = e({
29
- name: t().min(1).max(255).default(""),
30
- email: n().max(255).default(""),
31
- phone: t().max(50).regex(/^[+0-9\s\-.()]*$/, c("validation.invalidPhoneNumber")).optional()
32
- }), z = a, { VvForm: B, VvFormField: V, formData: H } = T(R, { lazyLoad: !0 });
33
- u(I, (e) => {
34
- H.value = {
35
- name: e?.name || "",
36
- email: e?.email || "",
37
- phone: e?.phone || ""
38
- };
39
- }, { immediate: !0 }), u(() => p.submitted, (e) => {
40
- e && (L.value = !0);
41
- }, { immediate: !0 });
42
- let U = m(() => p.submitted || L.value), W = async (e) => {
43
- z("submit", {
44
- ...e,
45
- metadata: I.value?.conversationContext
46
- });
47
- }, G = C(() => p.privacyPolicyNotice, "message.defaultPrivacyPolicyNotice");
48
- return (e, t) => {
49
- let n = x, a = S;
50
- return s(), _("div", E, [f("div", D, [v(n, {
51
- name: "ri:send-plane-2-line",
52
- class: "text-16"
53
- }), f("strong", O, o(l(c)("label.contactUs")), 1)]), v(g, { mode: "out-in" }, {
54
- default: r(() => [U.value ? (s(), _("div", M, [f("div", N, [v(n, {
55
- name: "ri:check-line",
56
- class: "text-16 text-success"
57
- }), f("div", null, [f("strong", P, o(l(c)("message.leadSubmittedTitle")), 1), f("p", F, o(l(c)("message.leadSubmittedMessage")), 1)])])])) : (s(), _("div", k, [v(l(B), {
58
- modelValue: l(H),
59
- "onUpdate:modelValue": t[0] ||= (e) => d(H) ? H.value = e : null,
60
- readonly: i.readonly,
61
- onSubmit: W
62
- }, {
63
- default: r(() => [
64
- v(l(V), {
65
- name: "name",
66
- type: "text",
67
- label: l(c)("label.name"),
68
- placeholder: l(c)("placeholder.name"),
69
- icon: "ri:user-line",
70
- modifiers: "compact",
71
- class: "mb-md"
72
- }, null, 8, ["label", "placeholder"]),
73
- v(l(V), {
74
- name: "email",
75
- type: "email",
76
- label: l(c)("label.email"),
77
- placeholder: l(c)("placeholder.email"),
78
- icon: "ri:mail-line",
79
- modifiers: "compact",
80
- class: "mb-md"
81
- }, null, 8, ["label", "placeholder"]),
82
- v(l(V), {
83
- name: "phone",
84
- type: "tel",
85
- label: l(c)("label.phone"),
86
- placeholder: l(c)("placeholder.phone"),
87
- icon: "ri:phone-line",
88
- class: "mb-md",
89
- modifiers: "compact"
90
- }, null, 8, ["label", "placeholder"]),
91
- f("div", A, [f("div", j, [v(n, {
92
- name: "ri:shield-check-line",
93
- class: "text-16 shrink-0"
94
- }), v(b, {
95
- markdown: l(G),
96
- class: "wysiwyg"
97
- }, null, 8, ["markdown"])]), v(a, {
98
- type: "submit",
99
- loading: i.loading,
100
- disabled: i.loading || i.readonly,
101
- "icon-position": "right",
102
- class: "shrink-0",
103
- label: l(c)("action.submit")
104
- }, null, 8, [
105
- "loading",
106
- "disabled",
107
- "label"
108
- ])])
109
- ]),
110
- _: 1
111
- }, 8, ["modelValue", "readonly"])]))]),
112
- _: 1
113
- })]);
114
- };
115
- }
116
- });
117
- //#endregion
118
- export { I as default };
119
-
120
- //# sourceMappingURL=PkToolShowContactForm-CfCy-b8w.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PkToolShowContactForm-CfCy-b8w.js","names":["z.object","z.string","z.email","useForm","__unplugin_components_0","__unplugin_components_1","_openBlock","_createElementBlock","_createElementVNode","_createVNode","_toDisplayString","_unref","_Transition","_withCtx","_isRef","PkStreamingMarkdown","_sfc_main","object","string","email","withCtx","defineComponent","init_shared_esm_bundler","toDisplayString","openBlock","init_runtime_core_esm_bundler","unref","watch","isRef","createBaseVNode","init_reactivity_esm_bundler","init_runtime_dom_esm_bundler","Transition","createElementBlock","createVNode","useI18n","PkStreamingMarkdown_default","Ae","VvButtonLocalized","useLocalizedString","useSafeLocalStorage","Se","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","PkToolShowContactForm_default","__emit","$t","props","__props","toolPart","computed","input","localSubmitted","LeadFormSchema","emit","newInput","submitted","isSubmitted","submitLead","data","privacyNotice","_component_VvIcon","_component_VvButton","VvForm","formData","_cache","$event","VvFormField"],"sources":["../../../../packages/components/src/chat/PkToolShowContactForm.vue","../../../../packages/components/src/chat/PkToolShowContactForm.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, watch } from 'vue'\n import { useI18n } from 'vue-i18n'\n import { useForm } from '@volverjs/form-vue'\n import * as z from 'zod'\n import { useSafeLocalStorage, useLocalizedString } from 'composables'\n import type { LocalizedString } from 'models'\n import PkStreamingMarkdown from './PkStreamingMarkdown.vue'\n\n const { t: $t } = useI18n({ useScope: 'global' })\n\n const props = defineProps<{\n part: unknown\n submitted?: boolean\n loading?: boolean\n error?: string\n readonly?: boolean\n privacyPolicyNotice?: LocalizedString\n }>()\n\n const toolPart = computed(() => {\n const part = props.part as {\n type: string\n toolCallId: string\n input?: {\n name: string\n email: string\n phone?: string\n conversationContext?: Record<string, unknown>\n }\n }\n return part\n })\n\n const input = computed(() => toolPart.value.input)\n\n const localSubmitted = useSafeLocalStorage<boolean>(\n computed(\n () =>\n `${toolPart.value.toolCallId}-${toolPart.value.type}-submitted`,\n ),\n false,\n )\n\n const LeadFormSchema = z.object({\n name: z.string().min(1).max(255).default(''),\n email: z.email().max(255).default(''),\n phone: z\n .string()\n .max(50)\n .regex(/^[+0-9\\s\\-.()]*$/, $t('validation.invalidPhoneNumber'))\n .optional(),\n })\n\n const emit = defineEmits<{\n submit: [data: Record<string, unknown>]\n }>()\n\n const { VvForm, VvFormField, formData } = useForm(LeadFormSchema, {\n lazyLoad: true,\n })\n\n // Pre-populate form with input values\n watch(\n input,\n (newInput) => {\n formData.value = {\n name: newInput?.name || '',\n email: newInput?.email || '',\n phone: newInput?.phone || '',\n }\n },\n { immediate: true },\n )\n\n watch(\n () => props.submitted,\n (submitted) => {\n if (submitted) {\n localSubmitted.value = true\n }\n },\n { immediate: true },\n )\n\n const isSubmitted = computed(() => {\n return props.submitted || localSubmitted.value\n })\n\n const submitLead = async (data: Record<string, unknown>): Promise<void> => {\n emit('submit', { ...data, metadata: input.value?.conversationContext })\n }\n\n const privacyNotice = useLocalizedString(\n () => props.privacyPolicyNotice,\n 'message.defaultPrivacyPolicyNotice',\n )\n</script>\n\n<template>\n <div\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden bg-surface\">\n <div\n class=\"px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8 min-h-40\">\n <VvIcon name=\"ri:send-plane-2-line\" class=\"text-16\" />\n <strong class=\"font-bold\">{{ $t('label.contactUs') }}</strong>\n </div>\n\n <Transition mode=\"out-in\">\n <div v-if=\"!isSubmitted\" class=\"p-sm\">\n <VvForm v-model=\"formData\" :readonly @submit=\"submitLead\">\n <VvFormField\n name=\"name\"\n type=\"text\"\n :label=\"$t('label.name')\"\n :placeholder=\"$t('placeholder.name')\"\n icon=\"ri:user-line\"\n modifiers=\"compact\"\n class=\"mb-md\" />\n <VvFormField\n name=\"email\"\n type=\"email\"\n :label=\"$t('label.email')\"\n :placeholder=\"$t('placeholder.email')\"\n icon=\"ri:mail-line\"\n modifiers=\"compact\"\n class=\"mb-md\" />\n <VvFormField\n name=\"phone\"\n type=\"tel\"\n :label=\"$t('label.phone')\"\n :placeholder=\"$t('placeholder.phone')\"\n icon=\"ri:phone-line\"\n class=\"mb-md\"\n modifiers=\"compact\" />\n\n <div class=\"flex justify-between items-center gap-16 mt-xs\">\n <div\n class=\"text-smaller text-word-3 flex items-center gap-8\">\n <VvIcon\n name=\"ri:shield-check-line\"\n class=\"text-16 shrink-0\" />\n <PkStreamingMarkdown\n :markdown=\"privacyNotice\"\n class=\"wysiwyg\" />\n </div>\n <!-- The library's default button is the brand, and in\n the chat the brand is the agent's color, as on the\n rest of the card: `primary` drew it neutral dark -->\n <VvButton\n type=\"submit\"\n :loading\n :disabled=\"loading || readonly\"\n icon-position=\"right\"\n class=\"shrink-0\"\n :label=\"$t('action.submit')\" />\n </div>\n </VvForm>\n </div>\n <div v-else class=\"p-sm\">\n <!-- One confirmation row across every tool card: a green\n check, the title in weight, the body quiet. The check is\n the outcome, so it alone carries the colour (DESIGN.md). -->\n <div class=\"flex items-center gap-sm\">\n <VvIcon name=\"ri:check-line\" class=\"text-16 text-success\" />\n <div>\n <strong class=\"font-medium block text-word-1\">\n {{ $t('message.leadSubmittedTitle') }}\n </strong>\n <p class=\"text-word-3\">\n {{ $t('message.leadSubmittedMessage') }}\n </p>\n </div>\n </div>\n </div>\n </Transition>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed, watch } from 'vue'\n import { useI18n } from 'vue-i18n'\n import { useForm } from '@volverjs/form-vue'\n import * as z from 'zod'\n import { useSafeLocalStorage, useLocalizedString } from 'composables'\n import type { LocalizedString } from 'models'\n import PkStreamingMarkdown from './PkStreamingMarkdown.vue'\n\n const { t: $t } = useI18n({ useScope: 'global' })\n\n const props = defineProps<{\n part: unknown\n submitted?: boolean\n loading?: boolean\n error?: string\n readonly?: boolean\n privacyPolicyNotice?: LocalizedString\n }>()\n\n const toolPart = computed(() => {\n const part = props.part as {\n type: string\n toolCallId: string\n input?: {\n name: string\n email: string\n phone?: string\n conversationContext?: Record<string, unknown>\n }\n }\n return part\n })\n\n const input = computed(() => toolPart.value.input)\n\n const localSubmitted = useSafeLocalStorage<boolean>(\n computed(\n () =>\n `${toolPart.value.toolCallId}-${toolPart.value.type}-submitted`,\n ),\n false,\n )\n\n const LeadFormSchema = z.object({\n name: z.string().min(1).max(255).default(''),\n email: z.email().max(255).default(''),\n phone: z\n .string()\n .max(50)\n .regex(/^[+0-9\\s\\-.()]*$/, $t('validation.invalidPhoneNumber'))\n .optional(),\n })\n\n const emit = defineEmits<{\n submit: [data: Record<string, unknown>]\n }>()\n\n const { VvForm, VvFormField, formData } = useForm(LeadFormSchema, {\n lazyLoad: true,\n })\n\n // Pre-populate form with input values\n watch(\n input,\n (newInput) => {\n formData.value = {\n name: newInput?.name || '',\n email: newInput?.email || '',\n phone: newInput?.phone || '',\n }\n },\n { immediate: true },\n )\n\n watch(\n () => props.submitted,\n (submitted) => {\n if (submitted) {\n localSubmitted.value = true\n }\n },\n { immediate: true },\n )\n\n const isSubmitted = computed(() => {\n return props.submitted || localSubmitted.value\n })\n\n const submitLead = async (data: Record<string, unknown>): Promise<void> => {\n emit('submit', { ...data, metadata: input.value?.conversationContext })\n }\n\n const privacyNotice = useLocalizedString(\n () => props.privacyPolicyNotice,\n 'message.defaultPrivacyPolicyNotice',\n )\n</script>\n\n<template>\n <div\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden bg-surface\">\n <div\n class=\"px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8 min-h-40\">\n <VvIcon name=\"ri:send-plane-2-line\" class=\"text-16\" />\n <strong class=\"font-bold\">{{ $t('label.contactUs') }}</strong>\n </div>\n\n <Transition mode=\"out-in\">\n <div v-if=\"!isSubmitted\" class=\"p-sm\">\n <VvForm v-model=\"formData\" :readonly @submit=\"submitLead\">\n <VvFormField\n name=\"name\"\n type=\"text\"\n :label=\"$t('label.name')\"\n :placeholder=\"$t('placeholder.name')\"\n icon=\"ri:user-line\"\n modifiers=\"compact\"\n class=\"mb-md\" />\n <VvFormField\n name=\"email\"\n type=\"email\"\n :label=\"$t('label.email')\"\n :placeholder=\"$t('placeholder.email')\"\n icon=\"ri:mail-line\"\n modifiers=\"compact\"\n class=\"mb-md\" />\n <VvFormField\n name=\"phone\"\n type=\"tel\"\n :label=\"$t('label.phone')\"\n :placeholder=\"$t('placeholder.phone')\"\n icon=\"ri:phone-line\"\n class=\"mb-md\"\n modifiers=\"compact\" />\n\n <div class=\"flex justify-between items-center gap-16 mt-xs\">\n <div\n class=\"text-smaller text-word-3 flex items-center gap-8\">\n <VvIcon\n name=\"ri:shield-check-line\"\n class=\"text-16 shrink-0\" />\n <PkStreamingMarkdown\n :markdown=\"privacyNotice\"\n class=\"wysiwyg\" />\n </div>\n <!-- The library's default button is the brand, and in\n the chat the brand is the agent's color, as on the\n rest of the card: `primary` drew it neutral dark -->\n <VvButton\n type=\"submit\"\n :loading\n :disabled=\"loading || readonly\"\n icon-position=\"right\"\n class=\"shrink-0\"\n :label=\"$t('action.submit')\" />\n </div>\n </VvForm>\n </div>\n <div v-else class=\"p-sm\">\n <!-- One confirmation row across every tool card: a green\n check, the title in weight, the body quiet. The check is\n the outcome, so it alone carries the colour (DESIGN.md). -->\n <div class=\"flex items-center gap-sm\">\n <VvIcon name=\"ri:check-line\" class=\"text-16 text-success\" />\n <div>\n <strong class=\"font-medium block text-word-1\">\n {{ $t('message.leadSubmittedTitle') }}\n </strong>\n <p class=\"text-word-3\">\n {{ $t('message.leadSubmittedMessage') }}\n </p>\n </div>\n </div>\n </div>\n </Transition>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EASI,IAAM,EAAE,GAAGsD,MAAOnB,EAAQ,EAAE,UAAU,SAAS,CAAC,GAE1CoB,IAAQC,GASRC,IAAWC,QACAH,EAAM,IAWtB,GAEKI,IAAQD,QAAeD,EAAS,MAAM,KAAK,GAE3CG,IAAiBpB,EACnBkB,QAEQ,GAAGD,EAAS,MAAM,WAAW,GAAGA,EAAS,MAAM,KAAK,WAC5D,GACA,EACJ,GAEMI,IAAiB7D,EAAS;GAC5B,MAAMC,EAAS,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE;GAC3C,OAAOC,EAAQ,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE;GACpC,OAAOD,EACK,CAAA,CACP,IAAI,EAAE,CAAA,CACN,MAAM,oBAAoBqD,EAAG,+BAA+B,CAAC,CAAA,CAC7D,SAAS;EAClB,CAAC,GAEKQ,IAAOT,GAIP,EAAE,WAAQ,gBA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;;;;;;IAI1BhD,GAAAA,GAAAA,CAAAA,cAAAA,UAAAA,CAAAA,CAAAA,CAAAA,EAWqB,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"src-DL9TKN-Z.js","names":["_otelBridge","SENSITIVE_KEY_RE","SERIALIZE_MAX_DEPTH","SERIALIZE_MAX_LENGTH","safeSerialize","seen","render","val","depth","item","out","key","rendered","value","text","formatParam","param","extractError","params","p","formatParams","isServerSide","isLoggingEnabled","LEVEL_WEIGHT","_consoleFloor","level","printsAt","log","error","err","info","debug","warn","withAttrs","attrs","message","logger","name","condition","table"],"sources":["../../../../packages/utils/src/logger.ts","../../../../packages/utils/src/internal-signature.ts","../../../../packages/utils/src/phoneNumber.ts"],"sourcesContent":["import type { Ref } from 'vue'\n\ntype ExceptionTracker = (\n error: Error,\n properties?: Record<string, string>,\n) => void\n\ntype OtelLoggerBridge = {\n logInfo: (msg: string, attrs?: Record<string, unknown>) => void\n logEvent: (name: string, attrs?: Record<string, unknown>) => void\n logDebug: (msg: string, attrs?: Record<string, unknown>) => void\n logWarn: (msg: string, attrs?: Record<string, unknown>) => void\n logError: (msg: string, attrs?: Record<string, unknown>) => void\n logException: (error: Error, attrs?: Record<string, unknown>) => void\n} | null\n\nlet _exceptionTracker: ExceptionTracker | undefined\n/** Runtime-set bridge to OTel LoggerProvider (set during backend init) */\nlet _otelBridge: OtelLoggerBridge = null\n\n/**\n * Registers the OTel logger bridge at runtime.\n * Called by the backend during startup; no-op in the frontend.\n */\nexport const setOtelLoggerBridge = (bridge: OtelLoggerBridge) => {\n _otelBridge = bridge\n}\n\n/**\n * Registers a callback invoked by error/warn/logError/logWarn to track exceptions\n * (e.g. OTel recordException + span status ERROR).\n */\nexport const setExceptionTracker = (tracker: ExceptionTracker) => {\n _exceptionTracker = tracker\n}\n\n/**\n * Keys whose values must never land in a log line. The OTel sink additionally\n * masks value patterns (see packages/telemetry/src/sanitization.ts), which\n * utils cannot import: the bridge exists precisely to avoid that dependency.\n */\nconst SENSITIVE_KEY_RE =\n /pass(word)?|secret|token|api[-_]?key|authorization|cookie|credential/i\nconst SERIALIZE_MAX_DEPTH = 3\nconst SERIALIZE_MAX_LENGTH = 2_000\n\n/**\n * Serializes a non-Error object for a log line. `String(param)` produced\n * `[object Object]`, which made whole error families undiagnosable. A naked\n * JSON.stringify is not the fix either: it throws on circular references and\n * BigInt, has no depth or length cap, and would promote sensitive fields\n * into the message. This handles all four.\n */\nconst safeSerialize = (value: unknown): string => {\n const seen = new WeakSet<object>()\n const render = (val: unknown, depth: number): unknown => {\n if (val instanceof Error) {\n return val.stack ?? val.message\n }\n if (typeof val === 'bigint') {\n return `${val.toString()}n`\n }\n if (typeof val === 'function' || typeof val === 'symbol') {\n return String(val)\n }\n if (typeof val !== 'object' || val === null) {\n return val\n }\n if (seen.has(val)) {\n return '[Circular]'\n }\n if (depth >= SERIALIZE_MAX_DEPTH) {\n return Array.isArray(val) ? '[Array]' : '[Object]'\n }\n // Added on the way down, removed on the way back up: only a true\n // cycle is flagged, a shared reference (the same object under two\n // keys) is rendered normally.\n seen.add(val)\n try {\n if (Array.isArray(val)) {\n return val.map((item) => render(item, depth + 1))\n }\n const out: Record<string, unknown> = {}\n for (const [key, item] of Object.entries(val)) {\n out[key] = SENSITIVE_KEY_RE.test(key)\n ? '[REDACTED]'\n : render(item, depth + 1)\n }\n return out\n } finally {\n seen.delete(val)\n }\n }\n try {\n const rendered = render(value, 0)\n const text =\n typeof rendered === 'string' ? rendered : JSON.stringify(rendered)\n if (typeof text !== 'string') {\n return String(text)\n }\n return text.length > SERIALIZE_MAX_LENGTH\n ? `${text.slice(0, SERIALIZE_MAX_LENGTH)}… [truncated]`\n : text\n } catch {\n return '[Unserializable]'\n }\n}\n\nconst formatParam = (param: unknown): string => {\n if (param instanceof Error) {\n return param.stack ?? param.message\n }\n if (typeof param === 'object' && param !== null) {\n return safeSerialize(param)\n }\n return String(param)\n}\n\nconst extractError = (params: unknown[]): Error => {\n const found = params.find((p): p is Error => p instanceof Error)\n if (found) {\n return found\n }\n return new Error(params.map(formatParam).join(' '))\n}\n\nconst formatParams = (params: unknown[]): string => {\n return params.map(formatParam).join(' ')\n}\n\nconst isServerSide = typeof window === 'undefined'\n// `import.meta.env` only exists in Vite builds: the cast keeps this file\n// compilable under plain Node tsconfigs (e.g. apps/azure-functions)\nconst isLocal = isServerSide\n ? process?.env?.VITE_LOCAL === 'true'\n : (import.meta as { env?: Record<string, unknown> }).env?.VITE_LOCAL ===\n 'true'\n\nconst isLoggingEnabled = isLocal || isServerSide\n\n/**\n * Console severity floor, read from `LOG_LEVEL`.\n *\n * The OTel bridge below has always honoured that variable, which is why\n * production exports no INFO rows. The console writers did not, and\n * `isLoggingEnabled` is unconditionally true on a server, so every info line\n * still reached stdout in every environment: the two sinks disagreed, and the\n * container log pipeline kept billing for rows nobody could query. Measured on\n * 2026-09-02: one knowledge-base search wrote three of them, one carrying 500\n * characters of dense-vector JSON, three times per turn.\n *\n * The default is `info`, so an environment that sets nothing keeps exactly the\n * output it has today. Note that an `error` is still tracked and exported when\n * the floor hides it from the console: only the console write is gated.\n */\nconst LEVEL_WEIGHT: Record<string, number> = {\n debug: 10,\n info: 20,\n warn: 30,\n error: 40,\n fatal: 50,\n}\nconst readLevel = (level: string | undefined): number =>\n LEVEL_WEIGHT[(level ?? '').toLowerCase()] ?? LEVEL_WEIGHT.info\n\nlet _consoleFloor = isServerSide\n ? readLevel(process?.env?.LOG_LEVEL)\n : LEVEL_WEIGHT.info\n\n/**\n * Overrides the console floor for a level chosen at runtime rather than by\n * env, mirroring `setLogLevel` on the OTel side. The backend calls both from\n * one place so the two sinks cannot drift (`apps/backend/src/main.ts`).\n */\nexport const setConsoleLogLevel = (level: string): void => {\n _consoleFloor = readLevel(level)\n}\n\n/** Whether a message of this severity should reach the console. */\nconst printsAt = (level: 'debug' | 'info' | 'warn' | 'error'): boolean =>\n isLoggingEnabled && LEVEL_WEIGHT[level] >= _consoleFloor\n\nexport const log = (...params: unknown[]) => {\n if (printsAt('info')) {\n // eslint-disable-next-line no-console\n console.log(...params)\n }\n _otelBridge?.logInfo(formatParams(params))\n}\n\nexport const error = (...params: unknown[]) => {\n const err = extractError(params)\n _exceptionTracker?.(err)\n _otelBridge?.logException(err)\n if (printsAt('error')) {\n // eslint-disable-next-line no-console\n console.error(formatParams(params))\n }\n}\n\nexport const info = (...params: unknown[]) => {\n if (printsAt('info')) {\n // eslint-disable-next-line no-console\n console.info(...params)\n }\n _otelBridge?.logInfo(formatParams(params))\n}\n\nexport const debug = (...params: unknown[]) => {\n if (printsAt('debug')) {\n // eslint-disable-next-line no-console\n console.debug(...params)\n }\n _otelBridge?.logDebug(formatParams(params))\n}\n\nexport const warn = (...params: unknown[]) => {\n // A warning is not an exception: it must never reach `app_errors`, so\n // the OTel bridge gets only logWarn. The exception tracker stays: it is\n // wired in the frontend only (Application Insights trackException).\n const err = extractError(params)\n _exceptionTracker?.(err)\n // Serialize once for both sinks: the walk is depth-capped but not free.\n const text = formatParams(params)\n _otelBridge?.logWarn(text)\n if (printsAt('warn')) {\n // eslint-disable-next-line no-console\n console.warn(text)\n }\n}\n\n/**\n * The console rendering of a fixed message plus attributes: ONE line, with the\n * attributes as JSON after the message. `console.warn(message, attrs)` lets\n * Node's inspector break a wide object across several lines, and a container\n * log pipeline stores each line as its own row, so the query that reads the\n * attributes back finds the first row and a fragment. `formatParams` also\n * redacts the sensitive keys and survives a circular reference.\n */\nconst withAttrs = (message: string, attrs?: Record<string, unknown>): string =>\n attrs ? formatParams([message, attrs]) : message\n\n/**\n * WARN with a fixed message and structured attributes. Prefer this over\n * interpolating values into the message: a fixed message keeps the log\n * stream groupable (and therefore alertable), the values stay queryable\n * as attributes.\n */\nexport const warnAttrs = (message: string, attrs?: Record<string, unknown>) => {\n _otelBridge?.logWarn(message, attrs)\n if (printsAt('warn')) {\n // eslint-disable-next-line no-console\n console.warn(withAttrs(message, attrs))\n }\n}\n\n/**\n * A measurement event: one fixed name, the ids as attributes, and **neither\n * sink drops it**, whatever `LOG_LEVEL` says.\n *\n * The info twin of {@link warnAttrs} used to be an ordinary INFO line, and that\n * was wrong in the one environment it exists for: production runs at\n * `LOG_LEVEL=warn`, so the console floor and the OTel floor would each have\n * dropped it and the measurement it feeds would have read zero rows and been\n * believed. WARN is not the answer either, because these events fire on the\n * majority of turns and a normal event at WARN degrades the level alerting\n * watches. So this is a channel, not a level: severity stays INFO and the floor\n * does not apply.\n *\n * The price is that nothing else may use it. Keep the callers few\n * (`closure_gate.refused`, `closure_recovery.applied`) and the volume of the\n * order of one row per turn, and never pass a message with the values\n * interpolated into it: a fixed name is what makes the rows groupable by agent\n * instead of countable by regex.\n */\nexport const logEvent = (name: string, attrs?: Record<string, unknown>) => {\n _otelBridge?.logEvent(name, attrs)\n if (isLoggingEnabled) {\n // eslint-disable-next-line no-console\n console.log(withAttrs(name, attrs))\n }\n}\n\nexport const assert = (condition: boolean | undefined, message: string) => {\n if (isLoggingEnabled) {\n // eslint-disable-next-line no-console\n console.assert(condition, message)\n }\n}\n\nexport const clear = () => {\n if (isLoggingEnabled) {\n // eslint-disable-next-line no-console\n console.clear()\n }\n}\n\n/**\n * A table is an info line that happens to be wide, so it answers to the floor\n * like one. It used to check only `isLoggingEnabled`, which left the usage\n * table of every turn on the console of an environment set to `warn`, and made\n * it the last write of a turn in the test run: vitest reports a console write\n * that outlives its test as `Closing rpc while \"onUserConsoleLog\" was pending`\n * and fails a run whose tests all passed.\n */\nexport const table = (table: unknown) => {\n if (printsAt('info')) {\n // eslint-disable-next-line no-console\n console.table(table)\n }\n}\n\nexport const group = (name: string) => {\n if (isLoggingEnabled) {\n // eslint-disable-next-line no-console\n console.group(name)\n }\n}\n\nexport const groupEnd = () => {\n if (isLoggingEnabled) {\n // eslint-disable-next-line no-console\n console.groupEnd()\n }\n}\n\nexport const time = (name: string) => {\n if (isLoggingEnabled) {\n // eslint-disable-next-line no-console\n console.time(name)\n }\n}\n\nexport const timeEnd = (name: string) => {\n if (isLoggingEnabled) {\n // eslint-disable-next-line no-console\n console.timeEnd(name)\n }\n}\n\nexport const timeLog = (name: string, ...params: unknown[]) => {\n if (isLoggingEnabled) {\n // eslint-disable-next-line no-console\n console.timeLog(name, ...params)\n }\n}\n\nexport const logger = {\n log,\n error,\n info,\n debug,\n warn,\n warnAttrs,\n logEvent,\n assert,\n clear,\n table,\n group,\n groupEnd,\n time,\n timeEnd,\n timeLog,\n}\n\nexport const useErrorsLogger = (errors: Ref<Error | null | undefined>[]) => {\n // Vue is an optional runtime dependency for the backend build.\n // Lazily import it only when running in a browser/Vue environment.\n if (typeof window === 'undefined') {\n return\n }\n\n void import('vue').then(({ watch }) => {\n errors.forEach((error) => {\n watch(error, (value) => {\n logger.error(value)\n })\n })\n })\n}\n","/**\n * Signature of the calls the function app makes to the backend's internal\n * routes (spec agent-wakeup, \"Timer: coda, function, endpoint interno\"). Both\n * ends share `INTERNAL_API_SECRET`; the signed payload binds the method, the\n * path, the body and a timestamp, so a captured request cannot be replayed on\n * another route nor after the tolerance window.\n *\n * WebCrypto, not `node:crypto`: this package is imported by the browser too.\n */\nexport const INTERNAL_SIGNATURE_HEADER = 'x-internal-signature'\nexport const INTERNAL_TIMESTAMP_HEADER = 'x-internal-timestamp'\nexport const INTERNAL_SIGNATURE_TOLERANCE_MS = 5 * 60_000\n\ninterface InternalRequest {\n secret: string\n method: string\n /** The path as the server routes it, without host or querystring. */\n path: string\n body: string\n}\n\nconst encoder = new TextEncoder()\n\nconst hmacSha256Hex = async (secret: string, payload: string) => {\n const key = await globalThis.crypto.subtle.importKey(\n 'raw',\n encoder.encode(secret),\n { name: 'HMAC', hash: 'SHA-256' },\n false,\n ['sign'],\n )\n const signature = await globalThis.crypto.subtle.sign(\n 'HMAC',\n key,\n encoder.encode(payload),\n )\n return Array.from(new Uint8Array(signature), (byte) =>\n byte.toString(16).padStart(2, '0'),\n ).join('')\n}\n\nconst signedPayload = (\n { method, path, body }: InternalRequest,\n timestamp: string,\n) => `${timestamp}.${method.toUpperCase()}.${path}.${body}`\n\n/** Constant-time comparison of two hex strings. */\nconst sameHex = (a: string, b: string) => {\n if (a.length !== b.length) {\n return false\n }\n let difference = 0\n for (let index = 0; index < a.length; index++) {\n difference |= a.charCodeAt(index) ^ b.charCodeAt(index)\n }\n return difference === 0\n}\n\n/** The two headers that sign an internal request. */\nexport async function signInternalRequest(\n request: InternalRequest,\n now = Date.now(),\n): Promise<Record<string, string>> {\n const timestamp = String(now)\n return {\n [INTERNAL_TIMESTAMP_HEADER]: timestamp,\n [INTERNAL_SIGNATURE_HEADER]: await hmacSha256Hex(\n request.secret,\n signedPayload(request, timestamp),\n ),\n }\n}\n\n/**\n * Whether the headers sign this request with this secret, within the\n * tolerance window.\n */\nexport async function verifyInternalRequest(\n request: InternalRequest & {\n signature: string | undefined\n timestamp: string | undefined\n },\n now = Date.now(),\n): Promise<boolean> {\n const { signature, timestamp } = request\n if (!signature || !timestamp || !/^\\d+$/.test(timestamp)) {\n return false\n }\n if (Math.abs(now - Number(timestamp)) > INTERNAL_SIGNATURE_TOLERANCE_MS) {\n return false\n }\n const expected = await hmacSha256Hex(\n request.secret,\n signedPayload(request, timestamp),\n )\n return sameHex(expected, signature.toLowerCase())\n}\n","// E.164 country codes are prefix-free: one digit for these two, two digits\n// for the next set, three for every other one. Reading \"the first one to four\n// digits\" took four, so +44 1234 567890 came out as +4412.\nconst ONE_DIGIT_COUNTRY_CODES = new Set(['1', '7'])\nconst TWO_DIGIT_COUNTRY_CODES = new Set(\n (\n '20 27 30 31 32 33 34 36 39 40 41 43 44 45 46 47 48 49 51 52 53 54 55 ' +\n '56 57 58 60 61 62 63 64 65 66 81 82 84 86 90 91 92 93 94 95 98'\n ).split(' '),\n)\n\n/** Splits international digits into country code and national number. */\nfunction splitCountryCode(digits: string): [string, string] | undefined {\n const length = ONE_DIGIT_COUNTRY_CODES.has(digits.slice(0, 1))\n ? 1\n : TWO_DIGIT_COUNTRY_CODES.has(digits.slice(0, 2))\n ? 2\n : 3\n return digits.length > length\n ? [digits.slice(0, length), digits.slice(length)]\n : undefined\n}\n\n/**\n * Formats a phone number with international prefix, its groups separated by\n * spaces as a person writes them\n * If no international prefix is provided, defaults to Italian (+39)\n *\n * @param phone - The phone number to format\n * @param defaultPrefix - The default international prefix (default: '+39')\n * @returns Formatted phone number (e.g., '+39 392 4096227')\n *\n * @example\n * formatPhoneNumber('3924096227') // '+39 392 4096227'\n * formatPhoneNumber('+393924096227') // '+39 392 4096227'\n * formatPhoneNumber('00393924096227') // '+39 392 4096227'\n * formatPhoneNumber('393924096227') // '+39 392 4096227'\n * formatPhoneNumber('0450000101') // '+39 045 0000101'\n */\nexport function formatPhoneNumber(\n phone: string | null | undefined,\n defaultPrefix = '+39',\n): string {\n if (!phone) {\n return ''\n }\n\n // Remove all non-digit characters except + at the beginning\n const cleaned = phone.trim().replace(/[^\\d+]/g, '')\n\n if (!cleaned) {\n return ''\n }\n\n // Normalize the phone number to have international prefix\n let nationalNumber = ''\n let countryCode = defaultPrefix.replace('+', '')\n\n // Handle different input formats\n if (cleaned.startsWith('+')) {\n // Already has + prefix: +393924096227\n const match = cleaned.match(/^\\+(\\d+)$/)\n if (match) {\n const digits = match[1]\n // Extract country code and national number\n if (digits.startsWith(countryCode)) {\n nationalNumber = digits.substring(countryCode.length)\n } else {\n const split = splitCountryCode(digits)\n if (split) {\n ;[countryCode, nationalNumber] = split\n }\n }\n }\n } else if (cleaned.startsWith('00')) {\n // International format without +: 00393924096227\n const digits = cleaned.substring(2)\n if (digits.startsWith(countryCode)) {\n nationalNumber = digits.substring(countryCode.length)\n } else {\n const split = splitCountryCode(digits)\n if (split) {\n ;[countryCode, nationalNumber] = split\n }\n }\n } else if (\n cleaned.startsWith(countryCode) &&\n cleaned.length > countryCode.length + 8\n ) {\n // Starts with country code but no +: 393924096227\n nationalNumber = cleaned.substring(countryCode.length)\n } else {\n // Local number: 3924096227 or 0450000101\n nationalNumber = cleaned\n // The national trunk 0 is not dialled after the country code, except\n // in Italy, where it belongs to the landline number (045 is Verona):\n // dropping it turned 045 0000101 into another number\n if (\n countryCode !== '39' &&\n nationalNumber.startsWith('0') &&\n nationalNumber.length > 1\n ) {\n nationalNumber = nationalNumber.substring(1)\n }\n }\n\n if (!nationalNumber) {\n return phone\n }\n\n const prefix = `+${countryCode}`\n\n // Italian mobile numbers: 3XX XXXXXXX (10 digits total, starting with 3)\n if (\n countryCode === '39' &&\n nationalNumber.length === 10 &&\n nationalNumber.startsWith('3')\n ) {\n return `${prefix} ${nationalNumber.substring(0, 3)} ${nationalNumber.substring(3)}`\n }\n\n // Italian landline numbers: 0XX XXXXXXX (9-11 digits, starting with 0)\n if (\n countryCode === '39' &&\n nationalNumber.length >= 9 &&\n nationalNumber.length <= 11 &&\n nationalNumber.startsWith('0')\n ) {\n const areaCode = nationalNumber.substring(0, 3)\n const rest = nationalNumber.substring(3)\n return `${prefix} ${areaCode} ${rest}`\n }\n\n // Generic formatting: group by 3-4 digits\n const parts: string[] = []\n let remaining = nationalNumber\n\n while (remaining.length > 0) {\n if (remaining.length <= 4) {\n parts.push(remaining)\n break\n }\n parts.push(remaining.substring(0, 3))\n remaining = remaining.substring(3)\n }\n\n return `${prefix} ${parts.join(' ')}`\n}\n\n/**\n * Returns a formatted phone number or a dash if empty\n * Useful for displaying in tables\n *\n * @param phone - The phone number to format\n * @param defaultPrefix - The default international prefix (default: '+39')\n * @returns Formatted phone number or '-'\n */\nexport function formatPhoneNumberOrDash(\n phone: string | null | undefined,\n defaultPrefix = '+39',\n): string {\n const formatted = formatPhoneNumber(phone, defaultPrefix)\n return formatted || '-'\n}\n"],"mappings":";;AAgBA,IAEIA,IAAgC,MAuB9BC,IACF,yEACEC,IAAsB,GACtBC,IAAuB,KASvBC,KAAiB,MAA2B;CAC9C,IAAMC,oBAAO,IAAI,QAAgB,GAC3BC,KAAU,GAAc,MAA2B;EACrD,IAAIC,aAAe,OACf,OAAOA,EAAI,SAASA,EAAI;EAE5B,IAAI,OAAOA,KAAQ,UACf,OAA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