@8wave/ai-elements 0.74.0 → 0.77.0

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 (159) hide show
  1. package/dist/_chunks/{PkStreamingMarkdown-orhL2kzD.js → PkStreamingMarkdown-COZApJzT.js} +22 -22
  2. package/dist/_chunks/PkStreamingMarkdown-COZApJzT.js.map +1 -0
  3. package/dist/_chunks/{PkToolShowArtifact-c_vCWUpQ.js → PkToolShowArtifact-BZQixk9z.js} +7 -7
  4. package/dist/_chunks/{PkToolShowArtifact-c_vCWUpQ.js.map → PkToolShowArtifact-BZQixk9z.js.map} +1 -1
  5. package/dist/_chunks/{PkToolShowCalendarEvent-D2VHu1V3.js → PkToolShowCalendarEvent-BEqn5iEb.js} +12 -12
  6. package/dist/_chunks/{PkToolShowCalendarEvent-D2VHu1V3.js.map → PkToolShowCalendarEvent-BEqn5iEb.js.map} +1 -1
  7. package/dist/_chunks/{PkToolShowComparison-C2ZUH0w4.js → PkToolShowComparison-p34r0Hhd.js} +7 -7
  8. package/dist/_chunks/{PkToolShowComparison-C2ZUH0w4.js.map → PkToolShowComparison-p34r0Hhd.js.map} +1 -1
  9. package/dist/_chunks/PkToolShowContactForm-thS7c8iL.js +1658 -0
  10. package/dist/_chunks/PkToolShowContactForm-thS7c8iL.js.map +1 -0
  11. package/dist/_chunks/{PkToolShowEmail-BuyCHUU5.js → PkToolShowEmail-Be8FvWjw.js} +11 -11
  12. package/dist/_chunks/{PkToolShowEmail-BuyCHUU5.js.map → PkToolShowEmail-Be8FvWjw.js.map} +1 -1
  13. package/dist/_chunks/{PkToolShowImageGallery-ByldZ0nj.js → PkToolShowImageGallery-DmJztS-Z.js} +5 -5
  14. package/dist/_chunks/{PkToolShowImageGallery-ByldZ0nj.js.map → PkToolShowImageGallery-DmJztS-Z.js.map} +1 -1
  15. package/dist/_chunks/{PkToolShowLocation-BCFnC5c7.js → PkToolShowLocation-DOoLCHzS.js} +9 -9
  16. package/dist/_chunks/{PkToolShowLocation-BCFnC5c7.js.map → PkToolShowLocation-DOoLCHzS.js.map} +1 -1
  17. package/dist/_chunks/{PkToolShowMessage-6Bsfi3BC.js → PkToolShowMessage-DgeULbdQ.js} +10 -10
  18. package/dist/_chunks/{PkToolShowMessage-6Bsfi3BC.js.map → PkToolShowMessage-DgeULbdQ.js.map} +1 -1
  19. package/dist/_chunks/{PkToolShowMultipleChoice-BLNTD2lK.js → PkToolShowMultipleChoice-CpGyn_bZ.js} +3 -3
  20. package/dist/_chunks/{PkToolShowMultipleChoice-BLNTD2lK.js.map → PkToolShowMultipleChoice-CpGyn_bZ.js.map} +1 -1
  21. package/dist/_chunks/{PkToolShowProductList-B4S5_m-f.js → PkToolShowProductList-DEo7XogW.js} +4 -4
  22. package/dist/_chunks/{PkToolShowProductList-B4S5_m-f.js.map → PkToolShowProductList-DEo7XogW.js.map} +1 -1
  23. package/dist/_chunks/{PkToolShowQrCode-BVZlzYDq.js → PkToolShowQrCode-UE4uSyvJ.js} +7 -7
  24. package/dist/_chunks/{PkToolShowQrCode-BVZlzYDq.js.map → PkToolShowQrCode-UE4uSyvJ.js.map} +1 -1
  25. package/dist/_chunks/{PkToolShowSources-BQo5DRwt.js → PkToolShowSources-BMXftK6O.js} +10 -9
  26. package/dist/_chunks/PkToolShowSources-BMXftK6O.js.map +1 -0
  27. package/dist/_chunks/{PkToolShowSuggestedReply-BxDI6yp_.js → PkToolShowSuggestedReply-CPAnHI0c.js} +3 -3
  28. package/dist/_chunks/{PkToolShowSuggestedReply-BxDI6yp_.js.map → PkToolShowSuggestedReply-CPAnHI0c.js.map} +1 -1
  29. package/dist/_chunks/{PkToolShowWeather-DR6egBIP.js → PkToolShowWeather-DcSUbzx0.js} +4 -4
  30. package/dist/_chunks/{PkToolShowWeather-DR6egBIP.js.map → PkToolShowWeather-DcSUbzx0.js.map} +1 -1
  31. package/dist/_chunks/{PkToolShowWebPages-D8RngE-F.js → PkToolShowWebPages-aH_GarEV.js} +5 -5
  32. package/dist/_chunks/{PkToolShowWebPages-D8RngE-F.js.map → PkToolShowWebPages-aH_GarEV.js.map} +1 -1
  33. package/dist/_chunks/{PkUrl-CI17WkYu.js → PkUrl-BHD0_pal.js} +2 -2
  34. package/dist/_chunks/{PkUrl-CI17WkYu.js.map → PkUrl-BHD0_pal.js.map} +1 -1
  35. package/dist/_chunks/{VvCheckbox.es-kmMsWlkU.js → VvCheckbox.es-ohF87NOe.js} +3 -3
  36. package/dist/_chunks/{VvCheckbox.es-kmMsWlkU.js.map → VvCheckbox.es-ohF87NOe.js.map} +1 -1
  37. package/dist/_chunks/{VvCheckboxGroup.es-BRRmuO9h.js → VvCheckboxGroup.es-DZCbyLN0.js} +109 -109
  38. package/dist/_chunks/{VvCheckboxGroup.es-BRRmuO9h.js.map → VvCheckboxGroup.es-DZCbyLN0.js.map} +1 -1
  39. package/dist/_chunks/{VvCombobox.es-pTM53Z4B.js → VvCombobox.es-YLPD7MpO.js} +256 -256
  40. package/dist/_chunks/{VvCombobox.es-pTM53Z4B.js.map → VvCombobox.es-YLPD7MpO.js.map} +1 -1
  41. package/dist/_chunks/{VvInputText.es-DO39OSWk.js → VvInputText.es-DAnAXfBO.js} +190 -190
  42. package/dist/_chunks/{VvInputText.es-DO39OSWk.js.map → VvInputText.es-DAnAXfBO.js.map} +1 -1
  43. package/dist/_chunks/{VvRadio.es-BpQAJbon.js → VvRadio.es-Do9oyNtV.js} +3 -3
  44. package/dist/_chunks/{VvRadio.es-BpQAJbon.js.map → VvRadio.es-Do9oyNtV.js.map} +1 -1
  45. package/dist/_chunks/{VvRadioGroup.es-BSBrmx9w.js → VvRadioGroup.es-BHcqcJFC.js} +11 -11
  46. package/dist/_chunks/{VvRadioGroup.es-BSBrmx9w.js.map → VvRadioGroup.es-BHcqcJFC.js.map} +1 -1
  47. package/dist/_chunks/{VvSelect.es-DALpUK5j.js → VvSelect.es-CP_y02fy.js} +8 -8
  48. package/dist/_chunks/{VvSelect.es-DALpUK5j.js.map → VvSelect.es-CP_y02fy.js.map} +1 -1
  49. package/dist/_chunks/{VvTextarea.es-C9dwYLOG.js → VvTextarea.es-DetA_2DM.js} +250 -250
  50. package/dist/_chunks/{VvTextarea.es-C9dwYLOG.js.map → VvTextarea.es-DetA_2DM.js.map} +1 -1
  51. package/dist/_chunks/{dist-DtF6poRc.js → dist-yqV26MWM.js} +132 -120
  52. package/dist/_chunks/dist-yqV26MWM.js.map +1 -0
  53. package/dist/_chunks/{esm-0nyRYwmP.js → esm-DLxNpT06.js} +7 -7
  54. package/dist/_chunks/{esm-0nyRYwmP.js.map → esm-DLxNpT06.js.map} +1 -1
  55. package/dist/_chunks/{floating-ui.vue-B5ZV-j8C.js → floating-ui.vue-tVPpNXUc.js} +3 -3
  56. package/dist/_chunks/{floating-ui.vue-B5ZV-j8C.js.map → floating-ui.vue-tVPpNXUc.js.map} +1 -1
  57. package/dist/_chunks/{iconify-C1EOwL90.js → iconify-y0w2FIJH.js} +3 -3
  58. package/dist/_chunks/{iconify-C1EOwL90.js.map → iconify-y0w2FIJH.js.map} +1 -1
  59. package/dist/_chunks/{index.es-BGFmj59S.js → index.es-7fUi-rc0.js} +452 -452
  60. package/dist/_chunks/{index.es-BGFmj59S.js.map → index.es-7fUi-rc0.js.map} +1 -1
  61. package/dist/_chunks/{schemas-Bp3a8tYV.js → schemas-aPiXCaCc.js} +1309 -945
  62. package/dist/_chunks/schemas-aPiXCaCc.js.map +1 -0
  63. package/dist/_chunks/{src-C_wl-KYN.js → src-BfoQF6Z3.js} +2 -2
  64. package/dist/_chunks/{src-C_wl-KYN.js.map → src-BfoQF6Z3.js.map} +1 -1
  65. package/dist/_chunks/{useLightbox-CH1KeVqr.js → useLightbox-DL_oVBep.js} +3 -3
  66. package/dist/_chunks/{useLightbox-CH1KeVqr.js.map → useLightbox-DL_oVBep.js.map} +1 -1
  67. package/dist/_chunks/{vue-i18n-KvYvoek4.js → vue-i18n-DAH6nDTN.js} +3 -3
  68. package/dist/_chunks/{vue-i18n-KvYvoek4.js.map → vue-i18n-DAH6nDTN.js.map} +1 -1
  69. package/dist/_chunks/{vue.runtime.esm-bundler-BmggS4HU.js → vue.runtime.esm-bundler-Dq29dQrz.js} +16 -10
  70. package/dist/_chunks/vue.runtime.esm-bundler-Dq29dQrz.js.map +1 -0
  71. package/dist/ai-elements.es.js +4637 -3428
  72. package/dist/ai-elements.es.js.map +1 -1
  73. package/dist-vue/PkChatbot.js +1 -1
  74. package/dist-vue/PkChatbotFeedbackForm.js +1 -1
  75. package/dist-vue/PkChatbotInput.js +1 -1
  76. package/dist-vue/PkChatbotMessages.js +1 -1
  77. package/dist-vue/PkChatbotViewChat.js +1 -1
  78. package/dist-vue/PkChatbotViewConversations.js +1 -1
  79. package/dist-vue/PkChatbotViewProfile.js +1 -1
  80. package/dist-vue/_chunks/{Media-Bic_vfSX.js → Media-kK7BnZGr.js} +4 -4
  81. package/dist-vue/_chunks/Media-kK7BnZGr.js.map +1 -0
  82. package/dist-vue/_chunks/{PkChatbot-woRkjgP5.js → PkChatbot-B9RSkQmJ.js} +7 -7
  83. package/dist-vue/_chunks/{PkChatbot-woRkjgP5.js.map → PkChatbot-B9RSkQmJ.js.map} +1 -1
  84. package/dist-vue/_chunks/{PkChatbotFeedbackForm-D-lx1URv.js → PkChatbotFeedbackForm-lj9CHdhn.js} +3 -3
  85. package/dist-vue/_chunks/{PkChatbotFeedbackForm-D-lx1URv.js.map → PkChatbotFeedbackForm-lj9CHdhn.js.map} +1 -1
  86. package/dist-vue/_chunks/{PkChatbotInput-LHE0HZ9z.js → PkChatbotInput-C5QSmt21.js} +2 -2
  87. package/dist-vue/_chunks/{PkChatbotInput-LHE0HZ9z.js.map → PkChatbotInput-C5QSmt21.js.map} +1 -1
  88. package/dist-vue/_chunks/{PkChatbotMessages-BxTeEm3j.js → PkChatbotMessages-DOeUT6YL.js} +7 -7
  89. package/dist-vue/_chunks/PkChatbotMessages-DOeUT6YL.js.map +1 -0
  90. package/dist-vue/_chunks/{PkChatbotViewChat-BoEfZeco.js → PkChatbotViewChat-C2FuDayB.js} +6 -6
  91. package/dist-vue/_chunks/{PkChatbotViewChat-BoEfZeco.js.map → PkChatbotViewChat-C2FuDayB.js.map} +1 -1
  92. package/dist-vue/_chunks/{PkChatbotViewConversations-DvVc1arX.js → PkChatbotViewConversations-2xc0o-fO.js} +2 -2
  93. package/dist-vue/_chunks/{PkChatbotViewConversations-DvVc1arX.js.map → PkChatbotViewConversations-2xc0o-fO.js.map} +1 -1
  94. package/dist-vue/_chunks/{PkChatbotViewProfile-Dev_6pki.js → PkChatbotViewProfile-CoT1JnMk.js} +2 -2
  95. package/dist-vue/_chunks/{PkChatbotViewProfile-Dev_6pki.js.map → PkChatbotViewProfile-CoT1JnMk.js.map} +1 -1
  96. package/dist-vue/_chunks/{PkStreamingMarkdown-B4gnJ4hk.js → PkStreamingMarkdown-BAhC3uGK.js} +20 -20
  97. package/dist-vue/_chunks/PkStreamingMarkdown-BAhC3uGK.js.map +1 -0
  98. package/dist-vue/_chunks/{PkToolShowArtifact-EvbUZSOf.js → PkToolShowArtifact-RzrDPcEQ.js} +2 -2
  99. package/dist-vue/_chunks/{PkToolShowArtifact-EvbUZSOf.js.map → PkToolShowArtifact-RzrDPcEQ.js.map} +1 -1
  100. package/dist-vue/_chunks/{PkToolShowContactForm-CsDOqSJK.js → PkToolShowContactForm-5H4jfq1F.js} +4 -4
  101. package/dist-vue/_chunks/{PkToolShowContactForm-CsDOqSJK.js.map → PkToolShowContactForm-5H4jfq1F.js.map} +1 -1
  102. package/dist-vue/_chunks/{PkToolShowSources-ZtXFkIHt.js → PkToolShowSources-Dv0uuvqS.js} +5 -4
  103. package/dist-vue/_chunks/PkToolShowSources-Dv0uuvqS.js.map +1 -0
  104. package/dist-vue/_chunks/{ZodError-Ca0wCsGp.js → ZodError-C_est8SY.js} +2 -2
  105. package/dist-vue/_chunks/{ZodError-Ca0wCsGp.js.map → ZodError-C_est8SY.js.map} +1 -1
  106. package/dist-vue/_chunks/{createChatbotApiClient-YJegM3ni.js → createChatbotApiClient-CvDRMmDa.js} +3 -3
  107. package/dist-vue/_chunks/createChatbotApiClient-CvDRMmDa.js.map +1 -0
  108. package/dist-vue/_chunks/{index.es-CrPSzhoZ.js → index.es-Dk_HaA08.js} +4 -4
  109. package/dist-vue/_chunks/{index.es-CrPSzhoZ.js.map → index.es-Dk_HaA08.js.map} +1 -1
  110. package/dist-vue/_chunks/{schemas-sa2dDEGb.js → schemas-Clx4oKCB.js} +1309 -945
  111. package/dist-vue/_chunks/schemas-Clx4oKCB.js.map +1 -0
  112. package/dist-vue/_chunks/{useChatbotStore-DGL81KJa.js → useChatbotStore-DMDbzuub.js} +1061 -1000
  113. package/dist-vue/_chunks/useChatbotStore-DMDbzuub.js.map +1 -0
  114. package/dist-vue/api.js +1 -1
  115. package/dist-vue/apps/web-component/src/composables/useChatbotAgent.d.ts +6 -6
  116. package/dist-vue/apps/web-component/src/composables/useChatbotAuth.d.ts +8 -8
  117. package/dist-vue/apps/web-component/src/lib.d.ts +29 -0
  118. package/dist-vue/apps/web-component/src/main.d.ts +0 -0
  119. package/dist-vue/apps/web-component/src/modules/applicationInsights.d.ts +38 -0
  120. package/dist-vue/composables.js +2 -2
  121. package/dist-vue/index.js +2852 -2876
  122. package/dist-vue/index.js.map +1 -1
  123. package/dist-vue/packages/auth/src/add-member-to-organization.d.ts +5 -0
  124. package/dist-vue/packages/auth/src/anonymous-reauth-plugin.d.ts +11 -0
  125. package/dist-vue/packages/auth/src/external-auth-plugin.d.ts +2 -0
  126. package/dist-vue/packages/auth/src/index.d.ts +3477 -8
  127. package/dist-vue/packages/auth/src/media-helpers.d.ts +13 -0
  128. package/dist-vue/packages/auth/src/organization-auto-join.d.ts +1 -0
  129. package/dist-vue/packages/components/src/PkEditorMarkdown.d.ts +1 -1
  130. package/dist-vue/packages/components/src/PkEditorRepeater.d.ts +2 -2
  131. package/dist-vue/packages/components/src/PkEditorWyswyg.d.ts +1 -1
  132. package/dist-vue/packages/components/src/PkFieldset.d.ts +3 -3
  133. package/dist-vue/packages/components/src/composables/index.d.ts +3 -0
  134. package/dist-vue/packages/components/src/composables/useChatbotError.d.ts +11 -11
  135. package/dist-vue/packages/composable/src/constants.d.ts +5 -0
  136. package/dist-vue/packages/composable/src/useDialog.d.ts +3 -3
  137. package/dist-vue/packages/composable/src/useSettingsStore.d.ts +4 -5
  138. package/dist-vue/packages/models/src/schema/Agent.d.ts +27 -27
  139. package/dist-vue/packages/models/src/schema/AgentEndpoint.d.ts +1 -1
  140. package/dist-vue/packages/models/src/schema/Document.d.ts +2 -0
  141. package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +5 -5
  142. package/dist-vue/packages/models/src/schema/SubAgent.d.ts +10 -10
  143. package/dist-vue/packages/models/src/schema/constants.d.ts +3 -1
  144. package/package.json +4 -4
  145. package/dist/_chunks/PkStreamingMarkdown-orhL2kzD.js.map +0 -1
  146. package/dist/_chunks/PkToolShowContactForm-6C4uWDtf.js +0 -1103
  147. package/dist/_chunks/PkToolShowContactForm-6C4uWDtf.js.map +0 -1
  148. package/dist/_chunks/PkToolShowSources-BQo5DRwt.js.map +0 -1
  149. package/dist/_chunks/dist-DtF6poRc.js.map +0 -1
  150. package/dist/_chunks/schemas-Bp3a8tYV.js.map +0 -1
  151. package/dist/_chunks/vue.runtime.esm-bundler-BmggS4HU.js.map +0 -1
  152. package/dist-vue/_chunks/Media-Bic_vfSX.js.map +0 -1
  153. package/dist-vue/_chunks/PkChatbotMessages-BxTeEm3j.js.map +0 -1
  154. package/dist-vue/_chunks/PkStreamingMarkdown-B4gnJ4hk.js.map +0 -1
  155. package/dist-vue/_chunks/PkToolShowSources-ZtXFkIHt.js.map +0 -1
  156. package/dist-vue/_chunks/createChatbotApiClient-YJegM3ni.js.map +0 -1
  157. package/dist-vue/_chunks/schemas-sa2dDEGb.js.map +0 -1
  158. package/dist-vue/_chunks/useChatbotStore-DGL81KJa.js.map +0 -1
  159. package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +0 -6
@@ -1,1103 +0,0 @@
1
- import { r as e } from "./rolldown-runtime-DHui2AQb.js";
2
- import { $ as t, B as n, D as r, E as i, Gt as a, I as o, L as s, T as c, U as l, Z as u, _ as d, _t as f, dt as p, ft as m, ht as h, it as g, j as _, k as v, m as y, n as b, q as x, st as S, v as C, vt as w, w as T, x as E, yt as D, z as O } from "./vue.runtime.esm-bundler-BmggS4HU.js";
3
- import { n as k } from "./vue-i18n-KvYvoek4.js";
4
- import { g as A, h as j, u as M } from "./dist-DtF6poRc.js";
5
- import { n as N, t as P } from "./dot-prop-ByInxMX6.js";
6
- import { c as F, o as I } from "./index.es-BGFmj59S.js";
7
- import { D as L, E as R, O as z, T as ee, l as te, m as ne, v as B } from "./schemas-Bp3a8tYV.js";
8
- import { f as re } from "./src-C_wl-KYN.js";
9
- import { t as ie } from "./PkStreamingMarkdown-orhL2kzD.js";
10
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/helpers/util.js
11
- var V;
12
- (function(e) {
13
- e.assertEqual = (e) => {};
14
- function t(e) {}
15
- e.assertIs = t;
16
- function n(e) {
17
- throw Error();
18
- }
19
- e.assertNever = n, e.arrayToEnum = (e) => {
20
- let t = {};
21
- for (let n of e) t[n] = n;
22
- return t;
23
- }, e.getValidEnumValues = (t) => {
24
- let n = e.objectKeys(t).filter((e) => typeof t[t[e]] != "number"), r = {};
25
- for (let e of n) r[e] = t[e];
26
- return e.objectValues(r);
27
- }, e.objectValues = (t) => e.objectKeys(t).map(function(e) {
28
- return t[e];
29
- }), e.objectKeys = typeof Object.keys == "function" ? (e) => Object.keys(e) : (e) => {
30
- let t = [];
31
- for (let n in e) Object.prototype.hasOwnProperty.call(e, n) && t.push(n);
32
- return t;
33
- }, e.find = (e, t) => {
34
- for (let n of e) if (t(n)) return n;
35
- }, e.isInteger = typeof Number.isInteger == "function" ? (e) => Number.isInteger(e) : (e) => typeof e == "number" && Number.isFinite(e) && Math.floor(e) === e;
36
- function r(e, t = " | ") {
37
- return e.map((e) => typeof e == "string" ? `'${e}'` : e).join(t);
38
- }
39
- e.joinValues = r, e.jsonStringifyReplacer = (e, t) => typeof t == "bigint" ? t.toString() : t;
40
- })(V ||= {});
41
- var ae;
42
- (function(e) {
43
- e.mergeShapes = (e, t) => ({
44
- ...e,
45
- ...t
46
- });
47
- })(ae ||= {});
48
- var H = V.arrayToEnum([
49
- "string",
50
- "nan",
51
- "number",
52
- "integer",
53
- "float",
54
- "boolean",
55
- "date",
56
- "bigint",
57
- "symbol",
58
- "function",
59
- "undefined",
60
- "null",
61
- "array",
62
- "object",
63
- "unknown",
64
- "promise",
65
- "void",
66
- "never",
67
- "map",
68
- "set"
69
- ]), oe = (e) => {
70
- switch (typeof e) {
71
- case "undefined": return H.undefined;
72
- case "string": return H.string;
73
- case "number": return Number.isNaN(e) ? H.nan : H.number;
74
- case "boolean": return H.boolean;
75
- case "function": return H.function;
76
- case "bigint": return H.bigint;
77
- case "symbol": return H.symbol;
78
- case "object": return Array.isArray(e) ? H.array : e === null ? H.null : e.then && typeof e.then == "function" && e.catch && typeof e.catch == "function" ? H.promise : typeof Map < "u" && e instanceof Map ? H.map : typeof Set < "u" && e instanceof Set ? H.set : typeof Date < "u" && e instanceof Date ? H.date : H.object;
79
- default: return H.unknown;
80
- }
81
- }, se = V.arrayToEnum([
82
- "invalid_type",
83
- "invalid_literal",
84
- "custom",
85
- "invalid_union",
86
- "invalid_union_discriminator",
87
- "invalid_enum_value",
88
- "unrecognized_keys",
89
- "invalid_arguments",
90
- "invalid_return_type",
91
- "invalid_date",
92
- "invalid_string",
93
- "too_small",
94
- "too_big",
95
- "invalid_intersection_types",
96
- "not_multiple_of",
97
- "not_finite"
98
- ]), U = class e extends Error {
99
- get errors() {
100
- return this.issues;
101
- }
102
- constructor(e) {
103
- super(), this.issues = [], this.addIssue = (e) => {
104
- this.issues = [...this.issues, e];
105
- }, this.addIssues = (e = []) => {
106
- this.issues = [...this.issues, ...e];
107
- };
108
- let t = new.target.prototype;
109
- Object.setPrototypeOf ? Object.setPrototypeOf(this, t) : this.__proto__ = t, this.name = "ZodError", this.issues = e;
110
- }
111
- format(e) {
112
- let t = e || function(e) {
113
- return e.message;
114
- }, n = { _errors: [] }, r = (e) => {
115
- for (let i of e.issues) if (i.code === "invalid_union") i.unionErrors.map(r);
116
- else if (i.code === "invalid_return_type") r(i.returnTypeError);
117
- else if (i.code === "invalid_arguments") r(i.argumentsError);
118
- else if (i.path.length === 0) n._errors.push(t(i));
119
- else {
120
- let e = n, r = 0;
121
- for (; r < i.path.length;) {
122
- let n = i.path[r];
123
- r === i.path.length - 1 ? (e[n] = e[n] || { _errors: [] }, e[n]._errors.push(t(i))) : e[n] = e[n] || { _errors: [] }, e = e[n], r++;
124
- }
125
- }
126
- };
127
- return r(this), n;
128
- }
129
- static assert(t) {
130
- if (!(t instanceof e)) throw Error(`Not a ZodError: ${t}`);
131
- }
132
- toString() {
133
- return this.message;
134
- }
135
- get message() {
136
- return JSON.stringify(this.issues, V.jsonStringifyReplacer, 2);
137
- }
138
- get isEmpty() {
139
- return this.issues.length === 0;
140
- }
141
- flatten(e = (e) => e.message) {
142
- let t = Object.create(null), n = [];
143
- for (let r of this.issues) if (r.path.length > 0) {
144
- let n = r.path[0];
145
- t[n] = t[n] || [], t[n].push(e(r));
146
- } else n.push(e(r));
147
- return {
148
- formErrors: n,
149
- fieldErrors: t
150
- };
151
- }
152
- get formErrors() {
153
- return this.flatten();
154
- }
155
- };
156
- U.create = (e) => new U(e);
157
- //#endregion
158
- //#region ../../packages/composable/src/useSafeLocalStorage.ts
159
- function W(e, t) {
160
- try {
161
- return window.localStorage.getItem(""), M(e, t);
162
- } catch (e) {
163
- return re.warn("[useSafeLocalStorage] localStorage blocked, falling back to in-memory ref", e), m(t);
164
- }
165
- }
166
- //#endregion
167
- //#region ../../node_modules/.pnpm/@volverjs+form-vue@1.1.1_@volverjs+ui-vue@0.0.13-beta.8_@volverjs+style@0.1.24-beta.3_@_7bbe5f849af2a651f01330e8c0996f87/node_modules/@volverjs/form-vue/dist/index.es.js
168
- var G = /* @__PURE__ */ ((e) => (e.text = "text", e.number = "number", e.email = "email", e.password = "password", e.tel = "tel", e.url = "url", e.search = "search", e.date = "date", e.time = "time", e.datetimeLocal = "datetime-local", e.month = "month", e.week = "week", e.color = "color", e.select = "select", e.checkbox = "checkbox", e.radio = "radio", e.textarea = "textarea", e.radioGroup = "radioGroup", e.checkboxGroup = "checkboxGroup", e.combobox = "combobox", e.custom = "custom", e))(G || {}), K = /* @__PURE__ */ ((e) => (e.invalid = "invalid", e.valid = "valid", e.submitting = "submitting", e.reset = "reset", e.updated = "updated", e.unknown = "unknown", e))(K || {}), q = (e) => e._def.typeName === "ZodObject", J = (e) => e._zod.def.type === "object", ce = (e) => e._def.typeName === "ZodDefault", le = (e) => e._zod.def.type === "default", ue = (e) => e._def.typeName === "ZodNullable", de = (e) => e._zod.def.type === "nullable", fe = (e) => e._def.typeName === "ZodRecord", pe = (e) => e._zod.def.type === "record", me = (e) => e._def.typeName === "ZodArray", he = (e) => e._zod.def.type === "array", ge = (e) => e._def.typeName === "ZodEffects", _e = (e) => e._def.typeName === "ZodOptional", ve = (e) => e._zod.def.type === "optional", ye = (e) => e._zod.def.type === "pipe", be = (e) => e._zod.def.type === "transform";
169
- function xe(e) {
170
- let t = e;
171
- for (; ge(t);) t = t.innerType();
172
- return t;
173
- }
174
- function Se(e) {
175
- let t = e;
176
- for (; ye(t);) t = be(t._zod.def.out) ? t._zod.def.in : t._zod.def.out;
177
- return t;
178
- }
179
- var Y = (e) => {
180
- let t = xe(e);
181
- return _e(t) && (t = t._def.innerType), t;
182
- }, X = (e) => {
183
- let t = Se(e);
184
- return ve(t) && (t = t._zod.def.innerType), t;
185
- }, Ce = (e) => !!_e(xe(e)), we = (e) => !!ve(Se(e)), Z = (e) => "_zod" in e;
186
- function Q(e, t = {}) {
187
- if (Z(e)) {
188
- let n = X(e);
189
- return J(n) ? {
190
- ...n._zod.def.catchall && n._zod.def.catchall._zod.def.type !== "never" ? t : {},
191
- ...Object.fromEntries(("shape" in n._zod.def ? Object.entries(n._zod.def.shape) : []).map(([e, n]) => {
192
- let r = t[e], i = we(n), a = X(n), o;
193
- if (le(a) && (o = a._zod.def.defaultValue, a = a._zod.def.innerType), r === null && de(a)) return [e, r];
194
- if (r == null && i) return [e, o];
195
- if (a) {
196
- let t = ee(n, r);
197
- if (t.success) return [e, t.data ?? o];
198
- }
199
- if (he(a) && Array.isArray(r) && r.length) {
200
- let t = X(a._zod.def.element);
201
- if (J(t)) return [e, r.map((e) => Q(t, e && typeof e == "object" ? e : void 0))];
202
- }
203
- if (pe(a) && r) {
204
- let t = X(a._zod.def.valueType);
205
- if (J(t)) return [e, Object.keys(r).reduce((e, n) => (e[n] = Q(t, r[n]), e), {})];
206
- }
207
- return J(a) ? [e, Q(a, r && typeof r == "object" ? r : o)] : [e, o];
208
- }))
209
- } : t;
210
- }
211
- let n = Y(e);
212
- return q(n) ? {
213
- ...n._def.unknownKeys === "passthrough" ? t : {},
214
- ...Object.fromEntries(("shape" in n ? Object.entries(n.shape) : []).map(([e, n]) => {
215
- let r = t[e], i = Ce(n), a = Y(n), o;
216
- if (ce(a) && (o = a._def.defaultValue(), a = a._def.innerType), r === null && ue(a)) return [e, r];
217
- if (r == null && i) return [e, o];
218
- if (a) {
219
- let t = n.safeParse(r);
220
- if (t.success) return [e, t.data ?? o];
221
- }
222
- if (me(a) && Array.isArray(r) && r.length) {
223
- let t = Y(a._def.type);
224
- if (q(t)) return [e, r.map((e) => Q(t, e && typeof e == "object" ? e : void 0))];
225
- }
226
- if (fe(a) && r) {
227
- let t = Y(a._def.valueType);
228
- if (q(t)) return [e, Object.keys(r).reduce((e, n) => (e[n] = Q(t, r[n]), e), {})];
229
- }
230
- return q(a) ? [e, Q(a, r && typeof r == "object" ? r : o)] : [e, o];
231
- }))
232
- } : t;
233
- }
234
- var Te = (e, t) => Z(e) ? R(e, t) : e.safeParseAsync(t), Ee = (e, t) => Z(e) ? z(t) : t.format(), De = (e, t) => Z(e) ? z(new L(t)) : new U(t).format();
235
- function Oe(e, t, r, a, o) {
236
- let c = m(), l = m(), f = d(() => l.value === K.invalid), _ = m(), b = m(!1), x, S = (t) => {
237
- let n = Q(e, t);
238
- if (r?.class) {
239
- let e = r.class;
240
- return new e(n);
241
- }
242
- return n;
243
- }, C = async (t = _.value, n) => {
244
- if (x = n?.fields, b.value) return !0;
245
- let r = await Te(e, t);
246
- if (!r.success) {
247
- if (l.value = K.invalid, !x?.size) return c.value = Ee(e, r.error), !1;
248
- let t = r.error.issues.filter((e) => x?.has(e.path.join(".")));
249
- return t.length ? (c.value = De(e, t), !1) : (c.value = void 0, !0);
250
- }
251
- return c.value = void 0, l.value = K.valid, _.value = S(r.data), !0;
252
- }, w = () => {
253
- c.value = void 0, l.value = void 0, x = void 0;
254
- }, T = () => {
255
- _.value = S(), w(), l.value = K.reset;
256
- }, E = async (e) => b.value || !await C(void 0, e) ? !1 : (l.value = K.submitting, !0), { ignoreUpdates: D, stop: O } = A(_, () => {
257
- l.value = K.updated;
258
- }, {
259
- deep: !0,
260
- eventFilter: j(r?.updateThrottle ?? 500)
261
- }), k = p(c), M = p(l);
262
- return {
263
- clear: w,
264
- errors: c,
265
- formData: _,
266
- ignoreUpdates: D,
267
- invalid: f,
268
- readonly: b,
269
- reset: T,
270
- status: l,
271
- wrappers: o,
272
- stopUpdatesWatch: O,
273
- submit: E,
274
- validate: C,
275
- VvForm: i({
276
- name: "VvForm",
277
- props: {
278
- continuousValidation: {
279
- type: Boolean,
280
- default: !1
281
- },
282
- modelValue: {
283
- type: Object,
284
- default: () => ({})
285
- },
286
- readonly: {
287
- type: Boolean,
288
- default: r?.readonly
289
- },
290
- tag: {
291
- type: String,
292
- default: "form"
293
- },
294
- template: {
295
- type: [Array, Function],
296
- default: void 0
297
- },
298
- superRefine: {
299
- type: Function,
300
- default: void 0
301
- },
302
- validateFields: {
303
- type: Array,
304
- default: void 0
305
- }
306
- },
307
- emits: [
308
- "invalid",
309
- "submit",
310
- "update:modelValue",
311
- "update:readonly",
312
- "valid",
313
- "reset"
314
- ],
315
- expose: [
316
- "errors",
317
- "invalid",
318
- "readonly",
319
- "status",
320
- "submit",
321
- "tag",
322
- "template",
323
- "valid",
324
- "validate",
325
- "clear",
326
- "reset"
327
- ],
328
- slots: Object,
329
- setup(e, { emit: i }) {
330
- return _.value = S(h(e.modelValue)), u(() => e.modelValue, (e) => {
331
- if (e) {
332
- let t = g(e) ? h(e) : e;
333
- if (JSON.stringify(t) === JSON.stringify(h(_.value))) return;
334
- _.value = typeof t?.clone == "function" ? t.clone() : JSON.parse(JSON.stringify(t));
335
- }
336
- }, { deep: !0 }), u(l, async (t) => {
337
- if (t === K.invalid) {
338
- let e = h(c.value);
339
- i("invalid", e), r?.onInvalid?.(e);
340
- return;
341
- }
342
- if (t === K.valid) {
343
- let e = h(_.value);
344
- i("valid", e), r?.onValid?.(e), i("update:modelValue", e), r?.onUpdate?.(e);
345
- return;
346
- }
347
- if (t === K.submitting) {
348
- let e = h(_.value);
349
- i("submit", e), r?.onSubmit?.(e);
350
- return;
351
- }
352
- if (t === K.reset) {
353
- let e = h(_.value);
354
- i("reset", e), r?.onReset?.(e);
355
- return;
356
- }
357
- if (t === K.updated) {
358
- if ((c.value || r?.continuousValidation || e.continuousValidation) && await C(void 0, {
359
- superRefine: e.superRefine,
360
- fields: x ?? new Set(e.validateFields)
361
- }), !_.value || !e.modelValue || JSON.stringify(_.value) !== JSON.stringify(e.modelValue)) {
362
- let e = h(_.value);
363
- i("update:modelValue", e), r?.onUpdate?.(e);
364
- }
365
- l.value === K.updated && (l.value = K.unknown);
366
- }
367
- }), s(() => {
368
- e.readonly !== void 0 && (b.value = e.readonly);
369
- }), u(() => e.readonly, (e) => {
370
- b.value = e;
371
- }), u(b, (t) => {
372
- t !== e.readonly && i("update:readonly", b.value);
373
- }), n(t, {
374
- clear: w,
375
- errors: k,
376
- formData: _,
377
- ignoreUpdates: D,
378
- invalid: f,
379
- readonly: b,
380
- reset: T,
381
- status: M,
382
- stopUpdatesWatch: O,
383
- submit: E,
384
- validate: C,
385
- wrappers: o
386
- }), {
387
- clear: w,
388
- errors: k,
389
- formData: _,
390
- ignoreUpdates: D,
391
- invalid: f,
392
- isReadonly: b,
393
- reset: T,
394
- status: M,
395
- stopUpdatesWatch: O,
396
- submit: () => E({
397
- superRefine: e.superRefine,
398
- fields: new Set(e.validateFields)
399
- }),
400
- validate: C,
401
- wrappers: o
402
- };
403
- },
404
- render() {
405
- let e = () => this.$slots?.default?.({
406
- errors: k.value,
407
- formData: _.value,
408
- invalid: f.value,
409
- readonly: b.value,
410
- status: M.value,
411
- wrappers: o,
412
- clear: w,
413
- ignoreUpdates: D,
414
- reset: T,
415
- stopUpdatesWatch: O,
416
- submit: E,
417
- validate: C
418
- }) ?? this.$slots.default;
419
- return v(this.tag, {
420
- onSubmit: y(this.submit, ["prevent"]),
421
- onReset: y(this.reset, ["prevent"])
422
- }, (this.template ?? r?.template) && a ? [v(a, { schema: this.template ?? r?.template }, { default: e })] : { default: e });
423
- }
424
- })
425
- };
426
- }
427
- function ke(e, t, r, a) {
428
- return i({
429
- name: "VvFormField",
430
- props: {
431
- type: {
432
- type: String,
433
- validator: (e) => Object.values(G).includes(e),
434
- default: G.custom
435
- },
436
- is: {
437
- type: [Object, String],
438
- default: void 0
439
- },
440
- name: {
441
- type: [
442
- String,
443
- Number,
444
- Boolean,
445
- Symbol
446
- ],
447
- required: !0
448
- },
449
- props: {
450
- type: [Object, Function],
451
- default: () => ({})
452
- },
453
- showValid: {
454
- type: Boolean,
455
- default: !1
456
- },
457
- defaultValue: {
458
- type: [
459
- String,
460
- Number,
461
- Boolean,
462
- Array,
463
- Object
464
- ],
465
- default: void 0
466
- },
467
- lazyLoad: {
468
- type: Boolean,
469
- default: !1
470
- },
471
- readonly: {
472
- type: Boolean,
473
- default: void 0
474
- }
475
- },
476
- emits: [
477
- "invalid",
478
- "update:formData",
479
- "update:modelValue",
480
- "valid"
481
- ],
482
- expose: [
483
- "component",
484
- "errors",
485
- "hasProps",
486
- "invalid",
487
- "invalidLabel",
488
- "is",
489
- "type"
490
- ],
491
- slots: Object,
492
- setup(i, { slots: m, emit: h }) {
493
- let { props: g, name: v } = f(i), y = x(), b = _(t, void 0);
494
- b && b.fields.value.set(y, i.name);
495
- let S = _(e), C = d({
496
- get() {
497
- if (S?.formData) return P(new Object(S.formData.value), String(i.name));
498
- },
499
- set(e) {
500
- S?.formData && (N(new Object(S.formData.value), String(i.name), e), h("update:modelValue", {
501
- newValue: C.value,
502
- formData: S?.formData
503
- }));
504
- }
505
- });
506
- s(() => {
507
- C.value === void 0 && i.defaultValue !== void 0 && (C.value = i.defaultValue);
508
- }), o(() => {
509
- b && b.fields.value.delete(y);
510
- });
511
- let w = d(() => {
512
- if (S?.errors.value) return P(S.errors.value, String(i.name));
513
- }), T = d(() => w.value?._errors), E = d(() => w.value !== void 0), O = u(E, (e) => {
514
- if (e) {
515
- h("invalid", w.value), b && b.errors.value.set(String(i.name), w.value);
516
- return;
517
- }
518
- h("valid", C.value), b && b.errors.value.delete(i.name);
519
- }), k = u(() => S?.formData, () => {
520
- h("update:formData", S?.formData);
521
- }, { deep: !0 });
522
- o(() => {
523
- O(), k();
524
- });
525
- let A = (e) => {
526
- e instanceof InputEvent && (e = e.target.value), C.value = e;
527
- }, j = d(() => {
528
- let e = g.value;
529
- return typeof e == "function" && (e = e(S?.formData)), Object.keys(e).reduce((t, n) => (t[n] = D(e[n]), t), {});
530
- }), M = d(() => S?.readonly.value || b?.readonly.value ? !0 : j.value.readonly ?? i.readonly), F = d(() => ({
531
- ...j.value,
532
- name: j.value.name ?? i.name,
533
- invalid: E.value,
534
- valid: i.showValid ? !!(!E.value && C.value) : void 0,
535
- type: ((e) => {
536
- if ([
537
- G.color,
538
- G.date,
539
- G.datetimeLocal,
540
- G.email,
541
- G.month,
542
- G.number,
543
- G.password,
544
- G.search,
545
- G.tel,
546
- G.text,
547
- G.time,
548
- G.url,
549
- G.week
550
- ].includes(e)) return e;
551
- })(i.type),
552
- invalidLabel: T.value,
553
- modelValue: C.value,
554
- readonly: M.value,
555
- "onUpdate:modelValue": A
556
- }));
557
- return n(r, {
558
- name: p(v),
559
- errors: p(w)
560
- }), {
561
- component: d(() => {
562
- if (i.type === G.custom) return { render() {
563
- return m.default?.({
564
- errors: p(w).value,
565
- formData: S?.formData.value,
566
- formErrors: S?.errors.value,
567
- invalid: E.value,
568
- invalidLabel: T.value,
569
- modelValue: C.value,
570
- readonly: M.value,
571
- onUpdate: A,
572
- submit: S?.submit,
573
- validate: S?.validate
574
- }) ?? m.default;
575
- } };
576
- if (!(a?.lazyLoad ?? i.lazyLoad)) {
577
- let e;
578
- switch (i.type) {
579
- case G.select:
580
- e = l("VvSelect");
581
- break;
582
- case G.checkbox:
583
- e = l("VvCheckbox");
584
- break;
585
- case G.radio:
586
- e = l("VvRadio");
587
- break;
588
- case G.textarea:
589
- e = l("VvTextarea");
590
- break;
591
- case G.radioGroup:
592
- e = l("VvRadioGroup");
593
- break;
594
- case G.checkboxGroup:
595
- e = l("VvCheckboxGroup");
596
- break;
597
- case G.combobox:
598
- e = l("VvCombobox");
599
- break;
600
- default: e = l("VvInputText");
601
- }
602
- if (typeof e != "string") return e;
603
- console.warn(`[@volverjs/form-vue]: ${e} not found, the component will be loaded asynchronously. To avoid this warning, please set "lazyLoad" option.`);
604
- }
605
- return c(async () => {
606
- switch (a?.sideEffects && await Promise.resolve(a.sideEffects(i.type)), i.type) {
607
- case G.textarea: return import("./VvTextarea.es-C9dwYLOG.js");
608
- case G.radio: return import("./VvRadio.es-BpQAJbon.js");
609
- case G.radioGroup: return import("./VvRadioGroup.es-BSBrmx9w.js");
610
- case G.checkbox: return import("./VvCheckbox.es-kmMsWlkU.js");
611
- case G.checkboxGroup: return import("./VvCheckboxGroup.es-BRRmuO9h.js");
612
- case G.select: return import("./VvSelect.es-DALpUK5j.js");
613
- case G.combobox: return import("./VvCombobox.es-pTM53Z4B.js");
614
- }
615
- return import("./VvInputText.es-DO39OSWk.js");
616
- });
617
- }),
618
- hasProps: F,
619
- invalid: E
620
- };
621
- },
622
- render() {
623
- return this.is ? v(this.is, this.hasProps, this.$slots) : this.type === G.custom ? v(this.component, null, this.$slots) : v(this.component, this.hasProps, this.$slots);
624
- }
625
- });
626
- }
627
- function Ae(e, t, r) {
628
- return i({
629
- name: "VvFormFieldsGroup",
630
- props: {
631
- is: {
632
- type: [Object, String],
633
- default: void 0
634
- },
635
- names: {
636
- type: [Array, Object],
637
- required: !0
638
- },
639
- props: {
640
- type: [Object, Function],
641
- default: () => ({})
642
- },
643
- showValid: {
644
- type: Boolean,
645
- default: !1
646
- },
647
- defaultValues: {
648
- type: [Object],
649
- default: void 0
650
- },
651
- readonly: {
652
- type: Boolean,
653
- default: void 0
654
- }
655
- },
656
- emits: [
657
- "invalid",
658
- "update:formData",
659
- "update:modelValue",
660
- "valid"
661
- ],
662
- expose: [
663
- "component",
664
- "errors",
665
- "hasProps",
666
- "invalid",
667
- "invalidLabels",
668
- "is"
669
- ],
670
- slots: Object,
671
- setup(i, { slots: a, emit: c }) {
672
- let { props: l, names: m, defaultValues: h } = f(i), g = x(), v = d(() => Array.isArray(m.value) ? m.value : Object.values(m.value)), y = d(() => Array.isArray(m.value) ? m.value : Object.keys(m.value)), b = d(() => Array.isArray(m.value) ? m.value.reduce((e, t) => (e[String(t)] = t, e), {}) : m.value), S = d(() => Object.keys(b.value).reduce((e, t) => (e[String(b.value[t])] = t, e), {})), C = _(t, void 0);
673
- C && v.value.forEach((e) => {
674
- C.fields.value.set(`${g}-${e}`, e);
675
- });
676
- let w = _(e), T = d({
677
- get() {
678
- return w?.formData ? y.value.reduce((e, t) => (e[t] = P(new Object(w.formData.value), b.value[t]), e), {}) : {};
679
- },
680
- set(e) {
681
- w?.formData && (y.value.forEach((t) => {
682
- N(new Object(w.formData.value), b.value[t], e?.[t]);
683
- }), c("update:modelValue", {
684
- newValue: T.value,
685
- formData: w?.formData
686
- }));
687
- }
688
- });
689
- s(() => {
690
- h.value && v.value.forEach((e) => {
691
- h.value?.[e] !== void 0 && T.value[e] === void 0 && (T.value = {
692
- ...T.value,
693
- [e]: h.value?.[e]
694
- });
695
- });
696
- }), o(() => {
697
- C && v.value.forEach((e) => {
698
- C.fields.value.delete(`${g}-${e}`);
699
- });
700
- });
701
- let E = d(() => {
702
- if (!w?.errors.value) return;
703
- let e = v.value.reduce((e, t) => {
704
- if (!w.errors.value) return e;
705
- let n = P(w.errors.value, String(t));
706
- return n === void 0 || (e[String(t)] = n), e;
707
- }, {});
708
- if (Object.keys(e).length !== 0) return e;
709
- }), O = d(() => {
710
- if (!E.value) return;
711
- let e = Object.keys(E.value).reduce((e, t) => (E.value?.[t] && (e[S.value[t]] = E.value[t]._errors), e), {});
712
- if (Object.keys(e).length !== 0) return e;
713
- }), k = d(() => E.value !== void 0), A = d(() => y.value.reduce((e, t) => (e[t] = !!E.value?.[S.value[t]], e), {})), j = u(k, () => {
714
- if (k.value) {
715
- c("invalid", E.value), C && v.value.forEach((e) => {
716
- if (!E.value?.[e]) {
717
- C.errors.value.delete(e);
718
- return;
719
- }
720
- C.errors.value.set(e, E.value?.[e]);
721
- });
722
- return;
723
- }
724
- c("valid", T.value), C && v.value.forEach((e) => {
725
- C.errors.value.delete(e);
726
- });
727
- }), M = u(() => w?.formData, () => {
728
- c("update:formData", w?.formData);
729
- }, { deep: !0 });
730
- o(() => {
731
- j(), M();
732
- });
733
- let F = (e) => {
734
- T.value = e;
735
- }, I = (e, t) => {
736
- t instanceof InputEvent && (t = t.target.value), y.value.includes(e) && (T.value = {
737
- ...T.value,
738
- [e]: t
739
- });
740
- }, L = d(() => {
741
- let e = l.value;
742
- return typeof e == "function" && (e = e(w?.formData)), Object.keys(e).reduce((t, n) => (t[n] = D(e[n]), t), {});
743
- }), R = d(() => w?.readonly.value ? !0 : L.value.readonly ?? i.readonly), z = d(() => y.value.reduce((e, t) => (e[`onUpdate:${t}`] = (e) => {
744
- I(t, e);
745
- }, e), { "onUpdate:modelValue": F })), ee = d(() => ({
746
- ...z.value,
747
- ...L.value,
748
- ...T.value,
749
- modelValue: T.value,
750
- names: L.value.name ?? v.value,
751
- invalid: k.value,
752
- invalids: A.value,
753
- valid: i.showValid ? !!(!k.value && T.value) : void 0,
754
- invalidLabels: O.value,
755
- readonly: R.value
756
- }));
757
- return n(r, {
758
- names: p(m),
759
- errors: p(E)
760
- }), {
761
- component: d(() => ({ render() {
762
- return a.default?.({
763
- errors: E.value,
764
- formData: w?.formData.value,
765
- formErrors: w?.errors.value,
766
- invalid: k.value,
767
- invalids: A.value,
768
- invalidLabels: O.value,
769
- modelValue: T.value,
770
- onUpdate: F,
771
- onUpdateField: I,
772
- readonly: R.value,
773
- submit: w?.submit,
774
- validate: w?.validate
775
- }) ?? a.default;
776
- } })),
777
- hasProps: ee,
778
- invalid: k
779
- };
780
- },
781
- render() {
782
- return this.is ? v(this.is, this.hasProps, this.$slots) : v(this.component, null, this.$slots);
783
- }
784
- });
785
- }
786
- function je(e, t) {
787
- return i({
788
- name: "VvFormWrapper",
789
- props: {
790
- name: {
791
- type: String,
792
- required: !0
793
- },
794
- tag: {
795
- type: String,
796
- default: void 0
797
- },
798
- readonly: {
799
- type: Boolean,
800
- default: !1
801
- }
802
- },
803
- emits: ["invalid", "valid"],
804
- expose: [
805
- "clear",
806
- "errors",
807
- "fields",
808
- "fieldsErrors",
809
- "formData",
810
- "invalid",
811
- "readonly",
812
- "reset",
813
- "submit",
814
- "tag",
815
- "validate",
816
- "validateWrapper"
817
- ],
818
- slots: Object,
819
- setup(r, { emit: i }) {
820
- let a = _(e), c = _(t, void 0), l = m(/* @__PURE__ */ new Map()), h = m(/* @__PURE__ */ new Map()), { name: g } = f(r), v = d(() => a?.invalid.value ? h.value.size > 0 : !1);
821
- u(v, (e) => {
822
- if (e) {
823
- i("invalid");
824
- return;
825
- }
826
- i("valid");
827
- });
828
- let y = d(() => a?.readonly.value || r.readonly), b = {
829
- name: p(g),
830
- errors: h,
831
- invalid: p(v),
832
- readonly: p(y),
833
- fields: l
834
- };
835
- return n(t, b), u(d(() => new Map(l.value)), (e, t) => {
836
- c?.fields && (t.forEach((t, n) => {
837
- e.has(n) || c?.fields.value.delete(n);
838
- }), e.forEach((e, t) => {
839
- c?.fields.value.has(t) || c?.fields.value.set(t, e);
840
- }));
841
- }, { deep: !0 }), u(h, (e) => {
842
- c?.errors && l.value.forEach((t) => {
843
- if (e.has(t) || c.errors.value.delete(t), e.has(t)) {
844
- let n = e.get(t);
845
- n && c.errors.value.set(t, n);
846
- }
847
- });
848
- }, { deep: !0 }), s(() => {
849
- if (!a?.wrappers || !g.value) {
850
- console.warn("[@volverjs/form-vue]: Invalid wrapper registration state");
851
- return;
852
- }
853
- if (a.wrappers.has(g.value)) {
854
- console.warn(`[@volverjs/form-vue]: wrapper name "${g.value}" is already used`);
855
- return;
856
- }
857
- a.wrappers.set(g.value, b);
858
- }), o(() => {
859
- a?.wrappers && g.value && a.wrappers.delete(g.value);
860
- }), {
861
- errors: a?.errors,
862
- fields: l,
863
- fieldsErrors: h,
864
- formData: a?.formData,
865
- invalid: v,
866
- readonly: y,
867
- clear: a?.clear,
868
- reset: a?.reset,
869
- submit: a?.submit,
870
- validate: a?.validate,
871
- validateWrapper: () => a?.validate(void 0, { fields: new Set(l.value.values()) }) ?? Promise.resolve(!0)
872
- };
873
- },
874
- render() {
875
- let e = () => this.$slots.default?.({
876
- errors: this.errors,
877
- fieldsErrors: this.fieldsErrors,
878
- formData: this.formData,
879
- invalid: this.invalid,
880
- readonly: this.readonly,
881
- clear: this.clear,
882
- reset: this.reset,
883
- submit: this.submit,
884
- validate: this.validate,
885
- validateWrapper: this.validateWrapper
886
- });
887
- return this.tag ? v(this.tag, null, { default: e }) : e();
888
- }
889
- });
890
- }
891
- function Me(e, t) {
892
- let n = i({
893
- name: "VvFormTemplate",
894
- props: {
895
- schema: {
896
- type: [Array, Function],
897
- required: !0
898
- },
899
- scope: {
900
- type: Object,
901
- default: () => ({})
902
- }
903
- },
904
- slots: Object,
905
- setup(r, { slots: i }) {
906
- let a = _(e);
907
- if (a?.formData) return () => {
908
- let e = typeof r.schema == "function" ? r.schema(a, r.scope) : r.schema, o, s = e.reduce((e, i) => {
909
- let { vvIs: s, vvName: c, vvSlots: l, vvChildren: u, vvIf: d, vvElseIf: f, vvType: p, vvDefaultValue: m, vvShowValid: h, vvContent: g, ..._ } = typeof i == "function" ? i(a, r.scope) : i;
910
- if (d !== void 0) {
911
- if (o = typeof d == "string" ? !!P(new Object(a.formData.value), d) : D(typeof d == "function" ? d(a) : d), !o) return e;
912
- } else if (f !== void 0 && o !== void 0) {
913
- if (o || (o = typeof f == "string" ? !!P(new Object(a.formData.value), f) : D(typeof f == "function" ? f(a) : f), !o)) return e;
914
- } else o = void 0;
915
- let y;
916
- return u && (y = typeof s == "string" ? v(n, { schema: u }) : { default: (e) => v(n, {
917
- schema: u,
918
- scope: e
919
- }) }), c ? (e.push(v(t, {
920
- name: c,
921
- is: s,
922
- type: p,
923
- defaultValue: m,
924
- showValid: h,
925
- props: _
926
- }, l ?? y ?? g)), e) : s ? (e.push(v(s, _, l ?? y ?? g)), e) : (y && ("default" in y ? e.push(y.default(r.scope)) : e.push(y)), e);
927
- }, []);
928
- return s.push(i?.default?.({
929
- errors: a?.errors.value,
930
- formData: a?.formData.value,
931
- invalid: a?.invalid.value,
932
- status: a?.status.value,
933
- submit: a?.submit,
934
- validate: a?.validate,
935
- clear: a?.clear,
936
- reset: a?.reset
937
- })), s;
938
- };
939
- }
940
- });
941
- return n;
942
- }
943
- function Ne(e, t = {}) {
944
- let n = Symbol("formInjectionKey"), r = Symbol("formWrapperInjectionKey"), i = Symbol("formFieldInjectionKey"), a = Symbol("formFieldsGroupInjectionKey"), o = je(n, r), s = ke(n, r, i, t), c = Ae(n, r, a), l = Me(n, s), u = /* @__PURE__ */ new Map(), { clear: d, errors: f, formData: p, ignoreUpdates: m, invalid: h, readonly: g, reset: _, status: v, stopUpdatesWatch: y, submit: b, validate: x, VvForm: S } = Oe(e, n, t, l, u);
945
- return {
946
- clear: d,
947
- errors: f,
948
- formData: p,
949
- formFieldInjectionKey: i,
950
- formInjectionKey: n,
951
- formWrapperInjectionKey: r,
952
- ignoreUpdates: m,
953
- invalid: h,
954
- readonly: g,
955
- reset: _,
956
- status: v,
957
- stopUpdatesWatch: y,
958
- submit: b,
959
- validate: x,
960
- wrappers: u,
961
- VvForm: S,
962
- VvFormField: s,
963
- VvFormFieldsGroup: c,
964
- VvFormTemplate: l,
965
- VvFormWrapper: o
966
- };
967
- }
968
- var Pe = Symbol("pluginInjectionKey"), $ = /* @__PURE__ */ new Map();
969
- function Fe(e, t = {}) {
970
- if (t.scope && $.has(t.scope)) return $.get(t.scope);
971
- if (!r()) {
972
- let n = Ne(e, t);
973
- return t.scope && $.set(t.scope, n), n;
974
- }
975
- let n = Ne(e, {
976
- ..._(Pe, {}),
977
- ...t
978
- });
979
- return t.scope && $.set(t.scope, n), n;
980
- }
981
- //#endregion
982
- //#region ../../packages/components/src/composables/useLocalizedString.ts
983
- function Ie(e, t) {
984
- let { locale: n, t: r, te: i } = k({ useScope: "global" });
985
- return d(() => {
986
- let a = w(e), o = t !== void 0 && i(t) ? r(t) : void 0;
987
- return a && a[n.value] || o;
988
- });
989
- }
990
- //#endregion
991
- //#region ../../packages/components/src/chat/PkToolShowContactForm.vue?vue&type=script&setup=true&lang.ts
992
- var Le = { class: "border border-surface-3 rounded-xl w-full overflow-hidden" }, Re = { class: "px-sm py-6 bg-surface-1 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8 min-h-40" }, ze = { class: "font-bold" }, Be = {
993
- key: 0,
994
- class: "p-sm"
995
- }, Ve = { class: "flex justify-between items-center gap-16 mt-xs" }, He = { class: "text-smaller text-word-3 flex items-center gap-8" }, Ue = {
996
- key: 1,
997
- class: "p-sm"
998
- }, We = { class: "flex items-center gap-sm" }, Ge = { class: "font-semibold block text-success" }, Ke = { class: "text-word-3" }, qe = /* @__PURE__ */ i({
999
- __name: "PkToolShowContactForm",
1000
- props: {
1001
- part: { type: null },
1002
- submitted: { type: Boolean },
1003
- loading: { type: Boolean },
1004
- error: { type: String },
1005
- readonly: { type: Boolean },
1006
- privacyPolicyNotice: { type: null }
1007
- },
1008
- emits: ["submit"],
1009
- setup(e, { emit: n }) {
1010
- let { t: r } = k({ useScope: "global" }), i = e, o = d(() => i.part), s = d(() => o.value.input), c = W(d(() => `${o.value.toolCallId}-${o.value.type}-submitted`), !1), l = ne({
1011
- name: B().min(1).max(255).default(""),
1012
- email: te().max(255).default(""),
1013
- phone: B().max(50).regex(/^[+0-9\s\-.()]*$/, r("validation.invalidPhoneNumber")).optional()
1014
- }), f = n, { VvForm: p, VvFormField: m, formData: h } = Fe(l, { lazyLoad: !0 });
1015
- u(s, (e) => {
1016
- h.value = {
1017
- name: e?.name || "",
1018
- email: e?.email || "",
1019
- phone: e?.phone || ""
1020
- };
1021
- }, { immediate: !0 }), u(() => i.submitted, (e) => {
1022
- e && (c.value = !0);
1023
- }, { immediate: !0 });
1024
- let g = d(() => i.submitted || c.value), _ = async (e) => {
1025
- f("submit", {
1026
- ...e,
1027
- metadata: s.value?.conversationContext
1028
- });
1029
- }, v = Ie(() => i.privacyPolicyNotice, "message.defaultPrivacyPolicyNotice");
1030
- return (n, i) => {
1031
- let o = I, s = F;
1032
- return O(), E("div", Le, [C("div", Re, [T(o, {
1033
- name: "ri:send-plane-2-line",
1034
- class: "text-16"
1035
- }), C("strong", ze, a(D(r)("label.contactUs")), 1)]), T(b, { mode: "out-in" }, {
1036
- default: t(() => [g.value ? (O(), E("div", Ue, [C("div", We, [T(o, {
1037
- name: "ri:mail-check-line",
1038
- class: "text-24 text-success"
1039
- }), C("div", null, [C("strong", Ge, a(D(r)("message.leadSubmittedTitle")), 1), C("p", Ke, a(D(r)("message.leadSubmittedMessage")), 1)])])])) : (O(), E("div", Be, [T(D(p), {
1040
- modelValue: D(h),
1041
- "onUpdate:modelValue": i[0] ||= (e) => S(h) ? h.value = e : null,
1042
- readonly: e.readonly,
1043
- onSubmit: _
1044
- }, {
1045
- default: t(() => [
1046
- T(D(m), {
1047
- name: "name",
1048
- type: "text",
1049
- label: D(r)("label.name"),
1050
- placeholder: D(r)("placeholder.name"),
1051
- icon: "ri:user-line",
1052
- modifiers: "compact no-label",
1053
- class: "mb-md"
1054
- }, null, 8, ["label", "placeholder"]),
1055
- T(D(m), {
1056
- name: "email",
1057
- type: "email",
1058
- label: D(r)("label.email"),
1059
- placeholder: D(r)("placeholder.email"),
1060
- icon: "ri:mail-line",
1061
- modifiers: "compact no-label",
1062
- class: "mb-md"
1063
- }, null, 8, ["label", "placeholder"]),
1064
- T(D(m), {
1065
- name: "phone",
1066
- type: "tel",
1067
- label: D(r)("label.phone"),
1068
- placeholder: D(r)("placeholder.phone"),
1069
- icon: "ri:phone-line",
1070
- class: "mb-md",
1071
- modifiers: "compact no-label"
1072
- }, null, 8, ["label", "placeholder"]),
1073
- C("div", Ve, [C("div", He, [T(o, {
1074
- name: "ri:shield-check-line",
1075
- class: "text-16 shrink-0"
1076
- }), T(ie, {
1077
- markdown: D(v),
1078
- class: "wysiwyg"
1079
- }, null, 8, ["markdown"])]), T(s, {
1080
- type: "submit",
1081
- modifiers: "primary",
1082
- loading: e.loading,
1083
- disabled: e.loading || e.readonly,
1084
- "icon-position": "right",
1085
- class: "shrink-0",
1086
- label: D(r)("action.submit")
1087
- }, null, 8, [
1088
- "loading",
1089
- "disabled",
1090
- "label"
1091
- ])])
1092
- ]),
1093
- _: 1
1094
- }, 8, ["modelValue", "readonly"])]))]),
1095
- _: 1
1096
- })]);
1097
- };
1098
- }
1099
- }), Je = /* @__PURE__ */ e({ default: () => Ye }), Ye = qe;
1100
- //#endregion
1101
- export { W as a, H as c, Fe as i, oe as l, Je as n, U as o, Ie as r, se as s, Ye as t, V as u };
1102
-
1103
- //# sourceMappingURL=PkToolShowContactForm-6C4uWDtf.js.map