intl-tel-input 26.0.0-beta.1 → 26.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/README.md +29 -26
  2. package/angular/README.md +1 -1
  3. package/angular/build/IntlTelInput.js +16 -6
  4. package/angular/build/IntlTelInputWithUtils.js +140 -191
  5. package/angular/build/types/intl-tel-input/i18n/index.d.ts +1 -0
  6. package/angular/build/types/intl-tel-input/i18n/zh-hk/index.d.ts +3 -0
  7. package/build/js/data.js +1 -1
  8. package/build/js/data.min.js +1 -1
  9. package/build/js/i18n/ar/countries.js +245 -0
  10. package/build/js/i18n/ar/index.js +1 -0
  11. package/build/js/i18n/ar/interface.js +23 -0
  12. package/build/js/i18n/bg/countries.js +245 -0
  13. package/build/js/i18n/bg/index.js +1 -0
  14. package/build/js/i18n/bg/interface.js +13 -0
  15. package/build/js/i18n/bn/countries.js +245 -0
  16. package/build/js/i18n/bn/index.js +1 -0
  17. package/build/js/i18n/bn/interface.js +13 -0
  18. package/build/js/i18n/bs/countries.js +245 -0
  19. package/build/js/i18n/bs/index.js +1 -0
  20. package/build/js/i18n/bs/interface.js +20 -0
  21. package/build/js/i18n/ca/countries.js +245 -0
  22. package/build/js/i18n/ca/index.js +1 -0
  23. package/build/js/i18n/ca/interface.js +13 -0
  24. package/build/js/i18n/cs/countries.js +245 -0
  25. package/build/js/i18n/cs/index.js +1 -0
  26. package/build/js/i18n/cs/interface.js +20 -0
  27. package/build/js/i18n/da/countries.js +245 -0
  28. package/build/js/i18n/da/index.js +1 -0
  29. package/build/js/i18n/da/interface.js +13 -0
  30. package/build/js/i18n/de/countries.js +245 -0
  31. package/build/js/i18n/de/index.js +1 -0
  32. package/build/js/i18n/de/interface.js +13 -0
  33. package/build/js/i18n/ee/countries.js +245 -0
  34. package/build/js/i18n/ee/index.js +1 -0
  35. package/build/js/i18n/ee/interface.js +13 -0
  36. package/build/js/i18n/el/countries.js +245 -0
  37. package/build/js/i18n/el/index.js +1 -0
  38. package/build/js/i18n/el/interface.js +13 -0
  39. package/build/js/i18n/en/countries.js +245 -0
  40. package/build/js/i18n/en/interface.js +14 -0
  41. package/build/js/i18n/es/countries.js +245 -0
  42. package/build/js/i18n/es/index.js +1 -0
  43. package/build/js/i18n/es/interface.js +13 -0
  44. package/build/js/i18n/fa/countries.js +245 -0
  45. package/build/js/i18n/fa/index.js +1 -0
  46. package/build/js/i18n/fa/interface.js +13 -0
  47. package/build/js/i18n/fi/countries.js +245 -0
  48. package/build/js/i18n/fi/index.js +1 -0
  49. package/build/js/i18n/fi/interface.js +13 -0
  50. package/build/js/i18n/fr/countries.js +245 -0
  51. package/build/js/i18n/fr/index.js +1 -0
  52. package/build/js/i18n/fr/interface.js +13 -0
  53. package/build/js/i18n/hi/countries.js +245 -0
  54. package/build/js/i18n/hi/index.js +1 -0
  55. package/build/js/i18n/hi/interface.js +13 -0
  56. package/build/js/i18n/hr/countries.js +245 -0
  57. package/build/js/i18n/hr/index.js +1 -0
  58. package/build/js/i18n/hr/interface.js +20 -0
  59. package/build/js/i18n/hu/countries.js +245 -0
  60. package/build/js/i18n/hu/index.js +1 -0
  61. package/build/js/i18n/hu/interface.js +13 -0
  62. package/build/js/i18n/id/countries.js +245 -0
  63. package/build/js/i18n/id/index.js +1 -0
  64. package/build/js/i18n/id/interface.js +13 -0
  65. package/build/js/i18n/index.js +1 -0
  66. package/build/js/i18n/it/countries.js +245 -0
  67. package/build/js/i18n/it/index.js +1 -0
  68. package/build/js/i18n/it/interface.js +13 -0
  69. package/build/js/i18n/ja/countries.js +245 -0
  70. package/build/js/i18n/ja/index.js +1 -0
  71. package/build/js/i18n/ja/interface.js +13 -0
  72. package/build/js/i18n/ko/countries.js +245 -0
  73. package/build/js/i18n/ko/index.js +1 -0
  74. package/build/js/i18n/ko/interface.js +13 -0
  75. package/build/js/i18n/lt/countries.js +245 -0
  76. package/build/js/i18n/lt/interface.js +26 -0
  77. package/build/js/i18n/mr/countries.js +245 -0
  78. package/build/js/i18n/mr/index.js +1 -0
  79. package/build/js/i18n/mr/interface.js +13 -0
  80. package/build/js/i18n/nl/countries.js +245 -0
  81. package/build/js/i18n/nl/index.js +1 -0
  82. package/build/js/i18n/nl/interface.js +13 -0
  83. package/build/js/i18n/no/countries.js +245 -0
  84. package/build/js/i18n/no/index.js +1 -0
  85. package/build/js/i18n/no/interface.js +13 -0
  86. package/build/js/i18n/pl/countries.js +245 -0
  87. package/build/js/i18n/pl/index.js +1 -0
  88. package/build/js/i18n/pl/interface.js +19 -0
  89. package/build/js/i18n/pt/countries.js +245 -0
  90. package/build/js/i18n/pt/index.js +1 -0
  91. package/build/js/i18n/pt/interface.js +13 -0
  92. package/build/js/i18n/ro/countries.js +245 -0
  93. package/build/js/i18n/ro/index.js +1 -0
  94. package/build/js/i18n/ro/interface.js +18 -0
  95. package/build/js/i18n/ru/countries.js +245 -0
  96. package/build/js/i18n/ru/index.js +1 -0
  97. package/build/js/i18n/ru/interface.js +20 -0
  98. package/build/js/i18n/sk/countries.js +245 -0
  99. package/build/js/i18n/sk/index.js +1 -0
  100. package/build/js/i18n/sk/interface.js +20 -0
  101. package/build/js/i18n/sl/countries.js +245 -0
  102. package/build/js/i18n/sl/interface.js +25 -0
  103. package/build/js/i18n/sq/countries.js +245 -0
  104. package/build/js/i18n/sq/interface.js +14 -0
  105. package/build/js/i18n/sr/countries.js +245 -0
  106. package/build/js/i18n/sr/interface.js +21 -0
  107. package/build/js/i18n/sv/countries.js +245 -0
  108. package/build/js/i18n/sv/index.js +1 -0
  109. package/build/js/i18n/sv/interface.js +13 -0
  110. package/build/js/i18n/te/countries.js +245 -0
  111. package/build/js/i18n/te/index.js +1 -0
  112. package/build/js/i18n/te/interface.js +13 -0
  113. package/build/js/i18n/th/countries.js +245 -0
  114. package/build/js/i18n/th/index.js +1 -0
  115. package/build/js/i18n/th/interface.js +13 -0
  116. package/build/js/i18n/tr/countries.js +245 -0
  117. package/build/js/i18n/tr/index.js +1 -0
  118. package/build/js/i18n/tr/interface.js +13 -0
  119. package/build/js/i18n/uk/countries.js +245 -0
  120. package/build/js/i18n/uk/index.js +1 -0
  121. package/build/js/i18n/uk/interface.js +20 -0
  122. package/build/js/i18n/ur/countries.js +245 -0
  123. package/build/js/i18n/ur/index.js +1 -0
  124. package/build/js/i18n/ur/interface.js +13 -0
  125. package/build/js/i18n/uz/countries.js +245 -0
  126. package/build/js/i18n/uz/index.js +1 -0
  127. package/build/js/i18n/uz/interface.js +13 -0
  128. package/build/js/i18n/vi/countries.js +245 -0
  129. package/build/js/i18n/vi/index.js +1 -0
  130. package/build/js/i18n/vi/interface.js +13 -0
  131. package/build/js/i18n/zh/countries.js +245 -0
  132. package/build/js/i18n/zh/index.js +1 -0
  133. package/build/js/i18n/zh/interface.js +13 -0
  134. package/build/js/i18n/zh-hk/countries.js +245 -0
  135. package/build/js/i18n/zh-hk/index.js +18 -0
  136. package/build/js/i18n/zh-hk/interface.js +14 -0
  137. package/build/js/intlTelInput.d.ts +6 -0
  138. package/build/js/intlTelInput.js +17 -7
  139. package/build/js/intlTelInput.min.js +3 -3
  140. package/build/js/intlTelInputWithUtils.js +141 -192
  141. package/build/js/intlTelInputWithUtils.min.js +3 -3
  142. package/build/js/utils.js +53 -54
  143. package/package.json +2 -2
  144. package/react/README.md +4 -2
  145. package/react/build/IntlTelInput.cjs +16 -6
  146. package/react/build/IntlTelInput.d.ts +6 -0
  147. package/react/build/IntlTelInput.js +16 -6
  148. package/react/build/IntlTelInputWithUtils.cjs +140 -191
  149. package/react/build/IntlTelInputWithUtils.js +140 -191
  150. package/svelte/README.md +7 -9
  151. package/svelte/build/IntlTelInput.mjs +1446 -1440
  152. package/svelte/build/IntlTelInputWithUtils.mjs +1795 -1850
  153. package/vue/README.md +12 -10
  154. package/vue/build/IntlTelInput.vue.d.ts +2 -0
  155. package/vue/build/IntlTelInputWithUtils.vue.d.ts +2 -0
  156. package/vue/build/exports/IntlTelInput.mjs +17 -16
  157. package/vue/build/exports/IntlTelInputWithUtils.mjs +176 -236
  158. package/vue/build/intl-tel-input/i18n/index.d.ts +1 -0
  159. package/vue/build/intl-tel-input/i18n/zh-hk/index.d.ts +3 -0
  160. package/vue/build/{intl-tel-input-f0-6rrpA.mjs → intl-tel-input-DYFK-Vt4.mjs} +12 -6
@@ -1,222 +1,235 @@
1
- var Hn = Object.defineProperty;
2
- var Se = (e) => {
3
- throw TypeError(e);
1
+ var Fn = Object.defineProperty;
2
+ var Se = (t) => {
3
+ throw TypeError(t);
4
4
  };
5
- var Fn = (e, t, n) => t in e ? Hn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
6
- var nt = (e, t, n) => Fn(e, typeof t != "symbol" ? t + "" : t, n), ee = (e, t, n) => t.has(e) || Se("Cannot " + n);
7
- var A = (e, t, n) => (ee(e, t, "read from private field"), n ? n.call(e) : t.get(e)), tt = (e, t, n) => t.has(e) ? Se("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), mt = (e, t, n, i) => (ee(e, t, "write to private field"), i ? i.call(e, n) : t.set(e, n), n), K = (e, t, n) => (ee(e, t, "access private method"), n);
8
- import { onMount as Bn, onDestroy as Vn } from "svelte";
9
- const Wn = "5";
5
+ var Bn = (t, e, n) => e in t ? Fn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
6
+ var tt = (t, e, n) => Bn(t, typeof e != "symbol" ? e + "" : e, n), te = (t, e, n) => e.has(t) || Se("Cannot " + n);
7
+ var L = (t, e, n) => (te(t, e, "read from private field"), n ? n.call(t) : e.get(t)), Z = (t, e, n) => e.has(t) ? Se("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), mt = (t, e, n, i) => (te(t, e, "write to private field"), i ? i.call(t, n) : e.set(t, n), n), lt = (t, e, n) => (te(t, e, "access private method"), n);
8
+ import { onMount as Vn, onDestroy as Wn } from "svelte";
9
+ const jn = "5";
10
10
  var $e;
11
- typeof window < "u" && (($e = window.__svelte ?? (window.__svelte = {})).v ?? ($e.v = /* @__PURE__ */ new Set())).add(Wn);
12
- const jn = 1, Gn = 4, Yn = 8, Kn = 16, zn = 2, R = Symbol(), qn = "http://www.w3.org/1999/xhtml", $n = "@attach", de = !1;
13
- var Xe = Array.isArray, Xn = Array.prototype.indexOf, Qn = Object.defineProperty, jt = Object.getOwnPropertyDescriptor, Zn = Object.getOwnPropertyDescriptors, Jn = Object.prototype, ti = Array.prototype, Qe = Object.getPrototypeOf;
14
- function ei(e) {
15
- for (var t = 0; t < e.length; t++)
16
- e[t]();
11
+ typeof window < "u" && (($e = window.__svelte ?? (window.__svelte = {})).v ?? ($e.v = /* @__PURE__ */ new Set())).add(jn);
12
+ const Gn = 1, Yn = 4, Kn = 8, zn = 16, qn = 2, P = Symbol(), $n = "http://www.w3.org/1999/xhtml", Xn = "@attach", ce = !1;
13
+ var Xe = Array.isArray, Qn = Array.prototype.indexOf, Zn = Object.defineProperty, Wt = Object.getOwnPropertyDescriptor, Jn = Object.getOwnPropertyDescriptors, ti = Object.prototype, ei = Array.prototype, Qe = Object.getPrototypeOf;
14
+ function ni(t) {
15
+ for (var e = 0; e < t.length; e++)
16
+ t[e]();
17
17
  }
18
18
  function Ze() {
19
- var e, t, n = new Promise((i, s) => {
20
- e = i, t = s;
19
+ var t, e, n = new Promise((i, s) => {
20
+ t = i, e = s;
21
21
  });
22
- return { promise: n, resolve: e, reject: t };
22
+ return { promise: n, resolve: t, reject: e };
23
23
  }
24
- const M = 2, ge = 4, Je = 8, tn = 1 << 24, _t = 16, Ct = 32, St = 64, be = 128, q = 512, H = 1024, j = 2048, Q = 4096, It = 8192, et = 16384, we = 32768, Pe = 65536, Oe = 1 << 17, en = 1 << 18, Jt = 1 << 19, ni = 1 << 20, ht = 32768, fe = 1 << 21, Ie = 1 << 22, it = 1 << 23, ct = Symbol("$state"), ii = Symbol("legacy props"), si = Symbol(""), gt = new class extends Error {
24
+ const k = 2, Gt = 4, ge = 8, me = 1 << 24, yt = 16, vt = 32, Pt = 64, Je = 128, Y = 512, x = 1024, W = 2048, rt = 4096, Et = 8192, J = 16384, be = 32768, Pe = 65536, Oe = 1 << 17, tn = 1 << 18, Zt = 1 << 19, ii = 1 << 20, _t = 32768, de = 1 << 21, we = 1 << 22, et = 1 << 23, ft = Symbol("$state"), si = Symbol("legacy props"), ri = Symbol(""), bt = new class extends Error {
25
25
  constructor() {
26
26
  super(...arguments);
27
- nt(this, "name", "StaleReactionError");
28
- nt(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed");
27
+ tt(this, "name", "StaleReactionError");
28
+ tt(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed");
29
29
  }
30
30
  }();
31
- function ri() {
31
+ function oi() {
32
32
  throw new Error("https://svelte.dev/e/async_derived_orphan");
33
33
  }
34
- function oi(e) {
34
+ function li(t) {
35
35
  throw new Error("https://svelte.dev/e/effect_in_teardown");
36
36
  }
37
- function li() {
37
+ function ui() {
38
38
  throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
39
39
  }
40
- function ui(e) {
40
+ function ai(t) {
41
41
  throw new Error("https://svelte.dev/e/effect_orphan");
42
42
  }
43
- function ai() {
43
+ function ci() {
44
44
  throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
45
45
  }
46
- function ci(e) {
46
+ function di(t) {
47
47
  throw new Error("https://svelte.dev/e/props_invalid_value");
48
48
  }
49
- function di() {
49
+ function fi() {
50
50
  throw new Error("https://svelte.dev/e/state_descriptors_fixed");
51
51
  }
52
- function fi() {
52
+ function hi() {
53
53
  throw new Error("https://svelte.dev/e/state_prototype_fixed");
54
54
  }
55
- function hi() {
55
+ function pi() {
56
56
  throw new Error("https://svelte.dev/e/state_unsafe_mutation");
57
57
  }
58
- function pi() {
58
+ function _i() {
59
59
  console.warn("https://svelte.dev/e/select_multiple_invalid_value");
60
60
  }
61
- function nn(e) {
62
- return e === this.v;
61
+ function en(t) {
62
+ return t === this.v;
63
63
  }
64
- function _i(e, t) {
65
- return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function";
64
+ function Ci(t, e) {
65
+ return t != t ? e == e : t !== e || t !== null && typeof t == "object" || typeof t == "function";
66
66
  }
67
- function Ci(e) {
68
- return !_i(e, this.v);
67
+ function yi(t) {
68
+ return !Ci(t, this.v);
69
69
  }
70
- let yi = !1, Z = null;
71
- function Yt(e) {
72
- Z = e;
70
+ let vi = !1, X = null;
71
+ function Yt(t) {
72
+ X = t;
73
73
  }
74
- function vi(e, t = !1, n) {
75
- Z = {
76
- p: Z,
74
+ function gi(t, e = !1, n) {
75
+ X = {
76
+ p: X,
77
77
  i: !1,
78
78
  c: null,
79
79
  e: null,
80
- s: e,
80
+ s: t,
81
81
  x: null,
82
82
  l: null
83
83
  };
84
84
  }
85
- function mi(e) {
86
- var t = (
85
+ function mi(t) {
86
+ var e = (
87
87
  /** @type {ComponentContext} */
88
- Z
89
- ), n = t.e;
88
+ X
89
+ ), n = e.e;
90
90
  if (n !== null) {
91
- t.e = null;
91
+ e.e = null;
92
92
  for (var i of n)
93
- _n(i);
93
+ Cn(i);
94
94
  }
95
- return e !== void 0 && (t.x = e), t.i = !0, Z = t.p, e ?? /** @type {T} */
95
+ return t !== void 0 && (e.x = t), e.i = !0, X = e.p, t ?? /** @type {T} */
96
96
  {};
97
97
  }
98
- function sn() {
98
+ function nn() {
99
99
  return !0;
100
100
  }
101
- let bt = [];
102
- function gi() {
103
- var e = bt;
104
- bt = [], ei(e);
101
+ let wt = [];
102
+ function bi() {
103
+ var t = wt;
104
+ wt = [], ni(t);
105
105
  }
106
- function te(e) {
107
- if (bt.length === 0) {
108
- var t = bt;
106
+ function Jt(t) {
107
+ if (wt.length === 0) {
108
+ var e = wt;
109
109
  queueMicrotask(() => {
110
- t === bt && gi();
110
+ e === wt && bi();
111
111
  });
112
112
  }
113
- bt.push(e);
113
+ wt.push(t);
114
114
  }
115
- function bi(e) {
116
- var t = D;
117
- if (t === null)
118
- return w.f |= it, e;
119
- if ((t.f & we) === 0) {
120
- if ((t.f & be) === 0)
121
- throw e;
122
- t.b.error(e);
115
+ function wi(t) {
116
+ var e = N;
117
+ if (e === null)
118
+ return w.f |= et, t;
119
+ if ((e.f & be) === 0) {
120
+ if ((e.f & Je) === 0)
121
+ throw t;
122
+ e.b.error(t);
123
123
  } else
124
- Kt(e, t);
124
+ Kt(t, e);
125
125
  }
126
- function Kt(e, t) {
127
- for (; t !== null; ) {
128
- if ((t.f & be) !== 0)
126
+ function Kt(t, e) {
127
+ for (; e !== null; ) {
128
+ if ((e.f & Je) !== 0)
129
129
  try {
130
- t.b.error(e);
130
+ e.b.error(t);
131
131
  return;
132
132
  } catch (n) {
133
- e = n;
133
+ t = n;
134
134
  }
135
- t = t.parent;
135
+ e = e.parent;
136
136
  }
137
- throw e;
137
+ throw t;
138
138
  }
139
- const Ft = /* @__PURE__ */ new Set();
140
- let N = null, P = null, $ = [], Ee = null, he = !1;
141
- var Nt, Dt, ut, at, Ut, Lt, At, k, pe, Rt, _e, rn, on;
142
- const Zt = class Zt {
139
+ const Ii = -7169;
140
+ function H(t, e) {
141
+ t.f = t.f & Ii | e;
142
+ }
143
+ function Ie(t) {
144
+ (t.f & Y) !== 0 || t.deps === null ? H(t, x) : H(t, rt);
145
+ }
146
+ function sn(t) {
147
+ if (t !== null)
148
+ for (const e of t)
149
+ (e.f & k) === 0 || (e.f & _t) === 0 || (e.f ^= _t, sn(
150
+ /** @type {Derived} */
151
+ e.deps
152
+ ));
153
+ }
154
+ function Ei(t, e, n) {
155
+ (t.f & W) !== 0 ? e.add(t) : (t.f & rt) !== 0 && n.add(t), sn(t.deps), H(t, x);
156
+ }
157
+ const Ht = /* @__PURE__ */ new Set();
158
+ let T = null, R = null, $ = [], Ee = null, fe = !1;
159
+ var Dt, Lt, ct, dt, xt, At, Tt, K, he, pe, rn, on;
160
+ const Qt = class Qt {
143
161
  constructor() {
144
- tt(this, k);
145
- nt(this, "committed", !1);
162
+ Z(this, K);
163
+ tt(this, "committed", !1);
146
164
  /**
147
165
  * The current values of any sources that are updated in this batch
148
166
  * They keys of this map are identical to `this.#previous`
149
167
  * @type {Map<Source, any>}
150
168
  */
151
- nt(this, "current", /* @__PURE__ */ new Map());
169
+ tt(this, "current", /* @__PURE__ */ new Map());
152
170
  /**
153
171
  * The values of any sources that are updated in this batch _before_ those updates took place.
154
172
  * They keys of this map are identical to `this.#current`
155
173
  * @type {Map<Source, any>}
156
174
  */
157
- nt(this, "previous", /* @__PURE__ */ new Map());
175
+ tt(this, "previous", /* @__PURE__ */ new Map());
158
176
  /**
159
177
  * When the batch is committed (and the DOM is updated), we need to remove old branches
160
178
  * and append new ones by calling the functions added inside (if/each/key/etc) blocks
161
179
  * @type {Set<() => void>}
162
180
  */
163
- tt(this, Nt, /* @__PURE__ */ new Set());
181
+ Z(this, Dt, /* @__PURE__ */ new Set());
164
182
  /**
165
183
  * If a fork is discarded, we need to destroy any effects that are no longer needed
166
184
  * @type {Set<(batch: Batch) => void>}
167
185
  */
168
- tt(this, Dt, /* @__PURE__ */ new Set());
186
+ Z(this, Lt, /* @__PURE__ */ new Set());
169
187
  /**
170
188
  * The number of async effects that are currently in flight
171
189
  */
172
- tt(this, ut, 0);
190
+ Z(this, ct, 0);
173
191
  /**
174
192
  * The number of async effects that are currently in flight, _not_ inside a pending boundary
175
193
  */
176
- tt(this, at, 0);
194
+ Z(this, dt, 0);
177
195
  /**
178
196
  * A deferred that resolves when the batch is committed, used with `settled()`
179
197
  * TODO replace with Promise.withResolvers once supported widely enough
180
198
  * @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}
181
199
  */
182
- tt(this, Ut, null);
200
+ Z(this, xt, null);
183
201
  /**
184
202
  * Deferred effects (which run after async work has completed) that are DIRTY
185
203
  * @type {Set<Effect>}
186
204
  */
187
- tt(this, Lt, /* @__PURE__ */ new Set());
205
+ Z(this, At, /* @__PURE__ */ new Set());
188
206
  /**
189
207
  * Deferred effects that are MAYBE_DIRTY
190
208
  * @type {Set<Effect>}
191
209
  */
192
- tt(this, At, /* @__PURE__ */ new Set());
210
+ Z(this, Tt, /* @__PURE__ */ new Set());
193
211
  /**
194
212
  * A set of branches that still exist, but will be destroyed when this batch
195
213
  * is committed — we skip over these during `process`
196
214
  * @type {Set<Effect>}
197
215
  */
198
- nt(this, "skipped_effects", /* @__PURE__ */ new Set());
199
- nt(this, "is_fork", !1);
216
+ tt(this, "skipped_effects", /* @__PURE__ */ new Set());
217
+ tt(this, "is_fork", !1);
200
218
  }
201
219
  is_deferred() {
202
- return this.is_fork || A(this, at) > 0;
220
+ return this.is_fork || L(this, dt) > 0;
203
221
  }
204
222
  /**
205
223
  *
206
224
  * @param {Effect[]} root_effects
207
225
  */
208
- process(t) {
209
- var i;
226
+ process(e) {
227
+ var s;
210
228
  $ = [], this.apply();
211
- var n = {
212
- parent: null,
213
- effect: null,
214
- effects: [],
215
- render_effects: []
216
- };
217
- for (const s of t)
218
- K(this, k, pe).call(this, s, n);
219
- this.is_fork || K(this, k, rn).call(this), this.is_deferred() ? (K(this, k, Rt).call(this, n.effects), K(this, k, Rt).call(this, n.render_effects)) : (N = null, Re(n.render_effects), Re(n.effects), (i = A(this, Ut)) == null || i.resolve()), P = null;
229
+ var n = [], i = [];
230
+ for (const r of e)
231
+ lt(this, K, he).call(this, r, n, i);
232
+ this.is_fork || lt(this, K, rn).call(this), this.is_deferred() ? (lt(this, K, pe).call(this, i), lt(this, K, pe).call(this, n)) : (T = null, Re(i), Re(n), (s = L(this, xt)) == null || s.resolve()), R = null;
220
233
  }
221
234
  /**
222
235
  * Associate a change to a given source with the current
@@ -224,215 +237,193 @@ const Zt = class Zt {
224
237
  * @param {Source} source
225
238
  * @param {any} value
226
239
  */
227
- capture(t, n) {
228
- this.previous.has(t) || this.previous.set(t, n), (t.f & it) === 0 && (this.current.set(t, t.v), P == null || P.set(t, t.v));
240
+ capture(e, n) {
241
+ n !== P && !this.previous.has(e) && this.previous.set(e, n), (e.f & et) === 0 && (this.current.set(e, e.v), R == null || R.set(e, e.v));
229
242
  }
230
243
  activate() {
231
- N = this, this.apply();
244
+ T = this, this.apply();
232
245
  }
233
246
  deactivate() {
234
- N === this && (N = null, P = null);
247
+ T === this && (T = null, R = null);
235
248
  }
236
249
  flush() {
237
250
  if (this.activate(), $.length > 0) {
238
- if (wi(), N !== null && N !== this)
251
+ if (Ni(), T !== null && T !== this)
239
252
  return;
240
- } else A(this, ut) === 0 && this.process([]);
253
+ } else L(this, ct) === 0 && this.process([]);
241
254
  this.deactivate();
242
255
  }
243
256
  discard() {
244
- for (const t of A(this, Dt)) t(this);
245
- A(this, Dt).clear();
257
+ for (const e of L(this, Lt)) e(this);
258
+ L(this, Lt).clear();
246
259
  }
247
260
  /**
248
261
  *
249
262
  * @param {boolean} blocking
250
263
  */
251
- increment(t) {
252
- mt(this, ut, A(this, ut) + 1), t && mt(this, at, A(this, at) + 1);
264
+ increment(e) {
265
+ mt(this, ct, L(this, ct) + 1), e && mt(this, dt, L(this, dt) + 1);
253
266
  }
254
267
  /**
255
268
  *
256
269
  * @param {boolean} blocking
257
270
  */
258
- decrement(t) {
259
- mt(this, ut, A(this, ut) - 1), t && mt(this, at, A(this, at) - 1), this.revive();
271
+ decrement(e) {
272
+ mt(this, ct, L(this, ct) - 1), e && mt(this, dt, L(this, dt) - 1), this.revive();
260
273
  }
261
274
  revive() {
262
- for (const t of A(this, Lt))
263
- A(this, At).delete(t), B(t, j), Tt(t);
264
- for (const t of A(this, At))
265
- B(t, Q), Tt(t);
275
+ for (const e of L(this, At))
276
+ L(this, Tt).delete(e), H(e, W), St(e);
277
+ for (const e of L(this, Tt))
278
+ H(e, rt), St(e);
266
279
  this.flush();
267
280
  }
268
281
  /** @param {() => void} fn */
269
- oncommit(t) {
270
- A(this, Nt).add(t);
282
+ oncommit(e) {
283
+ L(this, Dt).add(e);
271
284
  }
272
285
  /** @param {(batch: Batch) => void} fn */
273
- ondiscard(t) {
274
- A(this, Dt).add(t);
286
+ ondiscard(e) {
287
+ L(this, Lt).add(e);
275
288
  }
276
289
  settled() {
277
- return (A(this, Ut) ?? mt(this, Ut, Ze())).promise;
290
+ return (L(this, xt) ?? mt(this, xt, Ze())).promise;
278
291
  }
279
292
  static ensure() {
280
- if (N === null) {
281
- const t = N = new Zt();
282
- Ft.add(N), Zt.enqueue(() => {
283
- N === t && t.flush();
293
+ if (T === null) {
294
+ const e = T = new Qt();
295
+ Ht.add(T), Qt.enqueue(() => {
296
+ T === e && e.flush();
284
297
  });
285
298
  }
286
- return N;
299
+ return T;
287
300
  }
288
301
  /** @param {() => void} task */
289
- static enqueue(t) {
290
- te(t);
302
+ static enqueue(e) {
303
+ Jt(e);
291
304
  }
292
305
  apply() {
293
306
  }
294
307
  };
295
- Nt = new WeakMap(), Dt = new WeakMap(), ut = new WeakMap(), at = new WeakMap(), Ut = new WeakMap(), Lt = new WeakMap(), At = new WeakMap(), k = new WeakSet(), /**
308
+ Dt = new WeakMap(), Lt = new WeakMap(), ct = new WeakMap(), dt = new WeakMap(), xt = new WeakMap(), At = new WeakMap(), Tt = new WeakMap(), K = new WeakSet(), /**
296
309
  * Traverse the effect tree, executing effects or stashing
297
310
  * them for later execution as appropriate
298
311
  * @param {Effect} root
299
- * @param {EffectTarget} target
312
+ * @param {Effect[]} effects
313
+ * @param {Effect[]} render_effects
300
314
  */
301
- pe = function(t, n) {
302
- var c;
303
- t.f ^= H;
304
- for (var i = t.first; i !== null; ) {
305
- var s = i.f, r = (s & (Ct | St)) !== 0, o = r && (s & H) !== 0, l = o || (s & It) !== 0 || this.skipped_effects.has(i);
306
- if ((i.f & be) !== 0 && ((c = i.b) != null && c.is_pending()) && (n = {
307
- parent: n,
308
- effect: i,
309
- effects: [],
310
- render_effects: []
311
- }), !l && i.fn !== null) {
312
- r ? i.f ^= H : (s & ge) !== 0 ? n.effects.push(i) : Ht(i) && ((i.f & _t) !== 0 && A(this, Lt).add(i), xt(i));
313
- var a = i.first;
314
- if (a !== null) {
315
- i = a;
315
+ he = function(e, n, i) {
316
+ e.f ^= x;
317
+ for (var s = e.first, r = null; s !== null; ) {
318
+ var o = s.f, l = (o & (vt | Pt)) !== 0, u = l && (o & x) !== 0, a = u || (o & Et) !== 0 || this.skipped_effects.has(s);
319
+ if (!a && s.fn !== null) {
320
+ l ? s.f ^= x : r !== null && (o & (Gt | ge | me)) !== 0 ? r.b.defer_effect(s) : (o & Gt) !== 0 ? n.push(s) : Ut(s) && ((o & yt) !== 0 && L(this, At).add(s), Mt(s));
321
+ var c = s.first;
322
+ if (c !== null) {
323
+ s = c;
316
324
  continue;
317
325
  }
318
326
  }
319
- var u = i.parent;
320
- for (i = i.next; i === null && u !== null; )
321
- u === n.effect && (K(this, k, Rt).call(this, n.effects), K(this, k, Rt).call(this, n.render_effects), n = /** @type {EffectTarget} */
322
- n.parent), i = u.next, u = u.parent;
327
+ var d = s.parent;
328
+ for (s = s.next; s === null && d !== null; )
329
+ d === r && (r = null), s = d.next, d = d.parent;
323
330
  }
324
331
  }, /**
325
332
  * @param {Effect[]} effects
326
333
  */
327
- Rt = function(t) {
328
- for (const n of t)
329
- (n.f & j) !== 0 ? A(this, Lt).add(n) : (n.f & Q) !== 0 && A(this, At).add(n), K(this, k, _e).call(this, n.deps), B(n, H);
330
- }, /**
331
- * @param {Value[] | null} deps
332
- */
333
- _e = function(t) {
334
- if (t !== null)
335
- for (const n of t)
336
- (n.f & M) === 0 || (n.f & ht) === 0 || (n.f ^= ht, K(this, k, _e).call(
337
- this,
338
- /** @type {Derived} */
339
- n.deps
340
- ));
334
+ pe = function(e) {
335
+ for (var n = 0; n < e.length; n += 1)
336
+ Ei(e[n], L(this, At), L(this, Tt));
341
337
  }, rn = function() {
342
- if (A(this, at) === 0) {
343
- for (const t of A(this, Nt)) t();
344
- A(this, Nt).clear();
338
+ if (L(this, dt) === 0) {
339
+ for (const e of L(this, Dt)) e();
340
+ L(this, Dt).clear();
345
341
  }
346
- A(this, ut) === 0 && K(this, k, on).call(this);
342
+ L(this, ct) === 0 && lt(this, K, on).call(this);
347
343
  }, on = function() {
348
- var r;
349
- if (Ft.size > 1) {
344
+ var s;
345
+ if (Ht.size > 1) {
350
346
  this.previous.clear();
351
- var t = P, n = !0, i = {
352
- parent: null,
353
- effect: null,
354
- effects: [],
355
- render_effects: []
356
- };
357
- for (const o of Ft) {
358
- if (o === this) {
347
+ var e = R, n = !0;
348
+ for (const r of Ht) {
349
+ if (r === this) {
359
350
  n = !1;
360
351
  continue;
361
352
  }
362
- const l = [];
363
- for (const [u, c] of this.current) {
364
- if (o.current.has(u))
365
- if (n && c !== o.current.get(u))
366
- o.current.set(u, c);
353
+ const o = [];
354
+ for (const [u, a] of this.current) {
355
+ if (r.current.has(u))
356
+ if (n && a !== r.current.get(u))
357
+ r.current.set(u, a);
367
358
  else
368
359
  continue;
369
- l.push(u);
360
+ o.push(u);
370
361
  }
371
- if (l.length === 0)
362
+ if (o.length === 0)
372
363
  continue;
373
- const a = [...o.current.keys()].filter((u) => !this.current.has(u));
374
- if (a.length > 0) {
375
- var s = $;
364
+ const l = [...r.current.keys()].filter((u) => !this.current.has(u));
365
+ if (l.length > 0) {
366
+ var i = $;
376
367
  $ = [];
377
- const u = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Map();
378
- for (const d of l)
379
- ln(d, a, u, c);
368
+ const u = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Map();
369
+ for (const c of o)
370
+ ln(c, l, u, a);
380
371
  if ($.length > 0) {
381
- N = o, o.apply();
382
- for (const d of $)
383
- K(r = o, k, pe).call(r, d, i);
384
- o.deactivate();
372
+ T = r, r.apply();
373
+ for (const c of $)
374
+ lt(s = r, K, he).call(s, c, [], []);
375
+ r.deactivate();
385
376
  }
386
- $ = s;
377
+ $ = i;
387
378
  }
388
379
  }
389
- N = null, P = t;
380
+ T = null, R = e;
390
381
  }
391
- this.committed = !0, Ft.delete(this);
382
+ this.committed = !0, Ht.delete(this);
392
383
  };
393
- let zt = Zt;
394
- function wi() {
395
- var e = dt;
396
- he = !0;
397
- var t = null;
384
+ let zt = Qt;
385
+ function Ni() {
386
+ var t = ht;
387
+ fe = !0;
388
+ var e = null;
398
389
  try {
399
390
  var n = 0;
400
- for (Xt(!0); $.length > 0; ) {
391
+ for ($t(!0); $.length > 0; ) {
401
392
  var i = zt.ensure();
402
393
  if (n++ > 1e3) {
403
394
  var s, r;
404
- Ii();
395
+ Di();
405
396
  }
406
- i.process($), st.clear();
397
+ i.process($), nt.clear();
407
398
  }
408
399
  } finally {
409
- he = !1, Xt(e), Ee = null;
400
+ fe = !1, $t(t), Ee = null;
410
401
  }
411
402
  }
412
- function Ii() {
403
+ function Di() {
413
404
  try {
414
- ai();
415
- } catch (e) {
416
- Kt(e, Ee);
405
+ ci();
406
+ } catch (t) {
407
+ Kt(t, Ee);
417
408
  }
418
409
  }
419
410
  let z = null;
420
- function Re(e) {
421
- var t = e.length;
422
- if (t !== 0) {
423
- for (var n = 0; n < t; ) {
424
- var i = e[n++];
425
- if ((i.f & (et | It)) === 0 && Ht(i) && (z = /* @__PURE__ */ new Set(), xt(i), i.deps === null && i.first === null && i.nodes === null && (i.teardown === null && i.ac === null ? gn(i) : i.fn = null), (z == null ? void 0 : z.size) > 0)) {
426
- st.clear();
411
+ function Re(t) {
412
+ var e = t.length;
413
+ if (e !== 0) {
414
+ for (var n = 0; n < e; ) {
415
+ var i = t[n++];
416
+ if ((i.f & (J | Et)) === 0 && Ut(i) && (z = /* @__PURE__ */ new Set(), Mt(i), i.deps === null && i.first === null && i.nodes === null && (i.teardown === null && i.ac === null ? bn(i) : i.fn = null), (z == null ? void 0 : z.size) > 0)) {
417
+ nt.clear();
427
418
  for (const s of z) {
428
- if ((s.f & (et | It)) !== 0) continue;
419
+ if ((s.f & (J | Et)) !== 0) continue;
429
420
  const r = [s];
430
421
  let o = s.parent;
431
422
  for (; o !== null; )
432
423
  z.has(o) && (z.delete(o), r.push(o)), o = o.parent;
433
424
  for (let l = r.length - 1; l >= 0; l--) {
434
- const a = r[l];
435
- (a.f & (et | It)) === 0 && xt(a);
425
+ const u = r[l];
426
+ (u.f & (J | Et)) === 0 && Mt(u);
436
427
  }
437
428
  }
438
429
  z.clear();
@@ -441,33 +432,33 @@ function Re(e) {
441
432
  z = null;
442
433
  }
443
434
  }
444
- function ln(e, t, n, i) {
445
- if (!n.has(e) && (n.add(e), e.reactions !== null))
446
- for (const s of e.reactions) {
435
+ function ln(t, e, n, i) {
436
+ if (!n.has(t) && (n.add(t), t.reactions !== null))
437
+ for (const s of t.reactions) {
447
438
  const r = s.f;
448
- (r & M) !== 0 ? ln(
439
+ (r & k) !== 0 ? ln(
449
440
  /** @type {Derived} */
450
441
  s,
451
- t,
442
+ e,
452
443
  n,
453
444
  i
454
- ) : (r & (Ie | _t)) !== 0 && (r & j) === 0 && un(s, t, i) && (B(s, j), Tt(
445
+ ) : (r & (we | yt)) !== 0 && (r & W) === 0 && un(s, e, i) && (H(s, W), St(
455
446
  /** @type {Effect} */
456
447
  s
457
448
  ));
458
449
  }
459
450
  }
460
- function un(e, t, n) {
461
- const i = n.get(e);
451
+ function un(t, e, n) {
452
+ const i = n.get(t);
462
453
  if (i !== void 0) return i;
463
- if (e.deps !== null)
464
- for (const s of e.deps) {
465
- if (t.includes(s))
454
+ if (t.deps !== null)
455
+ for (const s of t.deps) {
456
+ if (e.includes(s))
466
457
  return !0;
467
- if ((s.f & M) !== 0 && un(
458
+ if ((s.f & k) !== 0 && un(
468
459
  /** @type {Derived} */
469
460
  s,
470
- t,
461
+ e,
471
462
  n
472
463
  ))
473
464
  return n.set(
@@ -476,333 +467,335 @@ function un(e, t, n) {
476
467
  !0
477
468
  ), !0;
478
469
  }
479
- return n.set(e, !1), !1;
470
+ return n.set(t, !1), !1;
480
471
  }
481
- function Tt(e) {
482
- for (var t = Ee = e; t.parent !== null; ) {
483
- t = t.parent;
484
- var n = t.f;
485
- if (he && t === D && (n & _t) !== 0 && (n & en) === 0)
472
+ function St(t) {
473
+ for (var e = Ee = t; e.parent !== null; ) {
474
+ e = e.parent;
475
+ var n = e.f;
476
+ if (fe && e === N && (n & yt) !== 0 && (n & tn) === 0)
486
477
  return;
487
- if ((n & (St | Ct)) !== 0) {
488
- if ((n & H) === 0) return;
489
- t.f ^= H;
478
+ if ((n & (Pt | vt)) !== 0) {
479
+ if ((n & x) === 0) return;
480
+ e.f ^= x;
490
481
  }
491
482
  }
492
- $.push(t);
483
+ $.push(e);
493
484
  }
494
- function Ei(e, t, n, i) {
485
+ function Li(t, e, n, i) {
495
486
  const s = Ne;
496
- if (n.length === 0 && e.length === 0) {
497
- i(t.map(s));
487
+ if (n.length === 0 && t.length === 0) {
488
+ i(e.map(s));
498
489
  return;
499
490
  }
500
- var r = N, o = (
491
+ var r = T, o = (
501
492
  /** @type {Effect} */
502
- D
503
- ), l = Ni();
504
- function a() {
505
- Promise.all(n.map((u) => /* @__PURE__ */ Di(u))).then((u) => {
493
+ N
494
+ ), l = Ai();
495
+ function u() {
496
+ Promise.all(n.map((a) => /* @__PURE__ */ Ti(a))).then((a) => {
506
497
  l();
507
498
  try {
508
- i([...t.map(s), ...u]);
499
+ i([...e.map(s), ...a]);
509
500
  } catch (c) {
510
- (o.f & et) === 0 && Kt(c, o);
501
+ (o.f & J) === 0 && Kt(c, o);
511
502
  }
512
503
  r == null || r.deactivate(), qt();
513
- }).catch((u) => {
514
- Kt(u, o);
504
+ }).catch((a) => {
505
+ Kt(a, o);
515
506
  });
516
507
  }
517
- e.length > 0 ? Promise.all(e).then(() => {
508
+ t.length > 0 ? Promise.all(t).then(() => {
518
509
  l();
519
510
  try {
520
- return a();
511
+ return u();
521
512
  } finally {
522
513
  r == null || r.deactivate(), qt();
523
514
  }
524
- }) : a();
515
+ }) : u();
525
516
  }
526
- function Ni() {
527
- var e = D, t = w, n = Z, i = N;
517
+ function Ai() {
518
+ var t = N, e = w, n = X, i = T;
528
519
  return function(r = !0) {
529
- rt(e), J(t), Yt(n), r && (i == null || i.activate());
520
+ st(t), Q(e), Yt(n), r && (i == null || i.activate());
530
521
  };
531
522
  }
532
523
  function qt() {
533
- rt(null), J(null), Yt(null);
524
+ st(null), Q(null), Yt(null);
534
525
  }
535
526
  // @__NO_SIDE_EFFECTS__
536
- function Ne(e) {
537
- var t = M | j, n = w !== null && (w.f & M) !== 0 ? (
527
+ function Ne(t) {
528
+ var e = k | W, n = w !== null && (w.f & k) !== 0 ? (
538
529
  /** @type {Derived} */
539
530
  w
540
531
  ) : null;
541
- return D !== null && (D.f |= Jt), {
542
- ctx: Z,
532
+ return N !== null && (N.f |= Zt), {
533
+ ctx: X,
543
534
  deps: null,
544
535
  effects: null,
545
- equals: nn,
546
- f: t,
547
- fn: e,
536
+ equals: en,
537
+ f: e,
538
+ fn: t,
548
539
  reactions: null,
549
540
  rv: 0,
550
541
  v: (
551
542
  /** @type {V} */
552
- R
543
+ P
553
544
  ),
554
545
  wv: 0,
555
- parent: n ?? D,
546
+ parent: n ?? N,
556
547
  ac: null
557
548
  };
558
549
  }
559
550
  // @__NO_SIDE_EFFECTS__
560
- function Di(e, t) {
561
- let n = (
551
+ function Ti(t, e, n) {
552
+ let i = (
562
553
  /** @type {Effect | null} */
563
- D
554
+ N
564
555
  );
565
- n === null && ri();
566
- var i = (
556
+ i === null && oi();
557
+ var s = (
567
558
  /** @type {Boundary} */
568
- n.b
569
- ), s = (
559
+ i.b
560
+ ), r = (
570
561
  /** @type {Promise<V>} */
571
562
  /** @type {unknown} */
572
563
  void 0
573
- ), r = fn(
564
+ ), o = fn(
574
565
  /** @type {V} */
575
- R
576
- ), o = !w, l = /* @__PURE__ */ new Map();
577
- return Bi(() => {
578
- var f;
566
+ P
567
+ ), l = !w, u = /* @__PURE__ */ new Map();
568
+ return ji(() => {
569
+ var p;
579
570
  var a = Ze();
580
- s = a.promise;
571
+ r = a.promise;
581
572
  try {
582
- Promise.resolve(e()).then(a.resolve, a.reject).then(() => {
583
- u === N && u.committed && u.deactivate(), qt();
573
+ Promise.resolve(t()).then(a.resolve, a.reject).then(() => {
574
+ c === T && c.committed && c.deactivate(), qt();
584
575
  });
585
- } catch (h) {
586
- a.reject(h), qt();
576
+ } catch (_) {
577
+ a.reject(_), qt();
587
578
  }
588
- var u = (
579
+ var c = (
589
580
  /** @type {Batch} */
590
- N
581
+ T
591
582
  );
592
- if (o) {
593
- var c = !i.is_pending();
594
- i.update_pending_count(1), u.increment(c), (f = l.get(u)) == null || f.reject(gt), l.delete(u), l.set(u, a);
583
+ if (l) {
584
+ var d = s.is_rendered();
585
+ s.update_pending_count(1), c.increment(d), (p = u.get(c)) == null || p.reject(bt), u.delete(c), u.set(c, a);
595
586
  }
596
- const d = (h, C = void 0) => {
597
- if (u.activate(), C)
598
- C !== gt && (r.f |= it, ye(r, C));
587
+ const f = (_, g = void 0) => {
588
+ if (c.activate(), g)
589
+ g !== bt && (o.f |= et, Ce(o, g));
599
590
  else {
600
- (r.f & it) !== 0 && (r.f ^= it), ye(r, h);
601
- for (const [b, g] of l) {
602
- if (l.delete(b), b === u) break;
603
- g.reject(gt);
591
+ (o.f & et) !== 0 && (o.f ^= et), Ce(o, _);
592
+ for (const [b, y] of u) {
593
+ if (u.delete(b), b === c) break;
594
+ y.reject(bt);
604
595
  }
605
596
  }
606
- o && (i.update_pending_count(-1), u.decrement(c));
597
+ l && (s.update_pending_count(-1), c.decrement(d));
607
598
  };
608
- a.promise.then(d, (h) => d(null, h || "unknown"));
609
- }), pn(() => {
610
- for (const a of l.values())
611
- a.reject(gt);
599
+ a.promise.then(f, (_) => f(null, _ || "unknown"));
600
+ }), _n(() => {
601
+ for (const a of u.values())
602
+ a.reject(bt);
612
603
  }), new Promise((a) => {
613
- function u(c) {
614
- function d() {
615
- c === s ? a(r) : u(s);
604
+ function c(d) {
605
+ function f() {
606
+ d === r ? a(o) : c(r);
616
607
  }
617
- c.then(d, d);
608
+ d.then(f, f);
618
609
  }
619
- u(s);
610
+ c(r);
620
611
  });
621
612
  }
622
613
  // @__NO_SIDE_EFFECTS__
623
- function Li(e) {
624
- const t = /* @__PURE__ */ Ne(e);
625
- return t.equals = Ci, t;
626
- }
627
- function an(e) {
628
- var t = e.effects;
629
- if (t !== null) {
630
- e.effects = null;
631
- for (var n = 0; n < t.length; n += 1)
632
- pt(
614
+ function Si(t) {
615
+ const e = /* @__PURE__ */ Ne(t);
616
+ return e.equals = yi, e;
617
+ }
618
+ function an(t) {
619
+ var e = t.effects;
620
+ if (e !== null) {
621
+ t.effects = null;
622
+ for (var n = 0; n < e.length; n += 1)
623
+ Ct(
633
624
  /** @type {Effect} */
634
- t[n]
625
+ e[n]
635
626
  );
636
627
  }
637
628
  }
638
- function Ai(e) {
639
- for (var t = e.parent; t !== null; ) {
640
- if ((t.f & M) === 0)
641
- return (t.f & et) === 0 ? (
629
+ function Pi(t) {
630
+ for (var e = t.parent; e !== null; ) {
631
+ if ((e.f & k) === 0)
632
+ return (e.f & J) === 0 ? (
642
633
  /** @type {Effect} */
643
- t
634
+ e
644
635
  ) : null;
645
- t = t.parent;
636
+ e = e.parent;
646
637
  }
647
638
  return null;
648
639
  }
649
- function De(e) {
650
- var t, n = D;
651
- rt(Ai(e));
640
+ function De(t) {
641
+ var e, n = N;
642
+ st(Pi(t));
652
643
  try {
653
- e.f &= ~ht, an(e), t = En(e);
644
+ t.f &= ~_t, an(t), e = Nn(t);
654
645
  } finally {
655
- rt(n);
646
+ st(n);
656
647
  }
657
- return t;
648
+ return e;
658
649
  }
659
- function cn(e) {
660
- var t = De(e);
661
- if (e.equals(t) || (N != null && N.is_fork || (e.v = t), e.wv = wn()), !vt)
662
- if (P !== null)
663
- ($t() || N != null && N.is_fork) && P.set(e, t);
664
- else {
665
- var n = (e.f & q) === 0 ? Q : H;
666
- B(e, n);
667
- }
650
+ function cn(t) {
651
+ var e = De(t);
652
+ if (!t.equals(e) && (t.wv = In(), (!(T != null && T.is_fork) || t.deps === null) && (t.v = e, t.deps === null))) {
653
+ H(t, x);
654
+ return;
655
+ }
656
+ it || (R !== null ? (pn() || T != null && T.is_fork) && R.set(t, e) : Ie(t));
668
657
  }
669
- let Ce = /* @__PURE__ */ new Set();
670
- const st = /* @__PURE__ */ new Map();
658
+ let _e = /* @__PURE__ */ new Set();
659
+ const nt = /* @__PURE__ */ new Map();
671
660
  let dn = !1;
672
- function fn(e, t) {
661
+ function fn(t, e) {
673
662
  var n = {
674
663
  f: 0,
675
664
  // TODO ideally we could skip this altogether, but it causes type errors
676
- v: e,
665
+ v: t,
677
666
  reactions: null,
678
- equals: nn,
667
+ equals: en,
679
668
  rv: 0,
680
669
  wv: 0
681
670
  };
682
671
  return n;
683
672
  }
684
673
  // @__NO_SIDE_EFFECTS__
685
- function Y(e, t) {
686
- const n = fn(e);
687
- return Gi(n), n;
674
+ function G(t, e) {
675
+ const n = fn(t);
676
+ return zi(n), n;
688
677
  }
689
- function W(e, t, n = !1) {
678
+ function V(t, e, n = !1) {
690
679
  w !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
691
680
  // to ensure we error if state is set inside an inspect effect
692
- (!X || (w.f & Oe) !== 0) && sn() && (w.f & (M | _t | Ie | Oe)) !== 0 && !(F != null && F.includes(e)) && hi();
693
- let i = n ? wt(t) : t;
694
- return ye(e, i);
695
- }
696
- function ye(e, t) {
697
- if (!e.equals(t)) {
698
- var n = e.v;
699
- vt ? st.set(e, t) : st.set(e, n), e.v = t;
681
+ (!q || (w.f & Oe) !== 0) && nn() && (w.f & (k | yt | we | Oe)) !== 0 && !(U != null && U.includes(t)) && pi();
682
+ let i = n ? It(e) : e;
683
+ return Ce(t, i);
684
+ }
685
+ function Ce(t, e) {
686
+ if (!t.equals(e)) {
687
+ var n = t.v;
688
+ it ? nt.set(t, e) : nt.set(t, n), t.v = e;
700
689
  var i = zt.ensure();
701
- i.capture(e, n), (e.f & M) !== 0 && ((e.f & j) !== 0 && De(
702
- /** @type {Derived} */
703
- e
704
- ), B(e, (e.f & q) !== 0 ? H : Q)), e.wv = wn(), hn(e, j), D !== null && (D.f & H) !== 0 && (D.f & (Ct | St)) === 0 && (G === null ? Yi([e]) : G.push(e)), !i.is_fork && Ce.size > 0 && !dn && Ti();
690
+ if (i.capture(t, n), (t.f & k) !== 0) {
691
+ const s = (
692
+ /** @type {Derived} */
693
+ t
694
+ );
695
+ (t.f & W) !== 0 && De(s), Ie(s);
696
+ }
697
+ t.wv = In(), hn(t, W), N !== null && (N.f & x) !== 0 && (N.f & (vt | Pt)) === 0 && (j === null ? qi([t]) : j.push(t)), !i.is_fork && _e.size > 0 && !dn && Oi();
705
698
  }
706
- return t;
699
+ return e;
707
700
  }
708
- function Ti() {
701
+ function Oi() {
709
702
  dn = !1;
710
- var e = dt;
711
- Xt(!0);
712
- const t = Array.from(Ce);
703
+ var t = ht;
704
+ $t(!0);
705
+ const e = Array.from(_e);
713
706
  try {
714
- for (const n of t)
715
- (n.f & H) !== 0 && B(n, Q), Ht(n) && xt(n);
707
+ for (const n of e)
708
+ (n.f & x) !== 0 && H(n, rt), Ut(n) && Mt(n);
716
709
  } finally {
717
- Xt(e);
710
+ $t(t);
718
711
  }
719
- Ce.clear();
712
+ _e.clear();
720
713
  }
721
- function ne(e) {
722
- W(e, e.v + 1);
714
+ function ee(t) {
715
+ V(t, t.v + 1);
723
716
  }
724
- function hn(e, t) {
725
- var n = e.reactions;
717
+ function hn(t, e) {
718
+ var n = t.reactions;
726
719
  if (n !== null)
727
720
  for (var i = n.length, s = 0; s < i; s++) {
728
- var r = n[s], o = r.f, l = (o & j) === 0;
729
- if (l && B(r, t), (o & M) !== 0) {
730
- var a = (
721
+ var r = n[s], o = r.f, l = (o & W) === 0;
722
+ if (l && H(r, e), (o & k) !== 0) {
723
+ var u = (
731
724
  /** @type {Derived} */
732
725
  r
733
726
  );
734
- P == null || P.delete(a), (o & ht) === 0 && (o & q && (r.f |= ht), hn(a, Q));
735
- } else l && ((o & _t) !== 0 && z !== null && z.add(
727
+ R == null || R.delete(u), (o & _t) === 0 && (o & Y && (r.f |= _t), hn(u, rt));
728
+ } else l && ((o & yt) !== 0 && z !== null && z.add(
736
729
  /** @type {Effect} */
737
730
  r
738
- ), Tt(
731
+ ), St(
739
732
  /** @type {Effect} */
740
733
  r
741
734
  ));
742
735
  }
743
736
  }
744
- function wt(e) {
745
- if (typeof e != "object" || e === null || ct in e)
746
- return e;
747
- const t = Qe(e);
748
- if (t !== Jn && t !== ti)
749
- return e;
750
- var n = /* @__PURE__ */ new Map(), i = Xe(e), s = /* @__PURE__ */ Y(0), r = ft, o = (l) => {
751
- if (ft === r)
737
+ function It(t) {
738
+ if (typeof t != "object" || t === null || ft in t)
739
+ return t;
740
+ const e = Qe(t);
741
+ if (e !== ti && e !== ei)
742
+ return t;
743
+ var n = /* @__PURE__ */ new Map(), i = Xe(t), s = /* @__PURE__ */ G(0), r = pt, o = (l) => {
744
+ if (pt === r)
752
745
  return l();
753
- var a = w, u = ft;
754
- J(null), xe(r);
746
+ var u = w, a = pt;
747
+ Q(null), xe(r);
755
748
  var c = l();
756
- return J(a), xe(u), c;
749
+ return Q(u), xe(a), c;
757
750
  };
758
- return i && n.set("length", /* @__PURE__ */ Y(
751
+ return i && n.set("length", /* @__PURE__ */ G(
759
752
  /** @type {any[]} */
760
- e.length
753
+ t.length
761
754
  )), new Proxy(
762
755
  /** @type {any} */
763
- e,
756
+ t,
764
757
  {
765
- defineProperty(l, a, u) {
766
- (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && di();
767
- var c = n.get(a);
758
+ defineProperty(l, u, a) {
759
+ (!("value" in a) || a.configurable === !1 || a.enumerable === !1 || a.writable === !1) && fi();
760
+ var c = n.get(u);
768
761
  return c === void 0 ? c = o(() => {
769
- var d = /* @__PURE__ */ Y(u.value);
770
- return n.set(a, d), d;
771
- }) : W(c, u.value, !0), !0;
762
+ var d = /* @__PURE__ */ G(a.value);
763
+ return n.set(u, d), d;
764
+ }) : V(c, a.value, !0), !0;
772
765
  },
773
- deleteProperty(l, a) {
774
- var u = n.get(a);
775
- if (u === void 0) {
776
- if (a in l) {
777
- const c = o(() => /* @__PURE__ */ Y(R));
778
- n.set(a, c), ne(s);
766
+ deleteProperty(l, u) {
767
+ var a = n.get(u);
768
+ if (a === void 0) {
769
+ if (u in l) {
770
+ const c = o(() => /* @__PURE__ */ G(P));
771
+ n.set(u, c), ee(s);
779
772
  }
780
773
  } else
781
- W(u, R), ne(s);
774
+ V(a, P), ee(s);
782
775
  return !0;
783
776
  },
784
- get(l, a, u) {
785
- var h;
786
- if (a === ct)
787
- return e;
788
- var c = n.get(a), d = a in l;
789
- if (c === void 0 && (!d || (h = jt(l, a)) != null && h.writable) && (c = o(() => {
790
- var C = wt(d ? l[a] : R), b = /* @__PURE__ */ Y(C);
791
- return b;
792
- }), n.set(a, c)), c !== void 0) {
777
+ get(l, u, a) {
778
+ var p;
779
+ if (u === ft)
780
+ return t;
781
+ var c = n.get(u), d = u in l;
782
+ if (c === void 0 && (!d || (p = Wt(l, u)) != null && p.writable) && (c = o(() => {
783
+ var _ = It(d ? l[u] : P), g = /* @__PURE__ */ G(_);
784
+ return g;
785
+ }), n.set(u, c)), c !== void 0) {
793
786
  var f = I(c);
794
- return f === R ? void 0 : f;
787
+ return f === P ? void 0 : f;
795
788
  }
796
- return Reflect.get(l, a, u);
789
+ return Reflect.get(l, u, a);
797
790
  },
798
- getOwnPropertyDescriptor(l, a) {
799
- var u = Reflect.getOwnPropertyDescriptor(l, a);
800
- if (u && "value" in u) {
801
- var c = n.get(a);
802
- c && (u.value = I(c));
803
- } else if (u === void 0) {
804
- var d = n.get(a), f = d == null ? void 0 : d.v;
805
- if (d !== void 0 && f !== R)
791
+ getOwnPropertyDescriptor(l, u) {
792
+ var a = Reflect.getOwnPropertyDescriptor(l, u);
793
+ if (a && "value" in a) {
794
+ var c = n.get(u);
795
+ c && (a.value = I(c));
796
+ } else if (a === void 0) {
797
+ var d = n.get(u), f = d == null ? void 0 : d.v;
798
+ if (d !== void 0 && f !== P)
806
799
  return {
807
800
  enumerable: !0,
808
801
  configurable: !0,
@@ -810,129 +803,129 @@ function wt(e) {
810
803
  writable: !0
811
804
  };
812
805
  }
813
- return u;
806
+ return a;
814
807
  },
815
- has(l, a) {
808
+ has(l, u) {
816
809
  var f;
817
- if (a === ct)
810
+ if (u === ft)
818
811
  return !0;
819
- var u = n.get(a), c = u !== void 0 && u.v !== R || Reflect.has(l, a);
820
- if (u !== void 0 || D !== null && (!c || (f = jt(l, a)) != null && f.writable)) {
821
- u === void 0 && (u = o(() => {
822
- var h = c ? wt(l[a]) : R, C = /* @__PURE__ */ Y(h);
823
- return C;
824
- }), n.set(a, u));
825
- var d = I(u);
826
- if (d === R)
812
+ var a = n.get(u), c = a !== void 0 && a.v !== P || Reflect.has(l, u);
813
+ if (a !== void 0 || N !== null && (!c || (f = Wt(l, u)) != null && f.writable)) {
814
+ a === void 0 && (a = o(() => {
815
+ var p = c ? It(l[u]) : P, _ = /* @__PURE__ */ G(p);
816
+ return _;
817
+ }), n.set(u, a));
818
+ var d = I(a);
819
+ if (d === P)
827
820
  return !1;
828
821
  }
829
822
  return c;
830
823
  },
831
- set(l, a, u, c) {
832
- var p;
833
- var d = n.get(a), f = a in l;
834
- if (i && a === "length")
835
- for (var h = u; h < /** @type {Source<number>} */
836
- d.v; h += 1) {
837
- var C = n.get(h + "");
838
- C !== void 0 ? W(C, R) : h in l && (C = o(() => /* @__PURE__ */ Y(R)), n.set(h + "", C));
824
+ set(l, u, a, c) {
825
+ var h;
826
+ var d = n.get(u), f = u in l;
827
+ if (i && u === "length")
828
+ for (var p = a; p < /** @type {Source<number>} */
829
+ d.v; p += 1) {
830
+ var _ = n.get(p + "");
831
+ _ !== void 0 ? V(_, P) : p in l && (_ = o(() => /* @__PURE__ */ G(P)), n.set(p + "", _));
839
832
  }
840
833
  if (d === void 0)
841
- (!f || (p = jt(l, a)) != null && p.writable) && (d = o(() => /* @__PURE__ */ Y(void 0)), W(d, wt(u)), n.set(a, d));
834
+ (!f || (h = Wt(l, u)) != null && h.writable) && (d = o(() => /* @__PURE__ */ G(void 0)), V(d, It(a)), n.set(u, d));
842
835
  else {
843
- f = d.v !== R;
844
- var b = o(() => wt(u));
845
- W(d, b);
836
+ f = d.v !== P;
837
+ var g = o(() => It(a));
838
+ V(d, g);
846
839
  }
847
- var g = Reflect.getOwnPropertyDescriptor(l, a);
848
- if (g != null && g.set && g.set.call(c, u), !f) {
849
- if (i && typeof a == "string") {
840
+ var b = Reflect.getOwnPropertyDescriptor(l, u);
841
+ if (b != null && b.set && b.set.call(c, a), !f) {
842
+ if (i && typeof u == "string") {
850
843
  var y = (
851
844
  /** @type {Source<number>} */
852
845
  n.get("length")
853
- ), v = Number(a);
854
- Number.isInteger(v) && v >= y.v && W(y, v + 1);
846
+ ), v = Number(u);
847
+ Number.isInteger(v) && v >= y.v && V(y, v + 1);
855
848
  }
856
- ne(s);
849
+ ee(s);
857
850
  }
858
851
  return !0;
859
852
  },
860
853
  ownKeys(l) {
861
854
  I(s);
862
- var a = Reflect.ownKeys(l).filter((d) => {
855
+ var u = Reflect.ownKeys(l).filter((d) => {
863
856
  var f = n.get(d);
864
- return f === void 0 || f.v !== R;
857
+ return f === void 0 || f.v !== P;
865
858
  });
866
- for (var [u, c] of n)
867
- c.v !== R && !(u in l) && a.push(u);
868
- return a;
859
+ for (var [a, c] of n)
860
+ c.v !== P && !(a in l) && u.push(a);
861
+ return u;
869
862
  },
870
863
  setPrototypeOf() {
871
- fi();
864
+ hi();
872
865
  }
873
866
  }
874
867
  );
875
868
  }
876
- function ke(e) {
869
+ function ke(t) {
877
870
  try {
878
- if (e !== null && typeof e == "object" && ct in e)
879
- return e[ct];
871
+ if (t !== null && typeof t == "object" && ft in t)
872
+ return t[ft];
880
873
  } catch {
881
874
  }
882
- return e;
875
+ return t;
883
876
  }
884
- function Si(e, t) {
885
- return Object.is(ke(e), ke(t));
877
+ function Ri(t, e) {
878
+ return Object.is(ke(t), ke(e));
886
879
  }
887
- var Pi, Oi, Ri;
880
+ var ki, Mi, xi;
888
881
  // @__NO_SIDE_EFFECTS__
889
- function ki(e) {
882
+ function Ui(t) {
890
883
  return (
891
884
  /** @type {TemplateNode | null} */
892
- Oi.call(e)
885
+ Mi.call(t)
893
886
  );
894
887
  }
895
888
  // @__NO_SIDE_EFFECTS__
896
- function Mi(e) {
889
+ function Hi(t) {
897
890
  return (
898
891
  /** @type {TemplateNode | null} */
899
- Ri.call(e)
892
+ xi.call(t)
900
893
  );
901
894
  }
902
- function xi(e, t) {
903
- if (t) {
895
+ function Fi(t, e) {
896
+ if (e) {
904
897
  const n = document.body;
905
- e.autofocus = !0, te(() => {
906
- document.activeElement === n && e.focus();
898
+ t.autofocus = !0, Jt(() => {
899
+ document.activeElement === n && t.focus();
907
900
  });
908
901
  }
909
902
  }
910
- function Le(e) {
911
- var t = w, n = D;
912
- J(null), rt(null);
903
+ function Le(t) {
904
+ var e = w, n = N;
905
+ Q(null), st(null);
913
906
  try {
914
- return e();
907
+ return t();
915
908
  } finally {
916
- J(t), rt(n);
909
+ Q(e), st(n);
917
910
  }
918
911
  }
919
- function Ui(e) {
920
- D === null && (w === null && ui(), li()), vt && oi();
912
+ function Bi(t) {
913
+ N === null && (w === null && ai(), ui()), it && li();
921
914
  }
922
- function Hi(e, t) {
923
- var n = t.last;
924
- n === null ? t.last = t.first = e : (n.next = e, e.prev = n, t.last = e);
915
+ function Vi(t, e) {
916
+ var n = e.last;
917
+ n === null ? e.last = e.first = t : (n.next = t, t.prev = n, e.last = t);
925
918
  }
926
- function yt(e, t, n) {
927
- var i = D;
928
- i !== null && (i.f & It) !== 0 && (e |= It);
919
+ function gt(t, e, n) {
920
+ var i = N;
921
+ i !== null && (i.f & Et) !== 0 && (t |= Et);
929
922
  var s = {
930
- ctx: Z,
923
+ ctx: X,
931
924
  deps: null,
932
925
  nodes: null,
933
- f: e | j | q,
926
+ f: t | W | Y,
934
927
  first: null,
935
- fn: t,
928
+ fn: e,
936
929
  last: null,
937
930
  next: null,
938
931
  parent: i,
@@ -944,14 +937,14 @@ function yt(e, t, n) {
944
937
  };
945
938
  if (n)
946
939
  try {
947
- xt(s), s.f |= we;
940
+ Mt(s), s.f |= be;
948
941
  } catch (l) {
949
- throw pt(s), l;
942
+ throw Ct(s), l;
950
943
  }
951
- else t !== null && Tt(s);
944
+ else e !== null && St(s);
952
945
  var r = s;
953
946
  if (n && r.deps === null && r.teardown === null && r.nodes === null && r.first === r.last && // either `null`, or a singular child
954
- (r.f & Jt) === 0 && (r = r.first, (e & _t) !== 0 && (e & Pe) !== 0 && r !== null && (r.f |= Pe)), r !== null && (r.parent = i, i !== null && Hi(r, i), w !== null && (w.f & M) !== 0 && (e & St) === 0)) {
947
+ (r.f & Zt) === 0 && (r = r.first, (t & yt) !== 0 && (t & Pe) !== 0 && r !== null && (r.f |= Pe)), r !== null && (r.parent = i, i !== null && Vi(r, i), w !== null && (w.f & k) !== 0 && (t & Pt) === 0)) {
955
948
  var o = (
956
949
  /** @type {Derived} */
957
950
  w
@@ -960,435 +953,442 @@ function yt(e, t, n) {
960
953
  }
961
954
  return s;
962
955
  }
963
- function $t() {
964
- return w !== null && !X;
956
+ function pn() {
957
+ return w !== null && !q;
965
958
  }
966
- function pn(e) {
967
- const t = yt(Je, null, !1);
968
- return B(t, H), t.teardown = e, t;
959
+ function _n(t) {
960
+ const e = gt(ge, null, !1);
961
+ return H(e, x), e.teardown = t, e;
969
962
  }
970
- function Fi(e) {
971
- Ui();
972
- var t = (
963
+ function Wi(t) {
964
+ Bi();
965
+ var e = (
973
966
  /** @type {Effect} */
974
- D.f
975
- ), n = !w && (t & Ct) !== 0 && (t & we) === 0;
967
+ N.f
968
+ ), n = !w && (e & vt) !== 0 && (e & be) === 0;
976
969
  if (n) {
977
970
  var i = (
978
971
  /** @type {ComponentContext} */
979
- Z
972
+ X
980
973
  );
981
- (i.e ?? (i.e = [])).push(e);
974
+ (i.e ?? (i.e = [])).push(t);
982
975
  } else
983
- return _n(e);
976
+ return Cn(t);
984
977
  }
985
- function _n(e) {
986
- return yt(ge | ni, e, !1);
978
+ function Cn(t) {
979
+ return gt(Gt | ii, t, !1);
987
980
  }
988
- function Ae(e) {
989
- return yt(ge, e, !1);
981
+ function Ae(t) {
982
+ return gt(Gt, t, !1);
990
983
  }
991
- function Bi(e) {
992
- return yt(Ie | Jt, e, !0);
984
+ function ji(t) {
985
+ return gt(we | Zt, t, !0);
993
986
  }
994
- function Vi(e, t = 0) {
995
- return yt(Je | t, e, !0);
987
+ function Gi(t, e = 0) {
988
+ return gt(ge | e, t, !0);
996
989
  }
997
- function Cn(e, t = 0) {
998
- var n = yt(tn | t, e, !0);
990
+ function yn(t, e = 0) {
991
+ var n = gt(me | e, t, !0);
999
992
  return n;
1000
993
  }
1001
- function yn(e) {
1002
- return yt(Ct | Jt, e, !0);
994
+ function vn(t) {
995
+ return gt(vt | Zt, t, !0);
1003
996
  }
1004
- function vn(e) {
1005
- var t = e.teardown;
1006
- if (t !== null) {
1007
- const n = vt, i = w;
1008
- Me(!0), J(null);
997
+ function gn(t) {
998
+ var e = t.teardown;
999
+ if (e !== null) {
1000
+ const n = it, i = w;
1001
+ Me(!0), Q(null);
1009
1002
  try {
1010
- t.call(null);
1003
+ e.call(null);
1011
1004
  } finally {
1012
- Me(n), J(i);
1005
+ Me(n), Q(i);
1013
1006
  }
1014
1007
  }
1015
1008
  }
1016
- function mn(e, t = !1) {
1017
- var n = e.first;
1018
- for (e.first = e.last = null; n !== null; ) {
1009
+ function mn(t, e = !1) {
1010
+ var n = t.first;
1011
+ for (t.first = t.last = null; n !== null; ) {
1019
1012
  const s = n.ac;
1020
1013
  s !== null && Le(() => {
1021
- s.abort(gt);
1014
+ s.abort(bt);
1022
1015
  });
1023
1016
  var i = n.next;
1024
- (n.f & St) !== 0 ? n.parent = null : pt(n, t), n = i;
1017
+ (n.f & Pt) !== 0 ? n.parent = null : Ct(n, e), n = i;
1025
1018
  }
1026
1019
  }
1027
- function Wi(e) {
1028
- for (var t = e.first; t !== null; ) {
1029
- var n = t.next;
1030
- (t.f & Ct) === 0 && pt(t), t = n;
1020
+ function Yi(t) {
1021
+ for (var e = t.first; e !== null; ) {
1022
+ var n = e.next;
1023
+ (e.f & vt) === 0 && Ct(e), e = n;
1031
1024
  }
1032
1025
  }
1033
- function pt(e, t = !0) {
1026
+ function Ct(t, e = !0) {
1034
1027
  var n = !1;
1035
- (t || (e.f & en) !== 0) && e.nodes !== null && e.nodes.end !== null && (ji(
1036
- e.nodes.start,
1028
+ (e || (t.f & tn) !== 0) && t.nodes !== null && t.nodes.end !== null && (Ki(
1029
+ t.nodes.start,
1037
1030
  /** @type {TemplateNode} */
1038
- e.nodes.end
1039
- ), n = !0), mn(e, t && !n), Qt(e, 0), B(e, et);
1040
- var i = e.nodes && e.nodes.t;
1031
+ t.nodes.end
1032
+ ), n = !0), mn(t, e && !n), Xt(t, 0), H(t, J);
1033
+ var i = t.nodes && t.nodes.t;
1041
1034
  if (i !== null)
1042
1035
  for (const r of i)
1043
1036
  r.stop();
1044
- vn(e);
1045
- var s = e.parent;
1046
- s !== null && s.first !== null && gn(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = null;
1037
+ gn(t);
1038
+ var s = t.parent;
1039
+ s !== null && s.first !== null && bn(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes = t.ac = null;
1047
1040
  }
1048
- function ji(e, t) {
1049
- for (; e !== null; ) {
1050
- var n = e === t ? null : /* @__PURE__ */ Mi(e);
1051
- e.remove(), e = n;
1041
+ function Ki(t, e) {
1042
+ for (; t !== null; ) {
1043
+ var n = t === e ? null : /* @__PURE__ */ Hi(t);
1044
+ t.remove(), t = n;
1052
1045
  }
1053
1046
  }
1054
- function gn(e) {
1055
- var t = e.parent, n = e.prev, i = e.next;
1056
- n !== null && (n.next = i), i !== null && (i.prev = n), t !== null && (t.first === e && (t.first = i), t.last === e && (t.last = n));
1047
+ function bn(t) {
1048
+ var e = t.parent, n = t.prev, i = t.next;
1049
+ n !== null && (n.next = i), i !== null && (i.prev = n), e !== null && (e.first === t && (e.first = i), e.last === t && (e.last = n));
1057
1050
  }
1058
- let dt = !1;
1059
- function Xt(e) {
1060
- dt = e;
1051
+ let ht = !1;
1052
+ function $t(t) {
1053
+ ht = t;
1061
1054
  }
1062
- let vt = !1;
1063
- function Me(e) {
1064
- vt = e;
1055
+ let it = !1;
1056
+ function Me(t) {
1057
+ it = t;
1065
1058
  }
1066
- let w = null, X = !1;
1067
- function J(e) {
1068
- w = e;
1059
+ let w = null, q = !1;
1060
+ function Q(t) {
1061
+ w = t;
1069
1062
  }
1070
- let D = null;
1071
- function rt(e) {
1072
- D = e;
1063
+ let N = null;
1064
+ function st(t) {
1065
+ N = t;
1073
1066
  }
1074
- let F = null;
1075
- function Gi(e) {
1076
- w !== null && (F === null ? F = [e] : F.push(e));
1067
+ let U = null;
1068
+ function zi(t) {
1069
+ w !== null && (U === null ? U = [t] : U.push(t));
1077
1070
  }
1078
- let U = null, V = 0, G = null;
1079
- function Yi(e) {
1080
- G = e;
1071
+ let F = null, B = 0, j = null;
1072
+ function qi(t) {
1073
+ j = t;
1081
1074
  }
1082
- let bn = 1, Mt = 0, ft = Mt;
1083
- function xe(e) {
1084
- ft = e;
1075
+ let wn = 1, at = 0, pt = at;
1076
+ function xe(t) {
1077
+ pt = t;
1085
1078
  }
1086
- function wn() {
1087
- return ++bn;
1079
+ function In() {
1080
+ return ++wn;
1088
1081
  }
1089
- function Ht(e) {
1090
- var t = e.f;
1091
- if ((t & j) !== 0)
1082
+ function Ut(t) {
1083
+ var e = t.f;
1084
+ if ((e & W) !== 0)
1092
1085
  return !0;
1093
- if (t & M && (e.f &= ~ht), (t & Q) !== 0) {
1094
- var n = e.deps;
1095
- if (n !== null)
1096
- for (var i = n.length, s = 0; s < i; s++) {
1097
- var r = n[s];
1098
- if (Ht(
1099
- /** @type {Derived} */
1100
- r
1101
- ) && cn(
1102
- /** @type {Derived} */
1103
- r
1104
- ), r.wv > e.wv)
1105
- return !0;
1106
- }
1107
- (t & q) !== 0 && // During time traveling we don't want to reset the status so that
1086
+ if (e & k && (t.f &= ~_t), (e & rt) !== 0) {
1087
+ for (var n = (
1088
+ /** @type {Value[]} */
1089
+ t.deps
1090
+ ), i = n.length, s = 0; s < i; s++) {
1091
+ var r = n[s];
1092
+ if (Ut(
1093
+ /** @type {Derived} */
1094
+ r
1095
+ ) && cn(
1096
+ /** @type {Derived} */
1097
+ r
1098
+ ), r.wv > t.wv)
1099
+ return !0;
1100
+ }
1101
+ (e & Y) !== 0 && // During time traveling we don't want to reset the status so that
1108
1102
  // traversal of the graph in the other batches still happens
1109
- P === null && B(e, H);
1103
+ R === null && H(t, x);
1110
1104
  }
1111
1105
  return !1;
1112
1106
  }
1113
- function In(e, t, n = !0) {
1114
- var i = e.reactions;
1115
- if (i !== null && !(F != null && F.includes(e)))
1107
+ function En(t, e, n = !0) {
1108
+ var i = t.reactions;
1109
+ if (i !== null && !(U != null && U.includes(t)))
1116
1110
  for (var s = 0; s < i.length; s++) {
1117
1111
  var r = i[s];
1118
- (r.f & M) !== 0 ? In(
1112
+ (r.f & k) !== 0 ? En(
1119
1113
  /** @type {Derived} */
1120
1114
  r,
1121
- t,
1115
+ e,
1122
1116
  !1
1123
- ) : t === r && (n ? B(r, j) : (r.f & H) !== 0 && B(r, Q), Tt(
1117
+ ) : e === r && (n ? H(r, W) : (r.f & x) !== 0 && H(r, rt), St(
1124
1118
  /** @type {Effect} */
1125
1119
  r
1126
1120
  ));
1127
1121
  }
1128
1122
  }
1129
- function En(e) {
1130
- var C;
1131
- var t = U, n = V, i = G, s = w, r = F, o = Z, l = X, a = ft, u = e.f;
1132
- U = /** @type {null | Value[]} */
1133
- null, V = 0, G = null, w = (u & (Ct | St)) === 0 ? e : null, F = null, Yt(e.ctx), X = !1, ft = ++Mt, e.ac !== null && (Le(() => {
1134
- e.ac.abort(gt);
1135
- }), e.ac = null);
1123
+ function Nn(t) {
1124
+ var _;
1125
+ var e = F, n = B, i = j, s = w, r = U, o = X, l = q, u = pt, a = t.f;
1126
+ F = /** @type {null | Value[]} */
1127
+ null, B = 0, j = null, w = (a & (vt | Pt)) === 0 ? t : null, U = null, Yt(t.ctx), q = !1, pt = ++at, t.ac !== null && (Le(() => {
1128
+ t.ac.abort(bt);
1129
+ }), t.ac = null);
1136
1130
  try {
1137
- e.f |= fe;
1131
+ t.f |= de;
1138
1132
  var c = (
1139
1133
  /** @type {Function} */
1140
- e.fn
1141
- ), d = c(), f = e.deps;
1142
- if (U !== null) {
1143
- var h;
1144
- if (Qt(e, V), f !== null && V > 0)
1145
- for (f.length = V + U.length, h = 0; h < U.length; h++)
1146
- f[V + h] = U[h];
1134
+ t.fn
1135
+ ), d = c(), f = t.deps;
1136
+ if (F !== null) {
1137
+ var p;
1138
+ if (Xt(t, B), f !== null && B > 0)
1139
+ for (f.length = B + F.length, p = 0; p < F.length; p++)
1140
+ f[B + p] = F[p];
1147
1141
  else
1148
- e.deps = f = U;
1149
- if ($t() && (e.f & q) !== 0)
1150
- for (h = V; h < f.length; h++)
1151
- ((C = f[h]).reactions ?? (C.reactions = [])).push(e);
1152
- } else f !== null && V < f.length && (Qt(e, V), f.length = V);
1153
- if (sn() && G !== null && !X && f !== null && (e.f & (M | Q | j)) === 0)
1154
- for (h = 0; h < /** @type {Source[]} */
1155
- G.length; h++)
1156
- In(
1157
- G[h],
1142
+ t.deps = f = F;
1143
+ if (pn() && (t.f & Y) !== 0)
1144
+ for (p = B; p < f.length; p++)
1145
+ ((_ = f[p]).reactions ?? (_.reactions = [])).push(t);
1146
+ } else f !== null && B < f.length && (Xt(t, B), f.length = B);
1147
+ if (nn() && j !== null && !q && f !== null && (t.f & (k | rt | W)) === 0)
1148
+ for (p = 0; p < /** @type {Source[]} */
1149
+ j.length; p++)
1150
+ En(
1151
+ j[p],
1158
1152
  /** @type {Effect} */
1159
- e
1153
+ t
1160
1154
  );
1161
- return s !== null && s !== e && (Mt++, G !== null && (i === null ? i = G : i.push(.../** @type {Source[]} */
1162
- G))), (e.f & it) !== 0 && (e.f ^= it), d;
1163
- } catch (b) {
1164
- return bi(b);
1155
+ if (s !== null && s !== t) {
1156
+ if (at++, s.deps !== null)
1157
+ for (let g = 0; g < n; g += 1)
1158
+ s.deps[g].rv = at;
1159
+ if (e !== null)
1160
+ for (const g of e)
1161
+ g.rv = at;
1162
+ j !== null && (i === null ? i = j : i.push(.../** @type {Source[]} */
1163
+ j));
1164
+ }
1165
+ return (t.f & et) !== 0 && (t.f ^= et), d;
1166
+ } catch (g) {
1167
+ return wi(g);
1165
1168
  } finally {
1166
- e.f ^= fe, U = t, V = n, G = i, w = s, F = r, Yt(o), X = l, ft = a;
1169
+ t.f ^= de, F = e, B = n, j = i, w = s, U = r, Yt(o), q = l, pt = u;
1167
1170
  }
1168
1171
  }
1169
- function Ki(e, t) {
1170
- let n = t.reactions;
1172
+ function $i(t, e) {
1173
+ let n = e.reactions;
1171
1174
  if (n !== null) {
1172
- var i = Xn.call(n, e);
1175
+ var i = Qn.call(n, t);
1173
1176
  if (i !== -1) {
1174
1177
  var s = n.length - 1;
1175
- s === 0 ? n = t.reactions = null : (n[i] = n[s], n.pop());
1178
+ s === 0 ? n = e.reactions = null : (n[i] = n[s], n.pop());
1176
1179
  }
1177
1180
  }
1178
- n === null && (t.f & M) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
1181
+ if (n === null && (e.f & k) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
1179
1182
  // to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
1180
1183
  // allows us to skip the expensive work of disconnecting and immediately reconnecting it
1181
- (U === null || !U.includes(t)) && (B(t, Q), (t.f & q) !== 0 && (t.f ^= q, t.f &= ~ht), an(
1182
- /** @type {Derived} **/
1183
- t
1184
- ), Qt(
1185
- /** @type {Derived} **/
1186
- t,
1187
- 0
1188
- ));
1184
+ (F === null || !F.includes(e))) {
1185
+ var r = (
1186
+ /** @type {Derived} */
1187
+ e
1188
+ );
1189
+ (r.f & Y) !== 0 && (r.f ^= Y, r.f &= ~_t), Ie(r), an(r), Xt(r, 0);
1190
+ }
1189
1191
  }
1190
- function Qt(e, t) {
1191
- var n = e.deps;
1192
+ function Xt(t, e) {
1193
+ var n = t.deps;
1192
1194
  if (n !== null)
1193
- for (var i = t; i < n.length; i++)
1194
- Ki(e, n[i]);
1195
- }
1196
- function xt(e) {
1197
- var t = e.f;
1198
- if ((t & et) === 0) {
1199
- B(e, H);
1200
- var n = D, i = dt;
1201
- D = e, dt = !0;
1195
+ for (var i = e; i < n.length; i++)
1196
+ $i(t, n[i]);
1197
+ }
1198
+ function Mt(t) {
1199
+ var e = t.f;
1200
+ if ((e & J) === 0) {
1201
+ H(t, x);
1202
+ var n = N, i = ht;
1203
+ N = t, ht = !0;
1202
1204
  try {
1203
- (t & (_t | tn)) !== 0 ? Wi(e) : mn(e), vn(e);
1204
- var s = En(e);
1205
- e.teardown = typeof s == "function" ? s : null, e.wv = bn;
1205
+ (e & (yt | me)) !== 0 ? Yi(t) : mn(t), gn(t);
1206
+ var s = Nn(t);
1207
+ t.teardown = typeof s == "function" ? s : null, t.wv = wn;
1206
1208
  var r;
1207
- de && yi && (e.f & j) !== 0 && e.deps;
1209
+ ce && vi && (t.f & W) !== 0 && t.deps;
1208
1210
  } finally {
1209
- dt = i, D = n;
1211
+ ht = i, N = n;
1210
1212
  }
1211
1213
  }
1212
1214
  }
1213
- function I(e) {
1214
- var t = e.f, n = (t & M) !== 0;
1215
- if (w !== null && !X) {
1216
- var i = D !== null && (D.f & et) !== 0;
1217
- if (!i && !(F != null && F.includes(e))) {
1215
+ function I(t) {
1216
+ var e = t.f, n = (e & k) !== 0;
1217
+ if (w !== null && !q) {
1218
+ var i = N !== null && (N.f & J) !== 0;
1219
+ if (!i && !(U != null && U.includes(t))) {
1218
1220
  var s = w.deps;
1219
- if ((w.f & fe) !== 0)
1220
- e.rv < Mt && (e.rv = Mt, U === null && s !== null && s[V] === e ? V++ : U === null ? U = [e] : U.includes(e) || U.push(e));
1221
+ if ((w.f & de) !== 0)
1222
+ t.rv < at && (t.rv = at, F === null && s !== null && s[B] === t ? B++ : F === null ? F = [t] : F.push(t));
1221
1223
  else {
1222
- (w.deps ?? (w.deps = [])).push(e);
1223
- var r = e.reactions;
1224
- r === null ? e.reactions = [w] : r.includes(w) || r.push(w);
1224
+ (w.deps ?? (w.deps = [])).push(t);
1225
+ var r = t.reactions;
1226
+ r === null ? t.reactions = [w] : r.includes(w) || r.push(w);
1225
1227
  }
1226
1228
  }
1227
1229
  }
1228
- if (vt) {
1229
- if (st.has(e))
1230
- return st.get(e);
1231
- if (n) {
1232
- var o = (
1233
- /** @type {Derived} */
1234
- e
1235
- ), l = o.v;
1236
- return ((o.f & H) === 0 && o.reactions !== null || Dn(o)) && (l = De(o)), st.set(o, l), l;
1230
+ if (it && nt.has(t))
1231
+ return nt.get(t);
1232
+ if (n) {
1233
+ var o = (
1234
+ /** @type {Derived} */
1235
+ t
1236
+ );
1237
+ if (it) {
1238
+ var l = o.v;
1239
+ return ((o.f & x) === 0 && o.reactions !== null || Ln(o)) && (l = De(o)), nt.set(o, l), l;
1237
1240
  }
1238
- } else n && (!(P != null && P.has(e)) || N != null && N.is_fork && !$t()) && (o = /** @type {Derived} */
1239
- e, Ht(o) && cn(o), dt && $t() && (o.f & q) === 0 && Nn(o));
1240
- if (P != null && P.has(e))
1241
- return P.get(e);
1242
- if ((e.f & it) !== 0)
1243
- throw e.v;
1244
- return e.v;
1245
- }
1246
- function Nn(e) {
1247
- if (e.deps !== null) {
1248
- e.f ^= q;
1249
- for (const t of e.deps)
1250
- (t.reactions ?? (t.reactions = [])).push(e), (t.f & M) !== 0 && (t.f & q) === 0 && Nn(
1241
+ var u = (o.f & Y) === 0 && !q && w !== null && (ht || (w.f & Y) !== 0), a = o.deps === null;
1242
+ Ut(o) && (u && (o.f |= Y), cn(o)), u && !a && Dn(o);
1243
+ }
1244
+ if (R != null && R.has(t))
1245
+ return R.get(t);
1246
+ if ((t.f & et) !== 0)
1247
+ throw t.v;
1248
+ return t.v;
1249
+ }
1250
+ function Dn(t) {
1251
+ if (t.deps !== null) {
1252
+ t.f |= Y;
1253
+ for (const e of t.deps)
1254
+ (e.reactions ?? (e.reactions = [])).push(t), (e.f & k) !== 0 && (e.f & Y) === 0 && Dn(
1251
1255
  /** @type {Derived} */
1252
- t
1256
+ e
1253
1257
  );
1254
1258
  }
1255
1259
  }
1256
- function Dn(e) {
1257
- if (e.v === R) return !0;
1258
- if (e.deps === null) return !1;
1259
- for (const t of e.deps)
1260
- if (st.has(t) || (t.f & M) !== 0 && Dn(
1260
+ function Ln(t) {
1261
+ if (t.v === P) return !0;
1262
+ if (t.deps === null) return !1;
1263
+ for (const e of t.deps)
1264
+ if (nt.has(e) || (e.f & k) !== 0 && Ln(
1261
1265
  /** @type {Derived} */
1262
- t
1266
+ e
1263
1267
  ))
1264
1268
  return !0;
1265
1269
  return !1;
1266
1270
  }
1267
- function Ln(e) {
1268
- var t = X;
1271
+ function An(t) {
1272
+ var e = q;
1269
1273
  try {
1270
- return X = !0, e();
1274
+ return q = !0, t();
1271
1275
  } finally {
1272
- X = t;
1276
+ q = e;
1273
1277
  }
1274
1278
  }
1275
- const zi = -7169;
1276
- function B(e, t) {
1277
- e.f = e.f & zi | t;
1278
- }
1279
- const qi = /* @__PURE__ */ new Set(), $i = /* @__PURE__ */ new Set();
1280
- function Xi(e, t, n, i = {}) {
1279
+ const Xi = /* @__PURE__ */ new Set(), Qi = /* @__PURE__ */ new Set();
1280
+ function Zi(t, e, n, i = {}) {
1281
1281
  function s(r) {
1282
- if (i.capture || Zi.call(t, r), !r.cancelBubble)
1282
+ if (i.capture || ts.call(e, r), !r.cancelBubble)
1283
1283
  return Le(() => n == null ? void 0 : n.call(this, r));
1284
1284
  }
1285
- return e.startsWith("pointer") || e.startsWith("touch") || e === "wheel" ? te(() => {
1286
- t.addEventListener(e, s, i);
1287
- }) : t.addEventListener(e, s, i), s;
1285
+ return t.startsWith("pointer") || t.startsWith("touch") || t === "wheel" ? Jt(() => {
1286
+ e.addEventListener(t, s, i);
1287
+ }) : e.addEventListener(t, s, i), s;
1288
1288
  }
1289
- function Qi(e) {
1290
- for (var t = 0; t < e.length; t++)
1291
- qi.add(e[t]);
1292
- for (var n of $i)
1293
- n(e);
1289
+ function Ji(t) {
1290
+ for (var e = 0; e < t.length; e++)
1291
+ Xi.add(t[e]);
1292
+ for (var n of Qi)
1293
+ n(t);
1294
1294
  }
1295
1295
  let Ue = null;
1296
- function Zi(e) {
1297
- var g;
1298
- var t = this, n = (
1296
+ function ts(t) {
1297
+ var b;
1298
+ var e = this, n = (
1299
1299
  /** @type {Node} */
1300
- t.ownerDocument
1301
- ), i = e.type, s = ((g = e.composedPath) == null ? void 0 : g.call(e)) || [], r = (
1300
+ e.ownerDocument
1301
+ ), i = t.type, s = ((b = t.composedPath) == null ? void 0 : b.call(t)) || [], r = (
1302
1302
  /** @type {null | Element} */
1303
- s[0] || e.target
1303
+ s[0] || t.target
1304
1304
  );
1305
- Ue = e;
1306
- var o = 0, l = Ue === e && e.__root;
1305
+ Ue = t;
1306
+ var o = 0, l = Ue === t && t.__root;
1307
1307
  if (l) {
1308
- var a = s.indexOf(l);
1309
- if (a !== -1 && (t === document || t === /** @type {any} */
1308
+ var u = s.indexOf(l);
1309
+ if (u !== -1 && (e === document || e === /** @type {any} */
1310
1310
  window)) {
1311
- e.__root = t;
1311
+ t.__root = e;
1312
1312
  return;
1313
1313
  }
1314
- var u = s.indexOf(t);
1315
- if (u === -1)
1314
+ var a = s.indexOf(e);
1315
+ if (a === -1)
1316
1316
  return;
1317
- a <= u && (o = a);
1317
+ u <= a && (o = u);
1318
1318
  }
1319
1319
  if (r = /** @type {Element} */
1320
- s[o] || e.target, r !== t) {
1321
- Qn(e, "currentTarget", {
1320
+ s[o] || t.target, r !== e) {
1321
+ Zn(t, "currentTarget", {
1322
1322
  configurable: !0,
1323
1323
  get() {
1324
1324
  return r || n;
1325
1325
  }
1326
1326
  });
1327
- var c = w, d = D;
1328
- J(null), rt(null);
1327
+ var c = w, d = N;
1328
+ Q(null), st(null);
1329
1329
  try {
1330
- for (var f, h = []; r !== null; ) {
1331
- var C = r.assignedSlot || r.parentNode || /** @type {any} */
1330
+ for (var f, p = []; r !== null; ) {
1331
+ var _ = r.assignedSlot || r.parentNode || /** @type {any} */
1332
1332
  r.host || null;
1333
1333
  try {
1334
- var b = r["__" + i];
1335
- b != null && (!/** @type {any} */
1334
+ var g = r["__" + i];
1335
+ g != null && (!/** @type {any} */
1336
1336
  r.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
1337
1337
  // -> the target could not have been disabled because it emits the event in the first place
1338
- e.target === r) && b.call(r, e);
1338
+ t.target === r) && g.call(r, t);
1339
1339
  } catch (y) {
1340
- f ? h.push(y) : f = y;
1340
+ f ? p.push(y) : f = y;
1341
1341
  }
1342
- if (e.cancelBubble || C === t || C === null)
1342
+ if (t.cancelBubble || _ === e || _ === null)
1343
1343
  break;
1344
- r = C;
1344
+ r = _;
1345
1345
  }
1346
1346
  if (f) {
1347
- for (let y of h)
1347
+ for (let y of p)
1348
1348
  queueMicrotask(() => {
1349
1349
  throw y;
1350
1350
  });
1351
1351
  throw f;
1352
1352
  }
1353
1353
  } finally {
1354
- e.__root = t, delete e.currentTarget, J(c), rt(d);
1354
+ t.__root = e, delete t.currentTarget, Q(c), st(d);
1355
1355
  }
1356
1356
  }
1357
1357
  }
1358
- function Ji(e) {
1359
- var t = document.createElement("template");
1360
- return t.innerHTML = e.replaceAll("<!>", "<!---->"), t.content;
1358
+ function es(t) {
1359
+ var e = document.createElement("template");
1360
+ return e.innerHTML = t.replaceAll("<!>", "<!---->"), e.content;
1361
1361
  }
1362
- function ts(e, t) {
1362
+ function ns(t, e) {
1363
1363
  var n = (
1364
1364
  /** @type {Effect} */
1365
- D
1365
+ N
1366
1366
  );
1367
- n.nodes === null && (n.nodes = { start: e, end: t, a: null, t: null });
1367
+ n.nodes === null && (n.nodes = { start: t, end: e, a: null, t: null });
1368
1368
  }
1369
1369
  // @__NO_SIDE_EFFECTS__
1370
- function es(e, t) {
1371
- var n = (t & zn) !== 0, i, s = !e.startsWith("<!>");
1370
+ function is(t, e) {
1371
+ var n = (e & qn) !== 0, i, s = !t.startsWith("<!>");
1372
1372
  return () => {
1373
- i === void 0 && (i = Ji(s ? e : "<!>" + e), i = /** @type {TemplateNode} */
1374
- /* @__PURE__ */ ki(i));
1373
+ i === void 0 && (i = es(s ? t : "<!>" + t), i = /** @type {TemplateNode} */
1374
+ /* @__PURE__ */ Ui(i));
1375
1375
  var r = (
1376
1376
  /** @type {TemplateNode} */
1377
- n || Pi ? document.importNode(i, !0) : i.cloneNode(!0)
1377
+ n || ki ? document.importNode(i, !0) : i.cloneNode(!0)
1378
1378
  );
1379
- return ts(r, r), r;
1379
+ return ns(r, r), r;
1380
1380
  };
1381
1381
  }
1382
- function ns(e, t) {
1383
- e !== null && e.before(
1382
+ function ss(t, e) {
1383
+ t !== null && t.before(
1384
1384
  /** @type {Node} */
1385
- t
1385
+ e
1386
1386
  );
1387
1387
  }
1388
- function is(e) {
1389
- return e.endsWith("capture") && e !== "gotpointercapture" && e !== "lostpointercapture";
1388
+ function rs(t) {
1389
+ return t.endsWith("capture") && t !== "gotpointercapture" && t !== "lostpointercapture";
1390
1390
  }
1391
- const ss = [
1391
+ const os = [
1392
1392
  "beforeinput",
1393
1393
  "click",
1394
1394
  "change",
@@ -1413,10 +1413,10 @@ const ss = [
1413
1413
  "touchmove",
1414
1414
  "touchstart"
1415
1415
  ];
1416
- function rs(e) {
1417
- return ss.includes(e);
1416
+ function ls(t) {
1417
+ return os.includes(t);
1418
1418
  }
1419
- const os = {
1419
+ const us = {
1420
1420
  // no `class: 'className'` because we handle that separately
1421
1421
  formnovalidate: "formNoValidate",
1422
1422
  ismap: "isMap",
@@ -1431,40 +1431,40 @@ const os = {
1431
1431
  disablepictureinpicture: "disablePictureInPicture",
1432
1432
  disableremoteplayback: "disableRemotePlayback"
1433
1433
  };
1434
- function ls(e) {
1435
- return e = e.toLowerCase(), os[e] ?? e;
1434
+ function as(t) {
1435
+ return t = t.toLowerCase(), us[t] ?? t;
1436
1436
  }
1437
- function us(e, t) {
1437
+ function cs(t, e) {
1438
1438
  var n = void 0, i;
1439
- Cn(() => {
1440
- n !== (n = t()) && (i && (pt(i), i = null), n && (i = yn(() => {
1439
+ yn(() => {
1440
+ n !== (n = e()) && (i && (Ct(i), i = null), n && (i = vn(() => {
1441
1441
  Ae(() => (
1442
1442
  /** @type {(node: Element) => void} */
1443
- n(e)
1443
+ n(t)
1444
1444
  ));
1445
1445
  })));
1446
1446
  });
1447
1447
  }
1448
- function An(e) {
1449
- var t, n, i = "";
1450
- if (typeof e == "string" || typeof e == "number") i += e;
1451
- else if (typeof e == "object") if (Array.isArray(e)) {
1452
- var s = e.length;
1453
- for (t = 0; t < s; t++) e[t] && (n = An(e[t])) && (i && (i += " "), i += n);
1454
- } else for (n in e) e[n] && (i && (i += " "), i += n);
1448
+ function Tn(t) {
1449
+ var e, n, i = "";
1450
+ if (typeof t == "string" || typeof t == "number") i += t;
1451
+ else if (typeof t == "object") if (Array.isArray(t)) {
1452
+ var s = t.length;
1453
+ for (e = 0; e < s; e++) t[e] && (n = Tn(t[e])) && (i && (i += " "), i += n);
1454
+ } else for (n in t) t[n] && (i && (i += " "), i += n);
1455
1455
  return i;
1456
1456
  }
1457
- function as() {
1458
- for (var e, t, n = 0, i = "", s = arguments.length; n < s; n++) (e = arguments[n]) && (t = An(e)) && (i && (i += " "), i += t);
1457
+ function ds() {
1458
+ for (var t, e, n = 0, i = "", s = arguments.length; n < s; n++) (t = arguments[n]) && (e = Tn(t)) && (i && (i += " "), i += e);
1459
1459
  return i;
1460
1460
  }
1461
- function cs(e) {
1462
- return typeof e == "object" ? as(e) : e ?? "";
1461
+ function fs(t) {
1462
+ return typeof t == "object" ? ds(t) : t ?? "";
1463
1463
  }
1464
1464
  const He = [...`
1465
1465
  \r\f \v\uFEFF`];
1466
- function ds(e, t, n) {
1467
- var i = e == null ? "" : "" + e;
1466
+ function hs(t, e, n) {
1467
+ var i = t == null ? "" : "" + t;
1468
1468
  if (n) {
1469
1469
  for (var s in n)
1470
1470
  if (n[s])
@@ -1477,99 +1477,99 @@ function ds(e, t, n) {
1477
1477
  }
1478
1478
  return i === "" ? null : i;
1479
1479
  }
1480
- function Fe(e, t = !1) {
1481
- var n = t ? " !important;" : ";", i = "";
1482
- for (var s in e) {
1483
- var r = e[s];
1480
+ function Fe(t, e = !1) {
1481
+ var n = e ? " !important;" : ";", i = "";
1482
+ for (var s in t) {
1483
+ var r = t[s];
1484
1484
  r != null && r !== "" && (i += " " + s + ": " + r + n);
1485
1485
  }
1486
1486
  return i;
1487
1487
  }
1488
- function ie(e) {
1489
- return e[0] !== "-" || e[1] !== "-" ? e.toLowerCase() : e;
1488
+ function ne(t) {
1489
+ return t[0] !== "-" || t[1] !== "-" ? t.toLowerCase() : t;
1490
1490
  }
1491
- function fs(e, t) {
1492
- if (t) {
1491
+ function ps(t, e) {
1492
+ if (e) {
1493
1493
  var n = "", i, s;
1494
- if (Array.isArray(t) ? (i = t[0], s = t[1]) : i = t, e) {
1495
- e = String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g, "").trim();
1496
- var r = !1, o = 0, l = !1, a = [];
1497
- i && a.push(...Object.keys(i).map(ie)), s && a.push(...Object.keys(s).map(ie));
1498
- var u = 0, c = -1;
1499
- const b = e.length;
1500
- for (var d = 0; d < b; d++) {
1501
- var f = e[d];
1502
- if (l ? f === "/" && e[d - 1] === "*" && (l = !1) : r ? r === f && (r = !1) : f === "/" && e[d + 1] === "*" ? l = !0 : f === '"' || f === "'" ? r = f : f === "(" ? o++ : f === ")" && o--, !l && r === !1 && o === 0) {
1494
+ if (Array.isArray(e) ? (i = e[0], s = e[1]) : i = e, t) {
1495
+ t = String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g, "").trim();
1496
+ var r = !1, o = 0, l = !1, u = [];
1497
+ i && u.push(...Object.keys(i).map(ne)), s && u.push(...Object.keys(s).map(ne));
1498
+ var a = 0, c = -1;
1499
+ const g = t.length;
1500
+ for (var d = 0; d < g; d++) {
1501
+ var f = t[d];
1502
+ if (l ? f === "/" && t[d - 1] === "*" && (l = !1) : r ? r === f && (r = !1) : f === "/" && t[d + 1] === "*" ? l = !0 : f === '"' || f === "'" ? r = f : f === "(" ? o++ : f === ")" && o--, !l && r === !1 && o === 0) {
1503
1503
  if (f === ":" && c === -1)
1504
1504
  c = d;
1505
- else if (f === ";" || d === b - 1) {
1505
+ else if (f === ";" || d === g - 1) {
1506
1506
  if (c !== -1) {
1507
- var h = ie(e.substring(u, c).trim());
1508
- if (!a.includes(h)) {
1507
+ var p = ne(t.substring(a, c).trim());
1508
+ if (!u.includes(p)) {
1509
1509
  f !== ";" && d++;
1510
- var C = e.substring(u, d).trim();
1511
- n += " " + C + ";";
1510
+ var _ = t.substring(a, d).trim();
1511
+ n += " " + _ + ";";
1512
1512
  }
1513
1513
  }
1514
- u = d + 1, c = -1;
1514
+ a = d + 1, c = -1;
1515
1515
  }
1516
1516
  }
1517
1517
  }
1518
1518
  }
1519
1519
  return i && (n += Fe(i)), s && (n += Fe(s, !0)), n = n.trim(), n === "" ? null : n;
1520
1520
  }
1521
- return e == null ? null : String(e);
1521
+ return t == null ? null : String(t);
1522
1522
  }
1523
- function hs(e, t, n, i, s, r) {
1524
- var o = e.__className;
1523
+ function _s(t, e, n, i, s, r) {
1524
+ var o = t.__className;
1525
1525
  if (o !== n || o === void 0) {
1526
- var l = ds(n, i, r);
1527
- l == null ? e.removeAttribute("class") : t ? e.className = l : e.setAttribute("class", l), e.__className = n;
1526
+ var l = hs(n, i, r);
1527
+ l == null ? t.removeAttribute("class") : e ? t.className = l : t.setAttribute("class", l), t.__className = n;
1528
1528
  } else if (r && s !== r)
1529
- for (var a in r) {
1530
- var u = !!r[a];
1531
- (s == null || u !== !!s[a]) && e.classList.toggle(a, u);
1529
+ for (var u in r) {
1530
+ var a = !!r[u];
1531
+ (s == null || a !== !!s[u]) && t.classList.toggle(u, a);
1532
1532
  }
1533
1533
  return r;
1534
1534
  }
1535
- function se(e, t = {}, n, i) {
1535
+ function ie(t, e = {}, n, i) {
1536
1536
  for (var s in n) {
1537
1537
  var r = n[s];
1538
- t[s] !== r && (n[s] == null ? e.style.removeProperty(s) : e.style.setProperty(s, r, i));
1538
+ e[s] !== r && (n[s] == null ? t.style.removeProperty(s) : t.style.setProperty(s, r, i));
1539
1539
  }
1540
1540
  }
1541
- function ps(e, t, n, i) {
1542
- var s = e.__style;
1543
- if (s !== t) {
1544
- var r = fs(t, i);
1545
- r == null ? e.removeAttribute("style") : e.style.cssText = r, e.__style = t;
1546
- } else i && (Array.isArray(i) ? (se(e, n == null ? void 0 : n[0], i[0]), se(e, n == null ? void 0 : n[1], i[1], "important")) : se(e, n, i));
1541
+ function Cs(t, e, n, i) {
1542
+ var s = t.__style;
1543
+ if (s !== e) {
1544
+ var r = ps(e, i);
1545
+ r == null ? t.removeAttribute("style") : t.style.cssText = r, t.__style = e;
1546
+ } else i && (Array.isArray(i) ? (ie(t, n == null ? void 0 : n[0], i[0]), ie(t, n == null ? void 0 : n[1], i[1], "important")) : ie(t, n, i));
1547
1547
  return i;
1548
1548
  }
1549
- function ve(e, t, n = !1) {
1550
- if (e.multiple) {
1551
- if (t == null)
1549
+ function ye(t, e, n = !1) {
1550
+ if (t.multiple) {
1551
+ if (e == null)
1552
1552
  return;
1553
- if (!Xe(t))
1554
- return pi();
1555
- for (var i of e.options)
1556
- i.selected = t.includes(Be(i));
1553
+ if (!Xe(e))
1554
+ return _i();
1555
+ for (var i of t.options)
1556
+ i.selected = e.includes(Be(i));
1557
1557
  return;
1558
1558
  }
1559
- for (i of e.options) {
1559
+ for (i of t.options) {
1560
1560
  var s = Be(i);
1561
- if (Si(s, t)) {
1561
+ if (Ri(s, e)) {
1562
1562
  i.selected = !0;
1563
1563
  return;
1564
1564
  }
1565
1565
  }
1566
- (!n || t !== void 0) && (e.selectedIndex = -1);
1566
+ (!n || e !== void 0) && (t.selectedIndex = -1);
1567
1567
  }
1568
- function _s(e) {
1569
- var t = new MutationObserver(() => {
1570
- ve(e, e.__value);
1568
+ function ys(t) {
1569
+ var e = new MutationObserver(() => {
1570
+ ye(t, t.__value);
1571
1571
  });
1572
- t.observe(e, {
1572
+ e.observe(t, {
1573
1573
  // Listen to option element changes
1574
1574
  childList: !0,
1575
1575
  subtree: !0,
@@ -1579,92 +1579,92 @@ function _s(e) {
1579
1579
  // because that property is not reflected as an attribute)
1580
1580
  attributes: !0,
1581
1581
  attributeFilter: ["value"]
1582
- }), pn(() => {
1583
- t.disconnect();
1582
+ }), _n(() => {
1583
+ e.disconnect();
1584
1584
  });
1585
1585
  }
1586
- function Be(e) {
1587
- return "__value" in e ? e.__value : e.value;
1586
+ function Be(t) {
1587
+ return "__value" in t ? t.__value : t.value;
1588
1588
  }
1589
- const Pt = Symbol("class"), Ot = Symbol("style"), Tn = Symbol("is custom element"), Sn = Symbol("is html");
1590
- function Cs(e, t) {
1591
- t ? e.hasAttribute("selected") || e.setAttribute("selected", "") : e.removeAttribute("selected");
1589
+ const Ot = Symbol("class"), Rt = Symbol("style"), Sn = Symbol("is custom element"), Pn = Symbol("is html");
1590
+ function vs(t, e) {
1591
+ e ? t.hasAttribute("selected") || t.setAttribute("selected", "") : t.removeAttribute("selected");
1592
1592
  }
1593
- function Ve(e, t, n, i) {
1594
- var s = Pn(e);
1595
- s[t] !== (s[t] = n) && (t === "loading" && (e[si] = n), n == null ? e.removeAttribute(t) : typeof n != "string" && On(e).includes(t) ? e[t] = n : e.setAttribute(t, n));
1593
+ function Ve(t, e, n, i) {
1594
+ var s = On(t);
1595
+ s[e] !== (s[e] = n) && (e === "loading" && (t[ri] = n), n == null ? t.removeAttribute(e) : typeof n != "string" && Rn(t).includes(e) ? t[e] = n : t.setAttribute(e, n));
1596
1596
  }
1597
- function ys(e, t, n, i, s = !1, r = !1) {
1598
- var o = Pn(e), l = o[Tn], a = !o[Sn], u = t || {}, c = e.tagName === "OPTION";
1599
- for (var d in t)
1597
+ function gs(t, e, n, i, s = !1, r = !1) {
1598
+ var o = On(t), l = o[Sn], u = !o[Pn], a = e || {}, c = t.tagName === "OPTION";
1599
+ for (var d in e)
1600
1600
  d in n || (n[d] = null);
1601
- n.class ? n.class = cs(n.class) : n[Pt] && (n.class = null), n[Ot] && (n.style ?? (n.style = null));
1602
- var f = On(e);
1603
- for (const p in n) {
1604
- let m = n[p];
1605
- if (c && p === "value" && m == null) {
1606
- e.value = e.__value = "", u[p] = m;
1601
+ n.class ? n.class = fs(n.class) : n[Ot] && (n.class = null), n[Rt] && (n.style ?? (n.style = null));
1602
+ var f = Rn(t);
1603
+ for (const h in n) {
1604
+ let m = n[h];
1605
+ if (c && h === "value" && m == null) {
1606
+ t.value = t.__value = "", a[h] = m;
1607
1607
  continue;
1608
1608
  }
1609
- if (p === "class") {
1610
- var h = e.namespaceURI === "http://www.w3.org/1999/xhtml";
1611
- hs(e, h, m, i, t == null ? void 0 : t[Pt], n[Pt]), u[p] = m, u[Pt] = n[Pt];
1609
+ if (h === "class") {
1610
+ var p = t.namespaceURI === "http://www.w3.org/1999/xhtml";
1611
+ _s(t, p, m, i, e == null ? void 0 : e[Ot], n[Ot]), a[h] = m, a[Ot] = n[Ot];
1612
1612
  continue;
1613
1613
  }
1614
- if (p === "style") {
1615
- ps(e, m, t == null ? void 0 : t[Ot], n[Ot]), u[p] = m, u[Ot] = n[Ot];
1614
+ if (h === "style") {
1615
+ Cs(t, m, e == null ? void 0 : e[Rt], n[Rt]), a[h] = m, a[Rt] = n[Rt];
1616
1616
  continue;
1617
1617
  }
1618
- var C = u[p];
1619
- if (!(m === C && !(m === void 0 && e.hasAttribute(p)))) {
1620
- u[p] = m;
1621
- var b = p[0] + p[1];
1622
- if (b !== "$$")
1623
- if (b === "on") {
1624
- const S = {}, ot = "$$" + p;
1625
- let O = p.slice(2);
1626
- var g = rs(O);
1627
- if (is(O) && (O = O.slice(0, -7), S.capture = !0), !g && C) {
1618
+ var _ = a[h];
1619
+ if (!(m === _ && !(m === void 0 && t.hasAttribute(h)))) {
1620
+ a[h] = m;
1621
+ var g = h[0] + h[1];
1622
+ if (g !== "$$")
1623
+ if (g === "on") {
1624
+ const S = {}, ot = "$$" + h;
1625
+ let O = h.slice(2);
1626
+ var b = ls(O);
1627
+ if (rs(O) && (O = O.slice(0, -7), S.capture = !0), !b && _) {
1628
1628
  if (m != null) continue;
1629
- e.removeEventListener(O, u[ot], S), u[ot] = null;
1629
+ t.removeEventListener(O, a[ot], S), a[ot] = null;
1630
1630
  }
1631
1631
  if (m != null)
1632
- if (g)
1633
- e[`__${O}`] = m, Qi([O]);
1632
+ if (b)
1633
+ t[`__${O}`] = m, Ji([O]);
1634
1634
  else {
1635
- let xn = function(Un) {
1636
- u[p].call(this, Un);
1635
+ let Un = function(Hn) {
1636
+ a[h].call(this, Hn);
1637
1637
  };
1638
- u[ot] = Xi(O, e, xn, S);
1638
+ a[ot] = Zi(O, t, Un, S);
1639
1639
  }
1640
- else g && (e[`__${O}`] = void 0);
1641
- } else if (p === "style")
1642
- Ve(e, p, m);
1643
- else if (p === "autofocus")
1644
- xi(
1640
+ else b && (t[`__${O}`] = void 0);
1641
+ } else if (h === "style")
1642
+ Ve(t, h, m);
1643
+ else if (h === "autofocus")
1644
+ Fi(
1645
1645
  /** @type {HTMLElement} */
1646
- e,
1646
+ t,
1647
1647
  !!m
1648
1648
  );
1649
- else if (!l && (p === "__value" || p === "value" && m != null))
1650
- e.value = e.__value = m;
1651
- else if (p === "selected" && c)
1652
- Cs(
1649
+ else if (!l && (h === "__value" || h === "value" && m != null))
1650
+ t.value = t.__value = m;
1651
+ else if (h === "selected" && c)
1652
+ vs(
1653
1653
  /** @type {HTMLOptionElement} */
1654
- e,
1654
+ t,
1655
1655
  m
1656
1656
  );
1657
1657
  else {
1658
- var y = p;
1659
- a || (y = ls(y));
1658
+ var y = h;
1659
+ u || (y = as(y));
1660
1660
  var v = y === "defaultValue" || y === "defaultChecked";
1661
1661
  if (m == null && !l && !v)
1662
- if (o[p] = null, y === "value" || y === "checked") {
1662
+ if (o[h] = null, y === "value" || y === "checked") {
1663
1663
  let S = (
1664
1664
  /** @type {HTMLInputElement} */
1665
- e
1665
+ t
1666
1666
  );
1667
- const ot = t === void 0;
1667
+ const ot = e === void 0;
1668
1668
  if (y === "value") {
1669
1669
  let O = S.defaultValue;
1670
1670
  S.removeAttribute(y), S.defaultValue = O, S.value = S.__value = ot ? O : null;
@@ -1673,161 +1673,161 @@ function ys(e, t, n, i, s = !1, r = !1) {
1673
1673
  S.removeAttribute(y), S.defaultChecked = O, S.checked = ot ? O : !1;
1674
1674
  }
1675
1675
  } else
1676
- e.removeAttribute(p);
1677
- else v || f.includes(y) && (l || typeof m != "string") ? (e[y] = m, y in o && (o[y] = R)) : typeof m != "function" && Ve(e, y, m);
1676
+ t.removeAttribute(h);
1677
+ else v || f.includes(y) && (l || typeof m != "string") ? (t[y] = m, y in o && (o[y] = P)) : typeof m != "function" && Ve(t, y, m);
1678
1678
  }
1679
1679
  }
1680
1680
  }
1681
- return u;
1681
+ return a;
1682
1682
  }
1683
- function vs(e, t, n = [], i = [], s = [], r, o = !1, l = !1) {
1684
- Ei(s, n, i, (a) => {
1685
- var u = void 0, c = {}, d = e.nodeName === "SELECT", f = !1;
1686
- if (Cn(() => {
1687
- var C = t(...a.map(I)), b = ys(
1688
- e,
1689
- u,
1690
- C,
1683
+ function ms(t, e, n = [], i = [], s = [], r, o = !1, l = !1) {
1684
+ Li(s, n, i, (u) => {
1685
+ var a = void 0, c = {}, d = t.nodeName === "SELECT", f = !1;
1686
+ if (yn(() => {
1687
+ var _ = e(...u.map(I)), g = gs(
1688
+ t,
1689
+ a,
1690
+ _,
1691
1691
  r,
1692
1692
  o,
1693
1693
  l
1694
1694
  );
1695
- f && d && "value" in C && ve(
1695
+ f && d && "value" in _ && ye(
1696
1696
  /** @type {HTMLSelectElement} */
1697
- e,
1698
- C.value
1697
+ t,
1698
+ _.value
1699
1699
  );
1700
1700
  for (let y of Object.getOwnPropertySymbols(c))
1701
- C[y] || pt(c[y]);
1702
- for (let y of Object.getOwnPropertySymbols(C)) {
1703
- var g = C[y];
1704
- y.description === $n && (!u || g !== u[y]) && (c[y] && pt(c[y]), c[y] = yn(() => us(e, () => g))), b[y] = g;
1701
+ _[y] || Ct(c[y]);
1702
+ for (let y of Object.getOwnPropertySymbols(_)) {
1703
+ var b = _[y];
1704
+ y.description === Xn && (!a || b !== a[y]) && (c[y] && Ct(c[y]), c[y] = vn(() => cs(t, () => b))), g[y] = b;
1705
1705
  }
1706
- u = b;
1706
+ a = g;
1707
1707
  }), d) {
1708
- var h = (
1708
+ var p = (
1709
1709
  /** @type {HTMLSelectElement} */
1710
- e
1710
+ t
1711
1711
  );
1712
1712
  Ae(() => {
1713
- ve(
1714
- h,
1713
+ ye(
1714
+ p,
1715
1715
  /** @type {Record<string | symbol, any>} */
1716
- u.value,
1716
+ a.value,
1717
1717
  !0
1718
- ), _s(h);
1718
+ ), ys(p);
1719
1719
  });
1720
1720
  }
1721
1721
  f = !0;
1722
1722
  });
1723
1723
  }
1724
- function Pn(e) {
1724
+ function On(t) {
1725
1725
  return (
1726
1726
  /** @type {Record<string | symbol, unknown>} **/
1727
1727
  // @ts-expect-error
1728
- e.__attributes ?? (e.__attributes = {
1729
- [Tn]: e.nodeName.includes("-"),
1730
- [Sn]: e.namespaceURI === qn
1728
+ t.__attributes ?? (t.__attributes = {
1729
+ [Sn]: t.nodeName.includes("-"),
1730
+ [Pn]: t.namespaceURI === $n
1731
1731
  })
1732
1732
  );
1733
1733
  }
1734
1734
  var We = /* @__PURE__ */ new Map();
1735
- function On(e) {
1736
- var t = e.getAttribute("is") || e.nodeName, n = We.get(t);
1735
+ function Rn(t) {
1736
+ var e = t.getAttribute("is") || t.nodeName, n = We.get(e);
1737
1737
  if (n) return n;
1738
- We.set(t, n = []);
1739
- for (var i, s = e, r = Element.prototype; r !== s; ) {
1740
- i = Zn(s);
1738
+ We.set(e, n = []);
1739
+ for (var i, s = t, r = Element.prototype; r !== s; ) {
1740
+ i = Jn(s);
1741
1741
  for (var o in i)
1742
1742
  i[o].set && n.push(o);
1743
1743
  s = Qe(s);
1744
1744
  }
1745
1745
  return n;
1746
1746
  }
1747
- function je(e, t) {
1748
- return e === t || (e == null ? void 0 : e[ct]) === t;
1747
+ function je(t, e) {
1748
+ return t === e || (t == null ? void 0 : t[ft]) === e;
1749
1749
  }
1750
- function ms(e = {}, t, n, i) {
1750
+ function bs(t = {}, e, n, i) {
1751
1751
  return Ae(() => {
1752
1752
  var s, r;
1753
- return Vi(() => {
1754
- s = r, r = [], Ln(() => {
1755
- e !== n(...r) && (t(e, ...r), s && je(n(...s), e) && t(null, ...s));
1753
+ return Gi(() => {
1754
+ s = r, r = [], An(() => {
1755
+ t !== n(...r) && (e(t, ...r), s && je(n(...s), t) && e(null, ...s));
1756
1756
  });
1757
1757
  }), () => {
1758
- te(() => {
1759
- r && je(n(...r), e) && t(null, ...r);
1758
+ Jt(() => {
1759
+ r && je(n(...r), t) && e(null, ...r);
1760
1760
  });
1761
1761
  };
1762
- }), e;
1762
+ }), t;
1763
1763
  }
1764
- let Bt = !1;
1765
- function gs(e) {
1766
- var t = Bt;
1764
+ let Ft = !1;
1765
+ function ws(t) {
1766
+ var e = Ft;
1767
1767
  try {
1768
- return Bt = !1, [e(), Bt];
1768
+ return Ft = !1, [t(), Ft];
1769
1769
  } finally {
1770
- Bt = t;
1770
+ Ft = e;
1771
1771
  }
1772
1772
  }
1773
- function Vt(e, t, n, i) {
1773
+ function Bt(t, e, n, i) {
1774
1774
  var v;
1775
- var s = (n & Yn) !== 0, r = (n & Kn) !== 0, o = (
1775
+ var s = (n & Kn) !== 0, r = (n & zn) !== 0, o = (
1776
1776
  /** @type {V} */
1777
1777
  i
1778
- ), l = !0, a = () => (l && (l = !1, o = r ? Ln(
1778
+ ), l = !0, u = () => (l && (l = !1, o = r ? An(
1779
1779
  /** @type {() => V} */
1780
1780
  i
1781
1781
  ) : (
1782
1782
  /** @type {V} */
1783
1783
  i
1784
- )), o), u;
1784
+ )), o), a;
1785
1785
  if (s) {
1786
- var c = ct in e || ii in e;
1787
- u = ((v = jt(e, t)) == null ? void 0 : v.set) ?? (c && t in e ? (p) => e[t] = p : void 0);
1786
+ var c = ft in t || si in t;
1787
+ a = ((v = Wt(t, e)) == null ? void 0 : v.set) ?? (c && e in t ? (h) => t[e] = h : void 0);
1788
1788
  }
1789
1789
  var d, f = !1;
1790
- s ? [d, f] = gs(() => (
1790
+ s ? [d, f] = ws(() => (
1791
1791
  /** @type {V} */
1792
- e[t]
1792
+ t[e]
1793
1793
  )) : d = /** @type {V} */
1794
- e[t], d === void 0 && i !== void 0 && (d = a(), u && (ci(), u(d)));
1795
- var h;
1796
- if (h = () => {
1797
- var p = (
1794
+ t[e], d === void 0 && i !== void 0 && (d = u(), a && (di(), a(d)));
1795
+ var p;
1796
+ if (p = () => {
1797
+ var h = (
1798
1798
  /** @type {V} */
1799
- e[t]
1799
+ t[e]
1800
1800
  );
1801
- return p === void 0 ? a() : (l = !0, p);
1802
- }, (n & Gn) === 0)
1803
- return h;
1804
- if (u) {
1805
- var C = e.$$legacy;
1801
+ return h === void 0 ? u() : (l = !0, h);
1802
+ }, (n & Yn) === 0)
1803
+ return p;
1804
+ if (a) {
1805
+ var _ = t.$$legacy;
1806
1806
  return (
1807
1807
  /** @type {() => V} */
1808
- (function(p, m) {
1809
- return arguments.length > 0 ? ((!m || C || f) && u(m ? h() : p), p) : h();
1808
+ (function(h, m) {
1809
+ return arguments.length > 0 ? ((!m || _ || f) && a(m ? p() : h), h) : p();
1810
1810
  })
1811
1811
  );
1812
1812
  }
1813
- var b = !1, g = ((n & jn) !== 0 ? Ne : Li)(() => (b = !1, h()));
1814
- s && I(g);
1813
+ var g = !1, b = ((n & Gn) !== 0 ? Ne : Si)(() => (g = !1, p()));
1814
+ s && I(b);
1815
1815
  var y = (
1816
1816
  /** @type {Effect} */
1817
- D
1817
+ N
1818
1818
  );
1819
1819
  return (
1820
1820
  /** @type {() => V} */
1821
- (function(p, m) {
1821
+ (function(h, m) {
1822
1822
  if (arguments.length > 0) {
1823
- const S = m ? I(g) : s ? wt(p) : p;
1824
- return W(g, S), b = !0, o !== void 0 && (o = S), p;
1823
+ const S = m ? I(b) : s ? It(h) : h;
1824
+ return V(b, S), g = !0, o !== void 0 && (o = S), h;
1825
1825
  }
1826
- return vt && b || (y.f & et) !== 0 ? g.v : I(g);
1826
+ return it && g || (y.f & J) !== 0 ? b.v : I(b);
1827
1827
  })
1828
1828
  );
1829
1829
  }
1830
- const bs = [
1830
+ const Is = [
1831
1831
  [
1832
1832
  "af",
1833
1833
  // Afghanistan
@@ -3504,18 +3504,18 @@ const bs = [
3504
3504
  null,
3505
3505
  "0"
3506
3506
  ]
3507
- ], Et = [];
3508
- for (const e of bs)
3509
- Et.push({
3507
+ ], Nt = [];
3508
+ for (const t of Is)
3509
+ Nt.push({
3510
3510
  name: "",
3511
3511
  // populated in the plugin
3512
- iso2: e[0],
3513
- dialCode: e[1],
3514
- priority: e[2] || 0,
3515
- areaCodes: e[3] || null,
3512
+ iso2: t[0],
3513
+ dialCode: t[1],
3514
+ priority: t[2] || 0,
3515
+ areaCodes: t[3] || null,
3516
3516
  nodeById: {},
3517
3517
  // populated by the plugin
3518
- nationalPrefix: e[4] || null,
3518
+ nationalPrefix: t[4] || null,
3519
3519
  normalisedName: "",
3520
3520
  // populated in the plugin
3521
3521
  initials: "",
@@ -3523,7 +3523,7 @@ for (const e of bs)
3523
3523
  dialCodePlus: ""
3524
3524
  // populated in the plugin
3525
3525
  });
3526
- const Wt = {
3526
+ const Vt = {
3527
3527
  OPEN_COUNTRY_DROPDOWN: "open:countrydropdown",
3528
3528
  CLOSE_COUNTRY_DROPDOWN: "close:countrydropdown",
3529
3529
  COUNTRY_CHANGE: "countrychange",
@@ -3537,7 +3537,7 @@ const Wt = {
3537
3537
  FLAG: "iti__flag",
3538
3538
  COUNTRY_ITEM: "iti__country",
3539
3539
  HIGHLIGHT: "iti__highlight"
3540
- }, x = {
3540
+ }, M = {
3541
3541
  ARROW_UP: "ArrowUp",
3542
3542
  ARROW_DOWN: "ArrowDown",
3543
3543
  SPACE: " ",
@@ -3547,7 +3547,7 @@ const Wt = {
3547
3547
  }, Ge = {
3548
3548
  PASTE: "insertFromPaste",
3549
3549
  DELETE_FWD: "deleteContentForward"
3550
- }, lt = {
3550
+ }, ut = {
3551
3551
  ALPHA_UNICODE: new RegExp("\\p{L}", "u"),
3552
3552
  // any kind of letter from any language
3553
3553
  NON_PLUS_NUMERIC: /[^+0-9]/,
@@ -3556,39 +3556,39 @@ const Wt = {
3556
3556
  // chars that are NOT + or digit (global)
3557
3557
  HIDDEN_SEARCH_CHAR: /^[a-zA-ZÀ-ÿа-яА-Я ]$/
3558
3558
  // single acceptable hidden-search char
3559
- }, ws = {
3559
+ }, Es = {
3560
3560
  HIDDEN_SEARCH_RESET_MS: 1e3
3561
3561
  }, Ye = {
3562
3562
  UNKNOWN_NUMBER_TYPE: -99,
3563
3563
  UNKNOWN_VALIDATION_ERROR: -99
3564
- }, re = {
3564
+ }, se = {
3565
3565
  SANE_SELECTED_WITH_DIAL_WIDTH: 78,
3566
3566
  // px width fallback when separateDialCode enabled
3567
3567
  SANE_SELECTED_NO_DIAL_WIDTH: 42,
3568
3568
  // px width fallback when no separate dial code
3569
3569
  INPUT_PADDING_EXTRA_LEFT: 6
3570
3570
  // px gap between selected country container and input text
3571
- }, Rn = {
3571
+ }, kn = {
3572
3572
  NANP: "1"
3573
3573
  // North American Numbering Plan
3574
- }, oe = {
3574
+ }, re = {
3575
3575
  DIAL_CODE: "44",
3576
3576
  // +44 United Kingdom
3577
3577
  MOBILE_PREFIX: "7",
3578
3578
  // UK mobile numbers start with 7 after national trunk (0) or core section
3579
3579
  MOBILE_CORE_LENGTH: 10
3580
3580
  // core number length (excluding dial code / national prefix) for mobiles
3581
- }, Is = {
3581
+ }, Ns = {
3582
3582
  ISO2: "us"
3583
- }, me = {
3583
+ }, ve = {
3584
3584
  AGGRESSIVE: "aggressive",
3585
3585
  POLITE: "polite"
3586
- }, le = {
3586
+ }, oe = {
3587
3587
  AUTO: "auto"
3588
3588
  }, Ke = {
3589
3589
  COUNTRY_CODE: "countryCode",
3590
3590
  DIAL_CODE: "dialCode"
3591
- }, L = {
3591
+ }, D = {
3592
3592
  EXPANDED: "aria-expanded",
3593
3593
  LABEL: "aria-label",
3594
3594
  SELECTED: "aria-selected",
@@ -3598,23 +3598,23 @@ const Wt = {
3598
3598
  HIDDEN: "aria-hidden",
3599
3599
  AUTOCOMPLETE: "aria-autocomplete",
3600
3600
  MODAL: "aria-modal"
3601
- }, Es = {
3601
+ }, Ds = {
3602
3602
  selectedCountryAriaLabel: "Change country, selected ${countryName} (${dialCode})",
3603
3603
  noCountrySelected: "Select country",
3604
3604
  countryListAriaLabel: "List of countries",
3605
3605
  searchPlaceholder: "Search",
3606
3606
  clearSearchAriaLabel: "Clear search",
3607
3607
  searchEmptyState: "No results found",
3608
- searchSummaryAria(e) {
3609
- return e === 0 ? "No results found" : e === 1 ? "1 result found" : `${e} results found`;
3608
+ searchSummaryAria(t) {
3609
+ return t === 0 ? "No results found" : t === 1 ? "1 result found" : `${t} results found`;
3610
3610
  }
3611
- }, ue = (e) => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(e).matches, Ns = () => {
3611
+ }, le = (t) => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(t).matches, Ls = () => {
3612
3612
  if (typeof navigator < "u" && typeof window < "u") {
3613
- const e = ue("(max-width: 500px)"), t = ue("(max-height: 600px)"), n = ue("(pointer: coarse)");
3614
- return e || n && t;
3613
+ const t = le("(max-width: 500px)"), e = le("(max-height: 600px)"), n = le("(pointer: coarse)");
3614
+ return t || n && e;
3615
3615
  }
3616
3616
  return !1;
3617
- }, kn = {
3617
+ }, Mn = {
3618
3618
  //* Whether or not to allow the dropdown.
3619
3619
  allowDropdown: !0,
3620
3620
  //* Whether or not to allow extensions after the main number.
@@ -3622,7 +3622,7 @@ const Wt = {
3622
3622
  // Allow alphanumeric "phonewords" (e.g. +1 800 FLOWERS) as valid numbers
3623
3623
  allowPhonewords: !1,
3624
3624
  //* Add a placeholder in the input with an example number for the selected country.
3625
- autoPlaceholder: me.POLITE,
3625
+ autoPlaceholder: ve.POLITE,
3626
3626
  //* Modify the parentClass.
3627
3627
  containerClass: "",
3628
3628
  //* Locale for localising country names via Intl.DisplayNames.
@@ -3666,112 +3666,112 @@ const Wt = {
3666
3666
  //* Only allow certain chars e.g. a plus followed by numeric digits, and cap at max valid length.
3667
3667
  strictMode: !1,
3668
3668
  //* Use full screen popup instead of dropdown for country list.
3669
- useFullscreenPopup: Ns(),
3669
+ useFullscreenPopup: Ls(),
3670
3670
  //* The number type to enforce during validation.
3671
3671
  allowedNumberTypes: ["MOBILE", "FIXED_LINE"]
3672
- }, Ds = (e) => {
3673
- e.useFullscreenPopup && (e.fixDropdownWidth = !1), e.onlyCountries.length === 1 && (e.initialCountry = e.onlyCountries[0]), e.separateDialCode && (e.nationalMode = !1), e.allowDropdown && !e.showFlags && !e.separateDialCode && (e.nationalMode = !1), e.useFullscreenPopup && !e.dropdownContainer && (e.dropdownContainer = document.body), e.i18n = { ...Es, ...e.i18n };
3674
- }, Gt = (e) => e.replace(/\D/g, ""), Mn = (e = "") => e.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase(), Ls = (e, t) => {
3675
- const n = Mn(t), i = [], s = [], r = [], o = [], l = [], a = [];
3676
- for (const c of e)
3677
- c.iso2 === n ? i.push(c) : c.normalisedName.startsWith(n) ? s.push(c) : c.normalisedName.includes(n) ? r.push(c) : n === c.dialCode || n === c.dialCodePlus ? o.push(c) : c.dialCodePlus.includes(n) ? l.push(c) : c.initials.includes(n) && a.push(c);
3678
- const u = (c, d) => c.priority - d.priority;
3672
+ }, As = (t) => {
3673
+ t.useFullscreenPopup && (t.fixDropdownWidth = !1), t.onlyCountries.length === 1 && (t.initialCountry = t.onlyCountries[0]), t.separateDialCode && (t.nationalMode = !1), t.allowDropdown && !t.showFlags && !t.separateDialCode && (t.nationalMode = !1), t.useFullscreenPopup && !t.dropdownContainer && (t.dropdownContainer = document.body), t.i18n = { ...Ds, ...t.i18n };
3674
+ }, jt = (t) => t.replace(/\D/g, ""), xn = (t = "") => t.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase(), Ts = (t, e) => {
3675
+ const n = xn(e), i = [], s = [], r = [], o = [], l = [], u = [];
3676
+ for (const c of t)
3677
+ c.iso2 === n ? i.push(c) : c.normalisedName.startsWith(n) ? s.push(c) : c.normalisedName.includes(n) ? r.push(c) : n === c.dialCode || n === c.dialCodePlus ? o.push(c) : c.dialCodePlus.includes(n) ? l.push(c) : c.initials.includes(n) && u.push(c);
3678
+ const a = (c, d) => c.priority - d.priority;
3679
3679
  return [
3680
- ...i.sort(u),
3681
- ...s.sort(u),
3682
- ...r.sort(u),
3683
- ...o.sort(u),
3684
- ...l.sort(u),
3685
- ...a.sort(u)
3680
+ ...i.sort(a),
3681
+ ...s.sort(a),
3682
+ ...r.sort(a),
3683
+ ...o.sort(a),
3684
+ ...l.sort(a),
3685
+ ...u.sort(a)
3686
3686
  ];
3687
- }, As = (e, t) => {
3688
- const n = t.toLowerCase();
3689
- for (const i of e)
3687
+ }, Ss = (t, e) => {
3688
+ const n = e.toLowerCase();
3689
+ for (const i of t)
3690
3690
  if (i.name.toLowerCase().startsWith(n))
3691
3691
  return i;
3692
3692
  return null;
3693
- }, ae = (e) => Object.keys(e).filter((t) => !!e[t]).join(" "), T = (e, t, n) => {
3694
- const i = document.createElement(e);
3695
- return t && Object.entries(t).forEach(
3693
+ }, ue = (t) => Object.keys(t).filter((e) => !!t[e]).join(" "), A = (t, e, n) => {
3694
+ const i = document.createElement(t);
3695
+ return e && Object.entries(e).forEach(
3696
3696
  ([s, r]) => i.setAttribute(s, r)
3697
3697
  ), n && n.appendChild(i), i;
3698
- }, Ts = () => `
3699
- <svg class="iti__search-icon-svg" width="14" height="14" viewBox="0 0 24 24" focusable="false" ${L.HIDDEN}="true">
3698
+ }, Ps = () => `
3699
+ <svg class="iti__search-icon-svg" width="14" height="14" viewBox="0 0 24 24" focusable="false" ${D.HIDDEN}="true">
3700
3700
  <circle cx="11" cy="11" r="7" />
3701
3701
  <line x1="21" y1="21" x2="16.65" y2="16.65" />
3702
- </svg>`, Ss = (e) => {
3703
- const t = `iti-${e}-clear-mask`;
3702
+ </svg>`, Os = (t) => {
3703
+ const e = `iti-${t}-clear-mask`;
3704
3704
  return `
3705
- <svg class="iti__search-clear-svg" width="12" height="12" viewBox="0 0 16 16" ${L.HIDDEN}="true" focusable="false">
3706
- <mask id="${t}" maskUnits="userSpaceOnUse">
3705
+ <svg class="iti__search-clear-svg" width="12" height="12" viewBox="0 0 16 16" ${D.HIDDEN}="true" focusable="false">
3706
+ <mask id="${e}" maskUnits="userSpaceOnUse">
3707
3707
  <rect width="16" height="16" fill="white" />
3708
3708
  <path d="M5.2 5.2 L10.8 10.8 M10.8 5.2 L5.2 10.8" stroke="black" stroke-linecap="round" class="iti__search-clear-x" />
3709
3709
  </mask>
3710
- <circle cx="8" cy="8" r="8" class="iti__search-clear-bg" mask="url(#${t})" />
3710
+ <circle cx="8" cy="8" r="8" class="iti__search-clear-bg" mask="url(#${e})" />
3711
3711
  </svg>`;
3712
- }, Ps = () => `
3712
+ }, Rs = () => `
3713
3713
  <svg width="256" height="256" viewBox="0 0 512 512" class="iti__globe-svg">
3714
3714
  <path d="M508 213a240 240 0 0 0-449-87l-2 5-2 5c-8 14-13 30-17 46a65 65 0 0 1 56 4c16-10 35-19 56-27l9-3c-6 23-10 48-10 74h-16l4 6c3 4 5 8 6 13h6c0 22 3 44 8 65l2 10-25-10-4 5 12 18 9 3 6 2 8 3 9 26 1 2 16-7h1l-5-13-1-2c24 6 49 9 75 10v26l11 10 7 7v-30l1-13c22 0 44-3 65-8l10-2-21 48-1 1a317 317 0 0 1-14 23l-21 5h-2c6 16 7 33 1 50a240 240 0 0 0 211-265m-401-56-11 6c19-44 54-79 98-98-11 20-21 44-29 69-21 6-40 15-58 23m154 182v4c-29-1-57-6-81-13-7-25-12-52-13-81h94zm0-109h-94c1-29 6-56 13-81 24-7 52-12 81-13zm0-112c-22 1-44 4-65 8l-10 2 12-30 9-17 1-2a332 332 0 0 1 13-23c13-4 26-6 40-7zm187 69 6 4c4 12 6 25 6 38v1h-68c-1-26-4-51-10-74l48 20 1 1 14 8zm-14-44 10 20c-20-11-43-21-68-29-8-25-18-49-29-69 37 16 67 44 87 78M279 49h1c13 1 27 3 39 7l14 23 1 2a343 343 0 0 1 12 26l2 5 6 16c-23-6-48-9-74-10h-1zm0 87h1c29 1 56 6 81 13 7 24 12 51 12 80v1h-94zm2 207h-2v-94h95c-1 29-6 56-13 81-24 7-51 12-80 13m86 60-20 10c11-20 21-43 29-68 25-8 48-18 68-29-16 37-43 67-77 87m87-115-7 5-16 9-2 1a337 337 0 0 1-47 21c6-24 9-49 10-75h68c0 13-2 27-6 39"/>
3715
3715
  <path d="m261 428-2-2-22-21a40 40 0 0 0-32-11h-1a37 37 0 0 0-18 8l-1 1-4 2-2 2-5 4c-9-3-36-31-47-44s-32-45-34-55l3-2a151 151 0 0 0 11-9v-1a39 39 0 0 0 5-48l-3-3-11-19-3-4-5-7h-1l-3-3-4-3-5-2a35 35 0 0 0-16-3h-5c-4 1-14 5-24 11l-4 2-4 3-4 2c-9 8-17 17-18 27a380 380 0 0 0 212 259h3c12 0 25-10 36-21l10-12 6-11a39 39 0 0 0-8-40"/>
3716
3716
  </svg>`;
3717
- class Os {
3718
- constructor(t, n, i) {
3719
- this.highlightedItem = null, this.selectedItem = null, t.dataset.intlTelInputId = i.toString(), this.telInput = t, this.options = n, this.id = i, this.hadInitialPlaceholder = !!t.getAttribute("placeholder"), this.isRTL = !!this.telInput.closest("[dir=rtl]"), this.options.separateDialCode && (this.originalPaddingLeft = this.telInput.style.paddingLeft);
3717
+ class ks {
3718
+ constructor(e, n, i) {
3719
+ this.highlightedItem = null, this.selectedItem = null, e.dataset.intlTelInputId = i.toString(), this.telInput = e, this.options = n, this.id = i, this.hadInitialPlaceholder = !!e.getAttribute("placeholder"), this.isRTL = !!this.telInput.closest("[dir=rtl]"), this.options.separateDialCode && (this.originalPaddingLeft = this.telInput.style.paddingLeft);
3720
3720
  }
3721
3721
  //* Generate all of the markup for the plugin: the selected country overlay, and the dropdown.
3722
- generateMarkup(t) {
3723
- this.countries = t, this.telInput.classList.add("iti__tel-input");
3722
+ generateMarkup(e) {
3723
+ this.countries = e, this.telInput.classList.add("iti__tel-input");
3724
3724
  const n = this._createWrapperAndInsert();
3725
3725
  this._maybeBuildCountryContainer(n), n.appendChild(this.telInput), this._maybeUpdateInputPaddingAndReveal(), this._maybeBuildHiddenInputs(n);
3726
3726
  }
3727
3727
  _createWrapperAndInsert() {
3728
- const { allowDropdown: t, showFlags: n, containerClass: i, useFullscreenPopup: s } = this.options, r = ae({
3728
+ const { allowDropdown: e, showFlags: n, containerClass: i, useFullscreenPopup: s } = this.options, r = ue({
3729
3729
  iti: !0,
3730
- "iti--allow-dropdown": t,
3730
+ "iti--allow-dropdown": e,
3731
3731
  "iti--show-flags": n,
3732
3732
  "iti--inline-dropdown": !s,
3733
3733
  [i]: !!i
3734
- }), o = T("div", { class: r });
3734
+ }), o = A("div", { class: r });
3735
3735
  return this.isRTL && o.setAttribute("dir", "ltr"), this.telInput.before(o), o;
3736
3736
  }
3737
- _maybeBuildCountryContainer(t) {
3737
+ _maybeBuildCountryContainer(e) {
3738
3738
  const { allowDropdown: n, separateDialCode: i, showFlags: s } = this.options;
3739
3739
  if (n || s || i) {
3740
- this.countryContainer = T(
3740
+ this.countryContainer = A(
3741
3741
  "div",
3742
3742
  // visibly hidden until we measure it's width to set the input padding correctly
3743
3743
  { class: `iti__country-container ${E.V_HIDE}` },
3744
- t
3745
- ), n ? (this.selectedCountry = T(
3744
+ e
3745
+ ), n ? (this.selectedCountry = A(
3746
3746
  "button",
3747
3747
  {
3748
3748
  type: "button",
3749
3749
  class: "iti__selected-country",
3750
- [L.EXPANDED]: "false",
3751
- [L.LABEL]: this.options.i18n.noCountrySelected,
3752
- [L.HASPOPUP]: "dialog",
3753
- [L.CONTROLS]: `iti-${this.id}__dropdown-content`
3750
+ [D.EXPANDED]: "false",
3751
+ [D.LABEL]: this.options.i18n.noCountrySelected,
3752
+ [D.HASPOPUP]: "dialog",
3753
+ [D.CONTROLS]: `iti-${this.id}__dropdown-content`
3754
3754
  },
3755
3755
  this.countryContainer
3756
- ), this.telInput.disabled && this.selectedCountry.setAttribute("disabled", "true")) : this.selectedCountry = T(
3756
+ ), this.telInput.disabled && this.selectedCountry.setAttribute("disabled", "true")) : this.selectedCountry = A(
3757
3757
  "div",
3758
3758
  { class: "iti__selected-country" },
3759
3759
  this.countryContainer
3760
3760
  );
3761
- const r = T(
3761
+ const r = A(
3762
3762
  "div",
3763
3763
  { class: "iti__selected-country-primary" },
3764
3764
  this.selectedCountry
3765
3765
  );
3766
- this.selectedCountryInner = T(
3766
+ this.selectedCountryInner = A(
3767
3767
  "div",
3768
3768
  { class: E.FLAG },
3769
3769
  r
3770
- ), n && (this.dropdownArrow = T(
3770
+ ), n && (this.dropdownArrow = A(
3771
3771
  "div",
3772
- { class: "iti__arrow", [L.HIDDEN]: "true" },
3772
+ { class: "iti__arrow", [D.HIDDEN]: "true" },
3773
3773
  r
3774
- )), i && (this.selectedDialCode = T(
3774
+ )), i && (this.selectedDialCode = A(
3775
3775
  "div",
3776
3776
  { class: "iti__selected-dial-code" },
3777
3777
  this.selectedCountry
@@ -3780,96 +3780,96 @@ class Os {
3780
3780
  }
3781
3781
  _buildDropdownContent() {
3782
3782
  const {
3783
- fixDropdownWidth: t,
3783
+ fixDropdownWidth: e,
3784
3784
  useFullscreenPopup: n,
3785
3785
  countrySearch: i,
3786
3786
  i18n: s,
3787
3787
  dropdownContainer: r,
3788
3788
  containerClass: o
3789
- } = this.options, l = t ? "" : "iti--flexible-dropdown-width";
3790
- if (this.dropdownContent = T("div", {
3789
+ } = this.options, l = e ? "" : "iti--flexible-dropdown-width";
3790
+ if (this.dropdownContent = A("div", {
3791
3791
  id: `iti-${this.id}__dropdown-content`,
3792
3792
  class: `iti__dropdown-content ${E.HIDE} ${l}`,
3793
3793
  role: "dialog",
3794
- [L.MODAL]: "true"
3795
- }), this.isRTL && this.dropdownContent.setAttribute("dir", "rtl"), i && this._buildSearchUI(), this.countryList = T(
3794
+ [D.MODAL]: "true"
3795
+ }), this.isRTL && this.dropdownContent.setAttribute("dir", "rtl"), i && this._buildSearchUI(), this.countryList = A(
3796
3796
  "ul",
3797
3797
  {
3798
3798
  class: "iti__country-list",
3799
3799
  id: `iti-${this.id}__country-listbox`,
3800
3800
  role: "listbox",
3801
- [L.LABEL]: s.countryListAriaLabel
3801
+ [D.LABEL]: s.countryListAriaLabel
3802
3802
  },
3803
3803
  this.dropdownContent
3804
3804
  ), this._appendListItems(), i && this.updateSearchResultsA11yText(), r) {
3805
- const a = ae({
3805
+ const u = ue({
3806
3806
  iti: !0,
3807
3807
  "iti--container": !0,
3808
3808
  "iti--fullscreen-popup": n,
3809
3809
  "iti--inline-dropdown": !n,
3810
3810
  [o]: !!o
3811
3811
  });
3812
- this.dropdown = T("div", { class: a }), this.dropdown.appendChild(this.dropdownContent);
3812
+ this.dropdown = A("div", { class: u }), this.dropdown.appendChild(this.dropdownContent);
3813
3813
  } else
3814
3814
  this.countryContainer.appendChild(this.dropdownContent);
3815
3815
  }
3816
3816
  _buildSearchUI() {
3817
- const { i18n: t } = this.options, n = T(
3817
+ const { i18n: e } = this.options, n = A(
3818
3818
  "div",
3819
3819
  { class: "iti__search-input-wrapper" },
3820
3820
  this.dropdownContent
3821
3821
  );
3822
- this.searchIcon = T(
3822
+ this.searchIcon = A(
3823
3823
  "span",
3824
3824
  {
3825
3825
  class: "iti__search-icon",
3826
- [L.HIDDEN]: "true"
3826
+ [D.HIDDEN]: "true"
3827
3827
  },
3828
3828
  n
3829
- ), this.searchIcon.innerHTML = Ts(), this.searchInput = T(
3829
+ ), this.searchIcon.innerHTML = Ps(), this.searchInput = A(
3830
3830
  "input",
3831
3831
  {
3832
3832
  id: `iti-${this.id}__search-input`,
3833
3833
  // Chrome says inputs need either a name or an id
3834
3834
  type: "search",
3835
3835
  class: "iti__search-input",
3836
- placeholder: t.searchPlaceholder,
3836
+ placeholder: e.searchPlaceholder,
3837
3837
  // role=combobox + aria-autocomplete=list + aria-activedescendant allows maintaining focus on the search input while allowing users to navigate search results with up/down keyboard keys
3838
3838
  role: "combobox",
3839
- [L.EXPANDED]: "true",
3840
- [L.LABEL]: t.searchPlaceholder,
3841
- [L.CONTROLS]: `iti-${this.id}__country-listbox`,
3842
- [L.AUTOCOMPLETE]: "list",
3839
+ [D.EXPANDED]: "true",
3840
+ [D.LABEL]: e.searchPlaceholder,
3841
+ [D.CONTROLS]: `iti-${this.id}__country-listbox`,
3842
+ [D.AUTOCOMPLETE]: "list",
3843
3843
  autocomplete: "off"
3844
3844
  },
3845
3845
  n
3846
- ), this.searchClearButton = T(
3846
+ ), this.searchClearButton = A(
3847
3847
  "button",
3848
3848
  {
3849
3849
  type: "button",
3850
3850
  class: `iti__search-clear ${E.HIDE}`,
3851
- [L.LABEL]: t.clearSearchAriaLabel,
3851
+ [D.LABEL]: e.clearSearchAriaLabel,
3852
3852
  tabindex: "-1"
3853
3853
  },
3854
3854
  n
3855
- ), this.searchClearButton.innerHTML = Ss(this.id), this.searchResultsA11yText = T(
3855
+ ), this.searchClearButton.innerHTML = Os(this.id), this.searchResultsA11yText = A(
3856
3856
  "span",
3857
3857
  { class: "iti__a11y-text" },
3858
3858
  this.dropdownContent
3859
- ), this.searchNoResults = T(
3859
+ ), this.searchNoResults = A(
3860
3860
  "div",
3861
3861
  {
3862
3862
  class: `iti__no-results ${E.HIDE}`,
3863
- [L.HIDDEN]: "true"
3863
+ [D.HIDDEN]: "true"
3864
3864
  // all a11y messaging happens in this.searchResultsA11yText
3865
3865
  },
3866
3866
  this.dropdownContent
3867
- ), this.searchNoResults.textContent = t.searchEmptyState;
3867
+ ), this.searchNoResults.textContent = e.searchEmptyState;
3868
3868
  }
3869
3869
  _maybeUpdateInputPaddingAndReveal() {
3870
3870
  this.countryContainer && (this.updateInputPadding(), this.countryContainer.classList.remove(E.V_HIDE));
3871
3871
  }
3872
- _maybeBuildHiddenInputs(t) {
3872
+ _maybeBuildHiddenInputs(e) {
3873
3873
  var i, s;
3874
3874
  const { hiddenInput: n } = this.options;
3875
3875
  if (n) {
@@ -3878,47 +3878,47 @@ class Os {
3878
3878
  const l = (i = this.telInput.form) == null ? void 0 : i.querySelector(
3879
3879
  `input[name="${o.phone}"]`
3880
3880
  );
3881
- l ? this.hiddenInput = l : (this.hiddenInput = T("input", {
3881
+ l ? this.hiddenInput = l : (this.hiddenInput = A("input", {
3882
3882
  type: "hidden",
3883
3883
  name: o.phone
3884
- }), t.appendChild(this.hiddenInput));
3884
+ }), e.appendChild(this.hiddenInput));
3885
3885
  }
3886
3886
  if (o.country) {
3887
3887
  const l = (s = this.telInput.form) == null ? void 0 : s.querySelector(
3888
3888
  `input[name="${o.country}"]`
3889
3889
  );
3890
- l ? this.hiddenInputCountry = l : (this.hiddenInputCountry = T("input", {
3890
+ l ? this.hiddenInputCountry = l : (this.hiddenInputCountry = A("input", {
3891
3891
  type: "hidden",
3892
3892
  name: o.country
3893
- }), t.appendChild(this.hiddenInputCountry));
3893
+ }), e.appendChild(this.hiddenInputCountry));
3894
3894
  }
3895
3895
  }
3896
3896
  }
3897
3897
  //* For each country: add a country list item <li> to the countryList <ul> container.
3898
3898
  _appendListItems() {
3899
- const t = document.createDocumentFragment();
3899
+ const e = document.createDocumentFragment();
3900
3900
  for (let n = 0; n < this.countries.length; n++) {
3901
- const i = this.countries[n], s = ae({
3901
+ const i = this.countries[n], s = ue({
3902
3902
  [E.COUNTRY_ITEM]: !0
3903
- }), r = T("li", {
3903
+ }), r = A("li", {
3904
3904
  id: `iti-${this.id}__item-${i.iso2}`,
3905
3905
  class: s,
3906
3906
  tabindex: "-1",
3907
3907
  role: "option",
3908
- [L.SELECTED]: "false"
3908
+ [D.SELECTED]: "false"
3909
3909
  });
3910
- r.dataset.dialCode = i.dialCode, r.dataset.countryCode = i.iso2, i.nodeById[this.id] = r, this.options.showFlags && T("div", { class: `${E.FLAG} iti__${i.iso2}` }, r);
3911
- const o = T("span", { class: "iti__country-name" }, r);
3910
+ r.dataset.dialCode = i.dialCode, r.dataset.countryCode = i.iso2, i.nodeById[this.id] = r, this.options.showFlags && A("div", { class: `${E.FLAG} iti__${i.iso2}` }, r);
3911
+ const o = A("span", { class: "iti__country-name" }, r);
3912
3912
  o.textContent = i.name;
3913
- const l = T("span", { class: "iti__dial-code" }, r);
3914
- this.isRTL && l.setAttribute("dir", "ltr"), l.textContent = `+${i.dialCode}`, t.appendChild(r);
3913
+ const l = A("span", { class: "iti__dial-code" }, r);
3914
+ this.isRTL && l.setAttribute("dir", "ltr"), l.textContent = `+${i.dialCode}`, e.appendChild(r);
3915
3915
  }
3916
- this.countryList.appendChild(t);
3916
+ this.countryList.appendChild(e);
3917
3917
  }
3918
3918
  //* Update the input padding to make space for the selected country/dial code.
3919
3919
  updateInputPadding() {
3920
3920
  if (this.selectedCountry) {
3921
- const t = this.options.separateDialCode ? re.SANE_SELECTED_WITH_DIAL_WIDTH : re.SANE_SELECTED_NO_DIAL_WIDTH, i = (this.selectedCountry.offsetWidth || this._getHiddenSelectedCountryWidth() || t) + re.INPUT_PADDING_EXTRA_LEFT;
3921
+ const e = this.options.separateDialCode ? se.SANE_SELECTED_WITH_DIAL_WIDTH : se.SANE_SELECTED_NO_DIAL_WIDTH, i = (this.selectedCountry.offsetWidth || this._getHiddenSelectedCountryWidth() || e) + se.INPUT_PADDING_EXTRA_LEFT;
3922
3922
  this.telInput.style.paddingLeft = `${i}px`;
3923
3923
  }
3924
3924
  }
@@ -3928,16 +3928,16 @@ class Os {
3928
3928
  //* and then to inject a deep clone of the selectedCountry element.
3929
3929
  _getHiddenSelectedCountryWidth() {
3930
3930
  if (this.telInput.parentNode) {
3931
- let t;
3931
+ let e;
3932
3932
  try {
3933
- t = window.top.document.body;
3933
+ e = window.top.document.body;
3934
3934
  } catch {
3935
- t = document.body;
3935
+ e = document.body;
3936
3936
  }
3937
3937
  const n = this.telInput.parentNode.cloneNode(
3938
3938
  !1
3939
3939
  );
3940
- n.style.visibility = "hidden", t.appendChild(n);
3940
+ n.style.visibility = "hidden", e.appendChild(n);
3941
3941
  const i = this.countryContainer.cloneNode();
3942
3942
  n.appendChild(i);
3943
3943
  const s = this.selectedCountry.cloneNode(
@@ -3945,47 +3945,47 @@ class Os {
3945
3945
  );
3946
3946
  i.appendChild(s);
3947
3947
  const r = s.offsetWidth;
3948
- return t.removeChild(n), r;
3948
+ return e.removeChild(n), r;
3949
3949
  }
3950
3950
  return 0;
3951
3951
  }
3952
3952
  //* Update search results text (for a11y).
3953
3953
  updateSearchResultsA11yText() {
3954
- const { i18n: t } = this.options, n = this.countryList.childElementCount;
3955
- this.searchResultsA11yText.textContent = t.searchSummaryAria(n);
3954
+ const { i18n: e } = this.options, n = this.countryList.childElementCount;
3955
+ this.searchResultsA11yText.textContent = e.searchSummaryAria(n);
3956
3956
  }
3957
3957
  //* Check if an element is visible within it's container, else scroll until it is.
3958
- scrollTo(t) {
3959
- const n = this.countryList, i = document.documentElement.scrollTop, s = n.offsetHeight, r = n.getBoundingClientRect().top + i, o = r + s, l = t.offsetHeight, a = t.getBoundingClientRect().top + i, u = a + l, c = a - r + n.scrollTop;
3960
- if (a < r)
3958
+ scrollTo(e) {
3959
+ const n = this.countryList, i = document.documentElement.scrollTop, s = n.offsetHeight, r = n.getBoundingClientRect().top + i, o = r + s, l = e.offsetHeight, u = e.getBoundingClientRect().top + i, a = u + l, c = u - r + n.scrollTop;
3960
+ if (u < r)
3961
3961
  n.scrollTop = c;
3962
- else if (u > o) {
3962
+ else if (a > o) {
3963
3963
  const d = s - l;
3964
3964
  n.scrollTop = c - d;
3965
3965
  }
3966
3966
  }
3967
3967
  //* Remove highlighting from the previous list item and highlight the new one.
3968
- highlightListItem(t, n) {
3968
+ highlightListItem(e, n) {
3969
3969
  const i = this.highlightedItem;
3970
- if (i && i.classList.remove(E.HIGHLIGHT), this.highlightedItem = t, this.highlightedItem && (this.highlightedItem.classList.add(E.HIGHLIGHT), this.options.countrySearch)) {
3970
+ if (i && i.classList.remove(E.HIGHLIGHT), this.highlightedItem = e, this.highlightedItem && (this.highlightedItem.classList.add(E.HIGHLIGHT), this.options.countrySearch)) {
3971
3971
  const s = this.highlightedItem.getAttribute("id") || "";
3972
- this.searchInput.setAttribute(L.ACTIVE_DESCENDANT, s);
3972
+ this.searchInput.setAttribute(D.ACTIVE_DESCENDANT, s);
3973
3973
  }
3974
3974
  n && this.highlightedItem.focus();
3975
3975
  }
3976
- updateSelectedItem(t) {
3977
- if (this.selectedItem && this.selectedItem.dataset.countryCode !== t && (this.selectedItem.setAttribute(L.SELECTED, "false"), this.selectedItem = null), t && !this.selectedItem) {
3976
+ updateSelectedItem(e) {
3977
+ if (this.selectedItem && this.selectedItem.dataset.countryCode !== e && (this.selectedItem.setAttribute(D.SELECTED, "false"), this.selectedItem = null), e && !this.selectedItem) {
3978
3978
  const n = this.countryList.querySelector(
3979
- `[data-country-code="${t}"]`
3979
+ `[data-country-code="${e}"]`
3980
3980
  );
3981
- n && (n.setAttribute(L.SELECTED, "true"), this.selectedItem = n);
3981
+ n && (n.setAttribute(D.SELECTED, "true"), this.selectedItem = n);
3982
3982
  }
3983
3983
  }
3984
3984
  //* Country search: Filter the country list to the given array of countries.
3985
- filterCountries(t) {
3985
+ filterCountries(e) {
3986
3986
  this.countryList.innerHTML = "";
3987
3987
  let n = !0;
3988
- for (const i of t) {
3988
+ for (const i of e) {
3989
3989
  const s = i.nodeById[this.id];
3990
3990
  s && (this.countryList.appendChild(s), n && (this.highlightListItem(s, !1), n = !1));
3991
3991
  }
@@ -3993,102 +3993,108 @@ class Os {
3993
3993
  }
3994
3994
  destroy() {
3995
3995
  this.telInput.iti = void 0, delete this.telInput.dataset.intlTelInputId, this.options.separateDialCode && (this.telInput.style.paddingLeft = this.originalPaddingLeft);
3996
- const t = this.telInput.parentNode;
3997
- t.before(this.telInput), t.remove(), this.telInput = null, this.countryContainer = null, this.selectedCountry = null, this.selectedCountryInner = null, this.selectedDialCode = null, this.dropdownArrow = null, this.dropdownContent = null, this.searchInput = null, this.searchIcon = null, this.searchClearButton = null, this.searchNoResults = null, this.searchResultsA11yText = null, this.countryList = null, this.dropdown = null, this.hiddenInput = null, this.hiddenInputCountry = null, this.highlightedItem = null, this.selectedItem = null;
3996
+ const e = this.telInput.parentNode;
3997
+ e.before(this.telInput), e.remove(), this.telInput = null, this.countryContainer = null, this.selectedCountry = null, this.selectedCountryInner = null, this.selectedDialCode = null, this.dropdownArrow = null, this.dropdownContent = null, this.searchInput = null, this.searchIcon = null, this.searchClearButton = null, this.searchNoResults = null, this.searchResultsA11yText = null, this.countryList = null, this.dropdown = null, this.hiddenInput = null, this.hiddenInputCountry = null, this.highlightedItem = null, this.selectedItem = null;
3998
3998
  for (const n of this.countries)
3999
3999
  delete n.nodeById[this.id];
4000
4000
  this.countries = null;
4001
4001
  }
4002
4002
  }
4003
- const Rs = (e) => {
4004
- const { onlyCountries: t, excludeCountries: n } = e;
4005
- if (t.length) {
4006
- const i = t.map(
4003
+ const Ms = (t) => {
4004
+ const { onlyCountries: e, excludeCountries: n } = t;
4005
+ if (e.length) {
4006
+ const i = e.map(
4007
4007
  (s) => s.toLowerCase()
4008
4008
  );
4009
- return Et.filter(
4009
+ return Nt.filter(
4010
4010
  (s) => i.includes(s.iso2)
4011
4011
  );
4012
4012
  } else if (n.length) {
4013
4013
  const i = n.map(
4014
4014
  (s) => s.toLowerCase()
4015
4015
  );
4016
- return Et.filter(
4016
+ return Nt.filter(
4017
4017
  (s) => !i.includes(s.iso2)
4018
4018
  );
4019
4019
  }
4020
- return Et;
4021
- }, ks = (e, t) => {
4022
- const { countryNameLocale: n, i18n: i } = t, r = typeof Intl < "u" && typeof Intl.DisplayNames == "function" ? new Intl.DisplayNames(n, {
4023
- type: "region"
4024
- }) : null;
4025
- for (const o of e)
4026
- o.name = i[o.iso2] || (r == null ? void 0 : r.of(o.iso2.toUpperCase()));
4027
- }, Ms = (e) => {
4028
- const t = /* @__PURE__ */ new Set();
4020
+ return Nt;
4021
+ }, xs = (t, e) => {
4022
+ const { countryNameLocale: n, i18n: i } = e;
4023
+ let s;
4024
+ try {
4025
+ typeof Intl < "u" && typeof Intl.DisplayNames == "function" ? s = new Intl.DisplayNames(n, {
4026
+ type: "region"
4027
+ }) : s = null;
4028
+ } catch (r) {
4029
+ console.error(r), s = null;
4030
+ }
4031
+ for (const r of t)
4032
+ r.name = i[r.iso2] || (s == null ? void 0 : s.of(r.iso2.toUpperCase())) || "";
4033
+ }, Us = (t) => {
4034
+ const e = /* @__PURE__ */ new Set();
4029
4035
  let n = 0;
4030
4036
  const i = {}, s = (o, l) => {
4031
4037
  if (!o || !l)
4032
4038
  return;
4033
4039
  l.length > n && (n = l.length), i.hasOwnProperty(l) || (i[l] = []);
4034
- const a = i[l];
4035
- a.includes(o) || a.push(o);
4036
- }, r = [...e].sort((o, l) => o.priority - l.priority);
4040
+ const u = i[l];
4041
+ u.includes(o) || u.push(o);
4042
+ }, r = [...t].sort((o, l) => o.priority - l.priority);
4037
4043
  for (const o of r) {
4038
- t.has(o.dialCode) || t.add(o.dialCode);
4044
+ e.has(o.dialCode) || e.add(o.dialCode);
4039
4045
  for (let l = 1; l < o.dialCode.length; l++) {
4040
- const a = o.dialCode.substring(0, l);
4041
- s(o.iso2, a);
4046
+ const u = o.dialCode.substring(0, l);
4047
+ s(o.iso2, u);
4042
4048
  }
4043
4049
  if (s(o.iso2, o.dialCode), o.areaCodes) {
4044
4050
  const l = i[o.dialCode][0];
4045
- for (const a of o.areaCodes) {
4046
- for (let u = 1; u < a.length; u++) {
4047
- const c = a.substring(0, u), d = o.dialCode + c;
4051
+ for (const u of o.areaCodes) {
4052
+ for (let a = 1; a < u.length; a++) {
4053
+ const c = u.substring(0, a), d = o.dialCode + c;
4048
4054
  s(l, d), s(o.iso2, d);
4049
4055
  }
4050
- s(o.iso2, o.dialCode + a);
4056
+ s(o.iso2, o.dialCode + u);
4051
4057
  }
4052
4058
  }
4053
4059
  }
4054
- return { dialCodes: t, dialCodeMaxLen: n, dialCodeToIso2Map: i };
4055
- }, xs = (e, t) => {
4056
- t.countryOrder && (t.countryOrder = t.countryOrder.map(
4060
+ return { dialCodes: e, dialCodeMaxLen: n, dialCodeToIso2Map: i };
4061
+ }, Hs = (t, e) => {
4062
+ e.countryOrder && (e.countryOrder = e.countryOrder.map(
4057
4063
  (n) => n.toLowerCase()
4058
- )), e.sort((n, i) => {
4059
- const { countryOrder: s } = t;
4064
+ )), t.sort((n, i) => {
4065
+ const { countryOrder: s } = e;
4060
4066
  if (s) {
4061
- const r = s.indexOf(n.iso2), o = s.indexOf(i.iso2), l = r > -1, a = o > -1;
4062
- if (l || a)
4063
- return l && a ? r - o : l ? -1 : 1;
4067
+ const r = s.indexOf(n.iso2), o = s.indexOf(i.iso2), l = r > -1, u = o > -1;
4068
+ if (l || u)
4069
+ return l && u ? r - o : l ? -1 : 1;
4064
4070
  }
4065
4071
  return n.name.localeCompare(i.name);
4066
4072
  });
4067
- }, Us = (e) => {
4068
- for (const t of e)
4069
- t.normalisedName = Mn(t.name), t.initials = t.normalisedName.split(/[^a-z]/).map((n) => n[0]).join(""), t.dialCodePlus = `+${t.dialCode}`;
4070
- }, ze = (e, t, n, i) => {
4071
- let s = e;
4072
- if (n && t) {
4073
+ }, Fs = (t) => {
4074
+ for (const e of t)
4075
+ e.normalisedName = xn(e.name), e.initials = e.normalisedName.split(/[^a-z]/).map((n) => n[0]).join(""), e.dialCodePlus = `+${e.dialCode}`;
4076
+ }, ze = (t, e, n, i) => {
4077
+ let s = t;
4078
+ if (n && e) {
4073
4079
  const r = `+${i.dialCode}`, o = s[r.length] === " " || s[r.length] === "-" ? r.length + 1 : r.length;
4074
4080
  s = s.substring(o);
4075
4081
  }
4076
4082
  return s;
4077
- }, Hs = (e, t, n, i, s) => {
4078
- const r = n ? n.formatNumberAsYouType(e, i.iso2) : e, { dialCode: o } = i;
4079
- return s && t.charAt(0) !== "+" && r.includes(`+${o}`) ? (r.split(`+${o}`)[1] || "").trim() : r;
4080
- }, Fs = (e, t, n, i) => {
4083
+ }, Bs = (t, e, n, i, s) => {
4084
+ const r = n ? n.formatNumberAsYouType(t, i.iso2) : t, { dialCode: o } = i;
4085
+ return s && e.charAt(0) !== "+" && r.includes(`+${o}`) ? (r.split(`+${o}`)[1] || "").trim() : r;
4086
+ }, Vs = (t, e, n, i) => {
4081
4087
  if (n === 0 && !i)
4082
4088
  return 0;
4083
4089
  let s = 0;
4084
- for (let r = 0; r < t.length; r++) {
4085
- if (/[+0-9]/.test(t[r]) && s++, s === e && !i)
4090
+ for (let r = 0; r < e.length; r++) {
4091
+ if (/[+0-9]/.test(e[r]) && s++, s === t && !i)
4086
4092
  return r + 1;
4087
- if (i && s === e + 1)
4093
+ if (i && s === t + 1)
4088
4094
  return r;
4089
4095
  }
4090
- return t.length;
4091
- }, Bs = [
4096
+ return e.length;
4097
+ }, Ws = [
4092
4098
  "800",
4093
4099
  "822",
4094
4100
  "833",
@@ -4106,20 +4112,20 @@ const Rs = (e) => {
4106
4112
  "887",
4107
4113
  "888",
4108
4114
  "889"
4109
- ], qe = (e) => {
4110
- const t = Gt(e);
4111
- if (t.startsWith(Rn.NANP) && t.length >= 4) {
4112
- const n = t.substring(1, 4);
4113
- return Bs.includes(n);
4115
+ ], qe = (t) => {
4116
+ const e = jt(t);
4117
+ if (e.startsWith(kn.NANP) && e.length >= 4) {
4118
+ const n = e.substring(1, 4);
4119
+ return Ws.includes(n);
4114
4120
  }
4115
4121
  return !1;
4116
4122
  };
4117
- let Vs = 0;
4118
- const Ws = new Set(Et.map((e) => e.iso2)), ce = (e) => Ws.has(e);
4123
+ let js = 0;
4124
+ const Gs = new Set(Nt.map((t) => t.iso2)), ae = (t) => Gs.has(t);
4119
4125
  class Te {
4120
- constructor(t, n = {}) {
4121
- this.id = Vs++, this.options = { ...kn, ...n }, Ds(this.options), this.ui = new Os(t, this.options, this.id), this.isAndroid = Te._getIsAndroid(), this.promise = this._createInitPromises(), this.countries = Rs(this.options);
4122
- const { dialCodes: i, dialCodeMaxLen: s, dialCodeToIso2Map: r } = Ms(
4126
+ constructor(e, n = {}) {
4127
+ this.id = js++, this.options = { ...Mn, ...n }, As(this.options), this.ui = new ks(e, this.options, this.id), this.isAndroid = Te._getIsAndroid(), this.promise = this._createInitPromises(), this.countries = Ms(this.options);
4128
+ const { dialCodes: i, dialCodeMaxLen: s, dialCodeToIso2Map: r } = Us(
4123
4129
  this.countries
4124
4130
  );
4125
4131
  this.dialCodes = i, this.dialCodeMaxLen = s, this.dialCodeToIso2Map = r, this.countryByIso2 = new Map(this.countries.map((o) => [o.iso2, o])), this._init();
@@ -4127,38 +4133,38 @@ class Te {
4127
4133
  static _getIsAndroid() {
4128
4134
  return typeof navigator < "u" ? /Android/i.test(navigator.userAgent) : !1;
4129
4135
  }
4130
- _updateNumeralSet(t) {
4131
- /[\u0660-\u0669]/.test(t) ? this.userNumeralSet = "arabic-indic" : /[\u06F0-\u06F9]/.test(t) ? this.userNumeralSet = "persian" : this.userNumeralSet = "ascii";
4136
+ _updateNumeralSet(e) {
4137
+ /[\u0660-\u0669]/.test(e) ? this.userNumeralSet = "arabic-indic" : /[\u06F0-\u06F9]/.test(e) ? this.userNumeralSet = "persian" : this.userNumeralSet = "ascii";
4132
4138
  }
4133
- _mapAsciiToUserNumerals(t) {
4139
+ _mapAsciiToUserNumerals(e) {
4134
4140
  if (this.userNumeralSet || this._updateNumeralSet(this.ui.telInput.value), this.userNumeralSet === "ascii")
4135
- return t;
4141
+ return e;
4136
4142
  const n = this.userNumeralSet === "arabic-indic" ? 1632 : 1776;
4137
- return t.replace(/[0-9]/g, (i) => String.fromCharCode(n + Number(i)));
4143
+ return e.replace(/[0-9]/g, (i) => String.fromCharCode(n + Number(i)));
4138
4144
  }
4139
4145
  // Normalize Eastern Arabic (U+0660-0669) and Persian/Extended Arabic-Indic (U+06F0-06F9) numerals to ASCII 0-9
4140
- _normaliseNumerals(t) {
4141
- if (!t)
4146
+ _normaliseNumerals(e) {
4147
+ if (!e)
4142
4148
  return "";
4143
- if (this._updateNumeralSet(t), this.userNumeralSet === "ascii")
4144
- return t;
4149
+ if (this._updateNumeralSet(e), this.userNumeralSet === "ascii")
4150
+ return e;
4145
4151
  const n = this.userNumeralSet === "arabic-indic" ? 1632 : 1776, i = this.userNumeralSet === "arabic-indic" ? /[\u0660-\u0669]/g : /[\u06F0-\u06F9]/g;
4146
- return t.replace(i, (s) => String.fromCharCode(48 + (s.charCodeAt(0) - n)));
4152
+ return e.replace(i, (s) => String.fromCharCode(48 + (s.charCodeAt(0) - n)));
4147
4153
  }
4148
4154
  _getTelInputValue() {
4149
- const t = this.ui.telInput.value.trim();
4150
- return this._normaliseNumerals(t);
4155
+ const e = this.ui.telInput.value.trim();
4156
+ return this._normaliseNumerals(e);
4151
4157
  }
4152
- _setTelInputValue(t) {
4153
- this.ui.telInput.value = this._mapAsciiToUserNumerals(t);
4158
+ _setTelInputValue(e) {
4159
+ this.ui.telInput.value = this._mapAsciiToUserNumerals(e);
4154
4160
  }
4155
4161
  _createInitPromises() {
4156
- const t = new Promise((i, s) => {
4162
+ const e = new Promise((i, s) => {
4157
4163
  this.resolveAutoCountryPromise = i, this.rejectAutoCountryPromise = s;
4158
4164
  }), n = new Promise((i, s) => {
4159
4165
  this.resolveUtilsScriptPromise = i, this.rejectUtilsScriptPromise = s;
4160
4166
  });
4161
- return Promise.all([t, n]);
4167
+ return Promise.all([e, n]);
4162
4168
  }
4163
4169
  //* Can't be private as it's called from intlTelInput convenience wrapper.
4164
4170
  _init() {
@@ -4169,18 +4175,18 @@ class Te {
4169
4175
  //********************
4170
4176
  //* Prepare all of the country data, including onlyCountries, excludeCountries, countryOrder options.
4171
4177
  _processCountryData() {
4172
- ks(this.countries, this.options), xs(this.countries, this.options), Us(this.countries);
4178
+ xs(this.countries, this.options), Hs(this.countries, this.options), Fs(this.countries);
4173
4179
  }
4174
4180
  //* Set the initial state of the input value and the selected country by:
4175
4181
  //* 1. Extracting a dial code from the given number
4176
4182
  //* 2. Using explicit initialCountry
4177
- _setInitialState(t = !1) {
4178
- const n = this.ui.telInput.getAttribute("value"), i = this._normaliseNumerals(n), s = this._getTelInputValue(), o = i && i.startsWith("+") && (!s || !s.startsWith("+")) ? i : s, l = this._getDialCode(o), a = qe(o), { initialCountry: u, geoIpLookup: c } = this.options, d = u === le.AUTO && c;
4179
- if (l && !a)
4183
+ _setInitialState(e = !1) {
4184
+ const n = this.ui.telInput.getAttribute("value"), i = this._normaliseNumerals(n), s = this._getTelInputValue(), o = i && i.startsWith("+") && (!s || !s.startsWith("+")) ? i : s, l = this._getDialCode(o), u = qe(o), { initialCountry: a, geoIpLookup: c } = this.options, d = a === oe.AUTO && c;
4185
+ if (l && !u)
4180
4186
  this._updateCountryFromNumber(o);
4181
- else if (!d || t) {
4182
- const f = u ? u.toLowerCase() : "";
4183
- ce(f) ? this._setCountry(f) : l && a ? this._setCountry(Is.ISO2) : this._setCountry("");
4187
+ else if (!d || e) {
4188
+ const f = a ? a.toLowerCase() : "";
4189
+ ae(f) ? this._setCountry(f) : l && u ? this._setCountry(Ns.ISO2) : this._setCountry("");
4184
4190
  }
4185
4191
  o && this._updateValFromNumber(o);
4186
4192
  }
@@ -4191,19 +4197,19 @@ class Te {
4191
4197
  //* Update hidden input on form submit.
4192
4198
  _initHiddenInputListener() {
4193
4199
  var n;
4194
- const t = () => {
4200
+ const e = () => {
4195
4201
  this.ui.hiddenInput && (this.ui.hiddenInput.value = this.getNumber()), this.ui.hiddenInputCountry && (this.ui.hiddenInputCountry.value = this.selectedCountryData.iso2 || "");
4196
4202
  };
4197
- (n = this.ui.telInput.form) == null || n.addEventListener("submit", t, {
4203
+ (n = this.ui.telInput.form) == null || n.addEventListener("submit", e, {
4198
4204
  signal: this.abortController.signal
4199
4205
  });
4200
4206
  }
4201
4207
  //* initialise the dropdown listeners.
4202
4208
  _initDropdownListeners() {
4203
- const t = this.abortController.signal, n = (o) => {
4209
+ const e = this.abortController.signal, n = (o) => {
4204
4210
  this.ui.dropdownContent.classList.contains(E.HIDE) ? this.ui.telInput.focus() : o.preventDefault();
4205
4211
  }, i = this.ui.telInput.closest("label");
4206
- i && i.addEventListener("click", n, { signal: t });
4212
+ i && i.addEventListener("click", n, { signal: e });
4207
4213
  const s = () => {
4208
4214
  this.ui.dropdownContent.classList.contains(
4209
4215
  E.HIDE
@@ -4213,30 +4219,30 @@ class Te {
4213
4219
  "click",
4214
4220
  s,
4215
4221
  {
4216
- signal: t
4222
+ signal: e
4217
4223
  }
4218
4224
  );
4219
4225
  const r = (o) => {
4220
4226
  this.ui.dropdownContent.classList.contains(
4221
4227
  E.HIDE
4222
- ) && [x.ARROW_UP, x.ARROW_DOWN, x.SPACE, x.ENTER].includes(o.key) && (o.preventDefault(), o.stopPropagation(), this._openDropdown()), o.key === x.TAB && this._closeDropdown();
4228
+ ) && [M.ARROW_UP, M.ARROW_DOWN, M.SPACE, M.ENTER].includes(o.key) && (o.preventDefault(), o.stopPropagation(), this._openDropdown()), o.key === M.TAB && this._closeDropdown();
4223
4229
  };
4224
4230
  this.ui.countryContainer.addEventListener(
4225
4231
  "keydown",
4226
4232
  r,
4227
- { signal: t }
4233
+ { signal: e }
4228
4234
  );
4229
4235
  }
4230
4236
  //* Init many requests: utils script / geo ip lookup.
4231
4237
  _initRequests() {
4232
- const { loadUtils: t, initialCountry: n, geoIpLookup: i } = this.options;
4233
- if (t && !_.utils) {
4238
+ const { loadUtils: e, initialCountry: n, geoIpLookup: i } = this.options;
4239
+ if (e && !C.utils) {
4234
4240
  const r = () => {
4235
4241
  var o;
4236
- (o = _.attachUtils(t)) == null || o.catch(() => {
4242
+ (o = C.attachUtils(e)) == null || o.catch(() => {
4237
4243
  });
4238
4244
  };
4239
- if (_.documentReady())
4245
+ if (C.documentReady())
4240
4246
  r();
4241
4247
  else {
4242
4248
  const o = () => {
@@ -4248,14 +4254,14 @@ class Te {
4248
4254
  }
4249
4255
  } else
4250
4256
  this.resolveUtilsScriptPromise();
4251
- n === le.AUTO && i && !this.selectedCountryData.iso2 ? this._loadAutoCountry() : this.resolveAutoCountryPromise();
4257
+ n === oe.AUTO && i && !this.selectedCountryData.iso2 ? this._loadAutoCountry() : this.resolveAutoCountryPromise();
4252
4258
  }
4253
4259
  //* Perform the geo ip lookup.
4254
4260
  _loadAutoCountry() {
4255
- _.autoCountry ? this.handleAutoCountry() : _.startedLoadingAutoCountry || (_.startedLoadingAutoCountry = !0, typeof this.options.geoIpLookup == "function" && this.options.geoIpLookup(
4256
- (t = "") => {
4257
- const n = t.toLowerCase();
4258
- ce(n) ? (_.autoCountry = n, setTimeout(() => kt("handleAutoCountry"))) : (this._setInitialState(!0), kt("rejectAutoCountryPromise"));
4261
+ C.autoCountry ? this.handleAutoCountry() : C.startedLoadingAutoCountry || (C.startedLoadingAutoCountry = !0, typeof this.options.geoIpLookup == "function" && this.options.geoIpLookup(
4262
+ (e = "") => {
4263
+ const n = e.toLowerCase();
4264
+ ae(n) ? (C.autoCountry = n, setTimeout(() => kt("handleAutoCountry"))) : (this._setInitialState(!0), kt("rejectAutoCountryPromise"));
4259
4265
  },
4260
4266
  () => {
4261
4267
  this._setInitialState(!0), kt("rejectAutoCountryPromise");
@@ -4271,49 +4277,49 @@ class Te {
4271
4277
  }
4272
4278
  _bindInputListener() {
4273
4279
  const {
4274
- strictMode: t,
4280
+ strictMode: e,
4275
4281
  formatAsYouType: n,
4276
4282
  separateDialCode: i,
4277
4283
  allowDropdown: s,
4278
4284
  countrySearch: r
4279
4285
  } = this.options;
4280
4286
  let o = !1;
4281
- lt.ALPHA_UNICODE.test(this._getTelInputValue()) && (o = !0);
4282
- const l = (a) => {
4283
- const u = this._getTelInputValue();
4284
- if (this.isAndroid && (a == null ? void 0 : a.data) === "+" && i && s && r) {
4285
- const C = this.ui.telInput.selectionStart || 0, b = u.substring(0, C - 1), g = u.substring(C);
4286
- this._setTelInputValue(b + g), this._openDropdownWithPlus();
4287
+ ut.ALPHA_UNICODE.test(this._getTelInputValue()) && (o = !0);
4288
+ const l = (u) => {
4289
+ const a = this._getTelInputValue();
4290
+ if (this.isAndroid && (u == null ? void 0 : u.data) === "+" && i && s && r) {
4291
+ const _ = this.ui.telInput.selectionStart || 0, g = a.substring(0, _ - 1), b = a.substring(_);
4292
+ this._setTelInputValue(g + b), this._openDropdownWithPlus();
4287
4293
  return;
4288
4294
  }
4289
- this._updateCountryFromNumber(u) && this._triggerCountryChange();
4290
- const c = (a == null ? void 0 : a.data) && lt.NON_PLUS_NUMERIC.test(a.data), d = (a == null ? void 0 : a.inputType) === Ge.PASTE && u;
4291
- c || d && !t ? o = !0 : lt.NON_PLUS_NUMERIC.test(u) || (o = !1);
4292
- const f = (a == null ? void 0 : a.detail) && a.detail.isSetNumber, h = this.userNumeralSet === "ascii";
4293
- if (n && !o && !f && h) {
4294
- const C = this.ui.telInput.selectionStart || 0, g = u.substring(
4295
+ this._updateCountryFromNumber(a) && this._triggerCountryChange();
4296
+ const c = (u == null ? void 0 : u.data) && ut.NON_PLUS_NUMERIC.test(u.data), d = (u == null ? void 0 : u.inputType) === Ge.PASTE && a;
4297
+ c || d && !e ? o = !0 : ut.NON_PLUS_NUMERIC.test(a) || (o = !1);
4298
+ const f = (u == null ? void 0 : u.detail) && u.detail.isSetNumber, p = this.userNumeralSet === "ascii";
4299
+ if (n && !o && !f && p) {
4300
+ const _ = this.ui.telInput.selectionStart || 0, b = a.substring(
4295
4301
  0,
4296
- C
4302
+ _
4297
4303
  ).replace(
4298
- lt.NON_PLUS_NUMERIC_GLOBAL,
4304
+ ut.NON_PLUS_NUMERIC_GLOBAL,
4299
4305
  ""
4300
- ).length, y = (a == null ? void 0 : a.inputType) === Ge.DELETE_FWD, v = this._getFullNumber(), p = Hs(
4306
+ ).length, y = (u == null ? void 0 : u.inputType) === Ge.DELETE_FWD, v = this._getFullNumber(), h = Bs(
4301
4307
  v,
4302
- u,
4303
- _.utils,
4308
+ a,
4309
+ C.utils,
4304
4310
  this.selectedCountryData,
4305
4311
  i
4306
- ), m = Fs(
4307
- g,
4308
- p,
4309
- C,
4312
+ ), m = Vs(
4313
+ b,
4314
+ h,
4315
+ _,
4310
4316
  y
4311
4317
  );
4312
- this._setTelInputValue(p), this.ui.telInput.setSelectionRange(m, m);
4318
+ this._setTelInputValue(h), this.ui.telInput.setSelectionRange(m, m);
4313
4319
  }
4314
- if (i && u.startsWith("+") && this.selectedCountryData.dialCode) {
4315
- const C = ze(u, !0, i, this.selectedCountryData);
4316
- this._setTelInputValue(C);
4320
+ if (i && a.startsWith("+") && this.selectedCountryData.dialCode) {
4321
+ const _ = ze(a, !0, i, this.selectedCountryData);
4322
+ this._setTelInputValue(_);
4317
4323
  }
4318
4324
  };
4319
4325
  this.ui.telInput.addEventListener(
@@ -4325,20 +4331,20 @@ class Te {
4325
4331
  );
4326
4332
  }
4327
4333
  _maybeBindKeydownListener() {
4328
- const { strictMode: t, separateDialCode: n, allowDropdown: i, countrySearch: s } = this.options;
4329
- if (t || n) {
4334
+ const { strictMode: e, separateDialCode: n, allowDropdown: i, countrySearch: s } = this.options;
4335
+ if (e || n) {
4330
4336
  const r = (o) => {
4331
4337
  if (o.key && o.key.length === 1 && !o.altKey && !o.ctrlKey && !o.metaKey) {
4332
4338
  if (n && i && s && o.key === "+") {
4333
4339
  o.preventDefault(), this._openDropdownWithPlus();
4334
4340
  return;
4335
4341
  }
4336
- if (t) {
4337
- const l = this._getTelInputValue(), u = !l.startsWith("+") && this.ui.telInput.selectionStart === 0 && o.key === "+", c = this._normaliseNumerals(o.key), d = /^[0-9]$/.test(c), f = n ? d : u || d, h = this.ui.telInput, C = h.selectionStart, b = h.selectionEnd, g = l.slice(0, C), y = l.slice(b), v = g + o.key + y, p = this._getFullNumber(v), m = _.utils.getCoreNumber(
4338
- p,
4342
+ if (e) {
4343
+ const l = this._getTelInputValue(), a = !l.startsWith("+") && this.ui.telInput.selectionStart === 0 && o.key === "+", c = this._normaliseNumerals(o.key), d = /^[0-9]$/.test(c), f = n ? d : a || d, p = this.ui.telInput, _ = p.selectionStart, g = p.selectionEnd, b = l.slice(0, _), y = l.slice(g), v = b + o.key + y, h = this._getFullNumber(v), m = C.utils.getCoreNumber(
4344
+ h,
4339
4345
  this.selectedCountryData.iso2
4340
- ), S = this.maxCoreNumberLength && m.length > this.maxCoreNumberLength, O = this._getNewCountryFromNumber(p) !== null;
4341
- (!f || S && !O && !u) && o.preventDefault();
4346
+ ), S = this.maxCoreNumberLength && m.length > this.maxCoreNumberLength, O = this._getNewCountryFromNumber(h) !== null;
4347
+ (!f || S && !O && !a) && o.preventDefault();
4342
4348
  }
4343
4349
  }
4344
4350
  };
@@ -4349,14 +4355,14 @@ class Te {
4349
4355
  }
4350
4356
  _maybeBindPasteListener() {
4351
4357
  if (this.options.strictMode) {
4352
- const t = (n) => {
4358
+ const e = (n) => {
4353
4359
  n.preventDefault();
4354
- const i = this.ui.telInput, s = i.selectionStart, r = i.selectionEnd, o = this._getTelInputValue(), l = o.slice(0, s), a = o.slice(r), u = this.selectedCountryData.iso2, c = n.clipboardData.getData("text"), d = this._normaliseNumerals(c), f = s === 0 && r > 0, h = !o.startsWith("+") || f, C = d.replace(lt.NON_PLUS_NUMERIC_GLOBAL, ""), b = C.startsWith("+"), g = C.replace(/\+/g, ""), y = b && h ? `+${g}` : g;
4355
- let v = l + y + a;
4360
+ const i = this.ui.telInput, s = i.selectionStart, r = i.selectionEnd, o = this._getTelInputValue(), l = o.slice(0, s), u = o.slice(r), a = this.selectedCountryData.iso2, c = n.clipboardData.getData("text"), d = this._normaliseNumerals(c), f = s === 0 && r > 0, p = !o.startsWith("+") || f, _ = d.replace(ut.NON_PLUS_NUMERIC_GLOBAL, ""), g = _.startsWith("+"), b = _.replace(/\+/g, ""), y = g && p ? `+${b}` : b;
4361
+ let v = l + y + u;
4356
4362
  if (v.length > 5) {
4357
- let m = _.utils.getCoreNumber(v, u);
4363
+ let m = C.utils.getCoreNumber(v, a);
4358
4364
  for (; m.length === 0 && v.length > 0; )
4359
- v = v.slice(0, -1), m = _.utils.getCoreNumber(v, u);
4365
+ v = v.slice(0, -1), m = C.utils.getCoreNumber(v, a);
4360
4366
  if (!m)
4361
4367
  return;
4362
4368
  if (this.maxCoreNumberLength && m.length > this.maxCoreNumberLength)
@@ -4367,22 +4373,22 @@ class Te {
4367
4373
  return;
4368
4374
  }
4369
4375
  this._setTelInputValue(v);
4370
- const p = s + y.length;
4371
- i.setSelectionRange(p, p), i.dispatchEvent(new InputEvent("input", { bubbles: !0 }));
4376
+ const h = s + y.length;
4377
+ i.setSelectionRange(h, h), i.dispatchEvent(new InputEvent("input", { bubbles: !0 }));
4372
4378
  };
4373
- this.ui.telInput.addEventListener("paste", t, {
4379
+ this.ui.telInput.addEventListener("paste", e, {
4374
4380
  signal: this.abortController.signal
4375
4381
  });
4376
4382
  }
4377
4383
  }
4378
4384
  //* Adhere to the input's maxlength attr.
4379
- _cap(t) {
4385
+ _cap(e) {
4380
4386
  const n = Number(this.ui.telInput.getAttribute("maxlength"));
4381
- return n && t.length > n ? t.substring(0, n) : t;
4387
+ return n && e.length > n ? e.substring(0, n) : e;
4382
4388
  }
4383
4389
  //* Trigger a custom event on the input (typed via ItiEventMap).
4384
- _trigger(t, n = {}) {
4385
- const i = new CustomEvent(t, {
4390
+ _trigger(e, n = {}) {
4391
+ const i = new CustomEvent(e, {
4386
4392
  bubbles: !0,
4387
4393
  cancelable: !0,
4388
4394
  detail: n
@@ -4391,19 +4397,19 @@ class Te {
4391
4397
  }
4392
4398
  //* Open the dropdown.
4393
4399
  _openDropdown() {
4394
- const { fixDropdownWidth: t, countrySearch: n } = this.options;
4395
- if (this.dropdownAbortController = new AbortController(), t && (this.ui.dropdownContent.style.width = `${this.ui.telInput.offsetWidth}px`), this.ui.dropdownContent.classList.remove(E.HIDE), this.ui.selectedCountry.setAttribute(L.EXPANDED, "true"), this._setDropdownPosition(), n) {
4400
+ const { fixDropdownWidth: e, countrySearch: n } = this.options;
4401
+ if (this.dropdownAbortController = new AbortController(), e && (this.ui.dropdownContent.style.width = `${this.ui.telInput.offsetWidth}px`), this.ui.dropdownContent.classList.remove(E.HIDE), this.ui.selectedCountry.setAttribute(D.EXPANDED, "true"), this._setDropdownPosition(), n) {
4396
4402
  const i = this.ui.countryList.firstElementChild;
4397
4403
  i && (this.ui.highlightListItem(i, !1), this.ui.countryList.scrollTop = 0), this.ui.searchInput.focus();
4398
4404
  }
4399
- this._bindDropdownListeners(), this.ui.dropdownArrow.classList.add(E.ARROW_UP), this._trigger(Wt.OPEN_COUNTRY_DROPDOWN);
4405
+ this._bindDropdownListeners(), this.ui.dropdownArrow.classList.add(E.ARROW_UP), this._trigger(Vt.OPEN_COUNTRY_DROPDOWN);
4400
4406
  }
4401
4407
  //* Set the dropdown position
4402
4408
  _setDropdownPosition() {
4403
4409
  if (this.options.dropdownContainer && this.options.dropdownContainer.appendChild(this.ui.dropdown), !this.options.useFullscreenPopup) {
4404
- const t = this.ui.telInput.getBoundingClientRect(), n = this.ui.telInput.offsetHeight;
4410
+ const e = this.ui.telInput.getBoundingClientRect(), n = this.ui.telInput.offsetHeight;
4405
4411
  if (this.options.dropdownContainer) {
4406
- this.ui.dropdown.style.top = `${t.top + n}px`, this.ui.dropdown.style.left = `${t.left}px`;
4412
+ this.ui.dropdown.style.top = `${e.top + n}px`, this.ui.dropdown.style.left = `${e.left}px`;
4407
4413
  const i = () => this._closeDropdown();
4408
4414
  window.addEventListener("scroll", i, {
4409
4415
  signal: this.dropdownAbortController.signal
@@ -4413,12 +4419,12 @@ class Te {
4413
4419
  }
4414
4420
  //* We only bind dropdown listeners when the dropdown is open.
4415
4421
  _bindDropdownListeners() {
4416
- const t = this.dropdownAbortController.signal;
4417
- this._bindDropdownMouseoverListener(t), this._bindDropdownCountryClickListener(t), this._bindDropdownClickOffListener(t), this._bindDropdownKeydownListener(t), this.options.countrySearch && this._bindDropdownSearchListeners(t);
4422
+ const e = this.dropdownAbortController.signal;
4423
+ this._bindDropdownMouseoverListener(e), this._bindDropdownCountryClickListener(e), this._bindDropdownClickOffListener(e), this._bindDropdownKeydownListener(e), this.options.countrySearch && this._bindDropdownSearchListeners(e);
4418
4424
  }
4419
4425
  //* When mouse over a list item, just highlight that one
4420
4426
  //* we add the class "highlight", so if they hit "enter" we know which one to select.
4421
- _bindDropdownMouseoverListener(t) {
4427
+ _bindDropdownMouseoverListener(e) {
4422
4428
  const n = (i) => {
4423
4429
  var r;
4424
4430
  const s = (r = i.target) == null ? void 0 : r.closest(
@@ -4430,12 +4436,12 @@ class Te {
4430
4436
  "mouseover",
4431
4437
  n,
4432
4438
  {
4433
- signal: t
4439
+ signal: e
4434
4440
  }
4435
4441
  );
4436
4442
  }
4437
4443
  //* Listen for country selection.
4438
- _bindDropdownCountryClickListener(t) {
4444
+ _bindDropdownCountryClickListener(e) {
4439
4445
  const n = (i) => {
4440
4446
  var r;
4441
4447
  const s = (r = i.target) == null ? void 0 : r.closest(
@@ -4444,12 +4450,12 @@ class Te {
4444
4450
  s && this._selectListItem(s);
4445
4451
  };
4446
4452
  this.ui.countryList.addEventListener("click", n, {
4447
- signal: t
4453
+ signal: e
4448
4454
  });
4449
4455
  }
4450
4456
  //* Click off to close (except when this initial opening click is bubbling up).
4451
4457
  //* We cannot just stopPropagation as it may be needed to close another instance.
4452
- _bindDropdownClickOffListener(t) {
4458
+ _bindDropdownClickOffListener(e) {
4453
4459
  const n = (i) => {
4454
4460
  !!i.target.closest(
4455
4461
  `#iti-${this.id}__dropdown-content`
@@ -4459,7 +4465,7 @@ class Te {
4459
4465
  document.documentElement.addEventListener(
4460
4466
  "click",
4461
4467
  n,
4462
- { signal: t }
4468
+ { signal: e }
4463
4469
  );
4464
4470
  }, 0);
4465
4471
  }
@@ -4467,22 +4473,22 @@ class Te {
4467
4473
  //* Use keydown as keypress doesn't fire for non-char keys and we want to catch if they
4468
4474
  //* just hit down and hold it to scroll down (no keyup event).
4469
4475
  //* Listen on the document because that's where key events are triggered if no input has focus.
4470
- _bindDropdownKeydownListener(t) {
4476
+ _bindDropdownKeydownListener(e) {
4471
4477
  let n = "", i = null;
4472
4478
  const s = (r) => {
4473
4479
  [
4474
- x.ARROW_UP,
4475
- x.ARROW_DOWN,
4476
- x.ENTER,
4477
- x.ESC
4478
- ].includes(r.key) && (r.preventDefault(), r.stopPropagation(), r.key === x.ARROW_UP || r.key === x.ARROW_DOWN ? this._handleUpDownKey(r.key) : r.key === x.ENTER ? this._handleEnterKey() : r.key === x.ESC && (this._closeDropdown(), this.ui.selectedCountry.focus())), !this.options.countrySearch && lt.HIDDEN_SEARCH_CHAR.test(r.key) && (r.stopPropagation(), i && clearTimeout(i), n += r.key.toLowerCase(), this._searchForCountry(n), i = setTimeout(() => {
4480
+ M.ARROW_UP,
4481
+ M.ARROW_DOWN,
4482
+ M.ENTER,
4483
+ M.ESC
4484
+ ].includes(r.key) && (r.preventDefault(), r.stopPropagation(), r.key === M.ARROW_UP || r.key === M.ARROW_DOWN ? this._handleUpDownKey(r.key) : r.key === M.ENTER ? this._handleEnterKey() : r.key === M.ESC && (this._closeDropdown(), this.ui.selectedCountry.focus())), !this.options.countrySearch && ut.HIDDEN_SEARCH_CHAR.test(r.key) && (r.stopPropagation(), i && clearTimeout(i), n += r.key.toLowerCase(), this._searchForCountry(n), i = setTimeout(() => {
4479
4485
  n = "";
4480
- }, ws.HIDDEN_SEARCH_RESET_MS));
4486
+ }, Es.HIDDEN_SEARCH_RESET_MS));
4481
4487
  };
4482
- document.addEventListener("keydown", s, { signal: t });
4488
+ document.addEventListener("keydown", s, { signal: e });
4483
4489
  }
4484
4490
  //* Search input listeners when countrySearch enabled.
4485
- _bindDropdownSearchListeners(t) {
4491
+ _bindDropdownSearchListeners(e) {
4486
4492
  const n = () => {
4487
4493
  const o = this.ui.searchInput.value.trim();
4488
4494
  this._filterCountriesByQuery(o), this.ui.searchInput.value ? this.ui.searchClearButton.classList.remove(E.HIDE) : this.ui.searchClearButton.classList.add(E.HIDE);
@@ -4494,33 +4500,33 @@ class Te {
4494
4500
  }, 100);
4495
4501
  };
4496
4502
  this.ui.searchInput.addEventListener("input", s, {
4497
- signal: t
4503
+ signal: e
4498
4504
  });
4499
4505
  const r = () => {
4500
4506
  this.ui.searchInput.value = "", this.ui.searchInput.focus(), n();
4501
4507
  };
4502
4508
  this.ui.searchClearButton.addEventListener("click", r, {
4503
- signal: t
4509
+ signal: e
4504
4510
  });
4505
4511
  }
4506
4512
  //* Hidden search (countrySearch disabled): Find the first list item whose name starts with the query string.
4507
- _searchForCountry(t) {
4508
- const n = As(this.countries, t);
4513
+ _searchForCountry(e) {
4514
+ const n = Ss(this.countries, e);
4509
4515
  if (n) {
4510
4516
  const i = n.nodeById[this.id];
4511
4517
  this.ui.highlightListItem(i, !1), this.ui.scrollTo(i);
4512
4518
  }
4513
4519
  }
4514
4520
  //* Country search: Filter the countries according to the search query.
4515
- _filterCountriesByQuery(t) {
4521
+ _filterCountriesByQuery(e) {
4516
4522
  let n;
4517
- t === "" ? n = this.countries : n = Ls(this.countries, t), this.ui.filterCountries(n);
4523
+ e === "" ? n = this.countries : n = Ts(this.countries, e), this.ui.filterCountries(n);
4518
4524
  }
4519
4525
  //* Highlight the next/prev item in the list (and ensure it is visible).
4520
- _handleUpDownKey(t) {
4526
+ _handleUpDownKey(e) {
4521
4527
  var i, s;
4522
- let n = t === x.ARROW_UP ? (i = this.ui.highlightedItem) == null ? void 0 : i.previousElementSibling : (s = this.ui.highlightedItem) == null ? void 0 : s.nextElementSibling;
4523
- !n && this.ui.countryList.childElementCount > 1 && (n = t === x.ARROW_UP ? this.ui.countryList.lastElementChild : this.ui.countryList.firstElementChild), n && (this.ui.scrollTo(n), this.ui.highlightListItem(n, !1));
4528
+ let n = e === M.ARROW_UP ? (i = this.ui.highlightedItem) == null ? void 0 : i.previousElementSibling : (s = this.ui.highlightedItem) == null ? void 0 : s.nextElementSibling;
4529
+ !n && this.ui.countryList.childElementCount > 1 && (n = e === M.ARROW_UP ? this.ui.countryList.lastElementChild : this.ui.countryList.firstElementChild), n && (this.ui.scrollTo(n), this.ui.highlightListItem(n, !1));
4524
4530
  }
4525
4531
  //* Select the currently highlighted item.
4526
4532
  _handleEnterKey() {
@@ -4528,11 +4534,11 @@ class Te {
4528
4534
  }
4529
4535
  //* Update the input's value to the given val (format first if possible)
4530
4536
  //* NOTE: this is called from _setInitialState, handleUtils and setNumber.
4531
- _updateValFromNumber(t) {
4532
- let n = t;
4533
- if (this.options.formatOnDisplay && _.utils && this.selectedCountryData) {
4534
- const i = this.options.nationalMode || !n.startsWith("+") && !this.options.separateDialCode, { NATIONAL: s, INTERNATIONAL: r } = _.utils.numberFormat, o = i ? s : r;
4535
- n = _.utils.formatNumber(
4537
+ _updateValFromNumber(e) {
4538
+ let n = e;
4539
+ if (this.options.formatOnDisplay && C.utils && this.selectedCountryData) {
4540
+ const i = this.options.nationalMode || !n.startsWith("+") && !this.options.separateDialCode, { NATIONAL: s, INTERNATIONAL: r } = C.utils.numberFormat, o = i ? s : r;
4541
+ n = C.utils.formatNumber(
4536
4542
  n,
4537
4543
  this.selectedCountryData.iso2,
4538
4544
  o
@@ -4542,34 +4548,34 @@ class Te {
4542
4548
  }
4543
4549
  //* Check if need to select a new country based on the given number
4544
4550
  //* Note: called from _setInitialState, keyup handler, setNumber.
4545
- _updateCountryFromNumber(t) {
4546
- const n = this._getNewCountryFromNumber(t);
4551
+ _updateCountryFromNumber(e) {
4552
+ const n = this._getNewCountryFromNumber(e);
4547
4553
  return n !== null ? this._setCountry(n) : !1;
4548
4554
  }
4549
4555
  // if there is a selected country, and the number doesn't start with a dial code, then add it
4550
- _ensureHasDialCode(t) {
4556
+ _ensureHasDialCode(e) {
4551
4557
  const { dialCode: n, nationalPrefix: i } = this.selectedCountryData;
4552
- if (t.startsWith("+") || !n)
4553
- return t;
4554
- const o = i && t.startsWith(i) && !this.options.separateDialCode ? t.substring(1) : t;
4558
+ if (e.startsWith("+") || !n)
4559
+ return e;
4560
+ const o = i && e.startsWith(i) && !this.options.separateDialCode ? e.substring(1) : e;
4555
4561
  return `+${n}${o}`;
4556
4562
  }
4557
4563
  // Get the country ISO2 code from the given number
4558
4564
  // BUT ONLY IF ITS CHANGED FROM THE CURRENTLY SELECTED COUNTRY
4559
4565
  // NOTE: consider refactoring this to be more clear
4560
- _getNewCountryFromNumber(t) {
4561
- const n = t.indexOf("+");
4562
- let i = n ? t.substring(n) : t;
4566
+ _getNewCountryFromNumber(e) {
4567
+ const n = e.indexOf("+");
4568
+ let i = n ? e.substring(n) : e;
4563
4569
  const s = this.selectedCountryData.iso2, r = this.selectedCountryData.dialCode;
4564
4570
  i = this._ensureHasDialCode(i);
4565
- const o = this._getDialCode(i, !0), l = Gt(i);
4571
+ const o = this._getDialCode(i, !0), l = jt(i);
4566
4572
  if (o) {
4567
- const a = Gt(o), u = this.dialCodeToIso2Map[a];
4568
- if (u.length === 1)
4569
- return u[0] === s ? null : u[0];
4570
- if (!s && this.defaultCountry && u.includes(this.defaultCountry))
4573
+ const u = jt(o), a = this.dialCodeToIso2Map[u];
4574
+ if (a.length === 1)
4575
+ return a[0] === s ? null : a[0];
4576
+ if (!s && this.defaultCountry && a.includes(this.defaultCountry))
4571
4577
  return this.defaultCountry;
4572
- if (r === Rn.NANP && qe(l))
4578
+ if (r === kn.NANP && qe(l))
4573
4579
  return null;
4574
4580
  const { areaCodes: d, priority: f } = this.selectedCountryData;
4575
4581
  if (d) {
@@ -4580,70 +4586,70 @@ class Te {
4580
4586
  if (l.startsWith(v))
4581
4587
  return null;
4582
4588
  }
4583
- const C = d && !(f === 0) && l.length > a.length, b = s && u.includes(s) && !C, g = s === u[0];
4584
- if (!b && !g)
4585
- return u[0];
4589
+ const _ = d && !(f === 0) && l.length > u.length, g = s && a.includes(s) && !_, b = s === a[0];
4590
+ if (!g && !b)
4591
+ return a[0];
4586
4592
  } else if (i.startsWith("+") && l.length) {
4587
- const a = this.selectedCountryData.dialCode || "";
4588
- return a && a.startsWith(l) ? null : "";
4593
+ const u = this.selectedCountryData.dialCode || "";
4594
+ return u && u.startsWith(l) ? null : "";
4589
4595
  } else if ((!i || i === "+") && !s)
4590
4596
  return this.defaultCountry;
4591
4597
  return null;
4592
4598
  }
4593
4599
  //* Update the selected country, dial code (if separateDialCode), placeholder, title, and selected list item.
4594
4600
  //* Note: called from _setInitialState, _updateCountryFromNumber, _selectListItem, setCountry.
4595
- _setCountry(t) {
4601
+ _setCountry(e) {
4596
4602
  const { separateDialCode: n, showFlags: i, i18n: s, allowDropdown: r } = this.options, o = this.selectedCountryData.iso2 || "";
4597
- if (r && this.ui.updateSelectedItem(t), this.selectedCountryData = t ? this.countryByIso2.get(t) : {}, this.selectedCountryData.iso2 && (this.defaultCountry = this.selectedCountryData.iso2), this.ui.selectedCountry) {
4598
- const l = t && i ? `${E.FLAG} iti__${t}` : `${E.FLAG} ${E.GLOBE}`;
4599
- let a, u, c;
4600
- if (t) {
4603
+ if (r && this.ui.updateSelectedItem(e), this.selectedCountryData = e ? this.countryByIso2.get(e) : {}, this.selectedCountryData.iso2 && (this.defaultCountry = this.selectedCountryData.iso2), this.ui.selectedCountry) {
4604
+ const l = e && i ? `${E.FLAG} iti__${e}` : `${E.FLAG} ${E.GLOBE}`;
4605
+ let u, a, c;
4606
+ if (e) {
4601
4607
  const { name: d, dialCode: f } = this.selectedCountryData;
4602
- u = d, a = s.selectedCountryAriaLabel.replace("${countryName}", d).replace("${dialCode}", `+${f}`), c = "";
4608
+ a = d, u = s.selectedCountryAriaLabel.replace("${countryName}", d).replace("${dialCode}", `+${f}`), c = "";
4603
4609
  } else
4604
- u = s.noCountrySelected, a = s.noCountrySelected, c = Ps();
4605
- this.ui.selectedCountryInner.className = l, this.ui.selectedCountry.setAttribute("title", u), this.ui.selectedCountry.setAttribute(L.LABEL, a), this.ui.selectedCountryInner.innerHTML = c;
4610
+ a = s.noCountrySelected, u = s.noCountrySelected, c = Rs();
4611
+ this.ui.selectedCountryInner.className = l, this.ui.selectedCountry.setAttribute("title", a), this.ui.selectedCountry.setAttribute(D.LABEL, u), this.ui.selectedCountryInner.innerHTML = c;
4606
4612
  }
4607
4613
  if (n) {
4608
4614
  const l = this.selectedCountryData.dialCode ? `+${this.selectedCountryData.dialCode}` : "";
4609
4615
  this.ui.selectedDialCode.textContent = l, this.ui.updateInputPadding();
4610
4616
  }
4611
- return this._updatePlaceholder(), this._updateMaxLength(), o !== t;
4617
+ return this._updatePlaceholder(), this._updateMaxLength(), o !== e;
4612
4618
  }
4613
4619
  //* Update the maximum valid number length for the currently selected country.
4614
4620
  _updateMaxLength() {
4615
- const { strictMode: t, placeholderNumberType: n, allowedNumberTypes: i } = this.options, { iso2: s } = this.selectedCountryData;
4616
- if (t && _.utils)
4621
+ const { strictMode: e, placeholderNumberType: n, allowedNumberTypes: i } = this.options, { iso2: s } = this.selectedCountryData;
4622
+ if (e && C.utils)
4617
4623
  if (s) {
4618
- const r = _.utils.numberType[n];
4619
- let o = _.utils.getExampleNumber(
4624
+ const r = C.utils.numberType[n];
4625
+ let o = C.utils.getExampleNumber(
4620
4626
  s,
4621
4627
  !1,
4622
4628
  r,
4623
4629
  !0
4624
4630
  ), l = o;
4625
- for (; _.utils.isPossibleNumber(
4631
+ for (; C.utils.isPossibleNumber(
4626
4632
  o,
4627
4633
  s,
4628
4634
  i
4629
4635
  ); )
4630
4636
  l = o, o += "0";
4631
- const a = _.utils.getCoreNumber(l, s);
4632
- this.maxCoreNumberLength = a.length, s === "by" && (this.maxCoreNumberLength = a.length + 1);
4637
+ const u = C.utils.getCoreNumber(l, s);
4638
+ this.maxCoreNumberLength = u.length, s === "by" && (this.maxCoreNumberLength = u.length + 1);
4633
4639
  } else
4634
4640
  this.maxCoreNumberLength = null;
4635
4641
  }
4636
4642
  //* Update the input placeholder to an example number from the currently selected country.
4637
4643
  _updatePlaceholder() {
4638
4644
  const {
4639
- autoPlaceholder: t,
4645
+ autoPlaceholder: e,
4640
4646
  placeholderNumberType: n,
4641
4647
  nationalMode: i,
4642
4648
  customPlaceholder: s
4643
- } = this.options, r = t === me.AGGRESSIVE || !this.ui.hadInitialPlaceholder && t === me.POLITE;
4644
- if (_.utils && r) {
4645
- const o = _.utils.numberType[n];
4646
- let l = this.selectedCountryData.iso2 ? _.utils.getExampleNumber(
4649
+ } = this.options, r = e === ve.AGGRESSIVE || !this.ui.hadInitialPlaceholder && e === ve.POLITE;
4650
+ if (C.utils && r) {
4651
+ const o = C.utils.numberType[n];
4652
+ let l = this.selectedCountryData.iso2 ? C.utils.getExampleNumber(
4647
4653
  this.selectedCountryData.iso2,
4648
4654
  i,
4649
4655
  o
@@ -4652,10 +4658,10 @@ class Te {
4652
4658
  }
4653
4659
  }
4654
4660
  //* Called when the user selects a list item from the dropdown.
4655
- _selectListItem(t) {
4656
- const n = t.dataset[Ke.COUNTRY_CODE], i = this._setCountry(n);
4661
+ _selectListItem(e) {
4662
+ const n = e.dataset[Ke.COUNTRY_CODE], i = this._setCountry(n);
4657
4663
  this._closeDropdown();
4658
- const s = t.dataset[Ke.DIAL_CODE];
4664
+ const s = e.dataset[Ke.DIAL_CODE];
4659
4665
  if (this._updateDialCode(s), this.options.formatOnDisplay) {
4660
4666
  const r = this._getTelInputValue();
4661
4667
  this._updateValFromNumber(r);
@@ -4664,12 +4670,12 @@ class Te {
4664
4670
  }
4665
4671
  //* Close the dropdown and unbind any listeners.
4666
4672
  _closeDropdown() {
4667
- this.ui.dropdownContent.classList.contains(E.HIDE) || (this.ui.dropdownContent.classList.add(E.HIDE), this.ui.selectedCountry.setAttribute(L.EXPANDED, "false"), this.options.countrySearch && (this.ui.searchInput.removeAttribute(L.ACTIVE_DESCENDANT), this.ui.highlightedItem && (this.ui.highlightedItem.classList.remove(E.HIGHLIGHT), this.ui.highlightedItem = null)), this.ui.dropdownArrow.classList.remove(E.ARROW_UP), this.dropdownAbortController.abort(), this.dropdownAbortController = null, this.options.dropdownContainer && this.ui.dropdown.remove(), this._trigger(Wt.CLOSE_COUNTRY_DROPDOWN));
4673
+ this.ui.dropdownContent.classList.contains(E.HIDE) || (this.ui.dropdownContent.classList.add(E.HIDE), this.ui.selectedCountry.setAttribute(D.EXPANDED, "false"), this.options.countrySearch && (this.ui.searchInput.removeAttribute(D.ACTIVE_DESCENDANT), this.ui.highlightedItem && (this.ui.highlightedItem.classList.remove(E.HIGHLIGHT), this.ui.highlightedItem = null)), this.ui.dropdownArrow.classList.remove(E.ARROW_UP), this.dropdownAbortController.abort(), this.dropdownAbortController = null, this.options.dropdownContainer && this.ui.dropdown.remove(), this._trigger(Vt.CLOSE_COUNTRY_DROPDOWN));
4668
4674
  }
4669
4675
  //* Replace any existing dial code with the new one
4670
4676
  //* Note: called from _selectListItem and setCountry
4671
- _updateDialCode(t) {
4672
- const n = this._getTelInputValue(), i = `+${t}`;
4677
+ _updateDialCode(e) {
4678
+ const n = this._getTelInputValue(), i = `+${e}`;
4673
4679
  let s;
4674
4680
  if (n.startsWith("+")) {
4675
4681
  const r = this._getDialCode(n);
@@ -4678,19 +4684,19 @@ class Te {
4678
4684
  }
4679
4685
  //* Try and extract a valid international dial code from a full telephone number.
4680
4686
  //* Note: returns the raw string inc plus character and any whitespace/dots etc.
4681
- _getDialCode(t, n) {
4687
+ _getDialCode(e, n) {
4682
4688
  let i = "";
4683
- if (t.startsWith("+")) {
4689
+ if (e.startsWith("+")) {
4684
4690
  let s = "", r = !1;
4685
- for (let o = 0; o < t.length; o++) {
4686
- const l = t.charAt(o);
4691
+ for (let o = 0; o < e.length; o++) {
4692
+ const l = e.charAt(o);
4687
4693
  if (/[0-9]/.test(l)) {
4688
4694
  if (s += l, !!!this.dialCodeToIso2Map[s])
4689
4695
  break;
4690
4696
  if (this.dialCodes.has(s)) {
4691
- if (i = t.substring(0, o + 1), r = !0, !n)
4697
+ if (i = e.substring(0, o + 1), r = !0, !n)
4692
4698
  break;
4693
- } else n && r && (i = t.substring(0, o + 1));
4699
+ } else n && r && (i = e.substring(0, o + 1));
4694
4700
  if (s.length === this.dialCodeMaxLen)
4695
4701
  break;
4696
4702
  }
@@ -4699,16 +4705,16 @@ class Te {
4699
4705
  return i;
4700
4706
  }
4701
4707
  //* Get the input val, adding the dial code if separateDialCode is enabled.
4702
- _getFullNumber(t) {
4703
- const n = t ? this._normaliseNumerals(t) : this._getTelInputValue(), { dialCode: i } = this.selectedCountryData;
4708
+ _getFullNumber(e) {
4709
+ const n = e ? this._normaliseNumerals(e) : this._getTelInputValue(), { dialCode: i } = this.selectedCountryData;
4704
4710
  let s;
4705
- const r = Gt(n);
4711
+ const r = jt(n);
4706
4712
  return this.options.separateDialCode && !n.startsWith("+") && i && r ? s = `+${i}` : s = "", s + n;
4707
4713
  }
4708
4714
  //* Remove the dial code if separateDialCode is enabled also cap the length if the input has a maxlength attribute
4709
- _beforeSetNumber(t) {
4710
- const n = !!this._getDialCode(t), i = ze(
4711
- t,
4715
+ _beforeSetNumber(e) {
4716
+ const n = !!this._getDialCode(e), i = ze(
4717
+ e,
4712
4718
  n,
4713
4719
  this.options.separateDialCode,
4714
4720
  this.selectedCountryData
@@ -4717,20 +4723,20 @@ class Te {
4717
4723
  }
4718
4724
  //* Trigger the 'countrychange' event.
4719
4725
  _triggerCountryChange() {
4720
- this._trigger(Wt.COUNTRY_CHANGE);
4726
+ this._trigger(Vt.COUNTRY_CHANGE);
4721
4727
  }
4722
4728
  //**************************
4723
4729
  //* SECRET PUBLIC METHODS
4724
4730
  //**************************
4725
4731
  //* This is called when the geoip call returns.
4726
4732
  handleAutoCountry() {
4727
- this.options.initialCountry === le.AUTO && _.autoCountry && (this.defaultCountry = _.autoCountry, this.selectedCountryData.iso2 || this.ui.selectedCountryInner.classList.contains(E.GLOBE) || this.setCountry(this.defaultCountry), this.resolveAutoCountryPromise());
4733
+ this.options.initialCountry === oe.AUTO && C.autoCountry && (this.defaultCountry = C.autoCountry, this.selectedCountryData.iso2 || this.ui.selectedCountryInner.classList.contains(E.GLOBE) || this.setCountry(this.defaultCountry), this.resolveAutoCountryPromise());
4728
4734
  }
4729
4735
  //* This is called when the utils request completes.
4730
4736
  handleUtils() {
4731
- if (_.utils) {
4732
- const t = this._getTelInputValue();
4733
- t && this._updateValFromNumber(t), this.selectedCountryData.iso2 && (this._updatePlaceholder(), this._updateMaxLength());
4737
+ if (C.utils) {
4738
+ const e = this._getTelInputValue();
4739
+ e && this._updateValFromNumber(e), this.selectedCountryData.iso2 && (this._updatePlaceholder(), this._updateMaxLength());
4734
4740
  }
4735
4741
  this.resolveUtilsScriptPromise();
4736
4742
  }
@@ -4739,22 +4745,22 @@ class Te {
4739
4745
  //********************
4740
4746
  //* Remove plugin.
4741
4747
  destroy() {
4742
- this.ui.telInput && (this.options.allowDropdown && this._closeDropdown(), this.abortController.abort(), this.abortController = null, this.ui.destroy(), _.instances instanceof Map ? _.instances.delete(this.id) : delete _.instances[this.id]);
4748
+ this.ui.telInput && (this.options.allowDropdown && this._closeDropdown(), this.abortController.abort(), this.abortController = null, this.ui.destroy(), C.instances instanceof Map ? C.instances.delete(this.id) : delete C.instances[this.id]);
4743
4749
  }
4744
4750
  //* Get the extension from the current number.
4745
4751
  getExtension() {
4746
- return _.utils ? _.utils.getExtension(
4752
+ return C.utils ? C.utils.getExtension(
4747
4753
  this._getFullNumber(),
4748
4754
  this.selectedCountryData.iso2
4749
4755
  ) : "";
4750
4756
  }
4751
4757
  //* Format the number to the given format.
4752
- getNumber(t) {
4753
- if (_.utils) {
4754
- const { iso2: n } = this.selectedCountryData, i = this._getFullNumber(), s = _.utils.formatNumber(
4758
+ getNumber(e) {
4759
+ if (C.utils) {
4760
+ const { iso2: n } = this.selectedCountryData, i = this._getFullNumber(), s = C.utils.formatNumber(
4755
4761
  i,
4756
4762
  n,
4757
- t
4763
+ e
4758
4764
  );
4759
4765
  return this._mapAsciiToUserNumerals(s);
4760
4766
  }
@@ -4762,7 +4768,7 @@ class Te {
4762
4768
  }
4763
4769
  //* Get the type of the entered number e.g. landline/mobile.
4764
4770
  getNumberType() {
4765
- return _.utils ? _.utils.getNumberType(
4771
+ return C.utils ? C.utils.getNumberType(
4766
4772
  this._getFullNumber(),
4767
4773
  this.selectedCountryData.iso2
4768
4774
  ) : Ye.UNKNOWN_NUMBER_TYPE;
@@ -4773,18 +4779,18 @@ class Te {
4773
4779
  }
4774
4780
  //* Get the validation error.
4775
4781
  getValidationError() {
4776
- if (_.utils) {
4777
- const { iso2: t } = this.selectedCountryData;
4778
- return _.utils.getValidationError(this._getFullNumber(), t);
4782
+ if (C.utils) {
4783
+ const { iso2: e } = this.selectedCountryData;
4784
+ return C.utils.getValidationError(this._getFullNumber(), e);
4779
4785
  }
4780
4786
  return Ye.UNKNOWN_VALIDATION_ERROR;
4781
4787
  }
4782
4788
  //* Validate the input val using number length only
4783
4789
  isValidNumber() {
4784
- const { dialCode: t, iso2: n } = this.selectedCountryData;
4785
- if (t === oe.DIAL_CODE && _.utils) {
4786
- const i = this._getFullNumber(), s = _.utils.getCoreNumber(i, n);
4787
- if (s[0] === oe.MOBILE_PREFIX && s.length !== oe.MOBILE_CORE_LENGTH)
4790
+ const { dialCode: e, iso2: n } = this.selectedCountryData;
4791
+ if (e === re.DIAL_CODE && C.utils) {
4792
+ const i = this._getFullNumber(), s = C.utils.getCoreNumber(i, n);
4793
+ if (s[0] === re.MOBILE_PREFIX && s.length !== re.MOBILE_CORE_LENGTH)
4788
4794
  return !1;
4789
4795
  }
4790
4796
  return this._validateNumber(!1);
@@ -4793,42 +4799,42 @@ class Te {
4793
4799
  isValidNumberPrecise() {
4794
4800
  return this._validateNumber(!0);
4795
4801
  }
4796
- _utilsIsPossibleNumber(t) {
4797
- return _.utils ? _.utils.isPossibleNumber(
4798
- t,
4802
+ _utilsIsPossibleNumber(e) {
4803
+ return C.utils ? C.utils.isPossibleNumber(
4804
+ e,
4799
4805
  this.selectedCountryData.iso2,
4800
4806
  this.options.allowedNumberTypes
4801
4807
  ) : null;
4802
4808
  }
4803
4809
  //* Shared internal validation logic to handle alpha character extension rules.
4804
- _validateNumber(t) {
4805
- if (!_.utils)
4810
+ _validateNumber(e) {
4811
+ if (!C.utils)
4806
4812
  return null;
4807
4813
  if (!this.selectedCountryData.iso2)
4808
4814
  return !1;
4809
- const { allowNumberExtensions: n, allowPhonewords: i } = this.options, s = (a) => t ? this._utilsIsValidNumber(a) : this._utilsIsPossibleNumber(a), r = this._getFullNumber();
4815
+ const { allowNumberExtensions: n, allowPhonewords: i } = this.options, s = (u) => e ? this._utilsIsValidNumber(u) : this._utilsIsPossibleNumber(u), r = this._getFullNumber();
4810
4816
  if (!s(r))
4811
4817
  return !1;
4812
- if (r.search(lt.ALPHA_UNICODE) > -1) {
4813
- const a = this.selectedCountryData.iso2;
4814
- return _.utils.getExtension(r, a) ? n : i;
4818
+ if (r.search(ut.ALPHA_UNICODE) > -1) {
4819
+ const u = this.selectedCountryData.iso2;
4820
+ return C.utils.getExtension(r, u) ? n : i;
4815
4821
  }
4816
4822
  return !0;
4817
4823
  }
4818
- _utilsIsValidNumber(t) {
4819
- return _.utils ? _.utils.isValidNumber(
4820
- t,
4824
+ _utilsIsValidNumber(e) {
4825
+ return C.utils ? C.utils.isValidNumber(
4826
+ e,
4821
4827
  this.selectedCountryData.iso2,
4822
4828
  this.options.allowedNumberTypes
4823
4829
  ) : null;
4824
4830
  }
4825
4831
  //* Update the selected country, and update the input val accordingly.
4826
- setCountry(t) {
4827
- const n = t == null ? void 0 : t.toLowerCase();
4828
- if (!ce(n))
4832
+ setCountry(e) {
4833
+ const n = e == null ? void 0 : e.toLowerCase();
4834
+ if (!ae(n))
4829
4835
  throw new Error(`Invalid country code: '${n}'`);
4830
4836
  const i = this.selectedCountryData.iso2;
4831
- if (t && n !== i || !t && i) {
4837
+ if (e && n !== i || !e && i) {
4832
4838
  if (this._setCountry(n), this._updateDialCode(this.selectedCountryData.dialCode), this.options.formatOnDisplay) {
4833
4839
  const r = this._getTelInputValue();
4834
4840
  this._updateValFromNumber(r);
@@ -4837,106 +4843,106 @@ class Te {
4837
4843
  }
4838
4844
  }
4839
4845
  //* Set the input value and update the country.
4840
- setNumber(t) {
4841
- const n = this._normaliseNumerals(t), i = this._updateCountryFromNumber(n);
4842
- this._updateValFromNumber(n), i && this._triggerCountryChange(), this._trigger(Wt.INPUT, { isSetNumber: !0 });
4846
+ setNumber(e) {
4847
+ const n = this._normaliseNumerals(e), i = this._updateCountryFromNumber(n);
4848
+ this._updateValFromNumber(n), i && this._triggerCountryChange(), this._trigger(Vt.INPUT, { isSetNumber: !0 });
4843
4849
  }
4844
4850
  //* Set the placeholder number typ
4845
- setPlaceholderNumberType(t) {
4846
- this.options.placeholderNumberType = t, this._updatePlaceholder();
4851
+ setPlaceholderNumberType(e) {
4852
+ this.options.placeholderNumberType = e, this._updatePlaceholder();
4847
4853
  }
4848
- setDisabled(t) {
4849
- this.ui.telInput.disabled = t, t ? this.ui.selectedCountry.setAttribute("disabled", "true") : this.ui.selectedCountry.removeAttribute("disabled");
4854
+ setDisabled(e) {
4855
+ this.ui.telInput.disabled = e, e ? this.ui.selectedCountry.setAttribute("disabled", "true") : this.ui.selectedCountry.removeAttribute("disabled");
4850
4856
  }
4851
4857
  }
4852
- const js = (e) => {
4853
- if (!_.utils && !_.startedLoadingUtilsScript) {
4854
- let t;
4855
- if (typeof e == "function")
4858
+ const Ys = (t) => {
4859
+ if (!C.utils && !C.startedLoadingUtilsScript) {
4860
+ let e;
4861
+ if (typeof t == "function")
4856
4862
  try {
4857
- t = Promise.resolve(e());
4863
+ e = Promise.resolve(t());
4858
4864
  } catch (n) {
4859
4865
  return Promise.reject(n);
4860
4866
  }
4861
4867
  else
4862
4868
  return Promise.reject(
4863
4869
  new TypeError(
4864
- `The argument passed to attachUtils must be a function that returns a promise for the utilities module, not ${typeof e}`
4870
+ `The argument passed to attachUtils must be a function that returns a promise for the utilities module, not ${typeof t}`
4865
4871
  )
4866
4872
  );
4867
- return _.startedLoadingUtilsScript = !0, t.then((n) => {
4873
+ return C.startedLoadingUtilsScript = !0, e.then((n) => {
4868
4874
  const i = n == null ? void 0 : n.default;
4869
4875
  if (!i || typeof i != "object")
4870
4876
  throw new TypeError(
4871
4877
  "The loader function passed to attachUtils did not resolve to a module object with utils as its default export."
4872
4878
  );
4873
- return _.utils = i, kt("handleUtils"), !0;
4879
+ return C.utils = i, kt("handleUtils"), !0;
4874
4880
  }).catch((n) => {
4875
4881
  throw kt("rejectUtilsScriptPromise", n), n;
4876
4882
  });
4877
4883
  }
4878
4884
  return null;
4879
- }, kt = (e, ...t) => {
4880
- Object.values(_.instances).forEach((n) => {
4881
- const i = n[e];
4882
- typeof i == "function" && i.apply(n, t);
4885
+ }, kt = (t, ...e) => {
4886
+ Object.values(C.instances).forEach((n) => {
4887
+ const i = n[t];
4888
+ typeof i == "function" && i.apply(n, e);
4883
4889
  });
4884
- }, _ = Object.assign(
4885
- (e, t) => {
4886
- const n = new Te(e, t);
4887
- return _.instances[n.id] = n, e.iti = n, n;
4890
+ }, C = Object.assign(
4891
+ (t, e) => {
4892
+ const n = new Te(t, e);
4893
+ return C.instances[n.id] = n, t.iti = n, n;
4888
4894
  },
4889
4895
  {
4890
- defaults: kn,
4896
+ defaults: Mn,
4891
4897
  //* Using a static var like this allows us to mock it in the tests.
4892
4898
  documentReady: () => document.readyState === "complete",
4893
4899
  //* Get the country data object.
4894
- getCountryData: () => Et,
4900
+ getCountryData: () => Nt,
4895
4901
  //* A getter for the plugin instance.
4896
- getInstance: (e) => {
4897
- const t = e.dataset.intlTelInputId;
4898
- return t ? _.instances[t] : null;
4902
+ getInstance: (t) => {
4903
+ const e = t.dataset.intlTelInputId;
4904
+ return e ? C.instances[e] : null;
4899
4905
  },
4900
4906
  //* A map from instance ID to instance object.
4901
4907
  instances: {},
4902
- attachUtils: js,
4908
+ attachUtils: Ys,
4903
4909
  startedLoadingUtilsScript: !1,
4904
4910
  startedLoadingAutoCountry: !1,
4905
- version: "26.0.0-beta.1"
4911
+ version: "26.0.2"
4906
4912
  }
4907
4913
  );
4908
- var Gs = /* @__PURE__ */ es("<input/>");
4909
- function qs(e, t) {
4910
- vi(t, !0);
4911
- let n = Vt(t, "disabled", 3, !1), i = Vt(t, "inputProps", 19, () => ({})), s = Vt(t, "options", 19, () => ({})), r = Vt(t, "value", 3, ""), o = /* @__PURE__ */ Y(void 0), l = /* @__PURE__ */ Y(void 0), a = /* @__PURE__ */ Y(null), u = /* @__PURE__ */ Y(!1);
4914
+ var Ks = /* @__PURE__ */ is("<input/>");
4915
+ function Xs(t, e) {
4916
+ gi(e, !0);
4917
+ let n = Bt(e, "disabled", 3, !1), i = Bt(e, "inputProps", 19, () => ({})), s = Bt(e, "options", 19, () => ({})), r = Bt(e, "value", 3, ""), o = /* @__PURE__ */ G(void 0), l = /* @__PURE__ */ G(void 0), u = /* @__PURE__ */ G(null), a = /* @__PURE__ */ G(!1);
4912
4918
  const c = () => I(l) ? s().strictMode ? I(l).isValidNumberPrecise() : I(l).isValidNumber() : null, d = () => {
4913
- var p, m;
4919
+ var h, m;
4914
4920
  const v = c();
4915
- I(a) !== v && (W(a, v, !0), (p = t.onChangeValidity) == null || p.call(t, !!v), (m = t.onChangeErrorCode) == null || m.call(t, v ? null : I(l).getValidationError()));
4921
+ I(u) !== v && (V(u, v, !0), (h = e.onChangeValidity) == null || h.call(e, !!v), (m = e.onChangeErrorCode) == null || m.call(e, v ? null : I(l).getValidationError()));
4916
4922
  }, f = () => {
4917
- var v, p;
4918
- (p = t.onChangeNumber) == null || p.call(t, ((v = I(l)) == null ? void 0 : v.getNumber()) ?? ""), d();
4919
- }, h = () => {
4920
- var v, p;
4921
- (p = t.onChangeCountry) == null || p.call(t, ((v = I(l)) == null ? void 0 : v.getSelectedCountryData().iso2) ?? ""), f();
4923
+ var v, h;
4924
+ (h = e.onChangeNumber) == null || h.call(e, ((v = I(l)) == null ? void 0 : v.getNumber()) ?? ""), d();
4925
+ }, p = () => {
4926
+ var v, h;
4927
+ (h = e.onChangeCountry) == null || h.call(e, ((v = I(l)) == null ? void 0 : v.getSelectedCountryData().iso2) ?? ""), f();
4922
4928
  };
4923
- Bn(() => {
4924
- I(o) && (W(l, _(I(o), s()), !0), I(o).addEventListener("countrychange", h), r() && I(l).setNumber(r()), n() && I(l).setDisabled(n()), W(a, c(), !0), W(u, !0));
4925
- }), Vn(() => {
4929
+ Vn(() => {
4930
+ I(o) && (V(l, C(I(o), s()), !0), I(o).addEventListener("countrychange", p), r() && I(l).setNumber(r()), n() && I(l).setDisabled(n()), V(u, c(), !0), V(a, !0));
4931
+ }), Wn(() => {
4926
4932
  var v;
4927
- I(o) && I(o).removeEventListener("countrychange", h), (v = I(l)) == null || v.destroy();
4928
- }), Fi(() => {
4929
- I(u) && I(l) && I(l).setDisabled(n());
4933
+ I(o) && I(o).removeEventListener("countrychange", p), (v = I(l)) == null || v.destroy();
4934
+ }), Wi(() => {
4935
+ I(a) && I(l) && I(l).setDisabled(n());
4930
4936
  });
4931
- function C() {
4937
+ function _() {
4932
4938
  return I(l);
4933
4939
  }
4934
- function b() {
4940
+ function g() {
4935
4941
  return I(o);
4936
4942
  }
4937
- var g = { getInstance: C, getInput: b }, y = Gs();
4938
- return vs(y, () => ({ type: "tel", oninput: f, ...i() }), void 0, void 0, void 0, void 0, !0), ms(y, (v) => W(o, v), () => I(o)), ns(e, y), mi(g);
4943
+ var b = { getInstance: _, getInput: g }, y = Ks();
4944
+ return ms(y, () => ({ type: "tel", oninput: f, ...i() }), void 0, void 0, void 0, void 0, !0), bs(y, (v) => V(o, v), () => I(o)), ss(t, y), mi(b);
4939
4945
  }
4940
4946
  export {
4941
- qs as default
4947
+ Xs as default
4942
4948
  };