@encatch/ws-react 0.0.14 → 0.0.15

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.
@@ -1,5 +1,5 @@
1
1
  import C, { useState as $, useEffect as U, useCallback as ne } from "react";
2
- var w = { exports: {} }, h = {};
2
+ var k = { exports: {} }, h = {};
3
3
  /**
4
4
  * @license React
5
5
  * react-jsx-runtime.production.js
@@ -14,24 +14,24 @@ function oe() {
14
14
  if (q) return h;
15
15
  q = 1;
16
16
  var t = Symbol.for("react.transitional.element"), l = Symbol.for("react.fragment");
17
- function f(d, c, i) {
17
+ function f(d, c, u) {
18
18
  var m = null;
19
- if (i !== void 0 && (m = "" + i), c.key !== void 0 && (m = "" + c.key), "key" in c) {
20
- i = {};
21
- for (var p in c)
22
- p !== "key" && (i[p] = c[p]);
23
- } else i = c;
24
- return c = i.ref, {
19
+ if (u !== void 0 && (m = "" + u), c.key !== void 0 && (m = "" + c.key), "key" in c) {
20
+ u = {};
21
+ for (var R in c)
22
+ R !== "key" && (u[R] = c[R]);
23
+ } else u = c;
24
+ return c = u.ref, {
25
25
  $$typeof: t,
26
26
  type: d,
27
27
  key: m,
28
28
  ref: c !== void 0 ? c : null,
29
- props: i
29
+ props: u
30
30
  };
31
31
  }
32
32
  return h.Fragment = l, h.jsx = f, h.jsxs = f, h;
33
33
  }
34
- var T = {};
34
+ var g = {};
35
35
  /**
36
36
  * @license React
37
37
  * react-jsx-runtime.development.js
@@ -60,7 +60,7 @@ function ae() {
60
60
  return "Suspense";
61
61
  case Q:
62
62
  return "SuspenseList";
63
- case K:
63
+ case D:
64
64
  return "Activity";
65
65
  }
66
66
  if (typeof e == "object")
@@ -76,7 +76,7 @@ function ae() {
76
76
  case H:
77
77
  var r = e.render;
78
78
  return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
79
- case D:
79
+ case K:
80
80
  return r = e.displayName || null, r !== null ? r : t(e.type) || "Memo";
81
81
  case x:
82
82
  r = e._payload, e = e._init;
@@ -119,10 +119,10 @@ function ae() {
119
119
  }
120
120
  }
121
121
  function c() {
122
- var e = k.A;
122
+ var e = S.A;
123
123
  return e === null ? null : e.getOwner();
124
124
  }
125
- function i() {
125
+ function u() {
126
126
  return Error("react-stack-top-frame");
127
127
  }
128
128
  function m(e) {
@@ -132,7 +132,7 @@ function ae() {
132
132
  }
133
133
  return e.key !== void 0;
134
134
  }
135
- function p(e, r) {
135
+ function R(e, r) {
136
136
  function o() {
137
137
  I || (I = !0, console.error(
138
138
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
@@ -144,22 +144,22 @@ function ae() {
144
144
  configurable: !0
145
145
  });
146
146
  }
147
- function v() {
147
+ function p() {
148
148
  var e = t(this.type);
149
149
  return Y[e] || (Y[e] = !0, console.error(
150
150
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
151
151
  )), e = this.props.ref, e !== void 0 ? e : null;
152
152
  }
153
- function R(e, r, o, a, E, u, O, A) {
154
- return o = u.ref, e = {
153
+ function v(e, r, o, a, E, i, O, A) {
154
+ return o = i.ref, e = {
155
155
  $$typeof: j,
156
156
  type: e,
157
157
  key: r,
158
- props: u,
158
+ props: i,
159
159
  _owner: E
160
160
  }, (o !== void 0 ? o : null) !== null ? Object.defineProperty(e, "ref", {
161
161
  enumerable: !1,
162
- get: v
162
+ get: p
163
163
  }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
164
164
  configurable: !1,
165
165
  enumerable: !1,
@@ -182,7 +182,7 @@ function ae() {
182
182
  value: A
183
183
  }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
184
184
  }
185
- function g(e, r, o, a, E, u, O, A) {
185
+ function T(e, r, o, a, E, i, O, A) {
186
186
  var s = r.children;
187
187
  if (s !== void 0)
188
188
  if (a)
@@ -218,13 +218,13 @@ React keys must be passed directly to JSX without using spread:
218
218
  for (var y in r)
219
219
  y !== "key" && (o[y] = r[y]);
220
220
  } else o = r;
221
- return s && p(
221
+ return s && R(
222
222
  o,
223
223
  typeof e == "function" ? e.displayName || e.name || "Unknown" : e
224
- ), R(
224
+ ), v(
225
225
  e,
226
226
  s,
227
- u,
227
+ i,
228
228
  E,
229
229
  c(),
230
230
  o,
@@ -235,7 +235,7 @@ React keys must be passed directly to JSX without using spread:
235
235
  function n(e) {
236
236
  typeof e == "object" && e !== null && e.$$typeof === j && e._store && (e._store.validated = 1);
237
237
  }
238
- var b = C, j = Symbol.for("react.transitional.element"), z = Symbol.for("react.portal"), P = Symbol.for("react.fragment"), V = Symbol.for("react.strict_mode"), G = Symbol.for("react.profiler"), X = Symbol.for("react.consumer"), B = Symbol.for("react.context"), H = Symbol.for("react.forward_ref"), Z = Symbol.for("react.suspense"), Q = Symbol.for("react.suspense_list"), D = Symbol.for("react.memo"), x = Symbol.for("react.lazy"), K = Symbol.for("react.activity"), ee = Symbol.for("react.client.reference"), k = b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, N = Object.prototype.hasOwnProperty, re = Array.isArray, S = console.createTask ? console.createTask : function() {
238
+ var b = C, j = Symbol.for("react.transitional.element"), z = Symbol.for("react.portal"), P = Symbol.for("react.fragment"), V = Symbol.for("react.strict_mode"), G = Symbol.for("react.profiler"), X = Symbol.for("react.consumer"), B = Symbol.for("react.context"), H = Symbol.for("react.forward_ref"), Z = Symbol.for("react.suspense"), Q = Symbol.for("react.suspense_list"), K = Symbol.for("react.memo"), x = Symbol.for("react.lazy"), D = Symbol.for("react.activity"), ee = Symbol.for("react.client.reference"), S = b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, N = Object.prototype.hasOwnProperty, re = Array.isArray, w = console.createTask ? console.createTask : function() {
239
239
  return null;
240
240
  };
241
241
  b = {
@@ -243,40 +243,40 @@ React keys must be passed directly to JSX without using spread:
243
243
  return e();
244
244
  }
245
245
  };
246
- var I, Y = {}, M = b.react_stack_bottom_frame.bind(
246
+ var I, Y = {}, L = b.react_stack_bottom_frame.bind(
247
247
  b,
248
- i
249
- )(), L = S(d(i)), F = {};
250
- T.Fragment = P, T.jsx = function(e, r, o, a, E) {
251
- var u = 1e4 > k.recentlyCreatedOwnerStacks++;
252
- return g(
248
+ u
249
+ )(), M = w(d(u)), F = {};
250
+ g.Fragment = P, g.jsx = function(e, r, o, a, E) {
251
+ var i = 1e4 > S.recentlyCreatedOwnerStacks++;
252
+ return T(
253
253
  e,
254
254
  r,
255
255
  o,
256
256
  !1,
257
257
  a,
258
258
  E,
259
- u ? Error("react-stack-top-frame") : M,
260
- u ? S(d(e)) : L
259
+ i ? Error("react-stack-top-frame") : L,
260
+ i ? w(d(e)) : M
261
261
  );
262
- }, T.jsxs = function(e, r, o, a, E) {
263
- var u = 1e4 > k.recentlyCreatedOwnerStacks++;
264
- return g(
262
+ }, g.jsxs = function(e, r, o, a, E) {
263
+ var i = 1e4 > S.recentlyCreatedOwnerStacks++;
264
+ return T(
265
265
  e,
266
266
  r,
267
267
  o,
268
268
  !0,
269
269
  a,
270
270
  E,
271
- u ? Error("react-stack-top-frame") : M,
272
- u ? S(d(e)) : L
271
+ i ? Error("react-stack-top-frame") : L,
272
+ i ? w(d(e)) : M
273
273
  );
274
274
  };
275
- })()), T;
275
+ })()), g;
276
276
  }
277
277
  var J;
278
278
  function se() {
279
- return J || (J = 1, process.env.NODE_ENV === "production" ? w.exports = oe() : w.exports = ae()), w.exports;
279
+ return J || (J = 1, process.env.NODE_ENV === "production" ? k.exports = oe() : k.exports = ae()), k.exports;
280
280
  }
281
281
  var ce = se();
282
282
  typeof window < "u" && import("./web-form-engine-core.umd-B1xHitkx.js").then((t) => t.w).then(({ EncatchAppElement: t }) => {
@@ -286,13 +286,13 @@ typeof window < "u" && import("./web-form-engine-core.umd-B1xHitkx.js").then((t)
286
286
  console.debug("Custom element registration:", l);
287
287
  }
288
288
  });
289
- const ue = ({
289
+ const ie = ({
290
290
  formData: t,
291
291
  cssLink: l,
292
292
  scale: f = 100,
293
293
  persistMode: d = "none"
294
294
  }) => {
295
- const [c, i] = $(!1), [m, p] = $(!0), v = C.useRef(null), R = C.useRef(
295
+ const [c, u] = $(!1), [m, R] = $(!0), p = C.useRef(null), v = C.useRef(
296
296
  null
297
297
  );
298
298
  U(() => {
@@ -302,25 +302,22 @@ const ue = ({
302
302
  } catch (b) {
303
303
  return console.error("[EncatchPreview] Error during data validation:", b), !1;
304
304
  }
305
- })() ? (i(!0), console.log("[EncatchPreview] Data is ready, rendering web component")) : console.warn(
305
+ })() ? u(!0) : console.warn(
306
306
  "[EncatchPreview] Data validation failed, retrying in 100ms..."
307
307
  );
308
308
  }, [t]);
309
- const g = ne(() => {
310
- console.log("[EncatchPreview] Close triggered, unmounting component"), t.onClose && t.onClose(), p(!1);
309
+ const T = ne(() => {
310
+ t.onClose && t.onClose(), R(!1);
311
311
  }, [t.onClose]);
312
312
  return U(() => {
313
- if (!c || !v.current)
313
+ if (!c || !p.current)
314
314
  return;
315
- console.log(
316
- "[EncatchPreview] Creating web component imperatively with properties"
317
- );
318
315
  const n = document.createElement("encatch-app");
319
- return n.theme = t.theme, n.currentMode = t.currentMode, n.currentLanguage = t.currentLanguage, n.questions = t.questions, n.questionLanguages = t.questionLanguages, n.otherConfigurationProperties = t.otherConfigurationProperties, n.welcomeScreenProperties = t.welcomeScreenProperties, n.endScreenProperties = t.endScreenProperties, n.translations = t.translations, n.sections = t.sections, n.themeSettings = t.themeSettings, n.onClose = g, n.onSectionChange = t.onSectionChange, n.apiKey = t.apiKey, n.hostUrl = t.hostUrl, n.feedbackConfigId = t.feedbackConfigId, n.identifier = t.identifier, n.cssLink = l, n.scale = f, n.persistMode = d, console.log("[EncatchPreview] All properties set, now adding to DOM"), R.current = n, v.current.appendChild(n), () => {
320
- console.log("[EncatchPreview] Unmounting web component"), v.current && R.current && v.current.removeChild(R.current), R.current = null;
316
+ return n.theme = t.theme, n.currentMode = t.currentMode, n.currentLanguage = t.currentLanguage, n.questions = t.questions, n.questionLanguages = t.questionLanguages, n.otherConfigurationProperties = t.otherConfigurationProperties, n.welcomeScreenProperties = t.welcomeScreenProperties, n.endScreenProperties = t.endScreenProperties, n.translations = t.translations, n.sections = t.sections, n.themeSettings = t.themeSettings, n.onClose = T, n.onSectionChange = t.onSectionChange, n.apiKey = t.apiKey, n.hostUrl = t.hostUrl, n.feedbackConfigId = t.feedbackConfigId, n.identifier = t.identifier, n.cssLink = l, n.scale = f, n.persistMode = d, v.current = n, p.current.appendChild(n), () => {
317
+ p.current && v.current && p.current.removeChild(v.current), v.current = null;
321
318
  };
322
- }, [c, t, l, f, g, d]), m ? /* @__PURE__ */ ce.jsx("div", { ref: v }) : null;
319
+ }, [c, t, l, f, T, d]), m ? /* @__PURE__ */ ce.jsx("div", { ref: p }) : null;
323
320
  };
324
321
  export {
325
- ue as EncatchPreview
322
+ ie as EncatchPreview
326
323
  };
@@ -19,7 +19,7 @@
19
19
  <%s {...props} />
20
20
  React keys must be passed directly to JSX without using spread:
21
21
  let props = %s;
22
- <%s key={someKey} {...props} />`,Lt,Yt,Zt,Yt),io[Yt+Lt]=!0)}if(Yt=null,jt!==void 0&&(o(jt),Yt=""+jt),f(Ve)&&(o(Ve.key),Yt=""+Ve.key),"key"in Ve){jt={};for(var Qn in Ve)Qn!=="key"&&(jt[Qn]=Ve[Qn])}else jt=Ve;return Yt&&k(jt,typeof ve=="function"?ve.displayName||ve.name||"Unknown":ve),B(ve,Yt,Tr,gt,t(),jt,Gn,vi)}function K(ve){typeof ve=="object"&&ve!==null&&ve.$$typeof===ye&&ve._store&&(ve._store.validated=1)}var Re=zr,ye=Symbol.for("react.transitional.element"),H=Symbol.for("react.portal"),Ne=Symbol.for("react.fragment"),De=Symbol.for("react.strict_mode"),pt=Symbol.for("react.profiler"),ut=Symbol.for("react.consumer"),dt=Symbol.for("react.context"),bt=Symbol.for("react.forward_ref"),lr=Symbol.for("react.suspense"),Br=Symbol.for("react.suspense_list"),Ft=Symbol.for("react.memo"),va=Symbol.for("react.lazy"),rl=Symbol.for("react.activity"),ha=Symbol.for("react.client.reference"),ro=Re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,yn=Object.prototype.hasOwnProperty,nl=Array.isArray,Fn=console.createTask?console.createTask:function(){return null};Re={react_stack_bottom_frame:function(ve){return ve()}};var Wn,Yr={},jr=Re.react_stack_bottom_frame.bind(Re,a)(),no=Fn(s(a)),io={};Ci.Fragment=Ne,Ci.jsx=function(ve,Ve,jt,Lt,gt){var Tr=1e4>ro.recentlyCreatedOwnerStacks++;return me(ve,Ve,jt,!1,Lt,gt,Tr?Error("react-stack-top-frame"):jr,Tr?Fn(s(ve)):no)},Ci.jsxs=function(ve,Ve,jt,Lt,gt){var Tr=1e4>ro.recentlyCreatedOwnerStacks++;return me(ve,Ve,jt,!0,Lt,gt,Tr?Error("react-stack-top-frame"):jr,Tr?Fn(s(ve)):no)}})()),Ci}var sc;function Ab(){return sc||(sc=1,process.env.NODE_ENV==="production"?zo.exports=Ub():zo.exports=Lb()),zo.exports}var Zb=Ab();typeof window<"u"&&Promise.resolve().then(()=>jk).then(({EncatchAppElement:e})=>{try{customElements.get("encatch-app")||customElements.define("encatch-app",e)}catch(r){console.debug("Custom element registration:",r)}});const Rb=({formData:e,cssLink:r,scale:o=100,persistMode:s="none"})=>{const[t,a]=zr.useState(!1),[f,k]=zr.useState(!0),R=zr.useRef(null),B=zr.useRef(null);zr.useEffect(()=>{(()=>{try{return e?!0:(console.warn("[EncatchPreview] formData is not defined"),!1)}catch(Re){return console.error("[EncatchPreview] Error during data validation:",Re),!1}})()?(a(!0),console.log("[EncatchPreview] Data is ready, rendering web component")):console.warn("[EncatchPreview] Data validation failed, retrying in 100ms...")},[e]);const me=zr.useCallback(()=>{console.log("[EncatchPreview] Close triggered, unmounting component"),e.onClose&&e.onClose(),k(!1)},[e.onClose]);return zr.useEffect(()=>{if(!t||!R.current)return;console.log("[EncatchPreview] Creating web component imperatively with properties");const K=document.createElement("encatch-app");return K.theme=e.theme,K.currentMode=e.currentMode,K.currentLanguage=e.currentLanguage,K.questions=e.questions,K.questionLanguages=e.questionLanguages,K.otherConfigurationProperties=e.otherConfigurationProperties,K.welcomeScreenProperties=e.welcomeScreenProperties,K.endScreenProperties=e.endScreenProperties,K.translations=e.translations,K.sections=e.sections,K.themeSettings=e.themeSettings,K.onClose=me,K.onSectionChange=e.onSectionChange,K.apiKey=e.apiKey,K.hostUrl=e.hostUrl,K.feedbackConfigId=e.feedbackConfigId,K.identifier=e.identifier,K.cssLink=r,K.scale=o,K.persistMode=s,console.log("[EncatchPreview] All properties set, now adding to DOM"),B.current=K,R.current.appendChild(K),()=>{console.log("[EncatchPreview] Unmounting web component"),R.current&&B.current&&R.current.removeChild(B.current),B.current=null}},[t,e,r,o,me,s]),f?Zb.jsx("div",{ref:R}):null};var Mi={exports:{}};const uc=Object.freeze({status:"aborted"});function M(e,r,o){function s(k,R){var B;Object.defineProperty(k,"_zod",{value:k._zod??{},enumerable:!1}),(B=k._zod).traits??(B.traits=new Set),k._zod.traits.add(e),r(k,R);for(const me in f.prototype)me in k||Object.defineProperty(k,me,{value:f.prototype[me].bind(k)});k._zod.constr=f,k._zod.def=R}const t=o?.Parent??Object;class a extends t{}Object.defineProperty(a,"name",{value:e});function f(k){var R;const B=o?.Parent?new a:this;s(B,k),(R=B._zod).deferred??(R.deferred=[]);for(const me of B._zod.deferred)me();return B}return Object.defineProperty(f,"init",{value:s}),Object.defineProperty(f,Symbol.hasInstance,{value:k=>o?.Parent&&k instanceof o.Parent?!0:k?._zod?.traits?.has(e)}),Object.defineProperty(f,"name",{value:e}),f}const lc=Symbol("zod_brand");class Cn extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class No extends Error{constructor(r){super(`Encountered unidirectional transform during encode: ${r}`),this.name="ZodEncodeError"}}const jo={};function ur(e){return e&&Object.assign(jo,e),jo}function qb(e){return e}function Fb(e){return e}function Wb(e){}function Gb(e){throw new Error}function Qb(e){}function Ja(e){const r=Object.values(e).filter(s=>typeof s=="number");return Object.entries(e).filter(([s,t])=>r.indexOf(+s)===-1).map(([s,t])=>t)}function he(e,r="|"){return e.map(o=>We(o)).join(r)}function To(e,r){return typeof r=="bigint"?r.toString():r}function Di(e){return{get value(){{const r=e();return Object.defineProperty(this,"value",{value:r}),r}}}}function Mn(e){return e==null}function Oo(e){const r=e.startsWith("^")?1:0,o=e.endsWith("$")?e.length-1:e.length;return e.slice(r,o)}function cc(e,r){const o=(e.toString().split(".")[1]||"").length,s=r.toString();let t=(s.split(".")[1]||"").length;if(t===0&&/\d?e-\d?/.test(s)){const R=s.match(/\d?e-(\d?)/);R?.[1]&&(t=Number.parseInt(R[1]))}const a=o>t?o:t,f=Number.parseInt(e.toFixed(a).replace(".","")),k=Number.parseInt(r.toFixed(a).replace(".",""));return f%k/10**a}const dc=Symbol("evaluating");function ot(e,r,o){let s;Object.defineProperty(e,r,{get(){if(s!==dc)return s===void 0&&(s=dc,s=o()),s},set(t){Object.defineProperty(e,r,{value:t})},configurable:!0})}function Eo(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Ur(e,r,o){Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0})}function hn(...e){const r={};for(const o of e){const s=Object.getOwnPropertyDescriptors(o);Object.assign(r,s)}return Object.defineProperties({},r)}function Jb(e){return hn(e._zod.def)}function Vb(e,r){return r?r.reduce((o,s)=>o?.[s],e):e}function Bb(e){const r=Object.keys(e),o=r.map(s=>e[s]);return Promise.all(o).then(s=>{const t={};for(let a=0;a<r.length;a++)t[r[a]]=s[a];return t})}function Yb(e=10){const r="abcdefghijklmnopqrstuvwxyz";let o="";for(let s=0;s<e;s++)o+=r[Math.floor(Math.random()*r.length)];return o}function Va(e){return JSON.stringify(e)}const Ba="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ci(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const fc=Di(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Dn(e){if(ci(e)===!1)return!1;const r=e.constructor;if(r===void 0)return!0;const o=r.prototype;return!(ci(o)===!1||Object.prototype.hasOwnProperty.call(o,"isPrototypeOf")===!1)}function Po(e){return Dn(e)?{...e}:Array.isArray(e)?[...e]:e}function Kb(e){let r=0;for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&r++;return r}const Hb=e=>{const r=typeof e;switch(r){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${r}`)}},Co=new Set(["string","number","symbol"]),mc=new Set(["string","number","bigint","boolean","symbol","undefined"]);function bn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Nr(e,r,o){const s=new e._zod.constr(r??e._zod.def);return(!r||o?.parent)&&(s._zod.parent=e),s}function ue(e){const r=e;if(!r)return{};if(typeof r=="string")return{error:()=>r};if(r?.message!==void 0){if(r?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");r.error=r.message}return delete r.message,typeof r.error=="string"?{...r,error:()=>r.error}:r}function Xb(e){let r;return new Proxy({},{get(o,s,t){return r??(r=e()),Reflect.get(r,s,t)},set(o,s,t,a){return r??(r=e()),Reflect.set(r,s,t,a)},has(o,s){return r??(r=e()),Reflect.has(r,s)},deleteProperty(o,s){return r??(r=e()),Reflect.deleteProperty(r,s)},ownKeys(o){return r??(r=e()),Reflect.ownKeys(r)},getOwnPropertyDescriptor(o,s){return r??(r=e()),Reflect.getOwnPropertyDescriptor(r,s)},defineProperty(o,s,t){return r??(r=e()),Reflect.defineProperty(r,s,t)}})}function We(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function pc(e){return Object.keys(e).filter(r=>e[r]._zod.optin==="optional"&&e[r]._zod.optout==="optional")}const gc={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},vc={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function hc(e,r){const o=e._zod.def,s=hn(e._zod.def,{get shape(){const t={};for(const a in r){if(!(a in o.shape))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(t[a]=o.shape[a])}return Ur(this,"shape",t),t},checks:[]});return Nr(e,s)}function bc(e,r){const o=e._zod.def,s=hn(e._zod.def,{get shape(){const t={...e._zod.def.shape};for(const a in r){if(!(a in o.shape))throw new Error(`Unrecognized key: "${a}"`);r[a]&&delete t[a]}return Ur(this,"shape",t),t},checks:[]});return Nr(e,s)}function yc(e,r){if(!Dn(r))throw new Error("Invalid input to extend: expected a plain object");const o=e._zod.def.checks;if(o&&o.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const t=hn(e._zod.def,{get shape(){const a={...e._zod.def.shape,...r};return Ur(this,"shape",a),a},checks:[]});return Nr(e,t)}function $c(e,r){if(!Dn(r))throw new Error("Invalid input to safeExtend: expected a plain object");const o={...e._zod.def,get shape(){const s={...e._zod.def.shape,...r};return Ur(this,"shape",s),s},checks:e._zod.def.checks};return Nr(e,o)}function wc(e,r){const o=hn(e._zod.def,{get shape(){const s={...e._zod.def.shape,...r._zod.def.shape};return Ur(this,"shape",s),s},get catchall(){return r._zod.def.catchall},checks:[]});return Nr(e,o)}function _c(e,r,o){const s=hn(r._zod.def,{get shape(){const t=r._zod.def.shape,a={...t};if(o)for(const f in o){if(!(f in t))throw new Error(`Unrecognized key: "${f}"`);o[f]&&(a[f]=e?new e({type:"optional",innerType:t[f]}):t[f])}else for(const f in t)a[f]=e?new e({type:"optional",innerType:t[f]}):t[f];return Ur(this,"shape",a),a},checks:[]});return Nr(r,s)}function kc(e,r,o){const s=hn(r._zod.def,{get shape(){const t=r._zod.def.shape,a={...t};if(o)for(const f in o){if(!(f in a))throw new Error(`Unrecognized key: "${f}"`);o[f]&&(a[f]=new e({type:"nonoptional",innerType:t[f]}))}else for(const f in t)a[f]=new e({type:"nonoptional",innerType:t[f]});return Ur(this,"shape",a),a},checks:[]});return Nr(r,s)}function Un(e,r=0){if(e.aborted===!0)return!0;for(let o=r;o<e.issues.length;o++)if(e.issues[o]?.continue!==!0)return!0;return!1}function Lr(e,r){return r.map(o=>{var s;return(s=o).path??(s.path=[]),o.path.unshift(e),o})}function Ui(e){return typeof e=="string"?e:e?.message}function Ar(e,r,o){const s={...e,path:e.path??[]};if(!e.message){const t=Ui(e.inst?._zod.def?.error?.(e))??Ui(r?.error?.(e))??Ui(o.customError?.(e))??Ui(o.localeError?.(e))??"Invalid input";s.message=t}return delete s.inst,delete s.continue,r?.reportInput||delete s.input,s}function Mo(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Do(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function di(...e){const[r,o,s]=e;return typeof r=="string"?{message:r,code:"custom",input:o,inst:s}:{...r}}function ey(e){return Object.entries(e).filter(([r,o])=>Number.isNaN(Number.parseInt(r,10))).map(r=>r[1])}function xc(e){const r=atob(e),o=new Uint8Array(r.length);for(let s=0;s<r.length;s++)o[s]=r.charCodeAt(s);return o}function Sc(e){let r="";for(let o=0;o<e.length;o++)r+=String.fromCharCode(e[o]);return btoa(r)}function ty(e){const r=e.replace(/-/g,"+").replace(/_/g,"/"),o="=".repeat((4-r.length%4)%4);return xc(r+o)}function ry(e){return Sc(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function ny(e){const r=e.replace(/^0x/,"");if(r.length%2!==0)throw new Error("Invalid hex string length");const o=new Uint8Array(r.length/2);for(let s=0;s<r.length;s+=2)o[s/2]=Number.parseInt(r.slice(s,s+2),16);return o}function iy(e){return Array.from(e).map(r=>r.toString(16).padStart(2,"0")).join("")}class oy{constructor(...r){}}const Ic=Object.freeze(Object.defineProperty({__proto__:null,BIGINT_FORMAT_RANGES:vc,Class:oy,NUMBER_FORMAT_RANGES:gc,aborted:Un,allowsEval:fc,assert:Qb,assertEqual:qb,assertIs:Wb,assertNever:Gb,assertNotEqual:Fb,assignProp:Ur,base64ToUint8Array:xc,base64urlToUint8Array:ty,cached:Di,captureStackTrace:Ba,cleanEnum:ey,cleanRegex:Oo,clone:Nr,cloneDef:Jb,createTransparentProxy:Xb,defineLazy:ot,esc:Va,escapeRegex:bn,extend:yc,finalizeIssue:Ar,floatSafeRemainder:cc,getElementAtPath:Vb,getEnumValues:Ja,getLengthableOrigin:Do,getParsedType:Hb,getSizableOrigin:Mo,hexToUint8Array:ny,isObject:ci,isPlainObject:Dn,issue:di,joinValues:he,jsonStringifyReplacer:To,merge:wc,mergeDefs:hn,normalizeParams:ue,nullish:Mn,numKeys:Kb,objectClone:Eo,omit:bc,optionalKeys:pc,partial:_c,pick:hc,prefixIssues:Lr,primitiveTypes:mc,promiseAllObject:Bb,propertyKeyTypes:Co,randomString:Yb,required:kc,safeExtend:$c,shallowClone:Po,stringifyPrimitive:We,uint8ArrayToBase64:Sc,uint8ArrayToBase64url:ry,uint8ArrayToHex:iy,unwrapMessage:Ui},Symbol.toStringTag,{value:"Module"})),zc=(e,r)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:r,enumerable:!1}),e.message=JSON.stringify(r,To,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ya=M("$ZodError",zc),hr=M("$ZodError",zc,{Parent:Error});function Ka(e,r=o=>o.message){const o={},s=[];for(const t of e.issues)t.path.length>0?(o[t.path[0]]=o[t.path[0]]||[],o[t.path[0]].push(r(t))):s.push(r(t));return{formErrors:s,fieldErrors:o}}function Ha(e,r){const o=r||function(a){return a.message},s={_errors:[]},t=a=>{for(const f of a.issues)if(f.code==="invalid_union"&&f.errors.length)f.errors.map(k=>t({issues:k}));else if(f.code==="invalid_key")t({issues:f.issues});else if(f.code==="invalid_element")t({issues:f.issues});else if(f.path.length===0)s._errors.push(o(f));else{let k=s,R=0;for(;R<f.path.length;){const B=f.path[R];R===f.path.length-1?(k[B]=k[B]||{_errors:[]},k[B]._errors.push(o(f))):k[B]=k[B]||{_errors:[]},k=k[B],R++}}};return t(e),s}function Nc(e,r){const o=r||function(a){return a.message},s={errors:[]},t=(a,f=[])=>{var k,R;for(const B of a.issues)if(B.code==="invalid_union"&&B.errors.length)B.errors.map(me=>t({issues:me},B.path));else if(B.code==="invalid_key")t({issues:B.issues},B.path);else if(B.code==="invalid_element")t({issues:B.issues},B.path);else{const me=[...f,...B.path];if(me.length===0){s.errors.push(o(B));continue}let K=s,Re=0;for(;Re<me.length;){const ye=me[Re],H=Re===me.length-1;typeof ye=="string"?(K.properties??(K.properties={}),(k=K.properties)[ye]??(k[ye]={errors:[]}),K=K.properties[ye]):(K.items??(K.items=[]),(R=K.items)[ye]??(R[ye]={errors:[]}),K=K.items[ye]),H&&K.errors.push(o(B)),Re++}}};return t(e),s}function jc(e){const r=[],o=e.map(s=>typeof s=="object"?s.key:s);for(const s of o)typeof s=="number"?r.push(`[${s}]`):typeof s=="symbol"?r.push(`[${JSON.stringify(String(s))}]`):/[^\w$]/.test(s)?r.push(`[${JSON.stringify(s)}]`):(r.length&&r.push("."),r.push(s));return r.join("")}function Tc(e){const r=[],o=[...e.issues].sort((s,t)=>(s.path??[]).length-(t.path??[]).length);for(const s of o)r.push(`✖ ${s.message}`),s.path?.length&&r.push(` → at ${jc(s.path)}`);return r.join(`
22
+ <%s key={someKey} {...props} />`,Lt,Yt,Zt,Yt),io[Yt+Lt]=!0)}if(Yt=null,jt!==void 0&&(o(jt),Yt=""+jt),f(Ve)&&(o(Ve.key),Yt=""+Ve.key),"key"in Ve){jt={};for(var Qn in Ve)Qn!=="key"&&(jt[Qn]=Ve[Qn])}else jt=Ve;return Yt&&k(jt,typeof ve=="function"?ve.displayName||ve.name||"Unknown":ve),B(ve,Yt,Tr,gt,t(),jt,Gn,vi)}function K(ve){typeof ve=="object"&&ve!==null&&ve.$$typeof===ye&&ve._store&&(ve._store.validated=1)}var Re=zr,ye=Symbol.for("react.transitional.element"),H=Symbol.for("react.portal"),Ne=Symbol.for("react.fragment"),De=Symbol.for("react.strict_mode"),pt=Symbol.for("react.profiler"),ut=Symbol.for("react.consumer"),dt=Symbol.for("react.context"),bt=Symbol.for("react.forward_ref"),lr=Symbol.for("react.suspense"),Br=Symbol.for("react.suspense_list"),Ft=Symbol.for("react.memo"),va=Symbol.for("react.lazy"),rl=Symbol.for("react.activity"),ha=Symbol.for("react.client.reference"),ro=Re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,yn=Object.prototype.hasOwnProperty,nl=Array.isArray,Fn=console.createTask?console.createTask:function(){return null};Re={react_stack_bottom_frame:function(ve){return ve()}};var Wn,Yr={},jr=Re.react_stack_bottom_frame.bind(Re,a)(),no=Fn(s(a)),io={};Ci.Fragment=Ne,Ci.jsx=function(ve,Ve,jt,Lt,gt){var Tr=1e4>ro.recentlyCreatedOwnerStacks++;return me(ve,Ve,jt,!1,Lt,gt,Tr?Error("react-stack-top-frame"):jr,Tr?Fn(s(ve)):no)},Ci.jsxs=function(ve,Ve,jt,Lt,gt){var Tr=1e4>ro.recentlyCreatedOwnerStacks++;return me(ve,Ve,jt,!0,Lt,gt,Tr?Error("react-stack-top-frame"):jr,Tr?Fn(s(ve)):no)}})()),Ci}var sc;function Ab(){return sc||(sc=1,process.env.NODE_ENV==="production"?zo.exports=Ub():zo.exports=Lb()),zo.exports}var Zb=Ab();typeof window<"u"&&Promise.resolve().then(()=>jk).then(({EncatchAppElement:e})=>{try{customElements.get("encatch-app")||customElements.define("encatch-app",e)}catch(r){console.debug("Custom element registration:",r)}});const Rb=({formData:e,cssLink:r,scale:o=100,persistMode:s="none"})=>{const[t,a]=zr.useState(!1),[f,k]=zr.useState(!0),R=zr.useRef(null),B=zr.useRef(null);zr.useEffect(()=>{(()=>{try{return e?!0:(console.warn("[EncatchPreview] formData is not defined"),!1)}catch(Re){return console.error("[EncatchPreview] Error during data validation:",Re),!1}})()?a(!0):console.warn("[EncatchPreview] Data validation failed, retrying in 100ms...")},[e]);const me=zr.useCallback(()=>{e.onClose&&e.onClose(),k(!1)},[e.onClose]);return zr.useEffect(()=>{if(!t||!R.current)return;const K=document.createElement("encatch-app");return K.theme=e.theme,K.currentMode=e.currentMode,K.currentLanguage=e.currentLanguage,K.questions=e.questions,K.questionLanguages=e.questionLanguages,K.otherConfigurationProperties=e.otherConfigurationProperties,K.welcomeScreenProperties=e.welcomeScreenProperties,K.endScreenProperties=e.endScreenProperties,K.translations=e.translations,K.sections=e.sections,K.themeSettings=e.themeSettings,K.onClose=me,K.onSectionChange=e.onSectionChange,K.apiKey=e.apiKey,K.hostUrl=e.hostUrl,K.feedbackConfigId=e.feedbackConfigId,K.identifier=e.identifier,K.cssLink=r,K.scale=o,K.persistMode=s,B.current=K,R.current.appendChild(K),()=>{R.current&&B.current&&R.current.removeChild(B.current),B.current=null}},[t,e,r,o,me,s]),f?Zb.jsx("div",{ref:R}):null};var Mi={exports:{}};const uc=Object.freeze({status:"aborted"});function M(e,r,o){function s(k,R){var B;Object.defineProperty(k,"_zod",{value:k._zod??{},enumerable:!1}),(B=k._zod).traits??(B.traits=new Set),k._zod.traits.add(e),r(k,R);for(const me in f.prototype)me in k||Object.defineProperty(k,me,{value:f.prototype[me].bind(k)});k._zod.constr=f,k._zod.def=R}const t=o?.Parent??Object;class a extends t{}Object.defineProperty(a,"name",{value:e});function f(k){var R;const B=o?.Parent?new a:this;s(B,k),(R=B._zod).deferred??(R.deferred=[]);for(const me of B._zod.deferred)me();return B}return Object.defineProperty(f,"init",{value:s}),Object.defineProperty(f,Symbol.hasInstance,{value:k=>o?.Parent&&k instanceof o.Parent?!0:k?._zod?.traits?.has(e)}),Object.defineProperty(f,"name",{value:e}),f}const lc=Symbol("zod_brand");class Cn extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class No extends Error{constructor(r){super(`Encountered unidirectional transform during encode: ${r}`),this.name="ZodEncodeError"}}const jo={};function ur(e){return e&&Object.assign(jo,e),jo}function qb(e){return e}function Fb(e){return e}function Wb(e){}function Gb(e){throw new Error}function Qb(e){}function Ja(e){const r=Object.values(e).filter(s=>typeof s=="number");return Object.entries(e).filter(([s,t])=>r.indexOf(+s)===-1).map(([s,t])=>t)}function he(e,r="|"){return e.map(o=>We(o)).join(r)}function To(e,r){return typeof r=="bigint"?r.toString():r}function Di(e){return{get value(){{const r=e();return Object.defineProperty(this,"value",{value:r}),r}}}}function Mn(e){return e==null}function Oo(e){const r=e.startsWith("^")?1:0,o=e.endsWith("$")?e.length-1:e.length;return e.slice(r,o)}function cc(e,r){const o=(e.toString().split(".")[1]||"").length,s=r.toString();let t=(s.split(".")[1]||"").length;if(t===0&&/\d?e-\d?/.test(s)){const R=s.match(/\d?e-(\d?)/);R?.[1]&&(t=Number.parseInt(R[1]))}const a=o>t?o:t,f=Number.parseInt(e.toFixed(a).replace(".","")),k=Number.parseInt(r.toFixed(a).replace(".",""));return f%k/10**a}const dc=Symbol("evaluating");function ot(e,r,o){let s;Object.defineProperty(e,r,{get(){if(s!==dc)return s===void 0&&(s=dc,s=o()),s},set(t){Object.defineProperty(e,r,{value:t})},configurable:!0})}function Eo(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Ur(e,r,o){Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0})}function hn(...e){const r={};for(const o of e){const s=Object.getOwnPropertyDescriptors(o);Object.assign(r,s)}return Object.defineProperties({},r)}function Jb(e){return hn(e._zod.def)}function Vb(e,r){return r?r.reduce((o,s)=>o?.[s],e):e}function Bb(e){const r=Object.keys(e),o=r.map(s=>e[s]);return Promise.all(o).then(s=>{const t={};for(let a=0;a<r.length;a++)t[r[a]]=s[a];return t})}function Yb(e=10){const r="abcdefghijklmnopqrstuvwxyz";let o="";for(let s=0;s<e;s++)o+=r[Math.floor(Math.random()*r.length)];return o}function Va(e){return JSON.stringify(e)}const Ba="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ci(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const fc=Di(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Dn(e){if(ci(e)===!1)return!1;const r=e.constructor;if(r===void 0)return!0;const o=r.prototype;return!(ci(o)===!1||Object.prototype.hasOwnProperty.call(o,"isPrototypeOf")===!1)}function Po(e){return Dn(e)?{...e}:Array.isArray(e)?[...e]:e}function Kb(e){let r=0;for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&r++;return r}const Hb=e=>{const r=typeof e;switch(r){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${r}`)}},Co=new Set(["string","number","symbol"]),mc=new Set(["string","number","bigint","boolean","symbol","undefined"]);function bn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Nr(e,r,o){const s=new e._zod.constr(r??e._zod.def);return(!r||o?.parent)&&(s._zod.parent=e),s}function ue(e){const r=e;if(!r)return{};if(typeof r=="string")return{error:()=>r};if(r?.message!==void 0){if(r?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");r.error=r.message}return delete r.message,typeof r.error=="string"?{...r,error:()=>r.error}:r}function Xb(e){let r;return new Proxy({},{get(o,s,t){return r??(r=e()),Reflect.get(r,s,t)},set(o,s,t,a){return r??(r=e()),Reflect.set(r,s,t,a)},has(o,s){return r??(r=e()),Reflect.has(r,s)},deleteProperty(o,s){return r??(r=e()),Reflect.deleteProperty(r,s)},ownKeys(o){return r??(r=e()),Reflect.ownKeys(r)},getOwnPropertyDescriptor(o,s){return r??(r=e()),Reflect.getOwnPropertyDescriptor(r,s)},defineProperty(o,s,t){return r??(r=e()),Reflect.defineProperty(r,s,t)}})}function We(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function pc(e){return Object.keys(e).filter(r=>e[r]._zod.optin==="optional"&&e[r]._zod.optout==="optional")}const gc={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},vc={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function hc(e,r){const o=e._zod.def,s=hn(e._zod.def,{get shape(){const t={};for(const a in r){if(!(a in o.shape))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(t[a]=o.shape[a])}return Ur(this,"shape",t),t},checks:[]});return Nr(e,s)}function bc(e,r){const o=e._zod.def,s=hn(e._zod.def,{get shape(){const t={...e._zod.def.shape};for(const a in r){if(!(a in o.shape))throw new Error(`Unrecognized key: "${a}"`);r[a]&&delete t[a]}return Ur(this,"shape",t),t},checks:[]});return Nr(e,s)}function yc(e,r){if(!Dn(r))throw new Error("Invalid input to extend: expected a plain object");const o=e._zod.def.checks;if(o&&o.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const t=hn(e._zod.def,{get shape(){const a={...e._zod.def.shape,...r};return Ur(this,"shape",a),a},checks:[]});return Nr(e,t)}function $c(e,r){if(!Dn(r))throw new Error("Invalid input to safeExtend: expected a plain object");const o={...e._zod.def,get shape(){const s={...e._zod.def.shape,...r};return Ur(this,"shape",s),s},checks:e._zod.def.checks};return Nr(e,o)}function wc(e,r){const o=hn(e._zod.def,{get shape(){const s={...e._zod.def.shape,...r._zod.def.shape};return Ur(this,"shape",s),s},get catchall(){return r._zod.def.catchall},checks:[]});return Nr(e,o)}function _c(e,r,o){const s=hn(r._zod.def,{get shape(){const t=r._zod.def.shape,a={...t};if(o)for(const f in o){if(!(f in t))throw new Error(`Unrecognized key: "${f}"`);o[f]&&(a[f]=e?new e({type:"optional",innerType:t[f]}):t[f])}else for(const f in t)a[f]=e?new e({type:"optional",innerType:t[f]}):t[f];return Ur(this,"shape",a),a},checks:[]});return Nr(r,s)}function kc(e,r,o){const s=hn(r._zod.def,{get shape(){const t=r._zod.def.shape,a={...t};if(o)for(const f in o){if(!(f in a))throw new Error(`Unrecognized key: "${f}"`);o[f]&&(a[f]=new e({type:"nonoptional",innerType:t[f]}))}else for(const f in t)a[f]=new e({type:"nonoptional",innerType:t[f]});return Ur(this,"shape",a),a},checks:[]});return Nr(r,s)}function Un(e,r=0){if(e.aborted===!0)return!0;for(let o=r;o<e.issues.length;o++)if(e.issues[o]?.continue!==!0)return!0;return!1}function Lr(e,r){return r.map(o=>{var s;return(s=o).path??(s.path=[]),o.path.unshift(e),o})}function Ui(e){return typeof e=="string"?e:e?.message}function Ar(e,r,o){const s={...e,path:e.path??[]};if(!e.message){const t=Ui(e.inst?._zod.def?.error?.(e))??Ui(r?.error?.(e))??Ui(o.customError?.(e))??Ui(o.localeError?.(e))??"Invalid input";s.message=t}return delete s.inst,delete s.continue,r?.reportInput||delete s.input,s}function Mo(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Do(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function di(...e){const[r,o,s]=e;return typeof r=="string"?{message:r,code:"custom",input:o,inst:s}:{...r}}function ey(e){return Object.entries(e).filter(([r,o])=>Number.isNaN(Number.parseInt(r,10))).map(r=>r[1])}function xc(e){const r=atob(e),o=new Uint8Array(r.length);for(let s=0;s<r.length;s++)o[s]=r.charCodeAt(s);return o}function Sc(e){let r="";for(let o=0;o<e.length;o++)r+=String.fromCharCode(e[o]);return btoa(r)}function ty(e){const r=e.replace(/-/g,"+").replace(/_/g,"/"),o="=".repeat((4-r.length%4)%4);return xc(r+o)}function ry(e){return Sc(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function ny(e){const r=e.replace(/^0x/,"");if(r.length%2!==0)throw new Error("Invalid hex string length");const o=new Uint8Array(r.length/2);for(let s=0;s<r.length;s+=2)o[s/2]=Number.parseInt(r.slice(s,s+2),16);return o}function iy(e){return Array.from(e).map(r=>r.toString(16).padStart(2,"0")).join("")}class oy{constructor(...r){}}const Ic=Object.freeze(Object.defineProperty({__proto__:null,BIGINT_FORMAT_RANGES:vc,Class:oy,NUMBER_FORMAT_RANGES:gc,aborted:Un,allowsEval:fc,assert:Qb,assertEqual:qb,assertIs:Wb,assertNever:Gb,assertNotEqual:Fb,assignProp:Ur,base64ToUint8Array:xc,base64urlToUint8Array:ty,cached:Di,captureStackTrace:Ba,cleanEnum:ey,cleanRegex:Oo,clone:Nr,cloneDef:Jb,createTransparentProxy:Xb,defineLazy:ot,esc:Va,escapeRegex:bn,extend:yc,finalizeIssue:Ar,floatSafeRemainder:cc,getElementAtPath:Vb,getEnumValues:Ja,getLengthableOrigin:Do,getParsedType:Hb,getSizableOrigin:Mo,hexToUint8Array:ny,isObject:ci,isPlainObject:Dn,issue:di,joinValues:he,jsonStringifyReplacer:To,merge:wc,mergeDefs:hn,normalizeParams:ue,nullish:Mn,numKeys:Kb,objectClone:Eo,omit:bc,optionalKeys:pc,partial:_c,pick:hc,prefixIssues:Lr,primitiveTypes:mc,promiseAllObject:Bb,propertyKeyTypes:Co,randomString:Yb,required:kc,safeExtend:$c,shallowClone:Po,stringifyPrimitive:We,uint8ArrayToBase64:Sc,uint8ArrayToBase64url:ry,uint8ArrayToHex:iy,unwrapMessage:Ui},Symbol.toStringTag,{value:"Module"})),zc=(e,r)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:r,enumerable:!1}),e.message=JSON.stringify(r,To,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ya=M("$ZodError",zc),hr=M("$ZodError",zc,{Parent:Error});function Ka(e,r=o=>o.message){const o={},s=[];for(const t of e.issues)t.path.length>0?(o[t.path[0]]=o[t.path[0]]||[],o[t.path[0]].push(r(t))):s.push(r(t));return{formErrors:s,fieldErrors:o}}function Ha(e,r){const o=r||function(a){return a.message},s={_errors:[]},t=a=>{for(const f of a.issues)if(f.code==="invalid_union"&&f.errors.length)f.errors.map(k=>t({issues:k}));else if(f.code==="invalid_key")t({issues:f.issues});else if(f.code==="invalid_element")t({issues:f.issues});else if(f.path.length===0)s._errors.push(o(f));else{let k=s,R=0;for(;R<f.path.length;){const B=f.path[R];R===f.path.length-1?(k[B]=k[B]||{_errors:[]},k[B]._errors.push(o(f))):k[B]=k[B]||{_errors:[]},k=k[B],R++}}};return t(e),s}function Nc(e,r){const o=r||function(a){return a.message},s={errors:[]},t=(a,f=[])=>{var k,R;for(const B of a.issues)if(B.code==="invalid_union"&&B.errors.length)B.errors.map(me=>t({issues:me},B.path));else if(B.code==="invalid_key")t({issues:B.issues},B.path);else if(B.code==="invalid_element")t({issues:B.issues},B.path);else{const me=[...f,...B.path];if(me.length===0){s.errors.push(o(B));continue}let K=s,Re=0;for(;Re<me.length;){const ye=me[Re],H=Re===me.length-1;typeof ye=="string"?(K.properties??(K.properties={}),(k=K.properties)[ye]??(k[ye]={errors:[]}),K=K.properties[ye]):(K.items??(K.items=[]),(R=K.items)[ye]??(R[ye]={errors:[]}),K=K.items[ye]),H&&K.errors.push(o(B)),Re++}}};return t(e),s}function jc(e){const r=[],o=e.map(s=>typeof s=="object"?s.key:s);for(const s of o)typeof s=="number"?r.push(`[${s}]`):typeof s=="symbol"?r.push(`[${JSON.stringify(String(s))}]`):/[^\w$]/.test(s)?r.push(`[${JSON.stringify(s)}]`):(r.length&&r.push("."),r.push(s));return r.join("")}function Tc(e){const r=[],o=[...e.issues].sort((s,t)=>(s.path??[]).length-(t.path??[]).length);for(const s of o)r.push(`✖ ${s.message}`),s.path?.length&&r.push(` → at ${jc(s.path)}`);return r.join(`
23
23
  `)}const Li=e=>(r,o,s,t)=>{const a=s?Object.assign(s,{async:!1}):{async:!1},f=r._zod.run({value:o,issues:[]},a);if(f instanceof Promise)throw new Cn;if(f.issues.length){const k=new(t?.Err??e)(f.issues.map(R=>Ar(R,a,ur())));throw Ba(k,t?.callee),k}return f.value},Xa=Li(hr),Ai=e=>async(r,o,s,t)=>{const a=s?Object.assign(s,{async:!0}):{async:!0};let f=r._zod.run({value:o,issues:[]},a);if(f instanceof Promise&&(f=await f),f.issues.length){const k=new(t?.Err??e)(f.issues.map(R=>Ar(R,a,ur())));throw Ba(k,t?.callee),k}return f.value},es=Ai(hr),Zi=e=>(r,o,s)=>{const t=s?{...s,async:!1}:{async:!1},a=r._zod.run({value:o,issues:[]},t);if(a instanceof Promise)throw new Cn;return a.issues.length?{success:!1,error:new(e??Ya)(a.issues.map(f=>Ar(f,t,ur())))}:{success:!0,data:a.value}},Oc=Zi(hr),Ri=e=>async(r,o,s)=>{const t=s?Object.assign(s,{async:!0}):{async:!0};let a=r._zod.run({value:o,issues:[]},t);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(f=>Ar(f,t,ur())))}:{success:!0,data:a.value}},Ec=Ri(hr),ts=e=>(r,o,s)=>{const t=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return Li(e)(r,o,t)},ay=ts(hr),rs=e=>(r,o,s)=>Li(e)(r,o,s),sy=rs(hr),ns=e=>async(r,o,s)=>{const t=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return Ai(e)(r,o,t)},uy=ns(hr),is=e=>async(r,o,s)=>Ai(e)(r,o,s),ly=is(hr),os=e=>(r,o,s)=>{const t=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return Zi(e)(r,o,t)},cy=os(hr),as=e=>(r,o,s)=>Zi(e)(r,o,s),dy=as(hr),ss=e=>async(r,o,s)=>{const t=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return Ri(e)(r,o,t)},fy=ss(hr),us=e=>async(r,o,s)=>Ri(e)(r,o,s),my=us(hr),Pc=/^[cC][^\s-]{8,}$/,Cc=/^[0-9a-z]+$/,Mc=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Dc=/^[0-9a-vA-V]{20}$/,Uc=/^[A-Za-z0-9]{27}$/,Lc=/^[a-zA-Z0-9_-]{21}$/,Ac=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,py=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Zc=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,fi=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,gy=fi(4),vy=fi(6),hy=fi(7),Rc=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,by=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,yy=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,qc=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,$y=qc,wy=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,_y="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Fc(){return new RegExp(_y,"u")}const Wc=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Gc=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Qc=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Jc=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Vc=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ls=/^[A-Za-z0-9_-]*$/,cs=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Bc=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Yc=/^\+(?:[0-9]){6,14}[0-9]$/,Kc="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Hc=new RegExp(`^${Kc}$`);function Xc(e){const r="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${r}`:e.precision===0?`${r}:[0-5]\\d`:`${r}:[0-5]\\d\\.\\d{${e.precision}}`:`${r}(?::[0-5]\\d(?:\\.\\d+)?)?`}function ed(e){return new RegExp(`^${Xc(e)}$`)}function td(e){const r=Xc({precision:e.precision}),o=["Z"];e.local&&o.push(""),e.offset&&o.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const s=`${r}(?:${o.join("|")})`;return new RegExp(`^${Kc}T(?:${s})$`)}const rd=e=>{const r=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${r}$`)},nd=/^-?\d+n?$/,id=/^-?\d+$/,od=/^-?\d+(?:\.\d+)?/,ad=/^(?:true|false)$/i,sd=/^null$/i,ud=/^undefined$/i,ld=/^[^A-Z]*$/,cd=/^[^a-z]*$/,dd=/^[0-9a-fA-F]*$/;function qi(e,r){return new RegExp(`^[A-Za-z0-9+/]{${e}}${r}$`)}function Fi(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}const ds=Object.freeze(Object.defineProperty({__proto__:null,base64:Vc,base64url:ls,bigint:nd,boolean:ad,browserEmail:wy,cidrv4:Qc,cidrv6:Jc,cuid:Pc,cuid2:Cc,date:Hc,datetime:td,domain:Bc,duration:Ac,e164:Yc,email:Rc,emoji:Fc,extendedDuration:py,guid:Zc,hex:dd,hostname:cs,html5Email:by,idnEmail:$y,integer:id,ipv4:Wc,ipv6:Gc,ksuid:Uc,lowercase:ld,md5_base64:qi(22,"=="),md5_base64url:Fi(22),md5_hex:/^[0-9a-fA-F]{32}$/,nanoid:Lc,null:sd,number:od,rfc5322Email:yy,sha1_base64:qi(27,"="),sha1_base64url:Fi(27),sha1_hex:/^[0-9a-fA-F]{40}$/,sha256_base64:qi(43,"="),sha256_base64url:Fi(43),sha256_hex:/^[0-9a-fA-F]{64}$/,sha384_base64:qi(64,""),sha384_base64url:Fi(64),sha384_hex:/^[0-9a-fA-F]{96}$/,sha512_base64:qi(86,"=="),sha512_base64url:Fi(86),sha512_hex:/^[0-9a-fA-F]{128}$/,string:rd,time:ed,ulid:Mc,undefined:ud,unicodeEmail:qc,uppercase:cd,uuid:fi,uuid4:gy,uuid6:vy,uuid7:hy,xid:Dc},Symbol.toStringTag,{value:"Module"})),Dt=M("$ZodCheck",(e,r)=>{var o;e._zod??(e._zod={}),e._zod.def=r,(o=e._zod).onattach??(o.onattach=[])}),fd={number:"number",bigint:"bigint",object:"date"},fs=M("$ZodCheckLessThan",(e,r)=>{Dt.init(e,r);const o=fd[typeof r.value];e._zod.onattach.push(s=>{const t=s._zod.bag,a=(r.inclusive?t.maximum:t.exclusiveMaximum)??Number.POSITIVE_INFINITY;r.value<a&&(r.inclusive?t.maximum=r.value:t.exclusiveMaximum=r.value)}),e._zod.check=s=>{(r.inclusive?s.value<=r.value:s.value<r.value)||s.issues.push({origin:o,code:"too_big",maximum:r.value,input:s.value,inclusive:r.inclusive,inst:e,continue:!r.abort})}}),ms=M("$ZodCheckGreaterThan",(e,r)=>{Dt.init(e,r);const o=fd[typeof r.value];e._zod.onattach.push(s=>{const t=s._zod.bag,a=(r.inclusive?t.minimum:t.exclusiveMinimum)??Number.NEGATIVE_INFINITY;r.value>a&&(r.inclusive?t.minimum=r.value:t.exclusiveMinimum=r.value)}),e._zod.check=s=>{(r.inclusive?s.value>=r.value:s.value>r.value)||s.issues.push({origin:o,code:"too_small",minimum:r.value,input:s.value,inclusive:r.inclusive,inst:e,continue:!r.abort})}}),md=M("$ZodCheckMultipleOf",(e,r)=>{Dt.init(e,r),e._zod.onattach.push(o=>{var s;(s=o._zod.bag).multipleOf??(s.multipleOf=r.value)}),e._zod.check=o=>{if(typeof o.value!=typeof r.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof o.value=="bigint"?o.value%r.value===BigInt(0):cc(o.value,r.value)===0)||o.issues.push({origin:typeof o.value,code:"not_multiple_of",divisor:r.value,input:o.value,inst:e,continue:!r.abort})}}),pd=M("$ZodCheckNumberFormat",(e,r)=>{Dt.init(e,r),r.format=r.format||"float64";const o=r.format?.includes("int"),s=o?"int":"number",[t,a]=gc[r.format];e._zod.onattach.push(f=>{const k=f._zod.bag;k.format=r.format,k.minimum=t,k.maximum=a,o&&(k.pattern=id)}),e._zod.check=f=>{const k=f.value;if(o){if(!Number.isInteger(k)){f.issues.push({expected:s,format:r.format,code:"invalid_type",continue:!1,input:k,inst:e});return}if(!Number.isSafeInteger(k)){k>0?f.issues.push({input:k,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:s,continue:!r.abort}):f.issues.push({input:k,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:s,continue:!r.abort});return}}k<t&&f.issues.push({origin:"number",input:k,code:"too_small",minimum:t,inclusive:!0,inst:e,continue:!r.abort}),k>a&&f.issues.push({origin:"number",input:k,code:"too_big",maximum:a,inst:e})}}),gd=M("$ZodCheckBigIntFormat",(e,r)=>{Dt.init(e,r);const[o,s]=vc[r.format];e._zod.onattach.push(t=>{const a=t._zod.bag;a.format=r.format,a.minimum=o,a.maximum=s}),e._zod.check=t=>{const a=t.value;a<o&&t.issues.push({origin:"bigint",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!r.abort}),a>s&&t.issues.push({origin:"bigint",input:a,code:"too_big",maximum:s,inst:e})}}),vd=M("$ZodCheckMaxSize",(e,r)=>{var o;Dt.init(e,r),(o=e._zod.def).when??(o.when=s=>{const t=s.value;return!Mn(t)&&t.size!==void 0}),e._zod.onattach.push(s=>{const t=s._zod.bag.maximum??Number.POSITIVE_INFINITY;r.maximum<t&&(s._zod.bag.maximum=r.maximum)}),e._zod.check=s=>{const t=s.value;t.size<=r.maximum||s.issues.push({origin:Mo(t),code:"too_big",maximum:r.maximum,inclusive:!0,input:t,inst:e,continue:!r.abort})}}),hd=M("$ZodCheckMinSize",(e,r)=>{var o;Dt.init(e,r),(o=e._zod.def).when??(o.when=s=>{const t=s.value;return!Mn(t)&&t.size!==void 0}),e._zod.onattach.push(s=>{const t=s._zod.bag.minimum??Number.NEGATIVE_INFINITY;r.minimum>t&&(s._zod.bag.minimum=r.minimum)}),e._zod.check=s=>{const t=s.value;t.size>=r.minimum||s.issues.push({origin:Mo(t),code:"too_small",minimum:r.minimum,inclusive:!0,input:t,inst:e,continue:!r.abort})}}),bd=M("$ZodCheckSizeEquals",(e,r)=>{var o;Dt.init(e,r),(o=e._zod.def).when??(o.when=s=>{const t=s.value;return!Mn(t)&&t.size!==void 0}),e._zod.onattach.push(s=>{const t=s._zod.bag;t.minimum=r.size,t.maximum=r.size,t.size=r.size}),e._zod.check=s=>{const t=s.value,a=t.size;if(a===r.size)return;const f=a>r.size;s.issues.push({origin:Mo(t),...f?{code:"too_big",maximum:r.size}:{code:"too_small",minimum:r.size},inclusive:!0,exact:!0,input:s.value,inst:e,continue:!r.abort})}}),yd=M("$ZodCheckMaxLength",(e,r)=>{var o;Dt.init(e,r),(o=e._zod.def).when??(o.when=s=>{const t=s.value;return!Mn(t)&&t.length!==void 0}),e._zod.onattach.push(s=>{const t=s._zod.bag.maximum??Number.POSITIVE_INFINITY;r.maximum<t&&(s._zod.bag.maximum=r.maximum)}),e._zod.check=s=>{const t=s.value;if(t.length<=r.maximum)return;const f=Do(t);s.issues.push({origin:f,code:"too_big",maximum:r.maximum,inclusive:!0,input:t,inst:e,continue:!r.abort})}}),$d=M("$ZodCheckMinLength",(e,r)=>{var o;Dt.init(e,r),(o=e._zod.def).when??(o.when=s=>{const t=s.value;return!Mn(t)&&t.length!==void 0}),e._zod.onattach.push(s=>{const t=s._zod.bag.minimum??Number.NEGATIVE_INFINITY;r.minimum>t&&(s._zod.bag.minimum=r.minimum)}),e._zod.check=s=>{const t=s.value;if(t.length>=r.minimum)return;const f=Do(t);s.issues.push({origin:f,code:"too_small",minimum:r.minimum,inclusive:!0,input:t,inst:e,continue:!r.abort})}}),wd=M("$ZodCheckLengthEquals",(e,r)=>{var o;Dt.init(e,r),(o=e._zod.def).when??(o.when=s=>{const t=s.value;return!Mn(t)&&t.length!==void 0}),e._zod.onattach.push(s=>{const t=s._zod.bag;t.minimum=r.length,t.maximum=r.length,t.length=r.length}),e._zod.check=s=>{const t=s.value,a=t.length;if(a===r.length)return;const f=Do(t),k=a>r.length;s.issues.push({origin:f,...k?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length},inclusive:!0,exact:!0,input:s.value,inst:e,continue:!r.abort})}}),Wi=M("$ZodCheckStringFormat",(e,r)=>{var o,s;Dt.init(e,r),e._zod.onattach.push(t=>{const a=t._zod.bag;a.format=r.format,r.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(r.pattern))}),r.pattern?(o=e._zod).check??(o.check=t=>{r.pattern.lastIndex=0,!r.pattern.test(t.value)&&t.issues.push({origin:"string",code:"invalid_format",format:r.format,input:t.value,...r.pattern?{pattern:r.pattern.toString()}:{},inst:e,continue:!r.abort})}):(s=e._zod).check??(s.check=()=>{})}),_d=M("$ZodCheckRegex",(e,r)=>{Wi.init(e,r),e._zod.check=o=>{r.pattern.lastIndex=0,!r.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:"regex",input:o.value,pattern:r.pattern.toString(),inst:e,continue:!r.abort})}}),kd=M("$ZodCheckLowerCase",(e,r)=>{r.pattern??(r.pattern=ld),Wi.init(e,r)}),xd=M("$ZodCheckUpperCase",(e,r)=>{r.pattern??(r.pattern=cd),Wi.init(e,r)}),Sd=M("$ZodCheckIncludes",(e,r)=>{Dt.init(e,r);const o=bn(r.includes),s=new RegExp(typeof r.position=="number"?`^.{${r.position}}${o}`:o);r.pattern=s,e._zod.onattach.push(t=>{const a=t._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(s)}),e._zod.check=t=>{t.value.includes(r.includes,r.position)||t.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:r.includes,input:t.value,inst:e,continue:!r.abort})}}),Id=M("$ZodCheckStartsWith",(e,r)=>{Dt.init(e,r);const o=new RegExp(`^${bn(r.prefix)}.*`);r.pattern??(r.pattern=o),e._zod.onattach.push(s=>{const t=s._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(o)}),e._zod.check=s=>{s.value.startsWith(r.prefix)||s.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:r.prefix,input:s.value,inst:e,continue:!r.abort})}}),zd=M("$ZodCheckEndsWith",(e,r)=>{Dt.init(e,r);const o=new RegExp(`.*${bn(r.suffix)}$`);r.pattern??(r.pattern=o),e._zod.onattach.push(s=>{const t=s._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(o)}),e._zod.check=s=>{s.value.endsWith(r.suffix)||s.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:r.suffix,input:s.value,inst:e,continue:!r.abort})}});function Nd(e,r,o){e.issues.length&&r.issues.push(...Lr(o,e.issues))}const jd=M("$ZodCheckProperty",(e,r)=>{Dt.init(e,r),e._zod.check=o=>{const s=r.schema._zod.run({value:o.value[r.property],issues:[]},{});if(s instanceof Promise)return s.then(t=>Nd(t,o,r.property));Nd(s,o,r.property)}}),Td=M("$ZodCheckMimeType",(e,r)=>{Dt.init(e,r);const o=new Set(r.mime);e._zod.onattach.push(s=>{s._zod.bag.mime=r.mime}),e._zod.check=s=>{o.has(s.value.type)||s.issues.push({code:"invalid_value",values:r.mime,input:s.value.type,inst:e,continue:!r.abort})}}),Od=M("$ZodCheckOverwrite",(e,r)=>{Dt.init(e,r),e._zod.check=o=>{o.value=r.tx(o.value)}});class Ed{constructor(r=[]){this.content=[],this.indent=0,this&&(this.args=r)}indented(r){this.indent+=1,r(this),this.indent-=1}write(r){if(typeof r=="function"){r(this,{execution:"sync"}),r(this,{execution:"async"});return}const s=r.split(`
24
24
  `).filter(f=>f),t=Math.min(...s.map(f=>f.length-f.trimStart().length)),a=s.map(f=>f.slice(t)).map(f=>" ".repeat(this.indent*2)+f);for(const f of a)this.content.push(f)}compile(){const r=Function,o=this?.args,t=[...(this?.content??[""]).map(a=>` ${a}`)];return new r(...o,t.join(`
25
25
  `))}}const Pd={major:4,minor:1,patch:8},Qe=M("$ZodType",(e,r)=>{var o;e??(e={}),e._zod.def=r,e._zod.bag=e._zod.bag||{},e._zod.version=Pd;const s=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&s.unshift(e);for(const t of s)for(const a of t._zod.onattach)a(e);if(s.length===0)(o=e._zod).deferred??(o.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(f,k,R)=>{let B=Un(f),me;for(const K of k){if(K._zod.def.when){if(!K._zod.def.when(f))continue}else if(B)continue;const Re=f.issues.length,ye=K._zod.check(f);if(ye instanceof Promise&&R?.async===!1)throw new Cn;if(me||ye instanceof Promise)me=(me??Promise.resolve()).then(async()=>{await ye,f.issues.length!==Re&&(B||(B=Un(f,Re)))});else{if(f.issues.length===Re)continue;B||(B=Un(f,Re))}}return me?me.then(()=>f):f},a=(f,k,R)=>{if(Un(f))return f.aborted=!0,f;const B=t(k,s,R);if(B instanceof Promise){if(R.async===!1)throw new Cn;return B.then(me=>e._zod.parse(me,R))}return e._zod.parse(B,R)};e._zod.run=(f,k)=>{if(k.skipChecks)return e._zod.parse(f,k);if(k.direction==="backward"){const B=e._zod.parse({value:f.value,issues:[]},{...k,skipChecks:!0});return B instanceof Promise?B.then(me=>a(me,f,k)):a(B,f,k)}const R=e._zod.parse(f,k);if(R instanceof Promise){if(k.async===!1)throw new Cn;return R.then(B=>t(B,s,k))}return t(R,s,k)}}e["~standard"]={validate:t=>{try{const a=Oc(e,t);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return Ec(e,t).then(f=>f.success?{value:f.data}:{issues:f.error?.issues})}},vendor:"zod",version:1}}),Gi=M("$ZodString",(e,r)=>{Qe.init(e,r),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??rd(e._zod.bag),e._zod.parse=(o,s)=>{if(r.coerce)try{o.value=String(o.value)}catch{}return typeof o.value=="string"||o.issues.push({expected:"string",code:"invalid_type",input:o.value,inst:e}),o}}),Nt=M("$ZodStringFormat",(e,r)=>{Wi.init(e,r),Gi.init(e,r)}),Cd=M("$ZodGUID",(e,r)=>{r.pattern??(r.pattern=Zc),Nt.init(e,r)}),Md=M("$ZodUUID",(e,r)=>{if(r.version){const s={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[r.version];if(s===void 0)throw new Error(`Invalid UUID version: "${r.version}"`);r.pattern??(r.pattern=fi(s))}else r.pattern??(r.pattern=fi());Nt.init(e,r)}),Dd=M("$ZodEmail",(e,r)=>{r.pattern??(r.pattern=Rc),Nt.init(e,r)}),Ud=M("$ZodURL",(e,r)=>{Nt.init(e,r),e._zod.check=o=>{try{const s=o.value.trim(),t=new URL(s);r.hostname&&(r.hostname.lastIndex=0,r.hostname.test(t.hostname)||o.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:cs.source,input:o.value,inst:e,continue:!r.abort})),r.protocol&&(r.protocol.lastIndex=0,r.protocol.test(t.protocol.endsWith(":")?t.protocol.slice(0,-1):t.protocol)||o.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:r.protocol.source,input:o.value,inst:e,continue:!r.abort})),r.normalize?o.value=t.href:o.value=s;return}catch{o.issues.push({code:"invalid_format",format:"url",input:o.value,inst:e,continue:!r.abort})}}}),Ld=M("$ZodEmoji",(e,r)=>{r.pattern??(r.pattern=Fc()),Nt.init(e,r)}),Ad=M("$ZodNanoID",(e,r)=>{r.pattern??(r.pattern=Lc),Nt.init(e,r)}),Zd=M("$ZodCUID",(e,r)=>{r.pattern??(r.pattern=Pc),Nt.init(e,r)}),Rd=M("$ZodCUID2",(e,r)=>{r.pattern??(r.pattern=Cc),Nt.init(e,r)}),qd=M("$ZodULID",(e,r)=>{r.pattern??(r.pattern=Mc),Nt.init(e,r)}),Fd=M("$ZodXID",(e,r)=>{r.pattern??(r.pattern=Dc),Nt.init(e,r)}),Wd=M("$ZodKSUID",(e,r)=>{r.pattern??(r.pattern=Uc),Nt.init(e,r)}),Gd=M("$ZodISODateTime",(e,r)=>{r.pattern??(r.pattern=td(r)),Nt.init(e,r)}),Qd=M("$ZodISODate",(e,r)=>{r.pattern??(r.pattern=Hc),Nt.init(e,r)}),Jd=M("$ZodISOTime",(e,r)=>{r.pattern??(r.pattern=ed(r)),Nt.init(e,r)}),Vd=M("$ZodISODuration",(e,r)=>{r.pattern??(r.pattern=Ac),Nt.init(e,r)}),Bd=M("$ZodIPv4",(e,r)=>{r.pattern??(r.pattern=Wc),Nt.init(e,r),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format="ipv4"})}),Yd=M("$ZodIPv6",(e,r)=>{r.pattern??(r.pattern=Gc),Nt.init(e,r),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format="ipv6"}),e._zod.check=o=>{try{new URL(`http://[${o.value}]`)}catch{o.issues.push({code:"invalid_format",format:"ipv6",input:o.value,inst:e,continue:!r.abort})}}}),Kd=M("$ZodCIDRv4",(e,r)=>{r.pattern??(r.pattern=Qc),Nt.init(e,r)}),Hd=M("$ZodCIDRv6",(e,r)=>{r.pattern??(r.pattern=Jc),Nt.init(e,r),e._zod.check=o=>{const s=o.value.split("/");try{if(s.length!==2)throw new Error;const[t,a]=s;if(!a)throw new Error;const f=Number(a);if(`${f}`!==a)throw new Error;if(f<0||f>128)throw new Error;new URL(`http://[${t}]`)}catch{o.issues.push({code:"invalid_format",format:"cidrv6",input:o.value,inst:e,continue:!r.abort})}}});function ps(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Xd=M("$ZodBase64",(e,r)=>{r.pattern??(r.pattern=Vc),Nt.init(e,r),e._zod.onattach.push(o=>{o._zod.bag.contentEncoding="base64"}),e._zod.check=o=>{ps(o.value)||o.issues.push({code:"invalid_format",format:"base64",input:o.value,inst:e,continue:!r.abort})}});function ef(e){if(!ls.test(e))return!1;const r=e.replace(/[-_]/g,s=>s==="-"?"+":"/"),o=r.padEnd(Math.ceil(r.length/4)*4,"=");return ps(o)}const tf=M("$ZodBase64URL",(e,r)=>{r.pattern??(r.pattern=ls),Nt.init(e,r),e._zod.onattach.push(o=>{o._zod.bag.contentEncoding="base64url"}),e._zod.check=o=>{ef(o.value)||o.issues.push({code:"invalid_format",format:"base64url",input:o.value,inst:e,continue:!r.abort})}}),rf=M("$ZodE164",(e,r)=>{r.pattern??(r.pattern=Yc),Nt.init(e,r)});function nf(e,r=null){try{const o=e.split(".");if(o.length!==3)return!1;const[s]=o;if(!s)return!1;const t=JSON.parse(atob(s));return!("typ"in t&&t?.typ!=="JWT"||!t.alg||r&&(!("alg"in t)||t.alg!==r))}catch{return!1}}const of=M("$ZodJWT",(e,r)=>{Nt.init(e,r),e._zod.check=o=>{nf(o.value,r.alg)||o.issues.push({code:"invalid_format",format:"jwt",input:o.value,inst:e,continue:!r.abort})}}),af=M("$ZodCustomStringFormat",(e,r)=>{Nt.init(e,r),e._zod.check=o=>{r.fn(o.value)||o.issues.push({code:"invalid_format",format:r.format,input:o.value,inst:e,continue:!r.abort})}}),gs=M("$ZodNumber",(e,r)=>{Qe.init(e,r),e._zod.pattern=e._zod.bag.pattern??od,e._zod.parse=(o,s)=>{if(r.coerce)try{o.value=Number(o.value)}catch{}const t=o.value;if(typeof t=="number"&&!Number.isNaN(t)&&Number.isFinite(t))return o;const a=typeof t=="number"?Number.isNaN(t)?"NaN":Number.isFinite(t)?void 0:"Infinity":void 0;return o.issues.push({expected:"number",code:"invalid_type",input:t,inst:e,...a?{received:a}:{}}),o}}),sf=M("$ZodNumber",(e,r)=>{pd.init(e,r),gs.init(e,r)}),vs=M("$ZodBoolean",(e,r)=>{Qe.init(e,r),e._zod.pattern=ad,e._zod.parse=(o,s)=>{if(r.coerce)try{o.value=!!o.value}catch{}const t=o.value;return typeof t=="boolean"||o.issues.push({expected:"boolean",code:"invalid_type",input:t,inst:e}),o}}),hs=M("$ZodBigInt",(e,r)=>{Qe.init(e,r),e._zod.pattern=nd,e._zod.parse=(o,s)=>{if(r.coerce)try{o.value=BigInt(o.value)}catch{}return typeof o.value=="bigint"||o.issues.push({expected:"bigint",code:"invalid_type",input:o.value,inst:e}),o}}),uf=M("$ZodBigInt",(e,r)=>{gd.init(e,r),hs.init(e,r)}),lf=M("$ZodSymbol",(e,r)=>{Qe.init(e,r),e._zod.parse=(o,s)=>{const t=o.value;return typeof t=="symbol"||o.issues.push({expected:"symbol",code:"invalid_type",input:t,inst:e}),o}}),cf=M("$ZodUndefined",(e,r)=>{Qe.init(e,r),e._zod.pattern=ud,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(o,s)=>{const t=o.value;return typeof t>"u"||o.issues.push({expected:"undefined",code:"invalid_type",input:t,inst:e}),o}}),df=M("$ZodNull",(e,r)=>{Qe.init(e,r),e._zod.pattern=sd,e._zod.values=new Set([null]),e._zod.parse=(o,s)=>{const t=o.value;return t===null||o.issues.push({expected:"null",code:"invalid_type",input:t,inst:e}),o}}),ff=M("$ZodAny",(e,r)=>{Qe.init(e,r),e._zod.parse=o=>o}),mf=M("$ZodUnknown",(e,r)=>{Qe.init(e,r),e._zod.parse=o=>o}),pf=M("$ZodNever",(e,r)=>{Qe.init(e,r),e._zod.parse=(o,s)=>(o.issues.push({expected:"never",code:"invalid_type",input:o.value,inst:e}),o)}),gf=M("$ZodVoid",(e,r)=>{Qe.init(e,r),e._zod.parse=(o,s)=>{const t=o.value;return typeof t>"u"||o.issues.push({expected:"void",code:"invalid_type",input:t,inst:e}),o}}),vf=M("$ZodDate",(e,r)=>{Qe.init(e,r),e._zod.parse=(o,s)=>{if(r.coerce)try{o.value=new Date(o.value)}catch{}const t=o.value,a=t instanceof Date;return a&&!Number.isNaN(t.getTime())||o.issues.push({expected:"date",code:"invalid_type",input:t,...a?{received:"Invalid Date"}:{},inst:e}),o}});function hf(e,r,o){e.issues.length&&r.issues.push(...Lr(o,e.issues)),r.value[o]=e.value}const bf=M("$ZodArray",(e,r)=>{Qe.init(e,r),e._zod.parse=(o,s)=>{const t=o.value;if(!Array.isArray(t))return o.issues.push({expected:"array",code:"invalid_type",input:t,inst:e}),o;o.value=Array(t.length);const a=[];for(let f=0;f<t.length;f++){const k=t[f],R=r.element._zod.run({value:k,issues:[]},s);R instanceof Promise?a.push(R.then(B=>hf(B,o,f))):hf(R,o,f)}return a.length?Promise.all(a).then(()=>o):o}});function Uo(e,r,o,s){e.issues.length&&r.issues.push(...Lr(o,e.issues)),e.value===void 0?o in s&&(r.value[o]=void 0):r.value[o]=e.value}function yf(e){const r=Object.keys(e.shape);for(const s of r)if(!e.shape?.[s]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${s}": expected a Zod schema`);const o=pc(e.shape);return{...e,keys:r,keySet:new Set(r),numKeys:r.length,optionalKeys:new Set(o)}}function $f(e,r,o,s,t,a){const f=[],k=t.keySet,R=t.catchall._zod,B=R.def.type;for(const me of Object.keys(r)){if(k.has(me))continue;if(B==="never"){f.push(me);continue}const K=R.run({value:r[me],issues:[]},s);K instanceof Promise?e.push(K.then(Re=>Uo(Re,o,me,r))):Uo(K,o,me,r)}return f.length&&o.issues.push({code:"unrecognized_keys",keys:f,input:r,inst:a}),e.length?Promise.all(e).then(()=>o):o}const wf=M("$ZodObject",(e,r)=>{Qe.init(e,r);const o=Di(()=>yf(r));ot(e._zod,"propValues",()=>{const f=r.shape,k={};for(const R in f){const B=f[R]._zod;if(B.values){k[R]??(k[R]=new Set);for(const me of B.values)k[R].add(me)}}return k});const s=ci,t=r.catchall;let a;e._zod.parse=(f,k)=>{a??(a=o.value);const R=f.value;if(!s(R))return f.issues.push({expected:"object",code:"invalid_type",input:R,inst:e}),f;f.value={};const B=[],me=a.shape;for(const K of a.keys){const ye=me[K]._zod.run({value:R[K],issues:[]},k);ye instanceof Promise?B.push(ye.then(H=>Uo(H,f,K,R))):Uo(ye,f,K,R)}return t?$f(B,R,f,k,o.value,e):B.length?Promise.all(B).then(()=>f):f}}),_f=M("$ZodObjectJIT",(e,r)=>{wf.init(e,r);const o=e._zod.parse,s=Di(()=>yf(r)),t=Re=>{const ye=new Ed(["shape","payload","ctx"]),H=s.value,Ne=dt=>{const bt=Va(dt);return`shape[${bt}]._zod.run({ value: input[${bt}], issues: [] }, ctx)`};ye.write("const input = payload.value;");const De=Object.create(null);let pt=0;for(const dt of H.keys)De[dt]=`key_${pt++}`;ye.write("const newResult = {};");for(const dt of H.keys){const bt=De[dt],lr=Va(dt);ye.write(`const ${bt} = ${Ne(dt)};`),ye.write(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@encatch/ws-react",
3
- "version": "0.0.14",
3
+ "version": "0.0.15",
4
4
  "type": "module",
5
5
 
6
6
  "main": "./dist/ws-react.umd.js",