(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push([typeof document === "object" ? document.currentScript : undefined, "[project]/node_modules/html-parse-stringify/dist/esm/html-parse-stringify.js [app-client] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "default", ()=>index, "parse", ()=>parse, "stringify", ()=>stringify ]); // inlined from the former `void-elements` dependency, so the package has // zero runtime dependencies. `!doctype`/`!DOCTYPE` are treated as void so a // doctype parses as a childless node instead of swallowing the document. const voidElements = { area: true, base: true, br: true, col: true, embed: true, hr: true, img: true, input: true, link: true, meta: true, param: true, source: true, track: true, wbr: true, '!doctype': true, '!DOCTYPE': true }; const attrRE = /\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?("[^"]*"|'[^']*')/g; function parseTag(tag) { const res = { type: 'tag', name: '', voidElement: false, attrs: {}, children: [] }; const tagMatch = tag.match(/<\/?([^\s]+?)[/\s>]/); if (tagMatch) { res.name = tagMatch[1]; // void-element lookup stays case sensitive on purpose: react-i18next // relies on `
` NOT being treated as a void `
` (see 1df0f9d) if (voidElements[tagMatch[1]] || tag.charAt(tag.length - 2) === '/') { res.voidElement = true; } // handle comment tag if (res.name.startsWith('!--')) { const endIndex = tag.indexOf('-->'); return { type: 'comment', comment: endIndex !== -1 ? tag.slice(4, endIndex) : '' }; } } const reg = new RegExp(attrRE); let result = null; for(;;){ result = reg.exec(tag); if (result === null) { break; } if (!result[0].trim()) { continue; } if (result[1]) { const attr = result[1].trim(); // boolean attributes carry `null` so stringify can render them bare // (`` instead of ``) let arr = [ attr, null ]; const eq = attr.indexOf('='); if (eq > -1) { // split at the first `=` only, so `data-x=a=b` keeps its full value arr = [ attr.slice(0, eq), attr.slice(eq + 1) ]; } res.attrs[arr[0]] = arr[1]; reg.lastIndex--; } else if (result[2]) { res.attrs[result[2]] = result[3].trim().substring(1, result[3].length - 1); } } return res; } // comments are matched as a whole (so `>` inside them is fine), everything // else tag-shaped is matched by the second alternative const tagRE = /|<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g; const tagNameRE = /<\/?([^\s]+?)[/\s>]/; const whitespaceRE = /^\s*$/; // tags whose content is raw text: nothing inside them is markup const rawTextRE = /^(script|style)$/i; // placeholder for `<` of tags rejected by options.allowedTags; restored to a // literal `<` in text/attr/comment content after parsing (U+0000 cannot appear // in sane input, and a collision would merely render as an extra `<`) const sentinel = '\u0000'; // re-used obj for quick lookups of components const empty = Object.create(null); function restoreSentinels(nodes) { nodes.forEach(function(node) { if (node.type === 'text') { node.content = node.content.split(sentinel).join('<'); return; } if (node.type === 'comment') { node.comment = node.comment.split(sentinel).join('<'); return; } for(const key in node.attrs){ const value = node.attrs[key]; if (typeof value === 'string' && value.indexOf(sentinel) > -1) { node.attrs[key] = value.split(sentinel).join('<'); } } if (node.children.length) { restoreSentinels(node.children); } }); } function parse(html, options) { const components = options && options.components || empty; const allowedTags = options && options.allowedTags; let restoreNeeded = false; if (allowedTags) { const isAllowed = typeof allowedTags === 'function' ? allowedTags : function(name) { return allowedTags.indexOf(name) > -1; }; // neutralize tags whose name is not allowed, so they parse as text. // on a disallowed match only the leading `<` is escaped and scanning // resumes right after it, so a valid tag glued into the same match // (e.g. `` inside `<10, <20, and `) still gets recognized let out = ''; let pos = 0; tagRE.lastIndex = 0; let am; while(am = tagRE.exec(html)){ const tag = am[0]; out += html.slice(pos, am.index); const nameMatch = tag.match(tagNameRE); if (tag.startsWith('` desyncs the string-level isComment check // from parseTag's name-based comment detection and crashes the walker const validSplit = secondLt > -1 && /[a-zA-Z0-9\-!/]/.test(tag.charAt(secondLt + 1)); if (lts > gts && validSplit) { const firstPart = tag.substring(0, secondLt); const secondPart = tag.substring(firstPart.length); matches[i][0] = secondPart; matches[i].index += firstPart.length; } }); matches.forEach(function(match, i) { const tag = match[0]; if (!tag) return; const index = match.index; if (index < rawUntil) return; if (inComponent) { if (tag !== '') { return; } else { inComponent = false; } } const isOpen = tag.charAt(1) !== '/'; const isComment = tag.startsWith(''; return buff; } } function stringify(doc) { return doc.reduce(function(token, rootEl) { return token + stringifyNode('', rootEl); }, ''); } var index = { parse, stringify }; ; }), "[project]/node_modules/i18next/dist/esm/i18next.js [app-client] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "changeLanguage", ()=>changeLanguage, "createInstance", ()=>createInstance, "default", ()=>instance, "dir", ()=>dir, "exists", ()=>exists, "getFixedT", ()=>getFixedT, "hasLoadedNamespace", ()=>hasLoadedNamespace, "init", ()=>init, "keyFromSelector", ()=>keysFromSelector, "loadLanguages", ()=>loadLanguages, "loadNamespaces", ()=>loadNamespaces, "loadResources", ()=>loadResources, "reloadResources", ()=>reloadResources, "setDefaultNamespace", ()=>setDefaultNamespace, "t", ()=>t, "use", ()=>use ]); const isString = (obj)=>typeof obj === 'string'; const defer = ()=>{ let res; let rej; const promise = new Promise((resolve, reject)=>{ res = resolve; rej = reject; }); promise.resolve = res; promise.reject = rej; return promise; }; const makeString = (object)=>{ if (object == null) return ''; return String(object); }; const copy = (a, s, t)=>{ a.forEach((m)=>{ if (s[m]) t[m] = s[m]; }); }; const lastOfPathSeparatorRegExp = /###/g; const cleanKey = (key)=>key && key.includes('###') ? key.replace(lastOfPathSeparatorRegExp, '.') : key; const canNotTraverseDeeper = (object)=>!object || isString(object); const getLastOfPath = (object, path, Empty)=>{ const stack = !isString(path) ? path : path.split('.'); let stackIndex = 0; while(stackIndex < stack.length - 1){ if (canNotTraverseDeeper(object)) return {}; const key = cleanKey(stack[stackIndex]); if (!object[key] && Empty) object[key] = new Empty(); if (Object.prototype.hasOwnProperty.call(object, key)) { object = object[key]; } else { object = {}; } ++stackIndex; } if (canNotTraverseDeeper(object)) return {}; return { obj: object, k: cleanKey(stack[stackIndex]) }; }; const setPath = (object, path, newValue)=>{ const { obj, k } = getLastOfPath(object, path, Object); if (obj !== undefined || path.length === 1) { obj[k] = newValue; return; } let e = path[path.length - 1]; let p = path.slice(0, path.length - 1); let last = getLastOfPath(object, p, Object); while(last.obj === undefined && p.length){ e = `${p[p.length - 1]}.${e}`; p = p.slice(0, p.length - 1); last = getLastOfPath(object, p, Object); if (last?.obj && typeof last.obj[`${last.k}.${e}`] !== 'undefined') { last.obj = undefined; } } last.obj[`${last.k}.${e}`] = newValue; }; const pushPath = (object, path, newValue, concat)=>{ const { obj, k } = getLastOfPath(object, path, Object); obj[k] = obj[k] || []; obj[k].push(newValue); }; const getPath = (object, path)=>{ const { obj, k } = getLastOfPath(object, path); if (!obj) return undefined; if (!Object.prototype.hasOwnProperty.call(obj, k)) return undefined; return obj[k]; }; const getPathWithDefaults = (data, defaultData, key)=>{ const value = getPath(data, key); if (value !== undefined) { return value; } return getPath(defaultData, key); }; const deepExtend = (target, source, overwrite)=>{ for(const prop in source){ if (prop !== '__proto__' && prop !== 'constructor') { if (Object.prototype.hasOwnProperty.call(target, prop)) { if (isString(target[prop]) || target[prop] instanceof String || isString(source[prop]) || source[prop] instanceof String) { if (overwrite) target[prop] = source[prop]; } else { deepExtend(target[prop], source[prop], overwrite); } } else { target[prop] = source[prop]; } } } return target; }; const regexEscape = (str)=>str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'); const _entityMap = { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''', '/': '/' }; const escape = (data)=>{ if (isString(data)) { return data.replace(/[&<>"'\/]/g, (s)=>_entityMap[s]); } return data; }; class RegExpCache { constructor(capacity){ this.capacity = capacity; this.regExpMap = new Map(); this.regExpQueue = []; } getRegExp(pattern) { const regExpFromCache = this.regExpMap.get(pattern); if (regExpFromCache !== undefined) { return regExpFromCache; } const regExpNew = new RegExp(pattern); if (this.regExpQueue.length === this.capacity) { this.regExpMap.delete(this.regExpQueue.shift()); } this.regExpMap.set(pattern, regExpNew); this.regExpQueue.push(pattern); return regExpNew; } } const chars = [ ' ', ',', '?', '!', ';' ]; const looksLikeObjectPathRegExpCache = new RegExpCache(20); const looksLikeObjectPath = (key, nsSeparator, keySeparator)=>{ nsSeparator = nsSeparator || ''; keySeparator = keySeparator || ''; const possibleChars = chars.filter((c)=>!nsSeparator.includes(c) && !keySeparator.includes(c)); if (possibleChars.length === 0) return true; const r = looksLikeObjectPathRegExpCache.getRegExp(`(${possibleChars.map((c)=>c === '?' ? '\\?' : c).join('|')})`); let matched = !r.test(key); if (!matched) { const ki = key.indexOf(keySeparator); if (ki > 0 && !r.test(key.substring(0, ki))) { matched = true; } } return matched; }; const deepFind = (obj, path, keySeparator = '.')=>{ if (!obj) return undefined; if (obj[path]) { if (!Object.prototype.hasOwnProperty.call(obj, path)) return undefined; return obj[path]; } const tokens = path.split(keySeparator); let current = obj; for(let i = 0; i < tokens.length;){ if (!current || typeof current !== 'object') { return undefined; } let next; let nextPath = ''; for(let j = i; j < tokens.length; ++j){ if (j !== i) { nextPath += keySeparator; } nextPath += tokens[j]; next = current[nextPath]; if (next !== undefined) { if ([ 'string', 'number', 'boolean' ].includes(typeof next) && j < tokens.length - 1) { continue; } i += j - i + 1; break; } } current = next; } return current; }; const getCleanedCode = (code)=>code?.replace(/_/g, '-'); const consoleLogger = { type: 'logger', log (args) { this.output('log', args); }, warn (args) { this.output('warn', args); }, error (args) { this.output('error', args); }, output (type, args) { console?.[type]?.apply?.(console, args); } }; class Logger { constructor(concreteLogger, options = {}){ this.init(concreteLogger, options); } init(concreteLogger, options = {}) { this.prefix = options.prefix || 'i18next:'; this.logger = concreteLogger || consoleLogger; this.options = options; this.debug = options.debug; } log(...args) { return this.forward(args, 'log', '', true); } warn(...args) { return this.forward(args, 'warn', '', true); } error(...args) { return this.forward(args, 'error', ''); } deprecate(...args) { return this.forward(args, 'warn', 'WARNING DEPRECATED: ', true); } forward(args, lvl, prefix, debugOnly) { if (debugOnly && !this.debug) return null; args = args.map((a)=>isString(a) ? a.replace(/[\r\n\x00-\x1F\x7F]/g, ' ') : a); if (isString(args[0])) args[0] = `${prefix}${this.prefix} ${args[0]}`; return this.logger[lvl](args); } create(moduleName) { return new Logger(this.logger, { ...{ prefix: `${this.prefix}:${moduleName}:` }, ...this.options }); } clone(options) { options = options || this.options; options.prefix = options.prefix || this.prefix; return new Logger(this.logger, options); } } var baseLogger = new Logger(); class EventEmitter { constructor(){ this.observers = {}; } on(events, listener) { events.split(' ').forEach((event)=>{ if (!this.observers[event]) this.observers[event] = new Map(); const numListeners = this.observers[event].get(listener) || 0; this.observers[event].set(listener, numListeners + 1); }); return this; } off(event, listener) { if (!this.observers[event]) return; if (!listener) { delete this.observers[event]; return; } this.observers[event].delete(listener); } once(event, listener) { const wrapper = (...args)=>{ listener(...args); this.off(event, wrapper); }; this.on(event, wrapper); return this; } emit(event, ...args) { if (this.observers[event]) { const cloned = Array.from(this.observers[event].entries()); cloned.forEach(([observer, numTimesAdded])=>{ for(let i = 0; i < numTimesAdded; i++){ observer(...args); } }); } if (this.observers['*']) { const cloned = Array.from(this.observers['*'].entries()); cloned.forEach(([observer, numTimesAdded])=>{ for(let i = 0; i < numTimesAdded; i++){ observer(event, ...args); } }); } } } class ResourceStore extends EventEmitter { constructor(data, options = { ns: [ 'translation' ], defaultNS: 'translation' }){ super(); this.data = data || {}; this.options = options; if (this.options.keySeparator === undefined) { this.options.keySeparator = '.'; } if (this.options.ignoreJSONStructure === undefined) { this.options.ignoreJSONStructure = true; } } addNamespaces(ns) { if (!this.options.ns.includes(ns)) { this.options.ns.push(ns); } } removeNamespaces(ns) { const index = this.options.ns.indexOf(ns); if (index > -1) { this.options.ns.splice(index, 1); } } getResource(lng, ns, key, options = {}) { const keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator; const ignoreJSONStructure = options.ignoreJSONStructure !== undefined ? options.ignoreJSONStructure : this.options.ignoreJSONStructure; let path; if (lng.includes('.')) { path = lng.split('.'); } else { path = [ lng, ns ]; if (key) { if (Array.isArray(key)) { path.push(...key); } else if (isString(key) && keySeparator) { path.push(...key.split(keySeparator)); } else { path.push(key); } } } const result = getPath(this.data, path); if (!result && !ns && !key && lng.includes('.')) { lng = path[0]; ns = path[1]; key = path.slice(2).join('.'); } if (result || !ignoreJSONStructure || !isString(key)) return result; return deepFind(this.data?.[lng]?.[ns], key, keySeparator); } addResource(lng, ns, key, value, options = { silent: false }) { const keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator; let path = [ lng, ns ]; if (key) path = path.concat(keySeparator ? key.split(keySeparator) : key); if (lng.includes('.')) { path = lng.split('.'); value = ns; ns = path[1]; } this.addNamespaces(ns); setPath(this.data, path, value); if (!options.silent) this.emit('added', lng, ns, key, value); } addResources(lng, ns, resources, options = { silent: false }) { for(const m in resources){ if (isString(resources[m]) || Array.isArray(resources[m])) this.addResource(lng, ns, m, resources[m], { silent: true }); } if (!options.silent) this.emit('added', lng, ns, resources); } addResourceBundle(lng, ns, resources, deep, overwrite, options = { silent: false, skipCopy: false }) { let path = [ lng, ns ]; if (lng.includes('.')) { path = lng.split('.'); deep = resources; resources = ns; ns = path[1]; } this.addNamespaces(ns); let pack = getPath(this.data, path) || {}; if (!options.skipCopy) resources = JSON.parse(JSON.stringify(resources)); if (deep) { deepExtend(pack, resources, overwrite); } else { pack = { ...pack, ...resources }; } setPath(this.data, path, pack); if (!options.silent) this.emit('added', lng, ns, resources); } removeResourceBundle(lng, ns) { if (this.hasResourceBundle(lng, ns)) { delete this.data[lng][ns]; } this.removeNamespaces(ns); this.emit('removed', lng, ns); } hasResourceBundle(lng, ns) { return this.getResource(lng, ns) !== undefined; } getResourceBundle(lng, ns) { if (!ns) ns = this.options.defaultNS; return this.getResource(lng, ns); } getDataByLanguage(lng) { return this.data[lng]; } hasLanguageSomeTranslations(lng) { const data = this.getDataByLanguage(lng); const n = data && Object.keys(data) || []; return !!n.find((v)=>data[v] && Object.keys(data[v]).length > 0); } toJSON() { return this.data; } } var postProcessor = { processors: {}, addPostProcessor (module) { this.processors[module.name] = module; }, handle (processors, value, key, options, translator) { processors.forEach((processor)=>{ value = this.processors[processor]?.process(value, key, options, translator) ?? value; }); return value; } }; const PATH_KEY = Symbol('i18next/PATH_KEY'); function createProxy() { const state = []; const handler = Object.create(null); let proxy; handler.get = (target, key)=>{ proxy?.revoke?.(); if (key === PATH_KEY) return state; state.push(key); proxy = Proxy.revocable(target, handler); return proxy.proxy; }; return Proxy.revocable(Object.create(null), handler).proxy; } function keysFromSelector(selector, opts) { const { [PATH_KEY]: path } = selector(createProxy()); const keySeparator = opts?.keySeparator ?? '.'; const nsSeparator = opts?.nsSeparator ?? ':'; const strict = opts?.enableSelector === 'strict'; if (path.length > 1 && nsSeparator) { const ns = opts?.ns; const nsList = strict ? Array.isArray(ns) ? ns : ns ? [ ns ] : null : Array.isArray(ns) ? ns : null; if (nsList) { const candidates = strict ? nsList : nsList.length > 1 ? nsList.slice(1) : []; if (candidates.includes(path[0])) { return `${path[0]}${nsSeparator}${path.slice(1).join(keySeparator)}`; } } } return path.join(keySeparator); } const shouldHandleAsObject = (res)=>!isString(res) && typeof res !== 'boolean' && typeof res !== 'number'; class Translator extends EventEmitter { constructor(services, options = {}){ super(); copy([ 'resourceStore', 'languageUtils', 'pluralResolver', 'interpolator', 'backendConnector', 'i18nFormat', 'utils' ], services, this); this.options = options; if (this.options.keySeparator === undefined) { this.options.keySeparator = '.'; } this.logger = baseLogger.create('translator'); this.checkedLoadedFor = {}; } changeLanguage(lng) { if (lng) this.language = lng; } exists(key, o = { interpolation: {} }) { const opt = { ...o }; if (key == null) return false; const resolved = this.resolve(key, opt); if (resolved?.res === undefined) return false; const isObject = shouldHandleAsObject(resolved.res); if (opt.returnObjects === false && isObject) { return false; } return true; } extractFromKey(key, opt) { let nsSeparator = opt.nsSeparator !== undefined ? opt.nsSeparator : this.options.nsSeparator; if (nsSeparator === undefined) nsSeparator = ':'; const keySeparator = opt.keySeparator !== undefined ? opt.keySeparator : this.options.keySeparator; let namespaces = opt.ns || this.options.defaultNS || []; const wouldCheckForNsInKey = nsSeparator && key.includes(nsSeparator); const seemsNaturalLanguage = !this.options.userDefinedKeySeparator && !opt.keySeparator && !this.options.userDefinedNsSeparator && !opt.nsSeparator && !looksLikeObjectPath(key, nsSeparator, keySeparator); if (wouldCheckForNsInKey && !seemsNaturalLanguage) { const m = key.match(this.interpolator.nestingRegexp); if (m && m.length > 0) { return { key, namespaces: isString(namespaces) ? [ namespaces ] : namespaces }; } const parts = key.split(nsSeparator); if (nsSeparator !== keySeparator || nsSeparator === keySeparator && this.options.ns.includes(parts[0])) namespaces = parts.shift(); key = parts.join(keySeparator); } return { key, namespaces: isString(namespaces) ? [ namespaces ] : namespaces }; } translate(keys, o, lastKey) { let opt = typeof o === 'object' ? { ...o } : o; if (typeof opt !== 'object' && this.options.overloadTranslationOptionHandler) { opt = this.options.overloadTranslationOptionHandler(arguments); } if (typeof opt === 'object') opt = { ...opt }; if (!opt) opt = {}; if (keys == null) return ''; if (typeof keys === 'function') keys = keysFromSelector(keys, { ...this.options, ...opt }); if (!Array.isArray(keys)) keys = [ String(keys) ]; keys = keys.map((k)=>typeof k === 'function' ? keysFromSelector(k, { ...this.options, ...opt }) : String(k)); const returnDetails = opt.returnDetails !== undefined ? opt.returnDetails : this.options.returnDetails; const keySeparator = opt.keySeparator !== undefined ? opt.keySeparator : this.options.keySeparator; const { key, namespaces } = this.extractFromKey(keys[keys.length - 1], opt); const namespace = namespaces[namespaces.length - 1]; let nsSeparator = opt.nsSeparator !== undefined ? opt.nsSeparator : this.options.nsSeparator; if (nsSeparator === undefined) nsSeparator = ':'; const lng = opt.lng || this.language; const appendNamespaceToCIMode = opt.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode; if (lng?.toLowerCase() === 'cimode') { if (appendNamespaceToCIMode) { if (returnDetails) { return { res: `${namespace}${nsSeparator}${key}`, usedKey: key, exactUsedKey: key, usedLng: lng, usedNS: namespace, usedParams: this.getUsedParamsDetails(opt) }; } return `${namespace}${nsSeparator}${key}`; } if (returnDetails) { return { res: key, usedKey: key, exactUsedKey: key, usedLng: lng, usedNS: namespace, usedParams: this.getUsedParamsDetails(opt) }; } return key; } const resolved = this.resolve(keys, opt); let res = resolved?.res; const resUsedKey = resolved?.usedKey || key; const resExactUsedKey = resolved?.exactUsedKey || key; const noObject = [ '[object Number]', '[object Function]', '[object RegExp]' ]; const joinArrays = opt.joinArrays !== undefined ? opt.joinArrays : this.options.joinArrays; const handleAsObjectInI18nFormat = !this.i18nFormat || this.i18nFormat.handleAsObject; const needsPluralHandling = opt.count !== undefined && !isString(opt.count); const hasDefaultValue = Translator.hasDefaultValue(opt); const defaultValueSuffix = needsPluralHandling ? this.pluralResolver.getSuffix(lng, opt.count, opt) : ''; const defaultValueSuffixOrdinalFallback = opt.ordinal && needsPluralHandling ? this.pluralResolver.getSuffix(lng, opt.count, { ordinal: false }) : ''; const needsZeroSuffixLookup = needsPluralHandling && !opt.ordinal && opt.count === 0; const defaultValue = needsZeroSuffixLookup && opt[`defaultValue${this.options.pluralSeparator}zero`] || opt[`defaultValue${defaultValueSuffix}`] || opt[`defaultValue${defaultValueSuffixOrdinalFallback}`] || opt.defaultValue; let resForObjHndl = res; if (handleAsObjectInI18nFormat && !res && hasDefaultValue) { resForObjHndl = defaultValue; } const handleAsObject = shouldHandleAsObject(resForObjHndl); const resType = Object.prototype.toString.apply(resForObjHndl); if (handleAsObjectInI18nFormat && resForObjHndl && handleAsObject && !noObject.includes(resType) && !(isString(joinArrays) && Array.isArray(resForObjHndl))) { if (!opt.returnObjects && !this.options.returnObjects) { if (!this.options.returnedObjectHandler) { this.logger.warn('accessing an object - but returnObjects options is not enabled!'); } const r = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(resUsedKey, resForObjHndl, { ...opt, ns: namespaces }) : `key '${key} (${this.language})' returned an object instead of string.`; if (returnDetails) { resolved.res = r; resolved.usedParams = this.getUsedParamsDetails(opt); return resolved; } return r; } if (keySeparator) { const resTypeIsArray = Array.isArray(resForObjHndl); const copy = resTypeIsArray ? [] : {}; const newKeyToUse = resTypeIsArray ? resExactUsedKey : resUsedKey; for(const m in resForObjHndl){ if (Object.prototype.hasOwnProperty.call(resForObjHndl, m)) { const deepKey = `${newKeyToUse}${keySeparator}${m}`; if (hasDefaultValue && !res) { copy[m] = this.translate(deepKey, { ...opt, defaultValue: shouldHandleAsObject(defaultValue) ? defaultValue[m] : undefined, ...{ joinArrays: false, ns: namespaces } }); } else { copy[m] = this.translate(deepKey, { ...opt, ...{ joinArrays: false, ns: namespaces } }); } if (copy[m] === deepKey) copy[m] = resForObjHndl[m]; } } res = copy; } } else if (handleAsObjectInI18nFormat && isString(joinArrays) && Array.isArray(res)) { res = res.join(joinArrays); if (res) res = this.extendTranslation(res, keys, opt, lastKey); } else { let usedDefault = false; let usedKey = false; if (!this.isValidLookup(res) && hasDefaultValue) { usedDefault = true; res = defaultValue; } if (!this.isValidLookup(res)) { usedKey = true; res = key; } const missingKeyNoValueFallbackToKey = opt.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey; const resForMissing = missingKeyNoValueFallbackToKey && usedKey ? undefined : res; const updateMissing = hasDefaultValue && defaultValue !== res && this.options.updateMissing; if (usedKey || usedDefault || updateMissing) { this.logger.log(updateMissing ? 'updateKey' : 'missingKey', lng, namespace, needsPluralHandling && !updateMissing ? `${key}${this.pluralResolver.getSuffix(lng, opt.count, opt)}` : key, updateMissing ? defaultValue : res); if (keySeparator) { const fk = this.resolve(key, { ...opt, keySeparator: false }); if (fk && fk.res) this.logger.warn('Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.'); } let lngs = []; const fallbackLngs = this.languageUtils.getFallbackCodes(this.options.fallbackLng, opt.lng || this.language); if (this.options.saveMissingTo === 'fallback' && fallbackLngs && fallbackLngs[0]) { for(let i = 0; i < fallbackLngs.length; i++){ lngs.push(fallbackLngs[i]); } } else if (this.options.saveMissingTo === 'all') { lngs = this.languageUtils.toResolveHierarchy(opt.lng || this.language); } else { lngs.push(opt.lng || this.language); } const send = (l, k, specificDefaultValue)=>{ const defaultForMissing = hasDefaultValue && specificDefaultValue !== res ? specificDefaultValue : resForMissing; if (this.options.missingKeyHandler) { this.options.missingKeyHandler(l, namespace, k, defaultForMissing, updateMissing, opt); } else if (this.backendConnector?.saveMissing) { this.backendConnector.saveMissing(l, namespace, k, defaultForMissing, updateMissing, opt); } this.emit('missingKey', l, namespace, k, res); }; if (this.options.saveMissing) { if (this.options.saveMissingPlurals && needsPluralHandling) { lngs.forEach((language)=>{ const suffixes = this.pluralResolver.getSuffixes(language, opt); if (needsZeroSuffixLookup && opt[`defaultValue${this.options.pluralSeparator}zero`] && !suffixes.includes(`${this.options.pluralSeparator}zero`)) { suffixes.push(`${this.options.pluralSeparator}zero`); } suffixes.forEach((suffix)=>{ send([ language ], key + suffix, opt[`defaultValue${suffix}`] || defaultValue); }); }); } else { send(lngs, key, defaultValue); } } } res = this.extendTranslation(res, keys, opt, resolved, lastKey); if (usedKey && res === key && this.options.appendNamespaceToMissingKey) { res = `${namespace}${nsSeparator}${key}`; } if ((usedKey || usedDefault) && this.options.parseMissingKeyHandler) { res = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${namespace}${nsSeparator}${key}` : key, usedDefault ? res : undefined, opt); } } if (returnDetails) { resolved.res = res; resolved.usedParams = this.getUsedParamsDetails(opt); return resolved; } return res; } extendTranslation(res, key, opt, resolved, lastKey) { if (this.i18nFormat?.parse) { res = this.i18nFormat.parse(res, { ...this.options.interpolation.defaultVariables, ...opt }, opt.lng || this.language || resolved.usedLng, resolved.usedNS, resolved.usedKey, { resolved }); } else if (!opt.skipInterpolation) { if (opt.interpolation) this.interpolator.init({ ...opt, ...{ interpolation: { ...this.options.interpolation, ...opt.interpolation } } }); const skipOnVariables = isString(res) && (opt?.interpolation?.skipOnVariables !== undefined ? opt.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables); let nestBef; if (skipOnVariables) { const nb = res.match(this.interpolator.nestingRegexp); nestBef = nb && nb.length; } let data = opt.replace && !isString(opt.replace) ? opt.replace : opt; if (this.options.interpolation.defaultVariables) data = { ...this.options.interpolation.defaultVariables, ...data }; res = this.interpolator.interpolate(res, data, opt.lng || this.language || resolved.usedLng, opt); if (skipOnVariables) { const na = res.match(this.interpolator.nestingRegexp); const nestAft = na && na.length; if (nestBef < nestAft) opt.nest = false; } if (!opt.lng && resolved && resolved.res) opt.lng = this.language || resolved.usedLng; if (opt.nest !== false) res = this.interpolator.nest(res, (...args)=>{ if (lastKey?.[0] === args[0] && !opt.context) { this.logger.warn(`It seems you are nesting recursively key: ${args[0]} in key: ${key[0]}`); return null; } return this.translate(...args, key); }, opt); if (opt.interpolation) this.interpolator.reset(); } const postProcess = opt.postProcess || this.options.postProcess; const postProcessorNames = isString(postProcess) ? [ postProcess ] : postProcess; if (res != null && postProcessorNames?.length && opt.applyPostProcessor !== false) { res = postProcessor.handle(postProcessorNames, res, key, this.options && this.options.postProcessPassResolved ? { i18nResolved: { ...resolved, usedParams: this.getUsedParamsDetails(opt) }, ...opt } : opt, this); } return res; } resolve(keys, opt = {}) { let found; let usedKey; let exactUsedKey; let usedLng; let usedNS; if (isString(keys)) keys = [ keys ]; if (Array.isArray(keys)) keys = keys.map((k)=>typeof k === 'function' ? keysFromSelector(k, { ...this.options, ...opt }) : k); keys.forEach((k)=>{ if (this.isValidLookup(found)) return; const extracted = this.extractFromKey(k, opt); const key = extracted.key; usedKey = key; let namespaces = extracted.namespaces; if (this.options.fallbackNS) namespaces = namespaces.concat(this.options.fallbackNS); const needsPluralHandling = opt.count !== undefined && !isString(opt.count); const needsZeroSuffixLookup = needsPluralHandling && !opt.ordinal && opt.count === 0; const needsContextHandling = opt.context !== undefined && (isString(opt.context) || typeof opt.context === 'number') && opt.context !== ''; const codes = opt.lngs ? opt.lngs : this.languageUtils.toResolveHierarchy(opt.lng || this.language, opt.fallbackLng); namespaces.forEach((ns)=>{ if (this.isValidLookup(found)) return; usedNS = ns; if (!this.checkedLoadedFor[`${codes[0]}-${ns}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(usedNS)) { this.checkedLoadedFor[`${codes[0]}-${ns}`] = true; this.logger.warn(`key "${usedKey}" for languages "${codes.join(', ')}" won't get resolved as namespace "${usedNS}" was not yet loaded`, 'This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!'); } codes.forEach((code)=>{ if (this.isValidLookup(found)) return; usedLng = code; const finalKeys = [ key ]; if (this.i18nFormat?.addLookupKeys) { this.i18nFormat.addLookupKeys(finalKeys, key, code, ns, opt); } else { let pluralSuffix; if (needsPluralHandling) pluralSuffix = this.pluralResolver.getSuffix(code, opt.count, opt); const zeroSuffix = `${this.options.pluralSeparator}zero`; const ordinalPrefix = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`; if (needsPluralHandling) { if (opt.ordinal && pluralSuffix.startsWith(ordinalPrefix)) { finalKeys.push(key + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator)); } finalKeys.push(key + pluralSuffix); if (needsZeroSuffixLookup) { finalKeys.push(key + zeroSuffix); } } if (needsContextHandling) { const contextKey = `${key}${this.options.contextSeparator || '_'}${opt.context}`; finalKeys.push(contextKey); if (needsPluralHandling) { if (opt.ordinal && pluralSuffix.startsWith(ordinalPrefix)) { finalKeys.push(contextKey + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator)); } finalKeys.push(contextKey + pluralSuffix); if (needsZeroSuffixLookup) { finalKeys.push(contextKey + zeroSuffix); } } } } let possibleKey; while(possibleKey = finalKeys.pop()){ if (!this.isValidLookup(found)) { exactUsedKey = possibleKey; found = this.getResource(code, ns, possibleKey, opt); } } }); }); }); return { res: found, usedKey, exactUsedKey, usedLng, usedNS }; } isValidLookup(res) { return res !== undefined && !(!this.options.returnNull && res === null) && !(!this.options.returnEmptyString && res === ''); } getResource(code, ns, key, options = {}) { if (this.i18nFormat?.getResource) return this.i18nFormat.getResource(code, ns, key, options); return this.resourceStore.getResource(code, ns, key, options); } getUsedParamsDetails(options = {}) { const optionsKeys = [ 'defaultValue', 'ordinal', 'context', 'replace', 'lng', 'lngs', 'fallbackLng', 'ns', 'keySeparator', 'nsSeparator', 'returnObjects', 'returnDetails', 'joinArrays', 'postProcess', 'interpolation' ]; const useOptionsReplaceForData = options.replace && !isString(options.replace); let data = useOptionsReplaceForData ? options.replace : options; if (useOptionsReplaceForData && typeof options.count !== 'undefined') { data = { ...data, count: options.count }; } if (this.options.interpolation.defaultVariables) { data = { ...this.options.interpolation.defaultVariables, ...data }; } if (!useOptionsReplaceForData) { data = { ...data }; for (const key of optionsKeys){ delete data[key]; } } return data; } static hasDefaultValue(options) { const prefix = 'defaultValue'; for(const option in options){ if (Object.prototype.hasOwnProperty.call(options, option) && option.startsWith(prefix) && undefined !== options[option]) { return true; } } return false; } } class LanguageUtil { constructor(options){ this.options = options; this.supportedLngs = this.options.supportedLngs || false; this.logger = baseLogger.create('languageUtils'); } getScriptPartFromCode(code) { code = getCleanedCode(code); if (!code || !code.includes('-')) return null; const p = code.split('-'); if (p.length === 2) return null; p.pop(); if (p[p.length - 1].toLowerCase() === 'x') return null; return this.formatLanguageCode(p.join('-')); } getLanguagePartFromCode(code) { code = getCleanedCode(code); if (!code || !code.includes('-')) return code; const p = code.split('-'); return this.formatLanguageCode(p[0]); } formatLanguageCode(code) { if (isString(code) && code.includes('-')) { let formattedCode; try { formattedCode = Intl.getCanonicalLocales(code)[0]; } catch (e) {} if (formattedCode && this.options.lowerCaseLng) { formattedCode = formattedCode.toLowerCase(); } if (formattedCode) return formattedCode; if (this.options.lowerCaseLng) { return code.toLowerCase(); } return code; } return this.options.cleanCode || this.options.lowerCaseLng ? code.toLowerCase() : code; } isSupportedCode(code) { if (this.options.load === 'languageOnly' || this.options.nonExplicitSupportedLngs) { code = this.getLanguagePartFromCode(code); } return !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.includes(code); } getBestMatchFromCodes(codes) { if (!codes) return null; let found; codes.forEach((code)=>{ if (found) return; const cleanedLng = this.formatLanguageCode(code); if (!this.options.supportedLngs || this.isSupportedCode(cleanedLng)) found = cleanedLng; }); if (!found && this.options.supportedLngs) { codes.forEach((code)=>{ if (found) return; const lngScOnly = this.getScriptPartFromCode(code); if (this.isSupportedCode(lngScOnly)) return found = lngScOnly; const lngOnly = this.getLanguagePartFromCode(code); if (this.isSupportedCode(lngOnly)) return found = lngOnly; found = this.options.supportedLngs.find((supportedLng)=>{ if (supportedLng === lngOnly) return true; if (!supportedLng.includes('-') && !lngOnly.includes('-')) return false; if (supportedLng.includes('-') && !lngOnly.includes('-') && supportedLng.slice(0, supportedLng.indexOf('-')) === lngOnly) return true; if (supportedLng.startsWith(lngOnly) && lngOnly.length > 1) return true; return false; }); }); } if (!found) found = this.getFallbackCodes(this.options.fallbackLng)[0]; return found; } getFallbackCodes(fallbacks, code) { if (!fallbacks) return []; if (typeof fallbacks === 'function') fallbacks = fallbacks(code); if (isString(fallbacks)) fallbacks = [ fallbacks ]; if (Array.isArray(fallbacks)) return fallbacks; if (!code) return fallbacks.default || []; let found = fallbacks[code]; if (!found) found = fallbacks[this.getScriptPartFromCode(code)]; if (!found) found = fallbacks[this.formatLanguageCode(code)]; if (!found) found = fallbacks[this.getLanguagePartFromCode(code)]; if (!found) found = fallbacks.default; return found || []; } toResolveHierarchy(code, fallbackCode) { const fallbackCodes = this.getFallbackCodes((fallbackCode === false ? [] : fallbackCode) || this.options.fallbackLng || [], code); const codes = []; const addCode = (c)=>{ if (!c) return; if (this.isSupportedCode(c)) { codes.push(c); } else { this.logger.warn(`rejecting language code not found in supportedLngs: ${c}`); } }; if (isString(code) && (code.includes('-') || code.includes('_'))) { if (this.options.load !== 'languageOnly') addCode(this.formatLanguageCode(code)); if (this.options.load !== 'languageOnly' && this.options.load !== 'currentOnly') addCode(this.getScriptPartFromCode(code)); if (this.options.load !== 'currentOnly') addCode(this.getLanguagePartFromCode(code)); } else if (isString(code)) { addCode(this.formatLanguageCode(code)); } fallbackCodes.forEach((fc)=>{ if (!codes.includes(fc)) addCode(this.formatLanguageCode(fc)); }); return codes; } } const suffixesOrder = { zero: 0, one: 1, two: 2, few: 3, many: 4, other: 5 }; const dummyRule = { select: (count)=>count === 1 ? 'one' : 'other', resolvedOptions: ()=>({ pluralCategories: [ 'one', 'other' ] }) }; class PluralResolver { constructor(languageUtils, options = {}){ this.languageUtils = languageUtils; this.options = options; this.logger = baseLogger.create('pluralResolver'); this.pluralRulesCache = {}; } clearCache() { this.pluralRulesCache = {}; } getRule(code, options = {}) { const cleanedCode = getCleanedCode(code === 'dev' ? 'en' : code); const type = options.ordinal ? 'ordinal' : 'cardinal'; const cacheKey = JSON.stringify({ cleanedCode, type }); if (cacheKey in this.pluralRulesCache) { return this.pluralRulesCache[cacheKey]; } let rule; try { rule = new Intl.PluralRules(cleanedCode, { type }); } catch (err) { if (typeof Intl === 'undefined') { this.logger.error('No Intl support, please use an Intl polyfill!'); return dummyRule; } if (!code.match(/-|_/)) return dummyRule; const lngPart = this.languageUtils.getLanguagePartFromCode(code); rule = this.getRule(lngPart, options); } this.pluralRulesCache[cacheKey] = rule; return rule; } needsPlural(code, options = {}) { let rule = this.getRule(code, options); if (!rule) rule = this.getRule('dev', options); return rule?.resolvedOptions().pluralCategories.length > 1; } getPluralFormsOfKey(code, key, options = {}) { return this.getSuffixes(code, options).map((suffix)=>`${key}${suffix}`); } getSuffixes(code, options = {}) { let rule = this.getRule(code, options); if (!rule) rule = this.getRule('dev', options); if (!rule) return []; return rule.resolvedOptions().pluralCategories.sort((pluralCategory1, pluralCategory2)=>suffixesOrder[pluralCategory1] - suffixesOrder[pluralCategory2]).map((pluralCategory)=>`${this.options.prepend}${options.ordinal ? `ordinal${this.options.prepend}` : ''}${pluralCategory}`); } getSuffix(code, count, options = {}) { const rule = this.getRule(code, options); if (rule) { return `${this.options.prepend}${options.ordinal ? `ordinal${this.options.prepend}` : ''}${rule.select(count)}`; } this.logger.warn(`no plural rule found for: ${code}`); return this.getSuffix('dev', count, options); } } const deepFindWithDefaults = (data, defaultData, key, keySeparator = '.', ignoreJSONStructure = true)=>{ let path = getPathWithDefaults(data, defaultData, key); if (!path && ignoreJSONStructure && isString(key)) { path = deepFind(data, key, keySeparator); if (path === undefined) path = deepFind(defaultData, key, keySeparator); } return path; }; const regexSafe = (val)=>val.replace(/\$/g, '$$$$'); class Interpolator { constructor(options = {}){ this.logger = baseLogger.create('interpolator'); this.options = options; this.format = options?.interpolation?.format || ((value)=>value); this.init(options); } init(options = {}) { if (!options.interpolation) options.interpolation = { escapeValue: true }; const { escape: escape$1, escapeValue, useRawValueToEscape, prefix, prefixEscaped, suffix, suffixEscaped, formatSeparator, unescapeSuffix, unescapePrefix, nestingPrefix, nestingPrefixEscaped, nestingSuffix, nestingSuffixEscaped, nestingOptionsSeparator, maxReplaces, alwaysFormat } = options.interpolation; this.escape = escape$1 !== undefined ? escape$1 : escape; this.escapeValue = escapeValue !== undefined ? escapeValue : true; this.useRawValueToEscape = useRawValueToEscape !== undefined ? useRawValueToEscape : false; this.prefix = prefix ? regexEscape(prefix) : prefixEscaped || '{{'; this.suffix = suffix ? regexEscape(suffix) : suffixEscaped || '}}'; this.formatSeparator = formatSeparator || ','; this.unescapePrefix = unescapeSuffix ? '' : unescapePrefix ? regexEscape(unescapePrefix) : '-'; this.unescapeSuffix = this.unescapePrefix ? '' : unescapeSuffix ? regexEscape(unescapeSuffix) : ''; this.nestingPrefix = nestingPrefix ? regexEscape(nestingPrefix) : nestingPrefixEscaped || regexEscape('$t('); this.nestingSuffix = nestingSuffix ? regexEscape(nestingSuffix) : nestingSuffixEscaped || regexEscape(')'); this.nestingOptionsSeparator = nestingOptionsSeparator || ','; this.maxReplaces = maxReplaces || 1000; this.alwaysFormat = alwaysFormat !== undefined ? alwaysFormat : false; this.resetRegExp(); } reset() { if (this.options) this.init(this.options); } resetRegExp() { const getOrResetRegExp = (existingRegExp, pattern)=>{ if (existingRegExp?.source === pattern) { existingRegExp.lastIndex = 0; return existingRegExp; } return new RegExp(pattern, 'g'); }; this.regexp = getOrResetRegExp(this.regexp, `${this.prefix}(.+?)${this.suffix}`); this.regexpUnescape = getOrResetRegExp(this.regexpUnescape, `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`); this.nestingRegexp = getOrResetRegExp(this.nestingRegexp, `${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`); } interpolate(str, data, lng, options) { let match; let value; let replaces; const defaultData = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}; const handleFormat = (key)=>{ if (!key.includes(this.formatSeparator)) { const path = deepFindWithDefaults(data, defaultData, key, this.options.keySeparator, this.options.ignoreJSONStructure); return this.alwaysFormat ? this.format(path, undefined, lng, { ...options, ...data, interpolationkey: key }) : path; } const p = key.split(this.formatSeparator); const k = p.shift().trim(); const f = p.join(this.formatSeparator).trim(); return this.format(deepFindWithDefaults(data, defaultData, k, this.options.keySeparator, this.options.ignoreJSONStructure), f, lng, { ...options, ...data, interpolationkey: k }); }; this.resetRegExp(); if (!this.escapeValue && typeof str === 'string' && /\$t\([^)]*\{[^}]*\{\{/.test(str)) { this.logger.warn('nesting options string contains interpolated variables with escapeValue: false — ' + 'if any of those values are attacker-controlled they can inject additional ' + 'nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing ' + 'it to t(), or keep escapeValue: true.'); } const missingInterpolationHandler = options?.missingInterpolationHandler || this.options.missingInterpolationHandler; const skipOnVariables = options?.interpolation?.skipOnVariables !== undefined ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables; const todos = [ { regex: this.regexpUnescape, safeValue: (val)=>val }, { regex: this.regexp, safeValue: (val)=>this.escapeValue ? this.escape(val) : val } ]; todos.forEach((todo)=>{ replaces = 0; while(match = todo.regex.exec(str)){ const matchedVar = match[1].trim(); value = handleFormat(matchedVar); if (value === undefined) { if (typeof missingInterpolationHandler === 'function') { const temp = missingInterpolationHandler(str, match, options); value = isString(temp) ? temp : ''; } else if (options && Object.prototype.hasOwnProperty.call(options, matchedVar)) { value = ''; } else if (skipOnVariables) { value = match[0]; continue; } else { this.logger.warn(`missed to pass in variable ${matchedVar} for interpolating ${str}`); value = ''; } } else if (!isString(value) && !this.useRawValueToEscape) { value = makeString(value); } const safeValue = todo.safeValue(value); str = str.replace(match[0], regexSafe(safeValue)); if (skipOnVariables) { todo.regex.lastIndex += safeValue.length; todo.regex.lastIndex -= match[0].length; } else { todo.regex.lastIndex = 0; } replaces++; if (replaces >= this.maxReplaces) { break; } } }); return str; } nest(str, fc, options = {}) { let match; let value; let clonedOptions; const handleHasOptions = (key, inheritedOptions)=>{ const sep = this.nestingOptionsSeparator; if (!key.includes(sep)) return key; const c = key.split(new RegExp(`${regexEscape(sep)}[ ]*{`)); let optionsString = `{${c[1]}`; key = c[0]; optionsString = this.interpolate(optionsString, clonedOptions); const matchedSingleQuotes = optionsString.match(/'/g); const matchedDoubleQuotes = optionsString.match(/"/g); if ((matchedSingleQuotes?.length ?? 0) % 2 === 0 && !matchedDoubleQuotes || (matchedDoubleQuotes?.length ?? 0) % 2 !== 0) { optionsString = optionsString.replace(/'/g, '"'); } try { clonedOptions = JSON.parse(optionsString); if (inheritedOptions) clonedOptions = { ...inheritedOptions, ...clonedOptions }; } catch (e) { this.logger.warn(`failed parsing options string in nesting for key ${key}`, e); return `${key}${sep}${optionsString}`; } if (clonedOptions.defaultValue && clonedOptions.defaultValue.includes(this.prefix)) delete clonedOptions.defaultValue; return key; }; while(match = this.nestingRegexp.exec(str)){ let formatters = []; clonedOptions = { ...options }; clonedOptions = clonedOptions.replace && !isString(clonedOptions.replace) ? clonedOptions.replace : clonedOptions; clonedOptions.applyPostProcessor = false; delete clonedOptions.defaultValue; const keyEndIndex = /{.*}/s.test(match[1]) ? match[1].lastIndexOf('}') + 1 : match[1].indexOf(this.formatSeparator); if (keyEndIndex !== -1) { formatters = match[1].slice(keyEndIndex).split(this.formatSeparator).map((elem)=>elem.trim()).filter(Boolean); match[1] = match[1].slice(0, keyEndIndex); } value = fc(handleHasOptions.call(this, match[1].trim(), clonedOptions), clonedOptions); if (value && match[0] === str && !isString(value)) return value; if (!isString(value)) value = makeString(value); if (!value) { this.logger.warn(`missed to resolve ${match[1]} for nesting ${str}`); value = ''; } if (formatters.length) { value = formatters.reduce((v, f)=>this.format(v, f, options.lng, { ...options, interpolationkey: match[1].trim() }), value.trim()); } str = str.replace(match[0], value); this.regexp.lastIndex = 0; } return str; } } const parseFormatStr = (formatStr)=>{ let formatName = formatStr.toLowerCase().trim(); const formatOptions = {}; if (formatStr.includes('(')) { const p = formatStr.split('('); formatName = p[0].toLowerCase().trim(); const optStr = p[1].slice(0, -1); if (formatName === 'currency' && !optStr.includes(':')) { if (!formatOptions.currency) formatOptions.currency = optStr.trim(); } else if (formatName === 'relativetime' && !optStr.includes(':')) { if (!formatOptions.range) formatOptions.range = optStr.trim(); } else { const opts = optStr.split(';'); opts.forEach((opt)=>{ if (opt) { const [key, ...rest] = opt.split(':'); const val = rest.join(':').trim().replace(/^'+|'+$/g, ''); const trimmedKey = key.trim(); if (!formatOptions[trimmedKey]) formatOptions[trimmedKey] = val; if (val === 'false') formatOptions[trimmedKey] = false; if (val === 'true') formatOptions[trimmedKey] = true; if (!isNaN(val)) formatOptions[trimmedKey] = parseInt(val, 10); } }); } } return { formatName, formatOptions }; }; const createCachedFormatter = (fn)=>{ const cache = {}; return (v, l, o)=>{ let optForCache = o; if (o && o.interpolationkey && o.formatParams && o.formatParams[o.interpolationkey] && o[o.interpolationkey]) { optForCache = { ...optForCache, [o.interpolationkey]: undefined }; } const key = l + JSON.stringify(optForCache); let frm = cache[key]; if (!frm) { frm = fn(getCleanedCode(l), o); cache[key] = frm; } return frm(v); }; }; const createNonCachedFormatter = (fn)=>(v, l, o)=>fn(getCleanedCode(l), o)(v); class Formatter { constructor(options = {}){ this.logger = baseLogger.create('formatter'); this.options = options; this.init(options); } init(services, options = { interpolation: {} }) { this.formatSeparator = options.interpolation.formatSeparator || ','; const cf = options.cacheInBuiltFormats ? createCachedFormatter : createNonCachedFormatter; this.formats = { number: cf((lng, opt)=>{ const formatter = new Intl.NumberFormat(lng, { ...opt }); return (val)=>formatter.format(val); }), currency: cf((lng, opt)=>{ const formatter = new Intl.NumberFormat(lng, { ...opt, style: 'currency' }); return (val)=>formatter.format(val); }), datetime: cf((lng, opt)=>{ const formatter = new Intl.DateTimeFormat(lng, { ...opt }); return (val)=>formatter.format(val); }), relativetime: cf((lng, opt)=>{ const formatter = new Intl.RelativeTimeFormat(lng, { ...opt }); return (val)=>formatter.format(val, opt.range || 'day'); }), list: cf((lng, opt)=>{ const formatter = new Intl.ListFormat(lng, { ...opt }); return (val)=>formatter.format(val); }) }; } add(name, fc) { this.formats[name.toLowerCase().trim()] = fc; } addCached(name, fc) { this.formats[name.toLowerCase().trim()] = createCachedFormatter(fc); } format(value, format, lng, options = {}) { if (!format) return value; if (value == null) return value; const rawFormats = format.split(this.formatSeparator); const formats = []; for(let i = 0; i < rawFormats.length; i++){ let f = rawFormats[i]; while(f.indexOf('(') > -1 && !f.includes(')') && i + 1 < rawFormats.length){ f = `${f}${this.formatSeparator}${rawFormats[++i]}`; } formats.push(f); } const result = formats.reduce((mem, f)=>{ const { formatName, formatOptions } = parseFormatStr(f); if (this.formats[formatName]) { let formatted = mem; try { const valOptions = options?.formatParams?.[options.interpolationkey] || {}; const l = valOptions.locale || valOptions.lng || options.locale || options.lng || lng; formatted = this.formats[formatName](mem, l, { ...formatOptions, ...options, ...valOptions }); } catch (error) { this.logger.warn(error); } return formatted; } else { this.logger.warn(`there was no format function for ${formatName}`); } return mem; }, value); return result; } } const removePending = (q, name)=>{ if (q.pending[name] !== undefined) { delete q.pending[name]; q.pendingCount--; } }; class Connector extends EventEmitter { constructor(backend, store, services, options = {}){ super(); this.backend = backend; this.store = store; this.services = services; this.languageUtils = services.languageUtils; this.options = options; this.logger = baseLogger.create('backendConnector'); this.waitingReads = []; this.maxParallelReads = options.maxParallelReads || 10; this.readingCalls = 0; this.maxRetries = options.maxRetries >= 0 ? options.maxRetries : 5; this.retryTimeout = options.retryTimeout >= 1 ? options.retryTimeout : 350; this.state = {}; this.queue = []; this.backend?.init?.(services, options.backend, options); } queueLoad(languages, namespaces, options, callback) { const toLoad = {}; const pending = {}; const toLoadLanguages = {}; const toLoadNamespaces = {}; languages.forEach((lng)=>{ let hasAllNamespaces = true; namespaces.forEach((ns)=>{ const name = `${lng}|${ns}`; if (!options.reload && this.store.hasResourceBundle(lng, ns)) { this.state[name] = 2; } else if (this.state[name] < 0) ; else if (this.state[name] === 1) { if (pending[name] === undefined) pending[name] = true; } else { this.state[name] = 1; hasAllNamespaces = false; if (pending[name] === undefined) pending[name] = true; if (toLoad[name] === undefined) toLoad[name] = true; if (toLoadNamespaces[ns] === undefined) toLoadNamespaces[ns] = true; } }); if (!hasAllNamespaces) toLoadLanguages[lng] = true; }); if (Object.keys(toLoad).length || Object.keys(pending).length) { this.queue.push({ pending, pendingCount: Object.keys(pending).length, loaded: {}, errors: [], callback }); } return { toLoad: Object.keys(toLoad), pending: Object.keys(pending), toLoadLanguages: Object.keys(toLoadLanguages), toLoadNamespaces: Object.keys(toLoadNamespaces) }; } loaded(name, err, data) { const s = name.split('|'); const lng = s[0]; const ns = s[1]; if (err) this.emit('failedLoading', lng, ns, err); if (!err && data) { this.store.addResourceBundle(lng, ns, data, undefined, undefined, { skipCopy: true }); } this.state[name] = err ? -1 : 2; if (err && data) this.state[name] = 0; const loaded = {}; this.queue.forEach((q)=>{ pushPath(q.loaded, [ lng ], ns); removePending(q, name); if (err) q.errors.push(err); if (q.pendingCount === 0 && !q.done) { Object.keys(q.loaded).forEach((l)=>{ if (!loaded[l]) loaded[l] = {}; const loadedKeys = q.loaded[l]; if (loadedKeys.length) { loadedKeys.forEach((n)=>{ if (loaded[l][n] === undefined) loaded[l][n] = true; }); } }); q.done = true; if (q.errors.length) { q.callback(q.errors); } else { q.callback(); } } }); this.emit('loaded', loaded); this.queue = this.queue.filter((q)=>!q.done); } read(lng, ns, fcName, tried = 0, wait = this.retryTimeout, callback) { if (!lng.length) return callback(null, {}); if (this.readingCalls >= this.maxParallelReads) { this.waitingReads.push({ lng, ns, fcName, tried, wait, callback }); return; } this.readingCalls++; const resolver = (err, data)=>{ this.readingCalls--; if (this.waitingReads.length > 0) { const next = this.waitingReads.shift(); this.read(next.lng, next.ns, next.fcName, next.tried, next.wait, next.callback); } if (err && data && tried < this.maxRetries) { setTimeout(()=>{ this.read(lng, ns, fcName, tried + 1, wait * 2, callback); }, wait); return; } callback(err, data); }; const fc = this.backend[fcName].bind(this.backend); if (fc.length === 2) { try { const r = fc(lng, ns); if (r && typeof r.then === 'function') { r.then((data)=>resolver(null, data)).catch(resolver); } else { resolver(null, r); } } catch (err) { resolver(err); } return; } return fc(lng, ns, resolver); } prepareLoading(languages, namespaces, options = {}, callback) { if (!this.backend) { this.logger.warn('No backend was added via i18next.use. Will not load resources.'); return callback && callback(); } if (isString(languages)) languages = this.languageUtils.toResolveHierarchy(languages); if (isString(namespaces)) namespaces = [ namespaces ]; const toLoad = this.queueLoad(languages, namespaces, options, callback); if (!toLoad.toLoad.length) { if (!toLoad.pending.length) callback(); return null; } toLoad.toLoad.forEach((name)=>{ this.loadOne(name); }); } load(languages, namespaces, callback) { this.prepareLoading(languages, namespaces, {}, callback); } reload(languages, namespaces, callback) { this.prepareLoading(languages, namespaces, { reload: true }, callback); } loadOne(name, prefix = '') { const s = name.split('|'); const lng = s[0]; const ns = s[1]; this.read(lng, ns, 'read', undefined, undefined, (err, data)=>{ if (err) this.logger.warn(`${prefix}loading namespace ${ns} for language ${lng} failed`, err); if (!err && data) this.logger.log(`${prefix}loaded namespace ${ns} for language ${lng}`, data); this.loaded(name, err, data); }); } saveMissing(languages, namespace, key, fallbackValue, isUpdate, options = {}, clb = ()=>{}) { if (this.services?.utils?.hasLoadedNamespace && !this.services?.utils?.hasLoadedNamespace(namespace)) { this.logger.warn(`did not save key "${key}" as the namespace "${namespace}" was not yet loaded`, 'This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!'); return; } if (key === undefined || key === null || key === '') return; if (this.backend?.create) { const opts = { ...options, isUpdate }; const fc = this.backend.create.bind(this.backend); if (fc.length < 6) { try { let r; if (fc.length === 5) { r = fc(languages, namespace, key, fallbackValue, opts); } else { r = fc(languages, namespace, key, fallbackValue); } if (r && typeof r.then === 'function') { r.then((data)=>clb(null, data)).catch(clb); } else { clb(null, r); } } catch (err) { clb(err); } } else { fc(languages, namespace, key, fallbackValue, clb, opts); } } if (!languages || !languages[0]) return; this.store.addResource(languages[0], namespace, key, fallbackValue); } } const get = ()=>({ debug: false, initAsync: true, ns: [ 'translation' ], defaultNS: [ 'translation' ], fallbackLng: [ 'dev' ], fallbackNS: false, supportedLngs: false, nonExplicitSupportedLngs: false, load: 'all', preload: false, keySeparator: '.', nsSeparator: ':', pluralSeparator: '_', contextSeparator: '_', enableSelector: false, partialBundledLanguages: false, saveMissing: false, updateMissing: false, saveMissingTo: 'fallback', saveMissingPlurals: true, missingKeyHandler: false, missingInterpolationHandler: false, postProcess: false, postProcessPassResolved: false, returnNull: false, returnEmptyString: true, returnObjects: false, joinArrays: false, returnedObjectHandler: false, parseMissingKeyHandler: false, appendNamespaceToMissingKey: false, appendNamespaceToCIMode: false, overloadTranslationOptionHandler: (args)=>{ let ret = {}; if (typeof args[1] === 'object') ret = args[1]; if (isString(args[1])) ret.defaultValue = args[1]; if (isString(args[2])) ret.tDescription = args[2]; if (typeof args[2] === 'object' || typeof args[3] === 'object') { const options = args[3] || args[2]; Object.keys(options).forEach((key)=>{ ret[key] = options[key]; }); } return ret; }, interpolation: { escapeValue: true, prefix: '{{', suffix: '}}', formatSeparator: ',', unescapePrefix: '-', nestingPrefix: '$t(', nestingSuffix: ')', nestingOptionsSeparator: ',', maxReplaces: 1000, skipOnVariables: true }, cacheInBuiltFormats: true }); const transformOptions = (options)=>{ if (isString(options.ns)) options.ns = [ options.ns ]; if (isString(options.fallbackLng)) options.fallbackLng = [ options.fallbackLng ]; if (isString(options.fallbackNS)) options.fallbackNS = [ options.fallbackNS ]; if (options.supportedLngs && !options.supportedLngs.includes('cimode')) { options.supportedLngs = options.supportedLngs.concat([ 'cimode' ]); } return options; }; const noop = ()=>{}; const bindMemberFunctions = (inst)=>{ const mems = Object.getOwnPropertyNames(Object.getPrototypeOf(inst)); mems.forEach((mem)=>{ if (typeof inst[mem] === 'function') { inst[mem] = inst[mem].bind(inst); } }); }; class I18n extends EventEmitter { constructor(options = {}, callback){ super(); this.options = transformOptions(options); this.services = {}; this.logger = baseLogger; this.modules = { external: [] }; bindMemberFunctions(this); if (callback && !this.isInitialized && !options.isClone) { if (!this.options.initAsync) { this.init(options, callback); return this; } setTimeout(()=>{ this.init(options, callback); }, 0); } } init(options = {}, callback) { this.isInitializing = true; if (typeof options === 'function') { callback = options; options = {}; } if (options.defaultNS == null && options.ns) { if (isString(options.ns)) { options.defaultNS = options.ns; } else if (!options.ns.includes('translation')) { options.defaultNS = options.ns[0]; } } const defOpts = get(); this.options = { ...defOpts, ...this.options, ...transformOptions(options) }; this.options.interpolation = { ...defOpts.interpolation, ...this.options.interpolation }; if (options.keySeparator !== undefined) { this.options.userDefinedKeySeparator = options.keySeparator; } if (options.nsSeparator !== undefined) { this.options.userDefinedNsSeparator = options.nsSeparator; } if (typeof this.options.overloadTranslationOptionHandler !== 'function') { this.options.overloadTranslationOptionHandler = defOpts.overloadTranslationOptionHandler; } const createClassOnDemand = (ClassOrObject)=>{ if (!ClassOrObject) return null; if (typeof ClassOrObject === 'function') return new ClassOrObject(); return ClassOrObject; }; if (!this.options.isClone) { if (this.modules.logger) { baseLogger.init(createClassOnDemand(this.modules.logger), this.options); } else { baseLogger.init(null, this.options); } let formatter; if (this.modules.formatter) { formatter = this.modules.formatter; } else { formatter = Formatter; } const lu = new LanguageUtil(this.options); this.store = new ResourceStore(this.options.resources, this.options); const s = this.services; s.logger = baseLogger; s.resourceStore = this.store; s.languageUtils = lu; s.pluralResolver = new PluralResolver(lu, { prepend: this.options.pluralSeparator }); if (formatter) { s.formatter = createClassOnDemand(formatter); if (s.formatter.init) s.formatter.init(s, this.options); this.options.interpolation.format = s.formatter.format.bind(s.formatter); } s.interpolator = new Interpolator(this.options); s.utils = { hasLoadedNamespace: this.hasLoadedNamespace.bind(this) }; s.backendConnector = new Connector(createClassOnDemand(this.modules.backend), s.resourceStore, s, this.options); s.backendConnector.on('*', (event, ...args)=>{ this.emit(event, ...args); }); if (this.modules.languageDetector) { s.languageDetector = createClassOnDemand(this.modules.languageDetector); if (s.languageDetector.init) s.languageDetector.init(s, this.options.detection, this.options); } if (this.modules.i18nFormat) { s.i18nFormat = createClassOnDemand(this.modules.i18nFormat); if (s.i18nFormat.init) s.i18nFormat.init(this); } this.translator = new Translator(this.services, this.options); this.translator.on('*', (event, ...args)=>{ this.emit(event, ...args); }); this.modules.external.forEach((m)=>{ if (m.init) m.init(this); }); } this.format = this.options.interpolation.format; if (!callback) callback = noop; if (this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) { const codes = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng); if (codes.length > 0 && codes[0] !== 'dev') this.options.lng = codes[0]; } if (!this.services.languageDetector && !this.options.lng) { this.logger.warn('init: no languageDetector is used and no lng is defined'); } const storeApi = [ 'getResource', 'hasResourceBundle', 'getResourceBundle', 'getDataByLanguage' ]; storeApi.forEach((fcName)=>{ this[fcName] = (...args)=>this.store[fcName](...args); }); const storeApiChained = [ 'addResource', 'addResources', 'addResourceBundle', 'removeResourceBundle' ]; storeApiChained.forEach((fcName)=>{ this[fcName] = (...args)=>{ this.store[fcName](...args); return this; }; }); const deferred = defer(); const load = ()=>{ const finish = (err, t)=>{ this.isInitializing = false; if (this.isInitialized && !this.initializedStoreOnce) this.logger.warn('init: i18next is already initialized. You should call init just once!'); this.isInitialized = true; if (!this.options.isClone) this.logger.log('initialized', this.options); this.emit('initialized', this.options); deferred.resolve(t); callback(err, t); }; if ((this.languages || this.isLanguageChangingTo) && !this.isInitialized) return finish(null, this.t.bind(this)); this.changeLanguage(this.options.lng, finish); }; if (this.options.resources || !this.options.initAsync) { load(); } else { setTimeout(load, 0); } return deferred; } loadResources(language, callback = noop) { let usedCallback = callback; const usedLng = isString(language) ? language : this.language; if (typeof language === 'function') usedCallback = language; if (!this.options.resources || this.options.partialBundledLanguages) { if (usedLng?.toLowerCase() === 'cimode' && (!this.options.preload || this.options.preload.length === 0)) return usedCallback(); const toLoad = []; const append = (lng)=>{ if (!lng) return; if (lng === 'cimode') return; const lngs = this.services.languageUtils.toResolveHierarchy(lng); lngs.forEach((l)=>{ if (l === 'cimode') return; if (!toLoad.includes(l)) toLoad.push(l); }); }; if (!usedLng) { const fallbacks = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng); fallbacks.forEach((l)=>append(l)); } else { append(usedLng); } this.options.preload?.forEach?.((l)=>append(l)); this.services.backendConnector.load(toLoad, this.options.ns, (e)=>{ if (!e && !this.resolvedLanguage && this.language) this.setResolvedLanguage(this.language); usedCallback(e); }); } else { usedCallback(null); } } reloadResources(lngs, ns, callback) { const deferred = defer(); if (typeof lngs === 'function') { callback = lngs; lngs = undefined; } if (typeof ns === 'function') { callback = ns; ns = undefined; } if (!lngs) lngs = this.languages; if (!ns) ns = this.options.ns; if (!callback) callback = noop; this.services.backendConnector.reload(lngs, ns, (err)=>{ deferred.resolve(); callback(err); }); return deferred; } use(module) { if (!module) throw new Error('You are passing an undefined module! Please check the object you are passing to i18next.use()'); if (!module.type) throw new Error('You are passing a wrong module! Please check the object you are passing to i18next.use()'); if (module.type === 'backend') { this.modules.backend = module; } if (module.type === 'logger' || module.log && module.warn && module.error) { this.modules.logger = module; } if (module.type === 'languageDetector') { this.modules.languageDetector = module; } if (module.type === 'i18nFormat') { this.modules.i18nFormat = module; } if (module.type === 'postProcessor') { postProcessor.addPostProcessor(module); } if (module.type === 'formatter') { this.modules.formatter = module; } if (module.type === '3rdParty') { this.modules.external.push(module); } return this; } setResolvedLanguage(l) { if (!l || !this.languages) return; if ([ 'cimode', 'dev' ].includes(l)) return; for(let li = 0; li < this.languages.length; li++){ const lngInLngs = this.languages[li]; if ([ 'cimode', 'dev' ].includes(lngInLngs)) continue; if (this.store.hasLanguageSomeTranslations(lngInLngs)) { this.resolvedLanguage = lngInLngs; break; } } if (!this.resolvedLanguage && !this.languages.includes(l) && this.store.hasLanguageSomeTranslations(l)) { this.resolvedLanguage = l; this.languages.unshift(l); } } changeLanguage(lng, callback) { this.isLanguageChangingTo = lng; const deferred = defer(); this.emit('languageChanging', lng); const setLngProps = (l)=>{ this.language = l; this.languages = this.services.languageUtils.toResolveHierarchy(l); this.resolvedLanguage = undefined; this.setResolvedLanguage(l); }; const done = (err, l)=>{ if (l) { if (this.isLanguageChangingTo === lng) { setLngProps(l); this.translator.changeLanguage(l); this.isLanguageChangingTo = undefined; this.emit('languageChanged', l); this.logger.log('languageChanged', l); } } else { this.isLanguageChangingTo = undefined; } deferred.resolve((...args)=>this.t(...args)); if (callback) callback(err, (...args)=>this.t(...args)); }; const setLng = (lngs)=>{ if (!lng && !lngs && this.services.languageDetector) lngs = []; const fl = isString(lngs) ? lngs : lngs && lngs[0]; const l = this.store.hasLanguageSomeTranslations(fl) ? fl : this.services.languageUtils.getBestMatchFromCodes(isString(lngs) ? [ lngs ] : lngs); if (l) { if (!this.language) { setLngProps(l); } if (!this.translator.language) this.translator.changeLanguage(l); this.services.languageDetector?.cacheUserLanguage?.(l); } this.loadResources(l, (err)=>{ done(err, l); }); }; if (!lng && this.services.languageDetector && !this.services.languageDetector.async) { setLng(this.services.languageDetector.detect()); } else if (!lng && this.services.languageDetector && this.services.languageDetector.async) { if (this.services.languageDetector.detect.length === 0) { this.services.languageDetector.detect().then(setLng); } else { this.services.languageDetector.detect(setLng); } } else { setLng(lng); } return deferred; } getFixedT(lng, ns, keyPrefix, fixedOpts) { const scopeNs = fixedOpts?.scopeNs; const fixedT = (key, opts, ...rest)=>{ let o; if (typeof opts !== 'object') { o = this.options.overloadTranslationOptionHandler([ key, opts ].concat(rest)); } else { o = { ...opts }; } o.lng = o.lng || fixedT.lng; o.lngs = o.lngs || fixedT.lngs; const explicitCallNs = o.ns !== undefined && o.ns !== null; o.ns = o.ns || fixedT.ns; if (o.keyPrefix !== '') o.keyPrefix = o.keyPrefix || keyPrefix || fixedT.keyPrefix; const selectorOpts = { ...this.options, ...o }; if (Array.isArray(scopeNs) && !explicitCallNs) selectorOpts.ns = scopeNs; if (typeof o.keyPrefix === 'function') o.keyPrefix = keysFromSelector(o.keyPrefix, selectorOpts); const keySeparator = this.options.keySeparator || '.'; let resultKey; if (o.keyPrefix && Array.isArray(key)) { resultKey = key.map((k)=>{ if (typeof k === 'function') k = keysFromSelector(k, selectorOpts); return `${o.keyPrefix}${keySeparator}${k}`; }); } else { if (typeof key === 'function') key = keysFromSelector(key, selectorOpts); resultKey = o.keyPrefix ? `${o.keyPrefix}${keySeparator}${key}` : key; } return this.t(resultKey, o); }; if (isString(lng)) { fixedT.lng = lng; } else { fixedT.lngs = lng; } fixedT.ns = ns; fixedT.keyPrefix = keyPrefix; return fixedT; } t(...args) { return this.translator?.translate(...args); } exists(...args) { return this.translator?.exists(...args); } setDefaultNamespace(ns) { this.options.defaultNS = ns; } hasLoadedNamespace(ns, options = {}) { if (!this.isInitialized) { this.logger.warn('hasLoadedNamespace: i18next was not initialized', this.languages); return false; } if (!this.languages || !this.languages.length) { this.logger.warn('hasLoadedNamespace: i18n.languages were undefined or empty', this.languages); return false; } const lng = options.lng || this.resolvedLanguage || this.languages[0]; const fallbackLng = this.options ? this.options.fallbackLng : false; const lastLng = this.languages[this.languages.length - 1]; if (lng.toLowerCase() === 'cimode') return true; const loadNotPending = (l, n)=>{ const loadState = this.services.backendConnector.state[`${l}|${n}`]; return loadState === -1 || loadState === 0 || loadState === 2; }; if (options.precheck) { const preResult = options.precheck(this, loadNotPending); if (preResult !== undefined) return preResult; } if (this.hasResourceBundle(lng, ns)) return true; if (!this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages) return true; if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true; return false; } loadNamespaces(ns, callback) { const deferred = defer(); if (!this.options.ns) { if (callback) callback(); return Promise.resolve(); } if (isString(ns)) ns = [ ns ]; ns.forEach((n)=>{ if (!this.options.ns.includes(n)) this.options.ns.push(n); }); this.loadResources((err)=>{ deferred.resolve(); if (callback) callback(err); }); return deferred; } loadLanguages(lngs, callback) { const deferred = defer(); if (isString(lngs)) lngs = [ lngs ]; const preloaded = this.options.preload || []; const newLngs = lngs.filter((lng)=>!preloaded.includes(lng) && this.services.languageUtils.isSupportedCode(lng)); if (!newLngs.length) { if (callback) callback(); return Promise.resolve(); } this.options.preload = preloaded.concat(newLngs); this.loadResources((err)=>{ deferred.resolve(); if (callback) callback(err); }); return deferred; } dir(lng) { if (!lng) lng = this.resolvedLanguage || (this.languages?.length > 0 ? this.languages[0] : this.language); if (!lng) return 'rtl'; try { const l = new Intl.Locale(lng); if (l && l.getTextInfo) { const ti = l.getTextInfo(); if (ti && ti.direction) return ti.direction; } } catch (e) {} const rtlLngs = [ 'ar', 'shu', 'sqr', 'ssh', 'xaa', 'yhd', 'yud', 'aao', 'abh', 'abv', 'acm', 'acq', 'acw', 'acx', 'acy', 'adf', 'ads', 'aeb', 'aec', 'afb', 'ajp', 'apc', 'apd', 'arb', 'arq', 'ars', 'ary', 'arz', 'auz', 'avl', 'ayh', 'ayl', 'ayn', 'ayp', 'bbz', 'pga', 'he', 'iw', 'ps', 'pbt', 'pbu', 'pst', 'prp', 'prd', 'ug', 'ur', 'ydd', 'yds', 'yih', 'ji', 'yi', 'hbo', 'men', 'xmn', 'fa', 'jpr', 'peo', 'pes', 'prs', 'dv', 'sam', 'ckb' ]; const languageUtils = this.services?.languageUtils || new LanguageUtil(get()); if (lng.toLowerCase().indexOf('-latn') > 1) return 'ltr'; return rtlLngs.includes(languageUtils.getLanguagePartFromCode(lng)) || lng.toLowerCase().indexOf('-arab') > 1 ? 'rtl' : 'ltr'; } static createInstance(options = {}, callback) { const instance = new I18n(options, callback); instance.createInstance = I18n.createInstance; return instance; } cloneInstance(options = {}, callback = noop) { const forkResourceStore = options.forkResourceStore; if (forkResourceStore) delete options.forkResourceStore; const mergedOptions = { ...this.options, ...options, ...{ isClone: true } }; const clone = new I18n(mergedOptions); if (options.debug !== undefined || options.prefix !== undefined) { clone.logger = clone.logger.clone(options); } const membersToCopy = [ 'store', 'services', 'language' ]; membersToCopy.forEach((m)=>{ clone[m] = this[m]; }); clone.services = { ...this.services }; clone.services.utils = { hasLoadedNamespace: clone.hasLoadedNamespace.bind(clone) }; if (forkResourceStore) { const clonedData = Object.keys(this.store.data).reduce((prev, l)=>{ prev[l] = { ...this.store.data[l] }; prev[l] = Object.keys(prev[l]).reduce((acc, n)=>{ acc[n] = { ...prev[l][n] }; return acc; }, prev[l]); return prev; }, {}); clone.store = new ResourceStore(clonedData, mergedOptions); clone.services.resourceStore = clone.store; } if (options.interpolation) { const defOpts = get(); const mergedInterpolation = { ...defOpts.interpolation, ...this.options.interpolation, ...options.interpolation }; const mergedForInterpolator = { ...mergedOptions, interpolation: mergedInterpolation }; clone.services.interpolator = new Interpolator(mergedForInterpolator); } clone.translator = new Translator(clone.services, mergedOptions); clone.translator.on('*', (event, ...args)=>{ clone.emit(event, ...args); }); clone.init(mergedOptions, callback); clone.translator.options = mergedOptions; clone.translator.backendConnector.services.utils = { hasLoadedNamespace: clone.hasLoadedNamespace.bind(clone) }; return clone; } toJSON() { return { options: this.options, store: this.store, language: this.language, languages: this.languages, resolvedLanguage: this.resolvedLanguage }; } } const instance = I18n.createInstance(); const createInstance = instance.createInstance; const dir = instance.dir; const init = instance.init; const loadResources = instance.loadResources; const reloadResources = instance.reloadResources; const use = instance.use; const changeLanguage = instance.changeLanguage; const getFixedT = instance.getFixedT; const t = instance.t; const exists = instance.exists; const setDefaultNamespace = instance.setDefaultNamespace; const hasLoadedNamespace = instance.hasLoadedNamespace; const loadNamespaces = instance.loadNamespaces; const loadLanguages = instance.loadLanguages; ; }), "[project]/node_modules/next/dist/client/components/bfcache-state-manager.js [app-client] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$build$2f$polyfills$2f$process$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = /*#__PURE__*/ __turbopack_context__.i("[project]/node_modules/next/dist/build/polyfills/process.js [app-client] (ecmascript)"); "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "useRouterBFCache", { enumerable: true, get: function() { return useRouterBFCache; } }); const _react = __turbopack_context__.r("[project]/node_modules/next/dist/compiled/react/index.js [app-client] (ecmascript)"); // When the flag is disabled, only track the currently active tree const MAX_BF_CACHE_ENTRIES = ("TURBOPACK compile-time falsy", 0) ? "TURBOPACK unreachable" : 1; function useRouterBFCache(activeTree, activeCacheNode, activeStateKey) { // The currently active entry. The entries form a linked list, sorted in // order of most recently active. This allows us to reuse parts of the list // without cloning, unless there's a reordering or removal. // TODO: Once we start tracking back/forward history at each route level, // we should use the history order instead. In other words, when traversing // to an existing entry as a result of a popstate event, we should maintain // the existing order instead of moving it to the front of the list. I think // an initial implementation of this could be to pass an incrementing id // to history.pushState/replaceState, then use that here for ordering. const [prevActiveEntry, setPrevActiveEntry] = (0, _react.useState)(()=>{ const initialEntry = { tree: activeTree, cacheNode: activeCacheNode, stateKey: activeStateKey, next: null }; return initialEntry; }); if (prevActiveEntry.tree === activeTree) { // Fast path. The active tree hasn't changed, so we can reuse the // existing state. return prevActiveEntry; } // The route tree changed. Note that this doesn't mean that the tree changed // *at this level* — the change may be due to a child route. Either way, we // need to either add or update the router tree in the bfcache. // // The rest of the code looks more complicated than it actually is because we // can't mutate the state in place; we have to copy-on-write. // Create a new entry for the active cache key. This is the head of the new // linked list. const newActiveEntry = { tree: activeTree, cacheNode: activeCacheNode, stateKey: activeStateKey, next: null }; // We need to append the old list onto the new list. If the head of the new // list was already present in the cache, then we'll need to clone everything // that came before it. Then we can reuse the rest. let n = 1; let oldEntry = prevActiveEntry; let clonedEntry = newActiveEntry; while(oldEntry !== null && n < MAX_BF_CACHE_ENTRIES){ if (oldEntry.stateKey === activeStateKey) { // Fast path. This entry in the old list that corresponds to the key that // is now active. We've already placed a clone of this entry at the front // of the new list. We can reuse the rest of the old list without cloning. // NOTE: We don't need to worry about eviction in this case because we // haven't increased the size of the cache, and we assume the max size // is constant across renders. If we were to change it to a dynamic limit, // then the implementation would need to account for that. clonedEntry.next = oldEntry.next; break; } else { // Clone the entry and append it to the list. n++; const entry = { tree: oldEntry.tree, cacheNode: oldEntry.cacheNode, stateKey: oldEntry.stateKey, next: null }; clonedEntry.next = entry; clonedEntry = entry; } oldEntry = oldEntry.next; } setPrevActiveEntry(newActiveEntry); return newActiveEntry; } if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') { Object.defineProperty(exports.default, '__esModule', { value: true }); Object.assign(exports.default, exports); module.exports = exports.default; } }), "[project]/node_modules/next/dist/client/components/client-boundary-params.browser.js [app-client] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; // Browser variant of `./client-boundary-params`. In the browser the params and // searchParams are created at render time rather than dynamically tracked. Object.defineProperty(exports, "__esModule", { value: true }); 0 && (module.exports = { createClientParams: null, createClientSearchParams: null }); function _export(target, all) { for(var name in all)Object.defineProperty(target, name, { enumerable: true, get: all[name] }); } _export(exports, { createClientParams: function() { return _paramsbrowser.createRenderParamsFromClient; }, createClientSearchParams: function() { return _searchparamsbrowser.createRenderSearchParamsFromClient; } }); const _paramsbrowser = __turbopack_context__.r("[project]/node_modules/next/dist/client/request/params.browser.js [app-client] (ecmascript)"); const _searchparamsbrowser = __turbopack_context__.r("[project]/node_modules/next/dist/client/request/search-params.browser.js [app-client] (ecmascript)"); if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') { Object.defineProperty(exports.default, '__esModule', { value: true }); Object.assign(exports.default, exports); module.exports = exports.default; } }), "[project]/node_modules/next/dist/client/components/client-page.js [app-client] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "ClientPageRoot", { enumerable: true, get: function() { return ClientPageRoot; } }); const _jsxruntime = __turbopack_context__.r("[project]/node_modules/next/dist/compiled/react/jsx-runtime.js [app-client] (ecmascript)"); const _approutercontextsharedruntime = __turbopack_context__.r("[project]/node_modules/next/dist/shared/lib/app-router-context.shared-runtime.js [app-client] (ecmascript)"); const _react = __turbopack_context__.r("[project]/node_modules/next/dist/compiled/react/index.js [app-client] (ecmascript)"); const _routeparams = __turbopack_context__.r("[project]/node_modules/next/dist/client/route-params.js [app-client] (ecmascript)"); const _hooksclientcontextsharedruntime = __turbopack_context__.r("[project]/node_modules/next/dist/shared/lib/hooks-client-context.shared-runtime.js [app-client] (ecmascript)"); const _clientboundaryparams = __turbopack_context__.r("[project]/node_modules/next/dist/client/components/client-boundary-params.browser.js [app-client] (ecmascript)"); function ClientPageRoot({ Component, serverProvidedParams }) { let searchParams; let params; if (serverProvidedParams !== null) { searchParams = serverProvidedParams.searchParams; params = serverProvidedParams.params; } else { // When Cache Components is enabled, the server does not pass the params as // props; they are parsed on the client and passed via context. const layoutRouterContext = (0, _react.use)(_approutercontextsharedruntime.LayoutRouterContext); params = layoutRouterContext !== null ? layoutRouterContext.parentParams : {}; // This is an intentional behavior change: when Cache Components is enabled, // client segments receive the "canonical" search params, not the // rewritten ones. Users should either call useSearchParams directly or pass // the rewritten ones in from a Server Component. // TODO: Log a deprecation error when this object is accessed searchParams = (0, _routeparams.urlSearchParamsToParsedUrlQuery)((0, _react.use)(_hooksclientcontextsharedruntime.SearchParamsContext)); } const clientSearchParams = (0, _clientboundaryparams.createClientSearchParams)(searchParams); const clientParams = (0, _clientboundaryparams.createClientParams)(params); return /*#__PURE__*/ (0, _jsxruntime.jsx)(Component, { params: clientParams, searchParams: clientSearchParams }); } if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') { Object.defineProperty(exports.default, '__esModule', { value: true }); Object.assign(exports.default, exports); module.exports = exports.default; } }), "[project]/node_modules/next/dist/client/components/client-segment.js [app-client] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "ClientSegmentRoot", { enumerable: true, get: function() { return ClientSegmentRoot; } }); const _jsxruntime = __turbopack_context__.r("[project]/node_modules/next/dist/compiled/react/jsx-runtime.js [app-client] (ecmascript)"); const _approutercontextsharedruntime = __turbopack_context__.r("[project]/node_modules/next/dist/shared/lib/app-router-context.shared-runtime.js [app-client] (ecmascript)"); const _react = __turbopack_context__.r("[project]/node_modules/next/dist/compiled/react/index.js [app-client] (ecmascript)"); const _clientboundaryparams = __turbopack_context__.r("[project]/node_modules/next/dist/client/components/client-boundary-params.browser.js [app-client] (ecmascript)"); function ClientSegmentRoot({ Component, slots, serverProvidedParams }) { let params; if (serverProvidedParams !== null) { params = serverProvidedParams.params; } else { // When Cache Components is enabled, the server does not pass the params // as props; they are parsed on the client and passed via context. const layoutRouterContext = (0, _react.use)(_approutercontextsharedruntime.LayoutRouterContext); params = layoutRouterContext !== null ? layoutRouterContext.parentParams : {}; } const clientParams = (0, _clientboundaryparams.createClientParams)(params); return /*#__PURE__*/ (0, _jsxruntime.jsx)(Component, { ...slots, params: clientParams }); } if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') { Object.defineProperty(exports.default, '__esModule', { value: true }); Object.assign(exports.default, exports); module.exports = exports.default; } }), "[project]/node_modules/next/dist/client/components/instant-validation/boundary.js [app-client] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); 0 && (module.exports = { InstantValidationBoundaryContext: null, PlaceValidationBoundaryBelowThisLevel: null, RenderValidationBoundaryAtThisLevel: null, SlotMarker: null }); function _export(target, all) { for(var name in all)Object.defineProperty(target, name, { enumerable: true, get: all[name] }); } _export(exports, { InstantValidationBoundaryContext: function() { return _impl.InstantValidationBoundaryContext; }, PlaceValidationBoundaryBelowThisLevel: function() { return _impl.PlaceValidationBoundaryBelowThisLevel; }, RenderValidationBoundaryAtThisLevel: function() { return _impl.RenderValidationBoundaryAtThisLevel; }, SlotMarker: function() { return _impl.SlotMarker; } }); const _impl = __turbopack_context__.r("[project]/node_modules/next/dist/client/components/instant-validation/impl.browser.js [app-client] (ecmascript)"); if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') { Object.defineProperty(exports.default, '__esModule', { value: true }); Object.assign(exports.default, exports); module.exports = exports.default; } }), "[project]/node_modules/next/dist/client/components/instant-validation/impl.browser.js [app-client] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); 0 && (module.exports = { InstantValidationBoundaryContext: null, PlaceValidationBoundaryBelowThisLevel: null, RenderValidationBoundaryAtThisLevel: null, SlotMarker: null }); function _export(target, all) { for(var name in all)Object.defineProperty(target, name, { enumerable: true, get: all[name] }); } _export(exports, { InstantValidationBoundaryContext: function() { return InstantValidationBoundaryContext; }, PlaceValidationBoundaryBelowThisLevel: function() { return PlaceValidationBoundaryBelowThisLevel; }, RenderValidationBoundaryAtThisLevel: function() { return RenderValidationBoundaryAtThisLevel; }, SlotMarker: function() { return SlotMarker; } }); const InstantValidationBoundaryContext = null; const PlaceValidationBoundaryBelowThisLevel = null; const RenderValidationBoundaryAtThisLevel = null; const SlotMarker = null; if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') { Object.defineProperty(exports.default, '__esModule', { value: true }); Object.assign(exports.default, exports); module.exports = exports.default; } }), "[project]/node_modules/next/dist/client/components/layout-router.js [app-client] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$build$2f$polyfills$2f$process$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = /*#__PURE__*/ __turbopack_context__.i("[project]/node_modules/next/dist/build/polyfills/process.js [app-client] (ecmascript)"); 'use client'; "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); 0 && (module.exports = { LoadingBoundaryProvider: null, default: null }); function _export(target, all) { for(var name in all)Object.defineProperty(target, name, { enumerable: true, get: all[name] }); } _export(exports, { LoadingBoundaryProvider: function() { return LoadingBoundaryProvider; }, /** * OuterLayoutRouter handles the current segment as well as rendering of other segments. * It can be rendered next to each other with a different `parallelRouterKey`, allowing for Parallel routes. */ default: function() { return OuterLayoutRouter; } }); const _interop_require_default = __turbopack_context__.r("[project]/node_modules/@swc/helpers/cjs/_interop_require_default.cjs [app-client] (ecmascript)"); const _interop_require_wildcard = __turbopack_context__.r("[project]/node_modules/@swc/helpers/cjs/_interop_require_wildcard.cjs [app-client] (ecmascript)"); const _jsxruntime = __turbopack_context__.r("[project]/node_modules/next/dist/compiled/react/jsx-runtime.js [app-client] (ecmascript)"); const _react = /*#__PURE__*/ _interop_require_wildcard._(__turbopack_context__.r("[project]/node_modules/next/dist/compiled/react/index.js [app-client] (ecmascript)")); const _reactdom = /*#__PURE__*/ _interop_require_default._(__turbopack_context__.r("[project]/node_modules/next/dist/compiled/react-dom/index.js [app-client] (ecmascript)")); const _approutercontextsharedruntime = __turbopack_context__.r("[project]/node_modules/next/dist/shared/lib/app-router-context.shared-runtime.js [app-client] (ecmascript)"); const _unresolvedthenable = __turbopack_context__.r("[project]/node_modules/next/dist/client/components/unresolved-thenable.js [app-client] (ecmascript)"); const _errorboundary = __turbopack_context__.r("[project]/node_modules/next/dist/client/components/error-boundary.js [app-client] (ecmascript)"); const _disablesmoothscroll = __turbopack_context__.r("[project]/node_modules/next/dist/shared/lib/router/utils/disable-smooth-scroll.js [app-client] (ecmascript)"); const _redirectboundary = __turbopack_context__.r("[project]/node_modules/next/dist/client/components/redirect-boundary.js [app-client] (ecmascript)"); const _errorboundary1 = __turbopack_context__.r("[project]/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js [app-client] (ecmascript)"); const _boundary = __turbopack_context__.r("[project]/node_modules/next/dist/client/components/instant-validation/boundary.js [app-client] (ecmascript)"); const _createroutercachekey = __turbopack_context__.r("[project]/node_modules/next/dist/client/components/router-reducer/create-router-cache-key.js [app-client] (ecmascript)"); const _bfcachestatemanager = __turbopack_context__.r("[project]/node_modules/next/dist/client/components/bfcache-state-manager.js [app-client] (ecmascript)"); const _apppaths = __turbopack_context__.r("[project]/node_modules/next/dist/shared/lib/router/utils/app-paths.js [app-client] (ecmascript)"); const _hooksclientcontextsharedruntime = __turbopack_context__.r("[project]/node_modules/next/dist/shared/lib/hooks-client-context.shared-runtime.js [app-client] (ecmascript)"); const _routeparams = __turbopack_context__.r("[project]/node_modules/next/dist/client/route-params.js [app-client] (ecmascript)"); const _pprnavigations = __turbopack_context__.r("[project]/node_modules/next/dist/client/components/router-reducer/ppr-navigations.js [app-client] (ecmascript)"); const enableNewScrollHandler = ("TURBOPACK compile-time value", true); const __DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = _reactdom.default.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; // TODO-APP: Replace with new React API for finding dom nodes without a `ref` when available /** * Wraps ReactDOM.findDOMNode with additional logic to hide React Strict Mode warning */ function findDOMNode(instance) { // Tree-shake for server bundle if (typeof window === 'undefined') return null; // __DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE.findDOMNode is null during module init. // We need to lazily reference it. const internal_reactDOMfindDOMNode = __DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE.findDOMNode; return internal_reactDOMfindDOMNode(instance); } const rectProperties = [ 'bottom', 'height', 'left', 'right', 'top', 'width', 'x', 'y' ]; /** * Check if a HTMLElement is hidden or fixed/sticky position */ function shouldSkipElement(element) { // we ignore fixed or sticky positioned elements since they'll likely pass the "in-viewport" check // and will result in a situation we bail on scroll because of something like a fixed nav, // even though the actual page content is offscreen if ([ 'sticky', 'fixed' ].includes(getComputedStyle(element).position)) { return true; } // Uses `getBoundingClientRect` to check if the element is hidden instead of `offsetParent` // because `offsetParent` doesn't consider document/body const rect = element.getBoundingClientRect(); return rectProperties.every((item)=>rect[item] === 0); } /** * Resolve the root scroll padding used by the viewport check. * * Computed lengths serialize as pixels, but percentages remain relative to * the scrollport. Preserve the existing behavior for values that still * contain unresolved CSS math. */ function getScrollPaddingTopInPixels(htmlElement, viewportHeight) { const scrollPaddingTop = getComputedStyle(htmlElement).scrollPaddingTop; const value = Number.parseFloat(scrollPaddingTop); if (!Number.isFinite(value) || value < 0) { return 0; } if (scrollPaddingTop.endsWith('px')) { return value; } if (scrollPaddingTop.endsWith('%')) { return value / 100 * viewportHeight; } return 0; } /** * Check where the top corner of the HTMLElement is relative to the usable * viewport. * * Scroll padding is resolved lazily so an empty Fragment does not trigger a * computed style read. The caller caches the value for the second check. */ function getScrollTargetState(instance, viewportHeight, getScrollPaddingTop) { const rects = instance.getClientRects(); if (rects.length === 0) { return 0; } let elementTop = Number.POSITIVE_INFINITY; for(let i = 0; i < rects.length; i++){ const rect = rects[i]; if (rect.top < elementTop) { elementTop = rect.top; } } return elementTop >= getScrollPaddingTop() && elementTop <= viewportHeight ? 1 : 2; } /** * Find the DOM node for a hash fragment. * If `top` the page has to scroll to the top of the page. This mirrors the browser's behavior. * If the hash fragment is an id, the page has to scroll to the element with that id. * If the hash fragment is a name, the page has to scroll to the first element with that name. */ function getHashFragmentDomNode(hashFragment) { // If the hash fragment is `top` the page has to scroll to the top of the page. if (hashFragment === 'top') { return document.body; } // If the hash fragment is an id, the page has to scroll to the element with that id. return document.getElementById(hashFragment) ?? // If the hash fragment is a name, the page has to scroll to the first element with that name. document.getElementsByName(hashFragment)[0] ?? null; } class InnerScrollAndFocusHandlerOld extends _react.default.Component { componentDidMount() { this.handlePotentialScroll(); } componentDidUpdate() { this.handlePotentialScroll(); } render() { return this.props.children; } constructor(...args){ super(...args), this.handlePotentialScroll = ()=>{ // Handle scroll and focus, it's only applied once. const { focusAndScrollRef, cacheNode } = this.props; const scrollRef = focusAndScrollRef.forceScroll ? focusAndScrollRef.scrollRef : cacheNode.scrollRef; if (scrollRef === null || !scrollRef.current) return; let domNode = null; const hashFragment = focusAndScrollRef.hashFragment; if (hashFragment) { domNode = getHashFragmentDomNode(hashFragment); if (domNode === null) { // A missing hash target is still a handled scroll intent. Do not // fall back to the route segment or leave the intent pending. scrollRef.current = false; focusAndScrollRef.onlyHashChange = false; focusAndScrollRef.hashFragment = null; return; } } // `findDOMNode` is tricky because it returns just the first child if the component is a fragment. // This already caused a bug where the first child was a in head. if (!domNode) { domNode = findDOMNode(this); } // If there is no DOM node this layout-router level is skipped. It'll be handled higher-up in the tree. if (!(domNode instanceof Element)) { return; } // Verify if the element is a HTMLElement and if we want to consider it for scroll behavior. // If the element is skipped, try to select the next sibling and try again. while(!(domNode instanceof HTMLElement) || shouldSkipElement(domNode)){ if ("TURBOPACK compile-time truthy", 1) { if (domNode.parentElement?.localName === 'head') { // We enter this state when metadata was rendered as part of the page or via Next.js. // This is always a bug in Next.js and caused by React hoisting metadata. // Fixed with `experimental.appNewScrollHandler` } } // No siblings found that match the criteria are found, so handle scroll higher up in the tree instead. if (domNode.nextElementSibling === null) { return; } domNode = domNode.nextElementSibling; } // Mark as scrolled so no other segment scrolls for this navigation. scrollRef.current = false; (0, _disablesmoothscroll.disableSmoothScrollDuringRouteTransition)(()=>{ // In case of hash scroll, we only need to scroll the element into view if (hashFragment) { domNode.scrollIntoView(); return; } // Store the current viewport height because reading `clientHeight` causes a reflow, // and it won't change during this function. const htmlElement = document.documentElement; const viewportHeight = htmlElement.clientHeight; let scrollPaddingTop = null; const getScrollPaddingTop = ()=>{ if (scrollPaddingTop === null) { // Reuse the style and layout update from the geometry read above. scrollPaddingTop = getScrollPaddingTopInPixels(htmlElement, viewportHeight); } return scrollPaddingTop; }; // If the element's top edge is already in the viewport, exit early. if (getScrollTargetState(domNode, viewportHeight, getScrollPaddingTop) === 1) { return; } // Otherwise, try scrolling go the top of the document to be backward compatible with pages // scrollIntoView() called on `` element scrolls horizontally on chrome and firefox (that shouldn't happen) // We could use it to scroll horizontally following RTL but that also seems to be broken - it will always scroll left // scrollLeft = 0 also seems to ignore RTL and manually checking for RTL is too much hassle so we will scroll just vertically htmlElement.scrollTop = 0; // Scroll to domNode if domNode is not in viewport when scrolled to top of document if (getScrollTargetState(domNode, viewportHeight, getScrollPaddingTop) !== 1) { // Scroll into view doesn't scroll horizontally by default when not needed domNode.scrollIntoView(); } }, { // We will force layout by querying domNode position dontForceLayout: true, onlyHashChange: focusAndScrollRef.onlyHashChange }); // Mutate after scrolling so that it can be read by `disableSmoothScrollDuringRouteTransition` focusAndScrollRef.onlyHashChange = false; focusAndScrollRef.hashFragment = null; // Set focus on the element domNode.focus(); }; } } /** * Fork of InnerScrollAndFocusHandlerOld using Fragment refs for scrolling. * No longer focuses the first host descendant. */ function InnerScrollHandlerNew(props) { const childrenRef = _react.default.useRef(null); (0, _react.useLayoutEffect)(()=>{ const { focusAndScrollRef, cacheNode } = props; const scrollRef = focusAndScrollRef.forceScroll ? focusAndScrollRef.scrollRef : cacheNode.scrollRef; if (scrollRef === null || !scrollRef.current) return; let instance = null; const hashFragment = focusAndScrollRef.hashFragment; if (hashFragment) { instance = getHashFragmentDomNode(hashFragment); if (instance === null) { // A missing hash target is still a handled scroll intent. Do not // fall back to the route Fragment or leave the intent pending. scrollRef.current = false; focusAndScrollRef.onlyHashChange = false; focusAndScrollRef.hashFragment = null; return; } } else { instance = childrenRef.current; } // If there is no DOM node this layout-router level is skipped. It'll be handled higher-up in the tree. if (instance === null) { return; } let didHandleScroll = false; (0, _disablesmoothscroll.disableSmoothScrollDuringRouteTransition)(()=>{ const htmlElement = document.documentElement; let viewportHeight = null; let initialTargetState = null; let scrollPaddingTop = null; const getScrollPaddingTop = ()=>{ if (scrollPaddingTop === null) { // Reuse the style and layout update from the geometry read. scrollPaddingTop = getScrollPaddingTopInPixels(htmlElement, viewportHeight); } return scrollPaddingTop; }; if (!hashFragment) { // Store the current viewport height because reading `clientHeight` causes a reflow, // and it won't change during this function. viewportHeight = htmlElement.clientHeight; initialTargetState = getScrollTargetState(instance, viewportHeight, getScrollPaddingTop); // An empty Fragment is not a scroll target. In particular, avoid // React's sibling fallback and leave the scroll signal available // for another changed segment. if (initialTargetState === 0) { return; } } didHandleScroll = true; // Mark as scrolled so no other segment scrolls for this navigation. scrollRef.current = false; // This handler intentionally leaves focus untouched; resetting focus on // navigation is deferred. // In case of hash scroll, we only need to scroll the element into view if (hashFragment) { instance.scrollIntoView(); return; } // If the element's top edge is already in the viewport, exit early. if (initialTargetState === 1) { return; } // Otherwise, try scrolling go the top of the document to be backward compatible with pages // scrollIntoView() called on `` element scrolls horizontally on chrome and firefox (that shouldn't happen) // We could use it to scroll horizontally following RTL but that also seems to be broken - it will always scroll left // scrollLeft = 0 also seems to ignore RTL and manually checking for RTL is too much hassle so we will scroll just vertically htmlElement.scrollTop = 0; // Scroll to domNode if domNode is not in viewport when scrolled to top of document if (getScrollTargetState(instance, viewportHeight, getScrollPaddingTop) === 2) { // Scroll into view doesn't scroll horizontally by default when not needed instance.scrollIntoView(); } }, { // We will force layout by querying domNode position dontForceLayout: true, onlyHashChange: focusAndScrollRef.onlyHashChange }); if (!didHandleScroll) { return; } // Mutate after scrolling so that it can be read by `disableSmoothScrollDuringRouteTransition` focusAndScrollRef.onlyHashChange = false; focusAndScrollRef.hashFragment = null; }, // but be prepared for lots of manual testing. undefined); return /*#__PURE__*/ (0, _jsxruntime.jsx)(_react.Fragment, { ref: childrenRef, children: props.children }); } const InnerScrollAndMaybeFocusHandler = ("TURBOPACK compile-time truthy", 1) ? InnerScrollHandlerNew : "TURBOPACK unreachable"; function ScrollAndMaybeFocusHandler({ children, cacheNode }) { const context = (0, _react.useContext)(_approutercontextsharedruntime.GlobalLayoutRouterContext); if (!context) { throw Object.defineProperty(new Error('invariant global layout router not mounted'), "__NEXT_ERROR_CODE", { value: "E473", enumerable: false, configurable: true }); } return /*#__PURE__*/ (0, _jsxruntime.jsx)(InnerScrollAndMaybeFocusHandler, { focusAndScrollRef: context.focusAndScrollRef, cacheNode: cacheNode, children: children }); } /** * InnerLayoutRouter handles rendering the provided segment based on the cache. */ function InnerLayoutRouter({ tree, segmentPath, debugNameContext, cacheNode: maybeCacheNode, params, url, isActive }) { const context = (0, _react.useContext)(_approutercontextsharedruntime.GlobalLayoutRouterContext); const parentNavPromises = (0, _react.useContext)(_hooksclientcontextsharedruntime.NavigationPromisesContext); if (!context) { throw Object.defineProperty(new Error('invariant global layout router not mounted'), "__NEXT_ERROR_CODE", { value: "E473", enumerable: false, configurable: true }); } const cacheNode = maybeCacheNode !== null ? maybeCacheNode : // This should only be reachable for inactive/hidden segments, during // prerendering The active segment should always be consistent with the // CacheNode tree. Regardless, if we don't have a matching CacheNode, we // must suspend rather than render nothing, to prevent showing an // inconsistent route. (0, _react.use)(_unresolvedthenable.unresolvedThenable); // `rsc` represents the renderable node for this segment. // If this segment has a `prefetchRsc`, it's the statically prefetched data. // We should use that on initial render instead of `rsc`. Then we'll switch // to `rsc` when the dynamic response streams in. // // If no prefetch data is available, then we go straight to rendering `rsc`. const resolvedPrefetchRsc = cacheNode.prefetchRsc !== null ? cacheNode.prefetchRsc : cacheNode.rsc; // We use `useDeferredValue` to handle switching between the prefetched and // final values. The second argument is returned on initial render, then it // re-renders with the first argument. const rsc = (0, _react.useDeferredValue)(cacheNode.rsc, resolvedPrefetchRsc); // `rsc` is either a React node or a promise for a React node, except we // special case `null` to represent that this segment's data is missing. If // it's a promise, we need to unwrap it so we can determine whether or not the // data is missing. let resolvedRsc; if ((0, _pprnavigations.isDeferredRsc)(rsc)) { const unwrappedRsc = (0, _react.use)(rsc); if (unwrappedRsc === null) { // If the promise was resolved to `null`, it means the data for this // segment was not returned by the server. Suspend indefinitely. When this // happens, the router is responsible for triggering a new state update to // un-suspend this segment. (0, _react.use)(_unresolvedthenable.unresolvedThenable); } resolvedRsc = unwrappedRsc; } else { // This is not a deferred RSC promise. Don't need to unwrap it. if (rsc === null) { (0, _react.use)(_unresolvedthenable.unresolvedThenable); } resolvedRsc = rsc; } // In dev, we create a NavigationPromisesContext containing the instrumented promises that provide // `useSelectedLayoutSegment` and `useSelectedLayoutSegments`. // Promises are cached outside of render to survive suspense retries. let navigationPromises = null; if ("TURBOPACK compile-time truthy", 1) { const { createNestedLayoutNavigationPromises } = __turbopack_context__.r("[project]/node_modules/next/dist/client/components/navigation-devtools.js [app-client] (ecmascript)"); navigationPromises = createNestedLayoutNavigationPromises(tree, parentNavPromises); } let children = resolvedRsc; if (navigationPromises) { children = /*#__PURE__*/ (0, _jsxruntime.jsx)(_hooksclientcontextsharedruntime.NavigationPromisesContext.Provider, { value: navigationPromises, children: resolvedRsc }); } children = /*#__PURE__*/ (0, _jsxruntime.jsx)(_approutercontextsharedruntime.LayoutRouterContext.Provider, { value: { parentTree: tree, parentCacheNode: cacheNode, parentSegmentPath: segmentPath, parentParams: params, // This is always set to null as we enter a child segment. It's // populated by LoadingBoundaryProvider the next time we reach a // loading boundary. parentLoadingData: null, debugNameContext: debugNameContext, // TODO-APP: overriding of url for parallel routes url: url, isActive: isActive }, children: children }); return children; } function LoadingBoundaryProvider({ loading, children }) { // Provides the data needed to render a loading.tsx boundary, via context. // // loading.tsx creates a Suspense boundary around each of a layout's child // slots. (Might be bit confusing to think about the data flow, but: if // loading.tsx and layout.tsx are in the same directory, they are assigned // to the same CacheNode.) // // This provider component does not render the Suspense boundary directly; // that's handled by LoadingBoundary. // // TODO: For simplicity, we should combine this provider with LoadingBoundary // and render the Suspense boundary directly. The only real benefit of doing // it separately is so that when there are multiple parallel routes, we only // send the boundary data once, rather than once per child. But that's a // negligible benefit and can be achieved via caching instead. const parentContext = (0, _react.use)(_approutercontextsharedruntime.LayoutRouterContext); if (parentContext === null) { return children; } // All values except for parentLoadingData are the same as the parent context. return /*#__PURE__*/ (0, _jsxruntime.jsx)(_approutercontextsharedruntime.LayoutRouterContext.Provider, { value: { parentTree: parentContext.parentTree, parentCacheNode: parentContext.parentCacheNode, parentSegmentPath: parentContext.parentSegmentPath, parentParams: parentContext.parentParams, parentLoadingData: loading, debugNameContext: parentContext.debugNameContext, url: parentContext.url, isActive: parentContext.isActive }, children: children }); } /** * Renders suspense boundary with the provided "loading" property as the fallback. * If no loading property is provided it renders the children without a suspense boundary. */ function LoadingBoundary({ name, loading, children }) { // TODO: For LoadingBoundary, and the other built-in boundary types, don't // wrap in an extra function component if no user-defined boundary is // provided. In other words, inline this conditional wrapping logic into // the parent component. More efficient and keeps unnecessary junk out of // the component stack. if (loading !== null) { const loadingRsc = loading[0]; const loadingStyles = loading[1]; const loadingScripts = loading[2]; return /*#__PURE__*/ (0, _jsxruntime.jsx)(_react.Suspense, { name: name, fallback: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, { children: [ loadingStyles, loadingScripts, loadingRsc ] }), children: children }); } return /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, { children: children }); } function OuterLayoutRouter({ parallelRouterKey, error, errorStyles, errorScripts, templateStyles, templateScripts, template, notFound, forbidden, unauthorized, segmentViewBoundaries }) { const context = (0, _react.useContext)(_approutercontextsharedruntime.LayoutRouterContext); if (!context) { throw Object.defineProperty(new Error('invariant expected layout router to be mounted'), "__NEXT_ERROR_CODE", { value: "E56", enumerable: false, configurable: true }); } const { parentTree, parentCacheNode, parentSegmentPath, parentParams, parentLoadingData, url, isActive, debugNameContext } = context; // Get the CacheNode for this segment by reading it from the parent segment's // child map. const parentTreeSegment = parentTree[0]; const segmentPath = parentSegmentPath === null ? // the code. We should clean this up. [ parallelRouterKey ] : parentSegmentPath.concat([ parentTreeSegment, parallelRouterKey ]); // The "state" key of a segment is the one passed to React — it represents the // identity of the UI tree. Whenever the state key changes, the tree is // recreated and the state is reset. In the App Router model, search params do // not cause state to be lost, so two segments with the same segment path but // different search params should have the same state key. // // The "cache" key of a segment, however, *does* include the search params, if // it's possible that the segment accessed the search params on the server. // (This only applies to page segments; layout segments cannot access search // params on the server.) const activeTree = parentTree[1][parallelRouterKey]; const maybeParentSlots = parentCacheNode.slots; if (activeTree === undefined || maybeParentSlots === null) { // Could not find a matching segment. The client tree is inconsistent with // the server tree. Suspend indefinitely; the router will have already // detected the inconsistency when handling the server response, and // triggered a refresh of the page to recover. (0, _react.use)(_unresolvedthenable.unresolvedThenable); } let maybeValidationBoundaryId = null; if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable ; const activeSegment = activeTree[0]; const activeCacheNode = maybeParentSlots[parallelRouterKey] ?? null; const activeStateKey = (0, _createroutercachekey.createRouterCacheKey)(activeSegment, true) // no search params ; // At each level of the route tree, not only do we render the currently // active segment — we also render the last N segments that were active at // this level inside a hidden boundary, to preserve their state // if or when the user navigates to them again. // // bfcacheEntry is a linked list of FlightRouterStates. let bfcacheEntry = (0, _bfcachestatemanager.useRouterBFCache)(activeTree, activeCacheNode, activeStateKey); let children = []; do { const tree = bfcacheEntry.tree; const cacheNode = bfcacheEntry.cacheNode; const stateKey = bfcacheEntry.stateKey; const segment = tree[0]; /* - Error boundary - Only renders error boundary if error component is provided. - Rendered for each segment to ensure they have their own error state. - When gracefully degrade for bots, skip rendering error boundary. - Loading boundary - Only renders suspense boundary if loading components is provided. - Rendered for each segment to ensure they have their own loading state. - Passed to the router during rendering to ensure it can be immediately rendered when suspending on a Flight fetch. */ let segmentBoundaryTriggerNode = null; let segmentViewStateNode = null; if ("TURBOPACK compile-time truthy", 1) { const { SegmentBoundaryTriggerNode, SegmentViewStateNode } = __turbopack_context__.r("[project]/node_modules/next/dist/next-devtools/userspace/app/segment-explorer-node.js [app-client] (ecmascript)"); const pagePrefix = (0, _apppaths.normalizeAppPath)(url); segmentViewStateNode = /*#__PURE__*/ (0, _jsxruntime.jsx)(SegmentViewStateNode, { page: pagePrefix }, pagePrefix); segmentBoundaryTriggerNode = /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, { children: /*#__PURE__*/ (0, _jsxruntime.jsx)(SegmentBoundaryTriggerNode, {}) }); } let params = parentParams; if (Array.isArray(segment)) { // This segment contains a route param. Accumulate these as we traverse // down the router tree. The result represents the set of params that // the layout/page components are permitted to access below this point. const paramName = segment[0]; const paramCacheKey = segment[1]; const paramType = segment[2]; const paramValue = (0, _routeparams.getParamValueFromCacheKey)(paramCacheKey, paramType); if (paramValue !== null) { params = { ...parentParams, [paramName]: paramValue }; } } const debugName = getBoundaryDebugNameFromSegment(segment); // `debugNameContext` represents the nearest non-"virtual" parent segment. // `getBoundaryDebugNameFromSegment` returns undefined for virtual segments. // So if `debugName` is undefined, the context is passed through unchanged. const childDebugNameContext = debugName ?? debugNameContext; // In practical terms, clicking this name in the Suspense DevTools // should select the child slots of that layout. // // So the name we apply to the Activity boundary is actually based on // the nearest parent segments. // // We skip over "virtual" parents, i.e. ones inserted by Next.js that // don't correspond to application-defined code. const isVirtual = debugName === undefined; const debugNameToDisplay = isVirtual ? undefined : debugNameContext; let templateValue = /*#__PURE__*/ (0, _jsxruntime.jsxs)(ScrollAndMaybeFocusHandler, { cacheNode: cacheNode, children: [ /*#__PURE__*/ (0, _jsxruntime.jsx)(_errorboundary.ErrorBoundary, { errorComponent: error, errorStyles: errorStyles, errorScripts: errorScripts, children: /*#__PURE__*/ (0, _jsxruntime.jsx)(LoadingBoundary, { name: debugNameToDisplay, // TODO: The loading module data for a segment is stored on the // parent, then applied to each of that parent segment's // parallel route slots. In the simple case where there's only // one parallel route (the `children` slot), this is no // different from if the loading module data were stored on the // child directly. But I'm not sure this actually makes sense // when there are multiple parallel routes. It's not a huge // issue because you always have the option to define a narrower // loading boundary for a particular slot. But this sort of // smells like an implementation accident to me. loading: parentLoadingData, children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_errorboundary1.HTTPAccessFallbackBoundary, { notFound: notFound, forbidden: forbidden, unauthorized: unauthorized, children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_redirectboundary.RedirectBoundary, { children: [ /*#__PURE__*/ (0, _jsxruntime.jsx)(InnerLayoutRouter, { url: url, tree: tree, params: params, cacheNode: cacheNode, segmentPath: segmentPath, debugNameContext: childDebugNameContext, isActive: isActive && stateKey === activeStateKey }), segmentBoundaryTriggerNode ] }) }) }) }), segmentViewStateNode ] }); if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable ; let child = /*#__PURE__*/ (0, _jsxruntime.jsxs)(_approutercontextsharedruntime.TemplateContext.Provider, { value: templateValue, children: [ templateStyles, templateScripts, template ] }, stateKey); if ("TURBOPACK compile-time truthy", 1) { const { SegmentStateProvider } = __turbopack_context__.r("[project]/node_modules/next/dist/next-devtools/userspace/app/segment-explorer-node.js [app-client] (ecmascript)"); child = /*#__PURE__*/ (0, _jsxruntime.jsxs)(SegmentStateProvider, { children: [ child, segmentViewBoundaries ] }, stateKey); } if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable ; children.push(child); bfcacheEntry = bfcacheEntry.next; }while (bfcacheEntry !== null) return children; } function getBoundaryDebugNameFromSegment(segment) { if (segment === '/') { // Reached the root return '/'; } if (typeof segment === 'string') { if (isVirtualLayout(segment)) { return undefined; } else { return segment + '/'; } } const paramCacheKey = segment[1]; return paramCacheKey + '/'; } function isVirtualLayout(segment) { return(// (like __PAGE__ and __DEFAULT__) to avoid collisions with // user-defined route groups. segment === '(__SLOT__)'); } if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') { Object.defineProperty(exports.default, '__esModule', { value: true }); Object.assign(exports.default, exports); module.exports = exports.default; } }), "[project]/node_modules/next/dist/client/components/render-from-template-context.js [app-client] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "default", { enumerable: true, get: function() { return RenderFromTemplateContext; } }); const _interop_require_wildcard = __turbopack_context__.r("[project]/node_modules/@swc/helpers/cjs/_interop_require_wildcard.cjs [app-client] (ecmascript)"); const _jsxruntime = __turbopack_context__.r("[project]/node_modules/next/dist/compiled/react/jsx-runtime.js [app-client] (ecmascript)"); const _react = /*#__PURE__*/ _interop_require_wildcard._(__turbopack_context__.r("[project]/node_modules/next/dist/compiled/react/index.js [app-client] (ecmascript)")); const _approutercontextsharedruntime = __turbopack_context__.r("[project]/node_modules/next/dist/shared/lib/app-router-context.shared-runtime.js [app-client] (ecmascript)"); function RenderFromTemplateContext() { const children = (0, _react.useContext)(_approutercontextsharedruntime.TemplateContext); return /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, { children: children }); } if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') { Object.defineProperty(exports.default, '__esModule', { value: true }); Object.assign(exports.default, exports); module.exports = exports.default; } }), "[project]/node_modules/next/dist/client/request/params.browser.dev.js [app-client] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "createRenderParamsFromClient", { enumerable: true, get: function() { return createRenderParamsFromClient; } }); const _reflect = __turbopack_context__.r("[project]/node_modules/next/dist/server/web/spec-extension/adapters/reflect.js [app-client] (ecmascript)"); const _reflectutils = __turbopack_context__.r("[project]/node_modules/next/dist/shared/lib/utils/reflect-utils.js [app-client] (ecmascript)"); const CachedParams = new WeakMap(); function makeDynamicallyTrackedParamsWithDevWarnings(underlyingParams) { const cachedParams = CachedParams.get(underlyingParams); if (cachedParams) { return cachedParams; } // We don't use makeResolvedReactPromise here because params // supports copying with spread and we don't want to unnecessarily // instrument the promise with spreadable properties of ReactPromise. const promise = Promise.resolve(underlyingParams); const proxiedProperties = new Set(); Object.keys(underlyingParams).forEach((prop)=>{ if (_reflectutils.wellKnownProperties.has(prop)) { // These properties cannot be shadowed because they need to be the // true underlying value for Promises to work correctly at runtime } else { proxiedProperties.add(prop); } }); const proxiedPromise = new Proxy(promise, { get (target, prop, receiver) { if (typeof prop === 'string') { if (proxiedProperties.has(prop)) { const expression = (0, _reflectutils.describeStringPropertyAccess)('params', prop); warnForSyncAccess(expression); } } return _reflect.ReflectAdapter.get(target, prop, receiver); }, set (target, prop, value, receiver) { if (typeof prop === 'string') { proxiedProperties.delete(prop); } return _reflect.ReflectAdapter.set(target, prop, value, receiver); }, ownKeys (target) { warnForEnumeration(); return Reflect.ownKeys(target); } }); CachedParams.set(underlyingParams, proxiedPromise); return proxiedPromise; } function warnForSyncAccess(expression) { console.error(`A param property was accessed directly with ${expression}. ` + `\`params\` is a Promise and must be unwrapped with \`React.use()\` before accessing its properties. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`); } function warnForEnumeration() { console.error(`params are being enumerated. ` + `\`params\` is a Promise and must be unwrapped with \`React.use()\` before accessing its properties. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`); } function createRenderParamsFromClient(clientParams) { return makeDynamicallyTrackedParamsWithDevWarnings(clientParams); } if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') { Object.defineProperty(exports.default, '__esModule', { value: true }); Object.assign(exports.default, exports); module.exports = exports.default; } }), "[project]/node_modules/next/dist/client/request/params.browser.js [app-client] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$build$2f$polyfills$2f$process$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = /*#__PURE__*/ __turbopack_context__.i("[project]/node_modules/next/dist/build/polyfills/process.js [app-client] (ecmascript)"); "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "createRenderParamsFromClient", { enumerable: true, get: function() { return createRenderParamsFromClient; } }); const createRenderParamsFromClient = ("TURBOPACK compile-time truthy", 1) ? __turbopack_context__.r("[project]/node_modules/next/dist/client/request/params.browser.dev.js [app-client] (ecmascript)").createRenderParamsFromClient : "TURBOPACK unreachable"; if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') { Object.defineProperty(exports.default, '__esModule', { value: true }); Object.assign(exports.default, exports); module.exports = exports.default; } }), "[project]/node_modules/next/dist/client/request/search-params.browser.dev.js [app-client] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "createRenderSearchParamsFromClient", { enumerable: true, get: function() { return createRenderSearchParamsFromClient; } }); const _reflect = __turbopack_context__.r("[project]/node_modules/next/dist/server/web/spec-extension/adapters/reflect.js [app-client] (ecmascript)"); const _reflectutils = __turbopack_context__.r("[project]/node_modules/next/dist/shared/lib/utils/reflect-utils.js [app-client] (ecmascript)"); const CachedSearchParams = new WeakMap(); function makeUntrackedSearchParamsWithDevWarnings(underlyingSearchParams) { const cachedSearchParams = CachedSearchParams.get(underlyingSearchParams); if (cachedSearchParams) { return cachedSearchParams; } const proxiedProperties = new Set(); const promise = Promise.resolve(underlyingSearchParams); Object.keys(underlyingSearchParams).forEach((prop)=>{ if (_reflectutils.wellKnownProperties.has(prop)) { // These properties cannot be shadowed because they need to be the // true underlying value for Promises to work correctly at runtime } else { proxiedProperties.add(prop); } }); const proxiedPromise = new Proxy(promise, { get (target, prop, receiver) { if (typeof prop === 'string') { if (!_reflectutils.wellKnownProperties.has(prop) && (proxiedProperties.has(prop) || // We are accessing a property that doesn't exist on the promise nor // the underlying searchParams. Reflect.has(target, prop) === false)) { const expression = (0, _reflectutils.describeStringPropertyAccess)('searchParams', prop); warnForSyncAccess(expression); } } return _reflect.ReflectAdapter.get(target, prop, receiver); }, set (target, prop, value, receiver) { if (typeof prop === 'string') { proxiedProperties.delete(prop); } return Reflect.set(target, prop, value, receiver); }, has (target, prop) { if (typeof prop === 'string') { if (!_reflectutils.wellKnownProperties.has(prop) && (proxiedProperties.has(prop) || // We are accessing a property that doesn't exist on the promise nor // the underlying searchParams. Reflect.has(target, prop) === false)) { const expression = (0, _reflectutils.describeHasCheckingStringProperty)('searchParams', prop); warnForSyncAccess(expression); } } return Reflect.has(target, prop); }, ownKeys (target) { warnForSyncSpread(); return Reflect.ownKeys(target); } }); CachedSearchParams.set(underlyingSearchParams, proxiedPromise); return proxiedPromise; } function warnForSyncAccess(expression) { console.error(`A searchParam property was accessed directly with ${expression}. ` + `\`searchParams\` is a Promise and must be unwrapped with \`React.use()\` before accessing its properties. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`); } function warnForSyncSpread() { console.error(`The keys of \`searchParams\` were accessed directly. ` + `\`searchParams\` is a Promise and must be unwrapped with \`React.use()\` before accessing its properties. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`); } function createRenderSearchParamsFromClient(underlyingSearchParams) { return makeUntrackedSearchParamsWithDevWarnings(underlyingSearchParams); } if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') { Object.defineProperty(exports.default, '__esModule', { value: true }); Object.assign(exports.default, exports); module.exports = exports.default; } }), "[project]/node_modules/next/dist/client/request/search-params.browser.js [app-client] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$build$2f$polyfills$2f$process$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = /*#__PURE__*/ __turbopack_context__.i("[project]/node_modules/next/dist/build/polyfills/process.js [app-client] (ecmascript)"); "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "createRenderSearchParamsFromClient", { enumerable: true, get: function() { return createRenderSearchParamsFromClient; } }); const createRenderSearchParamsFromClient = ("TURBOPACK compile-time truthy", 1) ? __turbopack_context__.r("[project]/node_modules/next/dist/client/request/search-params.browser.dev.js [app-client] (ecmascript)").createRenderSearchParamsFromClient : "TURBOPACK unreachable"; if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') { Object.defineProperty(exports.default, '__esModule', { value: true }); Object.assign(exports.default, exports); module.exports = exports.default; } }), "[project]/node_modules/next/dist/compiled/react/cjs/react-jsx-dev-runtime.development.js [app-client] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$build$2f$polyfills$2f$process$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = /*#__PURE__*/ __turbopack_context__.i("[project]/node_modules/next/dist/build/polyfills/process.js [app-client] (ecmascript)"); /** * @license React * react-jsx-dev-runtime.development.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ "use strict"; "production" !== ("TURBOPACK compile-time value", "development") && function() { function getComponentNameFromType(type) { if (null == type) return null; if ("function" === typeof type) return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null; if ("string" === typeof type) return type; switch(type){ case REACT_FRAGMENT_TYPE: return "Fragment"; case REACT_PROFILER_TYPE: return "Profiler"; case REACT_STRICT_MODE_TYPE: return "StrictMode"; case REACT_SUSPENSE_TYPE: return "Suspense"; case REACT_SUSPENSE_LIST_TYPE: return "SuspenseList"; case REACT_ACTIVITY_TYPE: return "Activity"; case REACT_VIEW_TRANSITION_TYPE: return "ViewTransition"; } if ("object" === typeof type) switch("number" === typeof type.tag && console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), type.$$typeof){ case REACT_PORTAL_TYPE: return "Portal"; case REACT_CONTEXT_TYPE: return type.displayName || "Context"; case REACT_CONSUMER_TYPE: return (type._context.displayName || "Context") + ".Consumer"; case REACT_FORWARD_REF_TYPE: var innerType = type.render; type = type.displayName; type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"); return type; case REACT_MEMO_TYPE: return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo"; case REACT_LAZY_TYPE: innerType = type._payload; type = type._init; try { return getComponentNameFromType(type(innerType)); } catch (x) {} } return null; } function testStringCoercion(value) { return "" + value; } function checkKeyStringCoercion(value) { try { testStringCoercion(value); var JSCompiler_inline_result = !1; } catch (e) { JSCompiler_inline_result = !0; } if (JSCompiler_inline_result) { JSCompiler_inline_result = console; var JSCompiler_temp_const = JSCompiler_inline_result.error; var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object"; JSCompiler_temp_const.call(JSCompiler_inline_result, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", JSCompiler_inline_result$jscomp$0); return testStringCoercion(value); } } function getTaskName(type) { if (type === REACT_FRAGMENT_TYPE) return "<>"; if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE) return "<...>"; try { var name = getComponentNameFromType(type); return name ? "<" + name + ">" : "<...>"; } catch (x) { return "<...>"; } } function getOwner() { var dispatcher = ReactSharedInternals.A; return null === dispatcher ? null : dispatcher.getOwner(); } function UnknownOwner() { return Error("react-stack-top-frame"); } function hasValidKey(config) { if (hasOwnProperty.call(config, "key")) { var getter = Object.getOwnPropertyDescriptor(config, "key").get; if (getter && getter.isReactWarning) return !1; } return void 0 !== config.key; } function defineKeyPropWarningGetter(props, displayName) { function warnAboutAccessingKey() { specialPropKeyWarningShown || (specialPropKeyWarningShown = !0, console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", displayName)); } warnAboutAccessingKey.isReactWarning = !0; Object.defineProperty(props, "key", { get: warnAboutAccessingKey, configurable: !0 }); } function elementRefGetterWithDeprecationWarning() { var componentName = getComponentNameFromType(this.type); didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = !0, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")); componentName = this.props.ref; return void 0 !== componentName ? componentName : null; } function ReactElement(type, key, props, owner, debugStack, debugTask) { var refProp = props.ref; type = { $$typeof: REACT_ELEMENT_TYPE, type: type, key: key, props: props, _owner: owner }; null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", { enumerable: !1, get: elementRefGetterWithDeprecationWarning }) : Object.defineProperty(type, "ref", { enumerable: !1, value: null }); type._store = {}; Object.defineProperty(type._store, "validated", { configurable: !1, enumerable: !1, writable: !0, value: 0 }); Object.defineProperty(type, "_debugInfo", { configurable: !1, enumerable: !1, writable: !0, value: null }); Object.defineProperty(type, "_debugStack", { configurable: !1, enumerable: !1, writable: !0, value: debugStack }); Object.defineProperty(type, "_debugTask", { configurable: !1, enumerable: !1, writable: !0, value: debugTask }); Object.freeze && (Object.freeze(type.props), Object.freeze(type)); return type; } function jsxDEVImpl(type, config, maybeKey, isStaticChildren, debugStack, debugTask) { var children = config.children; if (void 0 !== children) if (isStaticChildren) if (isArrayImpl(children)) { for(isStaticChildren = 0; isStaticChildren < children.length; isStaticChildren++)validateChildKeys(children[isStaticChildren]); Object.freeze && Object.freeze(children); } else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."); else validateChildKeys(children); if (hasOwnProperty.call(config, "key")) { children = getComponentNameFromType(type); var keys = Object.keys(config).filter(function(k) { return "key" !== k; }); isStaticChildren = 0 < keys.length ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}"; didWarnAboutKeySpread[children + isStaticChildren] || (keys = 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}", console.error('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />', isStaticChildren, children, keys, children), didWarnAboutKeySpread[children + isStaticChildren] = !0); } children = null; void 0 !== maybeKey && (checkKeyStringCoercion(maybeKey), children = "" + maybeKey); hasValidKey(config) && (checkKeyStringCoercion(config.key), children = "" + config.key); if ("key" in config) { maybeKey = {}; for(var propName in config)"key" !== propName && (maybeKey[propName] = config[propName]); } else maybeKey = config; children && defineKeyPropWarningGetter(maybeKey, "function" === typeof type ? type.displayName || type.name || "Unknown" : type); return ReactElement(type, children, maybeKey, getOwner(), debugStack, debugTask); } function validateChildKeys(node) { isValidElement(node) ? node._store && (node._store.validated = 1) : "object" === typeof node && null !== node && node.$$typeof === REACT_LAZY_TYPE && ("fulfilled" === node._payload.status ? isValidElement(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1)); } function isValidElement(object) { return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE; } var React = __turbopack_context__.r("[project]/node_modules/next/dist/compiled/react/index.js [app-client] (ecmascript)"), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), REACT_VIEW_TRANSITION_TYPE = Symbol.for("react.view_transition"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() { return null; }; React = { react_stack_bottom_frame: function(callStackForError) { return callStackForError(); } }; var specialPropKeyWarningShown; var didWarnAboutElementRef = {}; var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(React, UnknownOwner)(); var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner)); var didWarnAboutKeySpread = {}; exports.Fragment = REACT_FRAGMENT_TYPE; exports.jsxDEV = function(type, config, maybeKey, isStaticChildren) { var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++; if (trackActualOwner) { var previousStackTraceLimit = Error.stackTraceLimit; Error.stackTraceLimit = 10; var debugStackDEV = Error("react-stack-top-frame"); Error.stackTraceLimit = previousStackTraceLimit; } else debugStackDEV = unknownOwnerDebugStack; return jsxDEVImpl(type, config, maybeKey, isStaticChildren, debugStackDEV, trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask); }; }(); }), "[project]/node_modules/next/dist/compiled/react/jsx-dev-runtime.js [app-client] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$build$2f$polyfills$2f$process$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = /*#__PURE__*/ __turbopack_context__.i("[project]/node_modules/next/dist/build/polyfills/process.js [app-client] (ecmascript)"); 'use strict'; if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable ; else { module.exports = __turbopack_context__.r("[project]/node_modules/next/dist/compiled/react/cjs/react-jsx-dev-runtime.development.js [app-client] (ecmascript)"); } }), "[project]/node_modules/next/dist/lib/metadata/generate/icon-mark.js [app-client] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "IconMark", { enumerable: true, get: function() { return IconMark; } }); const _jsxruntime = __turbopack_context__.r("[project]/node_modules/next/dist/compiled/react/jsx-runtime.js [app-client] (ecmascript)"); const IconMark = ()=>{ if (typeof window !== 'undefined') { return null; } return /*#__PURE__*/ (0, _jsxruntime.jsx)("meta", { name: "\xabnxt-icon\xbb" }); }; }), "[project]/node_modules/next/dist/server/web/spec-extension/adapters/reflect.js [app-client] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "ReflectAdapter", { enumerable: true, get: function() { return ReflectAdapter; } }); class ReflectAdapter { static get(target, prop, receiver) { const value = Reflect.get(target, prop, receiver); if (typeof value === 'function') { return value.bind(target); } return value; } static set(target, prop, value, receiver) { return Reflect.set(target, prop, value, receiver); } static has(target, prop) { return Reflect.has(target, prop); } static deleteProperty(target, prop) { return Reflect.deleteProperty(target, prop); } } }), "[project]/node_modules/next/dist/shared/lib/router/utils/disable-smooth-scroll.js [app-client] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$build$2f$polyfills$2f$process$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = /*#__PURE__*/ __turbopack_context__.i("[project]/node_modules/next/dist/build/polyfills/process.js [app-client] (ecmascript)"); /** * Run function with `scroll-behavior: auto` applied to ``. * This css change will be reverted after the function finishes. */ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "disableSmoothScrollDuringRouteTransition", { enumerable: true, get: function() { return disableSmoothScrollDuringRouteTransition; } }); function disableSmoothScrollDuringRouteTransition(fn, options = {}) { // if only the hash is changed, we don't need to disable smooth scrolling // we only care to prevent smooth scrolling when navigating to a new page to avoid jarring UX if (options.onlyHashChange) { fn(); return; } const htmlElement = document.documentElement; const hasDataAttribute = htmlElement.dataset.scrollBehavior === 'smooth'; if (!hasDataAttribute) { // Warn if smooth scrolling is detected but no data attribute is present if (("TURBOPACK compile-time value", "development") === 'development' && getComputedStyle(htmlElement).scrollBehavior === 'smooth') { const { warnOnce } = __turbopack_context__.r("[project]/node_modules/next/dist/shared/lib/utils/warn-once.js [app-client] (ecmascript)"); warnOnce('Detected `scroll-behavior: smooth` on the `` element. To disable smooth scrolling during route transitions, ' + 'add `data-scroll-behavior="smooth"` to your element. ' + 'Learn more: https://nextjs.org/docs/messages/missing-data-scroll-behavior'); } // No smooth scrolling configured, run directly without style manipulation fn(); return; } // Proceed with temporarily disabling smooth scrolling const existing = htmlElement.style.scrollBehavior; htmlElement.style.scrollBehavior = 'auto'; if (!options.dontForceLayout) { // In Chrome-based browsers we need to force reflow before calling `scrollTo`. // Otherwise it will not pickup the change in scrollBehavior // More info here: https://github.com/vercel/next.js/issues/40719#issuecomment-1336248042 htmlElement.getClientRects(); } fn(); htmlElement.style.scrollBehavior = existing; } }), "[project]/node_modules/next/dist/shared/lib/utils/reflect-utils.js [app-client] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; // This regex will have fast negatives meaning valid identifiers may not pass // this test. However this is only used during static generation to provide hints // about why a page bailed out of some or all prerendering and we can use bracket notation // for example while `ಠ_ಠ` is a valid identifier it's ok to print `searchParams['ಠ_ಠ']` // even if this would have been fine too `searchParams.ಠ_ಠ` Object.defineProperty(exports, "__esModule", { value: true }); 0 && (module.exports = { describeHasCheckingStringProperty: null, describeStringPropertyAccess: null, wellKnownProperties: null }); function _export(target, all) { for(var name in all)Object.defineProperty(target, name, { enumerable: true, get: all[name] }); } _export(exports, { describeHasCheckingStringProperty: function() { return describeHasCheckingStringProperty; }, describeStringPropertyAccess: function() { return describeStringPropertyAccess; }, wellKnownProperties: function() { return wellKnownProperties; } }); const isDefinitelyAValidIdentifier = /^[A-Za-z_$][A-Za-z0-9_$]*$/; function describeStringPropertyAccess(target, prop) { if (isDefinitelyAValidIdentifier.test(prop)) { return `\`${target}.${prop}\``; } return `\`${target}[${JSON.stringify(prop)}]\``; } function describeHasCheckingStringProperty(target, prop) { const stringifiedProp = JSON.stringify(prop); return `\`Reflect.has(${target}, ${stringifiedProp})\`, \`${stringifiedProp} in ${target}\`, or similar`; } const wellKnownProperties = new Set([ 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toString', 'valueOf', 'toLocaleString', // Promise prototype 'then', 'catch', 'finally', // React Promise extension 'status', // 'value', // 'error', // React introspection 'displayName', '_debugInfo', // Common tested properties 'toJSON', '$$typeof', '__esModule', // Tested by flight when checking for iterables '@@iterator' ]); }), "[project]/node_modules/react-i18next/dist/es/I18nextProvider.js [app-client] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "I18nextProvider", ()=>I18nextProvider ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/compiled/react/index.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$context$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__$3c$locals$3e$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/context.js [app-client] (ecmascript) "); ; ; function I18nextProvider({ i18n, defaultNS, children }) { const value = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["useMemo"])({ "I18nextProvider.useMemo[value]": ()=>({ i18n, defaultNS }) }["I18nextProvider.useMemo[value]"], [ i18n, defaultNS ]); return (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["createElement"])(__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$context$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__$3c$locals$3e$__["I18nContext"].Provider, { value }, children); } }), "[project]/node_modules/react-i18next/dist/es/IcuTrans.js [app-client] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "IcuTrans", ()=>IcuTrans ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/compiled/react/index.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$IcuTransWithoutContext$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/IcuTransWithoutContext.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$context$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__$3c$locals$3e$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/context.js [app-client] (ecmascript) "); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$i18nInstance$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/i18nInstance.js [app-client] (ecmascript)"); ; ; ; function IcuTrans({ i18nKey, defaultTranslation, content, ns, values = {}, i18n: i18nFromProps, t: tFromProps }) { const { i18n: i18nFromContext, defaultNS: defaultNSFromContext } = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["useContext"])(__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$context$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__$3c$locals$3e$__["I18nContext"]) || {}; const i18n = i18nFromProps || i18nFromContext || (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$i18nInstance$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["getI18n"])(); const t = tFromProps || i18n?.t.bind(i18n); return (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$IcuTransWithoutContext$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["IcuTransWithoutContext"])({ i18nKey, defaultTranslation, content, ns: ns || t?.ns || defaultNSFromContext || i18n?.options?.defaultNS, values, i18n, t: tFromProps }); } IcuTrans.displayName = 'IcuTrans'; }), "[project]/node_modules/react-i18next/dist/es/IcuTransUtils/TranslationParserError.js [app-client] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "TranslationParserError", ()=>TranslationParserError ]); class TranslationParserError extends Error { constructor(message, position, translationString){ super(message); this.name = 'TranslationParserError'; this.position = position; this.translationString = translationString; if (Error.captureStackTrace) { Error.captureStackTrace(this, TranslationParserError); } } } }), "[project]/node_modules/react-i18next/dist/es/IcuTransUtils/htmlEntityDecoder.js [app-client] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "decodeHtmlEntities", ()=>decodeHtmlEntities ]); const commonEntities = { ' ': '\u00A0', '&': '&', '<': '<', '>': '>', '"': '"', ''': "'", '©': '©', '®': '®', '™': '™', '…': '…', '–': '–', '—': '—', '‘': '\u2018', '’': '\u2019', '‚': '\u201A', '“': '\u201C', '”': '\u201D', '„': '\u201E', '†': '†', '‡': '‡', '•': '•', '′': '′', '″': '″', '‹': '‹', '›': '›', '§': '§', '¶': '¶', '·': '·', ' ': '\u2002', ' ': '\u2003', ' ': '\u2009', '€': '€', '£': '£', '¥': '¥', '¢': '¢', '¤': '¤', '×': '×', '÷': '÷', '−': '−', '±': '±', '≠': '≠', '≤': '≤', '≥': '≥', '≈': '≈', '≡': '≡', '∞': '∞', '∫': '∫', '∑': '∑', '∏': '∏', '√': '√', '∂': '∂', '‰': '‰', '°': '°', 'µ': 'µ', '←': '←', '↑': '↑', '→': '→', '↓': '↓', '↔': '↔', '↵': '↵', '⇐': '⇐', '⇑': '⇑', '⇒': '⇒', '⇓': '⇓', '⇔': '⇔', 'α': 'α', 'β': 'β', 'γ': 'γ', 'δ': 'δ', 'ε': 'ε', 'ζ': 'ζ', 'η': 'η', 'θ': 'θ', 'ι': 'ι', 'κ': 'κ', 'λ': 'λ', 'μ': 'μ', 'ν': 'ν', 'ξ': 'ξ', 'ο': 'ο', 'π': 'π', 'ρ': 'ρ', 'σ': 'σ', 'τ': 'τ', 'υ': 'υ', 'φ': 'φ', 'χ': 'χ', 'ψ': 'ψ', 'ω': 'ω', 'Α': 'Α', 'Β': 'Β', 'Γ': 'Γ', 'Δ': 'Δ', 'Ε': 'Ε', 'Ζ': 'Ζ', 'Η': 'Η', 'Θ': 'Θ', 'Ι': 'Ι', 'Κ': 'Κ', 'Λ': 'Λ', 'Μ': 'Μ', 'Ν': 'Ν', 'Ξ': 'Ξ', 'Ο': 'Ο', 'Π': 'Π', 'Ρ': 'Ρ', 'Σ': 'Σ', 'Τ': 'Τ', 'Υ': 'Υ', 'Φ': 'Φ', 'Χ': 'Χ', 'Ψ': 'Ψ', 'Ω': 'Ω', 'À': 'À', 'Á': 'Á', 'Â': 'Â', 'Ã': 'Ã', 'Ä': 'Ä', 'Å': 'Å', 'Æ': 'Æ', 'Ç': 'Ç', 'È': 'È', 'É': 'É', 'Ê': 'Ê', 'Ë': 'Ë', 'Ì': 'Ì', 'Í': 'Í', 'Î': 'Î', 'Ï': 'Ï', 'Ð': 'Ð', 'Ñ': 'Ñ', 'Ò': 'Ò', 'Ó': 'Ó', 'Ô': 'Ô', 'Õ': 'Õ', 'Ö': 'Ö', 'Ø': 'Ø', 'Ù': 'Ù', 'Ú': 'Ú', 'Û': 'Û', 'Ü': 'Ü', 'Ý': 'Ý', 'Þ': 'Þ', 'ß': 'ß', 'à': 'à', 'á': 'á', 'â': 'â', 'ã': 'ã', 'ä': 'ä', 'å': 'å', 'æ': 'æ', 'ç': 'ç', 'è': 'è', 'é': 'é', 'ê': 'ê', 'ë': 'ë', 'ì': 'ì', 'í': 'í', 'î': 'î', 'ï': 'ï', 'ð': 'ð', 'ñ': 'ñ', 'ò': 'ò', 'ó': 'ó', 'ô': 'ô', 'õ': 'õ', 'ö': 'ö', 'ø': 'ø', 'ù': 'ù', 'ú': 'ú', 'û': 'û', 'ü': 'ü', 'ý': 'ý', 'þ': 'þ', 'ÿ': 'ÿ', '¡': '¡', '¿': '¿', 'ƒ': 'ƒ', 'ˆ': 'ˆ', '˜': '˜', 'Œ': 'Œ', 'œ': 'œ', 'Š': 'Š', 'š': 'š', 'Ÿ': 'Ÿ', 'ª': 'ª', 'º': 'º', '¯': '¯', '´': '´', '¸': '¸', '¹': '¹', '²': '²', '³': '³', '¼': '¼', '½': '½', '¾': '¾', '♠': '♠', '♣': '♣', '♥': '♥', '♦': '♦', '◊': '◊', '‾': '‾', '⁄': '⁄', '℘': '℘', 'ℑ': 'ℑ', 'ℜ': 'ℜ', 'ℵ': 'ℵ' }; const entityPattern = new RegExp(Object.keys(commonEntities).map((entity)=>entity.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')).join('|'), 'g'); const decodeHtmlEntities = (text)=>text.replace(entityPattern, (match)=>commonEntities[match]).replace(/&#(\d+);/g, (_, num)=>String.fromCharCode(parseInt(num, 10))).replace(/&#x([0-9a-fA-F]+);/g, (_, hex)=>String.fromCharCode(parseInt(hex, 16))); }), "[project]/node_modules/react-i18next/dist/es/IcuTransUtils/index.js [app-client] (ecmascript) ", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$IcuTransUtils$2f$htmlEntityDecoder$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/IcuTransUtils/htmlEntityDecoder.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$IcuTransUtils$2f$renderTranslation$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/IcuTransUtils/renderTranslation.js [app-client] (ecmascript)"); ; ; ; ; }), "[project]/node_modules/react-i18next/dist/es/IcuTransUtils/renderTranslation.js [app-client] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "renderTranslation", ()=>renderTranslation ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/compiled/react/index.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$IcuTransUtils$2f$TranslationParserError$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/IcuTransUtils/TranslationParserError.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$IcuTransUtils$2f$tokenizer$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/IcuTransUtils/tokenizer.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$IcuTransUtils$2f$htmlEntityDecoder$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/IcuTransUtils/htmlEntityDecoder.js [app-client] (ecmascript)"); ; ; ; ; const renderDeclarationNode = (declaration, children, childDeclarations)=>{ const { type, props = {} } = declaration; if (props.children && Array.isArray(props.children) && childDeclarations) { const { children: _childrenToRemove, ...propsWithoutChildren } = props; return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["default"].createElement(type, propsWithoutChildren, ...children); } if (children.length === 0) { return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["default"].createElement(type, props); } if (children.length === 1) { return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["default"].createElement(type, props, children[0]); } return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["default"].createElement(type, props, ...children); }; const renderTranslation = (translation, declarations = [])=>{ if (!translation) { return []; } const tokens = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$IcuTransUtils$2f$tokenizer$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["tokenize"])(translation); const result = []; const stack = []; const literalTagNumbers = new Set(); const getCurrentDeclarations = ()=>{ if (stack.length === 0) { return declarations; } const parentFrame = stack[stack.length - 1]; if (parentFrame.declaration.props?.children && Array.isArray(parentFrame.declaration.props.children)) { return parentFrame.declaration.props.children; } return parentFrame.declarations; }; tokens.forEach((token)=>{ switch(token.type){ case 'Text': { const decoded = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$IcuTransUtils$2f$htmlEntityDecoder$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["decodeHtmlEntities"])(token.value); const targetArray = stack.length > 0 ? stack[stack.length - 1].children : result; targetArray.push(decoded); } break; case 'TagOpen': { const { tagNumber } = token; const currentDeclarations = getCurrentDeclarations(); const declaration = currentDeclarations[tagNumber]; if (!declaration) { literalTagNumbers.add(tagNumber); const literalText = `<${tagNumber}>`; const targetArray = stack.length > 0 ? stack[stack.length - 1].children : result; targetArray.push(literalText); break; } stack.push({ tagNumber, children: [], position: token.position, declaration, declarations: currentDeclarations }); } break; case 'TagClose': { const { tagNumber } = token; if (literalTagNumbers.has(tagNumber)) { const literalText = ``; const literalTargetArray = stack.length > 0 ? stack[stack.length - 1].children : result; literalTargetArray.push(literalText); literalTagNumbers.delete(tagNumber); break; } if (stack.length === 0) { throw new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$IcuTransUtils$2f$TranslationParserError$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["TranslationParserError"](`Unexpected closing tag at position ${token.position}`, token.position, translation); } const frame = stack.pop(); if (frame.tagNumber !== tagNumber) { throw new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$IcuTransUtils$2f$TranslationParserError$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["TranslationParserError"](`Mismatched tags: expected but got at position ${token.position}`, token.position, translation); } const element = renderDeclarationNode(frame.declaration, frame.children, frame.declarations); const elementTargetArray = stack.length > 0 ? stack[stack.length - 1].children : result; elementTargetArray.push(element); } break; } }); if (stack.length > 0) { const unclosed = stack[stack.length - 1]; throw new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$IcuTransUtils$2f$TranslationParserError$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["TranslationParserError"](`Unclosed tag <${unclosed.tagNumber}> at position ${unclosed.position}`, unclosed.position, translation); } return result; }; }), "[project]/node_modules/react-i18next/dist/es/IcuTransUtils/tokenizer.js [app-client] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "tokenize", ()=>tokenize ]); const tokenize = (translation)=>{ const tokens = []; let position = 0; let currentText = ''; const flushText = ()=>{ if (currentText) { tokens.push({ type: 'Text', value: currentText, position: position - currentText.length }); currentText = ''; } }; while(position < translation.length){ const char = translation[position]; if (char === '<') { const tagMatch = translation.slice(position).match(/^<(\d+)>/); if (tagMatch) { flushText(); tokens.push({ type: 'TagOpen', value: tagMatch[0], position, tagNumber: parseInt(tagMatch[1], 10) }); position += tagMatch[0].length; } else { const closeTagMatch = translation.slice(position).match(/^<\/(\d+)>/); if (closeTagMatch) { flushText(); tokens.push({ type: 'TagClose', value: closeTagMatch[0], position, tagNumber: parseInt(closeTagMatch[1], 10) }); position += closeTagMatch[0].length; } else { currentText += char; position += 1; } } } else { currentText += char; position += 1; } } flushText(); return tokens; }; }), "[project]/node_modules/react-i18next/dist/es/IcuTransWithoutContext.js [app-client] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "IcuTransWithoutContext", ()=>IcuTransWithoutContext ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/compiled/react/index.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/utils.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$i18nInstance$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/i18nInstance.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$IcuTransUtils$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__$3c$locals$3e$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/IcuTransUtils/index.js [app-client] (ecmascript) "); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$IcuTransUtils$2f$renderTranslation$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/IcuTransUtils/renderTranslation.js [app-client] (ecmascript)"); ; ; ; ; function IcuTransWithoutContext({ i18nKey, defaultTranslation, content, ns, values = {}, i18n: i18nFromProps, t: tFromProps }) { const i18n = i18nFromProps || (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$i18nInstance$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["getI18n"])(); if (!i18n) { (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["warnOnce"])(i18n, 'NO_I18NEXT_INSTANCE', `IcuTrans: You need to pass in an i18next instance using i18nextReactModule`, { i18nKey }); return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["default"].createElement(__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["default"].Fragment, {}, defaultTranslation); } const t = tFromProps || i18n.t?.bind(i18n) || ((k)=>k); let namespaces = ns || t.ns || i18n.options?.defaultNS; namespaces = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["isString"])(namespaces) ? [ namespaces ] : namespaces || [ 'translation' ]; let mergedValues = values; if (i18n.options?.interpolation?.defaultVariables) { mergedValues = values && Object.keys(values).length > 0 ? { ...values, ...i18n.options.interpolation.defaultVariables } : { ...i18n.options.interpolation.defaultVariables }; } const translation = t(i18nKey, { defaultValue: defaultTranslation, ...mergedValues, ns: namespaces }); try { const rendered = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$IcuTransUtils$2f$renderTranslation$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["renderTranslation"])(translation, content); return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["default"].createElement(__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["default"].Fragment, {}, ...rendered); } catch (error) { (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["warn"])(i18n, 'ICU_TRANS_RENDER_ERROR', `IcuTrans component error for key "${i18nKey}": ${error.message}`, { i18nKey, error }); return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["default"].createElement(__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["default"].Fragment, {}, translation); } } IcuTransWithoutContext.displayName = 'IcuTransWithoutContext'; }), "[project]/node_modules/react-i18next/dist/es/Trans.js [app-client] (ecmascript) ", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "Trans", ()=>Trans ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/compiled/react/index.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$TransWithoutContext$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/TransWithoutContext.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$context$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__$3c$locals$3e$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/context.js [app-client] (ecmascript) "); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$i18nInstance$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/i18nInstance.js [app-client] (ecmascript)"); ; ; ; ; function Trans({ children, count, parent, i18nKey, context, tOptions = {}, values, defaults, components, ns, i18n: i18nFromProps, t: tFromProps, shouldUnescape, ...additionalProps }) { const { i18n: i18nFromContext, defaultNS: defaultNSFromContext } = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["useContext"])(__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$context$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__$3c$locals$3e$__["I18nContext"]) || {}; const i18n = i18nFromProps || i18nFromContext || (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$i18nInstance$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["getI18n"])(); const t = tFromProps || i18n?.t.bind(i18n); return (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$TransWithoutContext$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["Trans"])({ children, count, parent, i18nKey, context, tOptions, values, defaults, components, ns: ns || t?.ns || defaultNSFromContext || i18n?.options?.defaultNS, i18n, t: tFromProps, shouldUnescape, ...additionalProps }); } }), "[project]/node_modules/react-i18next/dist/es/TransWithoutContext.js [app-client] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "Trans", ()=>Trans, "nodesToString", ()=>nodesToString ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/compiled/react/index.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$i18next$2f$dist$2f$esm$2f$i18next$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/i18next/dist/esm/i18next.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$html$2d$parse$2d$stringify$2f$dist$2f$esm$2f$html$2d$parse$2d$stringify$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/html-parse-stringify/dist/esm/html-parse-stringify.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/utils.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$defaults$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/defaults.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$i18nInstance$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/i18nInstance.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$unescape$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/unescape.js [app-client] (ecmascript)"); ; ; ; ; ; ; ; const hasChildren = (node, checkLength)=>{ if (!node) return false; const base = node.props?.children ?? node.children; if (checkLength) return base.length > 0; return !!base; }; const getChildren = (node)=>{ if (!node) return []; const children = node.props?.children ?? node.children; return node.props?.i18nIsDynamicList ? getAsArray(children) : children; }; const hasValidReactChildren = (children)=>Array.isArray(children) && children.every(__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["isValidElement"]); const getAsArray = (data)=>Array.isArray(data) ? data : [ data ]; const mergeProps = (source, target)=>{ const newTarget = { ...target }; newTarget.props = { ...target.props, ...source.props }; return newTarget; }; const getValuesFromChildren = (children)=>{ const values = {}; if (!children) return values; const getData = (childs)=>{ const childrenArray = getAsArray(childs); childrenArray.forEach((child)=>{ if ((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["isString"])(child)) return; if (hasChildren(child)) getData(getChildren(child)); else if ((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["isObject"])(child) && !(0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["isValidElement"])(child)) Object.assign(values, child); }); }; getData(children); return values; }; const nodesToString = (children, i18nOptions, i18n, i18nKey)=>{ if (!children) return ''; let stringNode = ''; const childrenArray = getAsArray(children); const keepArray = i18nOptions?.transSupportBasicHtmlNodes ? i18nOptions.transKeepBasicHtmlNodesFor ?? [] : []; childrenArray.forEach((child, childIndex)=>{ if ((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["isString"])(child)) { stringNode += `${child}`; return; } if ((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["isValidElement"])(child)) { const { props, type } = child; const childPropsCount = Object.keys(props).length; const shouldKeepChild = keepArray.indexOf(type) > -1; const childChildren = props.children; if (!childChildren && shouldKeepChild && !childPropsCount) { stringNode += `<${type}/>`; return; } if (!childChildren && (!shouldKeepChild || childPropsCount) || props.i18nIsDynamicList) { stringNode += `<${childIndex}>`; return; } if (shouldKeepChild && childPropsCount <= 1) { const cnt = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["isString"])(childChildren) ? childChildren : nodesToString(childChildren, i18nOptions, i18n, i18nKey); stringNode += `<${type}>${cnt}`; return; } const content = nodesToString(childChildren, i18nOptions, i18n, i18nKey); stringNode += `<${childIndex}>${content}`; return; } if (child === null) { (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["warn"])(i18n, 'TRANS_NULL_VALUE', `Passed in a null value as child`, { i18nKey }); return; } if ((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["isObject"])(child)) { const { format, ...clone } = child; const keys = Object.keys(clone); if (keys.length === 1) { const value = format ? `${keys[0]}, ${format}` : keys[0]; stringNode += `{{${value}}}`; return; } (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["warn"])(i18n, 'TRANS_INVALID_OBJ', `Invalid child - Object should only have keys {{ value, format }} (format is optional).`, { i18nKey, child }); return; } (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["warn"])(i18n, 'TRANS_INVALID_VAR', `Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.`, { i18nKey, child }); }); return stringNode; }; const renderNodes = (children, knownComponentsMap, targetString, i18n, i18nOptions, combinedTOpts, shouldUnescape)=>{ if (targetString === '') return []; const keepArray = i18nOptions.transKeepBasicHtmlNodesFor || []; const emptyChildrenButNeedsHandling = targetString && new RegExp(keepArray.map((keep)=>`<${keep}`).join('|')).test(targetString); if (!children && !knownComponentsMap && !emptyChildrenButNeedsHandling && !shouldUnescape) return [ targetString ]; const data = knownComponentsMap ?? {}; const getData = (childs)=>{ const childrenArray = getAsArray(childs); childrenArray.forEach((child)=>{ if ((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["isString"])(child)) return; if (hasChildren(child)) getData(getChildren(child)); else if ((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["isObject"])(child) && !(0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["isValidElement"])(child)) Object.assign(data, child); }); }; getData(children); const knownNames = Object.keys(data); const allowedTags = (name)=>/^\d+$/.test(name) || keepArray.indexOf(name) > -1 || knownNames.indexOf(name) > -1; const ast = __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$html$2d$parse$2d$stringify$2f$dist$2f$esm$2f$html$2d$parse$2d$stringify$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["default"].parse(`<0>${targetString}`, { allowedTags }); const opts = { ...data, ...combinedTOpts }; const renderInner = (child, node, rootReactNode)=>{ const childs = getChildren(child); const mappedChildren = mapAST(childs, node.children, rootReactNode); return hasValidReactChildren(childs) && mappedChildren.length === 0 || child.props?.i18nIsDynamicList ? childs : mappedChildren; }; const pushTranslatedJSX = (child, inner, mem, i, isVoid)=>{ if (child.dummy) { child.children = inner; mem.push((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["cloneElement"])(child, { key: i }, isVoid ? undefined : inner)); } else { mem.push(...__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["Children"].map([ child ], (c)=>{ if (c.type === __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["Fragment"] || c.props?.i18nIsDynamicList !== undefined) { const freshProps = { key: i }; if (c && c.props) { Object.keys(c.props).forEach((k)=>{ if (k === 'children' || k === 'i18nIsDynamicList') return; freshProps[k] = c.props[k]; }); } return (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["createElement"])(c.type, freshProps, isVoid ? null : inner); } const override = { key: i }; if (c && c.props) { Object.keys(c.props).forEach((k)=>{ if (k === 'ref' || k === 'children') return; override[k] = c.props[k]; }); } return (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["cloneElement"])(c, override, isVoid ? null : inner); })); } }; const mapAST = (reactNode, astNode, rootReactNode)=>{ const reactNodes = getAsArray(reactNode); const astNodes = getAsArray(astNode); const keepTagOccurrence = {}; return astNodes.reduce((mem, node, i)=>{ const translationContent = node.children?.[0]?.content && i18n.services.interpolator.interpolate(node.children[0].content, opts, i18n.language); if (node.type === 'tag') { let tmp = reactNodes[parseInt(node.name, 10)]; if (!tmp && knownComponentsMap) tmp = knownComponentsMap[node.name]; if (rootReactNode.length === 1 && !tmp) tmp = rootReactNode[0][node.name]; if (!tmp) tmp = {}; const props = { ...node.attrs }; if (shouldUnescape) { Object.keys(props).forEach((p)=>{ const val = props[p]; if ((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["isString"])(val)) { props[p] = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$unescape$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["unescape"])(val); } }); } const child = Object.keys(props).length !== 0 ? mergeProps({ props }, tmp) : tmp; const isElement = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["isValidElement"])(child); const isValidTranslationWithChildren = isElement && hasChildren(node, true) && !node.voidElement; const isEmptyTransWithHTML = emptyChildrenButNeedsHandling && (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["isObject"])(child) && child.dummy && !isElement; const isKnownComponent = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["isObject"])(knownComponentsMap) && Object.hasOwnProperty.call(knownComponentsMap, node.name); if ((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["isString"])(child)) { const value = i18n.services.interpolator.interpolate(child, opts, i18n.language); mem.push(value); } else if (hasChildren(child) || isValidTranslationWithChildren) { const inner = renderInner(child, node, rootReactNode); pushTranslatedJSX(child, inner, mem, i); } else if (isEmptyTransWithHTML) { const inner = mapAST(reactNodes, node.children, rootReactNode); pushTranslatedJSX(child, inner, mem, i); } else if (Number.isNaN(parseFloat(node.name))) { if (isKnownComponent) { const inner = renderInner(child, node, rootReactNode); pushTranslatedJSX(child, inner, mem, i, node.voidElement); } else if (i18nOptions.transSupportBasicHtmlNodes && keepArray.indexOf(node.name) > -1) { if (node.voidElement) { mem.push((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["createElement"])(node.name, { key: `${node.name}-${i}` })); } else { const occurrence = keepTagOccurrence[node.name] || 0; keepTagOccurrence[node.name] = occurrence + 1; let matched; let seen = 0; for(let r = 0; r < reactNodes.length; r += 1){ const rn = reactNodes[r]; if ((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["isValidElement"])(rn) && rn.type === node.name) { if (seen === occurrence) { matched = rn; break; } seen += 1; } } const innerScope = matched ? getAsArray(getChildren(matched)) : reactNodes; const inner = mapAST(innerScope, node.children, rootReactNode); mem.push((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["createElement"])(node.name, { key: `${node.name}-${i}` }, inner)); } } else if (node.voidElement) { mem.push(`<${node.name} />`); } else { const inner = mapAST(reactNodes, node.children, rootReactNode); mem.push(`<${node.name}>${inner}`); } } else if ((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["isObject"])(child) && !isElement) { const content = node.children[0] ? translationContent : null; if (content) mem.push(content); } else { pushTranslatedJSX(child, translationContent, mem, i, node.children.length !== 1 || !translationContent); } } else if (node.type === 'text') { const wrapTextNodes = i18nOptions.transWrapTextNodes; const unescapeFn = typeof i18nOptions.unescape === 'function' ? i18nOptions.unescape : (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$defaults$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["getDefaults"])().unescape; const content = shouldUnescape ? unescapeFn(i18n.services.interpolator.interpolate(node.content, opts, i18n.language)) : i18n.services.interpolator.interpolate(node.content, opts, i18n.language); if (wrapTextNodes) { mem.push((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["createElement"])(wrapTextNodes, { key: `${node.name}-${i}` }, content)); } else { mem.push(content); } } return mem; }, []); }; const result = mapAST([ { dummy: true, children: children || [] } ], ast, getAsArray(children || [])); return getChildren(result[0]); }; const fixComponentProps = (component, index, translation)=>{ const componentKey = component.key || index; const comp = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["cloneElement"])(component, { key: componentKey }); if (!comp.props || !comp.props.children || translation.indexOf(`${index}/>`) < 0 && translation.indexOf(`${index} />`) < 0) { return comp; } function Componentized() { return (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["createElement"])(__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["Fragment"], null, comp); } return (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["createElement"])(Componentized, { key: componentKey }); }; const generateArrayComponents = (components, translation)=>components.map((c, index)=>fixComponentProps(c, index, translation)); const generateObjectComponents = (components, translation)=>{ const componentMap = {}; Object.keys(components).forEach((c)=>{ Object.assign(componentMap, { [c]: fixComponentProps(components[c], c, translation) }); }); return componentMap; }; const generateComponents = (components, translation, i18n, i18nKey)=>{ if (!components) return null; if (Array.isArray(components)) { return generateArrayComponents(components, translation); } if ((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["isObject"])(components)) { return generateObjectComponents(components, translation); } (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["warnOnce"])(i18n, 'TRANS_INVALID_COMPONENTS', ` "components" prop expects an object or array`, { i18nKey }); return null; }; const isComponentsMap = (object)=>{ if (!(0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["isObject"])(object)) return false; if (Array.isArray(object)) return false; return Object.keys(object).reduce((acc, key)=>acc && Number.isNaN(Number.parseFloat(key)), true); }; function Trans({ children, count, parent, i18nKey, context, tOptions = {}, values, defaults, components, ns, i18n: i18nFromProps, t: tFromProps, shouldUnescape, ...additionalProps }) { const i18n = i18nFromProps || (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$i18nInstance$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["getI18n"])(); if (!i18n) { (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["warnOnce"])(i18n, 'NO_I18NEXT_INSTANCE', `Trans: You need to pass in an i18next instance using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.`, { i18nKey }); return children; } const t = tFromProps || i18n.t.bind(i18n) || ((k)=>k); const reactI18nextOptions = { ...(0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$defaults$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["getDefaults"])(), ...i18n.options?.react }; let namespaces = ns || t.ns || i18n.options?.defaultNS; namespaces = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["isString"])(namespaces) ? [ namespaces ] : namespaces || [ 'translation' ]; const { transDefaultProps } = reactI18nextOptions; const mergedTOptions = transDefaultProps?.tOptions ? { ...transDefaultProps.tOptions, ...tOptions } : tOptions; const mergedShouldUnescape = shouldUnescape ?? transDefaultProps?.shouldUnescape; const mergedValues = transDefaultProps?.values ? { ...transDefaultProps.values, ...values } : values; const mergedComponents = transDefaultProps?.components ? { ...transDefaultProps.components, ...components } : components; const nodeAsString = nodesToString(children, reactI18nextOptions, i18n, i18nKey); const defaultValue = defaults || mergedTOptions?.defaultValue || nodeAsString || reactI18nextOptions.transEmptyNodeValue || (typeof i18nKey === 'function' ? (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$i18next$2f$dist$2f$esm$2f$i18next$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["keyFromSelector"])(i18nKey) : i18nKey); const { hashTransKey } = reactI18nextOptions; const key = i18nKey || (hashTransKey ? hashTransKey(nodeAsString || defaultValue) : nodeAsString || defaultValue); if (i18n.options?.interpolation?.defaultVariables) { values = mergedValues && Object.keys(mergedValues).length > 0 ? { ...mergedValues, ...i18n.options.interpolation.defaultVariables } : { ...i18n.options.interpolation.defaultVariables }; } else { values = mergedValues; } const valuesFromChildren = getValuesFromChildren(children); if (valuesFromChildren && typeof valuesFromChildren.count === 'number' && count === undefined) { count = valuesFromChildren.count; } const interpolationOverride = values || count !== undefined && !i18n.options?.interpolation?.alwaysFormat || !children ? mergedTOptions.interpolation : { interpolation: { ...mergedTOptions.interpolation, prefix: '#$?', suffix: '?$#' } }; const combinedTOpts = { ...mergedTOptions, context: context || mergedTOptions.context, count, ...values, ...interpolationOverride, defaultValue, ns: namespaces }; let translation = key ? t(key, combinedTOpts) : defaultValue; if (translation === key && defaultValue) translation = defaultValue; const generatedComponents = generateComponents(mergedComponents, translation, i18n, i18nKey); let indexedChildren = generatedComponents || children; let componentsMap = null; if (isComponentsMap(generatedComponents)) { componentsMap = generatedComponents; indexedChildren = children; } const content = renderNodes(indexedChildren, componentsMap, translation, i18n, reactI18nextOptions, combinedTOpts, mergedShouldUnescape); const useAsParent = parent ?? reactI18nextOptions.defaultTransParent; return useAsParent ? (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["createElement"])(useAsParent, additionalProps, content) : content; } }), "[project]/node_modules/react-i18next/dist/es/Translation.js [app-client] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "Translation", ()=>Translation ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$useTranslation$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/useTranslation.js [app-client] (ecmascript)"); ; const Translation = ({ ns, children, ...options })=>{ const [t, i18n, ready] = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$useTranslation$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["useTranslation"])(ns, options); return children(t, { i18n, lng: i18n?.language }, ready); }; }), "[project]/node_modules/react-i18next/dist/es/context.js [app-client] (ecmascript) ", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "I18nContext", ()=>I18nContext, "ReportNamespaces", ()=>ReportNamespaces, "composeInitialProps", ()=>composeInitialProps, "getInitialProps", ()=>getInitialProps ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/compiled/react/index.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$defaults$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/defaults.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$i18nInstance$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/i18nInstance.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$initReactI18next$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/initReactI18next.js [app-client] (ecmascript)"); ; ; ; ; ; const I18nContext = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["createContext"])(); class ReportNamespaces { constructor(){ this.usedNamespaces = {}; } addUsedNamespaces(namespaces) { namespaces.forEach((ns)=>{ if (!this.usedNamespaces[ns]) this.usedNamespaces[ns] = true; }); } getUsedNamespaces() { return Object.keys(this.usedNamespaces); } } const composeInitialProps = (ForComponent)=>async (ctx)=>{ const componentsInitialProps = await ForComponent.getInitialProps?.(ctx) ?? {}; const i18nInitialProps = getInitialProps(); return { ...componentsInitialProps, ...i18nInitialProps }; }; const getInitialProps = ()=>{ const i18n = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$i18nInstance$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["getI18n"])(); if (!i18n) { console.warn('react-i18next:: getInitialProps: You will need to pass in an i18next instance by using initReactI18next'); return {}; } const namespaces = i18n.reportNamespaces?.getUsedNamespaces() ?? []; const ret = {}; const initialI18nStore = {}; i18n.languages.forEach((l)=>{ initialI18nStore[l] = {}; namespaces.forEach((ns)=>{ initialI18nStore[l][ns] = i18n.getResourceBundle(l, ns) || {}; }); }); ret.initialI18nStore = initialI18nStore; ret.initialLanguage = i18n.language; return ret; }; }), "[project]/node_modules/react-i18next/dist/es/defaults.js [app-client] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "getDefaults", ()=>getDefaults, "setDefaults", ()=>setDefaults ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$unescape$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/unescape.js [app-client] (ecmascript)"); ; let defaultOptions = { bindI18n: 'languageChanged', bindI18nStore: '', transEmptyNodeValue: '', transSupportBasicHtmlNodes: true, transWrapTextNodes: '', transKeepBasicHtmlNodesFor: [ 'br', 'strong', 'i', 'p' ], useSuspense: true, unescape: __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$unescape$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["unescape"], transDefaultProps: undefined }; const setDefaults = (options = {})=>{ defaultOptions = { ...defaultOptions, ...options }; }; const getDefaults = ()=>defaultOptions; }), "[project]/node_modules/react-i18next/dist/es/i18nInstance.js [app-client] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "getI18n", ()=>getI18n, "setI18n", ()=>setI18n ]); let i18nInstance; const setI18n = (instance)=>{ i18nInstance = instance; }; const getI18n = ()=>i18nInstance; }), "[project]/node_modules/react-i18next/dist/es/index.js [app-client] (ecmascript) ", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "date", ()=>date, "number", ()=>number, "plural", ()=>plural, "select", ()=>select, "selectOrdinal", ()=>selectOrdinal, "time", ()=>time ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$Trans$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__$3c$locals$3e$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/Trans.js [app-client] (ecmascript) "); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$TransWithoutContext$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/TransWithoutContext.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$IcuTrans$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/IcuTrans.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$IcuTransWithoutContext$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/IcuTransWithoutContext.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$useTranslation$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/useTranslation.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$withTranslation$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/withTranslation.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$Translation$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/Translation.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$I18nextProvider$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/I18nextProvider.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$withSSR$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/withSSR.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$useSSR$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/useSSR.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$initReactI18next$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/initReactI18next.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$defaults$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/defaults.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$context$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__$3c$locals$3e$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/context.js [app-client] (ecmascript) "); ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; const date = ()=>''; const time = ()=>''; const number = ()=>''; const select = ()=>''; const plural = ()=>''; const selectOrdinal = ()=>''; }), "[project]/node_modules/react-i18next/dist/es/initReactI18next.js [app-client] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "initReactI18next", ()=>initReactI18next ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$defaults$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/defaults.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$i18nInstance$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/i18nInstance.js [app-client] (ecmascript)"); ; ; const initReactI18next = { type: '3rdParty', init (instance) { (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$defaults$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["setDefaults"])(instance.options.react); (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$i18nInstance$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["setI18n"])(instance); } }; }), "[project]/node_modules/react-i18next/dist/es/unescape.js [app-client] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "unescape", ()=>unescape ]); const matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g; const htmlEntities = { '&': '&', '&': '&', '<': '<', '<': '<', '>': '>', '>': '>', ''': "'", ''': "'", '"': '"', '"': '"', ' ': ' ', ' ': ' ', '©': '©', '©': '©', '®': '®', '®': '®', '…': '…', '…': '…', '/': '/', '/': '/' }; const unescapeHtmlEntity = (m)=>htmlEntities[m]; const unescape = (text)=>text.replace(matchHtmlEntity, unescapeHtmlEntity); }), "[project]/node_modules/react-i18next/dist/es/useSSR.js [app-client] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "useSSR", ()=>useSSR ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/compiled/react/index.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$context$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__$3c$locals$3e$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/context.js [app-client] (ecmascript) "); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$i18nInstance$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/i18nInstance.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/utils.js [app-client] (ecmascript)"); ; ; ; const useSSR = (initialI18nStore, initialLanguage, props = {})=>{ const { i18n: i18nFromProps } = props; const { i18n: i18nFromContext } = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["useContext"])(__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$context$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__$3c$locals$3e$__["I18nContext"]) || {}; const i18n = i18nFromProps || i18nFromContext || (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$i18nInstance$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["getI18n"])(); if (!i18n) { (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["warnOnce"])(i18n, 'NO_I18NEXT_INSTANCE', 'useSSR: You will need to pass in an i18next instance by using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.'); return; } if (i18n.options?.isClone) return; if (initialI18nStore && !i18n.initializedStoreOnce) { if (!i18n.services?.resourceStore) { (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["warnOnce"])(i18n, 'I18N_NOT_INITIALIZED', 'useSSR: i18n instance was found but not initialized (services.resourceStore is missing). Make sure you call i18next.init() before using useSSR — e.g. at module level, not only in getStaticProps/getServerSideProps.'); return; } i18n.services.resourceStore.data = initialI18nStore; i18n.options.ns = Object.values(initialI18nStore).reduce((mem, lngResources)=>{ Object.keys(lngResources).forEach((ns)=>{ if (mem.indexOf(ns) < 0) mem.push(ns); }); return mem; }, i18n.options.ns); i18n.initializedStoreOnce = true; i18n.isInitialized = true; } if (initialLanguage && !i18n.initializedLanguageOnce) { i18n.changeLanguage(initialLanguage); i18n.initializedLanguageOnce = true; } }; }), "[project]/node_modules/react-i18next/dist/es/useTranslation.js [app-client] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "useTranslation", ()=>useTranslation ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$build$2f$polyfills$2f$process$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = /*#__PURE__*/ __turbopack_context__.i("[project]/node_modules/next/dist/build/polyfills/process.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/compiled/react/index.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$use$2d$sync$2d$external$2d$store$2f$shim$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/use-sync-external-store/shim/index.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$context$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__$3c$locals$3e$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/context.js [app-client] (ecmascript) "); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$i18nInstance$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/i18nInstance.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$defaults$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/defaults.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/utils.js [app-client] (ecmascript)"); ; ; ; ; const notReadyT = (k, optsOrDefaultValue)=>{ if ((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["isString"])(optsOrDefaultValue)) return optsOrDefaultValue; if ((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["isObject"])(optsOrDefaultValue) && (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["isString"])(optsOrDefaultValue.defaultValue)) return optsOrDefaultValue.defaultValue; if (typeof k === 'function') return ''; if (Array.isArray(k)) { const last = k[k.length - 1]; return typeof last === 'function' ? '' : last; } return k; }; const notReadySnapshot = { t: notReadyT, ready: false }; const dummySubscribe = ()=>()=>{}; const useTranslation = (ns, props = {})=>{ const { i18n: i18nFromProps } = props; const { i18n: i18nFromContext, defaultNS: defaultNSFromContext } = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["useContext"])(__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$context$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__$3c$locals$3e$__["I18nContext"]) || {}; const i18n = i18nFromProps || i18nFromContext || (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$i18nInstance$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["getI18n"])(); if (i18n && !i18n.reportNamespaces) i18n.reportNamespaces = new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$context$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__$3c$locals$3e$__["ReportNamespaces"](); if (!i18n) { (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["warnOnce"])(i18n, 'NO_I18NEXT_INSTANCE', 'useTranslation: You will need to pass in an i18next instance by using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.'); } const i18nOptions = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["useMemo"])({ "useTranslation.useMemo[i18nOptions]": ()=>({ ...(0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$defaults$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["getDefaults"])(), ...i18n?.options?.react, ...props }) }["useTranslation.useMemo[i18nOptions]"], [ i18n, props ]); const { useSuspense, keyPrefix } = i18nOptions; const nsOrContext = ns || defaultNSFromContext || i18n?.options?.defaultNS; const unstableNamespaces = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["isString"])(nsOrContext) ? [ nsOrContext ] : nsOrContext || [ 'translation' ]; const namespaces = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["useMemo"])({ "useTranslation.useMemo[namespaces]": ()=>unstableNamespaces }["useTranslation.useMemo[namespaces]"], unstableNamespaces); i18n?.reportNamespaces?.addUsedNamespaces?.(namespaces); const revisionRef = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["useRef"])(0); const subscribe = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["useCallback"])({ "useTranslation.useCallback[subscribe]": (callback)=>{ if (!i18n) return dummySubscribe; const { bindI18n, bindI18nStore } = i18nOptions; const wrappedCallback = { "useTranslation.useCallback[subscribe].wrappedCallback": ()=>{ revisionRef.current += 1; callback(); } }["useTranslation.useCallback[subscribe].wrappedCallback"]; if (bindI18n) i18n.on(bindI18n, wrappedCallback); if (bindI18nStore) i18n.store.on(bindI18nStore, wrappedCallback); return ({ "useTranslation.useCallback[subscribe]": ()=>{ if (bindI18n) bindI18n.split(' ').forEach({ "useTranslation.useCallback[subscribe]": (e)=>i18n.off(e, wrappedCallback) }["useTranslation.useCallback[subscribe]"]); if (bindI18nStore) bindI18nStore.split(' ').forEach({ "useTranslation.useCallback[subscribe]": (e)=>i18n.store.off(e, wrappedCallback) }["useTranslation.useCallback[subscribe]"]); } })["useTranslation.useCallback[subscribe]"]; } }["useTranslation.useCallback[subscribe]"], [ i18n, i18nOptions ]); const snapshotRef = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["useRef"])(); const getSnapshot = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["useCallback"])({ "useTranslation.useCallback[getSnapshot]": ()=>{ if (!i18n) { return notReadySnapshot; } const calculatedReady = !!(i18n.isInitialized || i18n.initializedStoreOnce) && namespaces.every({ "useTranslation.useCallback[getSnapshot]": (n)=>(0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["hasLoadedNamespace"])(n, i18n, i18nOptions) }["useTranslation.useCallback[getSnapshot]"]); const currentLng = props.lng || i18n.language; const currentRevision = revisionRef.current; const lastSnapshot = snapshotRef.current; if (lastSnapshot && lastSnapshot.ready === calculatedReady && lastSnapshot.lng === currentLng && lastSnapshot.keyPrefix === keyPrefix && lastSnapshot.revision === currentRevision) { return lastSnapshot; } const calculatedT = i18n.getFixedT(currentLng, i18nOptions.nsMode === 'fallback' ? namespaces : namespaces[0], keyPrefix, { scopeNs: namespaces }); const newSnapshot = { t: calculatedT, ready: calculatedReady, lng: currentLng, keyPrefix, revision: currentRevision }; snapshotRef.current = newSnapshot; return newSnapshot; } }["useTranslation.useCallback[getSnapshot]"], [ i18n, namespaces, keyPrefix, i18nOptions, props.lng ]); const [loadCount, setLoadCount] = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["useState"])(0); const { t, ready } = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$use$2d$sync$2d$external$2d$store$2f$shim$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["useSyncExternalStore"])(subscribe, getSnapshot, getSnapshot); (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["useEffect"])({ "useTranslation.useEffect": ()=>{ if (i18n && !ready && !useSuspense) { const onLoaded = { "useTranslation.useEffect.onLoaded": ()=>setLoadCount({ "useTranslation.useEffect.onLoaded": (c)=>c + 1 }["useTranslation.useEffect.onLoaded"]) }["useTranslation.useEffect.onLoaded"]; if (props.lng) { (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["loadLanguages"])(i18n, props.lng, namespaces, onLoaded); } else { (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["loadNamespaces"])(i18n, namespaces, onLoaded); } } } }["useTranslation.useEffect"], [ i18n, props.lng, namespaces, ready, useSuspense, loadCount ]); const finalI18n = i18n || {}; const wrapperRef = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["useRef"])(null); const wrapperLangRef = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["useRef"])(); const createI18nWrapper = (original)=>{ const descriptors = Object.getOwnPropertyDescriptors(original); if (descriptors.__original) delete descriptors.__original; const wrapper = Object.create(Object.getPrototypeOf(original), descriptors); if (!Object.prototype.hasOwnProperty.call(wrapper, '__original')) { try { Object.defineProperty(wrapper, '__original', { value: original, writable: false, enumerable: false, configurable: false }); } catch (_) {} } return wrapper; }; const ret = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["useMemo"])({ "useTranslation.useMemo[ret]": ()=>{ const original = finalI18n; const lang = original?.language; let i18nWrapper = original; if ("TURBOPACK compile-time truthy", 1) { if (wrapperRef.current && wrapperRef.current.__original === original) { if (wrapperLangRef.current !== lang) { i18nWrapper = createI18nWrapper(original); wrapperRef.current = i18nWrapper; wrapperLangRef.current = lang; } else { i18nWrapper = wrapperRef.current; } } else { i18nWrapper = createI18nWrapper(original); wrapperRef.current = i18nWrapper; wrapperLangRef.current = lang; } } const effectiveT = !ready && !useSuspense ? ({ "useTranslation.useMemo[ret]": (...args)=>{ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["warnOnce"])(i18n, 'USE_T_BEFORE_READY', 'useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t.'); return t(...args); } })["useTranslation.useMemo[ret]"] : t; const arr = [ effectiveT, i18nWrapper, ready ]; arr.t = effectiveT; arr.i18n = i18nWrapper; arr.ready = ready; return arr; } }["useTranslation.useMemo[ret]"], [ t, finalI18n, ready, finalI18n.resolvedLanguage, finalI18n.language, finalI18n.languages ]); if (i18n && useSuspense && !ready) { let inDevelopment = false; try { inDevelopment = ("TURBOPACK compile-time value", "development") !== 'production'; } catch (e) {} if (inDevelopment) { (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["warnOnce"])(i18n, 'SUSPENDED_WHILE_LOADING', 'useTranslation: suspended while translations are loading (useSuspense is true by default). Add a boundary above this component, or set react.useSuspense: false in the i18next init options. https://react.i18next.com/latest/usetranslation-hook'); } throw new Promise((resolve)=>{ const onLoaded = ()=>resolve(); if (props.lng) { (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["loadLanguages"])(i18n, props.lng, namespaces, onLoaded); } else { (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["loadNamespaces"])(i18n, namespaces, onLoaded); } }); } return ret; }; }), "[project]/node_modules/react-i18next/dist/es/utils.js [app-client] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "getDisplayName", ()=>getDisplayName, "hasLoadedNamespace", ()=>hasLoadedNamespace, "isObject", ()=>isObject, "isString", ()=>isString, "loadLanguages", ()=>loadLanguages, "loadNamespaces", ()=>loadNamespaces, "warn", ()=>warn, "warnOnce", ()=>warnOnce ]); const warn = (i18n, code, msg, rest)=>{ const args = [ msg, { code, ...rest || {} } ]; if (i18n?.services?.logger?.forward) { return i18n.services.logger.forward(args, 'warn', 'react-i18next::', true); } if (isString(args[0])) args[0] = `react-i18next:: ${args[0]}`; if (i18n?.services?.logger?.warn) { i18n.services.logger.warn(...args); } else if (console?.warn) { console.warn(...args); } }; const alreadyWarned = {}; const warnOnce = (i18n, code, msg, rest)=>{ if (isString(msg) && alreadyWarned[msg]) return; if (isString(msg)) alreadyWarned[msg] = new Date(); warn(i18n, code, msg, rest); }; const loadedClb = (i18n, cb)=>()=>{ if (i18n.isInitialized) { cb(); } else { const initialized = ()=>{ setTimeout(()=>{ i18n.off('initialized', initialized); }, 0); cb(); }; i18n.on('initialized', initialized); } }; const loadNamespaces = (i18n, ns, cb)=>{ i18n.loadNamespaces(ns, loadedClb(i18n, cb)); }; const loadLanguages = (i18n, lng, ns, cb)=>{ if (isString(ns)) ns = [ ns ]; if (i18n.options.preload && i18n.options.preload.indexOf(lng) > -1) return loadNamespaces(i18n, ns, cb); ns.forEach((n)=>{ if (i18n.options.ns.indexOf(n) < 0) i18n.options.ns.push(n); }); i18n.loadLanguages(lng, loadedClb(i18n, cb)); }; const hasLoadedNamespace = (ns, i18n, options = {})=>{ if (!i18n.languages || !i18n.languages.length) { warnOnce(i18n, 'NO_LANGUAGES', 'i18n.languages were undefined or empty', { languages: i18n.languages }); return true; } return i18n.hasLoadedNamespace(ns, { lng: options.lng, precheck: (i18nInstance, loadNotPending)=>{ if (options.bindI18n && options.bindI18n.indexOf('languageChanging') > -1 && i18nInstance.services.backendConnector.backend && i18nInstance.isLanguageChangingTo && !loadNotPending(i18nInstance.isLanguageChangingTo, ns)) return false; } }); }; const getDisplayName = (Component)=>Component.displayName || Component.name || (isString(Component) && Component.length > 0 ? Component : 'Unknown'); const isString = (obj)=>typeof obj === 'string'; const isObject = (obj)=>typeof obj === 'object' && obj !== null; }), "[project]/node_modules/react-i18next/dist/es/withSSR.js [app-client] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "withSSR", ()=>withSSR ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/compiled/react/index.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$useSSR$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/useSSR.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$context$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__$3c$locals$3e$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/context.js [app-client] (ecmascript) "); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/utils.js [app-client] (ecmascript)"); ; ; ; ; const withSSR = ()=>function Extend(WrappedComponent) { function I18nextWithSSR({ initialI18nStore, initialLanguage, ...rest }) { (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$useSSR$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["useSSR"])(initialI18nStore, initialLanguage); return (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["createElement"])(WrappedComponent, { ...rest }); } I18nextWithSSR.getInitialProps = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$context$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__$3c$locals$3e$__["composeInitialProps"])(WrappedComponent); I18nextWithSSR.displayName = `withI18nextSSR(${(0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["getDisplayName"])(WrappedComponent)})`; I18nextWithSSR.WrappedComponent = WrappedComponent; return I18nextWithSSR; }; }), "[project]/node_modules/react-i18next/dist/es/withTranslation.js [app-client] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "withTranslation", ()=>withTranslation ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/compiled/react/index.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$useTranslation$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/useTranslation.js [app-client] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/react-i18next/dist/es/utils.js [app-client] (ecmascript)"); ; ; ; const withTranslation = (ns, options = {})=>function Extend(WrappedComponent) { function I18nextWithTranslation({ forwardedRef, ...rest }) { const [t, i18n, ready] = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$useTranslation$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["useTranslation"])(ns, { ...rest, keyPrefix: options.keyPrefix }); const passDownProps = { ...rest, t, i18n, tReady: ready }; if (options.withRef && forwardedRef) { passDownProps.ref = forwardedRef; } else if (!options.withRef && forwardedRef) { passDownProps.forwardedRef = forwardedRef; } return (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["createElement"])(WrappedComponent, passDownProps); } I18nextWithTranslation.displayName = `withI18nextTranslation(${(0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$react$2d$i18next$2f$dist$2f$es$2f$utils$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["getDisplayName"])(WrappedComponent)})`; I18nextWithTranslation.WrappedComponent = WrappedComponent; const forwardRef = (props, ref)=>(0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["createElement"])(I18nextWithTranslation, Object.assign({}, props, { forwardedRef: ref })); return options.withRef ? (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["forwardRef"])(forwardRef) : I18nextWithTranslation; }; }), "[project]/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js [app-client] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$build$2f$polyfills$2f$process$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = /*#__PURE__*/ __turbopack_context__.i("[project]/node_modules/next/dist/build/polyfills/process.js [app-client] (ecmascript)"); /** * @license React * use-sync-external-store-shim.development.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ "use strict"; "production" !== ("TURBOPACK compile-time value", "development") && function() { function is(x, y) { return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y; } function useSyncExternalStore$2(subscribe, getSnapshot) { didWarnOld18Alpha || void 0 === React.startTransition || (didWarnOld18Alpha = !0, console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.")); var value = getSnapshot(); if (!didWarnUncachedGetSnapshot) { var cachedValue = getSnapshot(); objectIs(value, cachedValue) || (console.error("The result of getSnapshot should be cached to avoid an infinite loop"), didWarnUncachedGetSnapshot = !0); } cachedValue = useState({ inst: { value: value, getSnapshot: getSnapshot } }); var inst = cachedValue[0].inst, forceUpdate = cachedValue[1]; useLayoutEffect({ "useSyncExternalStore$2.useLayoutEffect": function() { inst.value = value; inst.getSnapshot = getSnapshot; checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst }); } }["useSyncExternalStore$2.useLayoutEffect"], [ subscribe, value, getSnapshot ]); useEffect({ "useSyncExternalStore$2.useEffect": function() { checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst }); return subscribe({ "useSyncExternalStore$2.useEffect": function() { checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst }); } }["useSyncExternalStore$2.useEffect"]); } }["useSyncExternalStore$2.useEffect"], [ subscribe ]); useDebugValue(value); return value; } function checkIfSnapshotChanged(inst) { var latestGetSnapshot = inst.getSnapshot; inst = inst.value; try { var nextValue = latestGetSnapshot(); return !objectIs(inst, nextValue); } catch (error) { return !0; } } function useSyncExternalStore$1(subscribe, getSnapshot) { return getSnapshot(); } "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); var React = __turbopack_context__.r("[project]/node_modules/next/dist/compiled/react/index.js [app-client] (ecmascript)"), objectIs = "function" === typeof Object.is ? Object.is : is, useState = React.useState, useEffect = React.useEffect, useLayoutEffect = React.useLayoutEffect, useDebugValue = React.useDebugValue, didWarnOld18Alpha = !1, didWarnUncachedGetSnapshot = !1, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2; exports.useSyncExternalStore = void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); }(); }), "[project]/node_modules/use-sync-external-store/shim/index.js [app-client] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$build$2f$polyfills$2f$process$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = /*#__PURE__*/ __turbopack_context__.i("[project]/node_modules/next/dist/build/polyfills/process.js [app-client] (ecmascript)"); 'use strict'; if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable ; else { module.exports = __turbopack_context__.r("[project]/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js [app-client] (ecmascript)"); } }), ]); //# sourceMappingURL=node_modules_00ww-6v._.js.map