@mieweb/forms-renderer 0.1.8 → 0.1.10

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.
package/dist/react.js CHANGED
@@ -1,6 +1,7 @@
1
- import C, { useMemo as br } from "react";
2
- import { useUIApi as ke, useFormStore as ee, getFieldComponent as mr, useVisibleFields as yr, useFieldsArray as gr } from "@mieweb/forms-engine";
3
- var q = { exports: {} }, Y = {};
1
+ import O, { useMemo as gr } from "react";
2
+ import { useUIApi as Fe, adaptSchema as mr, useFormStore as ee, getFieldComponent as hr, useVisibleFields as yr, useUIStore as br } from "@mieweb/forms-engine";
3
+ import { useFieldsArray as kr } from "@mieweb/forms-engine";
4
+ var q = { exports: {} }, W = {};
4
5
  /**
5
6
  * @license React
6
7
  * react-jsx-runtime.production.min.js
@@ -11,20 +12,20 @@ var q = { exports: {} }, Y = {};
11
12
  * LICENSE file in the root directory of this source tree.
12
13
  */
13
14
  var Oe;
14
- function hr() {
15
- if (Oe) return Y;
15
+ function Rr() {
16
+ if (Oe) return W;
16
17
  Oe = 1;
17
- var o = C, s = Symbol.for("react.element"), f = Symbol.for("react.fragment"), l = Object.prototype.hasOwnProperty, p = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, g = { key: !0, ref: !0, __self: !0, __source: !0 };
18
- function w(x, b, O) {
19
- var h, E = {}, S = null, F = null;
20
- O !== void 0 && (S = "" + O), b.key !== void 0 && (S = "" + b.key), b.ref !== void 0 && (F = b.ref);
21
- for (h in b) l.call(b, h) && !g.hasOwnProperty(h) && (E[h] = b[h]);
22
- if (x && x.defaultProps) for (h in b = x.defaultProps, b) E[h] === void 0 && (E[h] = b[h]);
23
- return { $$typeof: s, type: x, key: S, ref: F, props: E, _owner: p.current };
18
+ var u = O, f = Symbol.for("react.element"), c = Symbol.for("react.fragment"), d = Object.prototype.hasOwnProperty, s = u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, g = { key: !0, ref: !0, __self: !0, __source: !0 };
19
+ function w(m, v, _) {
20
+ var y, S = {}, P = null, M = null;
21
+ _ !== void 0 && (P = "" + _), v.key !== void 0 && (P = "" + v.key), v.ref !== void 0 && (M = v.ref);
22
+ for (y in v) d.call(v, y) && !g.hasOwnProperty(y) && (S[y] = v[y]);
23
+ if (m && m.defaultProps) for (y in v = m.defaultProps, v) S[y] === void 0 && (S[y] = v[y]);
24
+ return { $$typeof: f, type: m, key: P, ref: M, props: S, _owner: s.current };
24
25
  }
25
- return Y.Fragment = f, Y.jsx = w, Y.jsxs = w, Y;
26
+ return W.Fragment = c, W.jsx = w, W.jsxs = w, W;
26
27
  }
27
- var N = {};
28
+ var Y = {};
28
29
  /**
29
30
  * @license React
30
31
  * react-jsx-runtime.development.js
@@ -34,18 +35,18 @@ var N = {};
34
35
  * This source code is licensed under the MIT license found in the
35
36
  * LICENSE file in the root directory of this source tree.
36
37
  */
37
- var je;
38
- function Rr() {
39
- return je || (je = 1, process.env.NODE_ENV !== "production" && (function() {
40
- var o = C, s = Symbol.for("react.element"), f = Symbol.for("react.portal"), l = Symbol.for("react.fragment"), p = Symbol.for("react.strict_mode"), g = Symbol.for("react.profiler"), w = Symbol.for("react.provider"), x = Symbol.for("react.context"), b = Symbol.for("react.forward_ref"), O = Symbol.for("react.suspense"), h = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), S = Symbol.for("react.lazy"), F = Symbol.for("react.offscreen"), re = Symbol.iterator, Fe = "@@iterator";
38
+ var Pe;
39
+ function Er() {
40
+ return Pe || (Pe = 1, process.env.NODE_ENV !== "production" && (function() {
41
+ var u = O, f = Symbol.for("react.element"), c = Symbol.for("react.portal"), d = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), g = Symbol.for("react.profiler"), w = Symbol.for("react.provider"), m = Symbol.for("react.context"), v = Symbol.for("react.forward_ref"), _ = Symbol.for("react.suspense"), y = Symbol.for("react.suspense_list"), S = Symbol.for("react.memo"), P = Symbol.for("react.lazy"), M = Symbol.for("react.offscreen"), re = Symbol.iterator, ke = "@@iterator";
41
42
  function Ae(e) {
42
43
  if (e === null || typeof e != "object")
43
44
  return null;
44
- var r = re && e[re] || e[Fe];
45
+ var r = re && e[re] || e[ke];
45
46
  return typeof r == "function" ? r : null;
46
47
  }
47
- var A = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
48
- function m(e) {
48
+ var k = u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
49
+ function b(e) {
49
50
  {
50
51
  for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
51
52
  t[n - 1] = arguments[n];
@@ -54,71 +55,71 @@ function Rr() {
54
55
  }
55
56
  function De(e, r, t) {
56
57
  {
57
- var n = A.ReactDebugCurrentFrame, u = n.getStackAddendum();
58
- u !== "" && (r += "%s", t = t.concat([u]));
59
- var c = t.map(function(i) {
58
+ var n = k.ReactDebugCurrentFrame, o = n.getStackAddendum();
59
+ o !== "" && (r += "%s", t = t.concat([o]));
60
+ var l = t.map(function(i) {
60
61
  return String(i);
61
62
  });
62
- c.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, c);
63
+ l.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, l);
63
64
  }
64
65
  }
65
- var Ie = !1, $e = !1, We = !1, Ye = !1, Ne = !1, te;
66
+ var Ie = !1, $e = !1, We = !1, Ye = !1, Me = !1, te;
66
67
  te = Symbol.for("react.module.reference");
67
- function Ve(e) {
68
- return !!(typeof e == "string" || typeof e == "function" || e === l || e === g || Ne || e === p || e === O || e === h || Ye || e === F || Ie || $e || We || typeof e == "object" && e !== null && (e.$$typeof === S || e.$$typeof === E || e.$$typeof === w || e.$$typeof === x || e.$$typeof === b || // This needs to include all possible module reference object
68
+ function Ue(e) {
69
+ return !!(typeof e == "string" || typeof e == "function" || e === d || e === g || Me || e === s || e === _ || e === y || Ye || e === M || Ie || $e || We || typeof e == "object" && e !== null && (e.$$typeof === P || e.$$typeof === S || e.$$typeof === w || e.$$typeof === m || e.$$typeof === v || // This needs to include all possible module reference object
69
70
  // types supported by any Flight configuration anywhere since
70
71
  // we don't know which Flight build this will end up being used
71
72
  // with.
72
73
  e.$$typeof === te || e.getModuleId !== void 0));
73
74
  }
74
- function Le(e, r, t) {
75
+ function Ve(e, r, t) {
75
76
  var n = e.displayName;
76
77
  if (n)
77
78
  return n;
78
- var u = r.displayName || r.name || "";
79
- return u !== "" ? t + "(" + u + ")" : t;
79
+ var o = r.displayName || r.name || "";
80
+ return o !== "" ? t + "(" + o + ")" : t;
80
81
  }
81
82
  function ne(e) {
82
83
  return e.displayName || "Context";
83
84
  }
84
- function j(e) {
85
+ function x(e) {
85
86
  if (e == null)
86
87
  return null;
87
- if (typeof e.tag == "number" && m("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
88
+ if (typeof e.tag == "number" && b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
88
89
  return e.displayName || e.name || null;
89
90
  if (typeof e == "string")
90
91
  return e;
91
92
  switch (e) {
92
- case l:
93
+ case d:
93
94
  return "Fragment";
94
- case f:
95
+ case c:
95
96
  return "Portal";
96
97
  case g:
97
98
  return "Profiler";
98
- case p:
99
+ case s:
99
100
  return "StrictMode";
100
- case O:
101
+ case _:
101
102
  return "Suspense";
102
- case h:
103
+ case y:
103
104
  return "SuspenseList";
104
105
  }
105
106
  if (typeof e == "object")
106
107
  switch (e.$$typeof) {
107
- case x:
108
+ case m:
108
109
  var r = e;
109
110
  return ne(r) + ".Consumer";
110
111
  case w:
111
112
  var t = e;
112
113
  return ne(t._context) + ".Provider";
113
- case b:
114
- return Le(e, e.render, "ForwardRef");
115
- case E:
114
+ case v:
115
+ return Ve(e, e.render, "ForwardRef");
116
+ case S:
116
117
  var n = e.displayName || null;
117
- return n !== null ? n : j(e.type) || "Memo";
118
- case S: {
119
- var u = e, c = u._payload, i = u._init;
118
+ return n !== null ? n : x(e.type) || "Memo";
119
+ case P: {
120
+ var o = e, l = o._payload, i = o._init;
120
121
  try {
121
- return j(i(c));
122
+ return x(i(l));
122
123
  } catch {
123
124
  return null;
124
125
  }
@@ -126,14 +127,14 @@ function Rr() {
126
127
  }
127
128
  return null;
128
129
  }
129
- var P = Object.assign, $ = 0, ae, ie, oe, ue, se, le, ce;
130
+ var C = Object.assign, I = 0, ae, ie, oe, se, ue, le, ce;
130
131
  function fe() {
131
132
  }
132
133
  fe.__reactDisabledLog = !0;
133
- function Me() {
134
+ function Le() {
134
135
  {
135
- if ($ === 0) {
136
- ae = console.log, ie = console.info, oe = console.warn, ue = console.error, se = console.group, le = console.groupCollapsed, ce = console.groupEnd;
136
+ if (I === 0) {
137
+ ae = console.log, ie = console.info, oe = console.warn, se = console.error, ue = console.group, le = console.groupCollapsed, ce = console.groupEnd;
137
138
  var e = {
138
139
  configurable: !0,
139
140
  enumerable: !0,
@@ -150,77 +151,77 @@ function Rr() {
150
151
  groupEnd: e
151
152
  });
152
153
  }
153
- $++;
154
+ I++;
154
155
  }
155
156
  }
156
- function Ue() {
157
+ function Ne() {
157
158
  {
158
- if ($--, $ === 0) {
159
+ if (I--, I === 0) {
159
160
  var e = {
160
161
  configurable: !0,
161
162
  enumerable: !0,
162
163
  writable: !0
163
164
  };
164
165
  Object.defineProperties(console, {
165
- log: P({}, e, {
166
+ log: C({}, e, {
166
167
  value: ae
167
168
  }),
168
- info: P({}, e, {
169
+ info: C({}, e, {
169
170
  value: ie
170
171
  }),
171
- warn: P({}, e, {
172
+ warn: C({}, e, {
172
173
  value: oe
173
174
  }),
174
- error: P({}, e, {
175
- value: ue
176
- }),
177
- group: P({}, e, {
175
+ error: C({}, e, {
178
176
  value: se
179
177
  }),
180
- groupCollapsed: P({}, e, {
178
+ group: C({}, e, {
179
+ value: ue
180
+ }),
181
+ groupCollapsed: C({}, e, {
181
182
  value: le
182
183
  }),
183
- groupEnd: P({}, e, {
184
+ groupEnd: C({}, e, {
184
185
  value: ce
185
186
  })
186
187
  });
187
188
  }
188
- $ < 0 && m("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
189
+ I < 0 && b("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
189
190
  }
190
191
  }
191
- var B = A.ReactCurrentDispatcher, J;
192
- function V(e, r, t) {
192
+ var B = k.ReactCurrentDispatcher, J;
193
+ function U(e, r, t) {
193
194
  {
194
195
  if (J === void 0)
195
196
  try {
196
197
  throw Error();
197
- } catch (u) {
198
- var n = u.stack.trim().match(/\n( *(at )?)/);
198
+ } catch (o) {
199
+ var n = o.stack.trim().match(/\n( *(at )?)/);
199
200
  J = n && n[1] || "";
200
201
  }
201
202
  return `
202
203
  ` + J + e;
203
204
  }
204
205
  }
205
- var K = !1, L;
206
+ var K = !1, V;
206
207
  {
207
208
  var qe = typeof WeakMap == "function" ? WeakMap : Map;
208
- L = new qe();
209
+ V = new qe();
209
210
  }
210
211
  function de(e, r) {
211
212
  if (!e || K)
212
213
  return "";
213
214
  {
214
- var t = L.get(e);
215
+ var t = V.get(e);
215
216
  if (t !== void 0)
216
217
  return t;
217
218
  }
218
219
  var n;
219
220
  K = !0;
220
- var u = Error.prepareStackTrace;
221
+ var o = Error.prepareStackTrace;
221
222
  Error.prepareStackTrace = void 0;
222
- var c;
223
- c = B.current, B.current = null, Me();
223
+ var l;
224
+ l = B.current, B.current = null, Le();
224
225
  try {
225
226
  if (r) {
226
227
  var i = function() {
@@ -233,50 +234,50 @@ function Rr() {
233
234
  }), typeof Reflect == "object" && Reflect.construct) {
234
235
  try {
235
236
  Reflect.construct(i, []);
236
- } catch (R) {
237
- n = R;
237
+ } catch (E) {
238
+ n = E;
238
239
  }
239
240
  Reflect.construct(e, [], i);
240
241
  } else {
241
242
  try {
242
243
  i.call();
243
- } catch (R) {
244
- n = R;
244
+ } catch (E) {
245
+ n = E;
245
246
  }
246
247
  e.call(i.prototype);
247
248
  }
248
249
  } else {
249
250
  try {
250
251
  throw Error();
251
- } catch (R) {
252
- n = R;
252
+ } catch (E) {
253
+ n = E;
253
254
  }
254
255
  e();
255
256
  }
256
- } catch (R) {
257
- if (R && n && typeof R.stack == "string") {
258
- for (var a = R.stack.split(`
259
- `), y = n.stack.split(`
260
- `), d = a.length - 1, v = y.length - 1; d >= 1 && v >= 0 && a[d] !== y[v]; )
261
- v--;
262
- for (; d >= 1 && v >= 0; d--, v--)
263
- if (a[d] !== y[v]) {
264
- if (d !== 1 || v !== 1)
257
+ } catch (E) {
258
+ if (E && n && typeof E.stack == "string") {
259
+ for (var a = E.stack.split(`
260
+ `), R = n.stack.split(`
261
+ `), p = a.length - 1, h = R.length - 1; p >= 1 && h >= 0 && a[p] !== R[h]; )
262
+ h--;
263
+ for (; p >= 1 && h >= 0; p--, h--)
264
+ if (a[p] !== R[h]) {
265
+ if (p !== 1 || h !== 1)
265
266
  do
266
- if (d--, v--, v < 0 || a[d] !== y[v]) {
267
- var _ = `
268
- ` + a[d].replace(" at new ", " at ");
269
- return e.displayName && _.includes("<anonymous>") && (_ = _.replace("<anonymous>", e.displayName)), typeof e == "function" && L.set(e, _), _;
267
+ if (p--, h--, h < 0 || a[p] !== R[h]) {
268
+ var T = `
269
+ ` + a[p].replace(" at new ", " at ");
270
+ return e.displayName && T.includes("<anonymous>") && (T = T.replace("<anonymous>", e.displayName)), typeof e == "function" && V.set(e, T), T;
270
271
  }
271
- while (d >= 1 && v >= 0);
272
+ while (p >= 1 && h >= 0);
272
273
  break;
273
274
  }
274
275
  }
275
276
  } finally {
276
- K = !1, B.current = c, Ue(), Error.prepareStackTrace = u;
277
+ K = !1, B.current = l, Ne(), Error.prepareStackTrace = o;
277
278
  }
278
- var I = e ? e.displayName || e.name : "", k = I ? V(I) : "";
279
- return typeof e == "function" && L.set(e, k), k;
279
+ var D = e ? e.displayName || e.name : "", j = D ? U(D) : "";
280
+ return typeof e == "function" && V.set(e, j), j;
280
281
  }
281
282
  function Be(e, r, t) {
282
283
  return de(e, !1);
@@ -285,94 +286,94 @@ function Rr() {
285
286
  var r = e.prototype;
286
287
  return !!(r && r.isReactComponent);
287
288
  }
288
- function M(e, r, t) {
289
+ function L(e, r, t) {
289
290
  if (e == null)
290
291
  return "";
291
292
  if (typeof e == "function")
292
293
  return de(e, Je(e));
293
294
  if (typeof e == "string")
294
- return V(e);
295
+ return U(e);
295
296
  switch (e) {
296
- case O:
297
- return V("Suspense");
298
- case h:
299
- return V("SuspenseList");
297
+ case _:
298
+ return U("Suspense");
299
+ case y:
300
+ return U("SuspenseList");
300
301
  }
301
302
  if (typeof e == "object")
302
303
  switch (e.$$typeof) {
303
- case b:
304
+ case v:
304
305
  return Be(e.render);
305
- case E:
306
- return M(e.type, r, t);
307
- case S: {
308
- var n = e, u = n._payload, c = n._init;
306
+ case S:
307
+ return L(e.type, r, t);
308
+ case P: {
309
+ var n = e, o = n._payload, l = n._init;
309
310
  try {
310
- return M(c(u), r, t);
311
+ return L(l(o), r, t);
311
312
  } catch {
312
313
  }
313
314
  }
314
315
  }
315
316
  return "";
316
317
  }
317
- var W = Object.prototype.hasOwnProperty, ve = {}, pe = A.ReactDebugCurrentFrame;
318
- function U(e) {
318
+ var $ = Object.prototype.hasOwnProperty, ve = {}, pe = k.ReactDebugCurrentFrame;
319
+ function N(e) {
319
320
  if (e) {
320
- var r = e._owner, t = M(e.type, e._source, r ? r.type : null);
321
+ var r = e._owner, t = L(e.type, e._source, r ? r.type : null);
321
322
  pe.setExtraStackFrame(t);
322
323
  } else
323
324
  pe.setExtraStackFrame(null);
324
325
  }
325
- function Ke(e, r, t, n, u) {
326
+ function Ke(e, r, t, n, o) {
326
327
  {
327
- var c = Function.call.bind(W);
328
+ var l = Function.call.bind($);
328
329
  for (var i in e)
329
- if (c(e, i)) {
330
+ if (l(e, i)) {
330
331
  var a = void 0;
331
332
  try {
332
333
  if (typeof e[i] != "function") {
333
- var y = Error((n || "React class") + ": " + t + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
334
- throw y.name = "Invariant Violation", y;
334
+ var R = Error((n || "React class") + ": " + t + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
335
+ throw R.name = "Invariant Violation", R;
335
336
  }
336
337
  a = e[i](r, i, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
337
- } catch (d) {
338
- a = d;
338
+ } catch (p) {
339
+ a = p;
339
340
  }
340
- a && !(a instanceof Error) && (U(u), m("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, i, typeof a), U(null)), a instanceof Error && !(a.message in ve) && (ve[a.message] = !0, U(u), m("Failed %s type: %s", t, a.message), U(null));
341
+ a && !(a instanceof Error) && (N(o), b("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, i, typeof a), N(null)), a instanceof Error && !(a.message in ve) && (ve[a.message] = !0, N(o), b("Failed %s type: %s", t, a.message), N(null));
341
342
  }
342
343
  }
343
344
  }
344
- var ze = Array.isArray;
345
- function z(e) {
346
- return ze(e);
345
+ var Ge = Array.isArray;
346
+ function G(e) {
347
+ return Ge(e);
347
348
  }
348
- function Ge(e) {
349
+ function ze(e) {
349
350
  {
350
351
  var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
351
352
  return t;
352
353
  }
353
354
  }
354
- function Qe(e) {
355
+ function He(e) {
355
356
  try {
356
- return be(e), !1;
357
+ return ge(e), !1;
357
358
  } catch {
358
359
  return !0;
359
360
  }
360
361
  }
361
- function be(e) {
362
+ function ge(e) {
362
363
  return "" + e;
363
364
  }
364
365
  function me(e) {
365
- if (Qe(e))
366
- return m("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ge(e)), be(e);
366
+ if (He(e))
367
+ return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ze(e)), ge(e);
367
368
  }
368
- var ye = A.ReactCurrentOwner, Xe = {
369
+ var he = k.ReactCurrentOwner, Qe = {
369
370
  key: !0,
370
371
  ref: !0,
371
372
  __self: !0,
372
373
  __source: !0
373
- }, ge, he;
374
- function He(e) {
375
- if (W.call(e, "ref")) {
374
+ }, ye, be;
375
+ function Xe(e) {
376
+ if ($.call(e, "ref")) {
376
377
  var r = Object.getOwnPropertyDescriptor(e, "ref").get;
377
378
  if (r && r.isReactWarning)
378
379
  return !1;
@@ -380,7 +381,7 @@ function Rr() {
380
381
  return e.ref !== void 0;
381
382
  }
382
383
  function Ze(e) {
383
- if (W.call(e, "key")) {
384
+ if ($.call(e, "key")) {
384
385
  var r = Object.getOwnPropertyDescriptor(e, "key").get;
385
386
  if (r && r.isReactWarning)
386
387
  return !1;
@@ -388,12 +389,12 @@ function Rr() {
388
389
  return e.key !== void 0;
389
390
  }
390
391
  function er(e, r) {
391
- typeof e.ref == "string" && ye.current;
392
+ typeof e.ref == "string" && he.current;
392
393
  }
393
394
  function rr(e, r) {
394
395
  {
395
396
  var t = function() {
396
- ge || (ge = !0, m("%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://reactjs.org/link/special-props)", r));
397
+ ye || (ye = !0, b("%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://reactjs.org/link/special-props)", r));
397
398
  };
398
399
  t.isReactWarning = !0, Object.defineProperty(e, "key", {
399
400
  get: t,
@@ -404,7 +405,7 @@ function Rr() {
404
405
  function tr(e, r) {
405
406
  {
406
407
  var t = function() {
407
- he || (he = !0, m("%s: `ref` 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://reactjs.org/link/special-props)", r));
408
+ be || (be = !0, b("%s: `ref` 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://reactjs.org/link/special-props)", r));
408
409
  };
409
410
  t.isReactWarning = !0, Object.defineProperty(e, "ref", {
410
411
  get: t,
@@ -412,17 +413,17 @@ function Rr() {
412
413
  });
413
414
  }
414
415
  }
415
- var nr = function(e, r, t, n, u, c, i) {
416
+ var nr = function(e, r, t, n, o, l, i) {
416
417
  var a = {
417
418
  // This tag allows us to uniquely identify this as a React Element
418
- $$typeof: s,
419
+ $$typeof: f,
419
420
  // Built-in properties that belong on the element
420
421
  type: e,
421
422
  key: r,
422
423
  ref: t,
423
424
  props: i,
424
425
  // Record the component responsible for creating this element.
425
- _owner: c
426
+ _owner: l
426
427
  };
427
428
  return a._store = {}, Object.defineProperty(a._store, "validated", {
428
429
  configurable: !1,
@@ -438,44 +439,44 @@ function Rr() {
438
439
  configurable: !1,
439
440
  enumerable: !1,
440
441
  writable: !1,
441
- value: u
442
+ value: o
442
443
  }), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
443
444
  };
444
- function ar(e, r, t, n, u) {
445
+ function ar(e, r, t, n, o) {
445
446
  {
446
- var c, i = {}, a = null, y = null;
447
- t !== void 0 && (me(t), a = "" + t), Ze(r) && (me(r.key), a = "" + r.key), He(r) && (y = r.ref, er(r, u));
448
- for (c in r)
449
- W.call(r, c) && !Xe.hasOwnProperty(c) && (i[c] = r[c]);
447
+ var l, i = {}, a = null, R = null;
448
+ t !== void 0 && (me(t), a = "" + t), Ze(r) && (me(r.key), a = "" + r.key), Xe(r) && (R = r.ref, er(r, o));
449
+ for (l in r)
450
+ $.call(r, l) && !Qe.hasOwnProperty(l) && (i[l] = r[l]);
450
451
  if (e && e.defaultProps) {
451
- var d = e.defaultProps;
452
- for (c in d)
453
- i[c] === void 0 && (i[c] = d[c]);
452
+ var p = e.defaultProps;
453
+ for (l in p)
454
+ i[l] === void 0 && (i[l] = p[l]);
454
455
  }
455
- if (a || y) {
456
- var v = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
457
- a && rr(i, v), y && tr(i, v);
456
+ if (a || R) {
457
+ var h = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
458
+ a && rr(i, h), R && tr(i, h);
458
459
  }
459
- return nr(e, a, y, u, n, ye.current, i);
460
+ return nr(e, a, R, o, n, he.current, i);
460
461
  }
461
462
  }
462
- var G = A.ReactCurrentOwner, Re = A.ReactDebugCurrentFrame;
463
- function D(e) {
463
+ var z = k.ReactCurrentOwner, Re = k.ReactDebugCurrentFrame;
464
+ function A(e) {
464
465
  if (e) {
465
- var r = e._owner, t = M(e.type, e._source, r ? r.type : null);
466
+ var r = e._owner, t = L(e.type, e._source, r ? r.type : null);
466
467
  Re.setExtraStackFrame(t);
467
468
  } else
468
469
  Re.setExtraStackFrame(null);
469
470
  }
470
- var Q;
471
- Q = !1;
472
- function X(e) {
473
- return typeof e == "object" && e !== null && e.$$typeof === s;
471
+ var H;
472
+ H = !1;
473
+ function Q(e) {
474
+ return typeof e == "object" && e !== null && e.$$typeof === f;
474
475
  }
475
476
  function Ee() {
476
477
  {
477
- if (G.current) {
478
- var e = j(G.current.type);
478
+ if (z.current) {
479
+ var e = x(z.current.type);
479
480
  if (e)
480
481
  return `
481
482
 
@@ -510,29 +511,29 @@ Check the top-level render call using <` + t + ">.");
510
511
  return;
511
512
  _e[t] = !0;
512
513
  var n = "";
513
- e && e._owner && e._owner !== G.current && (n = " It was passed a child from " + j(e._owner.type) + "."), D(e), m('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), D(null);
514
+ e && e._owner && e._owner !== z.current && (n = " It was passed a child from " + x(e._owner.type) + "."), A(e), b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), A(null);
514
515
  }
515
516
  }
516
517
  function we(e, r) {
517
518
  {
518
519
  if (typeof e != "object")
519
520
  return;
520
- if (z(e))
521
+ if (G(e))
521
522
  for (var t = 0; t < e.length; t++) {
522
523
  var n = e[t];
523
- X(n) && Te(n, r);
524
+ Q(n) && Te(n, r);
524
525
  }
525
- else if (X(e))
526
+ else if (Q(e))
526
527
  e._store && (e._store.validated = !0);
527
528
  else if (e) {
528
- var u = Ae(e);
529
- if (typeof u == "function" && u !== e.entries)
530
- for (var c = u.call(e), i; !(i = c.next()).done; )
531
- X(i.value) && Te(i.value, r);
529
+ var o = Ae(e);
530
+ if (typeof o == "function" && o !== e.entries)
531
+ for (var l = o.call(e), i; !(i = l.next()).done; )
532
+ Q(i.value) && Te(i.value, r);
532
533
  }
533
534
  }
534
535
  }
535
- function ur(e) {
536
+ function sr(e) {
536
537
  {
537
538
  var r = e.type;
538
539
  if (r == null || typeof r == "string")
@@ -540,204 +541,204 @@ Check the top-level render call using <` + t + ">.");
540
541
  var t;
541
542
  if (typeof r == "function")
542
543
  t = r.propTypes;
543
- else if (typeof r == "object" && (r.$$typeof === b || // Note: Memo only checks outer props here.
544
+ else if (typeof r == "object" && (r.$$typeof === v || // Note: Memo only checks outer props here.
544
545
  // Inner props are checked in the reconciler.
545
- r.$$typeof === E))
546
+ r.$$typeof === S))
546
547
  t = r.propTypes;
547
548
  else
548
549
  return;
549
550
  if (t) {
550
- var n = j(r);
551
+ var n = x(r);
551
552
  Ke(t, e.props, "prop", n, e);
552
- } else if (r.PropTypes !== void 0 && !Q) {
553
- Q = !0;
554
- var u = j(r);
555
- m("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", u || "Unknown");
553
+ } else if (r.PropTypes !== void 0 && !H) {
554
+ H = !0;
555
+ var o = x(r);
556
+ b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", o || "Unknown");
556
557
  }
557
- typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && m("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
558
+ typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
558
559
  }
559
560
  }
560
- function sr(e) {
561
+ function ur(e) {
561
562
  {
562
563
  for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
563
564
  var n = r[t];
564
565
  if (n !== "children" && n !== "key") {
565
- D(e), m("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), D(null);
566
+ A(e), b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), A(null);
566
567
  break;
567
568
  }
568
569
  }
569
- e.ref !== null && (D(e), m("Invalid attribute `ref` supplied to `React.Fragment`."), D(null));
570
+ e.ref !== null && (A(e), b("Invalid attribute `ref` supplied to `React.Fragment`."), A(null));
570
571
  }
571
572
  }
572
- var xe = {};
573
- function Se(e, r, t, n, u, c) {
573
+ var Se = {};
574
+ function xe(e, r, t, n, o, l) {
574
575
  {
575
- var i = Ve(e);
576
+ var i = Ue(e);
576
577
  if (!i) {
577
578
  var a = "";
578
579
  (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
579
- var y = ir();
580
- y ? a += y : a += Ee();
581
- var d;
582
- e === null ? d = "null" : z(e) ? d = "array" : e !== void 0 && e.$$typeof === s ? (d = "<" + (j(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : d = typeof e, m("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", d, a);
580
+ var R = ir();
581
+ R ? a += R : a += Ee();
582
+ var p;
583
+ e === null ? p = "null" : G(e) ? p = "array" : e !== void 0 && e.$$typeof === f ? (p = "<" + (x(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : p = typeof e, b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", p, a);
583
584
  }
584
- var v = ar(e, r, t, u, c);
585
- if (v == null)
586
- return v;
585
+ var h = ar(e, r, t, o, l);
586
+ if (h == null)
587
+ return h;
587
588
  if (i) {
588
- var _ = r.children;
589
- if (_ !== void 0)
589
+ var T = r.children;
590
+ if (T !== void 0)
590
591
  if (n)
591
- if (z(_)) {
592
- for (var I = 0; I < _.length; I++)
593
- we(_[I], e);
594
- Object.freeze && Object.freeze(_);
592
+ if (G(T)) {
593
+ for (var D = 0; D < T.length; D++)
594
+ we(T[D], e);
595
+ Object.freeze && Object.freeze(T);
595
596
  } else
596
- m("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
597
+ b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
597
598
  else
598
- we(_, e);
599
+ we(T, e);
599
600
  }
600
- if (W.call(r, "key")) {
601
- var k = j(e), R = Object.keys(r).filter(function(pr) {
601
+ if ($.call(r, "key")) {
602
+ var j = x(e), E = Object.keys(r).filter(function(pr) {
602
603
  return pr !== "key";
603
- }), H = R.length > 0 ? "{key: someKey, " + R.join(": ..., ") + ": ...}" : "{key: someKey}";
604
- if (!xe[k + H]) {
605
- var vr = R.length > 0 ? "{" + R.join(": ..., ") + ": ...}" : "{}";
606
- m(`A props object containing a "key" prop is being spread into JSX:
604
+ }), X = E.length > 0 ? "{key: someKey, " + E.join(": ..., ") + ": ...}" : "{key: someKey}";
605
+ if (!Se[j + X]) {
606
+ var vr = E.length > 0 ? "{" + E.join(": ..., ") + ": ...}" : "{}";
607
+ b(`A props object containing a "key" prop is being spread into JSX:
607
608
  let props = %s;
608
609
  <%s {...props} />
609
610
  React keys must be passed directly to JSX without using spread:
610
611
  let props = %s;
611
- <%s key={someKey} {...props} />`, H, k, vr, k), xe[k + H] = !0;
612
+ <%s key={someKey} {...props} />`, X, j, vr, j), Se[j + X] = !0;
612
613
  }
613
614
  }
614
- return e === l ? sr(v) : ur(v), v;
615
+ return e === d ? ur(h) : sr(h), h;
615
616
  }
616
617
  }
617
618
  function lr(e, r, t) {
618
- return Se(e, r, t, !0);
619
+ return xe(e, r, t, !0);
619
620
  }
620
621
  function cr(e, r, t) {
621
- return Se(e, r, t, !1);
622
+ return xe(e, r, t, !1);
622
623
  }
623
624
  var fr = cr, dr = lr;
624
- N.Fragment = l, N.jsx = fr, N.jsxs = dr;
625
- })()), N;
625
+ Y.Fragment = d, Y.jsx = fr, Y.jsxs = dr;
626
+ })()), Y;
626
627
  }
627
628
  var Ce;
628
- function Er() {
629
- return Ce || (Ce = 1, process.env.NODE_ENV === "production" ? q.exports = hr() : q.exports = Rr()), q.exports;
629
+ function _r() {
630
+ return Ce || (Ce = 1, process.env.NODE_ENV === "production" ? q.exports = Rr() : q.exports = Er()), q.exports;
631
+ }
632
+ var F = _r();
633
+ function Tr(u, f = "inhouse", c = !1) {
634
+ const d = O.useRef(!1), s = Fe();
635
+ O.useEffect(() => {
636
+ if (d.current || !u) return;
637
+ const g = mr(u, f), w = g.fields || g, m = g.conversionReport;
638
+ if (m) {
639
+ if (s.setConversionReport(m), console.log("[QuestionnaireRenderer] Schema conversion complete:", {
640
+ totalElements: m.totalElements,
641
+ convertedFields: m.convertedFields,
642
+ droppedFields: m.droppedFields.length,
643
+ warnings: m.warnings.length
644
+ }), m.warnings.length > 0) {
645
+ console.warn("[QuestionnaireRenderer] Conversion warnings detected. Some features may not work as expected.");
646
+ const v = m.warnings.filter((y) => y.impact === "high"), _ = m.warnings.filter((y) => y.impact === "medium");
647
+ v.length > 0 && console.warn(`⚠️ HIGH IMPACT (${v.length}):`, v), _.length > 0 && console.warn(`⚠️ MEDIUM IMPACT (${_.length}):`, _);
648
+ }
649
+ m.droppedFields.length > 0 && console.error("❌ DROPPED FIELDS:", m.droppedFields);
650
+ }
651
+ ee.getState().replaceAll(w), s.preview.set(!0), d.current = !0;
652
+ }, [u, f, s]), O.useEffect(() => {
653
+ s.setHideUnsupportedFields(c);
654
+ }, [c, s]);
655
+ }
656
+ const wr = O.memo(function({ id: f }) {
657
+ const c = ee(O.useCallback((s) => s.byId[f], [f]));
658
+ if (!c) return null;
659
+ const d = hr(c.fieldType);
660
+ return d ? /* @__PURE__ */ F.jsx("div", { className: "mb-1.5", "data-field-type": c.fieldType, "data-field-id": c.id, children: /* @__PURE__ */ F.jsx(d, { field: c }) }) : null;
661
+ });
662
+ function Sr() {
663
+ const u = Fe(), { fields: f } = yr(u.state.isPreview), c = br((s) => s.hideUnsupportedFields), d = gr(() => (c ? f.filter((g) => g.fieldType !== "unsupported") : f).map((g) => g.id), [f, c]);
664
+ return /* @__PURE__ */ F.jsx("div", { children: d.map((s) => /* @__PURE__ */ F.jsx(
665
+ wr,
666
+ {
667
+ id: s
668
+ },
669
+ s
670
+ )) });
630
671
  }
631
- var T = Er();
632
- function _r(o) {
633
- const s = C.useRef(!1), f = ke();
634
- C.useEffect(() => {
635
- s.current || !Array.isArray(o) || (ee.getState().replaceAll(o), f.preview.set(!0), s.current = !0);
636
- }, [o, f.preview]);
672
+ function Pr({
673
+ fields: u,
674
+ schemaType: f = "inhouse",
675
+ onChange: c,
676
+ className: d = "",
677
+ fullHeight: s = !1,
678
+ hideUnsupportedFields: g = !1
679
+ }) {
680
+ Tr(u, f, g), O.useEffect(() => c ? ee.subscribe((v) => {
681
+ const _ = v.order.map((y) => v.byId[y]);
682
+ c(_);
683
+ }) : void 0, [c]);
684
+ const w = [
685
+ "qb-render-root",
686
+ "bg-gray-100",
687
+ "font-titillium",
688
+ s ? "min-h-screen" : "",
689
+ d
690
+ ].filter(Boolean).join(" ");
691
+ return /* @__PURE__ */ F.jsx("div", { className: w, children: /* @__PURE__ */ F.jsx("div", { className: "max-w-4xl mx-auto px-2 pb-8 pt-4", children: /* @__PURE__ */ F.jsx(Sr, {}) }) });
637
692
  }
638
- function Pe(o) {
639
- switch (o.fieldType) {
693
+ function je(u) {
694
+ switch (u.fieldType) {
640
695
  case "input":
641
- return o.answer ? [{ valueString: String(o.answer) }] : [];
696
+ return u.answer ? [{ valueString: String(u.answer) }] : [];
642
697
  case "radio":
643
- return o.selected ? [{ valueString: Z(o, o.selected) }] : [];
698
+ return u.selected ? [{ valueString: Z(u, u.selected) }] : [];
644
699
  case "check":
645
- return (o.selected || []).map((s) => ({ valueString: Z(o, s) }));
700
+ return (u.selected || []).map((f) => ({ valueString: Z(u, f) }));
646
701
  case "selection":
647
- return o.selected ? [{ valueString: Z(o, o.selected) }] : [];
702
+ return u.selected ? [{ valueString: Z(u, u.selected) }] : [];
648
703
  default:
649
704
  return [];
650
705
  }
651
706
  }
652
- function Z(o, s) {
653
- const f = (o.options || []).find((l) => l.id === s || l.value === s);
654
- return f ? f.value : "";
707
+ function Z(u, f) {
708
+ const c = (u.options || []).find((d) => d.id === f || d.value === f);
709
+ return c ? c.value : "";
655
710
  }
656
- function Tr(o, s, f) {
657
- const l = [];
658
- return (o || []).forEach((p) => {
659
- if (p.fieldType === "section" && Array.isArray(p.fields)) {
660
- p.fields.forEach((g) => {
661
- g && l.push({
711
+ function Cr(u, f, c) {
712
+ const d = [];
713
+ return (u || []).forEach((s) => {
714
+ if (s.fieldType === "section" && Array.isArray(s.fields)) {
715
+ s.fields.forEach((g) => {
716
+ g && d.push({
662
717
  linkId: g.id,
663
718
  text: g.question || g.title || "",
664
- answer: Pe(g)
719
+ answer: je(g)
665
720
  });
666
721
  });
667
722
  return;
668
723
  }
669
- p.fieldType !== "section" && l.push({
670
- linkId: p.id,
671
- text: p.question || p.title || "",
672
- answer: Pe(p)
724
+ s.fieldType !== "section" && d.push({
725
+ linkId: s.id,
726
+ text: s.question || s.title || "",
727
+ answer: je(s)
673
728
  });
674
729
  }), {
675
730
  resourceType: "QuestionnaireResponse",
676
- questionnaire: s,
731
+ questionnaire: f,
677
732
  status: "in-progress",
678
- subject: f ? { reference: `Patient/${f}` } : void 0,
679
- item: l
733
+ subject: c ? { reference: `Patient/${c}` } : void 0,
734
+ item: d
680
735
  };
681
736
  }
682
- function wr(o, s, f, l) {
683
- return C.useCallback((g) => {
684
- g.preventDefault();
685
- const w = Tr(o, s, f);
686
- l == null || l(w);
687
- }, [o, s, f, l]);
688
- }
689
- const xr = C.memo(function({ id: s }) {
690
- const f = ee(C.useCallback((p) => p.byId[s], [s]));
691
- if (!f) return null;
692
- const l = mr(f.fieldType);
693
- return l ? /* @__PURE__ */ T.jsx("div", { className: "mb-1.5", "data-field-type": f.fieldType, "data-field-id": f.id, children: /* @__PURE__ */ T.jsx(l, { field: f }) }) : null;
694
- });
695
- function Sr() {
696
- const o = ke(), { fields: s } = yr(o.state.isPreview), f = br(() => s.map((l) => l.id), [s]);
697
- return /* @__PURE__ */ T.jsx("div", { children: f.map((l) => /* @__PURE__ */ T.jsx(
698
- xr,
699
- {
700
- id: l
701
- },
702
- l
703
- )) });
704
- }
705
- function Or({ className: o = "" }) {
706
- return /* @__PURE__ */ T.jsx("div", { className: `pt-2 ${o}`, children: /* @__PURE__ */ T.jsx(
707
- "button",
708
- {
709
- type: "submit",
710
- className: "px-4 py-2 rounded bg-[#0076a8] text-white shadow hover:bg-[#00628a] transition-colors",
711
- children: "Submit"
712
- }
713
- ) });
714
- }
715
- function Pr({
716
- fields: o,
717
- onChange: s,
718
- onSubmit: f,
719
- questionnaireId: l = "questionnaire-1",
720
- subjectId: p,
721
- className: g = "",
722
- fullHeight: w = !1
723
- }) {
724
- _r(o), C.useEffect(() => s ? ee.subscribe((E) => {
725
- const S = E.order.map((F) => E.byId[F]);
726
- s(S);
727
- }) : void 0, [s]);
728
- const x = gr(), b = wr(x, l, p, f), O = [
729
- "qb-render-root",
730
- "bg-gray-100",
731
- "font-titillium",
732
- w ? "min-h-screen" : "",
733
- g
734
- ].filter(Boolean).join(" ");
735
- return /* @__PURE__ */ T.jsx("div", { className: O, children: /* @__PURE__ */ T.jsxs("form", { onSubmit: b, className: "max-w-4xl mx-auto px-2 pb-8 pt-4", children: [
736
- /* @__PURE__ */ T.jsx(Sr, {}),
737
- /* @__PURE__ */ T.jsx(Or, {})
738
- ] }) });
739
- }
740
737
  export {
741
- Pr as QuestionnaireRenderer
738
+ wr as FieldNode,
739
+ Pr as QuestionnaireRenderer,
740
+ Sr as RendererBody,
741
+ Cr as buildQuestionnaireResponse,
742
+ kr as useFieldsArray
742
743
  };
743
744
  //# sourceMappingURL=react.js.map