@helpdice/ui 1.7.3 → 1.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2330 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+
7
+ function _arrayLikeToArray(r, a) {
8
+ (null == a || a > r.length) && (a = r.length);
9
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
10
+ return n;
11
+ }
12
+ function _arrayWithHoles(r) {
13
+ if (Array.isArray(r)) return r;
14
+ }
15
+ function _defineProperty(e, r, t) {
16
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
17
+ value: t,
18
+ enumerable: true,
19
+ configurable: true,
20
+ writable: true
21
+ }) : e[r] = t, e;
22
+ }
23
+ function _iterableToArrayLimit(r, l) {
24
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
25
+ if (null != t) {
26
+ var e,
27
+ n,
28
+ i,
29
+ u,
30
+ a = [],
31
+ f = true,
32
+ o = false;
33
+ try {
34
+ if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
35
+ } catch (r) {
36
+ o = true, n = r;
37
+ } finally {
38
+ try {
39
+ if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
40
+ } finally {
41
+ if (o) throw n;
42
+ }
43
+ }
44
+ return a;
45
+ }
46
+ }
47
+ function _nonIterableRest() {
48
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
49
+ }
50
+ function ownKeys(e, r) {
51
+ var t = Object.keys(e);
52
+ if (Object.getOwnPropertySymbols) {
53
+ var o = Object.getOwnPropertySymbols(e);
54
+ r && (o = o.filter(function (r) {
55
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
56
+ })), t.push.apply(t, o);
57
+ }
58
+ return t;
59
+ }
60
+ function _objectSpread2(e) {
61
+ for (var r = 1; r < arguments.length; r++) {
62
+ var t = null != arguments[r] ? arguments[r] : {};
63
+ r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
64
+ _defineProperty(e, r, t[r]);
65
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
66
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
67
+ });
68
+ }
69
+ return e;
70
+ }
71
+ function _slicedToArray(r, e) {
72
+ return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
73
+ }
74
+ function _toPrimitive(t, r) {
75
+ if ("object" != typeof t || !t) return t;
76
+ var e = t[Symbol.toPrimitive];
77
+ if (void 0 !== e) {
78
+ var i = e.call(t, r);
79
+ if ("object" != typeof i) return i;
80
+ throw new TypeError("@@toPrimitive must return a primitive value.");
81
+ }
82
+ return ("string" === r ? String : Number)(t);
83
+ }
84
+ function _toPropertyKey(t) {
85
+ var i = _toPrimitive(t, "string");
86
+ return "symbol" == typeof i ? i : i + "";
87
+ }
88
+ function _typeof(o) {
89
+ "@babel/helpers - typeof";
90
+
91
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
92
+ return typeof o;
93
+ } : function (o) {
94
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
95
+ }, _typeof(o);
96
+ }
97
+ function _unsupportedIterableToArray(r, a) {
98
+ if (r) {
99
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
100
+ var t = {}.toString.call(r).slice(8, -1);
101
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
102
+ }
103
+ }
104
+
105
+ function getDefaultExportFromCjs (x) {
106
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
107
+ }
108
+
109
+ var index = {};
110
+
111
+ var hasRequiredIndex;
112
+
113
+ function requireIndex () {
114
+ if (hasRequiredIndex) return index;
115
+ hasRequiredIndex = 1;
116
+ var React$1 = React;
117
+
118
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
119
+
120
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React$1);
121
+
122
+ /*
123
+ Based on Glamor's sheet
124
+ https://github.com/threepointone/glamor/blob/667b480d31b3721a905021b26e1290ce92ca2879/src/sheet.js
125
+ */ function _defineProperties(target, props) {
126
+ for(var i = 0; i < props.length; i++){
127
+ var descriptor = props[i];
128
+ descriptor.enumerable = descriptor.enumerable || false;
129
+ descriptor.configurable = true;
130
+ if ("value" in descriptor) descriptor.writable = true;
131
+ Object.defineProperty(target, descriptor.key, descriptor);
132
+ }
133
+ }
134
+ function _createClass(Constructor, protoProps, staticProps) {
135
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
136
+ return Constructor;
137
+ }
138
+ var isProd = typeof process !== "undefined" && process.env && process.env.NODE_ENV === "production";
139
+ var isString = function(o) {
140
+ return Object.prototype.toString.call(o) === "[object String]";
141
+ };
142
+ var StyleSheet = /*#__PURE__*/ function() {
143
+ function StyleSheet(param) {
144
+ var ref = param === void 0 ? {} : param, _name = ref.name, name = _name === void 0 ? "stylesheet" : _name, _optimizeForSpeed = ref.optimizeForSpeed, optimizeForSpeed = _optimizeForSpeed === void 0 ? isProd : _optimizeForSpeed;
145
+ invariant$1(isString(name), "`name` must be a string");
146
+ this._name = name;
147
+ this._deletedRulePlaceholder = "#" + name + "-deleted-rule____{}";
148
+ invariant$1(typeof optimizeForSpeed === "boolean", "`optimizeForSpeed` must be a boolean");
149
+ this._optimizeForSpeed = optimizeForSpeed;
150
+ this._serverSheet = undefined;
151
+ this._tags = [];
152
+ this._injected = false;
153
+ this._rulesCount = 0;
154
+ var node = typeof window !== "undefined" && document.querySelector('meta[property="csp-nonce"]');
155
+ this._nonce = node ? node.getAttribute("content") : null;
156
+ }
157
+ var _proto = StyleSheet.prototype;
158
+ _proto.setOptimizeForSpeed = function setOptimizeForSpeed(bool) {
159
+ invariant$1(typeof bool === "boolean", "`setOptimizeForSpeed` accepts a boolean");
160
+ invariant$1(this._rulesCount === 0, "optimizeForSpeed cannot be when rules have already been inserted");
161
+ this.flush();
162
+ this._optimizeForSpeed = bool;
163
+ this.inject();
164
+ };
165
+ _proto.isOptimizeForSpeed = function isOptimizeForSpeed() {
166
+ return this._optimizeForSpeed;
167
+ };
168
+ _proto.inject = function inject() {
169
+ var _this = this;
170
+ invariant$1(!this._injected, "sheet already injected");
171
+ this._injected = true;
172
+ if (typeof window !== "undefined" && this._optimizeForSpeed) {
173
+ this._tags[0] = this.makeStyleTag(this._name);
174
+ this._optimizeForSpeed = "insertRule" in this.getSheet();
175
+ if (!this._optimizeForSpeed) {
176
+ if (!isProd) {
177
+ console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode.");
178
+ }
179
+ this.flush();
180
+ this._injected = true;
181
+ }
182
+ return;
183
+ }
184
+ this._serverSheet = {
185
+ cssRules: [],
186
+ insertRule: function(rule, index) {
187
+ if (typeof index === "number") {
188
+ _this._serverSheet.cssRules[index] = {
189
+ cssText: rule
190
+ };
191
+ } else {
192
+ _this._serverSheet.cssRules.push({
193
+ cssText: rule
194
+ });
195
+ }
196
+ return index;
197
+ },
198
+ deleteRule: function(index) {
199
+ _this._serverSheet.cssRules[index] = null;
200
+ }
201
+ };
202
+ };
203
+ _proto.getSheetForTag = function getSheetForTag(tag) {
204
+ if (tag.sheet) {
205
+ return tag.sheet;
206
+ }
207
+ // this weirdness brought to you by firefox
208
+ for(var i = 0; i < document.styleSheets.length; i++){
209
+ if (document.styleSheets[i].ownerNode === tag) {
210
+ return document.styleSheets[i];
211
+ }
212
+ }
213
+ };
214
+ _proto.getSheet = function getSheet() {
215
+ return this.getSheetForTag(this._tags[this._tags.length - 1]);
216
+ };
217
+ _proto.insertRule = function insertRule(rule, index) {
218
+ invariant$1(isString(rule), "`insertRule` accepts only strings");
219
+ if (typeof window === "undefined") {
220
+ if (typeof index !== "number") {
221
+ index = this._serverSheet.cssRules.length;
222
+ }
223
+ this._serverSheet.insertRule(rule, index);
224
+ return this._rulesCount++;
225
+ }
226
+ if (this._optimizeForSpeed) {
227
+ var sheet = this.getSheet();
228
+ if (typeof index !== "number") {
229
+ index = sheet.cssRules.length;
230
+ }
231
+ // this weirdness for perf, and chrome's weird bug
232
+ // https://stackoverflow.com/questions/20007992/chrome-suddenly-stopped-accepting-insertrule
233
+ try {
234
+ sheet.insertRule(rule, index);
235
+ } catch (error) {
236
+ if (!isProd) {
237
+ console.warn("StyleSheet: illegal rule: \n\n" + rule + "\n\nSee https://stackoverflow.com/q/20007992 for more info");
238
+ }
239
+ return -1;
240
+ }
241
+ } else {
242
+ var insertionPoint = this._tags[index];
243
+ this._tags.push(this.makeStyleTag(this._name, rule, insertionPoint));
244
+ }
245
+ return this._rulesCount++;
246
+ };
247
+ _proto.replaceRule = function replaceRule(index, rule) {
248
+ if (this._optimizeForSpeed || typeof window === "undefined") {
249
+ var sheet = typeof window !== "undefined" ? this.getSheet() : this._serverSheet;
250
+ if (!rule.trim()) {
251
+ rule = this._deletedRulePlaceholder;
252
+ }
253
+ if (!sheet.cssRules[index]) {
254
+ // @TBD Should we throw an error?
255
+ return index;
256
+ }
257
+ sheet.deleteRule(index);
258
+ try {
259
+ sheet.insertRule(rule, index);
260
+ } catch (error) {
261
+ if (!isProd) {
262
+ console.warn("StyleSheet: illegal rule: \n\n" + rule + "\n\nSee https://stackoverflow.com/q/20007992 for more info");
263
+ }
264
+ // In order to preserve the indices we insert a deleteRulePlaceholder
265
+ sheet.insertRule(this._deletedRulePlaceholder, index);
266
+ }
267
+ } else {
268
+ var tag = this._tags[index];
269
+ invariant$1(tag, "old rule at index `" + index + "` not found");
270
+ tag.textContent = rule;
271
+ }
272
+ return index;
273
+ };
274
+ _proto.deleteRule = function deleteRule(index) {
275
+ if (typeof window === "undefined") {
276
+ this._serverSheet.deleteRule(index);
277
+ return;
278
+ }
279
+ if (this._optimizeForSpeed) {
280
+ this.replaceRule(index, "");
281
+ } else {
282
+ var tag = this._tags[index];
283
+ invariant$1(tag, "rule at index `" + index + "` not found");
284
+ tag.parentNode.removeChild(tag);
285
+ this._tags[index] = null;
286
+ }
287
+ };
288
+ _proto.flush = function flush() {
289
+ this._injected = false;
290
+ this._rulesCount = 0;
291
+ if (typeof window !== "undefined") {
292
+ this._tags.forEach(function(tag) {
293
+ return tag && tag.parentNode.removeChild(tag);
294
+ });
295
+ this._tags = [];
296
+ } else {
297
+ // simpler on server
298
+ this._serverSheet.cssRules = [];
299
+ }
300
+ };
301
+ _proto.cssRules = function cssRules() {
302
+ var _this = this;
303
+ if (typeof window === "undefined") {
304
+ return this._serverSheet.cssRules;
305
+ }
306
+ return this._tags.reduce(function(rules, tag) {
307
+ if (tag) {
308
+ rules = rules.concat(Array.prototype.map.call(_this.getSheetForTag(tag).cssRules, function(rule) {
309
+ return rule.cssText === _this._deletedRulePlaceholder ? null : rule;
310
+ }));
311
+ } else {
312
+ rules.push(null);
313
+ }
314
+ return rules;
315
+ }, []);
316
+ };
317
+ _proto.makeStyleTag = function makeStyleTag(name, cssString, relativeToTag) {
318
+ if (cssString) {
319
+ invariant$1(isString(cssString), "makeStyleTag accepts only strings as second parameter");
320
+ }
321
+ var tag = document.createElement("style");
322
+ if (this._nonce) tag.setAttribute("nonce", this._nonce);
323
+ tag.type = "text/css";
324
+ tag.setAttribute("data-" + name, "");
325
+ if (cssString) {
326
+ tag.appendChild(document.createTextNode(cssString));
327
+ }
328
+ var head = document.head || document.getElementsByTagName("head")[0];
329
+ if (relativeToTag) {
330
+ head.insertBefore(tag, relativeToTag);
331
+ } else {
332
+ head.appendChild(tag);
333
+ }
334
+ return tag;
335
+ };
336
+ _createClass(StyleSheet, [
337
+ {
338
+ key: "length",
339
+ get: function get() {
340
+ return this._rulesCount;
341
+ }
342
+ }
343
+ ]);
344
+ return StyleSheet;
345
+ }();
346
+ function invariant$1(condition, message) {
347
+ if (!condition) {
348
+ throw new Error("StyleSheet: " + message + ".");
349
+ }
350
+ }
351
+
352
+ function hash(str) {
353
+ var _$hash = 5381, i = str.length;
354
+ while(i){
355
+ _$hash = _$hash * 33 ^ str.charCodeAt(--i);
356
+ }
357
+ /* JavaScript does bitwise operations (like XOR, above) on 32-bit signed
358
+ * integers. Since we want the results to be always positive, convert the
359
+ * signed int to an unsigned by doing an unsigned bitshift. */ return _$hash >>> 0;
360
+ }
361
+ var stringHash = hash;
362
+
363
+ var sanitize = function(rule) {
364
+ return rule.replace(/\/style/gi, "\\/style");
365
+ };
366
+ var cache = {};
367
+ /**
368
+ * computeId
369
+ *
370
+ * Compute and memoize a jsx id from a basedId and optionally props.
371
+ */ function computeId(baseId, props) {
372
+ if (!props) {
373
+ return "jsx-" + baseId;
374
+ }
375
+ var propsToString = String(props);
376
+ var key = baseId + propsToString;
377
+ if (!cache[key]) {
378
+ cache[key] = "jsx-" + stringHash(baseId + "-" + propsToString);
379
+ }
380
+ return cache[key];
381
+ }
382
+ /**
383
+ * computeSelector
384
+ *
385
+ * Compute and memoize dynamic selectors.
386
+ */ function computeSelector(id, css) {
387
+ var selectoPlaceholderRegexp = /__jsx-style-dynamic-selector/g;
388
+ // Sanitize SSR-ed CSS.
389
+ // Client side code doesn't need to be sanitized since we use
390
+ // document.createTextNode (dev) and the CSSOM api sheet.insertRule (prod).
391
+ if (typeof window === "undefined") {
392
+ css = sanitize(css);
393
+ }
394
+ var idcss = id + css;
395
+ if (!cache[idcss]) {
396
+ cache[idcss] = css.replace(selectoPlaceholderRegexp, id);
397
+ }
398
+ return cache[idcss];
399
+ }
400
+
401
+ function mapRulesToStyle(cssRules, options) {
402
+ if (options === void 0) options = {};
403
+ return cssRules.map(function(args) {
404
+ var id = args[0];
405
+ var css = args[1];
406
+ return /*#__PURE__*/ React__default["default"].createElement("style", {
407
+ id: "__" + id,
408
+ // Avoid warnings upon render with a key
409
+ key: "__" + id,
410
+ nonce: options.nonce ? options.nonce : undefined,
411
+ dangerouslySetInnerHTML: {
412
+ __html: css
413
+ }
414
+ });
415
+ });
416
+ }
417
+ var StyleSheetRegistry = /*#__PURE__*/ function() {
418
+ function StyleSheetRegistry(param) {
419
+ var ref = param === void 0 ? {} : param, _styleSheet = ref.styleSheet, styleSheet = _styleSheet === void 0 ? null : _styleSheet, _optimizeForSpeed = ref.optimizeForSpeed, optimizeForSpeed = _optimizeForSpeed === void 0 ? false : _optimizeForSpeed;
420
+ this._sheet = styleSheet || new StyleSheet({
421
+ name: "styled-jsx",
422
+ optimizeForSpeed: optimizeForSpeed
423
+ });
424
+ this._sheet.inject();
425
+ if (styleSheet && typeof optimizeForSpeed === "boolean") {
426
+ this._sheet.setOptimizeForSpeed(optimizeForSpeed);
427
+ this._optimizeForSpeed = this._sheet.isOptimizeForSpeed();
428
+ }
429
+ this._fromServer = undefined;
430
+ this._indices = {};
431
+ this._instancesCounts = {};
432
+ }
433
+ var _proto = StyleSheetRegistry.prototype;
434
+ _proto.add = function add(props) {
435
+ var _this = this;
436
+ if (undefined === this._optimizeForSpeed) {
437
+ this._optimizeForSpeed = Array.isArray(props.children);
438
+ this._sheet.setOptimizeForSpeed(this._optimizeForSpeed);
439
+ this._optimizeForSpeed = this._sheet.isOptimizeForSpeed();
440
+ }
441
+ if (typeof window !== "undefined" && !this._fromServer) {
442
+ this._fromServer = this.selectFromServer();
443
+ this._instancesCounts = Object.keys(this._fromServer).reduce(function(acc, tagName) {
444
+ acc[tagName] = 0;
445
+ return acc;
446
+ }, {});
447
+ }
448
+ var ref = this.getIdAndRules(props), styleId = ref.styleId, rules = ref.rules;
449
+ // Deduping: just increase the instances count.
450
+ if (styleId in this._instancesCounts) {
451
+ this._instancesCounts[styleId] += 1;
452
+ return;
453
+ }
454
+ var indices = rules.map(function(rule) {
455
+ return _this._sheet.insertRule(rule);
456
+ })// Filter out invalid rules
457
+ .filter(function(index) {
458
+ return index !== -1;
459
+ });
460
+ this._indices[styleId] = indices;
461
+ this._instancesCounts[styleId] = 1;
462
+ };
463
+ _proto.remove = function remove(props) {
464
+ var _this = this;
465
+ var styleId = this.getIdAndRules(props).styleId;
466
+ invariant(styleId in this._instancesCounts, "styleId: `" + styleId + "` not found");
467
+ this._instancesCounts[styleId] -= 1;
468
+ if (this._instancesCounts[styleId] < 1) {
469
+ var tagFromServer = this._fromServer && this._fromServer[styleId];
470
+ if (tagFromServer) {
471
+ tagFromServer.parentNode.removeChild(tagFromServer);
472
+ delete this._fromServer[styleId];
473
+ } else {
474
+ this._indices[styleId].forEach(function(index) {
475
+ return _this._sheet.deleteRule(index);
476
+ });
477
+ delete this._indices[styleId];
478
+ }
479
+ delete this._instancesCounts[styleId];
480
+ }
481
+ };
482
+ _proto.update = function update(props, nextProps) {
483
+ this.add(nextProps);
484
+ this.remove(props);
485
+ };
486
+ _proto.flush = function flush() {
487
+ this._sheet.flush();
488
+ this._sheet.inject();
489
+ this._fromServer = undefined;
490
+ this._indices = {};
491
+ this._instancesCounts = {};
492
+ };
493
+ _proto.cssRules = function cssRules() {
494
+ var _this = this;
495
+ var fromServer = this._fromServer ? Object.keys(this._fromServer).map(function(styleId) {
496
+ return [
497
+ styleId,
498
+ _this._fromServer[styleId]
499
+ ];
500
+ }) : [];
501
+ var cssRules = this._sheet.cssRules();
502
+ return fromServer.concat(Object.keys(this._indices).map(function(styleId) {
503
+ return [
504
+ styleId,
505
+ _this._indices[styleId].map(function(index) {
506
+ return cssRules[index].cssText;
507
+ }).join(_this._optimizeForSpeed ? "" : "\n")
508
+ ];
509
+ })// filter out empty rules
510
+ .filter(function(rule) {
511
+ return Boolean(rule[1]);
512
+ }));
513
+ };
514
+ _proto.styles = function styles(options) {
515
+ return mapRulesToStyle(this.cssRules(), options);
516
+ };
517
+ _proto.getIdAndRules = function getIdAndRules(props) {
518
+ var css = props.children, dynamic = props.dynamic, id = props.id;
519
+ if (dynamic) {
520
+ var styleId = computeId(id, dynamic);
521
+ return {
522
+ styleId: styleId,
523
+ rules: Array.isArray(css) ? css.map(function(rule) {
524
+ return computeSelector(styleId, rule);
525
+ }) : [
526
+ computeSelector(styleId, css)
527
+ ]
528
+ };
529
+ }
530
+ return {
531
+ styleId: computeId(id),
532
+ rules: Array.isArray(css) ? css : [
533
+ css
534
+ ]
535
+ };
536
+ };
537
+ /**
538
+ * selectFromServer
539
+ *
540
+ * Collects style tags from the document with id __jsx-XXX
541
+ */ _proto.selectFromServer = function selectFromServer() {
542
+ var elements = Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]'));
543
+ return elements.reduce(function(acc, element) {
544
+ var id = element.id.slice(2);
545
+ acc[id] = element;
546
+ return acc;
547
+ }, {});
548
+ };
549
+ return StyleSheetRegistry;
550
+ }();
551
+ function invariant(condition, message) {
552
+ if (!condition) {
553
+ throw new Error("StyleSheetRegistry: " + message + ".");
554
+ }
555
+ }
556
+ var StyleSheetContext = /*#__PURE__*/ React$1.createContext(null);
557
+ StyleSheetContext.displayName = "StyleSheetContext";
558
+ function createStyleRegistry() {
559
+ return new StyleSheetRegistry();
560
+ }
561
+ function StyleRegistry(param) {
562
+ var configuredRegistry = param.registry, children = param.children;
563
+ var rootRegistry = React$1.useContext(StyleSheetContext);
564
+ var ref = React$1.useState(function() {
565
+ return rootRegistry || configuredRegistry || createStyleRegistry();
566
+ }), registry = ref[0];
567
+ return /*#__PURE__*/ React__default["default"].createElement(StyleSheetContext.Provider, {
568
+ value: registry
569
+ }, children);
570
+ }
571
+ function useStyleRegistry() {
572
+ return React$1.useContext(StyleSheetContext);
573
+ }
574
+
575
+ // Opt-into the new `useInsertionEffect` API in React 18, fallback to `useLayoutEffect`.
576
+ // https://github.com/reactwg/react-18/discussions/110
577
+ var useInsertionEffect = React__default["default"].useInsertionEffect || React$1.useLayoutEffect;
578
+ var defaultRegistry = typeof window !== "undefined" ? createStyleRegistry() : undefined;
579
+ function JSXStyle(props) {
580
+ var registry = defaultRegistry ? defaultRegistry : useStyleRegistry();
581
+ var insertionEffectCalled = React$1.useRef(false);
582
+ // `registry` might not exist while server-side rendering
583
+ if (!registry) {
584
+ return null;
585
+ }
586
+ if (typeof window === "undefined") {
587
+ registry.add(props);
588
+ return null;
589
+ }
590
+ useInsertionEffect(function() {
591
+ // ReactDOM removes all DOM during hydration in certain cases
592
+ if (!document.head) {
593
+ return;
594
+ }
595
+ registry.add(props);
596
+ insertionEffectCalled.current = true;
597
+ return function() {
598
+ insertionEffectCalled.current = false;
599
+ registry.remove(props);
600
+ };
601
+ }, [
602
+ props.id,
603
+ String(props.dynamic)
604
+ ]);
605
+ React$1.useLayoutEffect(function() {
606
+ if (!document.head || insertionEffectCalled.current) {
607
+ return;
608
+ }
609
+ registry.add(props);
610
+ return function() {
611
+ registry.remove(props);
612
+ };
613
+ // props.children can be string[], will be striped since id is identical
614
+ }, [
615
+ props.id,
616
+ String(props.dynamic)
617
+ ]);
618
+ return null;
619
+ }
620
+ JSXStyle.dynamic = function(info) {
621
+ return info.map(function(tagInfo) {
622
+ var baseId = tagInfo[0];
623
+ var props = tagInfo[1];
624
+ return computeId(baseId, props);
625
+ }).join(" ");
626
+ };
627
+
628
+ index.StyleRegistry = StyleRegistry;
629
+ index.createStyleRegistry = createStyleRegistry;
630
+ index.style = JSXStyle;
631
+ index.useStyleRegistry = useStyleRegistry;
632
+ return index;
633
+ }
634
+
635
+ var style;
636
+ var hasRequiredStyle;
637
+
638
+ function requireStyle () {
639
+ if (hasRequiredStyle) return style;
640
+ hasRequiredStyle = 1;
641
+ style = requireIndex().style;
642
+ return style;
643
+ }
644
+
645
+ var styleExports = requireStyle();
646
+ var _JSXStyle = /*@__PURE__*/getDefaultExportFromCjs(styleExports);
647
+
648
+ var countries = [
649
+ {
650
+ code: "AD",
651
+ label: "Andorra",
652
+ phone: "+376"
653
+ },
654
+ {
655
+ code: "AE",
656
+ label: "United Arab Emirates",
657
+ phone: "+971"
658
+ },
659
+ {
660
+ code: "AF",
661
+ label: "Afghanistan",
662
+ phone: "+93"
663
+ },
664
+ {
665
+ code: "AG",
666
+ label: "Antigua and Barbuda",
667
+ phone: "+1-268"
668
+ },
669
+ {
670
+ code: "AI",
671
+ label: "Anguilla",
672
+ phone: "+1-264"
673
+ },
674
+ {
675
+ code: "AL",
676
+ label: "Albania",
677
+ phone: "+355"
678
+ },
679
+ {
680
+ code: "AM",
681
+ label: "Armenia",
682
+ phone: "+374"
683
+ },
684
+ {
685
+ code: "AO",
686
+ label: "Angola",
687
+ phone: "+244"
688
+ },
689
+ {
690
+ code: "AQ",
691
+ label: "Antarctica",
692
+ phone: "+672"
693
+ },
694
+ {
695
+ code: "AR",
696
+ label: "Argentina",
697
+ phone: "+54"
698
+ },
699
+ {
700
+ code: "AS",
701
+ label: "American Samoa",
702
+ phone: "+1-684"
703
+ },
704
+ {
705
+ code: "AT",
706
+ label: "Austria",
707
+ phone: "+43"
708
+ },
709
+ {
710
+ code: "AU",
711
+ label: "Australia",
712
+ phone: "+61",
713
+ suggested: true
714
+ },
715
+ {
716
+ code: "AW",
717
+ label: "Aruba",
718
+ phone: "+297"
719
+ },
720
+ {
721
+ code: "AX",
722
+ label: "Alland Islands",
723
+ phone: "+358"
724
+ },
725
+ {
726
+ code: "AZ",
727
+ label: "Azerbaijan",
728
+ phone: "+994"
729
+ },
730
+ {
731
+ code: "BA",
732
+ label: "Bosnia and Herzegovina",
733
+ phone: "+387"
734
+ },
735
+ {
736
+ code: "BB",
737
+ label: "Barbados",
738
+ phone: "+1-246"
739
+ },
740
+ {
741
+ code: "BD",
742
+ label: "Bangladesh",
743
+ phone: "+880"
744
+ },
745
+ {
746
+ code: "BE",
747
+ label: "Belgium",
748
+ phone: "+32"
749
+ },
750
+ {
751
+ code: "BF",
752
+ label: "Burkina Faso",
753
+ phone: "+226"
754
+ },
755
+ {
756
+ code: "BG",
757
+ label: "Bulgaria",
758
+ phone: "+359"
759
+ },
760
+ {
761
+ code: "BH",
762
+ label: "Bahrain",
763
+ phone: "+973"
764
+ },
765
+ {
766
+ code: "BI",
767
+ label: "Burundi",
768
+ phone: "+257"
769
+ },
770
+ {
771
+ code: "BJ",
772
+ label: "Benin",
773
+ phone: "+229"
774
+ },
775
+ {
776
+ code: "BL",
777
+ label: "Saint Barthelemy",
778
+ phone: "+590"
779
+ },
780
+ {
781
+ code: "BM",
782
+ label: "Bermuda",
783
+ phone: "+1-441"
784
+ },
785
+ {
786
+ code: "BN",
787
+ label: "Brunei Darussalam",
788
+ phone: "+673"
789
+ },
790
+ {
791
+ code: "BO",
792
+ label: "Bolivia",
793
+ phone: "+591"
794
+ },
795
+ {
796
+ code: "BR",
797
+ label: "Brazil",
798
+ phone: "+55"
799
+ },
800
+ {
801
+ code: "BS",
802
+ label: "Bahamas",
803
+ phone: "+1-242"
804
+ },
805
+ {
806
+ code: "BT",
807
+ label: "Bhutan",
808
+ phone: "+975"
809
+ },
810
+ {
811
+ code: "BV",
812
+ label: "Bouvet Island",
813
+ phone: "+47"
814
+ },
815
+ {
816
+ code: "BW",
817
+ label: "Botswana",
818
+ phone: "+267"
819
+ },
820
+ {
821
+ code: "BY",
822
+ label: "Belarus",
823
+ phone: "+375"
824
+ },
825
+ {
826
+ code: "BZ",
827
+ label: "Belize",
828
+ phone: "+501"
829
+ },
830
+ {
831
+ code: "CA",
832
+ label: "Canada",
833
+ phone: "+1",
834
+ suggested: true
835
+ },
836
+ {
837
+ code: "CC",
838
+ label: "Cocos (Keeling) Islands",
839
+ phone: "+61"
840
+ },
841
+ {
842
+ code: "CD",
843
+ label: "Congo, Democratic Republic of the",
844
+ phone: "+243"
845
+ },
846
+ {
847
+ code: "CF",
848
+ label: "Central African Republic",
849
+ phone: "+236"
850
+ },
851
+ {
852
+ code: "CG",
853
+ label: "Congo, Republic of the",
854
+ phone: "+242"
855
+ },
856
+ {
857
+ code: "CH",
858
+ label: "Switzerland",
859
+ phone: "+41"
860
+ },
861
+ {
862
+ code: "CI",
863
+ label: "Cote d'Ivoire",
864
+ phone: "+225"
865
+ },
866
+ {
867
+ code: "CK",
868
+ label: "Cook Islands",
869
+ phone: "+682"
870
+ },
871
+ {
872
+ code: "CL",
873
+ label: "Chile",
874
+ phone: "+56"
875
+ },
876
+ {
877
+ code: "CM",
878
+ label: "Cameroon",
879
+ phone: "+237"
880
+ },
881
+ {
882
+ code: "CN",
883
+ label: "China",
884
+ phone: "+86"
885
+ },
886
+ {
887
+ code: "CO",
888
+ label: "Colombia",
889
+ phone: "+57"
890
+ },
891
+ {
892
+ code: "CR",
893
+ label: "Costa Rica",
894
+ phone: "+506"
895
+ },
896
+ {
897
+ code: "CU",
898
+ label: "Cuba",
899
+ phone: "+53"
900
+ },
901
+ {
902
+ code: "CV",
903
+ label: "Cape Verde",
904
+ phone: "+238"
905
+ },
906
+ {
907
+ code: "CW",
908
+ label: "Curacao",
909
+ phone: "+599"
910
+ },
911
+ {
912
+ code: "CX",
913
+ label: "Christmas Island",
914
+ phone: "+61"
915
+ },
916
+ {
917
+ code: "CY",
918
+ label: "Cyprus",
919
+ phone: "+357"
920
+ },
921
+ {
922
+ code: "CZ",
923
+ label: "Czech Republic",
924
+ phone: "+420"
925
+ },
926
+ {
927
+ code: "DE",
928
+ label: "Germany",
929
+ phone: "+49",
930
+ suggested: true
931
+ },
932
+ {
933
+ code: "DJ",
934
+ label: "Djibouti",
935
+ phone: "+253"
936
+ },
937
+ {
938
+ code: "DK",
939
+ label: "Denmark",
940
+ phone: "+45"
941
+ },
942
+ {
943
+ code: "DM",
944
+ label: "Dominica",
945
+ phone: "+1-767"
946
+ },
947
+ {
948
+ code: "DO",
949
+ label: "Dominican Republic",
950
+ phone: "+1-809"
951
+ },
952
+ {
953
+ code: "DZ",
954
+ label: "Algeria",
955
+ phone: "+213"
956
+ },
957
+ {
958
+ code: "EC",
959
+ label: "Ecuador",
960
+ phone: "+593"
961
+ },
962
+ {
963
+ code: "EE",
964
+ label: "Estonia",
965
+ phone: "+372"
966
+ },
967
+ {
968
+ code: "EG",
969
+ label: "Egypt",
970
+ phone: "+20"
971
+ },
972
+ {
973
+ code: "EH",
974
+ label: "Western Sahara",
975
+ phone: "+212"
976
+ },
977
+ {
978
+ code: "ER",
979
+ label: "Eritrea",
980
+ phone: "+291"
981
+ },
982
+ {
983
+ code: "ES",
984
+ label: "Spain",
985
+ phone: "+34"
986
+ },
987
+ {
988
+ code: "ET",
989
+ label: "Ethiopia",
990
+ phone: "+251"
991
+ },
992
+ {
993
+ code: "FI",
994
+ label: "Finland",
995
+ phone: "+358"
996
+ },
997
+ {
998
+ code: "FJ",
999
+ label: "Fiji",
1000
+ phone: "+679"
1001
+ },
1002
+ {
1003
+ code: "FK",
1004
+ label: "Falkland Islands (Malvinas)",
1005
+ phone: "+500"
1006
+ },
1007
+ {
1008
+ code: "FM",
1009
+ label: "Micronesia, Federated States of",
1010
+ phone: "+691"
1011
+ },
1012
+ {
1013
+ code: "FO",
1014
+ label: "Faroe Islands",
1015
+ phone: "+298"
1016
+ },
1017
+ {
1018
+ code: "FR",
1019
+ label: "France",
1020
+ phone: "+33",
1021
+ suggested: true
1022
+ },
1023
+ {
1024
+ code: "GA",
1025
+ label: "Gabon",
1026
+ phone: "+241"
1027
+ },
1028
+ {
1029
+ code: "GB",
1030
+ label: "United Kingdom",
1031
+ phone: "+44"
1032
+ },
1033
+ {
1034
+ code: "GD",
1035
+ label: "Grenada",
1036
+ phone: "+1-473"
1037
+ },
1038
+ {
1039
+ code: "GE",
1040
+ label: "Georgia",
1041
+ phone: "+995"
1042
+ },
1043
+ {
1044
+ code: "GF",
1045
+ label: "French Guiana",
1046
+ phone: "+594"
1047
+ },
1048
+ {
1049
+ code: "GG",
1050
+ label: "Guernsey",
1051
+ phone: "+44"
1052
+ },
1053
+ {
1054
+ code: "GH",
1055
+ label: "Ghana",
1056
+ phone: "+233"
1057
+ },
1058
+ {
1059
+ code: "GI",
1060
+ label: "Gibraltar",
1061
+ phone: "+350"
1062
+ },
1063
+ {
1064
+ code: "GL",
1065
+ label: "Greenland",
1066
+ phone: "+299"
1067
+ },
1068
+ {
1069
+ code: "GM",
1070
+ label: "Gambia",
1071
+ phone: "+220"
1072
+ },
1073
+ {
1074
+ code: "GN",
1075
+ label: "Guinea",
1076
+ phone: "+224"
1077
+ },
1078
+ {
1079
+ code: "GP",
1080
+ label: "Guadeloupe",
1081
+ phone: "+590"
1082
+ },
1083
+ {
1084
+ code: "GQ",
1085
+ label: "Equatorial Guinea",
1086
+ phone: "+240"
1087
+ },
1088
+ {
1089
+ code: "GR",
1090
+ label: "Greece",
1091
+ phone: "+30"
1092
+ },
1093
+ {
1094
+ code: "GS",
1095
+ label: "South Georgia and the South Sandwich Islands",
1096
+ phone: "+500"
1097
+ },
1098
+ {
1099
+ code: "GT",
1100
+ label: "Guatemala",
1101
+ phone: "+502"
1102
+ },
1103
+ {
1104
+ code: "GU",
1105
+ label: "Guam",
1106
+ phone: "+1-671"
1107
+ },
1108
+ {
1109
+ code: "GW",
1110
+ label: "Guinea-Bissau",
1111
+ phone: "+245"
1112
+ },
1113
+ {
1114
+ code: "GY",
1115
+ label: "Guyana",
1116
+ phone: "+592"
1117
+ },
1118
+ {
1119
+ code: "HK",
1120
+ label: "Hong Kong",
1121
+ phone: "+852"
1122
+ },
1123
+ {
1124
+ code: "HM",
1125
+ label: "Heard Island and McDonald Islands",
1126
+ phone: "+672"
1127
+ },
1128
+ {
1129
+ code: "HN",
1130
+ label: "Honduras",
1131
+ phone: "+504"
1132
+ },
1133
+ {
1134
+ code: "HR",
1135
+ label: "Croatia",
1136
+ phone: "+385"
1137
+ },
1138
+ {
1139
+ code: "HT",
1140
+ label: "Haiti",
1141
+ phone: "+509"
1142
+ },
1143
+ {
1144
+ code: "HU",
1145
+ label: "Hungary",
1146
+ phone: "+36"
1147
+ },
1148
+ {
1149
+ code: "ID",
1150
+ label: "Indonesia",
1151
+ phone: "+62"
1152
+ },
1153
+ {
1154
+ code: "IE",
1155
+ label: "Ireland",
1156
+ phone: "+353"
1157
+ },
1158
+ {
1159
+ code: "IL",
1160
+ label: "Israel",
1161
+ phone: "+972"
1162
+ },
1163
+ {
1164
+ code: "IM",
1165
+ label: "Isle of Man",
1166
+ phone: "+44"
1167
+ },
1168
+ {
1169
+ code: "IN",
1170
+ label: "India",
1171
+ phone: "+91"
1172
+ },
1173
+ {
1174
+ code: "IO",
1175
+ label: "British Indian Ocean Territory",
1176
+ phone: "+246"
1177
+ },
1178
+ {
1179
+ code: "IQ",
1180
+ label: "Iraq",
1181
+ phone: "+964"
1182
+ },
1183
+ {
1184
+ code: "IR",
1185
+ label: "Iran, Islamic Republic of",
1186
+ phone: "+98"
1187
+ },
1188
+ {
1189
+ code: "IS",
1190
+ label: "Iceland",
1191
+ phone: "+354"
1192
+ },
1193
+ {
1194
+ code: "IT",
1195
+ label: "Italy",
1196
+ phone: "+39"
1197
+ },
1198
+ {
1199
+ code: "JE",
1200
+ label: "Jersey",
1201
+ phone: "+44"
1202
+ },
1203
+ {
1204
+ code: "JM",
1205
+ label: "Jamaica",
1206
+ phone: "+1-876"
1207
+ },
1208
+ {
1209
+ code: "JO",
1210
+ label: "Jordan",
1211
+ phone: "+962"
1212
+ },
1213
+ {
1214
+ code: "JP",
1215
+ label: "Japan",
1216
+ phone: "+81",
1217
+ suggested: true
1218
+ },
1219
+ {
1220
+ code: "KE",
1221
+ label: "Kenya",
1222
+ phone: "+254"
1223
+ },
1224
+ {
1225
+ code: "KG",
1226
+ label: "Kyrgyzstan",
1227
+ phone: "+996"
1228
+ },
1229
+ {
1230
+ code: "KH",
1231
+ label: "Cambodia",
1232
+ phone: "+855"
1233
+ },
1234
+ {
1235
+ code: "KI",
1236
+ label: "Kiribati",
1237
+ phone: "+686"
1238
+ },
1239
+ {
1240
+ code: "KM",
1241
+ label: "Comoros",
1242
+ phone: "+269"
1243
+ },
1244
+ {
1245
+ code: "KN",
1246
+ label: "Saint Kitts and Nevis",
1247
+ phone: "+1-869"
1248
+ },
1249
+ {
1250
+ code: "KP",
1251
+ label: "Korea, Democratic People's Republic of",
1252
+ phone: "+850"
1253
+ },
1254
+ {
1255
+ code: "KR",
1256
+ label: "Korea, Republic of",
1257
+ phone: "+82"
1258
+ },
1259
+ {
1260
+ code: "KW",
1261
+ label: "Kuwait",
1262
+ phone: "+965"
1263
+ },
1264
+ {
1265
+ code: "KY",
1266
+ label: "Cayman Islands",
1267
+ phone: "+1-345"
1268
+ },
1269
+ {
1270
+ code: "KZ",
1271
+ label: "Kazakhstan",
1272
+ phone: "+7"
1273
+ },
1274
+ {
1275
+ code: "LA",
1276
+ label: "Lao People's Democratic Republic",
1277
+ phone: "+856"
1278
+ },
1279
+ {
1280
+ code: "LB",
1281
+ label: "Lebanon",
1282
+ phone: "+961"
1283
+ },
1284
+ {
1285
+ code: "LC",
1286
+ label: "Saint Lucia",
1287
+ phone: "+1-758"
1288
+ },
1289
+ {
1290
+ code: "LI",
1291
+ label: "Liechtenstein",
1292
+ phone: "+423"
1293
+ },
1294
+ {
1295
+ code: "LK",
1296
+ label: "Sri Lanka",
1297
+ phone: "+94"
1298
+ },
1299
+ {
1300
+ code: "LR",
1301
+ label: "Liberia",
1302
+ phone: "+231"
1303
+ },
1304
+ {
1305
+ code: "LS",
1306
+ label: "Lesotho",
1307
+ phone: "+266"
1308
+ },
1309
+ {
1310
+ code: "LT",
1311
+ label: "Lithuania",
1312
+ phone: "+370"
1313
+ },
1314
+ {
1315
+ code: "LU",
1316
+ label: "Luxembourg",
1317
+ phone: "+352"
1318
+ },
1319
+ {
1320
+ code: "LV",
1321
+ label: "Latvia",
1322
+ phone: "+371"
1323
+ },
1324
+ {
1325
+ code: "LY",
1326
+ label: "Libya",
1327
+ phone: "+218"
1328
+ },
1329
+ {
1330
+ code: "MA",
1331
+ label: "Morocco",
1332
+ phone: "+212"
1333
+ },
1334
+ {
1335
+ code: "MC",
1336
+ label: "Monaco",
1337
+ phone: "+377"
1338
+ },
1339
+ {
1340
+ code: "MD",
1341
+ label: "Moldova, Republic of",
1342
+ phone: "+373"
1343
+ },
1344
+ {
1345
+ code: "ME",
1346
+ label: "Montenegro",
1347
+ phone: "+382"
1348
+ },
1349
+ {
1350
+ code: "MF",
1351
+ label: "Saint Martin (French part)",
1352
+ phone: "+590"
1353
+ },
1354
+ {
1355
+ code: "MG",
1356
+ label: "Madagascar",
1357
+ phone: "+261"
1358
+ },
1359
+ {
1360
+ code: "MH",
1361
+ label: "Marshall Islands",
1362
+ phone: "+692"
1363
+ },
1364
+ {
1365
+ code: "MK",
1366
+ label: "Macedonia, the Former Yugoslav Republic of",
1367
+ phone: "+389"
1368
+ },
1369
+ {
1370
+ code: "ML",
1371
+ label: "Mali",
1372
+ phone: "+223"
1373
+ },
1374
+ {
1375
+ code: "MM",
1376
+ label: "Myanmar",
1377
+ phone: "+95"
1378
+ },
1379
+ {
1380
+ code: "MN",
1381
+ label: "Mongolia",
1382
+ phone: "+976"
1383
+ },
1384
+ {
1385
+ code: "MO",
1386
+ label: "Macao",
1387
+ phone: "+853"
1388
+ },
1389
+ {
1390
+ code: "MP",
1391
+ label: "Northern Mariana Islands",
1392
+ phone: "+1-670"
1393
+ },
1394
+ {
1395
+ code: "MQ",
1396
+ label: "Martinique",
1397
+ phone: "+596"
1398
+ },
1399
+ {
1400
+ code: "MR",
1401
+ label: "Mauritania",
1402
+ phone: "+222"
1403
+ },
1404
+ {
1405
+ code: "MS",
1406
+ label: "Montserrat",
1407
+ phone: "+1-664"
1408
+ },
1409
+ {
1410
+ code: "MT",
1411
+ label: "Malta",
1412
+ phone: "+356"
1413
+ },
1414
+ {
1415
+ code: "MU",
1416
+ label: "Mauritius",
1417
+ phone: "+230"
1418
+ },
1419
+ {
1420
+ code: "MV",
1421
+ label: "Maldives",
1422
+ phone: "+960"
1423
+ },
1424
+ {
1425
+ code: "MW",
1426
+ label: "Malawi",
1427
+ phone: "+265"
1428
+ },
1429
+ {
1430
+ code: "MX",
1431
+ label: "Mexico",
1432
+ phone: "+52"
1433
+ },
1434
+ {
1435
+ code: "MY",
1436
+ label: "Malaysia",
1437
+ phone: "+60"
1438
+ },
1439
+ {
1440
+ code: "MZ",
1441
+ label: "Mozambique",
1442
+ phone: "+258"
1443
+ },
1444
+ {
1445
+ code: "NA",
1446
+ label: "Namibia",
1447
+ phone: "+264"
1448
+ },
1449
+ {
1450
+ code: "NC",
1451
+ label: "New Caledonia",
1452
+ phone: "+687"
1453
+ },
1454
+ {
1455
+ code: "NE",
1456
+ label: "Niger",
1457
+ phone: "+227"
1458
+ },
1459
+ {
1460
+ code: "NF",
1461
+ label: "Norfolk Island",
1462
+ phone: "+672"
1463
+ },
1464
+ {
1465
+ code: "NG",
1466
+ label: "Nigeria",
1467
+ phone: "+234"
1468
+ },
1469
+ {
1470
+ code: "NI",
1471
+ label: "Nicaragua",
1472
+ phone: "+505"
1473
+ },
1474
+ {
1475
+ code: "NL",
1476
+ label: "Netherlands",
1477
+ phone: "+31"
1478
+ },
1479
+ {
1480
+ code: "NO",
1481
+ label: "Norway",
1482
+ phone: "+47"
1483
+ },
1484
+ {
1485
+ code: "NP",
1486
+ label: "Nepal",
1487
+ phone: "+977"
1488
+ },
1489
+ {
1490
+ code: "NR",
1491
+ label: "Nauru",
1492
+ phone: "+674"
1493
+ },
1494
+ {
1495
+ code: "NU",
1496
+ label: "Niue",
1497
+ phone: "+683"
1498
+ },
1499
+ {
1500
+ code: "NZ",
1501
+ label: "New Zealand",
1502
+ phone: "+64"
1503
+ },
1504
+ {
1505
+ code: "OM",
1506
+ label: "Oman",
1507
+ phone: "+968"
1508
+ },
1509
+ {
1510
+ code: "PA",
1511
+ label: "Panama",
1512
+ phone: "+507"
1513
+ },
1514
+ {
1515
+ code: "PE",
1516
+ label: "Peru",
1517
+ phone: "+51"
1518
+ },
1519
+ {
1520
+ code: "PF",
1521
+ label: "French Polynesia",
1522
+ phone: "+689"
1523
+ },
1524
+ {
1525
+ code: "PG",
1526
+ label: "Papua New Guinea",
1527
+ phone: "+675"
1528
+ },
1529
+ {
1530
+ code: "PH",
1531
+ label: "Philippines",
1532
+ phone: "+63"
1533
+ },
1534
+ {
1535
+ code: "PK",
1536
+ label: "Pakistan",
1537
+ phone: "+92"
1538
+ },
1539
+ {
1540
+ code: "PL",
1541
+ label: "Poland",
1542
+ phone: "+48"
1543
+ },
1544
+ {
1545
+ code: "PM",
1546
+ label: "Saint Pierre and Miquelon",
1547
+ phone: "+508"
1548
+ },
1549
+ {
1550
+ code: "PN",
1551
+ label: "Pitcairn",
1552
+ phone: "+870"
1553
+ },
1554
+ {
1555
+ code: "PR",
1556
+ label: "Puerto Rico",
1557
+ phone: "+1"
1558
+ },
1559
+ {
1560
+ code: "PS",
1561
+ label: "Palestine, State of",
1562
+ phone: "+970"
1563
+ },
1564
+ {
1565
+ code: "PT",
1566
+ label: "Portugal",
1567
+ phone: "+351"
1568
+ },
1569
+ {
1570
+ code: "PW",
1571
+ label: "Palau",
1572
+ phone: "+680"
1573
+ },
1574
+ {
1575
+ code: "PY",
1576
+ label: "Paraguay",
1577
+ phone: "+595"
1578
+ },
1579
+ {
1580
+ code: "QA",
1581
+ label: "Qatar",
1582
+ phone: "+974"
1583
+ },
1584
+ {
1585
+ code: "RE",
1586
+ label: "Reunion",
1587
+ phone: "+262"
1588
+ },
1589
+ {
1590
+ code: "RO",
1591
+ label: "Romania",
1592
+ phone: "+40"
1593
+ },
1594
+ {
1595
+ code: "RS",
1596
+ label: "Serbia",
1597
+ phone: "+381"
1598
+ },
1599
+ {
1600
+ code: "RU",
1601
+ label: "Russian Federation",
1602
+ phone: "+7"
1603
+ },
1604
+ {
1605
+ code: "RW",
1606
+ label: "Rwanda",
1607
+ phone: "+250"
1608
+ },
1609
+ {
1610
+ code: "SA",
1611
+ label: "Saudi Arabia",
1612
+ phone: "+966"
1613
+ },
1614
+ {
1615
+ code: "SB",
1616
+ label: "Solomon Islands",
1617
+ phone: "+677"
1618
+ },
1619
+ {
1620
+ code: "SC",
1621
+ label: "Seychelles",
1622
+ phone: "+248"
1623
+ },
1624
+ {
1625
+ code: "SD",
1626
+ label: "Sudan",
1627
+ phone: "+249"
1628
+ },
1629
+ {
1630
+ code: "SE",
1631
+ label: "Sweden",
1632
+ phone: "+46"
1633
+ },
1634
+ {
1635
+ code: "SG",
1636
+ label: "Singapore",
1637
+ phone: "+65"
1638
+ },
1639
+ {
1640
+ code: "SH",
1641
+ label: "Saint Helena",
1642
+ phone: "+290"
1643
+ },
1644
+ {
1645
+ code: "SI",
1646
+ label: "Slovenia",
1647
+ phone: "+386"
1648
+ },
1649
+ {
1650
+ code: "SJ",
1651
+ label: "Svalbard and Jan Mayen",
1652
+ phone: "+47"
1653
+ },
1654
+ {
1655
+ code: "SK",
1656
+ label: "Slovakia",
1657
+ phone: "+421"
1658
+ },
1659
+ {
1660
+ code: "SL",
1661
+ label: "Sierra Leone",
1662
+ phone: "+232"
1663
+ },
1664
+ {
1665
+ code: "SM",
1666
+ label: "San Marino",
1667
+ phone: "+378"
1668
+ },
1669
+ {
1670
+ code: "SN",
1671
+ label: "Senegal",
1672
+ phone: "+221"
1673
+ },
1674
+ {
1675
+ code: "SO",
1676
+ label: "Somalia",
1677
+ phone: "+252"
1678
+ },
1679
+ {
1680
+ code: "SR",
1681
+ label: "Suriname",
1682
+ phone: "+597"
1683
+ },
1684
+ {
1685
+ code: "SS",
1686
+ label: "South Sudan",
1687
+ phone: "+211"
1688
+ },
1689
+ {
1690
+ code: "ST",
1691
+ label: "Sao Tome and Principe",
1692
+ phone: "+239"
1693
+ },
1694
+ {
1695
+ code: "SV",
1696
+ label: "El Salvador",
1697
+ phone: "+503"
1698
+ },
1699
+ {
1700
+ code: "SX",
1701
+ label: "Sint Maarten (Dutch part)",
1702
+ phone: "+1-721"
1703
+ },
1704
+ {
1705
+ code: "SY",
1706
+ label: "Syrian Arab Republic",
1707
+ phone: "+963"
1708
+ },
1709
+ {
1710
+ code: "SZ",
1711
+ label: "Swaziland",
1712
+ phone: "+268"
1713
+ },
1714
+ {
1715
+ code: "TC",
1716
+ label: "Turks and Caicos Islands",
1717
+ phone: "+1-649"
1718
+ },
1719
+ {
1720
+ code: "TD",
1721
+ label: "Chad",
1722
+ phone: "+235"
1723
+ },
1724
+ {
1725
+ code: "TF",
1726
+ label: "French Southern Territories",
1727
+ phone: "+262"
1728
+ },
1729
+ {
1730
+ code: "TG",
1731
+ label: "Togo",
1732
+ phone: "+228"
1733
+ },
1734
+ {
1735
+ code: "TH",
1736
+ label: "Thailand",
1737
+ phone: "+66"
1738
+ },
1739
+ {
1740
+ code: "TJ",
1741
+ label: "Tajikistan",
1742
+ phone: "+992"
1743
+ },
1744
+ {
1745
+ code: "TK",
1746
+ label: "Tokelau",
1747
+ phone: "+690"
1748
+ },
1749
+ {
1750
+ code: "TL",
1751
+ label: "Timor-Leste",
1752
+ phone: "+670"
1753
+ },
1754
+ {
1755
+ code: "TM",
1756
+ label: "Turkmenistan",
1757
+ phone: "+993"
1758
+ },
1759
+ {
1760
+ code: "TN",
1761
+ label: "Tunisia",
1762
+ phone: "+216"
1763
+ },
1764
+ {
1765
+ code: "TO",
1766
+ label: "Tonga",
1767
+ phone: "+676"
1768
+ },
1769
+ {
1770
+ code: "TR",
1771
+ label: "Turkey",
1772
+ phone: "+90"
1773
+ },
1774
+ {
1775
+ code: "TT",
1776
+ label: "Trinidad and Tobago",
1777
+ phone: "+1-868"
1778
+ },
1779
+ {
1780
+ code: "TV",
1781
+ label: "Tuvalu",
1782
+ phone: "+688"
1783
+ },
1784
+ {
1785
+ code: "TW",
1786
+ label: "Taiwan, Province of China",
1787
+ phone: "+886"
1788
+ },
1789
+ {
1790
+ code: "TZ",
1791
+ label: "United Republic of Tanzania",
1792
+ phone: "+255"
1793
+ },
1794
+ {
1795
+ code: "UA",
1796
+ label: "Ukraine",
1797
+ phone: "+380"
1798
+ },
1799
+ {
1800
+ code: "UG",
1801
+ label: "Uganda",
1802
+ phone: "+256"
1803
+ },
1804
+ {
1805
+ code: "US",
1806
+ label: "United States",
1807
+ phone: "+1",
1808
+ suggested: true
1809
+ },
1810
+ {
1811
+ code: "UY",
1812
+ label: "Uruguay",
1813
+ phone: "+598"
1814
+ },
1815
+ {
1816
+ code: "UZ",
1817
+ label: "Uzbekistan",
1818
+ phone: "+998"
1819
+ },
1820
+ {
1821
+ code: "VA",
1822
+ label: "Holy See (Vatican City State)",
1823
+ phone: "+379"
1824
+ },
1825
+ {
1826
+ code: "VC",
1827
+ label: "Saint Vincent and the Grenadines",
1828
+ phone: "+1-784"
1829
+ },
1830
+ {
1831
+ code: "VE",
1832
+ label: "Venezuela",
1833
+ phone: "+58"
1834
+ },
1835
+ {
1836
+ code: "VG",
1837
+ label: "British Virgin Islands",
1838
+ phone: "+1-284"
1839
+ },
1840
+ {
1841
+ code: "VI",
1842
+ label: "US Virgin Islands",
1843
+ phone: "+1-340"
1844
+ },
1845
+ {
1846
+ code: "VN",
1847
+ label: "Vietnam",
1848
+ phone: "+84"
1849
+ },
1850
+ {
1851
+ code: "VU",
1852
+ label: "Vanuatu",
1853
+ phone: "+678"
1854
+ },
1855
+ {
1856
+ code: "WF",
1857
+ label: "Wallis and Futuna",
1858
+ phone: "+681"
1859
+ },
1860
+ {
1861
+ code: "WS",
1862
+ label: "Samoa",
1863
+ phone: "+685"
1864
+ },
1865
+ {
1866
+ code: "XK",
1867
+ label: "Kosovo",
1868
+ phone: "+383"
1869
+ },
1870
+ {
1871
+ code: "YE",
1872
+ label: "Yemen",
1873
+ phone: "+967"
1874
+ },
1875
+ {
1876
+ code: "YT",
1877
+ label: "Mayotte",
1878
+ phone: "+262"
1879
+ },
1880
+ {
1881
+ code: "ZA",
1882
+ label: "South Africa",
1883
+ phone: "+27"
1884
+ },
1885
+ {
1886
+ code: "ZM",
1887
+ label: "Zambia",
1888
+ phone: "+260"
1889
+ },
1890
+ {
1891
+ code: "ZW",
1892
+ label: "Zimbabwe",
1893
+ phone: "+263"
1894
+ }
1895
+ ];
1896
+
1897
+ var defaultFont = {
1898
+ sans: '"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif',
1899
+ mono: 'Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace',
1900
+ prism: 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,"Liberation Mono", "Courier New", monospace'
1901
+ };
1902
+ var defaultBreakpoints = {
1903
+ xs: {
1904
+ min: '0',
1905
+ max: '650px'
1906
+ },
1907
+ sm: {
1908
+ min: '650px',
1909
+ max: '900px'
1910
+ },
1911
+ md: {
1912
+ min: '900px',
1913
+ max: '1280px'
1914
+ },
1915
+ lg: {
1916
+ min: '1280px',
1917
+ max: '1920px'
1918
+ },
1919
+ xl: {
1920
+ min: '1920px',
1921
+ max: '10000px'
1922
+ }
1923
+ };
1924
+ var defaultLayout = {
1925
+ gap: '16pt',
1926
+ gapNegative: '-16pt',
1927
+ gapHalf: '8pt',
1928
+ gapHalfNegative: '-8pt',
1929
+ gapQuarter: '4pt',
1930
+ gapQuarterNegative: '-4pt',
1931
+ pageMargin: '16pt',
1932
+ pageWidth: '750pt',
1933
+ pageWidthWithMargin: '782pt',
1934
+ breakpointMobile: defaultBreakpoints.xs.max,
1935
+ breakpointTablet: defaultBreakpoints.sm.max,
1936
+ radius: '6px',
1937
+ unit: '16px'
1938
+ };
1939
+
1940
+ var palette$1 = {
1941
+ accents_1: '#fafafa',
1942
+ accents_2: '#eaeaea',
1943
+ accents_3: '#999',
1944
+ accents_4: '#888',
1945
+ accents_5: '#666',
1946
+ accents_6: '#444',
1947
+ accents_7: '#333',
1948
+ accents_8: '#111',
1949
+ background: '#fff',
1950
+ foreground: '#000',
1951
+ selection: '#79ffe1',
1952
+ secondary: '#666',
1953
+ code: '#f81ce5',
1954
+ border: '#eaeaea',
1955
+ error: '#e00',
1956
+ errorLight: '#ff1a1a',
1957
+ errorLighter: '#f7d4d6',
1958
+ errorDark: '#c50000',
1959
+ success: '#0070f3',
1960
+ successLight: '#3291ff',
1961
+ successLighter: '#d3e5ff',
1962
+ successDark: '#0761d1',
1963
+ warning: '#f5a623',
1964
+ warningLight: '#f7b955',
1965
+ warningLighter: '#ffefcf',
1966
+ warningDark: '#ab570a',
1967
+ cyan: '#50e3c2',
1968
+ cyanLighter: '#aaffec',
1969
+ cyanLight: '#79ffe1',
1970
+ cyanDark: '#29bc9b',
1971
+ violet: '#7928ca',
1972
+ violetLighter: '#e3d7fc',
1973
+ violetLight: '#8a63d2',
1974
+ violetDark: '#4c2889',
1975
+ purple: '#f81ce5',
1976
+ alert: '#ff0080',
1977
+ magenta: '#eb367f',
1978
+ link: '#0070f3'
1979
+ };
1980
+ var expressiveness$1 = {
1981
+ linkStyle: 'none',
1982
+ linkHoverStyle: 'none',
1983
+ dropdownBoxShadow: '0 4px 4px 0 rgba(0, 0, 0, 0.02)',
1984
+ scrollerStart: 'rgba(255, 255, 255, 1)',
1985
+ scrollerEnd: 'rgba(255, 255, 255, 0)',
1986
+ shadowSmall: '0 5px 10px rgba(0, 0, 0, 0.12)',
1987
+ shadowMedium: '0 8px 30px rgba(0, 0, 0, 0.12)',
1988
+ shadowLarge: '0 30px 60px rgba(0, 0, 0, 0.12)',
1989
+ portalOpacity: 0.25
1990
+ };
1991
+ var font$1 = defaultFont;
1992
+ var breakpoints$1 = defaultBreakpoints;
1993
+ var layout$1 = defaultLayout;
1994
+ var themes$1 = {
1995
+ type: 'light',
1996
+ font: font$1,
1997
+ layout: layout$1,
1998
+ palette: palette$1,
1999
+ breakpoints: breakpoints$1,
2000
+ expressiveness: expressiveness$1
2001
+ };
2002
+
2003
+ var palette = {
2004
+ accents_1: '#111',
2005
+ accents_2: '#333',
2006
+ accents_3: '#444',
2007
+ accents_4: '#666',
2008
+ accents_5: '#888',
2009
+ accents_6: '#999',
2010
+ accents_7: '#eaeaea',
2011
+ accents_8: '#fafafa',
2012
+ background: '#000',
2013
+ foreground: '#fff',
2014
+ selection: '#f81ce5',
2015
+ secondary: '#888',
2016
+ code: '#79ffe1',
2017
+ border: '#333',
2018
+ error: '#e00',
2019
+ errorLighter: '#f7d4d6',
2020
+ errorLight: '#ff1a1a',
2021
+ errorDark: '#c50000',
2022
+ success: '#0070f3',
2023
+ successLighter: '#d3e5ff',
2024
+ successLight: '#3291ff',
2025
+ successDark: '#0761d1',
2026
+ warning: '#f5a623',
2027
+ warningLighter: '#ffefcf',
2028
+ warningLight: '#f7b955',
2029
+ warningDark: '#ab570a',
2030
+ cyan: '#50e3c2',
2031
+ cyanLighter: '#aaffec',
2032
+ cyanLight: '#79ffe1',
2033
+ cyanDark: '#29bc9b',
2034
+ violet: '#7928ca',
2035
+ violetLighter: '#e3d7fc',
2036
+ violetLight: '#8a63d2',
2037
+ violetDark: '#4c2889',
2038
+ purple: '#f81ce5',
2039
+ alert: '#ff0080',
2040
+ magenta: '#eb367f',
2041
+ link: '#3291ff'
2042
+ };
2043
+ var expressiveness = {
2044
+ linkStyle: 'none',
2045
+ linkHoverStyle: 'none',
2046
+ dropdownBoxShadow: '0 0 0 1px #333',
2047
+ scrollerStart: 'rgba(255, 255, 255, 1)',
2048
+ scrollerEnd: 'rgba(255, 255, 255, 0)',
2049
+ shadowSmall: '0 0 0 1px #333',
2050
+ shadowMedium: '0 0 0 1px #333',
2051
+ shadowLarge: '0 0 0 1px #333',
2052
+ portalOpacity: 0.75
2053
+ };
2054
+ var font = defaultFont;
2055
+ var breakpoints = defaultBreakpoints;
2056
+ var layout = defaultLayout;
2057
+ var themes = {
2058
+ type: 'dark',
2059
+ font: font,
2060
+ layout: layout,
2061
+ palette: palette,
2062
+ breakpoints: breakpoints,
2063
+ expressiveness: expressiveness
2064
+ };
2065
+
2066
+ var isObject = function isObject(target) {
2067
+ return target && _typeof(target) === 'object';
2068
+ };
2069
+ var _deepDuplicable = function deepDuplicable(source, target) {
2070
+ if (!isObject(target) || !isObject(source)) return source;
2071
+ var sourceKeys = Object.keys(source);
2072
+ var result = {};
2073
+ for (var _i = 0, _sourceKeys = sourceKeys; _i < _sourceKeys.length; _i++) {
2074
+ var key = _sourceKeys[_i];
2075
+ var sourceValue = source[key];
2076
+ var targetValue = target[key];
2077
+ if (Array.isArray(sourceValue) && Array.isArray(targetValue)) {
2078
+ result[key] = targetValue.concat(sourceValue);
2079
+ } else if (isObject(sourceValue) && isObject(targetValue)) {
2080
+ result[key] = _deepDuplicable(sourceValue, _objectSpread2({}, targetValue));
2081
+ } else if (targetValue) {
2082
+ result[key] = targetValue;
2083
+ } else {
2084
+ result[key] = sourceValue;
2085
+ }
2086
+ }
2087
+ return result;
2088
+ };
2089
+ var getPresets = function getPresets() {
2090
+ return [themes$1, themes];
2091
+ };
2092
+ var getPresetStaticTheme = function getPresetStaticTheme() {
2093
+ return themes$1;
2094
+ };
2095
+ var isAvailableThemeType = function isAvailableThemeType(type) {
2096
+ if (!type) return false;
2097
+ var presetThemes = getPresets();
2098
+ var hasType = presetThemes.find(function (theme) {
2099
+ return theme.type === type;
2100
+ });
2101
+ return !hasType;
2102
+ };
2103
+ var isPresetTheme = function isPresetTheme(themeOrType) {
2104
+ if (!themeOrType) return false;
2105
+ var isType = typeof themeOrType === 'string';
2106
+ var type = isType ? themeOrType : themeOrType.type;
2107
+ return !isAvailableThemeType(type);
2108
+ };
2109
+ var hasUserCustomTheme = function hasUserCustomTheme() {
2110
+ var themes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
2111
+ return !!themes.find(function (item) {
2112
+ return isAvailableThemeType(item.type);
2113
+ });
2114
+ };
2115
+ var create = function create(base, custom) {
2116
+ if (!isAvailableThemeType(custom.type)) {
2117
+ throw new Error('Duplicate or unavailable theme type');
2118
+ }
2119
+ return _deepDuplicable(base, custom);
2120
+ };
2121
+ var createFromDark = function createFromDark(custom) {
2122
+ return create(themes, custom);
2123
+ };
2124
+ var createFromLight = function createFromLight(custom) {
2125
+ return create(themes$1, custom);
2126
+ };
2127
+ var Themes = {
2128
+ isPresetTheme: isPresetTheme,
2129
+ isAvailableThemeType: isAvailableThemeType,
2130
+ hasUserCustomTheme: hasUserCustomTheme,
2131
+ getPresets: getPresets,
2132
+ getPresetStaticTheme: getPresetStaticTheme,
2133
+ create: create,
2134
+ createFromDark: createFromDark,
2135
+ createFromLight: createFromLight
2136
+ };
2137
+
2138
+ /* "use client" */
2139
+
2140
+ var defaultTheme = Themes.getPresetStaticTheme();
2141
+ var ThemeContext = /*#__PURE__*/React.createContext(defaultTheme);
2142
+ var useTheme = function useTheme() {
2143
+ return React.useContext(ThemeContext);
2144
+ };
2145
+
2146
+ var getColors = function getColors(palette, status) {
2147
+ var colors = {
2148
+ "default": {
2149
+ color: palette.foreground,
2150
+ borderColor: palette.border,
2151
+ hoverBorder: palette.accents_5
2152
+ },
2153
+ secondary: {
2154
+ color: palette.foreground,
2155
+ borderColor: palette.secondary,
2156
+ hoverBorder: palette.secondary
2157
+ },
2158
+ success: {
2159
+ color: palette.foreground,
2160
+ borderColor: palette.successLight,
2161
+ hoverBorder: palette.success
2162
+ },
2163
+ warning: {
2164
+ color: palette.foreground,
2165
+ borderColor: palette.warningLight,
2166
+ hoverBorder: palette.warning
2167
+ },
2168
+ error: {
2169
+ color: palette.error,
2170
+ borderColor: palette.error,
2171
+ hoverBorder: palette.errorDark
2172
+ }
2173
+ };
2174
+ if (!status) return colors["default"];
2175
+ return colors[status];
2176
+ };
2177
+
2178
+ var PhoneInput = function PhoneInput(_ref) {
2179
+ var onChange = _ref.onChange,
2180
+ _ref$value = _ref.value,
2181
+ value = _ref$value === void 0 ? '' : _ref$value,
2182
+ country = _ref.country,
2183
+ _ref$placeholder = _ref.placeholder,
2184
+ placeholder = _ref$placeholder === void 0 ? 'Enter phone number' : _ref$placeholder,
2185
+ _ref$color = _ref.color,
2186
+ _color = _ref$color === void 0 ? 'default' : _ref$color;
2187
+ var theme = useTheme();
2188
+ var defaultValue = country ? countries.findIndex(function (cn) {
2189
+ return cn.code == country;
2190
+ }) : 103;
2191
+ var _useState = React.useState(countries[defaultValue]),
2192
+ _useState2 = _slicedToArray(_useState, 2),
2193
+ selectedCountry = _useState2[0],
2194
+ setSelectedCountry = _useState2[1];
2195
+ var _useState3 = React.useState(value),
2196
+ _useState4 = _slicedToArray(_useState3, 2),
2197
+ phoneNumber = _useState4[0],
2198
+ setPhoneNumber = _useState4[1];
2199
+ var _useState5 = React.useState(false),
2200
+ _useState6 = _slicedToArray(_useState5, 2),
2201
+ isFocused = _useState6[0],
2202
+ setIsFocused = _useState6[1];
2203
+ var _useState7 = React.useState(false),
2204
+ _useState8 = _slicedToArray(_useState7, 2),
2205
+ dropdownOpen = _useState8[0],
2206
+ setDropdownOpen = _useState8[1];
2207
+ var _useState9 = React.useState(''),
2208
+ _useState0 = _slicedToArray(_useState9, 2),
2209
+ searchTerm = _useState0[0],
2210
+ setSearchTerm = _useState0[1];
2211
+ var dropdownRef = React.useRef(null);
2212
+ var _useMemo = React.useMemo(function () {
2213
+ return getColors(theme.palette, _color);
2214
+ }, [theme.palette]),
2215
+ borderColor = _useMemo.borderColor,
2216
+ hoverBorder = _useMemo.hoverBorder;
2217
+ var handleSelectCountry = function handleSelectCountry(country) {
2218
+ setSelectedCountry(country);
2219
+ setDropdownOpen(false);
2220
+ setSearchTerm('');
2221
+ if (onChange) onChange("".concat(country.code, ":").concat(phoneNumber));
2222
+ };
2223
+ var handlePhoneChange = function handlePhoneChange(e) {
2224
+ var value = e.target.value.replace(/[^\d]/g, '');
2225
+ setPhoneNumber(value);
2226
+ if (onChange) onChange("".concat(selectedCountry.code).concat(value));
2227
+ };
2228
+ var handleClickOutside = function handleClickOutside(e) {
2229
+ if (dropdownRef.current && !dropdownRef.current.contains(e.target)) {
2230
+ setDropdownOpen(false);
2231
+ setSearchTerm('');
2232
+ }
2233
+ };
2234
+ React.useEffect(function () {
2235
+ document.addEventListener('mousedown', handleClickOutside);
2236
+ return function () {
2237
+ return document.removeEventListener('mousedown', handleClickOutside);
2238
+ };
2239
+ }, []);
2240
+ var filteredCountries = countries.filter(function (c) {
2241
+ return "".concat(c.label, " ").concat(c.code, " ").concat(c.phone).toLowerCase().includes(searchTerm.toLowerCase());
2242
+ });
2243
+ return /*#__PURE__*/React.createElement("div", {
2244
+ ref: dropdownRef,
2245
+ className: _JSXStyle.dynamic([["785147617", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "phone-input-container ".concat(isFocused ? 'focused' : '')
2246
+ }, /*#__PURE__*/React.createElement("div", {
2247
+ className: _JSXStyle.dynamic([["785147617", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "input-wrapper"
2248
+ }, /*#__PURE__*/React.createElement("div", {
2249
+ onClick: function onClick() {
2250
+ return setDropdownOpen(!dropdownOpen);
2251
+ },
2252
+ className: _JSXStyle.dynamic([["785147617", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "dropdown-toggle"
2253
+ }, /*#__PURE__*/React.createElement("span", {
2254
+ style: {
2255
+ display: 'flex',
2256
+ alignItems: 'center',
2257
+ gap: 5
2258
+ },
2259
+ className: _JSXStyle.dynamic([["785147617", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]])
2260
+ }, /*#__PURE__*/React.createElement("img", {
2261
+ loading: "lazy",
2262
+ width: "23",
2263
+ height: "23",
2264
+ src: "https://flagcdn.com/w20/".concat(selectedCountry.code.toLowerCase(), ".png"),
2265
+ srcSet: "https://flagcdn.com/w40/".concat(selectedCountry.code.toLowerCase(), ".png 2x"),
2266
+ alt: "Flag of ".concat(selectedCountry.label),
2267
+ className: _JSXStyle.dynamic([["785147617", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]])
2268
+ }), /*#__PURE__*/React.createElement("span", {
2269
+ className: _JSXStyle.dynamic([["785147617", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]])
2270
+ }, selectedCountry.phone))), /*#__PURE__*/React.createElement("input", {
2271
+ type: "tel",
2272
+ placeholder: placeholder,
2273
+ value: phoneNumber,
2274
+ onChange: handlePhoneChange,
2275
+ onFocus: function onFocus() {
2276
+ return setIsFocused(true);
2277
+ },
2278
+ onBlur: function onBlur() {
2279
+ return setIsFocused(false);
2280
+ },
2281
+ className: _JSXStyle.dynamic([["785147617", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "phone-input"
2282
+ })), dropdownOpen && /*#__PURE__*/React.createElement("div", {
2283
+ className: _JSXStyle.dynamic([["785147617", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "dropdown"
2284
+ }, /*#__PURE__*/React.createElement("input", {
2285
+ type: "text",
2286
+ placeholder: "Search country...",
2287
+ value: searchTerm,
2288
+ onChange: function onChange(e) {
2289
+ return setSearchTerm(e.target.value);
2290
+ },
2291
+ className: _JSXStyle.dynamic([["785147617", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "search-input"
2292
+ }), /*#__PURE__*/React.createElement("div", {
2293
+ className: _JSXStyle.dynamic([["785147617", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "country-list"
2294
+ }, filteredCountries.length > 0 ? filteredCountries.map(function (c) {
2295
+ return /*#__PURE__*/React.createElement("div", {
2296
+ key: c.code,
2297
+ onClick: function onClick() {
2298
+ return handleSelectCountry(c);
2299
+ },
2300
+ className: _JSXStyle.dynamic([["785147617", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "dropdown-item"
2301
+ }, /*#__PURE__*/React.createElement("span", {
2302
+ style: {
2303
+ display: 'flex',
2304
+ alignItems: 'center',
2305
+ gap: 5
2306
+ },
2307
+ className: _JSXStyle.dynamic([["785147617", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]])
2308
+ }, /*#__PURE__*/React.createElement("img", {
2309
+ loading: "lazy",
2310
+ width: "23",
2311
+ height: "23",
2312
+ src: "https://flagcdn.com/w20/".concat(c.code.toLowerCase(), ".png"),
2313
+ srcSet: "https://flagcdn.com/w40/".concat(c.code.toLowerCase(), ".png 2x"),
2314
+ alt: "Flag of ".concat(c.label),
2315
+ className: _JSXStyle.dynamic([["785147617", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]])
2316
+ }), c.phone, " ", /*#__PURE__*/React.createElement("span", {
2317
+ style: {
2318
+ color: 'grey'
2319
+ },
2320
+ className: _JSXStyle.dynamic([["785147617", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]])
2321
+ }, c.label)));
2322
+ }) : /*#__PURE__*/React.createElement("div", {
2323
+ className: _JSXStyle.dynamic([["785147617", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "dropdown-item disabled"
2324
+ }, "No results"))), /*#__PURE__*/React.createElement(_JSXStyle, {
2325
+ id: "785147617",
2326
+ dynamic: [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']
2327
+ }, ".phone-input-container.__jsx-style-dynamic-selector{position:relative;max-width:400px;}.phone-input-container.focused.__jsx-style-dynamic-selector{outline:1px solid ".concat(hoverBorder, ";border-radius:6px;}.input-wrapper.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border:1px solid ").concat(borderColor, ";border-radius:6px;overflow:hidden;}.dropdown-toggle.__jsx-style-dynamic-selector{padding:7px 12px;border-radius:6px 0px 0px 6px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-size:14px;border-right:1px solid ").concat(borderColor, ";}.phone-input.__jsx-style-dynamic-selector{-webkit-flex:1;-ms-flex:1;flex:1;padding:5px 10px;height:35px;background-color:transparent;font-size:14px;border:none;}.phone-input.__jsx-style-dynamic-selector:focus{outline:none;}.dropdown.__jsx-style-dynamic-selector{position:absolute;top:100%;left:0;width:100%;background:").concat(theme.type == 'dark' ? 'black' : 'white', ";border:1px solid ").concat(borderColor, ";border-radius:6px;margin-top:4px;z-index:999;box-shadow:0 4px 10px rgba(0,0,0,0.1);}.search-input.__jsx-style-dynamic-selector{width:100%;padding:8px 10px;border:none;background-color:transparent;border-bottom:1px solid ").concat(borderColor, ";font-size:14px;}.search-input.__jsx-style-dynamic-selector:focus{outline:none;}.country-list.__jsx-style-dynamic-selector{max-height:200px;overflow-y:auto;}.dropdown-item.__jsx-style-dynamic-selector{padding:10px;cursor:pointer;font-size:14px;}.dropdown-item.__jsx-style-dynamic-selector:hover{background:").concat(theme.type == 'dark' ? '#3a3d3d' : '#efefef', ";}.dropdown-item.disabled.__jsx-style-dynamic-selector{color:#888;cursor:default;}")));
2328
+ };
2329
+
2330
+ exports.default = PhoneInput;