@arche-mc2/vue-ui-lib 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2720 @@
1
+ import "vue";
2
+ function U(u) {
3
+ return typeof u == "string" || u instanceof String;
4
+ }
5
+ function At(u) {
6
+ var t;
7
+ return typeof u == "object" && u != null && (u == null || (t = u.constructor) == null ? void 0 : t.name) === "Object";
8
+ }
9
+ function wt(u, t) {
10
+ return Array.isArray(t) ? wt(u, (e, s) => t.includes(s)) : Object.entries(u).reduce((e, s) => {
11
+ let [i, n] = s;
12
+ return t(n, i) && (e[i] = n), e;
13
+ }, {});
14
+ }
15
+ const c = {
16
+ NONE: "NONE",
17
+ LEFT: "LEFT",
18
+ FORCE_LEFT: "FORCE_LEFT",
19
+ RIGHT: "RIGHT",
20
+ FORCE_RIGHT: "FORCE_RIGHT"
21
+ };
22
+ function Nt(u) {
23
+ switch (u) {
24
+ case c.LEFT:
25
+ return c.FORCE_LEFT;
26
+ case c.RIGHT:
27
+ return c.FORCE_RIGHT;
28
+ default:
29
+ return u;
30
+ }
31
+ }
32
+ function gt(u) {
33
+ return u.replace(/([.*+?^=!:${}()|[\]/\\])/g, "\\$1");
34
+ }
35
+ function ut(u, t) {
36
+ if (t === u) return !0;
37
+ const e = Array.isArray(t), s = Array.isArray(u);
38
+ let i;
39
+ if (e && s) {
40
+ if (t.length != u.length) return !1;
41
+ for (i = 0; i < t.length; i++) if (!ut(t[i], u[i])) return !1;
42
+ return !0;
43
+ }
44
+ if (e != s) return !1;
45
+ if (t && u && typeof t == "object" && typeof u == "object") {
46
+ const n = t instanceof Date, r = u instanceof Date;
47
+ if (n && r) return t.getTime() == u.getTime();
48
+ if (n != r) return !1;
49
+ const a = t instanceof RegExp, h = u instanceof RegExp;
50
+ if (a && h) return t.toString() == u.toString();
51
+ if (a != h) return !1;
52
+ const d = Object.keys(t);
53
+ for (i = 0; i < d.length; i++) if (!Object.prototype.hasOwnProperty.call(u, d[i])) return !1;
54
+ for (i = 0; i < d.length; i++) if (!ut(u[d[i]], t[d[i]])) return !1;
55
+ return !0;
56
+ } else if (t && u && typeof t == "function" && typeof u == "function")
57
+ return t.toString() === u.toString();
58
+ return !1;
59
+ }
60
+ class Ut {
61
+ /** Current input value */
62
+ /** Current cursor position */
63
+ /** Old input value */
64
+ /** Old selection */
65
+ constructor(t) {
66
+ for (Object.assign(this, t); this.value.slice(0, this.startChangePos) !== this.oldValue.slice(0, this.startChangePos); )
67
+ --this.oldSelection.start;
68
+ if (this.insertedCount)
69
+ for (; this.value.slice(this.cursorPos) !== this.oldValue.slice(this.oldSelection.end); )
70
+ this.value.length - this.cursorPos < this.oldValue.length - this.oldSelection.end ? ++this.oldSelection.end : ++this.cursorPos;
71
+ }
72
+ /** Start changing position */
73
+ get startChangePos() {
74
+ return Math.min(this.cursorPos, this.oldSelection.start);
75
+ }
76
+ /** Inserted symbols count */
77
+ get insertedCount() {
78
+ return this.cursorPos - this.startChangePos;
79
+ }
80
+ /** Inserted symbols */
81
+ get inserted() {
82
+ return this.value.substr(this.startChangePos, this.insertedCount);
83
+ }
84
+ /** Removed symbols count */
85
+ get removedCount() {
86
+ return Math.max(this.oldSelection.end - this.startChangePos || // for Delete
87
+ this.oldValue.length - this.value.length, 0);
88
+ }
89
+ /** Removed symbols */
90
+ get removed() {
91
+ return this.oldValue.substr(this.startChangePos, this.removedCount);
92
+ }
93
+ /** Unchanged head symbols */
94
+ get head() {
95
+ return this.value.substring(0, this.startChangePos);
96
+ }
97
+ /** Unchanged tail symbols */
98
+ get tail() {
99
+ return this.value.substring(this.startChangePos + this.insertedCount);
100
+ }
101
+ /** Remove direction */
102
+ get removeDirection() {
103
+ return !this.removedCount || this.insertedCount ? c.NONE : (this.oldSelection.end === this.cursorPos || this.oldSelection.start === this.cursorPos) && // if not range removed (event with backspace)
104
+ this.oldSelection.end === this.oldSelection.start ? c.RIGHT : c.LEFT;
105
+ }
106
+ }
107
+ function _(u, t) {
108
+ return new _.InputMask(u, t);
109
+ }
110
+ function Mt(u) {
111
+ if (u == null) throw new Error("mask property should be defined");
112
+ return u instanceof RegExp ? _.MaskedRegExp : U(u) ? _.MaskedPattern : u === Date ? _.MaskedDate : u === Number ? _.MaskedNumber : Array.isArray(u) || u === Array ? _.MaskedDynamic : _.Masked && u.prototype instanceof _.Masked ? u : _.Masked && u instanceof _.Masked ? u.constructor : u instanceof Function ? _.MaskedFunction : (console.warn("Mask not found for mask", u), _.Masked);
113
+ }
114
+ function X(u) {
115
+ if (!u) throw new Error("Options in not defined");
116
+ if (_.Masked) {
117
+ if (u.prototype instanceof _.Masked) return {
118
+ mask: u
119
+ };
120
+ const {
121
+ mask: t = void 0,
122
+ ...e
123
+ } = u instanceof _.Masked ? {
124
+ mask: u
125
+ } : At(u) && u.mask instanceof _.Masked ? u : {};
126
+ if (t) {
127
+ const s = t.mask;
128
+ return {
129
+ ...wt(t, (i, n) => !n.startsWith("_")),
130
+ mask: t.constructor,
131
+ _mask: s,
132
+ ...e
133
+ };
134
+ }
135
+ }
136
+ return At(u) ? {
137
+ ...u
138
+ } : {
139
+ mask: u
140
+ };
141
+ }
142
+ function L(u) {
143
+ if (_.Masked && u instanceof _.Masked) return u;
144
+ const t = X(u), e = Mt(t.mask);
145
+ if (!e) throw new Error("Masked class is not found for provided mask " + t.mask + ", appropriate module needs to be imported manually before creating mask.");
146
+ return t.mask === e && delete t.mask, t._mask && (t.mask = t._mask, delete t._mask), new e(t);
147
+ }
148
+ _.createMask = L;
149
+ class vt {
150
+ /** */
151
+ /** */
152
+ /** */
153
+ /** Safely returns selection start */
154
+ get selectionStart() {
155
+ let t;
156
+ try {
157
+ t = this._unsafeSelectionStart;
158
+ } catch {
159
+ }
160
+ return t ?? this.value.length;
161
+ }
162
+ /** Safely returns selection end */
163
+ get selectionEnd() {
164
+ let t;
165
+ try {
166
+ t = this._unsafeSelectionEnd;
167
+ } catch {
168
+ }
169
+ return t ?? this.value.length;
170
+ }
171
+ /** Safely sets element selection */
172
+ select(t, e) {
173
+ if (!(t == null || e == null || t === this.selectionStart && e === this.selectionEnd))
174
+ try {
175
+ this._unsafeSelect(t, e);
176
+ } catch {
177
+ }
178
+ }
179
+ /** */
180
+ get isActive() {
181
+ return !1;
182
+ }
183
+ /** */
184
+ /** */
185
+ /** */
186
+ }
187
+ _.MaskElement = vt;
188
+ const Ft = 90, Yt = 89;
189
+ class ot extends vt {
190
+ /** HTMLElement to use mask on */
191
+ constructor(t) {
192
+ super(), this.input = t, this._onKeydown = this._onKeydown.bind(this), this._onInput = this._onInput.bind(this), this._onBeforeinput = this._onBeforeinput.bind(this), this._onCompositionEnd = this._onCompositionEnd.bind(this);
193
+ }
194
+ get rootElement() {
195
+ var t, e, s;
196
+ return (t = (e = (s = this.input).getRootNode) == null ? void 0 : e.call(s)) != null ? t : document;
197
+ }
198
+ /** Is element in focus */
199
+ get isActive() {
200
+ return this.input === this.rootElement.activeElement;
201
+ }
202
+ /** Binds HTMLElement events to mask internal events */
203
+ bindEvents(t) {
204
+ this.input.addEventListener("keydown", this._onKeydown), this.input.addEventListener("input", this._onInput), this.input.addEventListener("beforeinput", this._onBeforeinput), this.input.addEventListener("compositionend", this._onCompositionEnd), this.input.addEventListener("drop", t.drop), this.input.addEventListener("click", t.click), this.input.addEventListener("focus", t.focus), this.input.addEventListener("blur", t.commit), this._handlers = t;
205
+ }
206
+ _onKeydown(t) {
207
+ if (this._handlers.redo && (t.keyCode === Ft && t.shiftKey && (t.metaKey || t.ctrlKey) || t.keyCode === Yt && t.ctrlKey))
208
+ return t.preventDefault(), this._handlers.redo(t);
209
+ if (this._handlers.undo && t.keyCode === Ft && (t.metaKey || t.ctrlKey))
210
+ return t.preventDefault(), this._handlers.undo(t);
211
+ t.isComposing || this._handlers.selectionChange(t);
212
+ }
213
+ _onBeforeinput(t) {
214
+ if (t.inputType === "historyUndo" && this._handlers.undo)
215
+ return t.preventDefault(), this._handlers.undo(t);
216
+ if (t.inputType === "historyRedo" && this._handlers.redo)
217
+ return t.preventDefault(), this._handlers.redo(t);
218
+ }
219
+ _onCompositionEnd(t) {
220
+ this._handlers.input(t);
221
+ }
222
+ _onInput(t) {
223
+ t.isComposing || this._handlers.input(t);
224
+ }
225
+ /** Unbinds HTMLElement events to mask internal events */
226
+ unbindEvents() {
227
+ this.input.removeEventListener("keydown", this._onKeydown), this.input.removeEventListener("input", this._onInput), this.input.removeEventListener("beforeinput", this._onBeforeinput), this.input.removeEventListener("compositionend", this._onCompositionEnd), this.input.removeEventListener("drop", this._handlers.drop), this.input.removeEventListener("click", this._handlers.click), this.input.removeEventListener("focus", this._handlers.focus), this.input.removeEventListener("blur", this._handlers.commit), this._handlers = {};
228
+ }
229
+ }
230
+ _.HTMLMaskElement = ot;
231
+ class Ht extends ot {
232
+ /** InputElement to use mask on */
233
+ constructor(t) {
234
+ super(t), this.input = t;
235
+ }
236
+ /** Returns InputElement selection start */
237
+ get _unsafeSelectionStart() {
238
+ return this.input.selectionStart != null ? this.input.selectionStart : this.value.length;
239
+ }
240
+ /** Returns InputElement selection end */
241
+ get _unsafeSelectionEnd() {
242
+ return this.input.selectionEnd;
243
+ }
244
+ /** Sets InputElement selection */
245
+ _unsafeSelect(t, e) {
246
+ this.input.setSelectionRange(t, e);
247
+ }
248
+ get value() {
249
+ return this.input.value;
250
+ }
251
+ set value(t) {
252
+ this.input.value = t;
253
+ }
254
+ }
255
+ _.HTMLMaskElement = ot;
256
+ class bt extends ot {
257
+ /** Returns HTMLElement selection start */
258
+ get _unsafeSelectionStart() {
259
+ const t = this.rootElement, e = t.getSelection && t.getSelection(), s = e && e.anchorOffset, i = e && e.focusOffset;
260
+ return i == null || s == null || s < i ? s : i;
261
+ }
262
+ /** Returns HTMLElement selection end */
263
+ get _unsafeSelectionEnd() {
264
+ const t = this.rootElement, e = t.getSelection && t.getSelection(), s = e && e.anchorOffset, i = e && e.focusOffset;
265
+ return i == null || s == null || s > i ? s : i;
266
+ }
267
+ /** Sets HTMLElement selection */
268
+ _unsafeSelect(t, e) {
269
+ if (!this.rootElement.createRange) return;
270
+ const s = this.rootElement.createRange();
271
+ s.setStart(this.input.firstChild || this.input, t), s.setEnd(this.input.lastChild || this.input, e);
272
+ const i = this.rootElement, n = i.getSelection && i.getSelection();
273
+ n && (n.removeAllRanges(), n.addRange(s));
274
+ }
275
+ /** HTMLElement value */
276
+ get value() {
277
+ return this.input.textContent || "";
278
+ }
279
+ set value(t) {
280
+ this.input.textContent = t;
281
+ }
282
+ }
283
+ _.HTMLContenteditableMaskElement = bt;
284
+ class lt {
285
+ constructor() {
286
+ this.states = [], this.currentIndex = 0;
287
+ }
288
+ get currentState() {
289
+ return this.states[this.currentIndex];
290
+ }
291
+ get isEmpty() {
292
+ return this.states.length === 0;
293
+ }
294
+ push(t) {
295
+ this.currentIndex < this.states.length - 1 && (this.states.length = this.currentIndex + 1), this.states.push(t), this.states.length > lt.MAX_LENGTH && this.states.shift(), this.currentIndex = this.states.length - 1;
296
+ }
297
+ go(t) {
298
+ return this.currentIndex = Math.min(Math.max(this.currentIndex + t, 0), this.states.length - 1), this.currentState;
299
+ }
300
+ undo() {
301
+ return this.go(-1);
302
+ }
303
+ redo() {
304
+ return this.go(1);
305
+ }
306
+ clear() {
307
+ this.states.length = 0, this.currentIndex = 0;
308
+ }
309
+ }
310
+ lt.MAX_LENGTH = 100;
311
+ class jt {
312
+ /**
313
+ View element
314
+ */
315
+ /** Internal {@link Masked} model */
316
+ constructor(t, e) {
317
+ this.el = t instanceof vt ? t : t.isContentEditable && t.tagName !== "INPUT" && t.tagName !== "TEXTAREA" ? new bt(t) : new Ht(t), this.masked = L(e), this._listeners = {}, this._value = "", this._unmaskedValue = "", this._rawInputValue = "", this.history = new lt(), this._saveSelection = this._saveSelection.bind(this), this._onInput = this._onInput.bind(this), this._onChange = this._onChange.bind(this), this._onDrop = this._onDrop.bind(this), this._onFocus = this._onFocus.bind(this), this._onClick = this._onClick.bind(this), this._onUndo = this._onUndo.bind(this), this._onRedo = this._onRedo.bind(this), this.alignCursor = this.alignCursor.bind(this), this.alignCursorFriendly = this.alignCursorFriendly.bind(this), this._bindEvents(), this.updateValue(), this._onChange();
318
+ }
319
+ maskEquals(t) {
320
+ var e;
321
+ return t == null || ((e = this.masked) == null ? void 0 : e.maskEquals(t));
322
+ }
323
+ /** Masked */
324
+ get mask() {
325
+ return this.masked.mask;
326
+ }
327
+ set mask(t) {
328
+ if (this.maskEquals(t)) return;
329
+ if (!(t instanceof _.Masked) && this.masked.constructor === Mt(t)) {
330
+ this.masked.updateOptions({
331
+ mask: t
332
+ });
333
+ return;
334
+ }
335
+ const e = t instanceof _.Masked ? t : L({
336
+ mask: t
337
+ });
338
+ e.unmaskedValue = this.masked.unmaskedValue, this.masked = e;
339
+ }
340
+ /** Raw value */
341
+ get value() {
342
+ return this._value;
343
+ }
344
+ set value(t) {
345
+ this.value !== t && (this.masked.value = t, this.updateControl("auto"));
346
+ }
347
+ /** Unmasked value */
348
+ get unmaskedValue() {
349
+ return this._unmaskedValue;
350
+ }
351
+ set unmaskedValue(t) {
352
+ this.unmaskedValue !== t && (this.masked.unmaskedValue = t, this.updateControl("auto"));
353
+ }
354
+ /** Raw input value */
355
+ get rawInputValue() {
356
+ return this._rawInputValue;
357
+ }
358
+ set rawInputValue(t) {
359
+ this.rawInputValue !== t && (this.masked.rawInputValue = t, this.updateControl(), this.alignCursor());
360
+ }
361
+ /** Typed unmasked value */
362
+ get typedValue() {
363
+ return this.masked.typedValue;
364
+ }
365
+ set typedValue(t) {
366
+ this.masked.typedValueEquals(t) || (this.masked.typedValue = t, this.updateControl("auto"));
367
+ }
368
+ /** Display value */
369
+ get displayValue() {
370
+ return this.masked.displayValue;
371
+ }
372
+ /** Starts listening to element events */
373
+ _bindEvents() {
374
+ this.el.bindEvents({
375
+ selectionChange: this._saveSelection,
376
+ input: this._onInput,
377
+ drop: this._onDrop,
378
+ click: this._onClick,
379
+ focus: this._onFocus,
380
+ commit: this._onChange,
381
+ undo: this._onUndo,
382
+ redo: this._onRedo
383
+ });
384
+ }
385
+ /** Stops listening to element events */
386
+ _unbindEvents() {
387
+ this.el && this.el.unbindEvents();
388
+ }
389
+ /** Fires custom event */
390
+ _fireEvent(t, e) {
391
+ const s = this._listeners[t];
392
+ s && s.forEach((i) => i(e));
393
+ }
394
+ /** Current selection start */
395
+ get selectionStart() {
396
+ return this._cursorChanging ? this._changingCursorPos : this.el.selectionStart;
397
+ }
398
+ /** Current cursor position */
399
+ get cursorPos() {
400
+ return this._cursorChanging ? this._changingCursorPos : this.el.selectionEnd;
401
+ }
402
+ set cursorPos(t) {
403
+ !this.el || !this.el.isActive || (this.el.select(t, t), this._saveSelection());
404
+ }
405
+ /** Stores current selection */
406
+ _saveSelection() {
407
+ this.displayValue !== this.el.value && console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."), this._selection = {
408
+ start: this.selectionStart,
409
+ end: this.cursorPos
410
+ };
411
+ }
412
+ /** Syncronizes model value from view */
413
+ updateValue() {
414
+ this.masked.value = this.el.value, this._value = this.masked.value, this._unmaskedValue = this.masked.unmaskedValue, this._rawInputValue = this.masked.rawInputValue;
415
+ }
416
+ /** Syncronizes view from model value, fires change events */
417
+ updateControl(t) {
418
+ const e = this.masked.unmaskedValue, s = this.masked.value, i = this.masked.rawInputValue, n = this.displayValue, r = this.unmaskedValue !== e || this.value !== s || this._rawInputValue !== i;
419
+ this._unmaskedValue = e, this._value = s, this._rawInputValue = i, this.el.value !== n && (this.el.value = n), t === "auto" ? this.alignCursor() : t != null && (this.cursorPos = t), r && this._fireChangeEvents(), !this._historyChanging && (r || this.history.isEmpty) && this.history.push({
420
+ unmaskedValue: e,
421
+ selection: {
422
+ start: this.selectionStart,
423
+ end: this.cursorPos
424
+ }
425
+ });
426
+ }
427
+ /** Updates options with deep equal check, recreates {@link Masked} model if mask type changes */
428
+ updateOptions(t) {
429
+ const {
430
+ mask: e,
431
+ ...s
432
+ } = t, i = !this.maskEquals(e), n = this.masked.optionsIsChanged(s);
433
+ i && (this.mask = e), n && this.masked.updateOptions(s), (i || n) && this.updateControl();
434
+ }
435
+ /** Updates cursor */
436
+ updateCursor(t) {
437
+ t != null && (this.cursorPos = t, this._delayUpdateCursor(t));
438
+ }
439
+ /** Delays cursor update to support mobile browsers */
440
+ _delayUpdateCursor(t) {
441
+ this._abortUpdateCursor(), this._changingCursorPos = t, this._cursorChanging = setTimeout(() => {
442
+ this.el && (this.cursorPos = this._changingCursorPos, this._abortUpdateCursor());
443
+ }, 10);
444
+ }
445
+ /** Fires custom events */
446
+ _fireChangeEvents() {
447
+ this._fireEvent("accept", this._inputEvent), this.masked.isComplete && this._fireEvent("complete", this._inputEvent);
448
+ }
449
+ /** Aborts delayed cursor update */
450
+ _abortUpdateCursor() {
451
+ this._cursorChanging && (clearTimeout(this._cursorChanging), delete this._cursorChanging);
452
+ }
453
+ /** Aligns cursor to nearest available position */
454
+ alignCursor() {
455
+ this.cursorPos = this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos, c.LEFT));
456
+ }
457
+ /** Aligns cursor only if selection is empty */
458
+ alignCursorFriendly() {
459
+ this.selectionStart === this.cursorPos && this.alignCursor();
460
+ }
461
+ /** Adds listener on custom event */
462
+ on(t, e) {
463
+ return this._listeners[t] || (this._listeners[t] = []), this._listeners[t].push(e), this;
464
+ }
465
+ /** Removes custom event listener */
466
+ off(t, e) {
467
+ if (!this._listeners[t]) return this;
468
+ if (!e)
469
+ return delete this._listeners[t], this;
470
+ const s = this._listeners[t].indexOf(e);
471
+ return s >= 0 && this._listeners[t].splice(s, 1), this;
472
+ }
473
+ /** Handles view input event */
474
+ _onInput(t) {
475
+ this._inputEvent = t, this._abortUpdateCursor();
476
+ const e = new Ut({
477
+ // new state
478
+ value: this.el.value,
479
+ cursorPos: this.cursorPos,
480
+ // old state
481
+ oldValue: this.displayValue,
482
+ oldSelection: this._selection
483
+ }), s = this.masked.rawInputValue, i = this.masked.splice(e.startChangePos, e.removed.length, e.inserted, e.removeDirection, {
484
+ input: !0,
485
+ raw: !0
486
+ }).offset, n = s === this.masked.rawInputValue ? e.removeDirection : c.NONE;
487
+ let r = this.masked.nearestInputPos(e.startChangePos + i, n);
488
+ n !== c.NONE && (r = this.masked.nearestInputPos(r, c.NONE)), this.updateControl(r), delete this._inputEvent;
489
+ }
490
+ /** Handles view change event and commits model value */
491
+ _onChange() {
492
+ this.displayValue !== this.el.value && this.updateValue(), this.masked.doCommit(), this.updateControl(), this._saveSelection();
493
+ }
494
+ /** Handles view drop event, prevents by default */
495
+ _onDrop(t) {
496
+ t.preventDefault(), t.stopPropagation();
497
+ }
498
+ /** Restore last selection on focus */
499
+ _onFocus(t) {
500
+ this.alignCursorFriendly();
501
+ }
502
+ /** Restore last selection on focus */
503
+ _onClick(t) {
504
+ this.alignCursorFriendly();
505
+ }
506
+ _onUndo() {
507
+ this._applyHistoryState(this.history.undo());
508
+ }
509
+ _onRedo() {
510
+ this._applyHistoryState(this.history.redo());
511
+ }
512
+ _applyHistoryState(t) {
513
+ t && (this._historyChanging = !0, this.unmaskedValue = t.unmaskedValue, this.el.select(t.selection.start, t.selection.end), this._saveSelection(), this._historyChanging = !1);
514
+ }
515
+ /** Unbind view events and removes element reference */
516
+ destroy() {
517
+ this._unbindEvents(), this._listeners.length = 0, delete this.el;
518
+ }
519
+ }
520
+ _.InputMask = jt;
521
+ class v {
522
+ /** Inserted symbols */
523
+ /** Additional offset if any changes occurred before tail */
524
+ /** Raw inserted is used by dynamic mask */
525
+ /** Can skip chars */
526
+ static normalize(t) {
527
+ return Array.isArray(t) ? t : [t, new v()];
528
+ }
529
+ constructor(t) {
530
+ Object.assign(this, {
531
+ inserted: "",
532
+ rawInserted: "",
533
+ tailShift: 0,
534
+ skip: !1
535
+ }, t);
536
+ }
537
+ /** Aggregate changes */
538
+ aggregate(t) {
539
+ return this.inserted += t.inserted, this.rawInserted += t.rawInserted, this.tailShift += t.tailShift, this.skip = this.skip || t.skip, this;
540
+ }
541
+ /** Total offset considering all changes */
542
+ get offset() {
543
+ return this.tailShift + this.inserted.length;
544
+ }
545
+ get consumed() {
546
+ return !!this.rawInserted || this.skip;
547
+ }
548
+ equals(t) {
549
+ return this.inserted === t.inserted && this.tailShift === t.tailShift && this.rawInserted === t.rawInserted && this.skip === t.skip;
550
+ }
551
+ }
552
+ _.ChangeDetails = v;
553
+ class O {
554
+ /** Tail value as string */
555
+ /** Tail start position */
556
+ /** Start position */
557
+ constructor(t, e, s) {
558
+ t === void 0 && (t = ""), e === void 0 && (e = 0), this.value = t, this.from = e, this.stop = s;
559
+ }
560
+ toString() {
561
+ return this.value;
562
+ }
563
+ extend(t) {
564
+ this.value += String(t);
565
+ }
566
+ appendTo(t) {
567
+ return t.append(this.toString(), {
568
+ tail: !0
569
+ }).aggregate(t._appendPlaceholder());
570
+ }
571
+ get state() {
572
+ return {
573
+ value: this.value,
574
+ from: this.from,
575
+ stop: this.stop
576
+ };
577
+ }
578
+ set state(t) {
579
+ Object.assign(this, t);
580
+ }
581
+ unshift(t) {
582
+ if (!this.value.length || t != null && this.from >= t) return "";
583
+ const e = this.value[0];
584
+ return this.value = this.value.slice(1), e;
585
+ }
586
+ shift() {
587
+ if (!this.value.length) return "";
588
+ const t = this.value[this.value.length - 1];
589
+ return this.value = this.value.slice(0, -1), t;
590
+ }
591
+ }
592
+ class M {
593
+ /** */
594
+ /** */
595
+ /** Transforms value before mask processing */
596
+ /** Transforms each char before mask processing */
597
+ /** Validates if value is acceptable */
598
+ /** Does additional processing at the end of editing */
599
+ /** Format typed value to string */
600
+ /** Parse string to get typed value */
601
+ /** Enable characters overwriting */
602
+ /** */
603
+ /** */
604
+ /** */
605
+ /** */
606
+ constructor(t) {
607
+ this._value = "", this._update({
608
+ ...M.DEFAULTS,
609
+ ...t
610
+ }), this._initialized = !0;
611
+ }
612
+ /** Sets and applies new options */
613
+ updateOptions(t) {
614
+ this.optionsIsChanged(t) && this.withValueRefresh(this._update.bind(this, t));
615
+ }
616
+ /** Sets new options */
617
+ _update(t) {
618
+ Object.assign(this, t);
619
+ }
620
+ /** Mask state */
621
+ get state() {
622
+ return {
623
+ _value: this.value,
624
+ _rawInputValue: this.rawInputValue
625
+ };
626
+ }
627
+ set state(t) {
628
+ this._value = t._value;
629
+ }
630
+ /** Resets value */
631
+ reset() {
632
+ this._value = "";
633
+ }
634
+ get value() {
635
+ return this._value;
636
+ }
637
+ set value(t) {
638
+ this.resolve(t, {
639
+ input: !0
640
+ });
641
+ }
642
+ /** Resolve new value */
643
+ resolve(t, e) {
644
+ e === void 0 && (e = {
645
+ input: !0
646
+ }), this.reset(), this.append(t, e, ""), this.doCommit();
647
+ }
648
+ get unmaskedValue() {
649
+ return this.value;
650
+ }
651
+ set unmaskedValue(t) {
652
+ this.resolve(t, {});
653
+ }
654
+ get typedValue() {
655
+ return this.parse ? this.parse(this.value, this) : this.unmaskedValue;
656
+ }
657
+ set typedValue(t) {
658
+ this.format ? this.value = this.format(t, this) : this.unmaskedValue = String(t);
659
+ }
660
+ /** Value that includes raw user input */
661
+ get rawInputValue() {
662
+ return this.extractInput(0, this.displayValue.length, {
663
+ raw: !0
664
+ });
665
+ }
666
+ set rawInputValue(t) {
667
+ this.resolve(t, {
668
+ raw: !0
669
+ });
670
+ }
671
+ get displayValue() {
672
+ return this.value;
673
+ }
674
+ get isComplete() {
675
+ return !0;
676
+ }
677
+ get isFilled() {
678
+ return this.isComplete;
679
+ }
680
+ /** Finds nearest input position in direction */
681
+ nearestInputPos(t, e) {
682
+ return t;
683
+ }
684
+ totalInputPositions(t, e) {
685
+ return t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), Math.min(this.displayValue.length, e - t);
686
+ }
687
+ /** Extracts value in range considering flags */
688
+ extractInput(t, e, s) {
689
+ return t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), this.displayValue.slice(t, e);
690
+ }
691
+ /** Extracts tail in range */
692
+ extractTail(t, e) {
693
+ return t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), new O(this.extractInput(t, e), t);
694
+ }
695
+ /** Appends tail */
696
+ appendTail(t) {
697
+ return U(t) && (t = new O(String(t))), t.appendTo(this);
698
+ }
699
+ /** Appends char */
700
+ _appendCharRaw(t, e) {
701
+ return t ? (this._value += t, new v({
702
+ inserted: t,
703
+ rawInserted: t
704
+ })) : new v();
705
+ }
706
+ /** Appends char */
707
+ _appendChar(t, e, s) {
708
+ e === void 0 && (e = {});
709
+ const i = this.state;
710
+ let n;
711
+ if ([t, n] = this.doPrepareChar(t, e), t && (n = n.aggregate(this._appendCharRaw(t, e)), !n.rawInserted && this.autofix === "pad")) {
712
+ const r = this.state;
713
+ this.state = i;
714
+ let a = this.pad(e);
715
+ const h = this._appendCharRaw(t, e);
716
+ a = a.aggregate(h), h.rawInserted || a.equals(n) ? n = a : this.state = r;
717
+ }
718
+ if (n.inserted) {
719
+ let r, a = this.doValidate(e) !== !1;
720
+ if (a && s != null) {
721
+ const h = this.state;
722
+ if (this.overwrite === !0) {
723
+ r = s.state;
724
+ for (let C = 0; C < n.rawInserted.length; ++C)
725
+ s.unshift(this.displayValue.length - n.tailShift);
726
+ }
727
+ let d = this.appendTail(s);
728
+ if (a = d.rawInserted.length === s.toString().length, !(a && d.inserted) && this.overwrite === "shift") {
729
+ this.state = h, r = s.state;
730
+ for (let C = 0; C < n.rawInserted.length; ++C)
731
+ s.shift();
732
+ d = this.appendTail(s), a = d.rawInserted.length === s.toString().length;
733
+ }
734
+ a && d.inserted && (this.state = h);
735
+ }
736
+ a || (n = new v(), this.state = i, s && r && (s.state = r));
737
+ }
738
+ return n;
739
+ }
740
+ /** Appends optional placeholder at the end */
741
+ _appendPlaceholder() {
742
+ return new v();
743
+ }
744
+ /** Appends optional eager placeholder at the end */
745
+ _appendEager() {
746
+ return new v();
747
+ }
748
+ /** Appends symbols considering flags */
749
+ append(t, e, s) {
750
+ if (!U(t)) throw new Error("value should be string");
751
+ const i = U(s) ? new O(String(s)) : s;
752
+ e != null && e.tail && (e._beforeTailState = this.state);
753
+ let n;
754
+ [t, n] = this.doPrepare(t, e);
755
+ for (let r = 0; r < t.length; ++r) {
756
+ const a = this._appendChar(t[r], e, i);
757
+ if (!a.rawInserted && !this.doSkipInvalid(t[r], e, i)) break;
758
+ n.aggregate(a);
759
+ }
760
+ return (this.eager === !0 || this.eager === "append") && e != null && e.input && t && n.aggregate(this._appendEager()), i != null && (n.tailShift += this.appendTail(i).tailShift), n;
761
+ }
762
+ remove(t, e) {
763
+ return t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), this._value = this.displayValue.slice(0, t) + this.displayValue.slice(e), new v();
764
+ }
765
+ /** Calls function and reapplies current value */
766
+ withValueRefresh(t) {
767
+ if (this._refreshing || !this._initialized) return t();
768
+ this._refreshing = !0;
769
+ const e = this.rawInputValue, s = this.value, i = t();
770
+ return this.rawInputValue = e, this.value && this.value !== s && s.indexOf(this.value) === 0 && (this.append(s.slice(this.displayValue.length), {}, ""), this.doCommit()), delete this._refreshing, i;
771
+ }
772
+ runIsolated(t) {
773
+ if (this._isolated || !this._initialized) return t(this);
774
+ this._isolated = !0;
775
+ const e = this.state, s = t(this);
776
+ return this.state = e, delete this._isolated, s;
777
+ }
778
+ doSkipInvalid(t, e, s) {
779
+ return !!this.skipInvalid;
780
+ }
781
+ /** Prepares string before mask processing */
782
+ doPrepare(t, e) {
783
+ return e === void 0 && (e = {}), v.normalize(this.prepare ? this.prepare(t, this, e) : t);
784
+ }
785
+ /** Prepares each char before mask processing */
786
+ doPrepareChar(t, e) {
787
+ return e === void 0 && (e = {}), v.normalize(this.prepareChar ? this.prepareChar(t, this, e) : t);
788
+ }
789
+ /** Validates if value is acceptable */
790
+ doValidate(t) {
791
+ return (!this.validate || this.validate(this.value, this, t)) && (!this.parent || this.parent.doValidate(t));
792
+ }
793
+ /** Does additional processing at the end of editing */
794
+ doCommit() {
795
+ this.commit && this.commit(this.value, this);
796
+ }
797
+ splice(t, e, s, i, n) {
798
+ s === void 0 && (s = ""), i === void 0 && (i = c.NONE), n === void 0 && (n = {
799
+ input: !0
800
+ });
801
+ const r = t + e, a = this.extractTail(r), h = this.eager === !0 || this.eager === "remove";
802
+ let d;
803
+ h && (i = Nt(i), d = this.extractInput(0, r, {
804
+ raw: !0
805
+ }));
806
+ let C = t;
807
+ const E = new v();
808
+ if (i !== c.NONE && (C = this.nearestInputPos(t, e > 1 && t !== 0 && !h ? c.NONE : i), E.tailShift = C - t), E.aggregate(this.remove(C)), h && i !== c.NONE && d === this.rawInputValue)
809
+ if (i === c.FORCE_LEFT) {
810
+ let x;
811
+ for (; d === this.rawInputValue && (x = this.displayValue.length); )
812
+ E.aggregate(new v({
813
+ tailShift: -1
814
+ })).aggregate(this.remove(x - 1));
815
+ } else i === c.FORCE_RIGHT && a.unshift();
816
+ return E.aggregate(this.append(s, n, a));
817
+ }
818
+ maskEquals(t) {
819
+ return this.mask === t;
820
+ }
821
+ optionsIsChanged(t) {
822
+ return !ut(this, t);
823
+ }
824
+ typedValueEquals(t) {
825
+ const e = this.typedValue;
826
+ return t === e || M.EMPTY_VALUES.includes(t) && M.EMPTY_VALUES.includes(e) || (this.format ? this.format(t, this) === this.format(this.typedValue, this) : !1);
827
+ }
828
+ pad(t) {
829
+ return new v();
830
+ }
831
+ }
832
+ M.DEFAULTS = {
833
+ skipInvalid: !0
834
+ };
835
+ M.EMPTY_VALUES = [void 0, null, ""];
836
+ _.Masked = M;
837
+ class P {
838
+ /** */
839
+ constructor(t, e) {
840
+ t === void 0 && (t = []), e === void 0 && (e = 0), this.chunks = t, this.from = e;
841
+ }
842
+ toString() {
843
+ return this.chunks.map(String).join("");
844
+ }
845
+ extend(t) {
846
+ if (!String(t)) return;
847
+ t = U(t) ? new O(String(t)) : t;
848
+ const e = this.chunks[this.chunks.length - 1], s = e && // if stops are same or tail has no stop
849
+ (e.stop === t.stop || t.stop == null) && // if tail chunk goes just after last chunk
850
+ t.from === e.from + e.toString().length;
851
+ if (t instanceof O)
852
+ s ? e.extend(t.toString()) : this.chunks.push(t);
853
+ else if (t instanceof P) {
854
+ if (t.stop == null) {
855
+ let i;
856
+ for (; t.chunks.length && t.chunks[0].stop == null; )
857
+ i = t.chunks.shift(), i.from += t.from, this.extend(i);
858
+ }
859
+ t.toString() && (t.stop = t.blockIndex, this.chunks.push(t));
860
+ }
861
+ }
862
+ appendTo(t) {
863
+ if (!(t instanceof _.MaskedPattern))
864
+ return new O(this.toString()).appendTo(t);
865
+ const e = new v();
866
+ for (let s = 0; s < this.chunks.length; ++s) {
867
+ const i = this.chunks[s], n = t._mapPosToBlock(t.displayValue.length), r = i.stop;
868
+ let a;
869
+ if (r != null && // if block not found or stop is behind lastBlock
870
+ (!n || n.index <= r) && ((i instanceof P || // for continuous block also check if stop is exist
871
+ t._stops.indexOf(r) >= 0) && e.aggregate(t._appendPlaceholder(r)), a = i instanceof P && t._blocks[r]), a) {
872
+ const h = a.appendTail(i);
873
+ e.aggregate(h);
874
+ const d = i.toString().slice(h.rawInserted.length);
875
+ d && e.aggregate(t.append(d, {
876
+ tail: !0
877
+ }));
878
+ } else
879
+ e.aggregate(t.append(i.toString(), {
880
+ tail: !0
881
+ }));
882
+ }
883
+ return e;
884
+ }
885
+ get state() {
886
+ return {
887
+ chunks: this.chunks.map((t) => t.state),
888
+ from: this.from,
889
+ stop: this.stop,
890
+ blockIndex: this.blockIndex
891
+ };
892
+ }
893
+ set state(t) {
894
+ const {
895
+ chunks: e,
896
+ ...s
897
+ } = t;
898
+ Object.assign(this, s), this.chunks = e.map((i) => {
899
+ const n = "chunks" in i ? new P() : new O();
900
+ return n.state = i, n;
901
+ });
902
+ }
903
+ unshift(t) {
904
+ if (!this.chunks.length || t != null && this.from >= t) return "";
905
+ const e = t != null ? t - this.from : t;
906
+ let s = 0;
907
+ for (; s < this.chunks.length; ) {
908
+ const i = this.chunks[s], n = i.unshift(e);
909
+ if (i.toString()) {
910
+ if (!n) break;
911
+ ++s;
912
+ } else
913
+ this.chunks.splice(s, 1);
914
+ if (n) return n;
915
+ }
916
+ return "";
917
+ }
918
+ shift() {
919
+ if (!this.chunks.length) return "";
920
+ let t = this.chunks.length - 1;
921
+ for (; 0 <= t; ) {
922
+ const e = this.chunks[t], s = e.shift();
923
+ if (e.toString()) {
924
+ if (!s) break;
925
+ --t;
926
+ } else
927
+ this.chunks.splice(t, 1);
928
+ if (s) return s;
929
+ }
930
+ return "";
931
+ }
932
+ }
933
+ class Pt {
934
+ constructor(t, e) {
935
+ this.masked = t, this._log = [];
936
+ const {
937
+ offset: s,
938
+ index: i
939
+ } = t._mapPosToBlock(e) || (e < 0 ? (
940
+ // first
941
+ {
942
+ index: 0,
943
+ offset: 0
944
+ }
945
+ ) : (
946
+ // last
947
+ {
948
+ index: this.masked._blocks.length,
949
+ offset: 0
950
+ }
951
+ ));
952
+ this.offset = s, this.index = i, this.ok = !1;
953
+ }
954
+ get block() {
955
+ return this.masked._blocks[this.index];
956
+ }
957
+ get pos() {
958
+ return this.masked._blockStartPos(this.index) + this.offset;
959
+ }
960
+ get state() {
961
+ return {
962
+ index: this.index,
963
+ offset: this.offset,
964
+ ok: this.ok
965
+ };
966
+ }
967
+ set state(t) {
968
+ Object.assign(this, t);
969
+ }
970
+ pushState() {
971
+ this._log.push(this.state);
972
+ }
973
+ popState() {
974
+ const t = this._log.pop();
975
+ return t && (this.state = t), t;
976
+ }
977
+ bindBlock() {
978
+ this.block || (this.index < 0 && (this.index = 0, this.offset = 0), this.index >= this.masked._blocks.length && (this.index = this.masked._blocks.length - 1, this.offset = this.block.displayValue.length));
979
+ }
980
+ _pushLeft(t) {
981
+ for (this.pushState(), this.bindBlock(); 0 <= this.index; --this.index, this.offset = ((e = this.block) == null ? void 0 : e.displayValue.length) || 0) {
982
+ var e;
983
+ if (t()) return this.ok = !0;
984
+ }
985
+ return this.ok = !1;
986
+ }
987
+ _pushRight(t) {
988
+ for (this.pushState(), this.bindBlock(); this.index < this.masked._blocks.length; ++this.index, this.offset = 0)
989
+ if (t()) return this.ok = !0;
990
+ return this.ok = !1;
991
+ }
992
+ pushLeftBeforeFilled() {
993
+ return this._pushLeft(() => {
994
+ if (!(this.block.isFixed || !this.block.value) && (this.offset = this.block.nearestInputPos(this.offset, c.FORCE_LEFT), this.offset !== 0))
995
+ return !0;
996
+ });
997
+ }
998
+ pushLeftBeforeInput() {
999
+ return this._pushLeft(() => {
1000
+ if (!this.block.isFixed)
1001
+ return this.offset = this.block.nearestInputPos(this.offset, c.LEFT), !0;
1002
+ });
1003
+ }
1004
+ pushLeftBeforeRequired() {
1005
+ return this._pushLeft(() => {
1006
+ if (!(this.block.isFixed || this.block.isOptional && !this.block.value))
1007
+ return this.offset = this.block.nearestInputPos(this.offset, c.LEFT), !0;
1008
+ });
1009
+ }
1010
+ pushRightBeforeFilled() {
1011
+ return this._pushRight(() => {
1012
+ if (!(this.block.isFixed || !this.block.value) && (this.offset = this.block.nearestInputPos(this.offset, c.FORCE_RIGHT), this.offset !== this.block.value.length))
1013
+ return !0;
1014
+ });
1015
+ }
1016
+ pushRightBeforeInput() {
1017
+ return this._pushRight(() => {
1018
+ if (!this.block.isFixed)
1019
+ return this.offset = this.block.nearestInputPos(this.offset, c.NONE), !0;
1020
+ });
1021
+ }
1022
+ pushRightBeforeRequired() {
1023
+ return this._pushRight(() => {
1024
+ if (!(this.block.isFixed || this.block.isOptional && !this.block.value))
1025
+ return this.offset = this.block.nearestInputPos(this.offset, c.NONE), !0;
1026
+ });
1027
+ }
1028
+ }
1029
+ class It {
1030
+ /** */
1031
+ /** */
1032
+ /** */
1033
+ /** */
1034
+ /** */
1035
+ /** */
1036
+ constructor(t) {
1037
+ Object.assign(this, t), this._value = "", this.isFixed = !0;
1038
+ }
1039
+ get value() {
1040
+ return this._value;
1041
+ }
1042
+ get unmaskedValue() {
1043
+ return this.isUnmasking ? this.value : "";
1044
+ }
1045
+ get rawInputValue() {
1046
+ return this._isRawInput ? this.value : "";
1047
+ }
1048
+ get displayValue() {
1049
+ return this.value;
1050
+ }
1051
+ reset() {
1052
+ this._isRawInput = !1, this._value = "";
1053
+ }
1054
+ remove(t, e) {
1055
+ return t === void 0 && (t = 0), e === void 0 && (e = this._value.length), this._value = this._value.slice(0, t) + this._value.slice(e), this._value || (this._isRawInput = !1), new v();
1056
+ }
1057
+ nearestInputPos(t, e) {
1058
+ e === void 0 && (e = c.NONE);
1059
+ const s = 0, i = this._value.length;
1060
+ switch (e) {
1061
+ case c.LEFT:
1062
+ case c.FORCE_LEFT:
1063
+ return s;
1064
+ case c.NONE:
1065
+ case c.RIGHT:
1066
+ case c.FORCE_RIGHT:
1067
+ default:
1068
+ return i;
1069
+ }
1070
+ }
1071
+ totalInputPositions(t, e) {
1072
+ return t === void 0 && (t = 0), e === void 0 && (e = this._value.length), this._isRawInput ? e - t : 0;
1073
+ }
1074
+ extractInput(t, e, s) {
1075
+ return t === void 0 && (t = 0), e === void 0 && (e = this._value.length), s === void 0 && (s = {}), s.raw && this._isRawInput && this._value.slice(t, e) || "";
1076
+ }
1077
+ get isComplete() {
1078
+ return !0;
1079
+ }
1080
+ get isFilled() {
1081
+ return !!this._value;
1082
+ }
1083
+ _appendChar(t, e) {
1084
+ if (e === void 0 && (e = {}), this.isFilled) return new v();
1085
+ const s = this.eager === !0 || this.eager === "append", n = this.char === t && (this.isUnmasking || e.input || e.raw) && (!e.raw || !s) && !e.tail, r = new v({
1086
+ inserted: this.char,
1087
+ rawInserted: n ? this.char : ""
1088
+ });
1089
+ return this._value = this.char, this._isRawInput = n && (e.raw || e.input), r;
1090
+ }
1091
+ _appendEager() {
1092
+ return this._appendChar(this.char, {
1093
+ tail: !0
1094
+ });
1095
+ }
1096
+ _appendPlaceholder() {
1097
+ const t = new v();
1098
+ return this.isFilled || (this._value = t.inserted = this.char), t;
1099
+ }
1100
+ extractTail() {
1101
+ return new O("");
1102
+ }
1103
+ appendTail(t) {
1104
+ return U(t) && (t = new O(String(t))), t.appendTo(this);
1105
+ }
1106
+ append(t, e, s) {
1107
+ const i = this._appendChar(t[0], e);
1108
+ return s != null && (i.tailShift += this.appendTail(s).tailShift), i;
1109
+ }
1110
+ doCommit() {
1111
+ }
1112
+ get state() {
1113
+ return {
1114
+ _value: this._value,
1115
+ _rawInputValue: this.rawInputValue
1116
+ };
1117
+ }
1118
+ set state(t) {
1119
+ this._value = t._value, this._isRawInput = !!t._rawInputValue;
1120
+ }
1121
+ pad(t) {
1122
+ return this._appendPlaceholder();
1123
+ }
1124
+ }
1125
+ class ht {
1126
+ /** */
1127
+ /** */
1128
+ /** */
1129
+ /** */
1130
+ /** */
1131
+ /** */
1132
+ /** */
1133
+ /** */
1134
+ constructor(t) {
1135
+ const {
1136
+ parent: e,
1137
+ isOptional: s,
1138
+ placeholderChar: i,
1139
+ displayChar: n,
1140
+ lazy: r,
1141
+ eager: a,
1142
+ ...h
1143
+ } = t;
1144
+ this.masked = L(h), Object.assign(this, {
1145
+ parent: e,
1146
+ isOptional: s,
1147
+ placeholderChar: i,
1148
+ displayChar: n,
1149
+ lazy: r,
1150
+ eager: a
1151
+ });
1152
+ }
1153
+ reset() {
1154
+ this.isFilled = !1, this.masked.reset();
1155
+ }
1156
+ remove(t, e) {
1157
+ return t === void 0 && (t = 0), e === void 0 && (e = this.value.length), t === 0 && e >= 1 ? (this.isFilled = !1, this.masked.remove(t, e)) : new v();
1158
+ }
1159
+ get value() {
1160
+ return this.masked.value || (this.isFilled && !this.isOptional ? this.placeholderChar : "");
1161
+ }
1162
+ get unmaskedValue() {
1163
+ return this.masked.unmaskedValue;
1164
+ }
1165
+ get rawInputValue() {
1166
+ return this.masked.rawInputValue;
1167
+ }
1168
+ get displayValue() {
1169
+ return this.masked.value && this.displayChar || this.value;
1170
+ }
1171
+ get isComplete() {
1172
+ return !!this.masked.value || this.isOptional;
1173
+ }
1174
+ _appendChar(t, e) {
1175
+ if (e === void 0 && (e = {}), this.isFilled) return new v();
1176
+ const s = this.masked.state;
1177
+ let i = this.masked._appendChar(t, this.currentMaskFlags(e));
1178
+ return i.inserted && this.doValidate(e) === !1 && (i = new v(), this.masked.state = s), !i.inserted && !this.isOptional && !this.lazy && !e.input && (i.inserted = this.placeholderChar), i.skip = !i.inserted && !this.isOptional, this.isFilled = !!i.inserted, i;
1179
+ }
1180
+ append(t, e, s) {
1181
+ return this.masked.append(t, this.currentMaskFlags(e), s);
1182
+ }
1183
+ _appendPlaceholder() {
1184
+ return this.isFilled || this.isOptional ? new v() : (this.isFilled = !0, new v({
1185
+ inserted: this.placeholderChar
1186
+ }));
1187
+ }
1188
+ _appendEager() {
1189
+ return new v();
1190
+ }
1191
+ extractTail(t, e) {
1192
+ return this.masked.extractTail(t, e);
1193
+ }
1194
+ appendTail(t) {
1195
+ return this.masked.appendTail(t);
1196
+ }
1197
+ extractInput(t, e, s) {
1198
+ return t === void 0 && (t = 0), e === void 0 && (e = this.value.length), this.masked.extractInput(t, e, s);
1199
+ }
1200
+ nearestInputPos(t, e) {
1201
+ e === void 0 && (e = c.NONE);
1202
+ const s = 0, i = this.value.length, n = Math.min(Math.max(t, s), i);
1203
+ switch (e) {
1204
+ case c.LEFT:
1205
+ case c.FORCE_LEFT:
1206
+ return this.isComplete ? n : s;
1207
+ case c.RIGHT:
1208
+ case c.FORCE_RIGHT:
1209
+ return this.isComplete ? n : i;
1210
+ case c.NONE:
1211
+ default:
1212
+ return n;
1213
+ }
1214
+ }
1215
+ totalInputPositions(t, e) {
1216
+ return t === void 0 && (t = 0), e === void 0 && (e = this.value.length), this.value.slice(t, e).length;
1217
+ }
1218
+ doValidate(t) {
1219
+ return this.masked.doValidate(this.currentMaskFlags(t)) && (!this.parent || this.parent.doValidate(this.currentMaskFlags(t)));
1220
+ }
1221
+ doCommit() {
1222
+ this.masked.doCommit();
1223
+ }
1224
+ get state() {
1225
+ return {
1226
+ _value: this.value,
1227
+ _rawInputValue: this.rawInputValue,
1228
+ masked: this.masked.state,
1229
+ isFilled: this.isFilled
1230
+ };
1231
+ }
1232
+ set state(t) {
1233
+ this.masked.state = t.masked, this.isFilled = t.isFilled;
1234
+ }
1235
+ currentMaskFlags(t) {
1236
+ var e;
1237
+ return {
1238
+ ...t,
1239
+ _beforeTailState: (t == null || (e = t._beforeTailState) == null ? void 0 : e.masked) || t?._beforeTailState
1240
+ };
1241
+ }
1242
+ pad(t) {
1243
+ return new v();
1244
+ }
1245
+ }
1246
+ ht.DEFAULT_DEFINITIONS = {
1247
+ 0: /\d/,
1248
+ a: /[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,
1249
+ // http://stackoverflow.com/a/22075070
1250
+ "*": /./
1251
+ };
1252
+ class qt extends M {
1253
+ /** */
1254
+ /** Enable characters overwriting */
1255
+ /** */
1256
+ /** */
1257
+ /** */
1258
+ updateOptions(t) {
1259
+ super.updateOptions(t);
1260
+ }
1261
+ _update(t) {
1262
+ const e = t.mask;
1263
+ e && (t.validate = (s) => s.search(e) >= 0), super._update(t);
1264
+ }
1265
+ }
1266
+ _.MaskedRegExp = qt;
1267
+ class b extends M {
1268
+ /** */
1269
+ /** */
1270
+ /** Single char for empty input */
1271
+ /** Single char for filled input */
1272
+ /** Show placeholder only when needed */
1273
+ /** Enable characters overwriting */
1274
+ /** */
1275
+ /** */
1276
+ /** */
1277
+ constructor(t) {
1278
+ super({
1279
+ ...b.DEFAULTS,
1280
+ ...t,
1281
+ definitions: Object.assign({}, ht.DEFAULT_DEFINITIONS, t?.definitions)
1282
+ });
1283
+ }
1284
+ updateOptions(t) {
1285
+ super.updateOptions(t);
1286
+ }
1287
+ _update(t) {
1288
+ t.definitions = Object.assign({}, this.definitions, t.definitions), super._update(t), this._rebuildMask();
1289
+ }
1290
+ _rebuildMask() {
1291
+ const t = this.definitions;
1292
+ this._blocks = [], this.exposeBlock = void 0, this._stops = [], this._maskedBlocks = {};
1293
+ const e = this.mask;
1294
+ if (!e || !t) return;
1295
+ let s = !1, i = !1;
1296
+ for (let n = 0; n < e.length; ++n) {
1297
+ if (this.blocks) {
1298
+ const d = e.slice(n), C = Object.keys(this.blocks).filter((x) => d.indexOf(x) === 0);
1299
+ C.sort((x, D) => D.length - x.length);
1300
+ const E = C[0];
1301
+ if (E) {
1302
+ const {
1303
+ expose: x,
1304
+ repeat: D,
1305
+ ...$
1306
+ } = X(this.blocks[E]), z = {
1307
+ lazy: this.lazy,
1308
+ eager: this.eager,
1309
+ placeholderChar: this.placeholderChar,
1310
+ displayChar: this.displayChar,
1311
+ overwrite: this.overwrite,
1312
+ autofix: this.autofix,
1313
+ ...$,
1314
+ repeat: D,
1315
+ parent: this
1316
+ }, G = D != null ? new _.RepeatBlock(
1317
+ z
1318
+ /* TODO */
1319
+ ) : L(z);
1320
+ G && (this._blocks.push(G), x && (this.exposeBlock = G), this._maskedBlocks[E] || (this._maskedBlocks[E] = []), this._maskedBlocks[E].push(this._blocks.length - 1)), n += E.length - 1;
1321
+ continue;
1322
+ }
1323
+ }
1324
+ let r = e[n], a = r in t;
1325
+ if (r === b.STOP_CHAR) {
1326
+ this._stops.push(this._blocks.length);
1327
+ continue;
1328
+ }
1329
+ if (r === "{" || r === "}") {
1330
+ s = !s;
1331
+ continue;
1332
+ }
1333
+ if (r === "[" || r === "]") {
1334
+ i = !i;
1335
+ continue;
1336
+ }
1337
+ if (r === b.ESCAPE_CHAR) {
1338
+ if (++n, r = e[n], !r) break;
1339
+ a = !1;
1340
+ }
1341
+ const h = a ? new ht({
1342
+ isOptional: i,
1343
+ lazy: this.lazy,
1344
+ eager: this.eager,
1345
+ placeholderChar: this.placeholderChar,
1346
+ displayChar: this.displayChar,
1347
+ ...X(t[r]),
1348
+ parent: this
1349
+ }) : new It({
1350
+ char: r,
1351
+ eager: this.eager,
1352
+ isUnmasking: s
1353
+ });
1354
+ this._blocks.push(h);
1355
+ }
1356
+ }
1357
+ get state() {
1358
+ return {
1359
+ ...super.state,
1360
+ _blocks: this._blocks.map((t) => t.state)
1361
+ };
1362
+ }
1363
+ set state(t) {
1364
+ if (!t) {
1365
+ this.reset();
1366
+ return;
1367
+ }
1368
+ const {
1369
+ _blocks: e,
1370
+ ...s
1371
+ } = t;
1372
+ this._blocks.forEach((i, n) => i.state = e[n]), super.state = s;
1373
+ }
1374
+ reset() {
1375
+ super.reset(), this._blocks.forEach((t) => t.reset());
1376
+ }
1377
+ get isComplete() {
1378
+ return this.exposeBlock ? this.exposeBlock.isComplete : this._blocks.every((t) => t.isComplete);
1379
+ }
1380
+ get isFilled() {
1381
+ return this._blocks.every((t) => t.isFilled);
1382
+ }
1383
+ get isFixed() {
1384
+ return this._blocks.every((t) => t.isFixed);
1385
+ }
1386
+ get isOptional() {
1387
+ return this._blocks.every((t) => t.isOptional);
1388
+ }
1389
+ doCommit() {
1390
+ this._blocks.forEach((t) => t.doCommit()), super.doCommit();
1391
+ }
1392
+ get unmaskedValue() {
1393
+ return this.exposeBlock ? this.exposeBlock.unmaskedValue : this._blocks.reduce((t, e) => t += e.unmaskedValue, "");
1394
+ }
1395
+ set unmaskedValue(t) {
1396
+ if (this.exposeBlock) {
1397
+ const e = this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock)) + this.exposeBlock.displayValue.length);
1398
+ this.exposeBlock.unmaskedValue = t, this.appendTail(e), this.doCommit();
1399
+ } else super.unmaskedValue = t;
1400
+ }
1401
+ get value() {
1402
+ return this.exposeBlock ? this.exposeBlock.value : (
1403
+ // TODO return _value when not in change?
1404
+ this._blocks.reduce((t, e) => t += e.value, "")
1405
+ );
1406
+ }
1407
+ set value(t) {
1408
+ if (this.exposeBlock) {
1409
+ const e = this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock)) + this.exposeBlock.displayValue.length);
1410
+ this.exposeBlock.value = t, this.appendTail(e), this.doCommit();
1411
+ } else super.value = t;
1412
+ }
1413
+ get typedValue() {
1414
+ return this.exposeBlock ? this.exposeBlock.typedValue : super.typedValue;
1415
+ }
1416
+ set typedValue(t) {
1417
+ if (this.exposeBlock) {
1418
+ const e = this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock)) + this.exposeBlock.displayValue.length);
1419
+ this.exposeBlock.typedValue = t, this.appendTail(e), this.doCommit();
1420
+ } else super.typedValue = t;
1421
+ }
1422
+ get displayValue() {
1423
+ return this._blocks.reduce((t, e) => t += e.displayValue, "");
1424
+ }
1425
+ appendTail(t) {
1426
+ return super.appendTail(t).aggregate(this._appendPlaceholder());
1427
+ }
1428
+ _appendEager() {
1429
+ var t;
1430
+ const e = new v();
1431
+ let s = (t = this._mapPosToBlock(this.displayValue.length)) == null ? void 0 : t.index;
1432
+ if (s == null) return e;
1433
+ this._blocks[s].isFilled && ++s;
1434
+ for (let i = s; i < this._blocks.length; ++i) {
1435
+ const n = this._blocks[i]._appendEager();
1436
+ if (!n.inserted) break;
1437
+ e.aggregate(n);
1438
+ }
1439
+ return e;
1440
+ }
1441
+ _appendCharRaw(t, e) {
1442
+ e === void 0 && (e = {});
1443
+ const s = this._mapPosToBlock(this.displayValue.length), i = new v();
1444
+ if (!s) return i;
1445
+ for (let r = s.index, a; a = this._blocks[r]; ++r) {
1446
+ var n;
1447
+ const h = a._appendChar(t, {
1448
+ ...e,
1449
+ _beforeTailState: (n = e._beforeTailState) == null || (n = n._blocks) == null ? void 0 : n[r]
1450
+ });
1451
+ if (i.aggregate(h), h.consumed) break;
1452
+ }
1453
+ return i;
1454
+ }
1455
+ extractTail(t, e) {
1456
+ t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length);
1457
+ const s = new P();
1458
+ return t === e || this._forEachBlocksInRange(t, e, (i, n, r, a) => {
1459
+ const h = i.extractTail(r, a);
1460
+ h.stop = this._findStopBefore(n), h.from = this._blockStartPos(n), h instanceof P && (h.blockIndex = n), s.extend(h);
1461
+ }), s;
1462
+ }
1463
+ extractInput(t, e, s) {
1464
+ if (t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), s === void 0 && (s = {}), t === e) return "";
1465
+ let i = "";
1466
+ return this._forEachBlocksInRange(t, e, (n, r, a, h) => {
1467
+ i += n.extractInput(a, h, s);
1468
+ }), i;
1469
+ }
1470
+ _findStopBefore(t) {
1471
+ let e;
1472
+ for (let s = 0; s < this._stops.length; ++s) {
1473
+ const i = this._stops[s];
1474
+ if (i <= t) e = i;
1475
+ else break;
1476
+ }
1477
+ return e;
1478
+ }
1479
+ /** Appends placeholder depending on laziness */
1480
+ _appendPlaceholder(t) {
1481
+ const e = new v();
1482
+ if (this.lazy && t == null) return e;
1483
+ const s = this._mapPosToBlock(this.displayValue.length);
1484
+ if (!s) return e;
1485
+ const i = s.index, n = t ?? this._blocks.length;
1486
+ return this._blocks.slice(i, n).forEach((r) => {
1487
+ if (!r.lazy || t != null) {
1488
+ var a;
1489
+ e.aggregate(r._appendPlaceholder((a = r._blocks) == null ? void 0 : a.length));
1490
+ }
1491
+ }), e;
1492
+ }
1493
+ /** Finds block in pos */
1494
+ _mapPosToBlock(t) {
1495
+ let e = "";
1496
+ for (let s = 0; s < this._blocks.length; ++s) {
1497
+ const i = this._blocks[s], n = e.length;
1498
+ if (e += i.displayValue, t <= e.length)
1499
+ return {
1500
+ index: s,
1501
+ offset: t - n
1502
+ };
1503
+ }
1504
+ }
1505
+ _blockStartPos(t) {
1506
+ return this._blocks.slice(0, t).reduce((e, s) => e += s.displayValue.length, 0);
1507
+ }
1508
+ _forEachBlocksInRange(t, e, s) {
1509
+ e === void 0 && (e = this.displayValue.length);
1510
+ const i = this._mapPosToBlock(t);
1511
+ if (i) {
1512
+ const n = this._mapPosToBlock(e), r = n && i.index === n.index, a = i.offset, h = n && r ? n.offset : this._blocks[i.index].displayValue.length;
1513
+ if (s(this._blocks[i.index], i.index, a, h), n && !r) {
1514
+ for (let d = i.index + 1; d < n.index; ++d)
1515
+ s(this._blocks[d], d, 0, this._blocks[d].displayValue.length);
1516
+ s(this._blocks[n.index], n.index, 0, n.offset);
1517
+ }
1518
+ }
1519
+ }
1520
+ remove(t, e) {
1521
+ t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length);
1522
+ const s = super.remove(t, e);
1523
+ return this._forEachBlocksInRange(t, e, (i, n, r, a) => {
1524
+ s.aggregate(i.remove(r, a));
1525
+ }), s;
1526
+ }
1527
+ nearestInputPos(t, e) {
1528
+ if (e === void 0 && (e = c.NONE), !this._blocks.length) return 0;
1529
+ const s = new Pt(this, t);
1530
+ if (e === c.NONE)
1531
+ return s.pushRightBeforeInput() || (s.popState(), s.pushLeftBeforeInput()) ? s.pos : this.displayValue.length;
1532
+ if (e === c.LEFT || e === c.FORCE_LEFT) {
1533
+ if (e === c.LEFT) {
1534
+ if (s.pushRightBeforeFilled(), s.ok && s.pos === t) return t;
1535
+ s.popState();
1536
+ }
1537
+ if (s.pushLeftBeforeInput(), s.pushLeftBeforeRequired(), s.pushLeftBeforeFilled(), e === c.LEFT) {
1538
+ if (s.pushRightBeforeInput(), s.pushRightBeforeRequired(), s.ok && s.pos <= t || (s.popState(), s.ok && s.pos <= t)) return s.pos;
1539
+ s.popState();
1540
+ }
1541
+ return s.ok ? s.pos : e === c.FORCE_LEFT ? 0 : (s.popState(), s.ok || (s.popState(), s.ok) ? s.pos : 0);
1542
+ }
1543
+ return e === c.RIGHT || e === c.FORCE_RIGHT ? (s.pushRightBeforeInput(), s.pushRightBeforeRequired(), s.pushRightBeforeFilled() ? s.pos : e === c.FORCE_RIGHT ? this.displayValue.length : (s.popState(), s.ok || (s.popState(), s.ok) ? s.pos : this.nearestInputPos(t, c.LEFT))) : t;
1544
+ }
1545
+ totalInputPositions(t, e) {
1546
+ t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length);
1547
+ let s = 0;
1548
+ return this._forEachBlocksInRange(t, e, (i, n, r, a) => {
1549
+ s += i.totalInputPositions(r, a);
1550
+ }), s;
1551
+ }
1552
+ /** Get block by name */
1553
+ maskedBlock(t) {
1554
+ return this.maskedBlocks(t)[0];
1555
+ }
1556
+ /** Get all blocks by name */
1557
+ maskedBlocks(t) {
1558
+ const e = this._maskedBlocks[t];
1559
+ return e ? e.map((s) => this._blocks[s]) : [];
1560
+ }
1561
+ pad(t) {
1562
+ const e = new v();
1563
+ return this._forEachBlocksInRange(0, this.displayValue.length, (s) => e.aggregate(s.pad(t))), e;
1564
+ }
1565
+ }
1566
+ b.DEFAULTS = {
1567
+ ...M.DEFAULTS,
1568
+ lazy: !0,
1569
+ placeholderChar: "_"
1570
+ };
1571
+ b.STOP_CHAR = "`";
1572
+ b.ESCAPE_CHAR = "\\";
1573
+ b.InputDefinition = ht;
1574
+ b.FixedDefinition = It;
1575
+ _.MaskedPattern = b;
1576
+ class et extends b {
1577
+ /**
1578
+ Optionally sets max length of pattern.
1579
+ Used when pattern length is longer then `to` param length. Pads zeros at start in this case.
1580
+ */
1581
+ /** Min bound */
1582
+ /** Max bound */
1583
+ get _matchFrom() {
1584
+ return this.maxLength - String(this.from).length;
1585
+ }
1586
+ constructor(t) {
1587
+ super(t);
1588
+ }
1589
+ updateOptions(t) {
1590
+ super.updateOptions(t);
1591
+ }
1592
+ _update(t) {
1593
+ const {
1594
+ to: e = this.to || 0,
1595
+ from: s = this.from || 0,
1596
+ maxLength: i = this.maxLength || 0,
1597
+ autofix: n = this.autofix,
1598
+ ...r
1599
+ } = t;
1600
+ this.to = e, this.from = s, this.maxLength = Math.max(String(e).length, i), this.autofix = n;
1601
+ const a = String(this.from).padStart(this.maxLength, "0"), h = String(this.to).padStart(this.maxLength, "0");
1602
+ let d = 0;
1603
+ for (; d < h.length && h[d] === a[d]; ) ++d;
1604
+ r.mask = h.slice(0, d).replace(/0/g, "\\0") + "0".repeat(this.maxLength - d), super._update(r);
1605
+ }
1606
+ get isComplete() {
1607
+ return super.isComplete && !!this.value;
1608
+ }
1609
+ boundaries(t) {
1610
+ let e = "", s = "";
1611
+ const [, i, n] = t.match(/^(\D*)(\d*)(\D*)/) || [];
1612
+ return n && (e = "0".repeat(i.length) + n, s = "9".repeat(i.length) + n), e = e.padEnd(this.maxLength, "0"), s = s.padEnd(this.maxLength, "9"), [e, s];
1613
+ }
1614
+ doPrepareChar(t, e) {
1615
+ e === void 0 && (e = {});
1616
+ let s;
1617
+ return [t, s] = super.doPrepareChar(t.replace(/\D/g, ""), e), t || (s.skip = !this.isComplete), [t, s];
1618
+ }
1619
+ _appendCharRaw(t, e) {
1620
+ if (e === void 0 && (e = {}), !this.autofix || this.value.length + 1 > this.maxLength) return super._appendCharRaw(t, e);
1621
+ const s = String(this.from).padStart(this.maxLength, "0"), i = String(this.to).padStart(this.maxLength, "0"), [n, r] = this.boundaries(this.value + t);
1622
+ return Number(r) < this.from ? super._appendCharRaw(s[this.value.length], e) : Number(n) > this.to ? !e.tail && this.autofix === "pad" && this.value.length + 1 < this.maxLength ? super._appendCharRaw(s[this.value.length], e).aggregate(this._appendCharRaw(t, e)) : super._appendCharRaw(i[this.value.length], e) : super._appendCharRaw(t, e);
1623
+ }
1624
+ doValidate(t) {
1625
+ const e = this.value;
1626
+ if (e.search(/[^0]/) === -1 && e.length <= this._matchFrom) return !0;
1627
+ const [i, n] = this.boundaries(e);
1628
+ return this.from <= Number(n) && Number(i) <= this.to && super.doValidate(t);
1629
+ }
1630
+ pad(t) {
1631
+ const e = new v();
1632
+ if (this.value.length === this.maxLength) return e;
1633
+ const s = this.value, i = this.maxLength - this.value.length;
1634
+ if (i) {
1635
+ this.reset();
1636
+ for (let n = 0; n < i; ++n)
1637
+ e.aggregate(super._appendCharRaw("0", t));
1638
+ s.split("").forEach((n) => this._appendCharRaw(n));
1639
+ }
1640
+ return e;
1641
+ }
1642
+ }
1643
+ _.MaskedRange = et;
1644
+ const zt = "d{.}`m{.}`Y";
1645
+ class R extends b {
1646
+ static extractPatternOptions(t) {
1647
+ const {
1648
+ mask: e,
1649
+ pattern: s,
1650
+ ...i
1651
+ } = t;
1652
+ return {
1653
+ ...i,
1654
+ mask: U(e) ? e : s
1655
+ };
1656
+ }
1657
+ /** Pattern mask for date according to {@link MaskedDate#format} */
1658
+ /** Start date */
1659
+ /** End date */
1660
+ /** Format typed value to string */
1661
+ /** Parse string to get typed value */
1662
+ constructor(t) {
1663
+ super(R.extractPatternOptions({
1664
+ ...R.DEFAULTS,
1665
+ ...t
1666
+ }));
1667
+ }
1668
+ updateOptions(t) {
1669
+ super.updateOptions(t);
1670
+ }
1671
+ _update(t) {
1672
+ const {
1673
+ mask: e,
1674
+ pattern: s,
1675
+ blocks: i,
1676
+ ...n
1677
+ } = {
1678
+ ...R.DEFAULTS,
1679
+ ...t
1680
+ }, r = Object.assign({}, R.GET_DEFAULT_BLOCKS());
1681
+ t.min && (r.Y.from = t.min.getFullYear()), t.max && (r.Y.to = t.max.getFullYear()), t.min && t.max && r.Y.from === r.Y.to && (r.m.from = t.min.getMonth() + 1, r.m.to = t.max.getMonth() + 1, r.m.from === r.m.to && (r.d.from = t.min.getDate(), r.d.to = t.max.getDate())), Object.assign(r, this.blocks, i), super._update({
1682
+ ...n,
1683
+ mask: U(e) ? e : s,
1684
+ blocks: r
1685
+ });
1686
+ }
1687
+ doValidate(t) {
1688
+ const e = this.date;
1689
+ return super.doValidate(t) && (!this.isComplete || this.isDateExist(this.value) && e != null && (this.min == null || this.min <= e) && (this.max == null || e <= this.max));
1690
+ }
1691
+ /** Checks if date is exists */
1692
+ isDateExist(t) {
1693
+ return this.format(this.parse(t, this), this).indexOf(t) >= 0;
1694
+ }
1695
+ /** Parsed Date */
1696
+ get date() {
1697
+ return this.typedValue;
1698
+ }
1699
+ set date(t) {
1700
+ this.typedValue = t;
1701
+ }
1702
+ get typedValue() {
1703
+ return this.isComplete ? super.typedValue : null;
1704
+ }
1705
+ set typedValue(t) {
1706
+ super.typedValue = t;
1707
+ }
1708
+ maskEquals(t) {
1709
+ return t === Date || super.maskEquals(t);
1710
+ }
1711
+ optionsIsChanged(t) {
1712
+ return super.optionsIsChanged(R.extractPatternOptions(t));
1713
+ }
1714
+ }
1715
+ R.GET_DEFAULT_BLOCKS = () => ({
1716
+ d: {
1717
+ mask: et,
1718
+ from: 1,
1719
+ to: 31,
1720
+ maxLength: 2
1721
+ },
1722
+ m: {
1723
+ mask: et,
1724
+ from: 1,
1725
+ to: 12,
1726
+ maxLength: 2
1727
+ },
1728
+ Y: {
1729
+ mask: et,
1730
+ from: 1900,
1731
+ to: 9999
1732
+ }
1733
+ });
1734
+ R.DEFAULTS = {
1735
+ ...b.DEFAULTS,
1736
+ mask: Date,
1737
+ pattern: zt,
1738
+ format: (u, t) => {
1739
+ if (!u) return "";
1740
+ const e = String(u.getDate()).padStart(2, "0"), s = String(u.getMonth() + 1).padStart(2, "0"), i = u.getFullYear();
1741
+ return [e, s, i].join(".");
1742
+ },
1743
+ parse: (u, t) => {
1744
+ const [e, s, i] = u.split(".").map(Number);
1745
+ return new Date(i, s - 1, e);
1746
+ }
1747
+ };
1748
+ _.MaskedDate = R;
1749
+ class dt extends M {
1750
+ constructor(t) {
1751
+ super({
1752
+ ...dt.DEFAULTS,
1753
+ ...t
1754
+ }), this.currentMask = void 0;
1755
+ }
1756
+ updateOptions(t) {
1757
+ super.updateOptions(t);
1758
+ }
1759
+ _update(t) {
1760
+ super._update(t), "mask" in t && (this.exposeMask = void 0, this.compiledMasks = Array.isArray(t.mask) ? t.mask.map((e) => {
1761
+ const {
1762
+ expose: s,
1763
+ ...i
1764
+ } = X(e), n = L({
1765
+ overwrite: this._overwrite,
1766
+ eager: this._eager,
1767
+ skipInvalid: this._skipInvalid,
1768
+ ...i
1769
+ });
1770
+ return s && (this.exposeMask = n), n;
1771
+ }) : []);
1772
+ }
1773
+ _appendCharRaw(t, e) {
1774
+ e === void 0 && (e = {});
1775
+ const s = this._applyDispatch(t, e);
1776
+ return this.currentMask && s.aggregate(this.currentMask._appendChar(t, this.currentMaskFlags(e))), s;
1777
+ }
1778
+ _applyDispatch(t, e, s) {
1779
+ t === void 0 && (t = ""), e === void 0 && (e = {}), s === void 0 && (s = "");
1780
+ const i = e.tail && e._beforeTailState != null ? e._beforeTailState._value : this.value, n = this.rawInputValue, r = e.tail && e._beforeTailState != null ? e._beforeTailState._rawInputValue : n, a = n.slice(r.length), h = this.currentMask, d = new v(), C = h?.state;
1781
+ return this.currentMask = this.doDispatch(t, {
1782
+ ...e
1783
+ }, s), this.currentMask && (this.currentMask !== h ? (this.currentMask.reset(), r && (this.currentMask.append(r, {
1784
+ raw: !0
1785
+ }), d.tailShift = this.currentMask.value.length - i.length), a && (d.tailShift += this.currentMask.append(a, {
1786
+ raw: !0,
1787
+ tail: !0
1788
+ }).tailShift)) : C && (this.currentMask.state = C)), d;
1789
+ }
1790
+ _appendPlaceholder() {
1791
+ const t = this._applyDispatch();
1792
+ return this.currentMask && t.aggregate(this.currentMask._appendPlaceholder()), t;
1793
+ }
1794
+ _appendEager() {
1795
+ const t = this._applyDispatch();
1796
+ return this.currentMask && t.aggregate(this.currentMask._appendEager()), t;
1797
+ }
1798
+ appendTail(t) {
1799
+ const e = new v();
1800
+ return t && e.aggregate(this._applyDispatch("", {}, t)), e.aggregate(this.currentMask ? this.currentMask.appendTail(t) : super.appendTail(t));
1801
+ }
1802
+ currentMaskFlags(t) {
1803
+ var e, s;
1804
+ return {
1805
+ ...t,
1806
+ _beforeTailState: ((e = t._beforeTailState) == null ? void 0 : e.currentMaskRef) === this.currentMask && ((s = t._beforeTailState) == null ? void 0 : s.currentMask) || t._beforeTailState
1807
+ };
1808
+ }
1809
+ doDispatch(t, e, s) {
1810
+ return e === void 0 && (e = {}), s === void 0 && (s = ""), this.dispatch(t, this, e, s);
1811
+ }
1812
+ doValidate(t) {
1813
+ return super.doValidate(t) && (!this.currentMask || this.currentMask.doValidate(this.currentMaskFlags(t)));
1814
+ }
1815
+ doPrepare(t, e) {
1816
+ e === void 0 && (e = {});
1817
+ let [s, i] = super.doPrepare(t, e);
1818
+ if (this.currentMask) {
1819
+ let n;
1820
+ [s, n] = super.doPrepare(s, this.currentMaskFlags(e)), i = i.aggregate(n);
1821
+ }
1822
+ return [s, i];
1823
+ }
1824
+ doPrepareChar(t, e) {
1825
+ e === void 0 && (e = {});
1826
+ let [s, i] = super.doPrepareChar(t, e);
1827
+ if (this.currentMask) {
1828
+ let n;
1829
+ [s, n] = super.doPrepareChar(s, this.currentMaskFlags(e)), i = i.aggregate(n);
1830
+ }
1831
+ return [s, i];
1832
+ }
1833
+ reset() {
1834
+ var t;
1835
+ (t = this.currentMask) == null || t.reset(), this.compiledMasks.forEach((e) => e.reset());
1836
+ }
1837
+ get value() {
1838
+ return this.exposeMask ? this.exposeMask.value : this.currentMask ? this.currentMask.value : "";
1839
+ }
1840
+ set value(t) {
1841
+ this.exposeMask ? (this.exposeMask.value = t, this.currentMask = this.exposeMask, this._applyDispatch()) : super.value = t;
1842
+ }
1843
+ get unmaskedValue() {
1844
+ return this.exposeMask ? this.exposeMask.unmaskedValue : this.currentMask ? this.currentMask.unmaskedValue : "";
1845
+ }
1846
+ set unmaskedValue(t) {
1847
+ this.exposeMask ? (this.exposeMask.unmaskedValue = t, this.currentMask = this.exposeMask, this._applyDispatch()) : super.unmaskedValue = t;
1848
+ }
1849
+ get typedValue() {
1850
+ return this.exposeMask ? this.exposeMask.typedValue : this.currentMask ? this.currentMask.typedValue : "";
1851
+ }
1852
+ set typedValue(t) {
1853
+ if (this.exposeMask) {
1854
+ this.exposeMask.typedValue = t, this.currentMask = this.exposeMask, this._applyDispatch();
1855
+ return;
1856
+ }
1857
+ let e = String(t);
1858
+ this.currentMask && (this.currentMask.typedValue = t, e = this.currentMask.unmaskedValue), this.unmaskedValue = e;
1859
+ }
1860
+ get displayValue() {
1861
+ return this.currentMask ? this.currentMask.displayValue : "";
1862
+ }
1863
+ get isComplete() {
1864
+ var t;
1865
+ return !!((t = this.currentMask) != null && t.isComplete);
1866
+ }
1867
+ get isFilled() {
1868
+ var t;
1869
+ return !!((t = this.currentMask) != null && t.isFilled);
1870
+ }
1871
+ remove(t, e) {
1872
+ const s = new v();
1873
+ return this.currentMask && s.aggregate(this.currentMask.remove(t, e)).aggregate(this._applyDispatch()), s;
1874
+ }
1875
+ get state() {
1876
+ var t;
1877
+ return {
1878
+ ...super.state,
1879
+ _rawInputValue: this.rawInputValue,
1880
+ compiledMasks: this.compiledMasks.map((e) => e.state),
1881
+ currentMaskRef: this.currentMask,
1882
+ currentMask: (t = this.currentMask) == null ? void 0 : t.state
1883
+ };
1884
+ }
1885
+ set state(t) {
1886
+ const {
1887
+ compiledMasks: e,
1888
+ currentMaskRef: s,
1889
+ currentMask: i,
1890
+ ...n
1891
+ } = t;
1892
+ e && this.compiledMasks.forEach((r, a) => r.state = e[a]), s != null && (this.currentMask = s, this.currentMask.state = i), super.state = n;
1893
+ }
1894
+ extractInput(t, e, s) {
1895
+ return this.currentMask ? this.currentMask.extractInput(t, e, s) : "";
1896
+ }
1897
+ extractTail(t, e) {
1898
+ return this.currentMask ? this.currentMask.extractTail(t, e) : super.extractTail(t, e);
1899
+ }
1900
+ doCommit() {
1901
+ this.currentMask && this.currentMask.doCommit(), super.doCommit();
1902
+ }
1903
+ nearestInputPos(t, e) {
1904
+ return this.currentMask ? this.currentMask.nearestInputPos(t, e) : super.nearestInputPos(t, e);
1905
+ }
1906
+ get overwrite() {
1907
+ return this.currentMask ? this.currentMask.overwrite : this._overwrite;
1908
+ }
1909
+ set overwrite(t) {
1910
+ this._overwrite = t;
1911
+ }
1912
+ get eager() {
1913
+ return this.currentMask ? this.currentMask.eager : this._eager;
1914
+ }
1915
+ set eager(t) {
1916
+ this._eager = t;
1917
+ }
1918
+ get skipInvalid() {
1919
+ return this.currentMask ? this.currentMask.skipInvalid : this._skipInvalid;
1920
+ }
1921
+ set skipInvalid(t) {
1922
+ this._skipInvalid = t;
1923
+ }
1924
+ get autofix() {
1925
+ return this.currentMask ? this.currentMask.autofix : this._autofix;
1926
+ }
1927
+ set autofix(t) {
1928
+ this._autofix = t;
1929
+ }
1930
+ maskEquals(t) {
1931
+ return Array.isArray(t) ? this.compiledMasks.every((e, s) => {
1932
+ if (!t[s]) return;
1933
+ const {
1934
+ mask: i,
1935
+ ...n
1936
+ } = t[s];
1937
+ return ut(e, n) && e.maskEquals(i);
1938
+ }) : super.maskEquals(t);
1939
+ }
1940
+ typedValueEquals(t) {
1941
+ var e;
1942
+ return !!((e = this.currentMask) != null && e.typedValueEquals(t));
1943
+ }
1944
+ }
1945
+ dt.DEFAULTS = {
1946
+ ...M.DEFAULTS,
1947
+ dispatch: (u, t, e, s) => {
1948
+ if (!t.compiledMasks.length) return;
1949
+ const i = t.rawInputValue, n = t.compiledMasks.map((r, a) => {
1950
+ const h = t.currentMask === r, d = h ? r.displayValue.length : r.nearestInputPos(r.displayValue.length, c.FORCE_LEFT);
1951
+ return r.rawInputValue !== i ? (r.reset(), r.append(i, {
1952
+ raw: !0
1953
+ })) : h || r.remove(d), r.append(u, t.currentMaskFlags(e)), r.appendTail(s), {
1954
+ index: a,
1955
+ weight: r.rawInputValue.length,
1956
+ totalInputPositions: r.totalInputPositions(0, Math.max(d, r.nearestInputPos(r.displayValue.length, c.FORCE_LEFT)))
1957
+ };
1958
+ });
1959
+ return n.sort((r, a) => a.weight - r.weight || a.totalInputPositions - r.totalInputPositions), t.compiledMasks[n[0].index];
1960
+ }
1961
+ };
1962
+ _.MaskedDynamic = dt;
1963
+ class pt extends b {
1964
+ constructor(t) {
1965
+ super({
1966
+ ...pt.DEFAULTS,
1967
+ ...t
1968
+ });
1969
+ }
1970
+ updateOptions(t) {
1971
+ super.updateOptions(t);
1972
+ }
1973
+ _update(t) {
1974
+ const {
1975
+ enum: e,
1976
+ ...s
1977
+ } = t;
1978
+ if (e) {
1979
+ const i = e.map((a) => a.length), n = Math.min(...i), r = Math.max(...i) - n;
1980
+ s.mask = "*".repeat(n), r && (s.mask += "[" + "*".repeat(r) + "]"), this.enum = e;
1981
+ }
1982
+ super._update(s);
1983
+ }
1984
+ _appendCharRaw(t, e) {
1985
+ e === void 0 && (e = {});
1986
+ const s = Math.min(this.nearestInputPos(0, c.FORCE_RIGHT), this.value.length), i = this.enum.filter((n) => this.matchValue(n, this.unmaskedValue + t, s));
1987
+ if (i.length) {
1988
+ i.length === 1 && this._forEachBlocksInRange(0, this.value.length, (r, a) => {
1989
+ const h = i[0][a];
1990
+ a >= this.value.length || h === r.value || (r.reset(), r._appendChar(h, e));
1991
+ });
1992
+ const n = super._appendCharRaw(i[0][this.value.length], e);
1993
+ return i.length === 1 && i[0].slice(this.unmaskedValue.length).split("").forEach((r) => n.aggregate(super._appendCharRaw(r))), n;
1994
+ }
1995
+ return new v({
1996
+ skip: !this.isComplete
1997
+ });
1998
+ }
1999
+ extractTail(t, e) {
2000
+ return t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), new O("", t);
2001
+ }
2002
+ remove(t, e) {
2003
+ if (t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), t === e) return new v();
2004
+ const s = Math.min(super.nearestInputPos(0, c.FORCE_RIGHT), this.value.length);
2005
+ let i;
2006
+ for (i = t; i >= 0 && !(this.enum.filter((a) => this.matchValue(a, this.value.slice(s, i), s)).length > 1); --i)
2007
+ ;
2008
+ const n = super.remove(i, e);
2009
+ return n.tailShift += i - t, n;
2010
+ }
2011
+ get isComplete() {
2012
+ return this.enum.indexOf(this.value) >= 0;
2013
+ }
2014
+ }
2015
+ pt.DEFAULTS = {
2016
+ ...b.DEFAULTS,
2017
+ matchValue: (u, t, e) => u.indexOf(t, e) === e
2018
+ };
2019
+ _.MaskedEnum = pt;
2020
+ class Gt extends M {
2021
+ /** */
2022
+ /** Enable characters overwriting */
2023
+ /** */
2024
+ /** */
2025
+ /** */
2026
+ updateOptions(t) {
2027
+ super.updateOptions(t);
2028
+ }
2029
+ _update(t) {
2030
+ super._update({
2031
+ ...t,
2032
+ validate: t.mask
2033
+ });
2034
+ }
2035
+ }
2036
+ _.MaskedFunction = Gt;
2037
+ var Vt;
2038
+ class V extends M {
2039
+ /** Single char */
2040
+ /** Single char */
2041
+ /** Array of single chars */
2042
+ /** */
2043
+ /** */
2044
+ /** Digits after point */
2045
+ /** Flag to remove leading and trailing zeros in the end of editing */
2046
+ /** Flag to pad trailing zeros after point in the end of editing */
2047
+ /** Enable characters overwriting */
2048
+ /** */
2049
+ /** */
2050
+ /** */
2051
+ /** Format typed value to string */
2052
+ /** Parse string to get typed value */
2053
+ constructor(t) {
2054
+ super({
2055
+ ...V.DEFAULTS,
2056
+ ...t
2057
+ });
2058
+ }
2059
+ updateOptions(t) {
2060
+ super.updateOptions(t);
2061
+ }
2062
+ _update(t) {
2063
+ super._update(t), this._updateRegExps();
2064
+ }
2065
+ _updateRegExps() {
2066
+ const t = "^" + (this.allowNegative ? "[+|\\-]?" : ""), e = "\\d*", s = (this.scale ? "(" + gt(this.radix) + "\\d{0," + this.scale + "})?" : "") + "$";
2067
+ this._numberRegExp = new RegExp(t + e + s), this._mapToRadixRegExp = new RegExp("[" + this.mapToRadix.map(gt).join("") + "]", "g"), this._thousandsSeparatorRegExp = new RegExp(gt(this.thousandsSeparator), "g");
2068
+ }
2069
+ _removeThousandsSeparators(t) {
2070
+ return t.replace(this._thousandsSeparatorRegExp, "");
2071
+ }
2072
+ _insertThousandsSeparators(t) {
2073
+ const e = t.split(this.radix);
2074
+ return e[0] = e[0].replace(/\B(?=(\d{3})+(?!\d))/g, this.thousandsSeparator), e.join(this.radix);
2075
+ }
2076
+ doPrepareChar(t, e) {
2077
+ e === void 0 && (e = {});
2078
+ const [s, i] = super.doPrepareChar(this._removeThousandsSeparators(this.scale && this.mapToRadix.length && /*
2079
+ radix should be mapped when
2080
+ 1) input is done from keyboard = flags.input && flags.raw
2081
+ 2) unmasked value is set = !flags.input && !flags.raw
2082
+ and should not be mapped when
2083
+ 1) value is set = flags.input && !flags.raw
2084
+ 2) raw value is set = !flags.input && flags.raw
2085
+ */
2086
+ (e.input && e.raw || !e.input && !e.raw) ? t.replace(this._mapToRadixRegExp, this.radix) : t), e);
2087
+ return t && !s && (i.skip = !0), s && !this.allowPositive && !this.value && s !== "-" && i.aggregate(this._appendChar("-")), [s, i];
2088
+ }
2089
+ _separatorsCount(t, e) {
2090
+ e === void 0 && (e = !1);
2091
+ let s = 0;
2092
+ for (let i = 0; i < t; ++i)
2093
+ this._value.indexOf(this.thousandsSeparator, i) === i && (++s, e && (t += this.thousandsSeparator.length));
2094
+ return s;
2095
+ }
2096
+ _separatorsCountFromSlice(t) {
2097
+ return t === void 0 && (t = this._value), this._separatorsCount(this._removeThousandsSeparators(t).length, !0);
2098
+ }
2099
+ extractInput(t, e, s) {
2100
+ return t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), [t, e] = this._adjustRangeWithSeparators(t, e), this._removeThousandsSeparators(super.extractInput(t, e, s));
2101
+ }
2102
+ _appendCharRaw(t, e) {
2103
+ e === void 0 && (e = {});
2104
+ const s = e.tail && e._beforeTailState ? e._beforeTailState._value : this._value, i = this._separatorsCountFromSlice(s);
2105
+ this._value = this._removeThousandsSeparators(this.value);
2106
+ const n = this._value;
2107
+ this._value += t;
2108
+ const r = this.number;
2109
+ let a = !isNaN(r), h = !1;
2110
+ if (a) {
2111
+ let x;
2112
+ this.min != null && this.min < 0 && this.number < this.min && (x = this.min), this.max != null && this.max > 0 && this.number > this.max && (x = this.max), x != null && (this.autofix ? (this._value = this.format(x, this).replace(V.UNMASKED_RADIX, this.radix), h || (h = n === this._value && !e.tail)) : a = !1), a && (a = !!this._value.match(this._numberRegExp));
2113
+ }
2114
+ let d;
2115
+ a ? d = new v({
2116
+ inserted: this._value.slice(n.length),
2117
+ rawInserted: h ? "" : t,
2118
+ skip: h
2119
+ }) : (this._value = n, d = new v()), this._value = this._insertThousandsSeparators(this._value);
2120
+ const C = e.tail && e._beforeTailState ? e._beforeTailState._value : this._value, E = this._separatorsCountFromSlice(C);
2121
+ return d.tailShift += (E - i) * this.thousandsSeparator.length, d;
2122
+ }
2123
+ _findSeparatorAround(t) {
2124
+ if (this.thousandsSeparator) {
2125
+ const e = t - this.thousandsSeparator.length + 1, s = this.value.indexOf(this.thousandsSeparator, e);
2126
+ if (s <= t) return s;
2127
+ }
2128
+ return -1;
2129
+ }
2130
+ _adjustRangeWithSeparators(t, e) {
2131
+ const s = this._findSeparatorAround(t);
2132
+ s >= 0 && (t = s);
2133
+ const i = this._findSeparatorAround(e);
2134
+ return i >= 0 && (e = i + this.thousandsSeparator.length), [t, e];
2135
+ }
2136
+ remove(t, e) {
2137
+ t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), [t, e] = this._adjustRangeWithSeparators(t, e);
2138
+ const s = this.value.slice(0, t), i = this.value.slice(e), n = this._separatorsCount(s.length);
2139
+ this._value = this._insertThousandsSeparators(this._removeThousandsSeparators(s + i));
2140
+ const r = this._separatorsCountFromSlice(s);
2141
+ return new v({
2142
+ tailShift: (r - n) * this.thousandsSeparator.length
2143
+ });
2144
+ }
2145
+ nearestInputPos(t, e) {
2146
+ if (!this.thousandsSeparator) return t;
2147
+ switch (e) {
2148
+ case c.NONE:
2149
+ case c.LEFT:
2150
+ case c.FORCE_LEFT: {
2151
+ const s = this._findSeparatorAround(t - 1);
2152
+ if (s >= 0) {
2153
+ const i = s + this.thousandsSeparator.length;
2154
+ if (t < i || this.value.length <= i || e === c.FORCE_LEFT)
2155
+ return s;
2156
+ }
2157
+ break;
2158
+ }
2159
+ case c.RIGHT:
2160
+ case c.FORCE_RIGHT: {
2161
+ const s = this._findSeparatorAround(t);
2162
+ if (s >= 0)
2163
+ return s + this.thousandsSeparator.length;
2164
+ }
2165
+ }
2166
+ return t;
2167
+ }
2168
+ doCommit() {
2169
+ if (this.value) {
2170
+ const t = this.number;
2171
+ let e = t;
2172
+ this.min != null && (e = Math.max(e, this.min)), this.max != null && (e = Math.min(e, this.max)), e !== t && (this.unmaskedValue = this.format(e, this));
2173
+ let s = this.value;
2174
+ this.normalizeZeros && (s = this._normalizeZeros(s)), this.padFractionalZeros && this.scale > 0 && (s = this._padFractionalZeros(s)), this._value = s;
2175
+ }
2176
+ super.doCommit();
2177
+ }
2178
+ _normalizeZeros(t) {
2179
+ const e = this._removeThousandsSeparators(t).split(this.radix);
2180
+ return e[0] = e[0].replace(/^(\D*)(0*)(\d*)/, (s, i, n, r) => i + r), t.length && !/\d$/.test(e[0]) && (e[0] = e[0] + "0"), e.length > 1 && (e[1] = e[1].replace(/0*$/, ""), e[1].length || (e.length = 1)), this._insertThousandsSeparators(e.join(this.radix));
2181
+ }
2182
+ _padFractionalZeros(t) {
2183
+ if (!t) return t;
2184
+ const e = t.split(this.radix);
2185
+ return e.length < 2 && e.push(""), e[1] = e[1].padEnd(this.scale, "0"), e.join(this.radix);
2186
+ }
2187
+ doSkipInvalid(t, e, s) {
2188
+ e === void 0 && (e = {});
2189
+ const i = this.scale === 0 && t !== this.thousandsSeparator && (t === this.radix || t === V.UNMASKED_RADIX || this.mapToRadix.includes(t));
2190
+ return super.doSkipInvalid(t, e, s) && !i;
2191
+ }
2192
+ get unmaskedValue() {
2193
+ return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix, V.UNMASKED_RADIX);
2194
+ }
2195
+ set unmaskedValue(t) {
2196
+ super.unmaskedValue = t;
2197
+ }
2198
+ get typedValue() {
2199
+ return this.parse(this.unmaskedValue, this);
2200
+ }
2201
+ set typedValue(t) {
2202
+ this.rawInputValue = this.format(t, this).replace(V.UNMASKED_RADIX, this.radix);
2203
+ }
2204
+ /** Parsed Number */
2205
+ get number() {
2206
+ return this.typedValue;
2207
+ }
2208
+ set number(t) {
2209
+ this.typedValue = t;
2210
+ }
2211
+ get allowNegative() {
2212
+ return this.min != null && this.min < 0 || this.max != null && this.max < 0;
2213
+ }
2214
+ get allowPositive() {
2215
+ return this.min != null && this.min > 0 || this.max != null && this.max > 0;
2216
+ }
2217
+ typedValueEquals(t) {
2218
+ return (super.typedValueEquals(t) || V.EMPTY_VALUES.includes(t) && V.EMPTY_VALUES.includes(this.typedValue)) && !(t === 0 && this.value === "");
2219
+ }
2220
+ }
2221
+ Vt = V;
2222
+ V.UNMASKED_RADIX = ".";
2223
+ V.EMPTY_VALUES = [...M.EMPTY_VALUES, 0];
2224
+ V.DEFAULTS = {
2225
+ ...M.DEFAULTS,
2226
+ mask: Number,
2227
+ radix: ",",
2228
+ thousandsSeparator: "",
2229
+ mapToRadix: [Vt.UNMASKED_RADIX],
2230
+ min: Number.MIN_SAFE_INTEGER,
2231
+ max: Number.MAX_SAFE_INTEGER,
2232
+ scale: 2,
2233
+ normalizeZeros: !0,
2234
+ padFractionalZeros: !1,
2235
+ parse: Number,
2236
+ format: (u) => u.toLocaleString("en-US", {
2237
+ useGrouping: !1,
2238
+ maximumFractionDigits: 20
2239
+ })
2240
+ };
2241
+ _.MaskedNumber = V;
2242
+ const mt = {
2243
+ MASKED: "value",
2244
+ UNMASKED: "unmaskedValue",
2245
+ TYPED: "typedValue"
2246
+ };
2247
+ function Tt(u, t, e) {
2248
+ t === void 0 && (t = mt.MASKED), e === void 0 && (e = mt.MASKED);
2249
+ const s = L(u);
2250
+ return (i) => s.runIsolated((n) => (n[t] = i, n[e]));
2251
+ }
2252
+ function Kt(u, t, e, s) {
2253
+ return Tt(t, e, s)(u);
2254
+ }
2255
+ _.PIPE_TYPE = mt;
2256
+ _.createPipe = Tt;
2257
+ _.pipe = Kt;
2258
+ class Wt extends b {
2259
+ get repeatFrom() {
2260
+ var t;
2261
+ return (t = Array.isArray(this.repeat) ? this.repeat[0] : this.repeat === 1 / 0 ? 0 : this.repeat) != null ? t : 0;
2262
+ }
2263
+ get repeatTo() {
2264
+ var t;
2265
+ return (t = Array.isArray(this.repeat) ? this.repeat[1] : this.repeat) != null ? t : 1 / 0;
2266
+ }
2267
+ constructor(t) {
2268
+ super(t);
2269
+ }
2270
+ updateOptions(t) {
2271
+ super.updateOptions(t);
2272
+ }
2273
+ _update(t) {
2274
+ var e, s, i;
2275
+ const {
2276
+ repeat: n,
2277
+ ...r
2278
+ } = X(t);
2279
+ this._blockOpts = Object.assign({}, this._blockOpts, r);
2280
+ const a = L(this._blockOpts);
2281
+ this.repeat = (e = (s = n ?? a.repeat) != null ? s : this.repeat) != null ? e : 1 / 0, super._update({
2282
+ mask: "m".repeat(Math.max(this.repeatTo === 1 / 0 && ((i = this._blocks) == null ? void 0 : i.length) || 0, this.repeatFrom)),
2283
+ blocks: {
2284
+ m: a
2285
+ },
2286
+ eager: a.eager,
2287
+ overwrite: a.overwrite,
2288
+ skipInvalid: a.skipInvalid,
2289
+ lazy: a.lazy,
2290
+ placeholderChar: a.placeholderChar,
2291
+ displayChar: a.displayChar
2292
+ });
2293
+ }
2294
+ _allocateBlock(t) {
2295
+ if (t < this._blocks.length) return this._blocks[t];
2296
+ if (this.repeatTo === 1 / 0 || this._blocks.length < this.repeatTo)
2297
+ return this._blocks.push(L(this._blockOpts)), this.mask += "m", this._blocks[this._blocks.length - 1];
2298
+ }
2299
+ _appendCharRaw(t, e) {
2300
+ e === void 0 && (e = {});
2301
+ const s = new v();
2302
+ for (
2303
+ let h = (i = (n = this._mapPosToBlock(this.displayValue.length)) == null ? void 0 : n.index) != null ? i : Math.max(this._blocks.length - 1, 0), d, C;
2304
+ // try to get a block or
2305
+ // try to allocate a new block if not allocated already
2306
+ d = (r = this._blocks[h]) != null ? r : C = !C && this._allocateBlock(h);
2307
+ ++h
2308
+ ) {
2309
+ var i, n, r, a;
2310
+ const E = d._appendChar(t, {
2311
+ ...e,
2312
+ _beforeTailState: (a = e._beforeTailState) == null || (a = a._blocks) == null ? void 0 : a[h]
2313
+ });
2314
+ if (E.skip && C) {
2315
+ this._blocks.pop(), this.mask = this.mask.slice(1);
2316
+ break;
2317
+ }
2318
+ if (s.aggregate(E), E.consumed) break;
2319
+ }
2320
+ return s;
2321
+ }
2322
+ _trimEmptyTail(t, e) {
2323
+ var s, i;
2324
+ t === void 0 && (t = 0);
2325
+ const n = Math.max(((s = this._mapPosToBlock(t)) == null ? void 0 : s.index) || 0, this.repeatFrom, 0);
2326
+ let r;
2327
+ e != null && (r = (i = this._mapPosToBlock(e)) == null ? void 0 : i.index), r == null && (r = this._blocks.length - 1);
2328
+ let a = 0;
2329
+ for (let h = r; n <= h && !this._blocks[h].unmaskedValue; --h, ++a)
2330
+ ;
2331
+ a && (this._blocks.splice(r - a + 1, a), this.mask = this.mask.slice(a));
2332
+ }
2333
+ reset() {
2334
+ super.reset(), this._trimEmptyTail();
2335
+ }
2336
+ remove(t, e) {
2337
+ t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length);
2338
+ const s = super.remove(t, e);
2339
+ return this._trimEmptyTail(t, e), s;
2340
+ }
2341
+ totalInputPositions(t, e) {
2342
+ return t === void 0 && (t = 0), e == null && this.repeatTo === 1 / 0 ? 1 / 0 : super.totalInputPositions(t, e);
2343
+ }
2344
+ get state() {
2345
+ return super.state;
2346
+ }
2347
+ set state(t) {
2348
+ this._blocks.length = t._blocks.length, this.mask = this.mask.slice(0, this._blocks.length), super.state = t;
2349
+ }
2350
+ }
2351
+ _.RepeatBlock = Wt;
2352
+ try {
2353
+ globalThis.IMask = _;
2354
+ } catch {
2355
+ }
2356
+ function ct(u) {
2357
+ return u && u.__esModule && Object.prototype.hasOwnProperty.call(u, "default") ? u.default : u;
2358
+ }
2359
+ var st = { exports: {} }, Zt = st.exports, xt;
2360
+ function Ot() {
2361
+ return xt || (xt = 1, function(u, t) {
2362
+ (function(e, s) {
2363
+ u.exports = s();
2364
+ })(Zt, function() {
2365
+ var e = 1e3, s = 6e4, i = 36e5, n = "millisecond", r = "second", a = "minute", h = "hour", d = "day", C = "week", E = "month", x = "quarter", D = "year", $ = "date", z = "Invalid Date", G = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, Rt = /\[([^\]]+)]|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, Lt = { 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(k) {
2366
+ var p = ["th", "st", "nd", "rd"], o = k % 100;
2367
+ return "[" + k + (p[(o - 20) % 10] || p[o] || p[0]) + "]";
2368
+ } }, kt = function(k, p, o) {
2369
+ var f = String(k);
2370
+ return !f || f.length >= p ? k : "" + Array(p + 1 - f.length).join(o) + k;
2371
+ }, $t = { s: kt, z: function(k) {
2372
+ var p = -k.utcOffset(), o = Math.abs(p), f = Math.floor(o / 60), l = o % 60;
2373
+ return (p <= 0 ? "+" : "-") + kt(f, 2, "0") + ":" + kt(l, 2, "0");
2374
+ }, m: function k(p, o) {
2375
+ if (p.date() < o.date()) return -k(o, p);
2376
+ var f = 12 * (o.year() - p.year()) + (o.month() - p.month()), l = p.clone().add(f, E), g = o - l < 0, m = p.clone().add(f + (g ? -1 : 1), E);
2377
+ return +(-(f + (o - l) / (g ? l - m : m - l)) || 0);
2378
+ }, a: function(k) {
2379
+ return k < 0 ? Math.ceil(k) || 0 : Math.floor(k);
2380
+ }, p: function(k) {
2381
+ return { M: E, y: D, w: C, d, D: $, h, m: a, s: r, ms: n, Q: x }[k] || String(k || "").toLowerCase().replace(/s$/, "");
2382
+ }, u: function(k) {
2383
+ return k === void 0;
2384
+ } }, K = "en", Y = {};
2385
+ Y[K] = Lt;
2386
+ var Et = "$isDayjsObject", _t = function(k) {
2387
+ return k instanceof Q || !(!k || !k[Et]);
2388
+ }, J = function k(p, o, f) {
2389
+ var l;
2390
+ if (!p) return K;
2391
+ if (typeof p == "string") {
2392
+ var g = p.toLowerCase();
2393
+ Y[g] && (l = g), o && (Y[g] = o, l = g);
2394
+ var m = p.split("-");
2395
+ if (!l && m.length > 1) return k(m[0]);
2396
+ } else {
2397
+ var F = p.name;
2398
+ Y[F] = p, l = F;
2399
+ }
2400
+ return !f && l && (K = l), l || !f && K;
2401
+ }, y = function(k, p) {
2402
+ if (_t(k)) return k.clone();
2403
+ var o = typeof p == "object" ? p : {};
2404
+ return o.date = k, o.args = arguments, new Q(o);
2405
+ }, A = $t;
2406
+ A.l = J, A.i = _t, A.w = function(k, p) {
2407
+ return y(k, { locale: p.$L, utc: p.$u, x: p.$x, $offset: p.$offset });
2408
+ };
2409
+ var Q = function() {
2410
+ function k(o) {
2411
+ this.$L = J(o.locale, null, !0), this.parse(o), this.$x = this.$x || o.x || {}, this[Et] = !0;
2412
+ }
2413
+ var p = k.prototype;
2414
+ return p.parse = function(o) {
2415
+ this.$d = function(f) {
2416
+ var l = f.date, g = f.utc;
2417
+ if (l === null) return /* @__PURE__ */ new Date(NaN);
2418
+ if (A.u(l)) return /* @__PURE__ */ new Date();
2419
+ if (l instanceof Date) return new Date(l);
2420
+ if (typeof l == "string" && !/Z$/i.test(l)) {
2421
+ var m = l.match(G);
2422
+ if (m) {
2423
+ var F = m[2] - 1 || 0, S = (m[7] || "0").substring(0, 3);
2424
+ return g ? new Date(Date.UTC(m[1], F, m[3] || 1, m[4] || 0, m[5] || 0, m[6] || 0, S)) : new Date(m[1], F, m[3] || 1, m[4] || 0, m[5] || 0, m[6] || 0, S);
2425
+ }
2426
+ }
2427
+ return new Date(l);
2428
+ }(o), this.init();
2429
+ }, p.init = function() {
2430
+ var o = this.$d;
2431
+ this.$y = o.getFullYear(), this.$M = o.getMonth(), this.$D = o.getDate(), this.$W = o.getDay(), this.$H = o.getHours(), this.$m = o.getMinutes(), this.$s = o.getSeconds(), this.$ms = o.getMilliseconds();
2432
+ }, p.$utils = function() {
2433
+ return A;
2434
+ }, p.isValid = function() {
2435
+ return this.$d.toString() !== z;
2436
+ }, p.isSame = function(o, f) {
2437
+ var l = y(o);
2438
+ return this.startOf(f) <= l && l <= this.endOf(f);
2439
+ }, p.isAfter = function(o, f) {
2440
+ return y(o) < this.startOf(f);
2441
+ }, p.isBefore = function(o, f) {
2442
+ return this.endOf(f) < y(o);
2443
+ }, p.$g = function(o, f, l) {
2444
+ return A.u(o) ? this[f] : this.set(l, o);
2445
+ }, p.unix = function() {
2446
+ return Math.floor(this.valueOf() / 1e3);
2447
+ }, p.valueOf = function() {
2448
+ return this.$d.getTime();
2449
+ }, p.startOf = function(o, f) {
2450
+ var l = this, g = !!A.u(f) || f, m = A.p(o), F = function(j, I) {
2451
+ var N = A.w(l.$u ? Date.UTC(l.$y, I, j) : new Date(l.$y, I, j), l);
2452
+ return g ? N : N.endOf(d);
2453
+ }, S = function(j, I) {
2454
+ return A.w(l.toDate()[j].apply(l.toDate("s"), (g ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(I)), l);
2455
+ }, B = this.$W, w = this.$M, T = this.$D, q = "set" + (this.$u ? "UTC" : "");
2456
+ switch (m) {
2457
+ case D:
2458
+ return g ? F(1, 0) : F(31, 11);
2459
+ case E:
2460
+ return g ? F(1, w) : F(0, w + 1);
2461
+ case C:
2462
+ var H = this.$locale().weekStart || 0, W = (B < H ? B + 7 : B) - H;
2463
+ return F(g ? T - W : T + (6 - W), w);
2464
+ case d:
2465
+ case $:
2466
+ return S(q + "Hours", 0);
2467
+ case h:
2468
+ return S(q + "Minutes", 1);
2469
+ case a:
2470
+ return S(q + "Seconds", 2);
2471
+ case r:
2472
+ return S(q + "Milliseconds", 3);
2473
+ default:
2474
+ return this.clone();
2475
+ }
2476
+ }, p.endOf = function(o) {
2477
+ return this.startOf(o, !1);
2478
+ }, p.$set = function(o, f) {
2479
+ var l, g = A.p(o), m = "set" + (this.$u ? "UTC" : ""), F = (l = {}, l[d] = m + "Date", l[$] = m + "Date", l[E] = m + "Month", l[D] = m + "FullYear", l[h] = m + "Hours", l[a] = m + "Minutes", l[r] = m + "Seconds", l[n] = m + "Milliseconds", l)[g], S = g === d ? this.$D + (f - this.$W) : f;
2480
+ if (g === E || g === D) {
2481
+ var B = this.clone().set($, 1);
2482
+ B.$d[F](S), B.init(), this.$d = B.set($, Math.min(this.$D, B.daysInMonth())).$d;
2483
+ } else F && this.$d[F](S);
2484
+ return this.init(), this;
2485
+ }, p.set = function(o, f) {
2486
+ return this.clone().$set(o, f);
2487
+ }, p.get = function(o) {
2488
+ return this[A.p(o)]();
2489
+ }, p.add = function(o, f) {
2490
+ var l, g = this;
2491
+ o = Number(o);
2492
+ var m = A.p(f), F = function(w) {
2493
+ var T = y(g);
2494
+ return A.w(T.date(T.date() + Math.round(w * o)), g);
2495
+ };
2496
+ if (m === E) return this.set(E, this.$M + o);
2497
+ if (m === D) return this.set(D, this.$y + o);
2498
+ if (m === d) return F(1);
2499
+ if (m === C) return F(7);
2500
+ var S = (l = {}, l[a] = s, l[h] = i, l[r] = e, l)[m] || 1, B = this.$d.getTime() + o * S;
2501
+ return A.w(B, this);
2502
+ }, p.subtract = function(o, f) {
2503
+ return this.add(-1 * o, f);
2504
+ }, p.format = function(o) {
2505
+ var f = this, l = this.$locale();
2506
+ if (!this.isValid()) return l.invalidDate || z;
2507
+ var g = o || "YYYY-MM-DDTHH:mm:ssZ", m = A.z(this), F = this.$H, S = this.$m, B = this.$M, w = l.weekdays, T = l.months, q = l.meridiem, H = function(I, N, Z, tt) {
2508
+ return I && (I[N] || I(f, g)) || Z[N].slice(0, tt);
2509
+ }, W = function(I) {
2510
+ return A.s(F % 12 || 12, I, "0");
2511
+ }, j = q || function(I, N, Z) {
2512
+ var tt = I < 12 ? "AM" : "PM";
2513
+ return Z ? tt.toLowerCase() : tt;
2514
+ };
2515
+ return g.replace(Rt, function(I, N) {
2516
+ return N || function(Z) {
2517
+ switch (Z) {
2518
+ case "YY":
2519
+ return String(f.$y).slice(-2);
2520
+ case "YYYY":
2521
+ return A.s(f.$y, 4, "0");
2522
+ case "M":
2523
+ return B + 1;
2524
+ case "MM":
2525
+ return A.s(B + 1, 2, "0");
2526
+ case "MMM":
2527
+ return H(l.monthsShort, B, T, 3);
2528
+ case "MMMM":
2529
+ return H(T, B);
2530
+ case "D":
2531
+ return f.$D;
2532
+ case "DD":
2533
+ return A.s(f.$D, 2, "0");
2534
+ case "d":
2535
+ return String(f.$W);
2536
+ case "dd":
2537
+ return H(l.weekdaysMin, f.$W, w, 2);
2538
+ case "ddd":
2539
+ return H(l.weekdaysShort, f.$W, w, 3);
2540
+ case "dddd":
2541
+ return w[f.$W];
2542
+ case "H":
2543
+ return String(F);
2544
+ case "HH":
2545
+ return A.s(F, 2, "0");
2546
+ case "h":
2547
+ return W(1);
2548
+ case "hh":
2549
+ return W(2);
2550
+ case "a":
2551
+ return j(F, S, !0);
2552
+ case "A":
2553
+ return j(F, S, !1);
2554
+ case "m":
2555
+ return String(S);
2556
+ case "mm":
2557
+ return A.s(S, 2, "0");
2558
+ case "s":
2559
+ return String(f.$s);
2560
+ case "ss":
2561
+ return A.s(f.$s, 2, "0");
2562
+ case "SSS":
2563
+ return A.s(f.$ms, 3, "0");
2564
+ case "Z":
2565
+ return m;
2566
+ }
2567
+ return null;
2568
+ }(I) || m.replace(":", "");
2569
+ });
2570
+ }, p.utcOffset = function() {
2571
+ return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
2572
+ }, p.diff = function(o, f, l) {
2573
+ var g, m = this, F = A.p(f), S = y(o), B = (S.utcOffset() - this.utcOffset()) * s, w = this - S, T = function() {
2574
+ return A.m(m, S);
2575
+ };
2576
+ switch (F) {
2577
+ case D:
2578
+ g = T() / 12;
2579
+ break;
2580
+ case E:
2581
+ g = T();
2582
+ break;
2583
+ case x:
2584
+ g = T() / 3;
2585
+ break;
2586
+ case C:
2587
+ g = (w - B) / 6048e5;
2588
+ break;
2589
+ case d:
2590
+ g = (w - B) / 864e5;
2591
+ break;
2592
+ case h:
2593
+ g = w / i;
2594
+ break;
2595
+ case a:
2596
+ g = w / s;
2597
+ break;
2598
+ case r:
2599
+ g = w / e;
2600
+ break;
2601
+ default:
2602
+ g = w;
2603
+ }
2604
+ return l ? g : A.a(g);
2605
+ }, p.daysInMonth = function() {
2606
+ return this.endOf(E).$D;
2607
+ }, p.$locale = function() {
2608
+ return Y[this.$L];
2609
+ }, p.locale = function(o, f) {
2610
+ if (!o) return this.$L;
2611
+ var l = this.clone(), g = J(o, f, !0);
2612
+ return g && (l.$L = g), l;
2613
+ }, p.clone = function() {
2614
+ return A.w(this.$d, this);
2615
+ }, p.toDate = function() {
2616
+ return new Date(this.valueOf());
2617
+ }, p.toJSON = function() {
2618
+ return this.isValid() ? this.toISOString() : null;
2619
+ }, p.toISOString = function() {
2620
+ return this.$d.toISOString();
2621
+ }, p.toString = function() {
2622
+ return this.$d.toUTCString();
2623
+ }, k;
2624
+ }(), Ct = Q.prototype;
2625
+ return y.prototype = Ct, [["$ms", n], ["$s", r], ["$m", a], ["$H", h], ["$W", d], ["$M", E], ["$y", D], ["$D", $]].forEach(function(k) {
2626
+ Ct[k[1]] = function(p) {
2627
+ return this.$g(p, k[0], k[1]);
2628
+ };
2629
+ }), y.extend = function(k, p) {
2630
+ return k.$i || (k(p, Q, y), k.$i = !0), y;
2631
+ }, y.locale = J, y.isDayjs = _t, y.unix = function(k) {
2632
+ return y(1e3 * k);
2633
+ }, y.en = Y[K], y.Ls = Y, y.p = {}, y;
2634
+ });
2635
+ }(st)), st.exports;
2636
+ }
2637
+ var Xt = Ot();
2638
+ const ft = /* @__PURE__ */ ct(Xt);
2639
+ var it = { exports: {} }, Jt = it.exports, St;
2640
+ function Qt() {
2641
+ return St || (St = 1, function(u, t) {
2642
+ (function(e, s) {
2643
+ u.exports = s(Ot());
2644
+ })(Jt, function(e) {
2645
+ function s(r) {
2646
+ return r && typeof r == "object" && "default" in r ? r : { default: r };
2647
+ }
2648
+ var i = s(e), n = { name: "fr", weekdays: "dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"), weekdaysShort: "dim._lun._mar._mer._jeu._ven._sam.".split("_"), weekdaysMin: "di_lu_ma_me_je_ve_sa".split("_"), months: "janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"), monthsShort: "janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"), weekStart: 1, yearStart: 4, formats: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "dddd D MMMM YYYY HH:mm" }, relativeTime: { future: "dans %s", past: "il y a %s", s: "quelques secondes", m: "une minute", mm: "%d minutes", h: "une heure", hh: "%d heures", d: "un jour", dd: "%d jours", M: "un mois", MM: "%d mois", y: "un an", yy: "%d ans" }, ordinal: function(r) {
2649
+ return "" + r + (r === 1 ? "er" : "");
2650
+ } };
2651
+ return i.default.locale(n, null, !0), n;
2652
+ });
2653
+ }(it)), it.exports;
2654
+ }
2655
+ Qt();
2656
+ var nt = { exports: {} }, te = nt.exports, yt;
2657
+ function ee() {
2658
+ return yt || (yt = 1, function(u, t) {
2659
+ (function(e, s) {
2660
+ u.exports = s();
2661
+ })(te, function() {
2662
+ return function(e, s) {
2663
+ s.prototype.weekday = function(i) {
2664
+ var n = this.$locale().weekStart || 0, r = this.$W, a = (r < n ? r + 7 : r) - n;
2665
+ return this.$utils().u(i) ? a : this.subtract(a, "day").add(i, "day");
2666
+ };
2667
+ };
2668
+ });
2669
+ }(nt)), nt.exports;
2670
+ }
2671
+ var se = ee();
2672
+ const ie = /* @__PURE__ */ ct(se);
2673
+ var rt = { exports: {} }, ne = rt.exports, Bt;
2674
+ function re() {
2675
+ return Bt || (Bt = 1, function(u, t) {
2676
+ (function(e, s) {
2677
+ u.exports = s();
2678
+ })(ne, function() {
2679
+ return function(e, s, i) {
2680
+ s.prototype.isBetween = function(n, r, a, h) {
2681
+ var d = i(n), C = i(r), E = (h = h || "()")[0] === "(", x = h[1] === ")";
2682
+ return (E ? this.isAfter(d, a) : !this.isBefore(d, a)) && (x ? this.isBefore(C, a) : !this.isAfter(C, a)) || (E ? this.isBefore(d, a) : !this.isAfter(d, a)) && (x ? this.isAfter(C, a) : !this.isBefore(C, a));
2683
+ };
2684
+ };
2685
+ });
2686
+ }(rt)), rt.exports;
2687
+ }
2688
+ var ae = re();
2689
+ const ue = /* @__PURE__ */ ct(ae);
2690
+ var at = { exports: {} }, he = at.exports, Dt;
2691
+ function oe() {
2692
+ return Dt || (Dt = 1, function(u, t) {
2693
+ (function(e, s) {
2694
+ u.exports = s();
2695
+ })(he, function() {
2696
+ var e = "week", s = "year";
2697
+ return function(i, n, r) {
2698
+ var a = n.prototype;
2699
+ a.week = function(h) {
2700
+ if (h === void 0 && (h = null), h !== null) return this.add(7 * (h - this.week()), "day");
2701
+ var d = this.$locale().yearStart || 1;
2702
+ if (this.month() === 11 && this.date() > 25) {
2703
+ var C = r(this).startOf(s).add(1, s).date(d), E = r(this).endOf(e);
2704
+ if (C.isBefore(E)) return 1;
2705
+ }
2706
+ var x = r(this).startOf(s).date(d).startOf(e).subtract(1, "millisecond"), D = this.diff(x, e, !0);
2707
+ return D < 0 ? r(this).startOf("week").week() : Math.ceil(D);
2708
+ }, a.weeks = function(h) {
2709
+ return h === void 0 && (h = null), this.week(h);
2710
+ };
2711
+ };
2712
+ });
2713
+ }(at)), at.exports;
2714
+ }
2715
+ var le = oe();
2716
+ const de = /* @__PURE__ */ ct(le);
2717
+ ft.locale("fr");
2718
+ ft.extend(ie);
2719
+ ft.extend(ue);
2720
+ ft.extend(de);