@nuskin/nextgen-header 1.0.0-library-setup.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package-dist/index.css +22 -19
- package/package-dist/index.css.map +1 -1
- package/package-dist/index.d.ts +10 -48
- package/package-dist/index.js +838 -244
- package/package-dist/index.js.map +1 -1
- package/package.json +8 -12
- package/readme.md +40 -18
- package/package-dist/index.mjs +0 -253
- package/package-dist/index.mjs.map +0 -1
package/package-dist/index.js
CHANGED
|
@@ -1,84 +1,768 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
/******/ (() => { // webpackBootstrap
|
|
2
|
+
/******/ "use strict";
|
|
3
|
+
/******/ // The require scope
|
|
4
|
+
/******/ var __webpack_require__ = {};
|
|
5
|
+
/******/
|
|
6
|
+
/************************************************************************/
|
|
7
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
8
|
+
/******/ (() => {
|
|
9
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
10
|
+
/******/ __webpack_require__.n = (module) => {
|
|
11
|
+
/******/ var getter = module && module.__esModule ?
|
|
12
|
+
/******/ () => (module['default']) :
|
|
13
|
+
/******/ () => (module);
|
|
14
|
+
/******/ __webpack_require__.d(getter, { a: getter });
|
|
15
|
+
/******/ return getter;
|
|
16
|
+
/******/ };
|
|
17
|
+
/******/ })();
|
|
18
|
+
/******/
|
|
19
|
+
/******/ /* webpack/runtime/define property getters */
|
|
20
|
+
/******/ (() => {
|
|
21
|
+
/******/ // define getter functions for harmony exports
|
|
22
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
23
|
+
/******/ for(var key in definition) {
|
|
24
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
25
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
26
|
+
/******/ }
|
|
27
|
+
/******/ }
|
|
28
|
+
/******/ };
|
|
29
|
+
/******/ })();
|
|
30
|
+
/******/
|
|
31
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
32
|
+
/******/ (() => {
|
|
33
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
34
|
+
/******/ })();
|
|
35
|
+
/******/
|
|
36
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
37
|
+
/******/ (() => {
|
|
38
|
+
/******/ // define __esModule on exports
|
|
39
|
+
/******/ __webpack_require__.r = (exports) => {
|
|
40
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
41
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
42
|
+
/******/ }
|
|
43
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
44
|
+
/******/ };
|
|
45
|
+
/******/ })();
|
|
46
|
+
/******/
|
|
47
|
+
/************************************************************************/
|
|
48
|
+
var __webpack_exports__ = {};
|
|
49
|
+
// ESM COMPAT FLAG
|
|
50
|
+
__webpack_require__.r(__webpack_exports__);
|
|
51
|
+
|
|
52
|
+
// EXPORTS
|
|
53
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
54
|
+
Header: () => (/* reexport */ src_Main)
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
;// external "react"
|
|
58
|
+
const external_react_namespaceObject = require("react");
|
|
59
|
+
;// external "prop-types"
|
|
60
|
+
const external_prop_types_namespaceObject = require("prop-types");
|
|
61
|
+
var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_namespaceObject);
|
|
62
|
+
;// external "react/jsx-runtime"
|
|
63
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
64
|
+
;// ./src/components/HeaderPlaceholder.jsx
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Stub shell for the future header. Replace with real navigation/branding when
|
|
70
|
+
* Contentstack content types and UX are defined.
|
|
71
|
+
*
|
|
72
|
+
* Locale is supplied by the parent (e.g. Main); `getLocale()` can be used upstream
|
|
73
|
+
* to derive values from the URL when needed.
|
|
74
|
+
*/
|
|
75
|
+
|
|
76
|
+
function HeaderPlaceholder(_ref) {
|
|
77
|
+
var country = _ref.country,
|
|
78
|
+
language = _ref.language,
|
|
79
|
+
locale = _ref.locale;
|
|
80
|
+
return /*#__PURE__*/(0,jsx_runtime_namespaceObject.jsx)("header", {
|
|
81
|
+
role: "banner",
|
|
82
|
+
"data-testid": "header-placeholder",
|
|
83
|
+
"data-country": country,
|
|
84
|
+
"data-language": language,
|
|
85
|
+
"data-locale": locale,
|
|
86
|
+
children: /*#__PURE__*/(0,jsx_runtime_namespaceObject.jsx)("p", {
|
|
87
|
+
children: "Header MFE \u2014 TODO: implement header content"
|
|
88
|
+
})
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
HeaderPlaceholder.propTypes = {
|
|
92
|
+
country: (external_prop_types_default()).string,
|
|
93
|
+
language: (external_prop_types_default()).string,
|
|
94
|
+
locale: (external_prop_types_default()).string
|
|
10
95
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
96
|
+
HeaderPlaceholder.defaultProps = {
|
|
97
|
+
country: "",
|
|
98
|
+
language: "",
|
|
99
|
+
locale: ""
|
|
18
100
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
101
|
+
;// ./node_modules/@babel/runtime/helpers/esm/extends.js
|
|
102
|
+
function _extends() {
|
|
103
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
104
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
105
|
+
var t = arguments[e];
|
|
106
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
107
|
+
}
|
|
108
|
+
return n;
|
|
109
|
+
}, _extends.apply(null, arguments);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
;// external "@emotion/react"
|
|
113
|
+
const react_namespaceObject = require("@emotion/react");
|
|
114
|
+
;// ./node_modules/@emotion/hash/dist/emotion-hash.esm.js
|
|
115
|
+
/* eslint-disable */
|
|
116
|
+
// Inspired by https://github.com/garycourt/murmurhash-js
|
|
117
|
+
// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86
|
|
118
|
+
function murmur2(str) {
|
|
119
|
+
// 'm' and 'r' are mixing constants generated offline.
|
|
120
|
+
// They're not really 'magic', they just happen to work well.
|
|
121
|
+
// const m = 0x5bd1e995;
|
|
122
|
+
// const r = 24;
|
|
123
|
+
// Initialize the hash
|
|
124
|
+
var h = 0; // Mix 4 bytes at a time into the hash
|
|
125
|
+
|
|
126
|
+
var k,
|
|
127
|
+
i = 0,
|
|
128
|
+
len = str.length;
|
|
129
|
+
|
|
130
|
+
for (; len >= 4; ++i, len -= 4) {
|
|
131
|
+
k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;
|
|
132
|
+
k =
|
|
133
|
+
/* Math.imul(k, m): */
|
|
134
|
+
(k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);
|
|
135
|
+
k ^=
|
|
136
|
+
/* k >>> r: */
|
|
137
|
+
k >>> 24;
|
|
138
|
+
h =
|
|
139
|
+
/* Math.imul(k, m): */
|
|
140
|
+
(k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^
|
|
141
|
+
/* Math.imul(h, m): */
|
|
142
|
+
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
|
|
143
|
+
} // Handle the last few bytes of the input array
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
switch (len) {
|
|
147
|
+
case 3:
|
|
148
|
+
h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
|
|
149
|
+
|
|
150
|
+
case 2:
|
|
151
|
+
h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
|
|
152
|
+
|
|
153
|
+
case 1:
|
|
154
|
+
h ^= str.charCodeAt(i) & 0xff;
|
|
155
|
+
h =
|
|
156
|
+
/* Math.imul(h, m): */
|
|
157
|
+
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
|
|
158
|
+
} // Do a few final mixes of the hash to ensure the last few
|
|
159
|
+
// bytes are well-incorporated.
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
h ^= h >>> 13;
|
|
163
|
+
h =
|
|
164
|
+
/* Math.imul(h, m): */
|
|
165
|
+
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
|
|
166
|
+
return ((h ^ h >>> 15) >>> 0).toString(36);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
;// ./node_modules/@emotion/unitless/dist/emotion-unitless.esm.js
|
|
172
|
+
var unitlessKeys = {
|
|
173
|
+
animationIterationCount: 1,
|
|
174
|
+
aspectRatio: 1,
|
|
175
|
+
borderImageOutset: 1,
|
|
176
|
+
borderImageSlice: 1,
|
|
177
|
+
borderImageWidth: 1,
|
|
178
|
+
boxFlex: 1,
|
|
179
|
+
boxFlexGroup: 1,
|
|
180
|
+
boxOrdinalGroup: 1,
|
|
181
|
+
columnCount: 1,
|
|
182
|
+
columns: 1,
|
|
183
|
+
flex: 1,
|
|
184
|
+
flexGrow: 1,
|
|
185
|
+
flexPositive: 1,
|
|
186
|
+
flexShrink: 1,
|
|
187
|
+
flexNegative: 1,
|
|
188
|
+
flexOrder: 1,
|
|
189
|
+
gridRow: 1,
|
|
190
|
+
gridRowEnd: 1,
|
|
191
|
+
gridRowSpan: 1,
|
|
192
|
+
gridRowStart: 1,
|
|
193
|
+
gridColumn: 1,
|
|
194
|
+
gridColumnEnd: 1,
|
|
195
|
+
gridColumnSpan: 1,
|
|
196
|
+
gridColumnStart: 1,
|
|
197
|
+
msGridRow: 1,
|
|
198
|
+
msGridRowSpan: 1,
|
|
199
|
+
msGridColumn: 1,
|
|
200
|
+
msGridColumnSpan: 1,
|
|
201
|
+
fontWeight: 1,
|
|
202
|
+
lineHeight: 1,
|
|
203
|
+
opacity: 1,
|
|
204
|
+
order: 1,
|
|
205
|
+
orphans: 1,
|
|
206
|
+
scale: 1,
|
|
207
|
+
tabSize: 1,
|
|
208
|
+
widows: 1,
|
|
209
|
+
zIndex: 1,
|
|
210
|
+
zoom: 1,
|
|
211
|
+
WebkitLineClamp: 1,
|
|
212
|
+
// SVG-related properties
|
|
213
|
+
fillOpacity: 1,
|
|
214
|
+
floodOpacity: 1,
|
|
215
|
+
stopOpacity: 1,
|
|
216
|
+
strokeDasharray: 1,
|
|
217
|
+
strokeDashoffset: 1,
|
|
218
|
+
strokeMiterlimit: 1,
|
|
219
|
+
strokeOpacity: 1,
|
|
220
|
+
strokeWidth: 1
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
;// ./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js
|
|
226
|
+
function memoize(fn) {
|
|
227
|
+
var cache = Object.create(null);
|
|
228
|
+
return function (arg) {
|
|
229
|
+
if (cache[arg] === undefined) cache[arg] = fn(arg);
|
|
230
|
+
return cache[arg];
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
;// ./node_modules/@emotion/serialize/dist/emotion-serialize.esm.js
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
var isDevelopment = false;
|
|
242
|
+
|
|
243
|
+
var hyphenateRegex = /[A-Z]|^ms/g;
|
|
244
|
+
var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
|
|
245
|
+
|
|
246
|
+
var isCustomProperty = function isCustomProperty(property) {
|
|
247
|
+
return property.charCodeAt(1) === 45;
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
var isProcessableValue = function isProcessableValue(value) {
|
|
251
|
+
return value != null && typeof value !== 'boolean';
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
var processStyleName = /* #__PURE__ */memoize(function (styleName) {
|
|
255
|
+
return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();
|
|
48
256
|
});
|
|
49
|
-
module.exports = __toCommonJS(index_exports);
|
|
50
257
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
258
|
+
var processStyleValue = function processStyleValue(key, value) {
|
|
259
|
+
switch (key) {
|
|
260
|
+
case 'animation':
|
|
261
|
+
case 'animationName':
|
|
262
|
+
{
|
|
263
|
+
if (typeof value === 'string') {
|
|
264
|
+
return value.replace(animationRegex, function (match, p1, p2) {
|
|
265
|
+
cursor = {
|
|
266
|
+
name: p1,
|
|
267
|
+
styles: p2,
|
|
268
|
+
next: cursor
|
|
269
|
+
};
|
|
270
|
+
return p1;
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
if (unitlessKeys[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {
|
|
277
|
+
return value + 'px';
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
return value;
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
var noComponentSelectorMessage = 'Component selectors can only be used in conjunction with ' + '@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware ' + 'compiler transform.';
|
|
284
|
+
|
|
285
|
+
function handleInterpolation(mergedProps, registered, interpolation) {
|
|
286
|
+
if (interpolation == null) {
|
|
287
|
+
return '';
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
var componentSelector = interpolation;
|
|
291
|
+
|
|
292
|
+
if (componentSelector.__emotion_styles !== undefined) {
|
|
293
|
+
|
|
294
|
+
return componentSelector;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
switch (typeof interpolation) {
|
|
298
|
+
case 'boolean':
|
|
299
|
+
{
|
|
300
|
+
return '';
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
case 'object':
|
|
304
|
+
{
|
|
305
|
+
var keyframes = interpolation;
|
|
306
|
+
|
|
307
|
+
if (keyframes.anim === 1) {
|
|
308
|
+
cursor = {
|
|
309
|
+
name: keyframes.name,
|
|
310
|
+
styles: keyframes.styles,
|
|
311
|
+
next: cursor
|
|
312
|
+
};
|
|
313
|
+
return keyframes.name;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
var serializedStyles = interpolation;
|
|
317
|
+
|
|
318
|
+
if (serializedStyles.styles !== undefined) {
|
|
319
|
+
var next = serializedStyles.next;
|
|
320
|
+
|
|
321
|
+
if (next !== undefined) {
|
|
322
|
+
// not the most efficient thing ever but this is a pretty rare case
|
|
323
|
+
// and there will be very few iterations of this generally
|
|
324
|
+
while (next !== undefined) {
|
|
325
|
+
cursor = {
|
|
326
|
+
name: next.name,
|
|
327
|
+
styles: next.styles,
|
|
328
|
+
next: cursor
|
|
329
|
+
};
|
|
330
|
+
next = next.next;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
var styles = serializedStyles.styles + ";";
|
|
335
|
+
return styles;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
return createStringFromObject(mergedProps, registered, interpolation);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
case 'function':
|
|
342
|
+
{
|
|
343
|
+
if (mergedProps !== undefined) {
|
|
344
|
+
var previousCursor = cursor;
|
|
345
|
+
var result = interpolation(mergedProps);
|
|
346
|
+
cursor = previousCursor;
|
|
347
|
+
return handleInterpolation(mergedProps, registered, result);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
break;
|
|
351
|
+
}
|
|
352
|
+
} // finalize string values (regular strings and functions interpolated into css calls)
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
var asString = interpolation;
|
|
356
|
+
|
|
357
|
+
if (registered == null) {
|
|
358
|
+
return asString;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
var cached = registered[asString];
|
|
362
|
+
return cached !== undefined ? cached : asString;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
function createStringFromObject(mergedProps, registered, obj) {
|
|
366
|
+
var string = '';
|
|
367
|
+
|
|
368
|
+
if (Array.isArray(obj)) {
|
|
369
|
+
for (var i = 0; i < obj.length; i++) {
|
|
370
|
+
string += handleInterpolation(mergedProps, registered, obj[i]) + ";";
|
|
371
|
+
}
|
|
372
|
+
} else {
|
|
373
|
+
for (var key in obj) {
|
|
374
|
+
var value = obj[key];
|
|
375
|
+
|
|
376
|
+
if (typeof value !== 'object') {
|
|
377
|
+
var asString = value;
|
|
378
|
+
|
|
379
|
+
if (registered != null && registered[asString] !== undefined) {
|
|
380
|
+
string += key + "{" + registered[asString] + "}";
|
|
381
|
+
} else if (isProcessableValue(asString)) {
|
|
382
|
+
string += processStyleName(key) + ":" + processStyleValue(key, asString) + ";";
|
|
383
|
+
}
|
|
384
|
+
} else {
|
|
385
|
+
if (key === 'NO_COMPONENT_SELECTOR' && isDevelopment) {
|
|
386
|
+
throw new Error(noComponentSelectorMessage);
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {
|
|
390
|
+
for (var _i = 0; _i < value.length; _i++) {
|
|
391
|
+
if (isProcessableValue(value[_i])) {
|
|
392
|
+
string += processStyleName(key) + ":" + processStyleValue(key, value[_i]) + ";";
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
} else {
|
|
396
|
+
var interpolated = handleInterpolation(mergedProps, registered, value);
|
|
397
|
+
|
|
398
|
+
switch (key) {
|
|
399
|
+
case 'animation':
|
|
400
|
+
case 'animationName':
|
|
401
|
+
{
|
|
402
|
+
string += processStyleName(key) + ":" + interpolated + ";";
|
|
403
|
+
break;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
default:
|
|
407
|
+
{
|
|
408
|
+
|
|
409
|
+
string += key + "{" + interpolated + "}";
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
return string;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
var labelPattern = /label:\s*([^\s;{]+)\s*(;|$)/g; // this is the cursor for keyframes
|
|
421
|
+
// keyframes are stored on the SerializedStyles object as a linked list
|
|
422
|
+
|
|
423
|
+
var cursor;
|
|
424
|
+
function serializeStyles(args, registered, mergedProps) {
|
|
425
|
+
if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {
|
|
426
|
+
return args[0];
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
var stringMode = true;
|
|
430
|
+
var styles = '';
|
|
431
|
+
cursor = undefined;
|
|
432
|
+
var strings = args[0];
|
|
433
|
+
|
|
434
|
+
if (strings == null || strings.raw === undefined) {
|
|
435
|
+
stringMode = false;
|
|
436
|
+
styles += handleInterpolation(mergedProps, registered, strings);
|
|
437
|
+
} else {
|
|
438
|
+
var asTemplateStringsArr = strings;
|
|
439
|
+
|
|
440
|
+
styles += asTemplateStringsArr[0];
|
|
441
|
+
} // we start at 1 since we've already handled the first arg
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
for (var i = 1; i < args.length; i++) {
|
|
445
|
+
styles += handleInterpolation(mergedProps, registered, args[i]);
|
|
446
|
+
|
|
447
|
+
if (stringMode) {
|
|
448
|
+
var templateStringsArr = strings;
|
|
449
|
+
|
|
450
|
+
styles += templateStringsArr[i];
|
|
451
|
+
}
|
|
452
|
+
} // using a global regex with .exec is stateful so lastIndex has to be reset each time
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
labelPattern.lastIndex = 0;
|
|
456
|
+
var identifierName = '';
|
|
457
|
+
var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5
|
|
458
|
+
|
|
459
|
+
while ((match = labelPattern.exec(styles)) !== null) {
|
|
460
|
+
identifierName += '-' + match[1];
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
var name = murmur2(styles) + identifierName;
|
|
464
|
+
|
|
465
|
+
return {
|
|
466
|
+
name: name,
|
|
467
|
+
styles: styles,
|
|
468
|
+
next: cursor
|
|
469
|
+
};
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
;// ./node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+
var syncFallback = function syncFallback(create) {
|
|
478
|
+
return create();
|
|
479
|
+
};
|
|
480
|
+
|
|
481
|
+
var useInsertionEffect = external_react_namespaceObject['useInsertion' + 'Effect'] ? external_react_namespaceObject['useInsertion' + 'Effect'] : false;
|
|
482
|
+
var useInsertionEffectAlwaysWithSyncFallback = useInsertionEffect || syncFallback;
|
|
483
|
+
var useInsertionEffectWithLayoutFallback = useInsertionEffect || external_react_namespaceObject.useLayoutEffect;
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
;// ./node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js
|
|
488
|
+
var isBrowser = true;
|
|
489
|
+
|
|
490
|
+
function getRegisteredStyles(registered, registeredStyles, classNames) {
|
|
491
|
+
var rawClassName = '';
|
|
492
|
+
classNames.split(' ').forEach(function (className) {
|
|
493
|
+
if (registered[className] !== undefined) {
|
|
494
|
+
registeredStyles.push(registered[className] + ";");
|
|
495
|
+
} else if (className) {
|
|
496
|
+
rawClassName += className + " ";
|
|
497
|
+
}
|
|
498
|
+
});
|
|
499
|
+
return rawClassName;
|
|
55
500
|
}
|
|
501
|
+
var registerStyles = function registerStyles(cache, serialized, isStringTag) {
|
|
502
|
+
var className = cache.key + "-" + serialized.name;
|
|
503
|
+
|
|
504
|
+
if ( // we only need to add the styles to the registered cache if the
|
|
505
|
+
// class name could be used further down
|
|
506
|
+
// the tree but if it's a string tag, we know it won't
|
|
507
|
+
// so we don't have to add it to registered cache.
|
|
508
|
+
// this improves memory usage since we can avoid storing the whole style string
|
|
509
|
+
(isStringTag === false || // we need to always store it if we're in compat mode and
|
|
510
|
+
// in node since emotion-server relies on whether a style is in
|
|
511
|
+
// the registered cache to know whether a style is global or not
|
|
512
|
+
// also, note that this check will be dead code eliminated in the browser
|
|
513
|
+
isBrowser === false ) && cache.registered[className] === undefined) {
|
|
514
|
+
cache.registered[className] = serialized.styles;
|
|
515
|
+
}
|
|
516
|
+
};
|
|
517
|
+
var insertStyles = function insertStyles(cache, serialized, isStringTag) {
|
|
518
|
+
registerStyles(cache, serialized, isStringTag);
|
|
519
|
+
var className = cache.key + "-" + serialized.name;
|
|
520
|
+
|
|
521
|
+
if (cache.inserted[serialized.name] === undefined) {
|
|
522
|
+
var current = serialized;
|
|
523
|
+
|
|
524
|
+
do {
|
|
525
|
+
cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true);
|
|
526
|
+
|
|
527
|
+
current = current.next;
|
|
528
|
+
} while (current !== undefined);
|
|
529
|
+
}
|
|
530
|
+
};
|
|
531
|
+
|
|
532
|
+
|
|
56
533
|
|
|
57
|
-
|
|
58
|
-
var import_react2 = __toESM(require("react"));
|
|
59
|
-
var import_prop_types = __toESM(require("prop-types"));
|
|
60
|
-
var import_react_router_dom = require("react-router-dom");
|
|
534
|
+
;// ./node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js
|
|
61
535
|
|
|
62
|
-
// src/styles/Main.styled.js
|
|
63
|
-
var import_styled = __toESM(require("@emotion/styled"));
|
|
64
|
-
var AppContainer = import_styled.default.div`
|
|
65
|
-
font-family: "Inter", sans-serif;
|
|
66
|
-
`;
|
|
67
536
|
|
|
68
|
-
//
|
|
537
|
+
// eslint-disable-next-line no-undef
|
|
538
|
+
var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23
|
|
539
|
+
|
|
540
|
+
var isPropValid = /* #__PURE__ */memoize(function (prop) {
|
|
541
|
+
return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
|
|
542
|
+
/* o */
|
|
543
|
+
&& prop.charCodeAt(1) === 110
|
|
544
|
+
/* n */
|
|
545
|
+
&& prop.charCodeAt(2) < 91;
|
|
546
|
+
}
|
|
547
|
+
/* Z+1 */
|
|
548
|
+
);
|
|
549
|
+
|
|
550
|
+
|
|
551
|
+
|
|
552
|
+
;// ./node_modules/@emotion/styled/base/dist/emotion-styled-base.browser.esm.js
|
|
553
|
+
|
|
554
|
+
|
|
555
|
+
|
|
556
|
+
|
|
557
|
+
|
|
558
|
+
|
|
559
|
+
|
|
560
|
+
|
|
561
|
+
var emotion_styled_base_browser_esm_isDevelopment = false;
|
|
562
|
+
|
|
563
|
+
var testOmitPropsOnStringTag = isPropValid;
|
|
564
|
+
|
|
565
|
+
var testOmitPropsOnComponent = function testOmitPropsOnComponent(key) {
|
|
566
|
+
return key !== 'theme';
|
|
567
|
+
};
|
|
568
|
+
|
|
569
|
+
var getDefaultShouldForwardProp = function getDefaultShouldForwardProp(tag) {
|
|
570
|
+
return typeof tag === 'string' && // 96 is one less than the char code
|
|
571
|
+
// for "a" so this is checking that
|
|
572
|
+
// it's a lowercase character
|
|
573
|
+
tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent;
|
|
574
|
+
};
|
|
575
|
+
var composeShouldForwardProps = function composeShouldForwardProps(tag, options, isReal) {
|
|
576
|
+
var shouldForwardProp;
|
|
577
|
+
|
|
578
|
+
if (options) {
|
|
579
|
+
var optionsShouldForwardProp = options.shouldForwardProp;
|
|
580
|
+
shouldForwardProp = tag.__emotion_forwardProp && optionsShouldForwardProp ? function (propName) {
|
|
581
|
+
return tag.__emotion_forwardProp(propName) && optionsShouldForwardProp(propName);
|
|
582
|
+
} : optionsShouldForwardProp;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
if (typeof shouldForwardProp !== 'function' && isReal) {
|
|
586
|
+
shouldForwardProp = tag.__emotion_forwardProp;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
return shouldForwardProp;
|
|
590
|
+
};
|
|
591
|
+
|
|
592
|
+
var Insertion = function Insertion(_ref) {
|
|
593
|
+
var cache = _ref.cache,
|
|
594
|
+
serialized = _ref.serialized,
|
|
595
|
+
isStringTag = _ref.isStringTag;
|
|
596
|
+
registerStyles(cache, serialized, isStringTag);
|
|
597
|
+
useInsertionEffectAlwaysWithSyncFallback(function () {
|
|
598
|
+
return insertStyles(cache, serialized, isStringTag);
|
|
599
|
+
});
|
|
600
|
+
|
|
601
|
+
return null;
|
|
602
|
+
};
|
|
603
|
+
|
|
604
|
+
var createStyled = function createStyled(tag, options) {
|
|
605
|
+
|
|
606
|
+
var isReal = tag.__emotion_real === tag;
|
|
607
|
+
var baseTag = isReal && tag.__emotion_base || tag;
|
|
608
|
+
var identifierName;
|
|
609
|
+
var targetClassName;
|
|
610
|
+
|
|
611
|
+
if (options !== undefined) {
|
|
612
|
+
identifierName = options.label;
|
|
613
|
+
targetClassName = options.target;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
var shouldForwardProp = composeShouldForwardProps(tag, options, isReal);
|
|
617
|
+
var defaultShouldForwardProp = shouldForwardProp || getDefaultShouldForwardProp(baseTag);
|
|
618
|
+
var shouldUseAs = !defaultShouldForwardProp('as');
|
|
619
|
+
return function () {
|
|
620
|
+
// eslint-disable-next-line prefer-rest-params
|
|
621
|
+
var args = arguments;
|
|
622
|
+
var styles = isReal && tag.__emotion_styles !== undefined ? tag.__emotion_styles.slice(0) : [];
|
|
623
|
+
|
|
624
|
+
if (identifierName !== undefined) {
|
|
625
|
+
styles.push("label:" + identifierName + ";");
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
if (args[0] == null || args[0].raw === undefined) {
|
|
629
|
+
// eslint-disable-next-line prefer-spread
|
|
630
|
+
styles.push.apply(styles, args);
|
|
631
|
+
} else {
|
|
632
|
+
var templateStringsArr = args[0];
|
|
633
|
+
|
|
634
|
+
styles.push(templateStringsArr[0]);
|
|
635
|
+
var len = args.length;
|
|
636
|
+
var i = 1;
|
|
637
|
+
|
|
638
|
+
for (; i < len; i++) {
|
|
639
|
+
|
|
640
|
+
styles.push(args[i], templateStringsArr[i]);
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
var Styled = (0,react_namespaceObject.withEmotionCache)(function (props, cache, ref) {
|
|
645
|
+
var FinalTag = shouldUseAs && props.as || baseTag;
|
|
646
|
+
var className = '';
|
|
647
|
+
var classInterpolations = [];
|
|
648
|
+
var mergedProps = props;
|
|
649
|
+
|
|
650
|
+
if (props.theme == null) {
|
|
651
|
+
mergedProps = {};
|
|
652
|
+
|
|
653
|
+
for (var key in props) {
|
|
654
|
+
mergedProps[key] = props[key];
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
mergedProps.theme = external_react_namespaceObject.useContext(react_namespaceObject.ThemeContext);
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
if (typeof props.className === 'string') {
|
|
661
|
+
className = getRegisteredStyles(cache.registered, classInterpolations, props.className);
|
|
662
|
+
} else if (props.className != null) {
|
|
663
|
+
className = props.className + " ";
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
var serialized = serializeStyles(styles.concat(classInterpolations), cache.registered, mergedProps);
|
|
667
|
+
className += cache.key + "-" + serialized.name;
|
|
668
|
+
|
|
669
|
+
if (targetClassName !== undefined) {
|
|
670
|
+
className += " " + targetClassName;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
var finalShouldForwardProp = shouldUseAs && shouldForwardProp === undefined ? getDefaultShouldForwardProp(FinalTag) : defaultShouldForwardProp;
|
|
674
|
+
var newProps = {};
|
|
675
|
+
|
|
676
|
+
for (var _key in props) {
|
|
677
|
+
if (shouldUseAs && _key === 'as') continue;
|
|
678
|
+
|
|
679
|
+
if (finalShouldForwardProp(_key)) {
|
|
680
|
+
newProps[_key] = props[_key];
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
newProps.className = className;
|
|
685
|
+
|
|
686
|
+
if (ref) {
|
|
687
|
+
newProps.ref = ref;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
return /*#__PURE__*/external_react_namespaceObject.createElement(external_react_namespaceObject.Fragment, null, /*#__PURE__*/external_react_namespaceObject.createElement(Insertion, {
|
|
691
|
+
cache: cache,
|
|
692
|
+
serialized: serialized,
|
|
693
|
+
isStringTag: typeof FinalTag === 'string'
|
|
694
|
+
}), /*#__PURE__*/external_react_namespaceObject.createElement(FinalTag, newProps));
|
|
695
|
+
});
|
|
696
|
+
Styled.displayName = identifierName !== undefined ? identifierName : "Styled(" + (typeof baseTag === 'string' ? baseTag : baseTag.displayName || baseTag.name || 'Component') + ")";
|
|
697
|
+
Styled.defaultProps = tag.defaultProps;
|
|
698
|
+
Styled.__emotion_real = Styled;
|
|
699
|
+
Styled.__emotion_base = baseTag;
|
|
700
|
+
Styled.__emotion_styles = styles;
|
|
701
|
+
Styled.__emotion_forwardProp = shouldForwardProp;
|
|
702
|
+
Object.defineProperty(Styled, 'toString', {
|
|
703
|
+
value: function value() {
|
|
704
|
+
if (targetClassName === undefined && emotion_styled_base_browser_esm_isDevelopment) {
|
|
705
|
+
return 'NO_COMPONENT_SELECTOR';
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
return "." + targetClassName;
|
|
709
|
+
}
|
|
710
|
+
});
|
|
711
|
+
|
|
712
|
+
Styled.withComponent = function (nextTag, nextOptions) {
|
|
713
|
+
var newStyled = createStyled(nextTag, _extends({}, options, nextOptions, {
|
|
714
|
+
shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true)
|
|
715
|
+
}));
|
|
716
|
+
return newStyled.apply(void 0, styles);
|
|
717
|
+
};
|
|
718
|
+
|
|
719
|
+
return Styled;
|
|
720
|
+
};
|
|
721
|
+
};
|
|
722
|
+
|
|
723
|
+
|
|
724
|
+
|
|
725
|
+
;// ./src/styles/Main.styled.js
|
|
726
|
+
|
|
727
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
728
|
+
var AppContainer = /*#__PURE__*/createStyled("div", true ? {
|
|
729
|
+
target: "eh9sycj0"
|
|
730
|
+
} : 0)( true ? {
|
|
731
|
+
name: "1xncdb6",
|
|
732
|
+
styles: "font-family:\"Inter\",sans-serif"
|
|
733
|
+
} : 0);
|
|
734
|
+
;// ./src/styles/globals.css
|
|
735
|
+
// extracted by mini-css-extract-plugin
|
|
736
|
+
|
|
737
|
+
;// ./src/utils/locale.js
|
|
738
|
+
/**
|
|
739
|
+
* Extracts the locale code from the provided URL or the current URL.
|
|
740
|
+
*
|
|
741
|
+
* @param options - An object with the following properties:
|
|
742
|
+
* @param options.url - The URL to extract the locale code from. If not provided, the current URL will be used.
|
|
743
|
+
* @param options.defaultLocale - The default locale code to use if the locale cannot be extracted from the URL.
|
|
744
|
+
* @returns The locale code in the format "language_COUNTRY".
|
|
745
|
+
*/
|
|
69
746
|
function getLocaleCodeFromUrl(options) {
|
|
70
|
-
var
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
747
|
+
var _localeAsArr$;
|
|
748
|
+
var _ref = options !== null && options !== void 0 ? options : {},
|
|
749
|
+
_ref$url = _ref.url,
|
|
750
|
+
url = _ref$url === void 0 ? "" : _ref$url,
|
|
751
|
+
_ref$defaultLocale = _ref.defaultLocale,
|
|
752
|
+
defaultLocale = _ref$defaultLocale === void 0 ? "" : _ref$defaultLocale;
|
|
753
|
+
var localeAsArr = [];
|
|
754
|
+
var tempUrl = url || typeof location != "undefined" && location.href;
|
|
74
755
|
if (tempUrl) {
|
|
75
|
-
|
|
76
|
-
|
|
756
|
+
var _tempUrl, _tempUrl2;
|
|
757
|
+
/* adding dummy domain since express originalUrl will not have request domain */
|
|
758
|
+
if (!((_tempUrl = tempUrl) !== null && _tempUrl !== void 0 && _tempUrl.includes("https://")) && !((_tempUrl2 = tempUrl) !== null && _tempUrl2 !== void 0 && _tempUrl2.includes("http://"))) {
|
|
759
|
+
tempUrl = "https://domain.com".concat(tempUrl);
|
|
77
760
|
}
|
|
78
|
-
|
|
79
|
-
|
|
761
|
+
var updatedUrl = new URL(tempUrl);
|
|
762
|
+
var pathParams = updatedUrl.pathname;
|
|
80
763
|
if (pathParams) {
|
|
81
|
-
|
|
764
|
+
var _pathParams$split;
|
|
765
|
+
var pathList = pathParams === null || pathParams === void 0 || (_pathParams$split = pathParams.split("/")) === null || _pathParams$split === void 0 ? void 0 : _pathParams$split.filter(Boolean);
|
|
82
766
|
if (pathList.length > 1) {
|
|
83
767
|
localeAsArr = pathList;
|
|
84
768
|
}
|
|
@@ -91,195 +775,105 @@ function getLocaleCodeFromUrl(options) {
|
|
|
91
775
|
if (localeAsArr.length === 0) {
|
|
92
776
|
localeAsArr = defaultLocale.split("_");
|
|
93
777
|
}
|
|
94
|
-
return
|
|
778
|
+
return "".concat((_localeAsArr$ = localeAsArr[1]) === null || _localeAsArr$ === void 0 ? void 0 : _localeAsArr$.toUpperCase(), "-").concat(localeAsArr[0]);
|
|
95
779
|
}
|
|
96
|
-
function getLocale(
|
|
97
|
-
var
|
|
98
|
-
|
|
99
|
-
|
|
780
|
+
function getLocale() {
|
|
781
|
+
var _splitLocale$, _splitLocale$2;
|
|
782
|
+
var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
783
|
+
url = _ref2.url;
|
|
784
|
+
var currentLocale = getLocaleCodeFromUrl(url ? {
|
|
785
|
+
url: url
|
|
786
|
+
} : null);
|
|
787
|
+
var splitLocale = currentLocale === null || currentLocale === void 0 ? void 0 : currentLocale.split("-");
|
|
100
788
|
return {
|
|
101
789
|
locale: currentLocale,
|
|
102
|
-
language:
|
|
103
|
-
country:
|
|
790
|
+
language: splitLocale === null || splitLocale === void 0 || (_splitLocale$ = splitLocale[1]) === null || _splitLocale$ === void 0 ? void 0 : _splitLocale$.toLowerCase(),
|
|
791
|
+
country: splitLocale === null || splitLocale === void 0 || (_splitLocale$2 = splitLocale[0]) === null || _splitLocale$2 === void 0 ? void 0 : _splitLocale$2.toUpperCase()
|
|
104
792
|
};
|
|
105
793
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
var HeaderMFEContext = (0, import_react2.createContext)({ isMFE: true });
|
|
109
|
-
function Main({ isMFE = true }) {
|
|
110
|
-
let { country, language } = getLocale();
|
|
111
|
-
country = country.toLocaleLowerCase();
|
|
112
|
-
language = language.toLocaleLowerCase();
|
|
113
|
-
const baseName = isMFE ? `/${country}/${language}` : `/${country}/${language}/static/header-mfe`;
|
|
114
|
-
return /* @__PURE__ */ import_react2.default.createElement(HeaderMFEContext.Provider, { value: { isMFE } }, /* @__PURE__ */ import_react2.default.createElement(import_react_router_dom.BrowserRouter, { basename: baseName }, /* @__PURE__ */ import_react2.default.createElement(AppContainer, null, /* @__PURE__ */ import_react2.default.createElement(import_react_router_dom.Routes, null, /* @__PURE__ */ import_react2.default.createElement(import_react_router_dom.Route, { path: "*", element: /* @__PURE__ */ import_react2.default.createElement(HeaderPlaceholder, null) })))));
|
|
794
|
+
function locale_isBrowser() {
|
|
795
|
+
return typeof window !== "undefined" && window != null;
|
|
115
796
|
}
|
|
116
|
-
Main.propTypes = {
|
|
117
|
-
isMFE: import_prop_types.default.bool
|
|
118
|
-
};
|
|
119
|
-
var Main_default = Main;
|
|
120
797
|
|
|
121
|
-
|
|
122
|
-
function
|
|
123
|
-
|
|
798
|
+
/** Normalized `country`, `language`, and `locale` string from explicit market + language. */
|
|
799
|
+
function buildLocaleData(market, language) {
|
|
800
|
+
var country = String(market).trim().toUpperCase();
|
|
801
|
+
var lang = String(language).trim().toLowerCase();
|
|
802
|
+
if (!country || !lang) {
|
|
803
|
+
throw new Error("@nuskin/nextgen-header: `market` and `language` must be non-empty when provided.");
|
|
804
|
+
}
|
|
124
805
|
return {
|
|
125
|
-
|
|
126
|
-
|
|
806
|
+
country: country,
|
|
807
|
+
language: lang,
|
|
808
|
+
locale: "".concat(country, "-").concat(lang)
|
|
127
809
|
};
|
|
128
810
|
}
|
|
129
811
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
var
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
var
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
// src/utils/contentstack.js
|
|
144
|
-
var _stack = null;
|
|
145
|
-
function getStack() {
|
|
146
|
-
if (!_stack) {
|
|
147
|
-
_stack = import_delivery_sdk.default.stack({
|
|
148
|
-
apiKey: CONTENTSTACK_API_KEY,
|
|
149
|
-
deliveryToken: CONTENTSTACK_DELIVERY_TOKEN,
|
|
150
|
-
environment: CONTENTSTACK_ENVIRONMENT,
|
|
151
|
-
live_preview: {
|
|
152
|
-
enable: true,
|
|
153
|
-
preview_token: CONTENTSTACK_PREVIEW_TOKEN,
|
|
154
|
-
host: "rest-preview.contentstack.com"
|
|
155
|
-
}
|
|
156
|
-
});
|
|
812
|
+
/**
|
|
813
|
+
* Resolves locale data (`country`, `language`, `locale`) for the header shell.
|
|
814
|
+
*
|
|
815
|
+
* - **SSR (no `window`):** `market` and `language` are required (e.g. from the host or from `requestUrl` in `renderAndExtractContext`).
|
|
816
|
+
* - **CSR:** `market` and `language` optional; if omitted, derived from the current URL via the same rules as `getLocale()`. Throws if `window` is missing or the path cannot be parsed.
|
|
817
|
+
*/
|
|
818
|
+
function resolveHeaderLocale() {
|
|
819
|
+
var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
820
|
+
market = _ref3.market,
|
|
821
|
+
language = _ref3.language;
|
|
822
|
+
var explicit = market != null && language != null && String(market).trim() !== "" && String(language).trim() !== "";
|
|
823
|
+
if (explicit) {
|
|
824
|
+
return buildLocaleData(market, language);
|
|
157
825
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
var BRIDGED_CONFIG_KEYS = ["live_preview", "headers", "environment"];
|
|
161
|
-
var stack = new Proxy(
|
|
162
|
-
{},
|
|
163
|
-
{
|
|
164
|
-
get(_, prop) {
|
|
165
|
-
var _a;
|
|
166
|
-
const s = getStack();
|
|
167
|
-
if (BRIDGED_CONFIG_KEYS.includes(prop)) {
|
|
168
|
-
return (_a = s.config) == null ? void 0 : _a[prop];
|
|
169
|
-
}
|
|
170
|
-
return s[prop];
|
|
171
|
-
},
|
|
172
|
-
set(_, prop, value) {
|
|
173
|
-
const s = getStack();
|
|
174
|
-
if (BRIDGED_CONFIG_KEYS.includes(prop)) {
|
|
175
|
-
if (!s.config) return false;
|
|
176
|
-
s.config[prop] = value;
|
|
177
|
-
return true;
|
|
178
|
-
}
|
|
179
|
-
s[prop] = value;
|
|
180
|
-
return true;
|
|
181
|
-
},
|
|
182
|
-
has(_, prop) {
|
|
183
|
-
if (BRIDGED_CONFIG_KEYS.includes(prop)) return true;
|
|
184
|
-
return prop in getStack();
|
|
185
|
-
},
|
|
186
|
-
ownKeys() {
|
|
187
|
-
return [
|
|
188
|
-
.../* @__PURE__ */ new Set([...Reflect.ownKeys(getStack()), ...BRIDGED_CONFIG_KEYS])
|
|
189
|
-
];
|
|
190
|
-
},
|
|
191
|
-
getOwnPropertyDescriptor(_, prop) {
|
|
192
|
-
var _a;
|
|
193
|
-
if (BRIDGED_CONFIG_KEYS.includes(prop)) {
|
|
194
|
-
return {
|
|
195
|
-
configurable: true,
|
|
196
|
-
enumerable: true,
|
|
197
|
-
writable: true,
|
|
198
|
-
value: (_a = getStack().config) == null ? void 0 : _a[prop]
|
|
199
|
-
};
|
|
200
|
-
}
|
|
201
|
-
return Object.getOwnPropertyDescriptor(getStack(), prop);
|
|
202
|
-
}
|
|
826
|
+
if (!locale_isBrowser()) {
|
|
827
|
+
throw new Error("@nuskin/nextgen-header: SSR requires `market` and `language` on `<Main />`, or pass `requestUrl` into `renderAndExtractContext` so they can be derived from the request path.");
|
|
203
828
|
}
|
|
204
|
-
);
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
import_live_preview_utils.default
|
|
208
|
-
);
|
|
209
|
-
function initLivePreview() {
|
|
210
|
-
if (_livePreviewInitialized) return;
|
|
211
|
-
_livePreviewInitialized = true;
|
|
212
|
-
import_live_preview_utils.default.init({
|
|
213
|
-
ssr: false,
|
|
214
|
-
enable: true,
|
|
215
|
-
mode: "builder",
|
|
216
|
-
stackSdk: stack,
|
|
217
|
-
stackDetails: {
|
|
218
|
-
apiKey: CONTENTSTACK_API_KEY,
|
|
219
|
-
environment: CONTENTSTACK_ENVIRONMENT
|
|
220
|
-
},
|
|
221
|
-
clientUrlParams: {
|
|
222
|
-
host: "app.contentstack.com"
|
|
223
|
-
},
|
|
224
|
-
editButton: {
|
|
225
|
-
enable: false
|
|
226
|
-
}
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
function isEditingMode() {
|
|
230
|
-
if (typeof window === "undefined") {
|
|
231
|
-
return false;
|
|
829
|
+
var fromUrl = getLocale();
|
|
830
|
+
if (!fromUrl.country || !fromUrl.language || !fromUrl.locale || String(fromUrl.locale).includes("undefined")) {
|
|
831
|
+
throw new Error("@nuskin/nextgen-header: could not derive `market` and `language` from the current URL (expected a path with at least two segments, e.g. /en/us/...). Pass `market` and `language` explicitly.");
|
|
232
832
|
}
|
|
233
|
-
|
|
234
|
-
return true;
|
|
235
|
-
}
|
|
236
|
-
const params = new URLSearchParams(window.location.search);
|
|
237
|
-
return params.has("visual-builder") || params.has("contentstack") || params.has("live_preview");
|
|
833
|
+
return fromUrl;
|
|
238
834
|
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
return result;
|
|
267
|
-
} catch (error) {
|
|
268
|
-
console.warn(
|
|
269
|
-
"Failed to fetch content with language:",
|
|
270
|
-
language,
|
|
271
|
-
error.message
|
|
272
|
-
);
|
|
273
|
-
try {
|
|
274
|
-
const fallbackResult = await tryFetch("en");
|
|
275
|
-
return fallbackResult;
|
|
276
|
-
} catch (fallbackError) {
|
|
277
|
-
console.warn(
|
|
278
|
-
"Failed to fetch content with fallback language:",
|
|
279
|
-
fallbackError.message
|
|
280
|
-
);
|
|
281
|
-
return null;
|
|
282
|
-
}
|
|
283
|
-
}
|
|
835
|
+
|
|
836
|
+
;// ./src/Main.js
|
|
837
|
+
|
|
838
|
+
|
|
839
|
+
|
|
840
|
+
|
|
841
|
+
|
|
842
|
+
|
|
843
|
+
|
|
844
|
+
function Main(_ref) {
|
|
845
|
+
var market = _ref.market,
|
|
846
|
+
language = _ref.language;
|
|
847
|
+
var resolved = resolveHeaderLocale({
|
|
848
|
+
market: market,
|
|
849
|
+
language: language
|
|
850
|
+
});
|
|
851
|
+
return /*#__PURE__*/(0,jsx_runtime_namespaceObject.jsx)(AppContainer, {
|
|
852
|
+
children: /*#__PURE__*/(0,jsx_runtime_namespaceObject.jsx)(HeaderPlaceholder, {
|
|
853
|
+
country: resolved.country,
|
|
854
|
+
language: resolved.language,
|
|
855
|
+
locale: resolved.locale
|
|
856
|
+
})
|
|
857
|
+
});
|
|
858
|
+
}
|
|
859
|
+
Main.propTypes = {
|
|
860
|
+
market: (external_prop_types_default()).string,
|
|
861
|
+
language: (external_prop_types_default()).string
|
|
284
862
|
};
|
|
863
|
+
/* harmony default export */ const src_Main = (Main);
|
|
864
|
+
;// ./src/library/index.js
|
|
865
|
+
/**
|
|
866
|
+
* Public API for `@nuskin/nextgen-header` npm consumers.
|
|
867
|
+
*
|
|
868
|
+
* **Header** — `AppContainer` + market/language resolution → renders the header placeholder inside.
|
|
869
|
+
* (Source: `Main.js`; exported under the product name `Header`.)
|
|
870
|
+
*
|
|
871
|
+
* Does not include the Module Federation app entry (`App`), Express server, or bootstrap.
|
|
872
|
+
* Contentstack helpers are internal for now; re-export here when the public API is defined.
|
|
873
|
+
*/
|
|
874
|
+
|
|
875
|
+
|
|
876
|
+
module.exports = __webpack_exports__;
|
|
877
|
+
/******/ })()
|
|
878
|
+
;
|
|
285
879
|
//# sourceMappingURL=index.js.map
|