@socotra/ec-react-utils 2.3.0-next.6 → 2.3.0-next.7
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/index.d.ts +5 -16
- package/dist/index.es.js +269 -276
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +3 -3
package/dist/index.es.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
const q = (e) => {
|
|
2
|
-
const { data: t, scope:
|
|
2
|
+
const { data: t, scope: u, dataTypes: m, rootDisplayName: x, account: h, quote: g, element: y } = e, L = [];
|
|
3
3
|
let k = {};
|
|
4
4
|
const B = Object.fromEntries(
|
|
5
|
-
Object.entries(t ?? {}).filter(([,
|
|
5
|
+
Object.entries(t ?? {}).filter(([, d]) => {
|
|
6
6
|
var M;
|
|
7
|
-
const
|
|
8
|
-
return !!(!
|
|
9
|
-
}).map(([
|
|
10
|
-
var H, G,
|
|
11
|
-
let M = !1, Y = !1,
|
|
12
|
-
const J =
|
|
13
|
-
let o =
|
|
7
|
+
const s = (M = d.scope) == null ? void 0 : M.split(",").map((Y) => Y.trim());
|
|
8
|
+
return !!(!s || u === "P" && (s != null && s.includes("P")) || s != null && s.includes("Q") || u === "Q" && (s != null && s.includes("Q")));
|
|
9
|
+
}).map(([d, s]) => {
|
|
10
|
+
var H, G, c, i, n, r, a, l, f, $, b, D, T, S, C, N, A;
|
|
11
|
+
let M = !1, Y = !1, z = !1;
|
|
12
|
+
const J = s.displayName ?? d, U = (H = s.type) == null ? void 0 : H.slice(-1), V = s.maxLength, Q = s.minLength, j = s.max, E = s.min, F = s.regex;
|
|
13
|
+
let o = s.type ?? "", _;
|
|
14
14
|
switch (U) {
|
|
15
15
|
case "*":
|
|
16
16
|
Y = !0, M = !0, o = o == null ? void 0 : o.split("*")[0];
|
|
@@ -48,26 +48,26 @@ const q = (e) => {
|
|
|
48
48
|
o = "boolean";
|
|
49
49
|
break;
|
|
50
50
|
default:
|
|
51
|
-
|
|
51
|
+
z = !0;
|
|
52
52
|
break;
|
|
53
53
|
}
|
|
54
|
-
if (!M && !
|
|
55
|
-
const
|
|
56
|
-
if (
|
|
54
|
+
if (!M && !z && !Y && L.push(d), z) {
|
|
55
|
+
const O = m == null ? void 0 : m[o];
|
|
56
|
+
if (O) {
|
|
57
57
|
let w = Y ? [] : {};
|
|
58
58
|
const I = q({
|
|
59
|
-
data:
|
|
60
|
-
scope:
|
|
61
|
-
dataTypes:
|
|
62
|
-
rootDisplayName:
|
|
59
|
+
data: O.data ?? {},
|
|
60
|
+
scope: u,
|
|
61
|
+
dataTypes: m,
|
|
62
|
+
rootDisplayName: O.displayName ?? d
|
|
63
63
|
});
|
|
64
|
-
return
|
|
64
|
+
return g && (c = (G = g.element) == null ? void 0 : G.data) != null && c[d] && (w = (n = (i = g.element) == null ? void 0 : i.data) == null ? void 0 : n[d]), y && (r = y == null ? void 0 : y.data) != null && r[d] && (w = (a = y == null ? void 0 : y.data) == null ? void 0 : a[d]), h && (l = h == null ? void 0 : h.data) != null && l[d] && (w = (f = h == null ? void 0 : h.data) == null ? void 0 : f[d]), k = {
|
|
65
65
|
...k,
|
|
66
66
|
[`${o}`]: I
|
|
67
67
|
}, Y ? [
|
|
68
|
-
|
|
68
|
+
d,
|
|
69
69
|
{
|
|
70
|
-
title:
|
|
70
|
+
title: O.displayName ?? d,
|
|
71
71
|
type: "array",
|
|
72
72
|
default: w,
|
|
73
73
|
items: {
|
|
@@ -76,56 +76,56 @@ const q = (e) => {
|
|
|
76
76
|
...!M && { minItems: 1 }
|
|
77
77
|
}
|
|
78
78
|
] : [
|
|
79
|
-
|
|
79
|
+
d,
|
|
80
80
|
{
|
|
81
|
-
title:
|
|
81
|
+
title: O.displayName ?? d,
|
|
82
82
|
default: w,
|
|
83
83
|
$ref: `#/definitions/${o}`
|
|
84
84
|
}
|
|
85
85
|
];
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
let
|
|
89
|
-
if (
|
|
90
|
-
const
|
|
91
|
-
|
|
88
|
+
let v = "";
|
|
89
|
+
if (h) {
|
|
90
|
+
const O = (h == null ? void 0 : h.state) === "validated" ? d.charAt(0).toLowerCase() + d.slice(1) : d;
|
|
91
|
+
v = ($ = h == null ? void 0 : h.data) != null && $[O] ? (b = h == null ? void 0 : h.data) == null ? void 0 : b[O] : o === "boolean" ? !!s.defaultValue : s.defaultValue;
|
|
92
92
|
}
|
|
93
|
-
return
|
|
94
|
-
|
|
93
|
+
return g && (v = (T = (D = g.element) == null ? void 0 : D.data) != null && T[d] ? (C = (S = g.element) == null ? void 0 : S.data) == null ? void 0 : C[d] : o === "boolean" ? !!s.defaultValue : s.defaultValue), y && (v = (N = y == null ? void 0 : y.data) != null && N[d] ? (A = y == null ? void 0 : y.data) == null ? void 0 : A[d] : o === "boolean" ? !!s.defaultValue : s.defaultValue), Y ? [
|
|
94
|
+
d,
|
|
95
95
|
{
|
|
96
96
|
title: J,
|
|
97
97
|
type: "array",
|
|
98
|
-
default:
|
|
98
|
+
default: v,
|
|
99
99
|
items: {
|
|
100
100
|
type: o,
|
|
101
101
|
...V && { maxLength: V },
|
|
102
102
|
...Q && { minLength: Q },
|
|
103
|
-
...
|
|
103
|
+
...E && { min: E },
|
|
104
104
|
...j && { max: j },
|
|
105
105
|
..._ && { format: _ },
|
|
106
|
-
...
|
|
106
|
+
...F && { pattern: s.regex }
|
|
107
107
|
},
|
|
108
108
|
...!M && { minItems: 1 }
|
|
109
109
|
}
|
|
110
110
|
] : [
|
|
111
|
-
|
|
111
|
+
d,
|
|
112
112
|
{
|
|
113
113
|
title: J,
|
|
114
114
|
type: o,
|
|
115
|
-
...
|
|
115
|
+
...v && { default: v },
|
|
116
116
|
...Q && { minLength: Q },
|
|
117
117
|
...V && { maxLength: V },
|
|
118
|
-
...
|
|
118
|
+
...E && { minimum: parseInt(E) },
|
|
119
119
|
...j && { maximum: parseInt(j) },
|
|
120
120
|
..._ && { format: _ },
|
|
121
|
-
...
|
|
122
|
-
...
|
|
121
|
+
...s.options && { enum: s.options },
|
|
122
|
+
...F && { pattern: s.regex }
|
|
123
123
|
}
|
|
124
124
|
];
|
|
125
125
|
})
|
|
126
126
|
);
|
|
127
127
|
return {
|
|
128
|
-
title:
|
|
128
|
+
title: x || "",
|
|
129
129
|
type: "object",
|
|
130
130
|
definitions: k,
|
|
131
131
|
required: L,
|
|
@@ -138,69 +138,69 @@ function te(e) {
|
|
|
138
138
|
}
|
|
139
139
|
var K = { exports: {} };
|
|
140
140
|
(function(e, t) {
|
|
141
|
-
(function(
|
|
142
|
-
e.exports =
|
|
141
|
+
(function(u, m) {
|
|
142
|
+
e.exports = m();
|
|
143
143
|
})(ee, function() {
|
|
144
|
-
var
|
|
145
|
-
var i = ["th", "st", "nd", "rd"], n =
|
|
146
|
-
return "[" +
|
|
147
|
-
} }, V = function(
|
|
148
|
-
var
|
|
149
|
-
return !
|
|
150
|
-
}, Q = { s: V, z: function(
|
|
151
|
-
var i = -
|
|
152
|
-
return (i <= 0 ? "+" : "-") + V(
|
|
153
|
-
}, m: function
|
|
154
|
-
if (i.date() < n.date()) return -
|
|
155
|
-
var
|
|
156
|
-
return +(-(
|
|
157
|
-
}, a: function(
|
|
158
|
-
return
|
|
159
|
-
}, p: function(
|
|
160
|
-
return { M:
|
|
161
|
-
}, u: function(
|
|
162
|
-
return
|
|
163
|
-
} }, j = "en",
|
|
164
|
-
|
|
165
|
-
var
|
|
166
|
-
return
|
|
167
|
-
}, _ = function
|
|
144
|
+
var u = 1e3, m = 6e4, x = 36e5, h = "millisecond", g = "second", y = "minute", L = "hour", k = "day", B = "week", P = "month", d = "quarter", s = "year", M = "date", Y = "Invalid Date", z = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, J = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, U = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(c) {
|
|
145
|
+
var i = ["th", "st", "nd", "rd"], n = c % 100;
|
|
146
|
+
return "[" + c + (i[(n - 20) % 10] || i[n] || i[0]) + "]";
|
|
147
|
+
} }, V = function(c, i, n) {
|
|
148
|
+
var r = String(c);
|
|
149
|
+
return !r || r.length >= i ? c : "" + Array(i + 1 - r.length).join(n) + c;
|
|
150
|
+
}, Q = { s: V, z: function(c) {
|
|
151
|
+
var i = -c.utcOffset(), n = Math.abs(i), r = Math.floor(n / 60), a = n % 60;
|
|
152
|
+
return (i <= 0 ? "+" : "-") + V(r, 2, "0") + ":" + V(a, 2, "0");
|
|
153
|
+
}, m: function c(i, n) {
|
|
154
|
+
if (i.date() < n.date()) return -c(n, i);
|
|
155
|
+
var r = 12 * (n.year() - i.year()) + (n.month() - i.month()), a = i.clone().add(r, P), l = n - a < 0, f = i.clone().add(r + (l ? -1 : 1), P);
|
|
156
|
+
return +(-(r + (n - a) / (l ? a - f : f - a)) || 0);
|
|
157
|
+
}, a: function(c) {
|
|
158
|
+
return c < 0 ? Math.ceil(c) || 0 : Math.floor(c);
|
|
159
|
+
}, p: function(c) {
|
|
160
|
+
return { M: P, y: s, w: B, d: k, D: M, h: L, m: y, s: g, ms: h, Q: d }[c] || String(c || "").toLowerCase().replace(/s$/, "");
|
|
161
|
+
}, u: function(c) {
|
|
162
|
+
return c === void 0;
|
|
163
|
+
} }, j = "en", E = {};
|
|
164
|
+
E[j] = U;
|
|
165
|
+
var F = "$isDayjsObject", o = function(c) {
|
|
166
|
+
return c instanceof H || !(!c || !c[F]);
|
|
167
|
+
}, _ = function c(i, n, r) {
|
|
168
168
|
var a;
|
|
169
169
|
if (!i) return j;
|
|
170
170
|
if (typeof i == "string") {
|
|
171
|
-
var
|
|
172
|
-
|
|
171
|
+
var l = i.toLowerCase();
|
|
172
|
+
E[l] && (a = l), n && (E[l] = n, a = l);
|
|
173
173
|
var f = i.split("-");
|
|
174
|
-
if (!a && f.length > 1) return
|
|
174
|
+
if (!a && f.length > 1) return c(f[0]);
|
|
175
175
|
} else {
|
|
176
|
-
var
|
|
177
|
-
|
|
176
|
+
var $ = i.name;
|
|
177
|
+
E[$] = i, a = $;
|
|
178
178
|
}
|
|
179
|
-
return !
|
|
180
|
-
},
|
|
181
|
-
if (o(
|
|
179
|
+
return !r && a && (j = a), a || !r && j;
|
|
180
|
+
}, v = function(c, i) {
|
|
181
|
+
if (o(c)) return c.clone();
|
|
182
182
|
var n = typeof i == "object" ? i : {};
|
|
183
|
-
return n.date =
|
|
184
|
-
},
|
|
185
|
-
|
|
186
|
-
return
|
|
183
|
+
return n.date = c, n.args = arguments, new H(n);
|
|
184
|
+
}, p = Q;
|
|
185
|
+
p.l = _, p.i = o, p.w = function(c, i) {
|
|
186
|
+
return v(c, { locale: i.$L, utc: i.$u, x: i.$x, $offset: i.$offset });
|
|
187
187
|
};
|
|
188
188
|
var H = function() {
|
|
189
|
-
function
|
|
190
|
-
this.$L = _(n.locale, null, !0), this.parse(n), this.$x = this.$x || n.x || {}, this[
|
|
189
|
+
function c(n) {
|
|
190
|
+
this.$L = _(n.locale, null, !0), this.parse(n), this.$x = this.$x || n.x || {}, this[F] = !0;
|
|
191
191
|
}
|
|
192
|
-
var i =
|
|
192
|
+
var i = c.prototype;
|
|
193
193
|
return i.parse = function(n) {
|
|
194
|
-
this.$d = function(
|
|
195
|
-
var a =
|
|
194
|
+
this.$d = function(r) {
|
|
195
|
+
var a = r.date, l = r.utc;
|
|
196
196
|
if (a === null) return /* @__PURE__ */ new Date(NaN);
|
|
197
|
-
if (
|
|
197
|
+
if (p.u(a)) return /* @__PURE__ */ new Date();
|
|
198
198
|
if (a instanceof Date) return new Date(a);
|
|
199
199
|
if (typeof a == "string" && !/Z$/i.test(a)) {
|
|
200
|
-
var f = a.match(
|
|
200
|
+
var f = a.match(z);
|
|
201
201
|
if (f) {
|
|
202
|
-
var
|
|
203
|
-
return
|
|
202
|
+
var $ = f[2] - 1 || 0, b = (f[7] || "0").substring(0, 3);
|
|
203
|
+
return l ? new Date(Date.UTC(f[1], $, f[3] || 1, f[4] || 0, f[5] || 0, f[6] || 0, b)) : new Date(f[1], $, f[3] || 1, f[4] || 0, f[5] || 0, f[6] || 0, b);
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
206
|
return new Date(a);
|
|
@@ -209,137 +209,137 @@ var K = { exports: {} };
|
|
|
209
209
|
var n = this.$d;
|
|
210
210
|
this.$y = n.getFullYear(), this.$M = n.getMonth(), this.$D = n.getDate(), this.$W = n.getDay(), this.$H = n.getHours(), this.$m = n.getMinutes(), this.$s = n.getSeconds(), this.$ms = n.getMilliseconds();
|
|
211
211
|
}, i.$utils = function() {
|
|
212
|
-
return
|
|
212
|
+
return p;
|
|
213
213
|
}, i.isValid = function() {
|
|
214
214
|
return this.$d.toString() !== Y;
|
|
215
|
-
}, i.isSame = function(n,
|
|
216
|
-
var a =
|
|
217
|
-
return this.startOf(
|
|
218
|
-
}, i.isAfter = function(n,
|
|
219
|
-
return
|
|
220
|
-
}, i.isBefore = function(n,
|
|
221
|
-
return this.endOf(
|
|
222
|
-
}, i.$g = function(n,
|
|
223
|
-
return
|
|
215
|
+
}, i.isSame = function(n, r) {
|
|
216
|
+
var a = v(n);
|
|
217
|
+
return this.startOf(r) <= a && a <= this.endOf(r);
|
|
218
|
+
}, i.isAfter = function(n, r) {
|
|
219
|
+
return v(n) < this.startOf(r);
|
|
220
|
+
}, i.isBefore = function(n, r) {
|
|
221
|
+
return this.endOf(r) < v(n);
|
|
222
|
+
}, i.$g = function(n, r, a) {
|
|
223
|
+
return p.u(n) ? this[r] : this.set(a, n);
|
|
224
224
|
}, i.unix = function() {
|
|
225
225
|
return Math.floor(this.valueOf() / 1e3);
|
|
226
226
|
}, i.valueOf = function() {
|
|
227
227
|
return this.$d.getTime();
|
|
228
|
-
}, i.startOf = function(n,
|
|
229
|
-
var a = this,
|
|
230
|
-
var I =
|
|
231
|
-
return
|
|
232
|
-
},
|
|
233
|
-
return
|
|
234
|
-
}, D = this.$W,
|
|
228
|
+
}, i.startOf = function(n, r) {
|
|
229
|
+
var a = this, l = !!p.u(r) || r, f = p.p(n), $ = function(O, w) {
|
|
230
|
+
var I = p.w(a.$u ? Date.UTC(a.$y, w, O) : new Date(a.$y, w, O), a);
|
|
231
|
+
return l ? I : I.endOf(k);
|
|
232
|
+
}, b = function(O, w) {
|
|
233
|
+
return p.w(a.toDate()[O].apply(a.toDate("s"), (l ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(w)), a);
|
|
234
|
+
}, D = this.$W, T = this.$M, S = this.$D, C = "set" + (this.$u ? "UTC" : "");
|
|
235
235
|
switch (f) {
|
|
236
|
-
case
|
|
237
|
-
return
|
|
238
|
-
case
|
|
239
|
-
return
|
|
236
|
+
case s:
|
|
237
|
+
return l ? $(1, 0) : $(31, 11);
|
|
238
|
+
case P:
|
|
239
|
+
return l ? $(1, T) : $(0, T + 1);
|
|
240
240
|
case B:
|
|
241
241
|
var N = this.$locale().weekStart || 0, A = (D < N ? D + 7 : D) - N;
|
|
242
|
-
return
|
|
242
|
+
return $(l ? S - A : S + (6 - A), T);
|
|
243
243
|
case k:
|
|
244
244
|
case M:
|
|
245
|
-
return
|
|
245
|
+
return b(C + "Hours", 0);
|
|
246
246
|
case L:
|
|
247
|
-
return
|
|
248
|
-
case
|
|
249
|
-
return
|
|
250
|
-
case
|
|
251
|
-
return
|
|
247
|
+
return b(C + "Minutes", 1);
|
|
248
|
+
case y:
|
|
249
|
+
return b(C + "Seconds", 2);
|
|
250
|
+
case g:
|
|
251
|
+
return b(C + "Milliseconds", 3);
|
|
252
252
|
default:
|
|
253
253
|
return this.clone();
|
|
254
254
|
}
|
|
255
255
|
}, i.endOf = function(n) {
|
|
256
256
|
return this.startOf(n, !1);
|
|
257
|
-
}, i.$set = function(n,
|
|
258
|
-
var a,
|
|
259
|
-
if (
|
|
257
|
+
}, i.$set = function(n, r) {
|
|
258
|
+
var a, l = p.p(n), f = "set" + (this.$u ? "UTC" : ""), $ = (a = {}, a[k] = f + "Date", a[M] = f + "Date", a[P] = f + "Month", a[s] = f + "FullYear", a[L] = f + "Hours", a[y] = f + "Minutes", a[g] = f + "Seconds", a[h] = f + "Milliseconds", a)[l], b = l === k ? this.$D + (r - this.$W) : r;
|
|
259
|
+
if (l === P || l === s) {
|
|
260
260
|
var D = this.clone().set(M, 1);
|
|
261
|
-
D.$d[
|
|
262
|
-
} else
|
|
261
|
+
D.$d[$](b), D.init(), this.$d = D.set(M, Math.min(this.$D, D.daysInMonth())).$d;
|
|
262
|
+
} else $ && this.$d[$](b);
|
|
263
263
|
return this.init(), this;
|
|
264
|
-
}, i.set = function(n,
|
|
265
|
-
return this.clone().$set(n,
|
|
264
|
+
}, i.set = function(n, r) {
|
|
265
|
+
return this.clone().$set(n, r);
|
|
266
266
|
}, i.get = function(n) {
|
|
267
|
-
return this[
|
|
268
|
-
}, i.add = function(n,
|
|
269
|
-
var a,
|
|
267
|
+
return this[p.p(n)]();
|
|
268
|
+
}, i.add = function(n, r) {
|
|
269
|
+
var a, l = this;
|
|
270
270
|
n = Number(n);
|
|
271
|
-
var f =
|
|
272
|
-
var
|
|
273
|
-
return
|
|
271
|
+
var f = p.p(r), $ = function(T) {
|
|
272
|
+
var S = v(l);
|
|
273
|
+
return p.w(S.date(S.date() + Math.round(T * n)), l);
|
|
274
274
|
};
|
|
275
|
-
if (f ===
|
|
276
|
-
if (f ===
|
|
277
|
-
if (f === k) return
|
|
278
|
-
if (f === B) return
|
|
279
|
-
var
|
|
280
|
-
return
|
|
281
|
-
}, i.subtract = function(n,
|
|
282
|
-
return this.add(-1 * n,
|
|
275
|
+
if (f === P) return this.set(P, this.$M + n);
|
|
276
|
+
if (f === s) return this.set(s, this.$y + n);
|
|
277
|
+
if (f === k) return $(1);
|
|
278
|
+
if (f === B) return $(7);
|
|
279
|
+
var b = (a = {}, a[y] = m, a[L] = x, a[g] = u, a)[f] || 1, D = this.$d.getTime() + n * b;
|
|
280
|
+
return p.w(D, this);
|
|
281
|
+
}, i.subtract = function(n, r) {
|
|
282
|
+
return this.add(-1 * n, r);
|
|
283
283
|
}, i.format = function(n) {
|
|
284
|
-
var
|
|
284
|
+
var r = this, a = this.$locale();
|
|
285
285
|
if (!this.isValid()) return a.invalidDate || Y;
|
|
286
|
-
var
|
|
287
|
-
return w && (w[I] || w(
|
|
286
|
+
var l = n || "YYYY-MM-DDTHH:mm:ssZ", f = p.z(this), $ = this.$H, b = this.$m, D = this.$M, T = a.weekdays, S = a.months, C = a.meridiem, N = function(w, I, Z, R) {
|
|
287
|
+
return w && (w[I] || w(r, l)) || Z[I].slice(0, R);
|
|
288
288
|
}, A = function(w) {
|
|
289
|
-
return
|
|
290
|
-
},
|
|
289
|
+
return p.s($ % 12 || 12, w, "0");
|
|
290
|
+
}, O = C || function(w, I, Z) {
|
|
291
291
|
var R = w < 12 ? "AM" : "PM";
|
|
292
292
|
return Z ? R.toLowerCase() : R;
|
|
293
293
|
};
|
|
294
|
-
return
|
|
294
|
+
return l.replace(J, function(w, I) {
|
|
295
295
|
return I || function(Z) {
|
|
296
296
|
switch (Z) {
|
|
297
297
|
case "YY":
|
|
298
|
-
return String(
|
|
298
|
+
return String(r.$y).slice(-2);
|
|
299
299
|
case "YYYY":
|
|
300
|
-
return
|
|
300
|
+
return p.s(r.$y, 4, "0");
|
|
301
301
|
case "M":
|
|
302
302
|
return D + 1;
|
|
303
303
|
case "MM":
|
|
304
|
-
return
|
|
304
|
+
return p.s(D + 1, 2, "0");
|
|
305
305
|
case "MMM":
|
|
306
|
-
return N(a.monthsShort, D,
|
|
306
|
+
return N(a.monthsShort, D, S, 3);
|
|
307
307
|
case "MMMM":
|
|
308
|
-
return N(
|
|
308
|
+
return N(S, D);
|
|
309
309
|
case "D":
|
|
310
|
-
return
|
|
310
|
+
return r.$D;
|
|
311
311
|
case "DD":
|
|
312
|
-
return
|
|
312
|
+
return p.s(r.$D, 2, "0");
|
|
313
313
|
case "d":
|
|
314
|
-
return String(
|
|
314
|
+
return String(r.$W);
|
|
315
315
|
case "dd":
|
|
316
|
-
return N(a.weekdaysMin,
|
|
316
|
+
return N(a.weekdaysMin, r.$W, T, 2);
|
|
317
317
|
case "ddd":
|
|
318
|
-
return N(a.weekdaysShort,
|
|
318
|
+
return N(a.weekdaysShort, r.$W, T, 3);
|
|
319
319
|
case "dddd":
|
|
320
|
-
return
|
|
320
|
+
return T[r.$W];
|
|
321
321
|
case "H":
|
|
322
|
-
return String(
|
|
322
|
+
return String($);
|
|
323
323
|
case "HH":
|
|
324
|
-
return
|
|
324
|
+
return p.s($, 2, "0");
|
|
325
325
|
case "h":
|
|
326
326
|
return A(1);
|
|
327
327
|
case "hh":
|
|
328
328
|
return A(2);
|
|
329
329
|
case "a":
|
|
330
|
-
return
|
|
330
|
+
return O($, b, !0);
|
|
331
331
|
case "A":
|
|
332
|
-
return
|
|
332
|
+
return O($, b, !1);
|
|
333
333
|
case "m":
|
|
334
|
-
return String(
|
|
334
|
+
return String(b);
|
|
335
335
|
case "mm":
|
|
336
|
-
return
|
|
336
|
+
return p.s(b, 2, "0");
|
|
337
337
|
case "s":
|
|
338
|
-
return String(
|
|
338
|
+
return String(r.$s);
|
|
339
339
|
case "ss":
|
|
340
|
-
return
|
|
340
|
+
return p.s(r.$s, 2, "0");
|
|
341
341
|
case "SSS":
|
|
342
|
-
return
|
|
342
|
+
return p.s(r.$ms, 3, "0");
|
|
343
343
|
case "Z":
|
|
344
344
|
return f;
|
|
345
345
|
}
|
|
@@ -348,49 +348,49 @@ var K = { exports: {} };
|
|
|
348
348
|
});
|
|
349
349
|
}, i.utcOffset = function() {
|
|
350
350
|
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
351
|
-
}, i.diff = function(n,
|
|
352
|
-
var
|
|
353
|
-
return
|
|
351
|
+
}, i.diff = function(n, r, a) {
|
|
352
|
+
var l, f = this, $ = p.p(r), b = v(n), D = (b.utcOffset() - this.utcOffset()) * m, T = this - b, S = function() {
|
|
353
|
+
return p.m(f, b);
|
|
354
354
|
};
|
|
355
|
-
switch (
|
|
356
|
-
case
|
|
357
|
-
|
|
355
|
+
switch ($) {
|
|
356
|
+
case s:
|
|
357
|
+
l = S() / 12;
|
|
358
358
|
break;
|
|
359
|
-
case
|
|
360
|
-
|
|
359
|
+
case P:
|
|
360
|
+
l = S();
|
|
361
361
|
break;
|
|
362
|
-
case
|
|
363
|
-
|
|
362
|
+
case d:
|
|
363
|
+
l = S() / 3;
|
|
364
364
|
break;
|
|
365
365
|
case B:
|
|
366
|
-
|
|
366
|
+
l = (T - D) / 6048e5;
|
|
367
367
|
break;
|
|
368
368
|
case k:
|
|
369
|
-
|
|
369
|
+
l = (T - D) / 864e5;
|
|
370
370
|
break;
|
|
371
371
|
case L:
|
|
372
|
-
|
|
372
|
+
l = T / x;
|
|
373
373
|
break;
|
|
374
|
-
case
|
|
375
|
-
|
|
374
|
+
case y:
|
|
375
|
+
l = T / m;
|
|
376
376
|
break;
|
|
377
|
-
case
|
|
378
|
-
|
|
377
|
+
case g:
|
|
378
|
+
l = T / u;
|
|
379
379
|
break;
|
|
380
380
|
default:
|
|
381
|
-
|
|
381
|
+
l = T;
|
|
382
382
|
}
|
|
383
|
-
return a ?
|
|
383
|
+
return a ? l : p.a(l);
|
|
384
384
|
}, i.daysInMonth = function() {
|
|
385
|
-
return this.endOf(
|
|
385
|
+
return this.endOf(P).$D;
|
|
386
386
|
}, i.$locale = function() {
|
|
387
|
-
return
|
|
388
|
-
}, i.locale = function(n,
|
|
387
|
+
return E[this.$L];
|
|
388
|
+
}, i.locale = function(n, r) {
|
|
389
389
|
if (!n) return this.$L;
|
|
390
|
-
var a = this.clone(),
|
|
391
|
-
return
|
|
390
|
+
var a = this.clone(), l = _(n, r, !0);
|
|
391
|
+
return l && (a.$L = l), a;
|
|
392
392
|
}, i.clone = function() {
|
|
393
|
-
return
|
|
393
|
+
return p.w(this.$d, this);
|
|
394
394
|
}, i.toDate = function() {
|
|
395
395
|
return new Date(this.valueOf());
|
|
396
396
|
}, i.toJSON = function() {
|
|
@@ -399,32 +399,32 @@ var K = { exports: {} };
|
|
|
399
399
|
return this.$d.toISOString();
|
|
400
400
|
}, i.toString = function() {
|
|
401
401
|
return this.$d.toUTCString();
|
|
402
|
-
},
|
|
402
|
+
}, c;
|
|
403
403
|
}(), G = H.prototype;
|
|
404
|
-
return
|
|
405
|
-
G[
|
|
406
|
-
return this.$g(i,
|
|
404
|
+
return v.prototype = G, [["$ms", h], ["$s", g], ["$m", y], ["$H", L], ["$W", k], ["$M", P], ["$y", s], ["$D", M]].forEach(function(c) {
|
|
405
|
+
G[c[1]] = function(i) {
|
|
406
|
+
return this.$g(i, c[0], c[1]);
|
|
407
407
|
};
|
|
408
|
-
}),
|
|
409
|
-
return
|
|
410
|
-
},
|
|
411
|
-
return
|
|
412
|
-
},
|
|
408
|
+
}), v.extend = function(c, i) {
|
|
409
|
+
return c.$i || (c(i, H, v), c.$i = !0), v;
|
|
410
|
+
}, v.locale = _, v.isDayjs = o, v.unix = function(c) {
|
|
411
|
+
return v(1e3 * c);
|
|
412
|
+
}, v.en = E[j], v.Ls = E, v.p = {}, v;
|
|
413
413
|
});
|
|
414
414
|
})(K);
|
|
415
415
|
var ne = K.exports;
|
|
416
|
-
const W = /* @__PURE__ */ te(ne),
|
|
417
|
-
const t = {},
|
|
418
|
-
return
|
|
416
|
+
const W = /* @__PURE__ */ te(ne), se = ({ data: e }) => {
|
|
417
|
+
const t = {}, u = { ...e };
|
|
418
|
+
return u.default && (u.default.startTime && (t.startTime = W(u.default.startTime).format()), u.default.endTime && (t.endTime = W(u.default.endTime).format()), u.default.expirationTime && (t.expirationTime = W(u.default.expirationTime).format())), u.advanced && (u.advanced.currency && (t.currency = u.advanced.currency), u.advanced.timezone && (t.timezone = u.advanced.timezone), u.advanced.billingPlan && (t.billingPlan = u.advanced.billingPlan), u.advanced.defaultTermDuration && (t.defaultTermDuration = u.advanced.defaultTermDuration), u.advanced.installmentPlan && (t.installmentPlan = u.advanced.installmentPlan), u.advanced.durationBasis && (t.durationBasis = u.advanced.durationBasis), u.advanced.delinquencyPlanName && (t.delinquencyPlanName = u.advanced.delinquencyPlanName)), delete u.default, delete u.advanced, t.setData = u, t;
|
|
419
419
|
};
|
|
420
|
-
function
|
|
420
|
+
function re(e) {
|
|
421
421
|
return e == null ? void 0 : e.map((t) => (t.keyword === "pattern" && (t.message = `Invalid format, must match pattern ${t.params.pattern}`), t.keyword === "format" && (t.message = "Invalid format"), t.keyword === "required" && (t.message = "Required"), t.keyword === "minItems" && (t.message = `Must have at least ${t.params.limit} item${t.params.limit !== 1 ? "s" : ""}`), t.keyword === "maxItems" && (t.message = `Must have at most ${t.params.limit} item${t.params.limit !== 1 ? "s" : ""}`), t.keyword === "type" && (t.message = "Invalid format"), t.keyword === "maxLength" && (t.message = `Must be at most ${t.params.limit} character${t.params.limit !== 1 ? "s" : ""}`), t.keyword === "minLength" && (t.message = `Must be at least ${t.params.limit} character${t.params.limit !== 1 ? "s" : ""}`), t.keyword === "minimum" && (t.message = `Must be greater than or equal to ${t.params.limit}`), t.keyword === "maximum" && (t.message = `Must be less than or equal to ${t.params.limit}`), t.keyword === "enum" && (t.message = "Invalid value"), t));
|
|
422
422
|
}
|
|
423
|
-
const
|
|
424
|
-
var
|
|
423
|
+
const ue = (e, t, u) => {
|
|
424
|
+
var m, x;
|
|
425
425
|
return {
|
|
426
|
-
...((
|
|
427
|
-
...(
|
|
426
|
+
...((m = e == null ? void 0 : e.element) == null ? void 0 : m.data) && {
|
|
427
|
+
...(x = e == null ? void 0 : e.element) == null ? void 0 : x.data
|
|
428
428
|
},
|
|
429
429
|
default: {
|
|
430
430
|
// set date to yyyy-MM-dd format if it exists
|
|
@@ -439,9 +439,9 @@ const le = (e, t, s) => {
|
|
|
439
439
|
}
|
|
440
440
|
},
|
|
441
441
|
advanced: {
|
|
442
|
-
currency: (e == null ? void 0 : e.currency) ?? t.defaultCurrency ??
|
|
443
|
-
timezone: (e == null ? void 0 : e.timezone) ?? t.defaultTimeZone ??
|
|
444
|
-
billingLevel: (e == null ? void 0 : e.billingLevel) ?? t.defaultBillingLevel ??
|
|
442
|
+
currency: (e == null ? void 0 : e.currency) ?? t.defaultCurrency ?? u.defaultCurrency ?? void 0,
|
|
443
|
+
timezone: (e == null ? void 0 : e.timezone) ?? t.defaultTimeZone ?? u.defaultTimeZone ?? void 0,
|
|
444
|
+
billingLevel: (e == null ? void 0 : e.billingLevel) ?? t.defaultBillingLevel ?? u.defaultBillingLevel ?? void 0,
|
|
445
445
|
billingTrigger: (e == null ? void 0 : e.billingTrigger) ?? t.defaultBillingTrigger,
|
|
446
446
|
durationBasis: (e == null ? void 0 : e.durationBasis) ?? t.defaultDurationBasis ?? void 0,
|
|
447
447
|
delinquencyPlanName: (e == null ? void 0 : e.delinquencyPlanName) ?? (t == null ? void 0 : t.defaultDelinquencyPlan) ?? void 0,
|
|
@@ -451,105 +451,98 @@ const le = (e, t, s) => {
|
|
|
451
451
|
}, ce = (e) => ({
|
|
452
452
|
...e.data,
|
|
453
453
|
coverageTerms: e.coverageTerms ?? {}
|
|
454
|
-
}),
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
return Object.keys(e.exposures ?? {}).forEach((b) => {
|
|
461
|
-
b === d && (s = e.exposures ? e.exposures[b] : {});
|
|
462
|
-
}), s || Object.keys(e.coverages ?? {}).forEach((b) => {
|
|
463
|
-
b === d && (s = e.coverages ? e.coverages[b] : {});
|
|
464
|
-
}), s || Object.keys(e.policyLines ?? {}).forEach((b) => {
|
|
465
|
-
b === d && (s = e.policyLines ? e.policyLines[b] : {});
|
|
466
|
-
}), s || Object.keys(e.exposureGroups ?? {}).forEach((b) => {
|
|
467
|
-
b === d && (s = e.exposureGroups ? e.exposureGroups[b] : {});
|
|
468
|
-
}), s;
|
|
469
|
-
}, X = (e, t) => {
|
|
470
|
-
for (const s of e) {
|
|
471
|
-
if (s.locator === t)
|
|
472
|
-
return s;
|
|
473
|
-
const d = X(
|
|
474
|
-
s.elements ?? [],
|
|
454
|
+
}), X = (e, t) => {
|
|
455
|
+
for (const u of e) {
|
|
456
|
+
if (u.locator === t)
|
|
457
|
+
return u;
|
|
458
|
+
const m = X(
|
|
459
|
+
u.elements ?? [],
|
|
475
460
|
t
|
|
476
461
|
);
|
|
477
|
-
if (
|
|
478
|
-
return
|
|
462
|
+
if (m)
|
|
463
|
+
return m;
|
|
479
464
|
}
|
|
480
465
|
return !1;
|
|
481
|
-
},
|
|
482
|
-
var
|
|
483
|
-
return ((
|
|
484
|
-
((
|
|
466
|
+
}, ae = (e, t) => {
|
|
467
|
+
var u, m;
|
|
468
|
+
return ((u = e.element) == null ? void 0 : u.locator) === t ? e.element : X(
|
|
469
|
+
((m = e.element) == null ? void 0 : m.elements) ?? [],
|
|
485
470
|
t
|
|
486
471
|
);
|
|
487
|
-
},
|
|
472
|
+
}, le = ({
|
|
488
473
|
dataModel: e,
|
|
489
474
|
quote: t,
|
|
490
|
-
elementLocator:
|
|
475
|
+
elementLocator: u
|
|
491
476
|
}) => {
|
|
492
|
-
const
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
),
|
|
477
|
+
const m = ae(t, u);
|
|
478
|
+
if (!m)
|
|
479
|
+
return {};
|
|
480
|
+
let x = !1;
|
|
481
|
+
const h = m.type.split("Quote")[0];
|
|
482
|
+
return Object.keys(e.exposures ?? {}).forEach((g) => {
|
|
483
|
+
g === h && (x = e.exposures ? e.exposures[g] : {});
|
|
484
|
+
}), x || Object.keys(e.coverages ?? {}).forEach((g) => {
|
|
485
|
+
g === h && (x = e.coverages ? e.coverages[g] : {});
|
|
486
|
+
}), x || Object.keys(e.policyLines ?? {}).forEach((g) => {
|
|
487
|
+
g === h && (x = e.policyLines ? e.policyLines[g] : {});
|
|
488
|
+
}), x || Object.keys(e.exposureGroups ?? {}).forEach((g) => {
|
|
489
|
+
g === h && (x = e.exposureGroups ? e.exposureGroups[g] : {});
|
|
490
|
+
}), x;
|
|
491
|
+
}, fe = (e, t) => e.filter(
|
|
492
|
+
(m) => m.type === `${t}Quote`
|
|
493
|
+
), oe = ({
|
|
500
494
|
dataModel: e,
|
|
501
495
|
element: { productName: t }
|
|
502
|
-
}) => e.products[t] ?? {},
|
|
503
|
-
var
|
|
496
|
+
}) => e.products[t] ?? {}, ie = (e) => {
|
|
497
|
+
var m;
|
|
504
498
|
e = e ?? "";
|
|
505
|
-
const t = e.replace(/\?|\*|!|\+/g, ""),
|
|
499
|
+
const t = e.replace(/\?|\*|!|\+/g, ""), u = (m = e.match(/\?|\*|!|\+/g)) == null ? void 0 : m.pop();
|
|
506
500
|
return {
|
|
507
501
|
name: t,
|
|
508
|
-
quantifier:
|
|
502
|
+
quantifier: u ?? ""
|
|
509
503
|
};
|
|
510
|
-
},
|
|
504
|
+
}, de = ({
|
|
511
505
|
dataModel: e,
|
|
512
506
|
contents: t
|
|
513
507
|
}) => {
|
|
514
|
-
const
|
|
515
|
-
const { name: M } =
|
|
508
|
+
const u = e.exposures ?? {}, m = e.coverages ?? {}, x = e.policyLines ?? {}, h = e.exposureGroups ?? {}, y = (t ?? []).map((s) => {
|
|
509
|
+
const { name: M } = ie(s);
|
|
516
510
|
return M;
|
|
517
|
-
}), L = Object.keys(
|
|
518
|
-
(
|
|
519
|
-
), k = Object.keys(
|
|
520
|
-
(
|
|
521
|
-
), B = Object.keys(
|
|
522
|
-
(
|
|
523
|
-
),
|
|
524
|
-
|
|
525
|
-
).filter((
|
|
511
|
+
}), L = Object.keys(u).filter(
|
|
512
|
+
(s) => y.includes(s)
|
|
513
|
+
), k = Object.keys(m).filter(
|
|
514
|
+
(s) => y.includes(s)
|
|
515
|
+
), B = Object.keys(x).filter(
|
|
516
|
+
(s) => y.includes(s)
|
|
517
|
+
), P = Object.keys(
|
|
518
|
+
h
|
|
519
|
+
).filter((s) => y.includes(s)), d = {
|
|
526
520
|
coverages: {},
|
|
527
521
|
exposures: {},
|
|
528
522
|
policyLines: {},
|
|
529
523
|
exposureGroups: {}
|
|
530
524
|
};
|
|
531
|
-
for (const
|
|
532
|
-
|
|
533
|
-
for (const
|
|
534
|
-
|
|
535
|
-
for (const
|
|
536
|
-
|
|
537
|
-
for (const
|
|
538
|
-
|
|
539
|
-
return
|
|
525
|
+
for (const s of L)
|
|
526
|
+
d.exposures[s] = u[s];
|
|
527
|
+
for (const s of k)
|
|
528
|
+
d.coverages[s] = m[s];
|
|
529
|
+
for (const s of B)
|
|
530
|
+
d.policyLines[s] = x[s];
|
|
531
|
+
for (const s of P)
|
|
532
|
+
d.exposureGroups[s] = h[s];
|
|
533
|
+
return d;
|
|
540
534
|
};
|
|
541
535
|
export {
|
|
542
536
|
q as dataModelToJSONSchema,
|
|
543
|
-
|
|
544
|
-
ae as
|
|
545
|
-
|
|
546
|
-
oe as
|
|
547
|
-
de as
|
|
548
|
-
me as extractProductElements,
|
|
537
|
+
le as extractElementDataModel,
|
|
538
|
+
ae as extractElementFromQuote,
|
|
539
|
+
fe as extractElementsFromQuote,
|
|
540
|
+
oe as extractProductDataModel,
|
|
541
|
+
de as extractProductElements,
|
|
549
542
|
ce as getDefaultElementValues,
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
543
|
+
ue as getDefaultQuoteValues,
|
|
544
|
+
se as getQuoteRequest,
|
|
545
|
+
ie as splitInputAndQuantifier,
|
|
546
|
+
re as transformErrors
|
|
554
547
|
};
|
|
555
548
|
//# sourceMappingURL=index.es.js.map
|