@wix/blog 1.0.715 → 1.0.716

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/_sdk-exports/context-blog-feed/runtime.d.ts +7 -0
  2. package/_sdk-exports/context-blog-feed/runtime.js +2 -2
  3. package/_sdk-exports/context-post-by-id/runtime.js +4 -4
  4. package/_sdk-exports/context-post-by-slug/runtime.js +2 -2
  5. package/_sdk-exports/context-post-list-item/runtime.d.ts +8 -3
  6. package/_sdk-exports/context-post-list-item/runtime.js +4 -4
  7. package/_sdk-exports/context-related-posts/runtime.d.ts +7 -0
  8. package/_sdk-exports/context-related-posts/runtime.js +2 -2
  9. package/build/cjs/context-blog-feed.d.ts +7 -0
  10. package/build/cjs/context-blog-feed.js +4 -4
  11. package/build/cjs/context-blog-feed.js.map +1 -1
  12. package/build/cjs/context-post-by-id.js +916 -893
  13. package/build/cjs/context-post-by-id.js.map +1 -1
  14. package/build/cjs/context-post-by-slug.js +145 -122
  15. package/build/cjs/context-post-by-slug.js.map +1 -1
  16. package/build/cjs/context-post-list-item.d.ts +8 -3
  17. package/build/cjs/context-post-list-item.js +896 -873
  18. package/build/cjs/context-post-list-item.js.map +1 -1
  19. package/build/cjs/context-related-posts.d.ts +7 -0
  20. package/build/cjs/context-related-posts.js +4 -4
  21. package/build/cjs/context-related-posts.js.map +1 -1
  22. package/build/es/context-blog-feed.d.mts +7 -0
  23. package/build/es/context-blog-feed.mjs +4 -4
  24. package/build/es/context-blog-feed.mjs.map +1 -1
  25. package/build/es/context-post-by-id.mjs +916 -893
  26. package/build/es/context-post-by-id.mjs.map +1 -1
  27. package/build/es/context-post-by-slug.mjs +146 -123
  28. package/build/es/context-post-by-slug.mjs.map +1 -1
  29. package/build/es/context-post-list-item.d.mts +8 -3
  30. package/build/es/context-post-list-item.mjs +896 -873
  31. package/build/es/context-post-list-item.mjs.map +1 -1
  32. package/build/es/context-related-posts.d.mts +7 -0
  33. package/build/es/context-related-posts.mjs +4 -4
  34. package/build/es/context-related-posts.mjs.map +1 -1
  35. package/build/internal/cjs/context-blog-feed.d.ts +7 -0
  36. package/build/internal/cjs/context-post-list-item.d.ts +8 -3
  37. package/build/internal/cjs/context-related-posts.d.ts +7 -0
  38. package/build/internal/es/context-blog-feed.d.mts +7 -0
  39. package/build/internal/es/context-post-list-item.d.mts +8 -3
  40. package/build/internal/es/context-related-posts.d.mts +7 -0
  41. package/package.json +2 -2
@@ -1,5 +1,5 @@
1
- import e from"@wix/blog/post-context-provider";import{createContext as t,createElement as n,startTransition as r,useCallback as i,useContext as a,useEffect as o,useMemo as s,useRef as c,useState as l}from"react";import{useService as u}from"@wix/services-manager-react";import{Fragment as d,jsx as f}from"react/jsx-runtime";var p=Object.defineProperty,m=(e,t)=>{let n={};for(var r in e)p(n,r,{get:e[r],enumerable:!0});return t||p(n,Symbol.toStringTag,{value:`Module`}),n},h={};function g(e,t=!1,n=e=>e){return()=>({__type:`event-definition`,type:e,isDomainEvent:t,transformations:n})}var _=e=>{switch(e){case`get`:case`GET`:return`GET`;case`post`:case`POST`:return`POST`;case`put`:case`PUT`:return`PUT`;case`delete`:case`DELETE`:return`DELETE`;case`patch`:case`PATCH`:return`PATCH`;case`head`:case`HEAD`:return`HEAD`;case`options`:case`OPTIONS`:return`OPTIONS`;default:throw Error(`Unknown method: ${e}`)}},v=e=>t=>async n=>{let r,i=t=>{if(r=e(n)(t),r.url===void 0)throw Error(`Url was not successfully created for this request, please reach out to support channels for assistance.`);let{method:i,url:a,params:o}=r;return{...r,method:_(i),url:a,data:r.data,params:o}};try{let e=await t.request(i);if(r===void 0)throw Error(`Request options were not created for this request, please reach out to support channels for assistance.`);let n=Array.isArray(r.transformResponse)?r.transformResponse:[r.transformResponse],a=e.data;return n.forEach(t=>{t&&(a=t(e.data,e.headers))}),a}catch(e){throw typeof e==`object`&&e&&`response`in e&&typeof e.response==`object`&&e.response!==null&&`data`in e.response?e.response.data:e}},y=e=>e.__isAmbassador?!0:!!e().__isAmbassador,b=`__metadata`,x=`edge.wixapis.com`,S=class extends Error{message;response;constructor(e,t){super(e),this.message=e,this.response=t}async details(){let e=await this.response.json();return C(this.response.status,e?.message,e?.details,{requestId:this.response.headers.get(`X-Wix-Request-Id`),details:e})}},C=(e,t,n,r)=>({details:{...!n?.validationError&&{applicationError:{description:t,code:e,data:r}},...n},message:t,requestId:r?.requestId}),ee=e=>e?.method&&[`post`,`put`,`patch`].includes(e.method.toLocaleLowerCase())&&e.body?{"Content-Type":`application/json`}:{},w=e=>e&&typeof e==`object`&&!Array.isArray(e),T=e=>e.__type===`host`;function te(e,t){return e.create(t)}var ne=`x-wix-bi-gateway`;function re(e,t,n){return{[ne]:ie({environment:`js-sdk${n?`-${n}`:``}`,"package-name":e.packageName??t?.PACKAGE_NAME,"method-fqn":e.methodFqn,entity:e.entityFqdn})}}function ie(e){return Object.entries(e).filter(([e,t])=>!!t).map(([e,t])=>`${e}=${t}`).join(`,`)}function ae(e){let t=globalThis.__wix_context__,n={client:h.client,elevatedClient:h.elevatedClient},r;globalThis.__wix_context__=void 0,h.client=void 0,h.elevatedClient=void 0,typeof $wixContext<`u`&&(r={client:$wixContext?.client,elevatedClient:$wixContext?.elevatedClient},delete $wixContext.client,delete $wixContext.elevatedClient);try{return e()}finally{globalThis.__wix_context__=t,h.client=n.client,h.elevatedClient=n.elevatedClient,typeof $wixContext<`u`&&($wixContext.client=r.client,$wixContext.elevatedClient=r.elevatedClient)}}var oe={id:`_id`,createdDate:`_createdDate`,updatedDate:`_updatedDate`};function se(e){return fe(e).map(e=>e.toLocaleUpperCase()).join(`_`)}var ce=/([\p{Ll}\d])(\p{Lu})/gu,le=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,ue=`$1\0$2`,de=/[^\p{L}\d]+/giu;function fe(e){let t=e.trim();t=t.replace(ce,ue).replace(le,ue),t=t.replace(de,`\0`);let n=0,r=t.length;for(;t.charAt(n)===`\0`;)n++;if(n===r)return[];for(;t.charAt(r-1)===`\0`;)r--;return t.slice(n,r).split(/\0/g)}var pe=e=>`validationError`in(e.response?.data?.details??{}),me=e=>`applicationError`in(e.response?.data?.details??{}),he=e=>(e.response?.status??-1)>=400&&(e.response?.status??-1)<500;function ge(e,t={explicitPathsToArguments:{},spreadPathsToArguments:{},singleArgumentUnchanged:!1},n=[]){if(typeof e!=`object`||!e)throw e;if(pe(e))return _e(e,t,n);if(me(e))return ve(e);if(he(e)){let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i={applicationError:{description:n,code:se(n),data:{}},requestId:e.requestId};return E(e,{message:JSON.stringify({message:r,details:i},null,2),extraProperties:{details:i,status:t}})}return ye(e)}var _e=(e,t,n)=>{let r=e.response?.data,i=e.requestId,{fieldViolations:a}=r.details.validationError,o=be(t,a,n)?.sort((e,t)=>e.field<t.field?-1:1),s=`INVALID_ARGUMENT: ${o?.map(({field:e,description:t})=>`"${e}" ${t}`)?.join(`, `)}`,c={validationError:{fieldViolations:o},requestId:i};return E(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:e.response?.status,requestId:i}})},E=(e,{message:t,extraProperties:n})=>Object.assign(e,{...n,message:t}),ve=e=>{let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i=e.response?.data?.details?.applicationError?.description??n,a=e.response?.data?.details?.applicationError?.code??se(n),o=e.response?.data?.details?.applicationError?.data??{},s=r===i?r:`${r}: ${i}`,c={applicationError:{description:i,code:a,data:o},requestId:e.requestId};return E(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:t,requestId:e.requestId}})},ye=e=>E(e,{message:e.requestId?`System error occurred, request-id: ${e.requestId}`:`System error occurred: ${JSON.stringify(e)}`,extraProperties:{requestId:e.requestId,status:e.response?.status,code:se(e.response?.statusText??`UNKNOWN`),...!e.response&&{runtimeError:e}}}),be=({spreadPathsToArguments:e,explicitPathsToArguments:t,singleArgumentUnchanged:n},r,i)=>{let a={...e,...t},o=Object.keys(a);return r?.filter(e=>!r.some(t=>t.field.length>e.field.length&&t.field.startsWith(e.field)&&o.includes(t.field))).map(e=>{let r=t[e.field];if(r)return{...e,field:xe(r,i)};let s=o?.sort((e,t)=>t.length-e.length)?.find(t=>e.field.startsWith(t));if(s){let t=a[s];if(t)return{...e,field:e.field.replace(s,xe(t,i))}}return n?{...e,field:`${i[0]}.${e.field}`}:e})},xe=(e,t)=>{let n=Se(e);return n==null?e:e.replace(`$[${n}]`,t[n])},Se=e=>{let t=e.match(/\$\[(?<argIndex>\d+)\]/);return t&&t.groups&&Number(t.groups.argIndex)};function Ce(e,t,n,r,i,a,o,s,c,l,u){return ae(()=>e({request:async e=>{let i=e({host:s?.HTTPHost||`www.wixapis.com`}),a=i;a.method===`GET`&&a.fallback?.length&&(a.params?.toString().length??0)>4e3&&(a=i.fallback[0]);let o=s?.HTTPHost??`www.wixapis.com`,u=`https://${l?x:o}${a.url}`;a.params&&a.params.toString()&&(u+=`?${a.params.toString()}`);try{let e=re(i,t,c),o={method:a.method,...a.data&&{body:JSON.stringify(a.data)},headers:{...e}},s=await n(u,o);if(s.status!==200){let e=null;try{e=await s.json()}catch{}let t=Te(s.status,e?.message??s.statusText,e?.details,{requestId:s.headers.get(`X-Wix-Request-Id`),details:e}),n=ge(t);throw r?.handleError(n,{requestOptions:{url:a.url,method:a.method,entityFqdn:i.entityFqdn,methodFqn:i.methodFqn}}),t}let l=await s.json();return{data:a.migrationOptions?.optInTransformResponse&&a.transformResponse?Array.isArray(a.transformResponse)?a.transformResponse[0](l):a.transformResponse(l):l,headers:s.headers,status:s.status,statusText:s.statusText}}catch(e){throw e.message?.includes(`fetch is not defined`)&&console.error(`Node.js v18+ is required`),e}},fetchWithAuth:n,wixAPIFetch:i,getActiveToken:a,getAuthHeaders:o},{validateRequestSchema:u}))}var we=class extends Error{response;requestId;constructor(e){super(),this.response=e.response,this.requestId=e.requestId}},Te=(e,t,n,r)=>new we({response:{data:{details:{...!n?.validationError&&{applicationError:{description:t,code:e,data:r}},...n},message:t},status:e},requestId:r?.requestId}),Ee=`.`;function De(e,t,n){if(e==null)throw Error(`Cannot set value on null or undefined`);let r=Oe(t),i=e;for(let e=0;e<r.length;e++){let t=r[e];if(e===r.length-1){i[t]=n;break}let a=r[e+1];(!(t in i)||i[t]==null||typeof i[t]!=`object`||i[t]===null)&&(i[t]=typeof a==`number`?[]:{}),i=i[t]}return e}function Oe(e){return Array.isArray(e)?e:e.split(Ee).map(e=>ke(e)?Number(e):e)}function ke(e){return/^\d+$/.test(e)}function Ae(e){let t={};for(let[n,r]of Object.entries(e))je(n)||De(t,Oe(n),r);return t}function je(e){return e===`__proto__`||e===`constructor`||e===`prototype`}var Me=class{BRACKET_PATTERN=/\[(\d+)\]/g;NUMERIC_PATTERN=/^\d+$/;ESCAPED_DOT_PATTERN=/\\\./g;ESCAPED_LEFT_BRACKET_PATTERN=/\\\[/g;ESCAPED_RIGHT_BRACKET_PATTERN=/\\\]/g;SPLIT_PATTERN=/\.|\[(\d+)\]/g;DOT_BEFORE_BRACKET_PATTERN=/\.\[/g;ESCAPED_DOT_PLACEHOLDER=`__DOT__`;ESCAPED_RIGHT_BRACKET_PLACEHOLDER=`__RB__`;ESCAPED_LEFT_BRACKET_PLACEHOLDER=`__LB__`;modifiedFields;cleanedModifiedFields;constructor(e){this.modifiedFields=e}replaceEscapedCharacters(e){return e.replace(this.ESCAPED_DOT_PATTERN,this.ESCAPED_DOT_PLACEHOLDER).replace(this.ESCAPED_LEFT_BRACKET_PATTERN,this.ESCAPED_LEFT_BRACKET_PLACEHOLDER).replace(this.ESCAPED_RIGHT_BRACKET_PATTERN,this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER)}restoreEscapedCharacters(e){return e.replace(this.ESCAPED_DOT_PLACEHOLDER,`\\.`).replace(this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER,`\\]`).replace(this.ESCAPED_LEFT_BRACKET_PLACEHOLDER,`\\[`)}unflatten(){return this.cleanedModifiedFields=Object.fromEntries(Object.entries(this.modifiedFields).map(([e,t])=>[this.replaceEscapedCharacters(this.bracketToDotNotation(e)),t])),Ae(this.cleanedModifiedFields)}flatten(e){let t={};for(let n of Object.keys(this.cleanedModifiedFields)){let r=this.splitPath(n),i=this.navigatePath(e,r);t={...t,...i}}return Object.fromEntries(Object.entries(t).map(([e,t])=>[this.restoreEscapedCharacters(e),t]))}splitPath(e){let t=[],n=0,r=Array.from(e.matchAll(this.SPLIT_PATTERN));for(let i of r)i.index>n&&t.push(e.substring(n,i.index)),i[1]&&t.push(i[1]),n=i.index+i[0].length;return n<e.length&&t.push(e.substring(n)),t}navigatePath(e,t){let n=e,r=[],i=e=>{if(!Array.isArray(n))throw Error(`Expected array at path ${this.buildPathString(r)}, but got ${typeof n}`);r.push(`[${e}]`),n=n[parseInt(e,10)]},a=(e,t)=>{let i=e in oe?oe[e]:void 0;if(i&&i in t){r.push(i),n=t[i];return}let a=Ie(e);if(a&&a in t)r.push(a),n=t[a];else throw Error(`Cannot find key '${e}' or its transformations at path ${this.buildPathString(r)}`)},o=(e,t)=>{r.push(e),n=t[e]};for(let e of t){if(this.NUMERIC_PATTERN.test(e)){i(e);continue}if(typeof n!=`object`||!n)throw Error(`Cannot access property '${e}' on ${typeof n} at path ${this.buildPathString(r)}`);let t=n;e in n?o(e,t):a(e,t)}return{[this.buildPathString(r)]:n}}buildPathString(e){return e.join(`.`).replace(this.DOT_BEFORE_BRACKET_PATTERN,`[`)}bracketToDotNotation(e){return e.replace(this.BRACKET_PATTERN,(t,n,r)=>r>0&&e[r-1]===`\\`?t:`.`+n)}};function Ne(e,t){let n=e?.modifiedFields;if(!n)return null;let r=Pe(n);if(!r)return null;let{unflattenedModifiedFields:i,modifiedFieldsManipulator:a}=r;e={...e,modifiedFields:i};let o=t(e),s=o?.modifiedFields;if(!s)return null;let c=Fe(s,a);return c===null?null:(o.modifiedFields=c,o)}function Pe(e){if(typeof e==`object`&&e&&!Array.isArray(e))try{let t=new Me(e);return{unflattenedModifiedFields:t.unflatten(),modifiedFieldsManipulator:t}}catch{return null}return null}function Fe(e,t){if(typeof e==`object`&&e&&!Array.isArray(e))try{return t.flatten(e)}catch{return null}return null}function Ie(e){return e.replace(/[-_\s]+(.)?/g,(e,t)=>t?t.toUpperCase():``).replace(/^./,e=>e.toLowerCase())}function Le(){return{emit(e,...t){for(let n=0,r=this.events[e]||[],i=r.length;n<i;n++)r[n](...t)},events:{},on(e,t){return(this.events[e]||=[]).push(t),()=>{this.events[e]=this.events[e]?.filter(e=>t!==e)}}}}var Re=e=>e.__type===`event-definition`;function ze(e,t,n,r){let i;if(e.isDomainEvent){let{deletedEvent:e,actionEvent:t,createdEvent:a,updatedEvent:o,...s}=n,c={...r,...s};i=e?e?.deletedEntity?{entity:e?.deletedEntity,metadata:c}:{metadata:c}:t?{data:t.body,metadata:c}:o?{entity:o.currentEntity,metadata:c,...o.modifiedFields?{modifiedFields:o.modifiedFields}:{}}:{entity:a?.entity,metadata:c}}else i={data:n,metadata:r};let a=e.transformations??(e=>e),o=i,s=i;if(s.modifiedFields){let e=s.modifiedFields;if(typeof e==`object`&&e&&!Array.isArray(e)){o=structuredClone(i);let e=Ne(s,a);if(e)return t(e)}}return t(a(o))}function Be(e){let t=new Map,n=Le();return{initModule(e){return r=>{let i=t.get(e.type)??[];i.push({eventDefinition:e,handler:r}),t.set(e.type,i),n.emit(`registered`,e)}},client:{...n,getRegisteredEvents:()=>t,async process(e,n={expectedEvents:[]}){let{eventType:r,identity:i,instanceId:a,payload:o,accountInfo:s}=await this.parseJWT(e),c=[...n.expectedEvents,...Array.from(t.keys()).map(e=>({type:e}))];if(c.length>0&&!c.some(({type:e})=>e===r))throw Error(`Unexpected event type: ${r}. Expected one of: ${c.map(e=>e.type).join(`, `)}`);let l=t.get(r)??[];return await Promise.all(l.map(({eventDefinition:e,handler:t})=>ze(e,t,o,{instanceId:a,identity:i,accountInfo:s}))),{instanceId:a,eventType:r,payload:o,identity:i,accountInfo:s}},async processRequest(e,t){let n=await e.text();return this.process(n,t)},async parseJWT(t){let n=e();if(!n.decodeJWT)throw Error(`decodeJWT is not supported by the authentication strategy`);let{decoded:r,valid:i}=await n.decodeJWT(t);if(!i)throw Error(`JWT is not valid`);if(typeof r.data!=`string`)throw Error(`Unexpected type of JWT data: expected string, got ${typeof r.data}`);let a=JSON.parse(r.data),o=a.eventType,s=a.accountInfo,c=a.instanceId,l=a.identity?JSON.parse(a.identity):void 0;return{instanceId:c,eventType:o,payload:JSON.parse(a.data),identity:l,accountInfo:s}},async parseRequest(e){let t=await e.text();return this.parseJWT(t)},async executeHandlers(e){let n=Array.from(t.keys()).map(e=>({type:e}));if(n.length>0&&!n.some(({type:t})=>t===e.eventType))throw Error(`Unexpected event type: ${e.eventType}. Expected one of: ${n.map(e=>e.type).join(`, `)}`);let r=t.get(e.eventType)??[];await Promise.all(r.map(({eventDefinition:t,handler:n})=>ze(t,n,e.payload,{instanceId:e.instanceId,identity:e.identity})))},apps:{AppInstalled:g(`AppInstalled`)(),AppRemoved:g(`AppRemoved`)()}}}}var Ve=e=>e.__type===`service-plugin-definition`;function He(e){let t=new Map,n=Le();return{initModule(e){return r=>{let i=t.get(e.componentType.toLowerCase())??[];i.push({servicePluginDefinition:e,implementation:r}),t.set(e.componentType.toLowerCase(),i),n.emit(`registered`,e)}},client:{...n,getRegisteredServicePlugins:()=>t,async parseJWT(t){let n=e();if(!n.decodeJWT)throw Error(`decodeJWT is not supported by the authentication strategy`);let{decoded:r,valid:i}=await n.decodeJWT(t,!0);if(!i)throw Error(`JWT is not valid`);if(typeof r.data!=`object`||r.data===null||!(`metadata`in r.data)||typeof r.data.metadata!=`object`||r.data.metadata===null||!(`appExtensionType`in r.data.metadata)||typeof r.data.metadata.appExtensionType!=`string`)throw Error(`Unexpected JWT data: expected object with metadata.appExtensionType string`);return r.data},async process(e){let t=await this.parseJWT(e.body);return this.executeHandler(t,e.url)},async parseRequest(e){let t=await e.text();return this.parseJWT(t)},async processRequest(e){let t=await this.parseRequest(e);return this.processParsedRequest(t,e.url)},async processParsedRequest(e,t){try{let n=await this.executeHandler(e,t);return Response.json(n)}catch(e){if(e.errorType===`SPI`&&e.applicationCode&&e.httpCode)return Response.json({applicationError:{code:e.applicationCode,data:e.data}},{status:e.httpCode});throw e}},async executeHandler(e,n){let r=e.metadata.appExtensionType.toLowerCase(),i=t.get(r)??[];if(i.length===0)throw Error(`No service plugin implementations found for component type ${r}`);if(i.length>1)throw Error(`Multiple service plugin implementations found for component type ${r}. This is currently not supported`);let{implementation:a,servicePluginDefinition:o}=i[0],s=o.methods.find(e=>n.endsWith(e.primaryHttpMappingPath));if(!s)throw Error(`Unexpect request: request url did not match any method: `+n);let c=a[s.name];if(!c)throw Error(`Got request for service plugin method ${s.name} but no implementation was provided. Available methods: ${Object.keys(a).join(`, `)}`);return s.transformations.toREST(await c(s.transformations.fromREST(e)))}}}}var D=`X-Wix-Consistent`;function Ue(e){let t=e.headers||{Authorization:``},n={getAuthHeaders:e=>Promise.resolve({headers:{}})},r=e.auth,i=typeof r==`function`?r:()=>r??n,a=()=>i().getAuthHeaders(e.host),o=()=>e.fetch??fetch,s=async(n,r)=>{let i=o(),s=await a(),c={...r?.headers??{},...s.headers,...e.host?.essentials?.passThroughHeaders,...t[`X-Wix-Consistent`]?{[D]:t[D]}:{}},l=e.host?.getErrorHandler?.();try{if(typeof n==`string`||n instanceof URL){let e=await i(n,{...r,headers:c});l?.handleError(e,{requestOptions:{url:n.toString(),method:r?.method}});let a=We(e);return a&&(t[D]=a),e}{for(let[e,t]of Object.entries(c))typeof t==`string`&&n.headers.set(e,t);let e=await i(n,r);l?.handleError(e,{requestOptions:{url:n.url,method:r?.method}});let a=We(e);return a&&(t[D]=a),e}}catch(e){throw l?.handleError(e,{requestOptions:{url:typeof n==`string`||n instanceof URL?n.toString():n.url,method:r?.method}}),e}},{client:c,initModule:l}=He(i),{client:u,initModule:d}=Be(i),f=async(n,r)=>{let i=o(),s=await a(),c=ee(r),l=await i(n,{...r,headers:{...c,...t,...s?.headers,...r?.headers,...e.host?.essentials?.passThroughHeaders,...t[`X-Wix-Consistent`]?{[D]:t[D]}:{}}}),u=We(l);return u&&(t[D]=u),l},p=(t,n)=>{if(Re(t))return d(t);if(Ve(t))return l(t);if(T(t)&&e.host)return te(t,e.host);if(typeof t==`function`){if(`__type`in t&&t.__type===`wix_spi_error`)return t;let r=e.host?.apiBaseUrl??`www.wixapis.com`,o=e.useCDN===void 0?i().shouldUseCDN:e.useCDN;return Ce(ae(()=>y(t))?v(t):t,n??{},f,e.host?.getErrorHandler?.(),(e,t)=>{let n=new URL(e,`https://${r}`);return n.host=r,n.protocol=`https`,f(n.toString(),t)},i().getActiveToken,async()=>a(),{HTTPHost:r},e.host?.name,o,e.validateRequestSchema)}return w(t)?Object.fromEntries(Object.entries(t).map(([e,n])=>[e,p(n,t[b])])):t},m=e=>{for(let n in e)t[n]=e[n]};return{...e.modules?p(e.modules):{},get auth(){let t=i();return t.getAuthHeaders=t.getAuthHeaders.bind(void 0,e.host),t},setHeaders:m,use:p,enableContext(e,t={elevated:!1}){e===`global`?globalThis.__wix_context__==null?t.elevated?globalThis.__wix_context__={elevatedClient:this}:globalThis.__wix_context__={client:this}:t.elevated?globalThis.__wix_context__.elevatedClient=this:globalThis.__wix_context__.client=this:t.elevated?h.elevatedClient=this:h.client=this},fetch:(t,n)=>{let r=e.host?.apiBaseUrl??`www.wixapis.com`,i=new URL(t,`https://${r}`);return i.host=r,i.protocol=`https`,f(i.toString(),n)},fetchWithAuth:s,async graphql(t,n,r={apiVersion:`alpha`}){let i=e?.host?.apiBaseUrl??`www.wixapis.com`,a=await f(`https://${i}/graphql/${r.apiVersion}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({query:t,variables:n})});if(a.status!==200)throw new S(`GraphQL request failed with status ${a.status}`,a);let{data:o,errors:s}=await a.json();return{data:o??{},errors:s}},webhooks:u,servicePlugins:c}}function We(e){return e.headers?.get(`X-Wix-Consistent`)??e.headers?.get(`x-wix-consistent`)}var Ge={_id:`id`,_createdDate:`createdDate`,_updatedDate:`updatedDate`},Ke={id:`_id`,createdDate:`_createdDate`,updatedDate:`_updatedDate`},qe=`items`,Je=`pagingMetadata`,Ye=Ge;function Xe(e,t){return e?.split(`.`).map(e=>t?.[e]??e).join(`.`)}var Ze=`sort.fieldName`;function Qe(e,t,n){return(e===Ze||e.endsWith(`.${Ze}`))&&typeof t==`string`?Xe(t,n):t}function $e(e,t,n){let r=e=>n.includes(e),i=(e,n)=>{if(Array.isArray(e))e.forEach(e=>{i(e,n)});else if(typeof e==`object`&&e){let a=e;Object.keys(a).forEach(e=>{let o=n===``?e:`${n}.${e}`;if(r(o))return;let s=et(e,t);s!==e&&!(s in a)&&(a[s]=a[e],delete a[e]),a[s]=Qe(o,a[s],t),i(a[s],o)})}};return i(e,``),e}function et(e,t){let n;return n=e.includes(`.`)?e.split(`.`).map(e=>t[e]??e).join(`.`):t[e]??e,n}function O(e,t=[]){return $e(e,Ge,t)}function k(e,t=[]){return $e(e,Ke,t)}function tt(e){return e?.toISOString()}function nt(e){return e?new Date(e):void 0}var rt=new WeakMap;function it(){return{leaves:void 0,fields:void 0,mapFields:void 0,anyField:void 0}}function at(e,t){let n=e.get(t);return n||(n=it(),e.set(t,n)),n}function ot(e,t){return t===`*`?(e.anyField??=it(),e.anyField):t.endsWith(`{}`)?(e.mapFields??=new Map,at(e.mapFields,t.slice(0,-2))):(e.fields??=new Map,at(e.fields,t))}function st(e){let t=it();for(let n of e){let e=n.path.split(`.`).reduce(ot,t);e.leaves??=[],e.leaves.push(n)}return t}function ct(e){let t=rt.get(e);return t||(t=st(e),rt.set(e,t)),t}function A(e){return typeof e==`object`&&!!e}function lt(e,{isRepeated:t,isMap:n},r){return t?Array.isArray(e)?e.map(r):e:n?A(e)?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,r(t)])):e:r(e)}function j(e,t,n){A(e)&&ft(e,t,n)}function ut(e,t,n){for(let[r,i]of t){if(!(r in e))continue;if(i.leaves)for(let t of i.leaves)e[r]=lt(e[r],t,n);let t=e[r];Array.isArray(t)?t.forEach(e=>j(e,i,n)):j(t,i,n)}}function dt(e,t,n){for(let[r,i]of t){let t=e[r];A(t)&&Object.values(t).forEach(e=>j(e,i,n))}}function ft(e,{fields:t,mapFields:n,anyField:r},i){t&&ut(e,t,i),n&&dt(e,n,i),r&&Object.values(e).forEach(e=>j(e,r,i))}function M(e,t){if(!A(e))return e;for(let{paths:n,transformFn:r}of t)ft(e,ct(n),r);return e}function pt(e){return vt(e).map(e=>e.toLocaleUpperCase()).join(`_`)}var mt=/([\p{Ll}\d])(\p{Lu})/gu,ht=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,gt=`$1\0$2`,_t=/[^\p{L}\d]+/giu;function vt(e){let t=e.trim();t=t.replace(mt,gt).replace(ht,gt),t=t.replace(_t,`\0`);let n=0,r=t.length;for(;t.charAt(n)===`\0`;)n++;if(n===r)return[];for(;t.charAt(r-1)===`\0`;)r--;return t.slice(n,r).split(/\0/g)}var yt=e=>`validationError`in(e.response?.data?.details??{}),bt=e=>`applicationError`in(e.response?.data?.details??{}),xt=e=>(e.response?.status??-1)>=400&&(e.response?.status??-1)<500;function N(e,t={explicitPathsToArguments:{},spreadPathsToArguments:{},singleArgumentUnchanged:!1},n=[]){if(typeof e!=`object`||!e)throw e;if(yt(e))return St(e,t,n);if(bt(e))return wt(e);if(xt(e)){let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i={applicationError:{description:n,code:pt(n),data:{}},requestId:e.requestId};return Ct(e,{message:JSON.stringify({message:r,details:i},null,2),extraProperties:{details:i,status:t}})}return Tt(e)}var St=(e,t,n)=>{let r=e.response?.data,i=e.requestId,{fieldViolations:a}=r.details.validationError,o=Et(t,a,n)?.sort((e,t)=>e.field<t.field?-1:1),s=`INVALID_ARGUMENT: ${o?.map(({field:e,description:t})=>`"${e}" ${t}`)?.join(`, `)}`,c={validationError:{fieldViolations:o},requestId:i};return Ct(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:e.response?.status,requestId:i}})},Ct=(e,{message:t,extraProperties:n})=>Object.assign(e,{...n,message:t}),wt=e=>{let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i=e.response?.data?.details?.applicationError?.description??n,a=e.response?.data?.details?.applicationError?.code??pt(n),o=e.response?.data?.details?.applicationError?.data??{},s=r===i?r:`${r}: ${i}`,c={applicationError:{description:i,code:a,data:o},requestId:e.requestId};return Ct(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:t,requestId:e.requestId}})},Tt=e=>Ct(e,{message:e.requestId?`System error occurred, request-id: ${e.requestId}`:`System error occurred: ${JSON.stringify(e)}`,extraProperties:{requestId:e.requestId,status:e.response?.status,code:pt(e.response?.statusText??`UNKNOWN`),...!e.response&&{runtimeError:e}}}),Et=({spreadPathsToArguments:e,explicitPathsToArguments:t,singleArgumentUnchanged:n},r,i)=>{let a={...e,...t},o=Object.keys(a);return r?.filter(e=>!r.some(t=>t.field.length>e.field.length&&t.field.startsWith(e.field)&&o.includes(t.field))).map(e=>{let r=t[e.field];if(r)return{...e,field:Dt(r,i)};let s=o?.sort((e,t)=>t.length-e.length)?.find(t=>e.field.startsWith(t));if(s){let t=a[s];if(t)return{...e,field:e.field.replace(s,Dt(t,i))}}return n?{...e,field:`${i[0]}.${e.field}`}:e})},Dt=(e,t)=>{let n=Ot(e);return n==null?e:e.replace(`$[${n}]`,t[n])},Ot=e=>{let t=e.match(/\$\[(?<argIndex>\d+)\]/);return t&&t.groups&&Number(t.groups.argIndex)};function kt(){let e=typeof $wixContext<`u`&&$wixContext.initWixModules?$wixContext.initWixModules:globalThis.__wix_context__!==void 0&&globalThis.__wix_context__.initWixModules?globalThis.__wix_context__.initWixModules:void 0;if(e)return{initWixModules(t,n){return At(()=>e(t,n))},fetchWithAuth(){throw Error(`fetchWithAuth is not available in this context`)},graphql(){throw Error(`graphql is not available in this context`)}};let t=typeof $wixContext<`u`?$wixContext.client:h.client===void 0?globalThis.__wix_context__===void 0?void 0:globalThis.__wix_context__.client:h.client,n=typeof $wixContext<`u`?$wixContext.elevatedClient:h.elevatedClient===void 0?globalThis.__wix_context__===void 0?void 0:globalThis.__wix_context__.elevatedClient:h.elevatedClient;if(t||n)return{initWixModules(e,r){if(r){if(!n)throw Error(`An elevated client is required to use elevated modules. Make sure to initialize the Wix context with an elevated client before using elevated SDK modules`);return At(()=>n.use(e))}if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return At(()=>t.use(e))},fetchWithAuth:(e,n)=>{if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return t.fetchWithAuth(e,n)},getAuth(){if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return t.auth},async graphql(e,n,r){if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return t.graphql(e,n,r)}}}function At(e){let t=globalThis.__wix_context__,n={client:h.client,elevatedClient:h.elevatedClient},r;globalThis.__wix_context__=void 0,h.client=void 0,h.elevatedClient=void 0,typeof $wixContext<`u`&&(r={client:$wixContext?.client,elevatedClient:$wixContext?.elevatedClient},delete $wixContext.client,delete $wixContext.elevatedClient);try{return e()}finally{globalThis.__wix_context__=t,h.client=n.client,h.elevatedClient=n.elevatedClient,typeof $wixContext<`u`&&($wixContext.client=r.client,$wixContext.elevatedClient=r.elevatedClient)}}function jt(e,t){return((...n)=>{let r=kt();return r?r.initWixModules(e,t).apply(void 0,n):e.apply(void 0,n)})}function Mt(e,t=!1){return jt(e,t)}function Nt(e,t){let n=Ft(e),r=Object.entries(n).some(([e,t])=>e.includes(`.`)||Array.isArray(t)&&t.some(e=>typeof e==`object`));return t&&r?new URLSearchParams({".r":Lt(JSON.stringify(e))}):Object.entries(n).reduce((e,[t,n])=>((Array.isArray(n)?n:[n]).forEach(r=>{r==null||Array.isArray(n)&&typeof r==`object`||e.append(t,r)}),e),new URLSearchParams)}function Pt(e){let t=Xt(Jt(e.host),e.domainToMappings);return on(nn(e.protoPath,e.data||{}),t)}function Ft(e,t=``){let n={};return Object.entries(e).forEach(([e,r])=>{let i=typeof r==`object`&&!!r&&!Array.isArray(r),a=It(t,e);if(i){let e=Ft(r,a);Object.assign(n,e)}else n[a]=r}),n}function It(e,t){return`${e}${e?`.`:``}${t}`}var Lt=e=>{let t=new TextEncoder().encode(e);return(typeof btoa<`u`?btoa(String.fromCodePoint(...t)):Buffer.from(e,`utf-8`).toString(`base64`)).replace(/=/g,``).replace(/\+/g,`-`).replace(/\//g,`_`)},Rt=[`wix.com`,`editorx.com`],zt=`_`,Bt=`*.`,Vt=RegExp(`\\.(${Rt.join(`|`)})$`),Ht=[`42.wixprod.net`,`uw2-edt-1.wixprod.net`,`virginia-edt.wixprod.net`],Ut={"payments.base44.com":`manage.wix.com`,"create.editorx.com":`editor.editorx.com`},Wt=`dev.wix-code.com`,Gt=/{(.*)}/,Kt=RegExp(`\\.(${Ht.join(`|`)})$`),qt=RegExp(`.*\\.${Wt}$`);function Jt(e){return Yt(e).replace(Vt,`._base_domain_`).replace(Kt,`._api_base_domain_`).replace(qt,`*.dev.wix-code.com`)}function Yt(e){return Ut[e]??e}function Xt(e,t){let n=t[e];if(n)return n;let r=Zt(e,t)??Qt(e,t);if(!r){if(en(e)){let e=t[tn];if(e)return e}let n=t[zt];if(n)return n}return r??[]}function Zt(e,t){return Object.entries(t).find(([t])=>{let[,...n]=e.split(`.`);return n.join(`.`)===t})?.[1]}function Qt(e,t){let[n]=Object.entries(t).filter(([t])=>$t(e,t)).sort(([e],[t])=>t.length-e.length);if(!n)return;let[,r]=n;return r}function $t(e,t){if(!t.startsWith(Bt))return!1;let n=t.slice(1);return e.length>n.length&&e.endsWith(n)}function en(e){return!!e.match(/\._base_domain_$/)}var tn=`www._base_domain_`;function nn(e,t){return e.split(`/`).map(e=>rn(e,t)).join(`/`)}function rn(e,t){let n=e.match(Gt)||[],r=n[1];return r?an(t,r,e,e.replace(n[0],``)):e}function an(e,t,n,r){let i=e;for(let e of t.split(`.`)){if(!i)return n;i=i[e]}return`${i}${r}`}function on(e,t){let n=t?.find(t=>e.startsWith(t.destPath));return n?n.srcPath+e.slice(n.destPath.length):e}function sn(e){return e===`NaN`?NaN:e===`Infinity`?1/0:e===`-Infinity`?-1/0:e}var cn=`modulepreload`,ln=function(e,t){return new URL(e,t).href},un={},dn=function(e){return e.pathname.endsWith(`.css`)},fn=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},pn=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=ln(t,n);let r=s(t),i=dn(r);return fn(un,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:cn,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},mn=`x-wix-linguist`,hn=`00000000-0000-0000-0000-000000000000`,gn=`false`,_n=()=>{let e=bn(`language`),t=bn(`locale`);if(e)return{[mn]:[e,t||e,gn,hn].join(`|`)}};function vn(){let e=null,t=null;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var yn=()=>(typeof window<`u`?window.commonConfig:void 0)??globalThis.commonConfig,bn=e=>yn()?.[e],xn=({createHost:e})=>({__type:`host`,create:e=>({}),host:t=>{let{applicationId:n,componentId:r}=t??{},i=typeof window<`u`?window.wixEmbedsAPI:void 0,a=e(t),o=Cn();return{...a,apiBaseUrl:o,getMonitoringClient:i?.getMonitoringClientFunction?.(n,r),essentials:{language:bn(`language`),locale:bn(`locale`),get passThroughHeaders(){return _n()}}}},auth:e=>{let t=typeof window<`u`?window.wixEmbedsAPI:void 0;!e&&Sn()&&(e=t?.getAccessTokenFunction?.());let n=!1,{resolve:r,promise:i}=vn();return{getAuthHeaders:async()=>{if(!e&&n&&(e=await i),!e)throw Error(`Failed to resolve auth token`);return{headers:{Authorization:await e()}}},getAccessTokenInjector:()=>(n=!0,e=>{r(e)})}}});function Sn(){return typeof document<`u`&&document.currentScript?.tagName===`SCRIPT`}function Cn(){let e=(typeof window<`u`?window.wixEmbedsAPI:void 0)?.getExternalBaseUrl?.();if(!e)return;let t=new URL(e);return t?.pathname&&t.pathname!==`/`?`${t.hostname}${t.pathname}`:t.hostname}var wn=({clientSdk:e,applicationId:t})=>({invoke:async({namespace:n,method:r,args:i})=>{if(!e)throw Error(`Wix Site SDK only works in a Wix site environment. Learn more: https://dev.wix.com/docs/sdk/host-modules/site/introduction`);return e.invoke({namespace:n,method:r,args:i,applicationId:t,accessToken:`accessToken`})},getAccessToken:()=>{throw Error(`Not implemented`)},observeState:()=>({disconnect:()=>{}})}),Tn=xn({createHost:function(e){let t=(typeof $wixContext<`u`?$wixContext.clientSdk:void 0)??e?.clientSdk??(typeof window<`u`?window?.clientSdk:void 0),{applicationId:n}=e||{};if(!n)throw Error(`"createHost" was called without a required field "applicationId"`);return{channel:wn({clientSdk:t,applicationId:n}),close:()=>{}}}}),En=(e,t)=>{let n=Tn.host({applicationId:e,componentId:t}),r=Tn.auth();return Ue({auth:r,host:n}).enableContext(`module`),r.getAccessTokenInjector()},Dn=e=>En(`14bcded7-0066-7c35-14d7-466cb3f09103`,e),On={post:`post`,feed:`feed`,relatedPosts:`related-posts`,comments:`comments`,seo:`seo`,likes:`likes`},kn=(e,t)=>e&&typeof e[t]==`function`?e:null;function An(e,t,{feature:n,action:r,level:i=`error`,tags:a,contexts:o}){let s=kn(e,`captureException`);if(!s)return;let c=t instanceof Error?t:Error(String(t));s.captureException(c,{level:i,tags:{feature:n,action:r,...a},...o?{contexts:o}:{}})}function jn(e){return Object.keys(e).length===1&&`$and`in e&&Array.isArray(e.$and)}function Mn(e){return Object.keys(e).length===1&&`$or`in e&&Array.isArray(e.$or)}function Nn(e){return Object.keys(e).length===1&&`$not`in e&&typeof e.$not==`object`}function P(e,t){return e===void 0||Object.keys(e).length===0?t:t===void 0||Object.keys(t).length===0?e:{$and:[...jn(e)?e.$and:[e],...jn(t)?t.$and:[t]]}}function Pn(e,t){return e===void 0||Object.keys(e).length===0?t:t===void 0||Object.keys(t).length===0?e:{$or:[...Mn(e)?e.$or:[e],...Mn(t)?t.$or:[t]]}}function Fn(e){if(e!==void 0&&Object.keys(e).length!==0)return Nn(e)?e.$not:{$not:e}}var In=class{_items;_fetchNextPage;_fetchPrevPage;_originQuery;_limit;constructor({items:e,originQuery:t,fetchNextPage:n,fetchPrevPage:r,limit:i}){this._items=e,this._fetchNextPage=n,this._fetchPrevPage=r,this._originQuery=t,this._limit=i}get items(){return this._items}get length(){return this._items.length}get pageSize(){return this._limit}get query(){return this._originQuery}async next(){if(!this.hasNext())throw Error(`No next page to fetch`);return await this._fetchNextPage()}async prev(){if(!this.hasPrev())throw Error(`No previous page to fetch`);return await this._fetchPrevPage()}},Ln=class extends In{_nextCursor;_prevCursor;cursors;constructor({items:e,originQuery:t,fetchNextPage:n,fetchPrevPage:r,limit:i,nextCursor:a,prevCursor:o}){super({items:e,originQuery:t,fetchNextPage:n,fetchPrevPage:r,limit:i}),this._nextCursor=a,this._prevCursor=o,this.cursors={next:a,prev:o}}hasNext(){return!!this._nextCursor}hasPrev(){return!!this._prevCursor}},Rn=class extends In{_totalCount;_offset;_tooManyToCount;constructor({items:e,fetchNextPage:t,fetchPrevPage:n,offset:r,originQuery:i,limit:a,totalCount:o,tooManyToCount:s}){super({items:e,fetchNextPage:t,fetchPrevPage:n,originQuery:i,limit:a}),this._totalCount=o,this._offset=r,this._tooManyToCount=s}get currentPage(){return this._limit===0?void 0:Math.floor(this._offset/this._limit)}get totalPages(){return this._tooManyToCount||this._limit===0?void 0:Math.ceil(this._totalCount/this._limit)}get totalCount(){return this._tooManyToCount?void 0:this._totalCount}hasNext(){return this._limit!==0&&this.currentPage!==void 0&&this.totalPages!==void 0&&this.currentPage<this.totalPages-1}hasPrev(){return!!(this._limit!==0&&this.currentPage&&this.currentPage>0)}};function zn(e){let t=n=>({query:n,async find(){try{let r=e.requestTransformer(e.pagingMethod===`CURSOR`&&n.cursorPaging.cursor?{cursorPaging:n.cursorPaging}:n),i=await e.func(r),{[qe]:a,[Je]:o}=e.responseTransformer(i);if(e.pagingMethod===`OFFSET`){let e=n;return new Rn({items:a??[],fetchNextPage:()=>t({...e,paging:{offset:e.paging.offset+e.paging.limit,limit:e.paging.limit}}).find(),fetchPrevPage:()=>t({...n,paging:{offset:Math.max(e.paging.offset-e.paging.limit,0),limit:e.paging.limit}}).find(),offset:e.paging.offset,limit:e.paging.limit,totalCount:o?.total,tooManyToCount:o?.tooManyToCount,originQuery:this})}let s=n.cursorPaging;return new Ln({items:a??[],limit:s.limit,originQuery:this,fetchNextPage:()=>t({...n,cursorPaging:{cursor:o?.cursors?.next??void 0,limit:s.limit}}).find(),fetchPrevPage:()=>t({...n,cursorPaging:{cursor:o?.cursors?.prev??void 0,limit:s.limit}}).find(),prevCursor:o?.cursors?.prev??void 0,nextCursor:o?.cursors?.next??void 0})}catch(t){throw e.errorTransformer(t)}},skipTo(e){return t({...n,cursorPaging:{cursor:e,limit:n.cursorPaging.limit}})},eq(r,i){let a=i===void 0?null:i,o={[F(e.transformationPaths,r)]:a};return t({...n,filter:P(n.filter,o)})},ne(r,i){let a=i===void 0?null:i,o={[F(e.transformationPaths,r)]:{$ne:a}};return t({...n,filter:P(n.filter,o)})},ge(r,i){let a={[F(e.transformationPaths,r)]:{$gte:i}};return t({...n,filter:P(n.filter,a)})},gt(r,i){let a={[F(e.transformationPaths,r)]:{$gt:i}};return t({...n,filter:P(n.filter,a)})},le(r,i){let a={[F(e.transformationPaths,r)]:{$lte:i}};return t({...n,filter:P(n.filter,a)})},lt(r,i){let a={[F(e.transformationPaths,r)]:{$lt:i}};return t({...n,filter:P(n.filter,a)})},isNotEmpty(e){return this.ne(e,null)},isEmpty(e){return this.eq(e,null)},startsWith(r,i){let a={[F(e.transformationPaths,r)]:{$startsWith:i}};return t({...n,filter:P(n.filter,a)})},endsWith(r,i){let a={[F(e.transformationPaths,r)]:{$endsWith:i}};return t({...n,filter:P(n.filter,a)})},contains(r,i){let a={[F(e.transformationPaths,r)]:{$contains:i}};return t({...n,filter:P(n.filter,a)})},hasSome(r,...i){let a={[F(e.transformationPaths,r)]:{$hasSome:Array.isArray(i[0])?i[0]:i}};return t({...n,filter:P(n.filter,a)})},hasAll(r,...i){let a={[F(e.transformationPaths,r)]:{$hasAll:Array.isArray(i[0])?i[0]:i}};return t({...n,filter:P(n.filter,a)})},between(e,t,n){return this.ge(e,t).lt(e,n)},in(r,i){let a={[F(e.transformationPaths,r)]:{$in:i}};return t({...n,filter:P(n.filter,a)})},exists(r,i=!0){let a={[F(e.transformationPaths,r)]:{$exists:i}};return t({...n,filter:P(n.filter,a)})},or(e){return t({...n,filter:Pn(n.filter,e.query.filter)})},and(e){return t({...n,filter:P(n.filter,e.query.filter)})},not(e){return t({...n,filter:Fn(e.query.filter)})},ascending(...r){return t({...n,sort:[...n.sort??[],...r.map(t=>({fieldName:F(e.transformationPaths,t),order:`ASC`}))]})},descending(...r){return t({...n,sort:[...n.sort??[],...r.map(t=>({fieldName:F(e.transformationPaths,t),order:`DESC`}))]})},skip(e){return t({...n,paging:{offset:e,limit:`limit`in n.paging?n.paging.limit:50}})},limit(r){if(e.pagingMethod===`CURSOR`){let e=n;return t({...n,cursorPaging:{limit:r,cursor:`cursor`in e.cursorPaging?e.cursorPaging.cursor:void 0}})}let i=n;return t({...n,paging:{limit:r,offset:`offset`in i.paging?i.paging.offset:0}})}});return t({filter:{},...e.pagingMethod===`OFFSET`?{paging:{offset:0,limit:50}}:{cursorPaging:{limit:50}}})}function F(e,t){let n=Object.entries(e).find(([e])=>e===t||t.startsWith(`${e}.`))?.[0];return n?t.replace(n,e[n]):Xe(t,{...e,...Ye})}var Bn=`filter`,Vn=`sort`,Hn=`cursorPaging`,Un=`paging`,Wn=[Bn,Vn,Hn],Gn=[Bn,Vn,Un];function Kn(e,t){return!e||typeof e!=`object`?!1:t.some(t=>e.hasOwnProperty(t))}function qn(e){return Kn(e,Wn)}function Jn(e){return Kn(e,Gn)}function Yn(e){let{hasOptionsParameter:t}=e;return function(...n){return t?Zn(n,e):Xn(n,e)}}function Xn(e,t){return e.length===0?t.builderQueryFunction():t.typedQueryFunction(e[0])}function Zn(e,t){switch(e.length){case 0:return t.builderQueryFunction();case 1:return qn(e[0])||Jn(e[0])?t.typedQueryFunction(e[0]):t.builderQueryFunction(e[0]);default:return t.typedQueryFunction(e[0],e[1])}}var Qn=[{path:`like.createdDate`}],$n=[{path:`likes.createdDate`}];function er(e){return Pt(Object.assign(e,{domainToMappings:{_:[{srcPath:`/_api/blog-like-service`,destPath:``}],"api._api_base_domain_":[{srcPath:`/blog-like-service`,destPath:``}],"social-blog._base_domain_":[{srcPath:`/_api/blog-like-service`,destPath:``}],"manage._base_domain_":[{srcPath:`/_api/blog-like-service`,destPath:``}],"apps._base_domain_":[{srcPath:`/_api/blog-like-service`,destPath:``}],"www.wixapis.com":[{srcPath:`/blog/v1/likes`,destPath:`/v1/likes`}],"*.dev.wix-code.com":[{srcPath:`/blog/v1/likes`,destPath:`/v1/likes`}]}}))}var tr=`@wix/auto_sdk_blog_likes`;function nr(e){function t({host:t}){let n=M(e,[{transformFn:tt,paths:Qn}]);return{entityFqdn:`wix.blog.v1.like`,method:`POST`,methodFqn:`wix.blog.v1.LikeService.CreateLike`,packageName:tr,migrationOptions:{optInTransformResponse:!0},url:er({protoPath:`/v1/likes`,data:n,host:t}),data:n,transformResponse:e=>M(e,[{transformFn:nt,paths:Qn}])}}return t}function rr(e){function t({host:t}){return{entityFqdn:`wix.blog.v1.like`,method:`POST`,methodFqn:`wix.blog.v1.LikeService.QueryLikes`,packageName:tr,migrationOptions:{optInTransformResponse:!0},url:er({protoPath:`/v1/likes/query`,data:e,host:t}),data:e,transformResponse:e=>M(e,[{transformFn:nt,paths:$n}])}}return t}function ir(e){function t({host:t}){return{entityFqdn:`wix.blog.v1.like`,method:`DELETE`,methodFqn:`wix.blog.v1.LikeService.DeleteLikeByFqdnAndEntityId`,packageName:tr,migrationOptions:{optInTransformResponse:!0},url:er({protoPath:`/v1/likes/fqdn/{fqdn}/entity-id/{entityId}`,data:e,host:t}),params:Nt(e)}}return t}async function ar(e){let{httpClient:t,sideEffects:n}=arguments[1],r=nr(O({like:e?.like}));n?.onSiteCall?.();try{let e=await t.request(r);return n?.onSuccess?.(e),k(e.data)?.like}catch(e){let t=N(e,{spreadPathsToArguments:{},explicitPathsToArguments:{like:`$[0].like`},singleArgumentUnchanged:!1},[`options`]);throw n?.onError?.(e),t}}function or(){let{httpClient:e,sideEffects:t}=arguments[0];return zn({func:async n=>{let r=rr(n);t?.onSiteCall?.();try{let n=await e.request(r);return t?.onSuccess?.(n),n}catch(e){throw t?.onError?.(e),e}},requestTransformer:e=>{let t=[e,{}];return O({...t?.[1],query:t?.[0]})},responseTransformer:({data:e})=>{let t=k(M(e,[]));return{items:t?.likes,pagingMetadata:t?.pagingMetadata}},errorTransformer:e=>{throw N(e,{spreadPathsToArguments:{},explicitPathsToArguments:{query:`$[0]`},singleArgumentUnchanged:!1})},pagingMethod:`CURSOR`,transformationPaths:{}})}async function sr(e){let{httpClient:t,sideEffects:n}=arguments[1],r=rr(O({query:e}));n?.onSiteCall?.();try{let e=await t.request(r);return n?.onSuccess?.(e),k(e.data)}catch(e){let t=N(e,{spreadPathsToArguments:{},explicitPathsToArguments:{query:`$[0]`},singleArgumentUnchanged:!1},[`query`]);throw n?.onError?.(e),t}}async function cr(e){let{httpClient:t,sideEffects:n}=arguments[1],r=ir(O({fqdn:e?.fqdn,entityId:e?.entityId}));n?.onSiteCall?.();try{let e=await t.request(r);n?.onSuccess?.(e)}catch(e){let t=N(e,{spreadPathsToArguments:{},explicitPathsToArguments:{fqdn:`$[0].fqdn`,entityId:`$[0].entityId`},singleArgumentUnchanged:!1},[`identifiers`]);throw n?.onError?.(e),t}}function lr(e){return t=>ar(t,{httpClient:e})}function ur(e){return()=>or({httpClient:e})}function dr(e){return t=>sr(t,{httpClient:e})}function fr(e){return t=>cr(t,{httpClient:e})}function pr(e){let t=Yn({builderQueryFunction:()=>ur(e)(),typedQueryFunction:t=>dr(e)(t),hasOptionsParameter:!1});function n(e){return t(...arguments)}return n}var mr=Mt(lr),hr=Mt(fr),gr=Mt(pr),_r=[{path:`metrics.averageRating`}];function vr(e){return Pt(Object.assign(e,{domainToMappings:{_:[{srcPath:`/_api/communities-blog-node-api/v3/posts`,destPath:`/v3/posts`}],"apps._base_domain_":[{srcPath:`/_api/communities-blog-node-api/v3/posts`,destPath:`/v3/posts`}],"www._base_domain_":[{srcPath:`/_api/communities-blog-node-api/v3/posts`,destPath:`/v3/posts`}],"www.wixapis.com":[{srcPath:`/v3/posts`,destPath:`/v3/posts`},{srcPath:`/blog/v3/posts`,destPath:`/v3/posts`},{srcPath:`/_api/v3/posts`,destPath:`/v3/posts`}],"manage._base_domain_":[{srcPath:`/_api/communities-blog-node-api/v3/posts`,destPath:`/v3/posts`},{srcPath:`/_api/post-service-api-proxy/v3/bulk/posts`,destPath:`/v3/bulk/posts`}],"*.dev.wix-code.com":[{srcPath:`/_api/communities-blog-node-api/v3/posts`,destPath:`/v3/posts`}],"editor._base_domain_":[{srcPath:`/_api/communities-blog-node-api/v3/posts`,destPath:`/v3/posts`}],"blocks._base_domain_":[{srcPath:`/_api/communities-blog-node-api/v3/posts`,destPath:`/v3/posts`}],"create.editorx":[{srcPath:`/_api/communities-blog-node-api/v3/posts`,destPath:`/v3/posts`}],"editor.wixapps.net":[{srcPath:`/_api/communities-blog-node-api/v3/posts`,destPath:`/v3/posts`}],"dev._base_domain_":[{srcPath:`/_api/communities-blog-node-api/v3/posts`,destPath:`/v3/posts`}]}}))}var yr=`@wix/auto_sdk_blog_posts`;function br(e){function t({host:t}){return{entityFqdn:`wix.blog.v3.post`,method:`GET`,methodFqn:`com.wixpress.npm.communities.platformized.blog.v3.PostService.GetPostMetrics`,packageName:yr,migrationOptions:{optInTransformResponse:!0},url:vr({protoPath:`/v3/posts/{postId}/metrics`,data:e,host:t}),params:Nt(e),transformResponse:e=>M(e,[{transformFn:sn,paths:_r}])}}return t}async function xr(e){let{httpClient:t,sideEffects:n}=arguments[1],r=br(O({postId:e},[]));n?.onSiteCall?.();try{let e=await t.request(r);return n?.onSuccess?.(e),k(e.data,[])}catch(e){let t=N(e,{spreadPathsToArguments:{},explicitPathsToArguments:{postId:`$[0]`},singleArgumentUnchanged:!1},[`postId`]);throw n?.onError?.(e),t}}function Sr(e){return t=>xr(t,{httpClient:e})}var Cr=Mt(Sr),wr=`wix.blog.v3.post`,Tr=async e=>{await mr({like:{entityId:e,fqdn:wr}})},Er=async e=>{await hr({fqdn:wr,entityId:e})},Dr=e=>typeof e==`number`?e:void 0,Or=async e=>{let[t,n]=await Promise.allSettled([gr().eq(`fqdn`,wr).eq(`entityId`,e).limit(1).find(),Cr(e)]),r=n.status===`fulfilled`?n.value.metrics:void 0;return{liked:t.status===`fulfilled`&&t.value.items.length>0,likeCount:Dr(r?.likes),viewCount:Dr(r?.views),commentCount:Dr(r?.comments)}};function I(e){return e}var kr=I(`@wix/site-service-editor-context`),Ar=()=>{try{return!!u(kr).previewMode}catch{return!1}},jr=I(`@wix/viewer-service-site-members`),Mr=()=>{try{return u(jr)}catch{return}},Nr={liked:!1,baselineLiked:!1,freshLikeCount:void 0,viewCount:void 0,commentCount:void 0,isLikeCountLoaded:!1},L=`wix-blog:post-like-toggled`,Pr=()=>{let e=window;return e[L]??=new Map},Fr=e=>{Pr().set(e.postId,e.liked),window.dispatchEvent(new CustomEvent(L,{detail:e}))},Ir=(e,t)=>({isLiked:e.liked,likeCount:Math.max(0,(e.freshLikeCount??t)+Number(e.liked)-Number(e.baselineLiked)),isLikeCountLoaded:e.isLikeCountLoaded,viewCount:e.viewCount,commentCount:e.commentCount}),Lr=(e,t,n=!1,a)=>{let u=Ar()||n,[d,f]=l(Nr),p=c(Nr),m=c(t),h=c(new Set),g=c(!1),_=c(!1),v=c(void 0),y=Mr(),[b,x]=l(0);o(()=>{let e=y?.addMemberLoginListener?.(()=>{Pr().clear(),x(e=>e+1)});return()=>{e!==void 0&&y?.removeMemberLoginListener?.(e)}},[y]);let S=i(e=>{let t=p.current,n={...t,...e};Object.keys(n).every(e=>n[e]===t[e])||(p.current=n,h.current.forEach(e=>e()),r(()=>f(n)))},[]),C=s(()=>({get:()=>Ir(p.current,m.current),subscribe:e=>(h.current.add(e),()=>{h.current.delete(e)})}),[]);o(()=>{m.current!==t&&(m.current=t,h.current.forEach(e=>e()))},[t]),o(()=>{if(v.current!==e&&(v.current=e,S(Nr)),_.current=!1,!e||u){S({isLikeCountLoaded:!0});return}let t=!1;return Or(e).then(({liked:e,likeCount:n,viewCount:r,commentCount:i})=>{t||S({isLikeCountLoaded:!0,viewCount:r,commentCount:i,baselineLiked:e,freshLikeCount:n,...!_.current&&{liked:e}})}).catch(n=>{t||S({isLikeCountLoaded:!0}),An(a,n,{feature:On.likes,action:`read-like-state`,level:`warning`,contexts:{likes:{postId:e}}})}),()=>{t=!0}},[e,u,a,S,b]),o(()=>{if(!e)return;let t=e=>{_.current=!0,S({liked:e})},n=Pr().get(e);n!==void 0&&t(n);let r=n=>{let{detail:r}=n;r.postId===e&&t(r.liked)};return window.addEventListener(L,r),()=>window.removeEventListener(L,r)},[e,S]);let ee=i(async t=>{if(!e||g.current)return;_.current=!0;let n=!p.current.liked;if(S({liked:n}),Fr({postId:e,liked:n}),!u){g.current=!0;try{await(n?Tr(e):Er(e))}catch(t){S({liked:!n}),Fr({postId:e,liked:!n}),An(a,t,{feature:On.likes,action:n?`like-post`:`unlike-post`,contexts:{likes:{postId:e}}})}finally{g.current=!1}}},[e,u,a,S]);return{...Ir(d,t),toggleLike:ee,liveLikes:C}},Rr=I(`@wix/site-service-locale`),zr=I(`@wix/viewer-service-multilingual`),Br=()=>{let e;try{let{multilingualEnabled:t,currentLocale:n}=u(zr);t&&n&&!n.primaryLocale&&(e=n.regionalFormat)}catch{}let t,n;try{({locale:t,language:n}=u(Rr))}catch{}return e||t||n},Vr=()=>{let e=new Map;return{getOrInsert:(t,n)=>(e.has(t)||e.set(t,n().finally(()=>{e.delete(t)})),e.get(t))}},Hr=async e=>{try{let{default:t}=await e();return t}catch{return}},Ur=({isDev:e,loadMessages:t,loadDevMessages:n})=>{let r=Vr(),i=async r=>{let[i,a]=await Promise.all([Hr(()=>t(r)),!e||!n?void 0:Hr(()=>n(r))]);if(i&&a)return{...i,...a};if(i)return i;if(a)return a;throw Error(`No translation files found for ${r}`)};return e=>r.getOrInsert(e,()=>i(e))},R=e=>typeof e==`string`,z=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},Wr=e=>e==null?``:String(e),Gr=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},Kr=/###/g,qr=e=>e&&e.includes(`###`)?e.replace(Kr,`.`):e,Jr=e=>!e||R(e),B=(e,t,n)=>{let r=R(t)?t.split(`.`):t,i=0;for(;i<r.length-1;){if(Jr(e))return{};let t=qr(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return Jr(e)?{}:{obj:e,k:qr(r[i])}},Yr=(e,t,n)=>{let{obj:r,k:i}=B(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=B(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=B(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},Xr=(e,t,n,r)=>{let{obj:i,k:a}=B(e,t,Object);i[a]=i[a]||[],i[a].push(n)},V=(e,t)=>{let{obj:n,k:r}=B(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},Zr=(e,t,n)=>{let r=V(e,n);return r===void 0?V(t,n):r},Qr=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(Object.prototype.hasOwnProperty.call(e,r)?R(e[r])||e[r]instanceof String||R(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Qr(e[r],t[r],n):e[r]=t[r]);return e},H=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),$r={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`,"/":`&#x2F;`},ei=e=>R(e)?e.replace(/[&<>"'\/]/g,e=>$r[e]):e,ti=class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}},ni=[` `,`,`,`?`,`!`,`;`],ri=new ti(20),ii=(e,t,n)=>{t||=``,n||=``;let r=ni.filter(e=>!t.includes(e)&&!n.includes(e));if(r.length===0)return!0;let i=ri.getRegExp(`(${r.map(e=>e===`?`?`\\?`:e).join(`|`)})`),a=!i.test(e);if(!a){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a},ai=(e,t,n=`.`)=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;let r=t.split(n),i=e;for(let e=0;e<r.length;){if(!i||typeof i!=`object`)return;let t,a=``;for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],t!==void 0){if([`string`,`number`,`boolean`].includes(typeof t)&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},U=e=>e?.replace(/_/g,`-`),oi={type:`logger`,log(e){this.output(`log`,e)},warn(e){this.output(`warn`,e)},error(e){this.output(`error`,e)},output(e,t){console?.[e]?.apply?.(console,t)}},W=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||oi,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,`log`,``,!0)}warn(...e){return this.forward(e,`warn`,``,!0)}error(...e){return this.forward(e,`error`,``)}deprecate(...e){return this.forward(e,`warn`,`WARNING DEPRECATED: `,!0)}forward(e,t,n,r){return r&&!this.debug?null:(e=e.map(e=>R(e)?e.replace(/[\r\n\x00-\x1F\x7F]/g,` `):e),R(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t||=this.options,t.prefix=t.prefix||this.prefix,new e(this.logger,t)}},si=class{constructor(){this.observers={}}on(e,t){return e.split(` `).forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}once(e,t){let n=(...r)=>{t(...r),this.off(e,n)};return this.on(e,n),this}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers[`*`]&&Array.from(this.observers[`*`].entries()).forEach(([n,r])=>{for(let i=0;i<r;i++)n(e,...t)})}},ci=new WeakSet,li=class extends si{constructor(e,t={ns:[`translation`],defaultNS:`translation`}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.includes(e)||this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){let i=r.keySeparator===void 0?this.options.keySeparator:r.keySeparator,a=r.ignoreJSONStructure===void 0?this.options.ignoreJSONStructure:r.ignoreJSONStructure,o;e.includes(`.`)?o=e.split(`.`):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):R(n)&&i?o.push(...n.split(i)):o.push(n)));let s=V(this.data,o);return!s&&!t&&!n&&e.includes(`.`)&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!R(n)?s:ai(this.data?.[e]?.[t],n,i)}addResource(e,t,n,r,i={silent:!1}){let a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.includes(`.`)&&(o=e.split(`.`),r=t,t=o[1]),this.addNamespaces(t),Yr(this.data,o,r),i.silent||this.emit(`added`,e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(let r in n)(R(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit(`added`,e,t,n)}addResourceBundle(e,t,n,r,i,a={silent:!1,skipCopy:!1}){let o=[e,t];e.includes(`.`)&&(o=e.split(`.`),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=V(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?Qr(s,n,i):s={...s,...n},Yr(this.data,o,s),a.silent||this.emit(`added`,e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit(`removed`,e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||=this.options.defaultNS,this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>{let n=t[e];return ci.has(n)?!0:!n||Object.keys(n).length===0?!1:(typeof n==`object`&&ci.add(n),!0)})}toJSON(){return this.data}},ui={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,i)??t}),t}},di=Symbol(`i18next/PATH_KEY`);function fi(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===di?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function G(e,t){let{[di]:n}=e(fi()),r=t?.keySeparator??`.`,i=t?.nsSeparator??`:`,a=t?.enableSelector===`strict`;if(n.length>1&&i){let e=t?.ns,o=a?Array.isArray(e)?e:e?[e]:null:Array.isArray(e)?e:null;if(o&&(a?o:o.length>1?o.slice(1):[]).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}var pi=e=>!R(e)&&typeof e!=`boolean`&&typeof e!=`number`,mi=class e extends si{constructor(e,t={}){super(),Gr([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=W.create(`translator`),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(e==null)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let i=pi(r.res);return!(n.returnObjects===!1&&i)}extractFromKey(e,t){let n=t.nsSeparator===void 0?this.options.nsSeparator:t.nsSeparator;n===void 0&&(n=`:`);let r=t.keySeparator===void 0?this.options.keySeparator:t.keySeparator,i=t.ns||this.options.defaultNS||[],a=n&&e.includes(n),o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!ii(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:R(i)?[i]:i};let a=e.split(n);(n!==r||n===r&&this.options.ns.includes(a[0]))&&(i=a.shift()),e=a.join(r)}return{key:e,namespaces:R(i)?[i]:i}}translate(t,n,r){let i=typeof n==`object`?{...n}:n;if(typeof i!=`object`&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i==`object`&&(i={...i}),i||={},t==null)return``;typeof t==`function`&&(t=G(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>typeof e==`function`?G(e,{...this.options,...i}):String(e));let a=i.returnDetails===void 0?this.options.returnDetails:i.returnDetails,o=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,{key:s,namespaces:c}=this.extractFromKey(t[t.length-1],i),l=c[c.length-1],u=i.nsSeparator===void 0?this.options.nsSeparator:i.nsSeparator;u===void 0&&(u=`:`);let d=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()===`cimode`)return f?a?{res:`${l}${u}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:`${l}${u}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:s;let p=this.resolve(t,i),m=p?.res,h=p?.usedKey||s,g=p?.exactUsedKey||s,_=[`[object Number]`,`[object Function]`,`[object RegExp]`],v=i.joinArrays===void 0?this.options.joinArrays:i.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,b=i.count!==void 0&&!R(i.count),x=e.hasDefaultValue(i),S=b?this.pluralResolver.getSuffix(d,i.count,i):``,C=i.ordinal&&b?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):``,ee=b&&!i.ordinal&&i.count===0,w=ee&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${S}`]||i[`defaultValue${C}`]||i.defaultValue,T=m;y&&!m&&x&&(T=w);let te=pi(T),ne=Object.prototype.toString.apply(T);if(y&&T&&te&&!_.includes(ne)&&!(R(v)&&Array.isArray(T))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,T,{...i,ns:c}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(p.res=e,p.usedParams=this.getUsedParamsDetails(i),p):e}if(o){let e=Array.isArray(T),t=e?[]:{},n=e?g:h;for(let e in T)if(Object.prototype.hasOwnProperty.call(T,e)){let r=`${n}${o}${e}`;t[e]=x&&!m?this.translate(r,{...i,defaultValue:pi(w)?w[e]:void 0,joinArrays:!1,ns:c}):this.translate(r,{...i,joinArrays:!1,ns:c}),t[e]===r&&(t[e]=T[e])}m=t}}else if(y&&R(v)&&Array.isArray(m))m=m.join(v),m&&=this.extendTranslation(m,t,i,r);else{let e=!1,n=!1;!this.isValidLookup(m)&&x&&(e=!0,m=w),this.isValidLookup(m)||(n=!0,m=s);let a=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:m,c=x&&w!==m&&this.options.updateMissing;if(n||e||c){if(this.logger.log(c?`updateKey`:`missingKey`,d,l,b&&!c?`${s}${this.pluralResolver.getSuffix(d,i.count,i)}`:s,c?w:m),o){let e=this.resolve(s,{...i,keySeparator:!1});e&&e.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 e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else this.options.saveMissingTo===`all`?e=this.languageUtils.toResolveHierarchy(i.lng||this.language):e.push(i.lng||this.language);let n=(e,t,n)=>{let r=x&&n!==m?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,r,c,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,r,c,i),this.emit(`missingKey`,e,l,t,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,i);ee&&i[`defaultValue${this.options.pluralSeparator}zero`]&&!t.includes(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],s+t,i[`defaultValue${t}`]||w)})}):n(e,s,w))}m=this.extendTranslation(m,t,i,p,r),n&&m===s&&this.options.appendNamespaceToMissingKey&&(m=`${l}${u}${s}`),(n||e)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${s}`:s,e?m:void 0,i))}return a?(p.res=m,p.usedParams=this.getUsedParamsDetails(i),p):m}extendTranslation(e,t,n,r,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let a=R(e)&&(n?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:n.interpolation.skipOnVariables),o;if(a){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let s=n.replace&&!R(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),a){let t=e.match(this.interpolator.nestingRegexp),r=t&&t.length;o<r&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...e)=>i?.[0]===e[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null):this.translate(...e,t),n)),n.interpolation&&this.interpolator.reset()}let a=n.postProcess||this.options.postProcess,o=R(a)?[a]:a;return e!=null&&o?.length&&n.applyPostProcessor!==!1&&(e=ui.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,i,a,o;return R(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>typeof e==`function`?G(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),c=s.key;r=c;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));let u=t.count!==void 0&&!R(t.count),d=u&&!t.ordinal&&t.count===0,f=t.context!==void 0&&(R(t.context)||typeof t.context==`number`)&&t.context!==``,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(e=>{this.isValidLookup(n)||(o=e,!this.checkedLoadedFor[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(this.checkedLoadedFor[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(`, `)}" won't get resolved as namespace "${o}" 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!!!`)),p.forEach(r=>{if(this.isValidLookup(n))return;a=r;let o=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,c,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&e.startsWith(i)&&o.push(c+e.replace(i,this.options.pluralSeparator)),o.push(c+e),d&&o.push(c+n)),f){let r=`${c}${this.options.contextSeparator||`_`}${t.context}`;o.push(r),u&&(t.ordinal&&e.startsWith(i)&&o.push(r+e.replace(i,this.options.pluralSeparator)),o.push(r+e),d&&o.push(r+n))}}let s;for(;s=o.pop();)this.isValidLookup(n)||(i=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e===``)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){let t=[`defaultValue`,`ordinal`,`context`,`replace`,`lng`,`lngs`,`fallbackLng`,`ns`,`keySeparator`,`nsSeparator`,`returnObjects`,`returnDetails`,`joinArrays`,`postProcess`,`interpolation`],n=e.replace&&!R(e.replace),r=n?e.replace:e;if(n&&e.count!==void 0&&(r={...r,count:e.count}),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(let e of t)delete r[e]}return r}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.startsWith(`defaultValue`)&&e[t]!==void 0)return!0;return!1}},hi=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=W.create(`languageUtils`),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(e){if(e=U(e),!e||!e.includes(`-`))return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=U(e),!e||!e.includes(`-`))return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(R(e)&&e.includes(`-`)){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load===`languageOnly`||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>e===r?!0:!e.includes(`-`)&&!r.includes(`-`)?!1:!!(e.includes(`-`)&&!r.includes(`-`)&&e.slice(0,e.indexOf(`-`))===r||e.startsWith(r)&&r.length>1))}),t||=this.getFallbackCodes(this.options.fallbackLng)[0],t}getFallbackCodes(e,t){if(!e)return[];if(typeof e==`function`&&(e=e(t)),R(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||=e[this.getScriptPartFromCode(t)],n||=e[this.formatLanguageCode(t)],n||=e[this.getLanguagePartFromCode(t)],n||=e.default,n||[]}toResolveHierarchy(e,t){let n=this.options.fallbackLng,r=Array.isArray(n)?n.join(`|`):n;r!==this._cachedFallbackLng&&(this.resolveHierarchyCache={},this._cachedFallbackLng=r);let i=t===void 0||t===!1||R(t),a=t===void 0&&typeof this.options.fallbackLng==`function`,o=R(e)&&i&&!a,s=null;if(o){let n;n=t===void 0?`undefined`:t===!1?`boolean:false`:`string:${t}`,s=`${e.length}:${e}|${n}`}if(s!==null){let e=this.resolveHierarchyCache[s];if(e!==void 0)return e.slice()}let c=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),l=[],u=e=>{e&&(this.isSupportedCode(e)?l.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return R(e)&&(e.includes(`-`)||e.includes(`_`))?(this.options.load!==`languageOnly`&&u(this.formatLanguageCode(e)),this.options.load!==`languageOnly`&&this.options.load!==`currentOnly`&&u(this.getScriptPartFromCode(e)),this.options.load!==`currentOnly`&&u(this.getLanguagePartFromCode(e))):R(e)&&u(this.formatLanguageCode(e)),c.forEach(e=>{let t=this.formatLanguageCode(e);l.includes(t)||u(t)}),s===null?l:(this.resolveHierarchyCache[s]=l,l.slice())}},gi={zero:0,one:1,two:2,few:3,many:4,other:5},_i={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},vi=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=W.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=U(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch{if(typeof Intl>`u`)return this.logger.error(`No Intl support, please use an Intl polyfill!`),_i;if(!e.match(/-|_/))return _i;let n=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(n,t)}return this.pluralRulesCache[i]=a,a}needsPlural(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?n.resolvedOptions().pluralCategories.sort((e,t)=>gi[e]-gi[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:``}${e}`):[]}getSuffix(e,t,n={}){let r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:``}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix(`dev`,t,n))}},yi=(e,t,n,r=`.`,i=!0)=>{let a=Zr(e,t,n);return!a&&i&&R(n)&&(a=ai(e,n,r),a===void 0&&(a=ai(t,n,r))),a},bi=e=>e.replace(/\$/g,`$$$$`),xi=class{constructor(e={}){this.logger=W.create(`interpolator`),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||={escapeValue:!0};let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:_}=e.interpolation;this.escape=t===void 0?ei:t,this.escapeValue=n===void 0||n,this.useRawValueToEscape=r!==void 0&&r,this.prefix=i?H(i):a||`{{`,this.suffix=o?H(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u?H(u):`-`,this.unescapeSuffix=this.unescapePrefix?``:l?H(l):``,this.nestingPrefix=d?H(d):f||H(`$t(`),this.nestingSuffix=p?H(p):m||H(`)`),this.nestingOptionsSeparator=h||`,`,this.maxReplaces=g||1e3,this.alwaysFormat=_!==void 0&&_,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,`g`);this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']|"[^"]*"|'[^']*'|\\((?:[^()"']|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,a,o,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(!e.includes(this.formatSeparator)){let i=yi(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),a=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(yi(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...r,...t,interpolationkey:a})};this.resetRegExp(),!this.escapeValue&&typeof e==`string`&&/\$t\([^)]*\{[^}]*\{\{/.test(e)&&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.`);let l=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=r?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:r.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>e},{regex:this.regexp,safeValue:e=>this.escapeValue?this.escape(e):e}].forEach(t=>{for(o=0;i=t.regex.exec(e);){let n=i[1].trim();if(a=c(n),a===void 0){if(typeof l==`function`){let t=l(e,i,r);a=R(t)?t:``}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a=``;else if(u){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=``}else!R(a)&&!this.useRawValueToEscape&&(a=Wr(a));let s=t.safeValue(a);if(e=e.replace(i[0],bi(s)),u?(t.regex.lastIndex+=s.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,i,a,o=(e,t)=>{let n=this.nestingOptionsSeparator;if(!e.includes(n))return e;let r=e.split(RegExp(`${H(n)}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,a);let o=i.match(/'/g),s=i.match(/"/g);((o?.length??0)%2==0&&!s||(s?.length??0)%2!=0)&&(i=i.replace(/'/g,`"`));try{a=JSON.parse(i),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return a.defaultValue&&a.defaultValue.includes(this.prefix)&&delete a.defaultValue,e},s=new RegExp(this.nestingRegexp),c=``,l=0;for(;r=s.exec(e);){let u=[];a={...n},a=a.replace&&!R(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let d=/{.*}/s.test(r[1])?r[1].lastIndexOf(`}`)+1:r[1].indexOf(this.formatSeparator);if(d!==-1&&(u=r[1].slice(d).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,d)),i=t(o.call(this,r[1].trim(),a),a),i&&r[0]===e&&!R(i))return i;R(i)||(i=Wr(i)),i||=(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),``),u.length&&(i=u.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),i.trim())),c+=e.slice(l,r.index)+Wr(i),l=s.lastIndex,this.regexp.lastIndex=0}return l?c+e.slice(l):e}},Si=e=>{let t=e.toLowerCase().trim(),n={};if(e.includes(`(`)){let r=e.split(`(`);t=r[0].toLowerCase().trim();let i=r[1].slice(0,-1);t===`currency`&&!i.includes(`:`)?n.currency||=i.trim():t===`relativetime`&&!i.includes(`:`)?n.range||=i.trim():i.split(`;`).forEach(e=>{if(e){let[t,...r]=e.split(`:`),i=r.join(`:`).trim().replace(/^'+|'+$/g,``),a=t.trim();n[a]||(n[a]=i),i===`false`&&(n[a]=!1),i===`true`&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},Ci=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});let o=r+JSON.stringify(a),s=t[o];return s||(s=e(U(r),i),t[o]=s),s(n)}},wi=e=>(t,n,r)=>e(U(n),r)(t),Ti=class{constructor(e={}){this.logger=W.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?Ci:wi;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:`currency`});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||`day`)}),list:n((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Ci(t)}format(e,t,n,r={}){if(!t||e==null)return e;let i=t.split(this.formatSeparator),a=[];for(let e=0;e<i.length;e++){let t=i[e];for(;t.indexOf(`(`)>-1&&!t.includes(`)`)&&e+1<i.length;)t=`${t}${this.formatSeparator}${i[++e]}`;a.push(t)}return a.reduce((e,t)=>{let{formatName:i,formatOptions:a}=Si(t);if(this.formats[i]){let t=e;try{let o=r?.formatParams?.[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...a,...r,...o})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${i}`),e},e)}},Ei=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},Di=class extends si{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=W.create(`backendConnector`),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{Xr(n.loaded,[i],a),Ei(n,e),t&&n.errors.push(t),n.pendingCount===0&&!n.done&&(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{o[e][t]===void 0&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit(`loaded`,o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,i=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});return}this.readingCalls++;let o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}o&&s&&r<this.maxRetries?setTimeout(()=>{this.read(e,t,n,r+1,i*2,a)},i):a(o,s)},s=this.backend[n].bind(this.backend);if(s.length===2)try{let n=s(e,t);n&&typeof n.then==`function`?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(e){o(e)}else return s(e,t,o)}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`),r&&r();R(e)&&(e=this.languageUtils.toResolveHierarchy(e)),R(t)&&(t=[t]);let i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=``){let n=e.split(`|`),r=n[0],i=n[1];this.read(r,i,`read`,void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,i,a={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t))this.logger.warn(`did not save key "${n}" as the namespace "${t}" 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!!!`);else if(n!=null&&n!==``){if(this.backend?.create){let s={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let i;i=c.length===5?c(e,t,n,r,s):c(e,t,n,r),i&&typeof i.then==`function`?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}else c(e,t,n,r,o,s)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}},Oi=()=>({debug:!1,initAsync:!0,ns:[`translation`],defaultNS:[`translation`],fallbackLng:[`dev`],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:`all`,preload:!1,keySeparator:`.`,nsSeparator:`:`,pluralSeparator:`_`,contextSeparator:`_`,enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:`fallback`,saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]==`object`&&(t=e[1]),R(e[1])&&(t.defaultValue=e[1]),R(e[2])&&(t.tDescription=e[2]),typeof e[2]==`object`||typeof e[3]==`object`){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,prefix:`{{`,suffix:`}}`,formatSeparator:`,`,unescapePrefix:`-`,nestingPrefix:`$t(`,nestingSuffix:`)`,nestingOptionsSeparator:`,`,maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),ki=e=>(R(e.ns)&&(e.ns=[e.ns]),R(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),R(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes(`cimode`)&&(e.supportedLngs=e.supportedLngs.concat([`cimode`])),e),Ai=()=>{},ji=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},K=class e extends si{constructor(e={},t){if(super(),this.options=ki(e),this.services={},this.logger=W,this.modules={external:[]},ji(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e==`function`&&(t=e,e={}),e.defaultNS==null&&e.ns&&(R(e.ns)?e.defaultNS=e.ns:e.ns.includes(`translation`)||(e.defaultNS=e.ns[0]));let n=Oi();this.options={...n,...this.options,...ki(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!=`function`&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler);let r=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?W.init(r(this.modules.logger),this.options):W.init(null,this.options);let e;e=this.modules.formatter?this.modules.formatter:Ti;let t=new hi(this.options);this.store=new li(this.options.resources,this.options);let n=this.services;n.logger=W,n.resourceStore=this.store,n.languageUtils=t,n.pluralResolver=new vi(t,{prepend:this.options.pluralSeparator}),e&&(n.formatter=r(e),n.formatter.init&&n.formatter.init(n,this.options),this.options.interpolation.format=n.formatter.format.bind(n.formatter)),n.interpolator=new xi(this.options),n.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},n.backendConnector=new Di(r(this.modules.backend),n.resourceStore,n,this.options),n.backendConnector.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(n.languageDetector=r(this.modules.languageDetector),n.languageDetector.init&&n.languageDetector.init(n,this.options.detection,this.options)),this.modules.i18nFormat&&(n.i18nFormat=r(this.modules.i18nFormat),n.i18nFormat.init&&n.i18nFormat.init(this)),this.translator=new mi(this.services,this.options),this.translator.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||=Ai,this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!==`dev`&&(this.options.lng=e[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn(`init: no languageDetector is used and no lng is defined`),[`getResource`,`hasResourceBundle`,`getResourceBundle`,`getDataByLanguage`].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),[`addResource`,`addResources`,`addResourceBundle`,`removeResourceBundle`].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let i=z(),a=()=>{let e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn(`init: i18next is already initialized. You should call init just once!`),this.isInitialized=!0,this.options.isClone||this.logger.log(`initialized`,this.options),this.emit(`initialized`,this.options),i.resolve(n),t(e,n)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),i}loadResources(e,t=Ai){let n=t,r=R(e)?e:this.language;if(typeof e==`function`&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()===`cimode`&&(!this.options.preload||this.options.preload.length===0))return n();let e=[],t=t=>{t&&t!==`cimode`&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{t!==`cimode`&&(e.includes(t)||e.push(t))})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{!e&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=z();return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e||=this.languages,t||=this.options.ns,n||=Ai,this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);if(!e.type)throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);return e.type===`backend`&&(this.modules.backend=e),(e.type===`logger`||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type===`languageDetector`&&(this.modules.languageDetector=e),e.type===`i18nFormat`&&(this.modules.i18nFormat=e),e.type===`postProcessor`&&ui.addPostProcessor(e),e.type===`formatter`&&(this.modules.formatter=e),e.type===`3rdParty`&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&![`cimode`,`dev`].includes(e)){for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(![`cimode`,`dev`].includes(t)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&!this.languages.includes(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let n=z();this.emit(`languageChanging`,e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,a)=>{a?this.isLanguageChangingTo===e&&(r(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit(`languageChanged`,a),this.logger.log(`languageChanged`,a)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},a=t=>{!e&&!t&&this.services.languageDetector&&(t=[]);let n=R(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(R(t)?[t]:t);a&&(this.language||r(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,e=>{i(e,a)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),n}getFixedT(e,t,n,r){let i=r?.scopeNs,a=(e,t,...r)=>{let o;o=typeof t==`object`?{...t}:this.options.overloadTranslationOptionHandler([e,t].concat(r)),o.lng=o.lng||a.lng,o.lngs=o.lngs||a.lngs;let s=o.ns!==void 0&&o.ns!==null;o.ns=o.ns||a.ns,o.keyPrefix!==``&&(o.keyPrefix=o.keyPrefix||n||a.keyPrefix);let c={...this.options,...o};Array.isArray(i)&&!s&&(c.ns=i),typeof o.keyPrefix==`function`&&(o.keyPrefix=G(o.keyPrefix,c));let l=this.options.keySeparator||`.`,u;return o.keyPrefix&&Array.isArray(e)?u=e.map(e=>(typeof e==`function`&&(e=G(e,c)),`${o.keyPrefix}${l}${e}`)):(typeof e==`function`&&(e=G(e,c)),u=o.keyPrefix?`${o.keyPrefix}${l}${e}`:e),this.t(u,o)};return R(e)?a.lng=e:a.lngs=e,a.ns=t,a.keyPrefix=n,a}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn(`hasLoadedNamespace: i18next was not initialized`,this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn(`hasLoadedNamespace: i18n.languages were undefined or empty`,this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()===`cimode`)return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return n===-1||n===0||n===2};if(t.precheck){let e=t.precheck(this,a);if(e!==void 0)return e}if(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages)return!0;let{languageUtils:o}=this.services,s=t.lng?o.isSupportedCode(n)&&o.toResolveHierarchy(n,!1)[0]:n;return!(s&&!a(s,e)||r&&!a(i,e))}loadNamespaces(e,t){let n=z();return this.options.ns?(R(e)&&(e=[e]),e.forEach(e=>{this.options.ns.includes(e)||this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=z();R(e)&&(e=[e]);let r=this.options.preload||[],i=e.filter(e=>!r.includes(e)&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language),!e)return`rtl`;try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch{}let t=`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`.split(`.`),n=this.services?.languageUtils||new hi(Oi());return e.toLowerCase().indexOf(`-latn`)>1?`ltr`:t.includes(n.getLanguagePartFromCode(e))||e.toLowerCase().indexOf(`-arab`)>1?`rtl`:`ltr`}static createInstance(t={},n){let r=new e(t,n);return r.createInstance=e.createInstance,r}cloneInstance(t={},n=Ai){let r=t.forkResourceStore;r&&delete t.forkResourceStore;let i={...this.options,preload:!1,...t,isClone:!0},a=new e(i);if((t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),[`store`,`services`,`language`].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new li(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{}),i),a.services.resourceStore=a.store),t.interpolation){let e={...Oi().interpolation,...this.options.interpolation,...t.interpolation},n={...i,interpolation:e};a.services.interpolator=new xi(n)}return a.translator=new mi(a.services,i),a.translator.on(`*`,(e,...t)=>{a.emit(e,...t)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}.createInstance();K.createInstance,K.dir,K.init,K.loadResources,K.reloadResources,K.use,K.changeLanguage,K.getFixedT,K.t,K.exists,K.setDefaultNamespace,K.hasLoadedNamespace,K.loadNamespaces,K.loadLanguages;var Mi=({locale:e,asyncMessagesLoader:t,messages:n,useSuspense:r=!1,disableAutoInit:i=!1,bindI18n:a},{icu:o}={})=>{let s={lng:e,fallbackLng:`en`,keySeparator:!1,react:{useSuspense:r,bindI18n:a},_polyfill:{isLoading:!1}},c=K.createInstance(i?s:void 0);return o&&c.use(o),t&&c.use({type:`backend`,read:async(e,n,r)=>{try{return r(null,await t(e))}catch(e){return r(e,null)}}}),n&&(s.resources={[e]:{translation:n}}),i||c.init(s),c};function Ni(e,t){let n=t&&t.cache?t.cache:Ui,r=t&&t.serializer?t.serializer:Vi;return(t&&t.strategy?t.strategy:Ri)(e,{cache:n,serializer:r})}function Pi(e){return e==null||typeof e==`number`||typeof e==`boolean`}function Fi(e,t,n,r){let i=Pi(r)?r:n(r),a=t.get(i);return a===void 0&&(a=e.call(this,r),t.set(i,a)),a}function Ii(e,t,n){let r=Array.prototype.slice.call(arguments,3),i=n(r),a=t.get(i);return a===void 0&&(a=e.apply(this,r),t.set(i,a)),a}function Li(e,t,n,r,i){return n.bind(t,e,r,i)}function Ri(e,t){let n=e.length===1?Fi:Ii;return Li(e,this,n,t.cache.create(),t.serializer)}function zi(e,t){return Li(e,this,Ii,t.cache.create(),t.serializer)}function Bi(e,t){return Li(e,this,Fi,t.cache.create(),t.serializer)}var Vi=function(){return JSON.stringify(arguments)},Hi=class{constructor(){this.cache=Object.create(null)}get(e){return this.cache[e]}set(e,t){this.cache[e]=t}},Ui={create:function(){return new Hi}},Wi={variadic:zi,monadic:Bi},Gi=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function Ki(e){let t={};return e.replace(Gi,e=>{let n=e.length;switch(e[0]){case`G`:t.era=n===4?`long`:n===5?`narrow`:`short`;break;case`y`:t.year=n===2?`2-digit`:`numeric`;break;case`Y`:case`u`:case`U`:case`r`:throw RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case`q`:case`Q`:throw RangeError("`q/Q` (quarter) patterns are not supported");case`M`:case`L`:t.month=[`numeric`,`2-digit`,`short`,`long`,`narrow`][n-1];break;case`w`:case`W`:throw RangeError("`w/W` (week) patterns are not supported");case`d`:t.day=[`numeric`,`2-digit`][n-1];break;case`D`:case`F`:case`g`:throw RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case`E`:t.weekday=n===4?`long`:n===5?`narrow`:`short`;break;case`e`:if(n<4)throw RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=[`short`,`long`,`narrow`,`short`][n-3];break;case`c`:if(n<4)throw RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=[`short`,`long`,`narrow`,`short`][n-3];break;case`a`:t.hour12=!0;break;case`b`:case`B`:throw RangeError("`b/B` (period) patterns are not supported, use `a` instead");case`h`:t.hourCycle=`h12`,t.hour=[`numeric`,`2-digit`][n-1];break;case`H`:t.hourCycle=`h23`,t.hour=[`numeric`,`2-digit`][n-1];break;case`K`:t.hourCycle=`h11`,t.hour=[`numeric`,`2-digit`][n-1];break;case`k`:t.hourCycle=`h24`,t.hour=[`numeric`,`2-digit`][n-1];break;case`j`:case`J`:case`C`:throw RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case`m`:t.minute=[`numeric`,`2-digit`][n-1];break;case`s`:t.second=[`numeric`,`2-digit`][n-1];break;case`S`:case`A`:throw RangeError("`S/A` (second) patterns are not supported, use `s` instead");case`z`:t.timeZoneName=n<4?`short`:`long`;break;case`Z`:case`O`:case`v`:case`V`:case`X`:case`x`:throw RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return``}),t}var qi=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function Ji(e){if(e.length===0)throw Error(`Number skeleton cannot be empty`);let t=e.split(qi).filter(e=>e.length>0),n=[];for(let e of t){let t=e.split(`/`);if(t.length===0)throw Error(`Invalid number skeleton`);let[r,...i]=t;for(let e of i)if(e.length===0)throw Error(`Invalid number skeleton`);n.push({stem:r,options:i})}return n}function Yi(e){return e.replace(/^(.*?)-/,``)}var Xi=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,Zi=/^(@+)?(\+|#+)?[rs]?$/g,Qi=/(\*)(0+)|(#+)(0+)|(0+)/g,$i=/^(0+)$/;function ea(e){let t={};return e[e.length-1]===`r`?t.roundingPriority=`morePrecision`:e[e.length-1]===`s`&&(t.roundingPriority=`lessPrecision`),e.replace(Zi,function(e,n,r){return typeof r==`string`?r===`+`?t.minimumSignificantDigits=n.length:n[0]===`#`?t.maximumSignificantDigits=n.length:(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length+(typeof r==`string`?r.length:0)):(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length),``}),t}function ta(e){switch(e){case`sign-auto`:return{signDisplay:`auto`};case`sign-accounting`:case`()`:return{currencySign:`accounting`};case`sign-always`:case`+!`:return{signDisplay:`always`};case`sign-accounting-always`:case`()!`:return{signDisplay:`always`,currencySign:`accounting`};case`sign-except-zero`:case`+?`:return{signDisplay:`exceptZero`};case`sign-accounting-except-zero`:case`()?`:return{signDisplay:`exceptZero`,currencySign:`accounting`};case`sign-never`:case`+_`:return{signDisplay:`never`}}}function na(e){let t;if(e[0]===`E`&&e[1]===`E`?(t={notation:`engineering`},e=e.slice(2)):e[0]===`E`&&(t={notation:`scientific`},e=e.slice(1)),t){let n=e.slice(0,2);if(n===`+!`?(t.signDisplay=`always`,e=e.slice(2)):n===`+?`&&(t.signDisplay=`exceptZero`,e=e.slice(2)),!$i.test(e))throw Error(`Malformed concise eng/scientific notation`);t.minimumIntegerDigits=e.length}return t}function ra(e){return ta(e)||{}}function ia(e){let t={};for(let n of e){switch(n.stem){case`percent`:case`%`:t.style=`percent`;continue;case`%x100`:t.style=`percent`,t.scale=100;continue;case`currency`:t.style=`currency`,t.currency=n.options[0];continue;case`group-off`:case`,_`:t.useGrouping=!1;continue;case`precision-integer`:case`.`:t.maximumFractionDigits=0;continue;case`measure-unit`:case`unit`:t.style=`unit`,t.unit=Yi(n.options[0]);continue;case`compact-short`:case`K`:t.notation=`compact`,t.compactDisplay=`short`;continue;case`compact-long`:case`KK`:t.notation=`compact`,t.compactDisplay=`long`;continue;case`scientific`:t={...t,notation:`scientific`,...n.options.reduce((e,t)=>({...e,...ra(t)}),{})};continue;case`engineering`:t={...t,notation:`engineering`,...n.options.reduce((e,t)=>({...e,...ra(t)}),{})};continue;case`notation-simple`:t.notation=`standard`;continue;case`unit-width-narrow`:t.currencyDisplay=`narrowSymbol`,t.unitDisplay=`narrow`;continue;case`unit-width-short`:t.currencyDisplay=`code`,t.unitDisplay=`short`;continue;case`unit-width-full-name`:t.currencyDisplay=`name`,t.unitDisplay=`long`;continue;case`unit-width-iso-code`:t.currencyDisplay=`symbol`;continue;case`scale`:t.scale=parseFloat(n.options[0]);continue;case`rounding-mode-floor`:t.roundingMode=`floor`;continue;case`rounding-mode-ceiling`:t.roundingMode=`ceil`;continue;case`rounding-mode-down`:t.roundingMode=`trunc`;continue;case`rounding-mode-up`:t.roundingMode=`expand`;continue;case`rounding-mode-half-even`:t.roundingMode=`halfEven`;continue;case`rounding-mode-half-down`:t.roundingMode=`halfTrunc`;continue;case`rounding-mode-half-up`:t.roundingMode=`halfExpand`;continue;case`integer-width`:if(n.options.length>1)throw RangeError(`integer-width stems only accept a single optional option`);n.options[0].replace(Qi,function(e,n,r,i,a,o){if(n)t.minimumIntegerDigits=r.length;else if(i&&a)throw Error(`We currently do not support maximum integer digits`);else if(o)throw Error(`We currently do not support exact integer digits`);return``});continue}if($i.test(n.stem)){t.minimumIntegerDigits=n.stem.length;continue}if(Xi.test(n.stem)){if(n.options.length>1)throw RangeError(`Fraction-precision stems only accept a single optional option`);n.stem.replace(Xi,function(e,n,r,i,a,o){return r===`*`?t.minimumFractionDigits=n.length:i&&i[0]===`#`?t.maximumFractionDigits=i.length:a&&o?(t.minimumFractionDigits=a.length,t.maximumFractionDigits=a.length+o.length):(t.minimumFractionDigits=n.length,t.maximumFractionDigits=n.length),``});let e=n.options[0];e===`w`?t={...t,trailingZeroDisplay:`stripIfInteger`}:e&&(t={...t,...ea(e)});continue}if(Zi.test(n.stem)){t={...t,...ea(n.stem)};continue}let e=ta(n.stem);e&&(t={...t,...e});let r=na(n.stem);r&&(t={...t,...r})}return t}var aa=function(e){return e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]=`EXPECT_ARGUMENT_CLOSING_BRACE`,e[e.EMPTY_ARGUMENT=2]=`EMPTY_ARGUMENT`,e[e.MALFORMED_ARGUMENT=3]=`MALFORMED_ARGUMENT`,e[e.EXPECT_ARGUMENT_TYPE=4]=`EXPECT_ARGUMENT_TYPE`,e[e.INVALID_ARGUMENT_TYPE=5]=`INVALID_ARGUMENT_TYPE`,e[e.EXPECT_ARGUMENT_STYLE=6]=`EXPECT_ARGUMENT_STYLE`,e[e.INVALID_NUMBER_SKELETON=7]=`INVALID_NUMBER_SKELETON`,e[e.INVALID_DATE_TIME_SKELETON=8]=`INVALID_DATE_TIME_SKELETON`,e[e.EXPECT_NUMBER_SKELETON=9]=`EXPECT_NUMBER_SKELETON`,e[e.EXPECT_DATE_TIME_SKELETON=10]=`EXPECT_DATE_TIME_SKELETON`,e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]=`UNCLOSED_QUOTE_IN_ARGUMENT_STYLE`,e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]=`EXPECT_SELECT_ARGUMENT_OPTIONS`,e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]=`EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE`,e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]=`INVALID_PLURAL_ARGUMENT_OFFSET_VALUE`,e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]=`EXPECT_SELECT_ARGUMENT_SELECTOR`,e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]=`EXPECT_PLURAL_ARGUMENT_SELECTOR`,e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]=`EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT`,e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]=`EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT`,e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]=`INVALID_PLURAL_ARGUMENT_SELECTOR`,e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]=`DUPLICATE_PLURAL_ARGUMENT_SELECTOR`,e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]=`DUPLICATE_SELECT_ARGUMENT_SELECTOR`,e[e.MISSING_OTHER_CLAUSE=22]=`MISSING_OTHER_CLAUSE`,e[e.INVALID_TAG=23]=`INVALID_TAG`,e[e.INVALID_TAG_NAME=25]=`INVALID_TAG_NAME`,e[e.UNMATCHED_CLOSING_TAG=26]=`UNMATCHED_CLOSING_TAG`,e[e.UNCLOSED_TAG=27]=`UNCLOSED_TAG`,e}({});function oa(e){return e.type===0}function sa(e){return e.type===1}function ca(e){return e.type===2}function la(e){return e.type===3}function ua(e){return e.type===4}function da(e){return e.type===5}function fa(e){return e.type===6}function pa(e){return e.type===7}function ma(e){return e.type===8}function ha(e){return!!(e&&typeof e==`object`&&e.type===0)}function ga(e){return!!(e&&typeof e==`object`&&e.type===1)}var _a=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,q={"001":[`H`,`h`],419:[`h`,`H`,`hB`,`hb`],AC:[`H`,`h`,`hb`,`hB`],AD:[`H`,`hB`],AE:[`h`,`hB`,`hb`,`H`],AF:[`H`,`hb`,`hB`,`h`],AG:[`h`,`hb`,`H`,`hB`],AI:[`H`,`h`,`hb`,`hB`],AL:[`h`,`H`,`hB`],AM:[`H`,`hB`],AO:[`H`,`hB`],AR:[`h`,`H`,`hB`,`hb`],AS:[`h`,`H`],AT:[`H`,`hB`],AU:[`h`,`hb`,`H`,`hB`],AW:[`H`,`hB`],AX:[`H`],AZ:[`H`,`hB`,`h`],BA:[`H`,`hB`,`h`],BB:[`h`,`hb`,`H`,`hB`],BD:[`h`,`hB`,`H`],BE:[`H`,`hB`],BF:[`H`,`hB`],BG:[`H`,`hB`,`h`],BH:[`h`,`hB`,`hb`,`H`],BI:[`H`,`h`],BJ:[`H`,`hB`],BL:[`H`,`hB`],BM:[`h`,`hb`,`H`,`hB`],BN:[`hb`,`hB`,`h`,`H`],BO:[`h`,`H`,`hB`,`hb`],BQ:[`H`],BR:[`H`,`hB`],BS:[`h`,`hb`,`H`,`hB`],BT:[`h`,`H`],BW:[`H`,`h`,`hb`,`hB`],BY:[`H`,`h`],BZ:[`H`,`h`,`hb`,`hB`],CA:[`h`,`hb`,`H`,`hB`],CC:[`H`,`h`,`hb`,`hB`],CD:[`hB`,`H`],CF:[`H`,`h`,`hB`],CG:[`H`,`hB`],CH:[`H`,`hB`,`h`],CI:[`H`,`hB`],CK:[`H`,`h`,`hb`,`hB`],CL:[`h`,`H`,`hB`,`hb`],CM:[`H`,`h`,`hB`],CN:[`H`,`hB`,`hb`,`h`],CO:[`h`,`H`,`hB`,`hb`],CP:[`H`],CR:[`h`,`H`,`hB`,`hb`],CU:[`h`,`H`,`hB`,`hb`],CV:[`H`,`hB`],CW:[`H`,`hB`],CX:[`H`,`h`,`hb`,`hB`],CY:[`h`,`H`,`hb`,`hB`],CZ:[`H`],DE:[`H`,`hB`],DG:[`H`,`h`,`hb`,`hB`],DJ:[`h`,`H`],DK:[`H`],DM:[`h`,`hb`,`H`,`hB`],DO:[`h`,`H`,`hB`,`hb`],DZ:[`h`,`hB`,`hb`,`H`],EA:[`H`,`h`,`hB`,`hb`],EC:[`h`,`H`,`hB`,`hb`],EE:[`H`,`hB`],EG:[`h`,`hB`,`hb`,`H`],EH:[`h`,`hB`,`hb`,`H`],ER:[`h`,`H`],ES:[`H`,`hB`,`h`,`hb`],ET:[`hB`,`hb`,`h`,`H`],FI:[`H`],FJ:[`h`,`hb`,`H`,`hB`],FK:[`H`,`h`,`hb`,`hB`],FM:[`h`,`hb`,`H`,`hB`],FO:[`H`,`h`],FR:[`H`,`hB`],GA:[`H`,`hB`],GB:[`H`,`h`,`hb`,`hB`],GD:[`h`,`hb`,`H`,`hB`],GE:[`H`,`hB`,`h`],GF:[`H`,`hB`],GG:[`H`,`h`,`hb`,`hB`],GH:[`h`,`H`],GI:[`H`,`h`,`hb`,`hB`],GL:[`H`,`h`],GM:[`h`,`hb`,`H`,`hB`],GN:[`H`,`hB`],GP:[`H`,`hB`],GQ:[`H`,`hB`,`h`,`hb`],GR:[`h`,`H`,`hb`,`hB`],GS:[`H`,`h`,`hb`,`hB`],GT:[`h`,`H`,`hB`,`hb`],GU:[`h`,`hb`,`H`,`hB`],GW:[`H`,`hB`],GY:[`h`,`hb`,`H`,`hB`],HK:[`h`,`hB`,`hb`,`H`],HN:[`h`,`H`,`hB`,`hb`],HR:[`H`,`hB`],HU:[`H`,`h`],IC:[`H`,`h`,`hB`,`hb`],ID:[`H`],IE:[`H`,`h`,`hb`,`hB`],IL:[`H`,`hB`],IM:[`H`,`h`,`hb`,`hB`],IN:[`h`,`H`],IO:[`H`,`h`,`hb`,`hB`],IQ:[`h`,`hB`,`hb`,`H`],IR:[`hB`,`H`],IS:[`H`],IT:[`H`,`hB`],JE:[`H`,`h`,`hb`,`hB`],JM:[`h`,`hb`,`H`,`hB`],JO:[`h`,`hB`,`hb`,`H`],JP:[`H`,`K`,`h`],KE:[`hB`,`hb`,`H`,`h`],KG:[`H`,`h`,`hB`,`hb`],KH:[`hB`,`h`,`H`,`hb`],KI:[`h`,`hb`,`H`,`hB`],KM:[`H`,`h`,`hB`,`hb`],KN:[`h`,`hb`,`H`,`hB`],KP:[`h`,`H`,`hB`,`hb`],KR:[`h`,`H`,`hB`,`hb`],KW:[`h`,`hB`,`hb`,`H`],KY:[`h`,`hb`,`H`,`hB`],KZ:[`H`,`hB`],LA:[`H`,`hb`,`hB`,`h`],LB:[`h`,`hB`,`hb`,`H`],LC:[`h`,`hb`,`H`,`hB`],LI:[`H`,`hB`,`h`],LK:[`H`,`h`,`hB`,`hb`],LR:[`h`,`hb`,`H`,`hB`],LS:[`h`,`H`],LT:[`H`,`h`,`hb`,`hB`],LU:[`H`,`h`,`hB`],LV:[`H`,`hB`,`hb`,`h`],LY:[`h`,`hB`,`hb`,`H`],MA:[`H`,`h`,`hB`,`hb`],MC:[`H`,`hB`],MD:[`H`,`hB`],ME:[`H`,`hB`,`h`],MF:[`H`,`hB`],MG:[`H`,`h`],MH:[`h`,`hb`,`H`,`hB`],MK:[`H`,`h`,`hb`,`hB`],ML:[`H`],MM:[`hB`,`hb`,`H`,`h`],MN:[`H`,`h`,`hb`,`hB`],MO:[`h`,`hB`,`hb`,`H`],MP:[`h`,`hb`,`H`,`hB`],MQ:[`H`,`hB`],MR:[`h`,`hB`,`hb`,`H`],MS:[`H`,`h`,`hb`,`hB`],MT:[`H`,`h`],MU:[`H`,`h`],MV:[`H`,`h`],MW:[`h`,`hb`,`H`,`hB`],MX:[`h`,`H`,`hB`,`hb`],MY:[`hb`,`hB`,`h`,`H`],MZ:[`H`,`hB`],NA:[`h`,`H`,`hB`,`hb`],NC:[`H`,`hB`],NE:[`H`],NF:[`H`,`h`,`hb`,`hB`],NG:[`H`,`h`,`hb`,`hB`],NI:[`h`,`H`,`hB`,`hb`],NL:[`H`,`hB`],NO:[`H`,`h`],NP:[`H`,`h`,`hB`],NR:[`H`,`h`,`hb`,`hB`],NU:[`H`,`h`,`hb`,`hB`],NZ:[`h`,`hb`,`H`,`hB`],OM:[`h`,`hB`,`hb`,`H`],PA:[`h`,`H`,`hB`,`hb`],PE:[`h`,`H`,`hB`,`hb`],PF:[`H`,`h`,`hB`],PG:[`h`,`H`],PH:[`h`,`hB`,`hb`,`H`],PK:[`h`,`hB`,`H`],PL:[`H`,`h`],PM:[`H`,`hB`],PN:[`H`,`h`,`hb`,`hB`],PR:[`h`,`H`,`hB`,`hb`],PS:[`h`,`hB`,`hb`,`H`],PT:[`H`,`hB`],PW:[`h`,`H`],PY:[`h`,`H`,`hB`,`hb`],QA:[`h`,`hB`,`hb`,`H`],RE:[`H`,`hB`],RO:[`H`,`hB`],RS:[`H`,`hB`,`h`],RU:[`H`],RW:[`H`,`h`],SA:[`h`,`hB`,`hb`,`H`],SB:[`h`,`hb`,`H`,`hB`],SC:[`H`,`h`,`hB`],SD:[`h`,`hB`,`hb`,`H`],SE:[`H`],SG:[`h`,`hb`,`H`,`hB`],SH:[`H`,`h`,`hb`,`hB`],SI:[`H`,`hB`],SJ:[`H`],SK:[`H`],SL:[`h`,`hb`,`H`,`hB`],SM:[`H`,`h`,`hB`],SN:[`H`,`h`,`hB`],SO:[`h`,`H`],SR:[`H`,`hB`],SS:[`h`,`hb`,`H`,`hB`],ST:[`H`,`hB`],SV:[`h`,`H`,`hB`,`hb`],SX:[`H`,`h`,`hb`,`hB`],SY:[`h`,`hB`,`hb`,`H`],SZ:[`h`,`hb`,`H`,`hB`],TA:[`H`,`h`,`hb`,`hB`],TC:[`h`,`hb`,`H`,`hB`],TD:[`h`,`H`,`hB`],TF:[`H`,`h`,`hB`],TG:[`H`,`hB`],TH:[`H`,`h`],TJ:[`H`,`h`],TL:[`H`,`hB`,`hb`,`h`],TM:[`H`,`h`],TN:[`h`,`hB`,`hb`,`H`],TO:[`h`,`H`],TR:[`H`,`hB`],TT:[`h`,`hb`,`H`,`hB`],TW:[`hB`,`hb`,`h`,`H`],TZ:[`hB`,`hb`,`H`,`h`],UA:[`H`,`hB`,`h`],UG:[`hB`,`hb`,`H`,`h`],UM:[`h`,`hb`,`H`,`hB`],US:[`h`,`hb`,`H`,`hB`],UY:[`h`,`H`,`hB`,`hb`],UZ:[`H`,`hB`,`h`],VA:[`H`,`h`,`hB`],VC:[`h`,`hb`,`H`,`hB`],VE:[`h`,`H`,`hB`,`hb`],VG:[`h`,`hb`,`H`,`hB`],VI:[`h`,`hb`,`H`,`hB`],VN:[`H`,`h`],VU:[`h`,`H`],WF:[`H`,`hB`],WS:[`h`,`H`],XK:[`H`,`hB`,`h`],YE:[`h`,`hB`,`hb`,`H`],YT:[`H`,`hB`],ZA:[`H`,`h`,`hb`,`hB`],ZM:[`h`,`hb`,`H`,`hB`],ZW:[`H`,`h`],"af-ZA":[`H`,`h`,`hB`,`hb`],"ar-001":[`h`,`hB`,`hb`,`H`],"ca-ES":[`H`,`h`,`hB`],"en-001":[`h`,`hb`,`H`,`hB`],"en-HK":[`h`,`hb`,`H`,`hB`],"en-IL":[`H`,`h`,`hb`,`hB`],"en-MY":[`h`,`hb`,`H`,`hB`],"es-BR":[`H`,`h`,`hB`,`hb`],"es-ES":[`H`,`h`,`hB`,`hb`],"es-GQ":[`H`,`h`,`hB`,`hb`],"fr-CA":[`H`,`h`,`hB`],"gl-ES":[`H`,`h`,`hB`],"gu-IN":[`hB`,`hb`,`h`,`H`],"hi-IN":[`hB`,`h`,`H`],"it-CH":[`H`,`h`,`hB`],"it-IT":[`H`,`h`,`hB`],"kn-IN":[`hB`,`h`,`H`],"ku-SY":[`H`,`hB`],"ml-IN":[`hB`,`h`,`H`],"mr-IN":[`hB`,`hb`,`h`,`H`],"pa-IN":[`hB`,`hb`,`h`,`H`],"ta-IN":[`hB`,`h`,`hb`,`H`],"te-IN":[`hB`,`h`,`H`],"zu-ZA":[`H`,`hB`,`hb`,`h`]};function va(e,t){let n=``;for(let r=0;r<e.length;r++){let i=e.charAt(r);if(i===`j`){let a=0;for(;r+1<e.length&&e.charAt(r+1)===i;)a++,r++;let o=1+(a&1),s=a<2?1:3+(a>>1),c=ya(t);for((c==`H`||c==`k`)&&(s=0);s-->0;)n+=`a`;for(;o-->0;)n=c+n}else n+=i===`J`?`H`:i}return n}function ya(e){let t=e.hourCycle;if(t===void 0){let n=e;t=n.getHourCycles?.()[0]??n.hourCycles?.[0]}if(t)switch(t){case`h24`:return`k`;case`h23`:return`H`;case`h12`:return`h`;case`h11`:return`K`;default:throw Error(`Invalid hourCycle`)}let n=e.language,r;return n!==`root`&&(r=e.maximize().region),(q[`${n}-${r}`]||q[r||``]||q[n||``]||q[`${n}-001`]||q[`001`])[0].charAt(0)}var ba=RegExp(`^${_a.source}*`),xa=RegExp(`${_a.source}*$`);function J(e,t){return{start:e,end:t}}var Sa=!!Object.fromEntries,Ca=!!String.prototype.trimStart,wa=!!String.prototype.trimEnd,Ta=Sa?Object.fromEntries:function(e){let t={};for(let[n,r]of e)t[n]=r;return t},Ea=Ca?function(e){return e.trimStart()}:function(e){return e.replace(ba,``)},Da=wa?function(e){return e.trimEnd()}:function(e){return e.replace(xa,``)},Oa=RegExp(`([^\\p{White_Space}\\p{Pattern_Syntax}]*)`,`yu`);function ka(e,t){return Oa.lastIndex=t,Oa.exec(e)[1]??``}function Aa(e){if(e.length===0)return null;let t=1,n=1;for(let r=0;r<e.length;){let i=e.charCodeAt(r);switch(i){case 35:case 39:case 60:case 123:case 125:return null}if(i===10)t++,n=1,r++;else if(n++,i>=55296&&i<=56319&&r+1<e.length){let t=e.charCodeAt(r+1);r+=t>=56320&&t<=57343?2:1}else r++}return{offset:e.length,line:t,column:n}}var ja=class{constructor(e,t={}){this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}parse(){if(this.offset()!==0)throw Error(`parser can only be used once`);if(this.message.length>0){let e=this.message.charCodeAt(0);if(e!==35&&e!==39&&e!==60&&e!==123&&e!==125){let e=Aa(this.message);if(e){let t=this.clonePosition();return this.position=e,{val:[{type:0,value:this.message,location:J(t,this.clonePosition())}],err:null}}}}return this.parseMessage(0,``,!1)}parseMessage(e,t,n){let r=[];for(;!this.isEOF();){let i=this.char();if(i===123){let t=this.parseArgument(e,n);if(t.err)return t;r.push(t.val)}else if(i===125&&e>0)break;else if(i===35&&(t===`plural`||t===`selectordinal`)){let e=this.clonePosition();this.bump(),r.push({type:7,location:J(e,this.clonePosition())})}else if(i===60&&!this.ignoreTag&&this.peek()===47){if(n)break;return this.error(26,J(this.clonePosition(),this.clonePosition()))}else if(i===60&&!this.ignoreTag&&Ma(this.peek()||0)){let n=this.parseTag(e,t);if(n.err)return n;r.push(n.val)}else{let n=this.parseLiteral(e,t);if(n.err)return n;r.push(n.val)}}return{val:r,err:null}}parseTag(e,t){let n=this.clonePosition();this.bump();let r=this.parseTagName();if(this.bumpSpace(),this.bumpIf(`/>`))return{val:{type:0,value:`<${r}/>`,location:J(n,this.clonePosition())},err:null};if(this.bumpIf(`>`)){let i=this.parseMessage(e+1,t,!0);if(i.err)return i;let a=i.val,o=this.clonePosition();if(this.bumpIf(`</`)){if(this.isEOF()||!Ma(this.char()))return this.error(23,J(o,this.clonePosition()));let e=this.clonePosition();return r===this.parseTagName()?(this.bumpSpace(),this.bumpIf(`>`)?{val:{type:8,value:r,children:a,location:J(n,this.clonePosition())},err:null}:this.error(23,J(o,this.clonePosition()))):this.error(26,J(e,this.clonePosition()))}return this.error(27,J(n,this.clonePosition()))}return this.error(23,J(n,this.clonePosition()))}parseTagName(){let e=this.offset();for(this.bump();!this.isEOF()&&Pa(this.char());)this.bump();return this.message.slice(e,this.offset())}parseLiteral(e,t){let n=this.clonePosition(),r=``;for(;;){let n=this.tryParseQuote(t);if(n){r+=n;continue}let i=this.tryParseUnquoted(e,t);if(i){r+=i;continue}let a=this.tryParseLeftAngleBracket();if(a)r+=a;else break}let i=J(n,this.clonePosition());return{val:{type:0,value:r,location:i},err:null}}tryParseLeftAngleBracket(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!Na(this.peek()||0))?(this.bump(),`<`):null}tryParseQuote(e){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),`'`;case 123:case 60:case 62:case 125:break;case 35:if(e===`plural`||e===`selectordinal`)break;return null;default:return null}this.bump();let t=[this.char()];for(this.bump();!this.isEOF();){let e=this.char();if(e===39){if(this.peek()===39)t.push(39),this.bump();else{this.bump();break}}else t.push(e);this.bump()}return String.fromCodePoint(...t)}tryParseUnquoted(e,t){if(this.isEOF())return null;let n=this.char();return n===60||n===123||n===35&&(t===`plural`||t===`selectordinal`)||n===125&&e>0?null:(this.bump(),String.fromCodePoint(n))}parseArgument(e,t){let n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(1,J(n,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(2,J(n,this.clonePosition()));let r=this.parseIdentifierIfPossible().value;if(!r)return this.error(3,J(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(1,J(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:1,value:r,location:J(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(1,J(n,this.clonePosition())):this.parseArgumentOptions(e,t,r,n);default:return this.error(3,J(n,this.clonePosition()))}}parseIdentifierIfPossible(){let e=this.clonePosition(),t=this.offset(),n=ka(this.message,t),r=t+n.length;return this.bumpTo(r),{value:n,location:J(e,this.clonePosition())}}parseArgumentOptions(e,t,n,r){let i=this.clonePosition(),a=this.parseIdentifierIfPossible().value,o=this.clonePosition();switch(a){case``:return this.error(4,J(i,o));case`number`:case`date`:case`time`:{this.bumpSpace();let e=null;if(this.bumpIf(`,`)){this.bumpSpace();let t=this.clonePosition(),n=this.parseSimpleArgStyleIfPossible();if(n.err)return n;let r=Da(n.val);if(r.length===0)return this.error(6,J(this.clonePosition(),this.clonePosition()));e={style:r,styleLocation:J(t,this.clonePosition())}}let t=this.tryParseArgumentClose(r);if(t.err)return t;let i=J(r,this.clonePosition());if(e&&e.style.startsWith(`::`)){let t=Ea(e.style.slice(2));if(a===`number`){let r=this.parseNumberSkeletonFromString(t,e.styleLocation);return r.err?r:{val:{type:2,value:n,location:i,style:r.val},err:null}}{if(t.length===0)return this.error(10,i);let r=t;this.locale&&(r=va(t,this.locale));let o={type:1,pattern:r,location:e.styleLocation,parsedOptions:this.shouldParseSkeletons?Ki(r):{}};return{val:{type:a===`date`?3:4,value:n,location:i,style:o},err:null}}}return{val:{type:a===`number`?2:a===`date`?3:4,value:n,location:i,style:e?.style??null},err:null}}case`plural`:case`selectordinal`:case`select`:{let i=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(`,`))return this.error(12,J(i,{...i}));this.bumpSpace();let o=this.parseIdentifierIfPossible(),s=0;if(a!==`select`&&o.value===`offset`){if(!this.bumpIf(`:`))return this.error(13,J(this.clonePosition(),this.clonePosition()));this.bumpSpace();let e=this.tryParseDecimalInteger(13,14);if(e.err)return e;this.bumpSpace(),o=this.parseIdentifierIfPossible(),s=e.val}let c=this.tryParsePluralOrSelectOptions(e,a,t,o);if(c.err)return c;let l=this.tryParseArgumentClose(r);if(l.err)return l;let u=J(r,this.clonePosition());return a===`select`?{val:{type:5,value:n,options:Ta(c.val),location:u},err:null}:{val:{type:6,value:n,options:Ta(c.val),offset:s,pluralType:a===`plural`?`cardinal`:`ordinal`,location:u},err:null}}default:return this.error(5,J(i,o))}}tryParseArgumentClose(e){return this.isEOF()||this.char()!==125?this.error(1,J(e,this.clonePosition())):(this.bump(),{val:!0,err:null})}parseSimpleArgStyleIfPossible(){let e=0,t=this.clonePosition();for(;!this.isEOF();)switch(this.char()){case 39:{this.bump();let e=this.clonePosition();if(!this.bumpUntil(`'`))return this.error(11,J(e,this.clonePosition()));this.bump();break}case 123:e+=1,this.bump();break;case 125:if(e>0)--e;else return{val:this.message.slice(t.offset,this.offset()),err:null};break;default:this.bump()}return{val:this.message.slice(t.offset,this.offset()),err:null}}parseNumberSkeletonFromString(e,t){let n=[];try{n=Ji(e)}catch{return this.error(7,t)}return{val:{type:0,tokens:n,location:t,parsedOptions:this.shouldParseSkeletons?ia(n):{}},err:null}}tryParsePluralOrSelectOptions(e,t,n,r){let i=!1,a=[],o=new Set,{value:s,location:c}=r;for(;;){if(s.length===0){let e=this.clonePosition();if(t!==`select`&&this.bumpIf(`=`)){let t=this.tryParseDecimalInteger(16,19);if(t.err)return t;c=J(e,this.clonePosition()),s=this.message.slice(e.offset,this.offset())}else break}if(o.has(s))return this.error(t===`select`?21:20,c);s===`other`&&(i=!0),this.bumpSpace();let r=this.clonePosition();if(!this.bumpIf(`{`))return this.error(t===`select`?17:18,J(this.clonePosition(),this.clonePosition()));let l=this.parseMessage(e+1,t,n);if(l.err)return l;let u=this.tryParseArgumentClose(r);if(u.err)return u;a.push([s,{value:l.val,location:J(r,this.clonePosition())}]),o.add(s),this.bumpSpace(),{value:s,location:c}=this.parseIdentifierIfPossible()}return a.length===0?this.error(t===`select`?15:16,J(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!i?this.error(22,J(this.clonePosition(),this.clonePosition())):{val:a,err:null}}tryParseDecimalInteger(e,t){let n=1,r=this.clonePosition();this.bumpIf(`+`)||this.bumpIf(`-`)&&(n=-1);let i=!1,a=0;for(;!this.isEOF();){let e=this.char();if(e>=48&&e<=57)i=!0,a=a*10+(e-48),this.bump();else break}let o=J(r,this.clonePosition());return i?(a*=n,Number.isSafeInteger(a)?{val:a,err:null}:this.error(t,o)):this.error(e,o)}offset(){return this.position.offset}isEOF(){return this.offset()===this.message.length}clonePosition(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}}char(){let e=this.position.offset;if(e>=this.message.length)throw Error(`out of bound`);let t=this.message.codePointAt(e);if(t===void 0)throw Error(`Offset ${e} is at invalid UTF-16 code unit boundary`);return t}error(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}}bump(){if(this.isEOF())return;let e=this.char();e===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}bumpIf(e){if(this.message.startsWith(e,this.offset())){for(let t=0;t<e.length;t++)this.bump();return!0}return!1}bumpUntil(e){let t=this.offset(),n=this.message.indexOf(e,t);return n>=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)}bumpTo(e){if(this.offset()>e)throw Error(`targetOffset ${e} must be greater than or equal to the current offset ${this.offset()}`);for(e=Math.min(e,this.message.length);;){let t=this.offset();if(t===e)break;if(t>e)throw Error(`targetOffset ${e} is at invalid UTF-16 code unit boundary`);if(this.bump(),this.isEOF())break}}bumpSpace(){for(;!this.isEOF()&&Fa(this.char());)this.bump()}peek(){if(this.isEOF())return null;let e=this.char(),t=this.offset();return this.message.charCodeAt(t+(e>=65536?2:1))??null}};function Ma(e){return e>=97&&e<=122||e>=65&&e<=90}function Na(e){return Ma(e)||e===47}function Pa(e){return e===45||e===46||e>=48&&e<=57||e===95||e>=97&&e<=122||e>=65&&e<=90||e==183||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function Fa(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function Ia(e){e.forEach(e=>{if(delete e.location,da(e)||fa(e))for(let t in e.options)delete e.options[t].location,Ia(e.options[t].value);else ca(e)&&ha(e.style)||(la(e)||ua(e))&&ga(e.style)?delete e.style.location:ma(e)&&Ia(e.children)})}function La(e,t={}){t={shouldParseSkeletons:!0,requiresOtherClause:!0,...t};let n=new ja(e,t).parse();if(n.err){let e=SyntaxError(aa[n.err.kind]);throw e.location=n.err.location,e.originalMessage=n.err.message,e}return t?.captureLocation||Ia(n.val),n.val}var Ra=class extends Error{constructor(e,t,n){super(e),this.code=t,this.originalMessage=n}toString(){return`[formatjs Error: ${this.code}] ${this.message}`}},za=class extends Ra{constructor(e,t,n,r){super(`Invalid values for "${e}": "${t}". Options are "${Object.keys(n).join(`", "`)}"`,`INVALID_VALUE`,r)}},Ba=class extends Ra{constructor(e,t,n){super(`Value for "${e}" must be of type ${t}`,`INVALID_VALUE`,n)}},Va=class extends Ra{constructor(e,t){super(`The intl string context variable "${e}" was not provided to the string "${t}"`,`MISSING_VALUE`,t)}};function Ha(e){return e.length<2?e:e.reduce((e,t)=>{let n=e[e.length-1];return!n||n.type!==0||t.type!==0?e.push(t):n.value+=t.value,e},[])}function Ua(e){return typeof e==`function`}function Y(e,t,n,r,i,a,o){if(e.length===1&&oa(e[0]))return[{type:0,value:e[0].value}];let s=[];for(let c of e){if(oa(c)){s.push({type:0,value:c.value});continue}if(pa(c)){typeof a==`number`&&s.push({type:0,value:n.getNumberFormat(t).format(a)});continue}let{value:e}=c;if(!(i&&e in i))throw new Va(e,o);let l=i[e];if(sa(c))(!l||typeof l==`string`||typeof l==`number`||typeof l==`bigint`)&&(l=typeof l==`string`||typeof l==`number`||typeof l==`bigint`?String(l):``),s.push({type:typeof l==`string`?0:1,value:l});else if(la(c)){let e=typeof c.style==`string`?r.date[c.style]:ga(c.style)?c.style.parsedOptions:void 0;s.push({type:0,value:n.getDateTimeFormat(t,e).format(l)})}else if(ua(c)){let e=typeof c.style==`string`?r.time[c.style]:ga(c.style)?c.style.parsedOptions:r.time.medium;s.push({type:0,value:n.getDateTimeFormat(t,e).format(l)})}else if(ca(c)){let e=typeof c.style==`string`?r.number[c.style]:ha(c.style)?c.style.parsedOptions:void 0;if(e&&e.scale){let t=e.scale||1;if(typeof l==`bigint`){if(!Number.isInteger(t))throw TypeError(`Cannot apply fractional scale ${t} to bigint value. Scale must be an integer when formatting bigint.`);l*=BigInt(t)}else l*=t}s.push({type:0,value:n.getNumberFormat(t,e).format(l)})}else{if(ma(c)){let{children:e,value:l}=c,u=i[l];if(!Ua(u))throw new Ba(l,`function`,o);let d=u(Y(e,t,n,r,i,a).map(e=>e.value));Array.isArray(d)||(d=[d]),s.push(...d.map(e=>({type:typeof e==`string`?0:1,value:e})))}if(da(c)){let e=l,a=(Object.prototype.hasOwnProperty.call(c.options,e)?c.options[e]:void 0)||c.options.other;if(!a)throw new za(c.value,l,Object.keys(c.options),o);s.push(...Y(a.value,t,n,r,i))}else if(fa(c)){let e=`=${l}`,a=Object.prototype.hasOwnProperty.call(c.options,e)?c.options[e]:void 0;if(!a){if(!Intl.PluralRules)throw new Ra(`Intl.PluralRules is not available in this environment.
1
+ import e from"@wix/blog/post-context-provider";import{createContext as t,createElement as n,startTransition as r,useCallback as i,useContext as a,useEffect as o,useMemo as s,useRef as c,useState as l}from"react";import{useService as u}from"@wix/services-manager-react";import{Fragment as d,jsx as f}from"react/jsx-runtime";var p=Object.defineProperty,m=(e,t)=>{let n={};for(var r in e)p(n,r,{get:e[r],enumerable:!0});return t||p(n,Symbol.toStringTag,{value:`Module`}),n},h={};function g(e,t=!1,n=e=>e){return()=>({__type:`event-definition`,type:e,isDomainEvent:t,transformations:n})}var _=e=>{switch(e){case`get`:case`GET`:return`GET`;case`post`:case`POST`:return`POST`;case`put`:case`PUT`:return`PUT`;case`delete`:case`DELETE`:return`DELETE`;case`patch`:case`PATCH`:return`PATCH`;case`head`:case`HEAD`:return`HEAD`;case`options`:case`OPTIONS`:return`OPTIONS`;default:throw Error(`Unknown method: ${e}`)}},v=e=>t=>async n=>{let r,i=t=>{if(r=e(n)(t),r.url===void 0)throw Error(`Url was not successfully created for this request, please reach out to support channels for assistance.`);let{method:i,url:a,params:o}=r;return{...r,method:_(i),url:a,data:r.data,params:o}};try{let e=await t.request(i);if(r===void 0)throw Error(`Request options were not created for this request, please reach out to support channels for assistance.`);let n=Array.isArray(r.transformResponse)?r.transformResponse:[r.transformResponse],a=e.data;return n.forEach(t=>{t&&(a=t(e.data,e.headers))}),a}catch(e){throw typeof e==`object`&&e&&`response`in e&&typeof e.response==`object`&&e.response!==null&&`data`in e.response?e.response.data:e}},y=e=>e.__isAmbassador?!0:!!e().__isAmbassador,b=`__metadata`,x=`edge.wixapis.com`,S=class extends Error{message;response;constructor(e,t){super(e),this.message=e,this.response=t}async details(){let e=await this.response.json();return C(this.response.status,e?.message,e?.details,{requestId:this.response.headers.get(`X-Wix-Request-Id`),details:e})}},C=(e,t,n,r)=>({details:{...!n?.validationError&&{applicationError:{description:t,code:e,data:r}},...n},message:t,requestId:r?.requestId}),w=e=>e?.method&&[`post`,`put`,`patch`].includes(e.method.toLocaleLowerCase())&&e.body?{"Content-Type":`application/json`}:{},T=e=>e&&typeof e==`object`&&!Array.isArray(e),E=e=>e.__type===`host`;function ee(e,t){return e.create(t)}var te=`x-wix-bi-gateway`;function ne(e,t,n){return{[te]:re({environment:`js-sdk${n?`-${n}`:``}`,"package-name":e.packageName??t?.PACKAGE_NAME,"method-fqn":e.methodFqn,entity:e.entityFqdn})}}function re(e){return Object.entries(e).filter(([e,t])=>!!t).map(([e,t])=>`${e}=${t}`).join(`,`)}function ie(e){let t=globalThis.__wix_context__,n={client:h.client,elevatedClient:h.elevatedClient},r;globalThis.__wix_context__=void 0,h.client=void 0,h.elevatedClient=void 0,typeof $wixContext<`u`&&(r={client:$wixContext?.client,elevatedClient:$wixContext?.elevatedClient},delete $wixContext.client,delete $wixContext.elevatedClient);try{return e()}finally{globalThis.__wix_context__=t,h.client=n.client,h.elevatedClient=n.elevatedClient,typeof $wixContext<`u`&&($wixContext.client=r.client,$wixContext.elevatedClient=r.elevatedClient)}}var ae={id:`_id`,createdDate:`_createdDate`,updatedDate:`_updatedDate`};function oe(e){return de(e).map(e=>e.toLocaleUpperCase()).join(`_`)}var se=/([\p{Ll}\d])(\p{Lu})/gu,ce=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,le=`$1\0$2`,ue=/[^\p{L}\d]+/giu;function de(e){let t=e.trim();t=t.replace(se,le).replace(ce,le),t=t.replace(ue,`\0`);let n=0,r=t.length;for(;t.charAt(n)===`\0`;)n++;if(n===r)return[];for(;t.charAt(r-1)===`\0`;)r--;return t.slice(n,r).split(/\0/g)}var fe=e=>`validationError`in(e.response?.data?.details??{}),pe=e=>`applicationError`in(e.response?.data?.details??{}),me=e=>(e.response?.status??-1)>=400&&(e.response?.status??-1)<500;function he(e,t={explicitPathsToArguments:{},spreadPathsToArguments:{},singleArgumentUnchanged:!1},n=[]){if(typeof e!=`object`||!e)throw e;if(fe(e))return ge(e,t,n);if(pe(e))return _e(e);if(me(e)){let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i={applicationError:{description:n,code:oe(n),data:{}},requestId:e.requestId};return D(e,{message:JSON.stringify({message:r,details:i},null,2),extraProperties:{details:i,status:t}})}return ve(e)}var ge=(e,t,n)=>{let r=e.response?.data,i=e.requestId,{fieldViolations:a}=r.details.validationError,o=ye(t,a,n)?.sort((e,t)=>e.field<t.field?-1:1),s=`INVALID_ARGUMENT: ${o?.map(({field:e,description:t})=>`"${e}" ${t}`)?.join(`, `)}`,c={validationError:{fieldViolations:o},requestId:i};return D(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:e.response?.status,requestId:i}})},D=(e,{message:t,extraProperties:n})=>Object.assign(e,{...n,message:t}),_e=e=>{let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i=e.response?.data?.details?.applicationError?.description??n,a=e.response?.data?.details?.applicationError?.code??oe(n),o=e.response?.data?.details?.applicationError?.data??{},s=r===i?r:`${r}: ${i}`,c={applicationError:{description:i,code:a,data:o},requestId:e.requestId};return D(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:t,requestId:e.requestId}})},ve=e=>D(e,{message:e.requestId?`System error occurred, request-id: ${e.requestId}`:`System error occurred: ${JSON.stringify(e)}`,extraProperties:{requestId:e.requestId,status:e.response?.status,code:oe(e.response?.statusText??`UNKNOWN`),...!e.response&&{runtimeError:e}}}),ye=({spreadPathsToArguments:e,explicitPathsToArguments:t,singleArgumentUnchanged:n},r,i)=>{let a={...e,...t},o=Object.keys(a);return r?.filter(e=>!r.some(t=>t.field.length>e.field.length&&t.field.startsWith(e.field)&&o.includes(t.field))).map(e=>{let r=t[e.field];if(r)return{...e,field:be(r,i)};let s=o?.sort((e,t)=>t.length-e.length)?.find(t=>e.field.startsWith(t));if(s){let t=a[s];if(t)return{...e,field:e.field.replace(s,be(t,i))}}return n?{...e,field:`${i[0]}.${e.field}`}:e})},be=(e,t)=>{let n=xe(e);return n==null?e:e.replace(`$[${n}]`,t[n])},xe=e=>{let t=e.match(/\$\[(?<argIndex>\d+)\]/);return t&&t.groups&&Number(t.groups.argIndex)};function Se(e,t,n,r,i,a,o,s,c,l,u){return ie(()=>e({request:async e=>{let i=e({host:s?.HTTPHost||`www.wixapis.com`}),a=i;a.method===`GET`&&a.fallback?.length&&(a.params?.toString().length??0)>4e3&&(a=i.fallback[0]);let o=s?.HTTPHost??`www.wixapis.com`,u=`https://${l?x:o}${a.url}`;a.params&&a.params.toString()&&(u+=`?${a.params.toString()}`);try{let e=ne(i,t,c),o={method:a.method,...a.data&&{body:JSON.stringify(a.data)},headers:{...e}},s=await n(u,o);if(s.status!==200){let e=null;try{e=await s.json()}catch{}let t=we(s.status,e?.message??s.statusText,e?.details,{requestId:s.headers.get(`X-Wix-Request-Id`),details:e}),n=he(t);throw r?.handleError(n,{requestOptions:{url:a.url,method:a.method,entityFqdn:i.entityFqdn,methodFqn:i.methodFqn}}),t}let l=await s.json();return{data:a.migrationOptions?.optInTransformResponse&&a.transformResponse?Array.isArray(a.transformResponse)?a.transformResponse[0](l):a.transformResponse(l):l,headers:s.headers,status:s.status,statusText:s.statusText}}catch(e){throw e.message?.includes(`fetch is not defined`)&&console.error(`Node.js v18+ is required`),e}},fetchWithAuth:n,wixAPIFetch:i,getActiveToken:a,getAuthHeaders:o},{validateRequestSchema:u}))}var Ce=class extends Error{response;requestId;constructor(e){super(),this.response=e.response,this.requestId=e.requestId}},we=(e,t,n,r)=>new Ce({response:{data:{details:{...!n?.validationError&&{applicationError:{description:t,code:e,data:r}},...n},message:t},status:e},requestId:r?.requestId}),Te=`.`;function Ee(e,t,n){if(e==null)throw Error(`Cannot set value on null or undefined`);let r=De(t),i=e;for(let e=0;e<r.length;e++){let t=r[e];if(e===r.length-1){i[t]=n;break}let a=r[e+1];(!(t in i)||i[t]==null||typeof i[t]!=`object`||i[t]===null)&&(i[t]=typeof a==`number`?[]:{}),i=i[t]}return e}function De(e){return Array.isArray(e)?e:e.split(Te).map(e=>Oe(e)?Number(e):e)}function Oe(e){return/^\d+$/.test(e)}function ke(e){let t={};for(let[n,r]of Object.entries(e))Ae(n)||Ee(t,De(n),r);return t}function Ae(e){return e===`__proto__`||e===`constructor`||e===`prototype`}var je=class{BRACKET_PATTERN=/\[(\d+)\]/g;NUMERIC_PATTERN=/^\d+$/;ESCAPED_DOT_PATTERN=/\\\./g;ESCAPED_LEFT_BRACKET_PATTERN=/\\\[/g;ESCAPED_RIGHT_BRACKET_PATTERN=/\\\]/g;SPLIT_PATTERN=/\.|\[(\d+)\]/g;DOT_BEFORE_BRACKET_PATTERN=/\.\[/g;ESCAPED_DOT_PLACEHOLDER=`__DOT__`;ESCAPED_RIGHT_BRACKET_PLACEHOLDER=`__RB__`;ESCAPED_LEFT_BRACKET_PLACEHOLDER=`__LB__`;modifiedFields;cleanedModifiedFields;constructor(e){this.modifiedFields=e}replaceEscapedCharacters(e){return e.replace(this.ESCAPED_DOT_PATTERN,this.ESCAPED_DOT_PLACEHOLDER).replace(this.ESCAPED_LEFT_BRACKET_PATTERN,this.ESCAPED_LEFT_BRACKET_PLACEHOLDER).replace(this.ESCAPED_RIGHT_BRACKET_PATTERN,this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER)}restoreEscapedCharacters(e){return e.replace(this.ESCAPED_DOT_PLACEHOLDER,`\\.`).replace(this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER,`\\]`).replace(this.ESCAPED_LEFT_BRACKET_PLACEHOLDER,`\\[`)}unflatten(){return this.cleanedModifiedFields=Object.fromEntries(Object.entries(this.modifiedFields).map(([e,t])=>[this.replaceEscapedCharacters(this.bracketToDotNotation(e)),t])),ke(this.cleanedModifiedFields)}flatten(e){let t={};for(let n of Object.keys(this.cleanedModifiedFields)){let r=this.splitPath(n),i=this.navigatePath(e,r);t={...t,...i}}return Object.fromEntries(Object.entries(t).map(([e,t])=>[this.restoreEscapedCharacters(e),t]))}splitPath(e){let t=[],n=0,r=Array.from(e.matchAll(this.SPLIT_PATTERN));for(let i of r)i.index>n&&t.push(e.substring(n,i.index)),i[1]&&t.push(i[1]),n=i.index+i[0].length;return n<e.length&&t.push(e.substring(n)),t}navigatePath(e,t){let n=e,r=[],i=e=>{if(!Array.isArray(n))throw Error(`Expected array at path ${this.buildPathString(r)}, but got ${typeof n}`);r.push(`[${e}]`),n=n[parseInt(e,10)]},a=(e,t)=>{let i=e in ae?ae[e]:void 0;if(i&&i in t){r.push(i),n=t[i];return}let a=Fe(e);if(a&&a in t)r.push(a),n=t[a];else throw Error(`Cannot find key '${e}' or its transformations at path ${this.buildPathString(r)}`)},o=(e,t)=>{r.push(e),n=t[e]};for(let e of t){if(this.NUMERIC_PATTERN.test(e)){i(e);continue}if(typeof n!=`object`||!n)throw Error(`Cannot access property '${e}' on ${typeof n} at path ${this.buildPathString(r)}`);let t=n;e in n?o(e,t):a(e,t)}return{[this.buildPathString(r)]:n}}buildPathString(e){return e.join(`.`).replace(this.DOT_BEFORE_BRACKET_PATTERN,`[`)}bracketToDotNotation(e){return e.replace(this.BRACKET_PATTERN,(t,n,r)=>r>0&&e[r-1]===`\\`?t:`.`+n)}};function Me(e,t){let n=e?.modifiedFields;if(!n)return null;let r=Ne(n);if(!r)return null;let{unflattenedModifiedFields:i,modifiedFieldsManipulator:a}=r;e={...e,modifiedFields:i};let o=t(e),s=o?.modifiedFields;if(!s)return null;let c=Pe(s,a);return c===null?null:(o.modifiedFields=c,o)}function Ne(e){if(typeof e==`object`&&e&&!Array.isArray(e))try{let t=new je(e);return{unflattenedModifiedFields:t.unflatten(),modifiedFieldsManipulator:t}}catch{return null}return null}function Pe(e,t){if(typeof e==`object`&&e&&!Array.isArray(e))try{return t.flatten(e)}catch{return null}return null}function Fe(e){return e.replace(/[-_\s]+(.)?/g,(e,t)=>t?t.toUpperCase():``).replace(/^./,e=>e.toLowerCase())}function Ie(){return{emit(e,...t){for(let n=0,r=this.events[e]||[],i=r.length;n<i;n++)r[n](...t)},events:{},on(e,t){return(this.events[e]||=[]).push(t),()=>{this.events[e]=this.events[e]?.filter(e=>t!==e)}}}}var Le=e=>e.__type===`event-definition`;function Re(e,t,n,r){let i;if(e.isDomainEvent){let{deletedEvent:e,actionEvent:t,createdEvent:a,updatedEvent:o,...s}=n,c={...r,...s};i=e?e?.deletedEntity?{entity:e?.deletedEntity,metadata:c}:{metadata:c}:t?{data:t.body,metadata:c}:o?{entity:o.currentEntity,metadata:c,...o.modifiedFields?{modifiedFields:o.modifiedFields}:{}}:{entity:a?.entity,metadata:c}}else i={data:n,metadata:r};let a=e.transformations??(e=>e),o=i,s=i;if(s.modifiedFields){let e=s.modifiedFields;if(typeof e==`object`&&e&&!Array.isArray(e)){o=structuredClone(i);let e=Me(s,a);if(e)return t(e)}}return t(a(o))}function ze(e){let t=new Map,n=Ie();return{initModule(e){return r=>{let i=t.get(e.type)??[];i.push({eventDefinition:e,handler:r}),t.set(e.type,i),n.emit(`registered`,e)}},client:{...n,getRegisteredEvents:()=>t,async process(e,n={expectedEvents:[]}){let{eventType:r,identity:i,instanceId:a,payload:o,accountInfo:s}=await this.parseJWT(e),c=[...n.expectedEvents,...Array.from(t.keys()).map(e=>({type:e}))];if(c.length>0&&!c.some(({type:e})=>e===r))throw Error(`Unexpected event type: ${r}. Expected one of: ${c.map(e=>e.type).join(`, `)}`);let l=t.get(r)??[];return await Promise.all(l.map(({eventDefinition:e,handler:t})=>Re(e,t,o,{instanceId:a,identity:i,accountInfo:s}))),{instanceId:a,eventType:r,payload:o,identity:i,accountInfo:s}},async processRequest(e,t){let n=await e.text();return this.process(n,t)},async parseJWT(t){let n=e();if(!n.decodeJWT)throw Error(`decodeJWT is not supported by the authentication strategy`);let{decoded:r,valid:i}=await n.decodeJWT(t);if(!i)throw Error(`JWT is not valid`);if(typeof r.data!=`string`)throw Error(`Unexpected type of JWT data: expected string, got ${typeof r.data}`);let a=JSON.parse(r.data),o=a.eventType,s=a.accountInfo,c=a.instanceId,l=a.identity?JSON.parse(a.identity):void 0;return{instanceId:c,eventType:o,payload:JSON.parse(a.data),identity:l,accountInfo:s}},async parseRequest(e){let t=await e.text();return this.parseJWT(t)},async executeHandlers(e){let n=Array.from(t.keys()).map(e=>({type:e}));if(n.length>0&&!n.some(({type:t})=>t===e.eventType))throw Error(`Unexpected event type: ${e.eventType}. Expected one of: ${n.map(e=>e.type).join(`, `)}`);let r=t.get(e.eventType)??[];await Promise.all(r.map(({eventDefinition:t,handler:n})=>Re(t,n,e.payload,{instanceId:e.instanceId,identity:e.identity})))},apps:{AppInstalled:g(`AppInstalled`)(),AppRemoved:g(`AppRemoved`)()}}}}var Be=e=>e.__type===`service-plugin-definition`;function Ve(e){let t=new Map,n=Ie();return{initModule(e){return r=>{let i=t.get(e.componentType.toLowerCase())??[];i.push({servicePluginDefinition:e,implementation:r}),t.set(e.componentType.toLowerCase(),i),n.emit(`registered`,e)}},client:{...n,getRegisteredServicePlugins:()=>t,async parseJWT(t){let n=e();if(!n.decodeJWT)throw Error(`decodeJWT is not supported by the authentication strategy`);let{decoded:r,valid:i}=await n.decodeJWT(t,!0);if(!i)throw Error(`JWT is not valid`);if(typeof r.data!=`object`||r.data===null||!(`metadata`in r.data)||typeof r.data.metadata!=`object`||r.data.metadata===null||!(`appExtensionType`in r.data.metadata)||typeof r.data.metadata.appExtensionType!=`string`)throw Error(`Unexpected JWT data: expected object with metadata.appExtensionType string`);return r.data},async process(e){let t=await this.parseJWT(e.body);return this.executeHandler(t,e.url)},async parseRequest(e){let t=await e.text();return this.parseJWT(t)},async processRequest(e){let t=await this.parseRequest(e);return this.processParsedRequest(t,e.url)},async processParsedRequest(e,t){try{let n=await this.executeHandler(e,t);return Response.json(n)}catch(e){if(e.errorType===`SPI`&&e.applicationCode&&e.httpCode)return Response.json({applicationError:{code:e.applicationCode,data:e.data}},{status:e.httpCode});throw e}},async executeHandler(e,n){let r=e.metadata.appExtensionType.toLowerCase(),i=t.get(r)??[];if(i.length===0)throw Error(`No service plugin implementations found for component type ${r}`);if(i.length>1)throw Error(`Multiple service plugin implementations found for component type ${r}. This is currently not supported`);let{implementation:a,servicePluginDefinition:o}=i[0],s=o.methods.find(e=>n.endsWith(e.primaryHttpMappingPath));if(!s)throw Error(`Unexpect request: request url did not match any method: `+n);let c=a[s.name];if(!c)throw Error(`Got request for service plugin method ${s.name} but no implementation was provided. Available methods: ${Object.keys(a).join(`, `)}`);return s.transformations.toREST(await c(s.transformations.fromREST(e)))}}}}var O=`X-Wix-Consistent`;function He(e){let t=e.headers||{Authorization:``},n={getAuthHeaders:e=>Promise.resolve({headers:{}})},r=e.auth,i=typeof r==`function`?r:()=>r??n,a=()=>i().getAuthHeaders(e.host),o=()=>e.fetch??fetch,s=async(n,r)=>{let i=o(),s=await a(),c={...r?.headers??{},...s.headers,...e.host?.essentials?.passThroughHeaders,...t[`X-Wix-Consistent`]?{[O]:t[O]}:{}},l=e.host?.getErrorHandler?.();try{if(typeof n==`string`||n instanceof URL){let e=await i(n,{...r,headers:c});l?.handleError(e,{requestOptions:{url:n.toString(),method:r?.method}});let a=Ue(e);return a&&(t[O]=a),e}{for(let[e,t]of Object.entries(c))typeof t==`string`&&n.headers.set(e,t);let e=await i(n,r);l?.handleError(e,{requestOptions:{url:n.url,method:r?.method}});let a=Ue(e);return a&&(t[O]=a),e}}catch(e){throw l?.handleError(e,{requestOptions:{url:typeof n==`string`||n instanceof URL?n.toString():n.url,method:r?.method}}),e}},{client:c,initModule:l}=Ve(i),{client:u,initModule:d}=ze(i),f=async(n,r)=>{let i=o(),s=await a(),c=w(r),l=await i(n,{...r,headers:{...c,...t,...s?.headers,...r?.headers,...e.host?.essentials?.passThroughHeaders,...t[`X-Wix-Consistent`]?{[O]:t[O]}:{}}}),u=Ue(l);return u&&(t[O]=u),l},p=(t,n)=>{if(Le(t))return d(t);if(Be(t))return l(t);if(E(t)&&e.host)return ee(t,e.host);if(typeof t==`function`){if(`__type`in t&&t.__type===`wix_spi_error`)return t;let r=e.host?.apiBaseUrl??`www.wixapis.com`,o=e.useCDN===void 0?i().shouldUseCDN:e.useCDN;return Se(ie(()=>y(t))?v(t):t,n??{},f,e.host?.getErrorHandler?.(),(e,t)=>{let n=new URL(e,`https://${r}`);return n.host=r,n.protocol=`https`,f(n.toString(),t)},i().getActiveToken,async()=>a(),{HTTPHost:r},e.host?.name,o,e.validateRequestSchema)}return T(t)?Object.fromEntries(Object.entries(t).map(([e,n])=>[e,p(n,t[b])])):t},m=e=>{for(let n in e)t[n]=e[n]};return{...e.modules?p(e.modules):{},get auth(){let t=i();return t.getAuthHeaders=t.getAuthHeaders.bind(void 0,e.host),t},setHeaders:m,use:p,enableContext(e,t={elevated:!1}){e===`global`?globalThis.__wix_context__==null?t.elevated?globalThis.__wix_context__={elevatedClient:this}:globalThis.__wix_context__={client:this}:t.elevated?globalThis.__wix_context__.elevatedClient=this:globalThis.__wix_context__.client=this:t.elevated?h.elevatedClient=this:h.client=this},fetch:(t,n)=>{let r=e.host?.apiBaseUrl??`www.wixapis.com`,i=new URL(t,`https://${r}`);return i.host=r,i.protocol=`https`,f(i.toString(),n)},fetchWithAuth:s,async graphql(t,n,r={apiVersion:`alpha`}){let i=e?.host?.apiBaseUrl??`www.wixapis.com`,a=await f(`https://${i}/graphql/${r.apiVersion}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({query:t,variables:n})});if(a.status!==200)throw new S(`GraphQL request failed with status ${a.status}`,a);let{data:o,errors:s}=await a.json();return{data:o??{},errors:s}},webhooks:u,servicePlugins:c}}function Ue(e){return e.headers?.get(`X-Wix-Consistent`)??e.headers?.get(`x-wix-consistent`)}var We={_id:`id`,_createdDate:`createdDate`,_updatedDate:`updatedDate`},Ge={id:`_id`,createdDate:`_createdDate`,updatedDate:`_updatedDate`},Ke=`items`,qe=`pagingMetadata`,Je=We;function Ye(e,t){return e?.split(`.`).map(e=>t?.[e]??e).join(`.`)}var Xe=`sort.fieldName`;function Ze(e,t,n){return(e===Xe||e.endsWith(`.${Xe}`))&&typeof t==`string`?Ye(t,n):t}function Qe(e,t,n){let r=e=>n.includes(e),i=(e,n)=>{if(Array.isArray(e))e.forEach(e=>{i(e,n)});else if(typeof e==`object`&&e){let a=e;Object.keys(a).forEach(e=>{let o=n===``?e:`${n}.${e}`;if(r(o))return;let s=$e(e,t);s!==e&&!(s in a)&&(a[s]=a[e],delete a[e]),a[s]=Ze(o,a[s],t),i(a[s],o)})}};return i(e,``),e}function $e(e,t){let n;return n=e.includes(`.`)?e.split(`.`).map(e=>t[e]??e).join(`.`):t[e]??e,n}function k(e,t=[]){return Qe(e,We,t)}function et(e,t=[]){return Qe(e,Ge,t)}function tt(e){return e?.toISOString()}function nt(e){return e?new Date(e):void 0}var rt=new WeakMap;function it(){return{leaves:void 0,fields:void 0,mapFields:void 0,anyField:void 0}}function at(e,t){let n=e.get(t);return n||(n=it(),e.set(t,n)),n}function ot(e,t){return t===`*`?(e.anyField??=it(),e.anyField):t.endsWith(`{}`)?(e.mapFields??=new Map,at(e.mapFields,t.slice(0,-2))):(e.fields??=new Map,at(e.fields,t))}function st(e){let t=it();for(let n of e){let e=n.path.split(`.`).reduce(ot,t);e.leaves??=[],e.leaves.push(n)}return t}function ct(e){let t=rt.get(e);return t||(t=st(e),rt.set(e,t)),t}function lt(e){return typeof e==`object`&&!!e}function ut(e,{isRepeated:t,isMap:n},r){return t?Array.isArray(e)?e.map(r):e:n?lt(e)?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,r(t)])):e:r(e)}function dt(e,t,n){lt(e)&&mt(e,t,n)}function ft(e,t,n){for(let[r,i]of t){if(!(r in e))continue;if(i.leaves)for(let t of i.leaves)e[r]=ut(e[r],t,n);let t=e[r];Array.isArray(t)?t.forEach(e=>dt(e,i,n)):dt(t,i,n)}}function pt(e,t,n){for(let[r,i]of t){let t=e[r];lt(t)&&Object.values(t).forEach(e=>dt(e,i,n))}}function mt(e,{fields:t,mapFields:n,anyField:r},i){t&&ft(e,t,i),n&&pt(e,n,i),r&&Object.values(e).forEach(e=>dt(e,r,i))}function A(e,t){if(!lt(e))return e;for(let{paths:n,transformFn:r}of t)mt(e,ct(n),r);return e}function ht(e){return bt(e).map(e=>e.toLocaleUpperCase()).join(`_`)}var gt=/([\p{Ll}\d])(\p{Lu})/gu,_t=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,vt=`$1\0$2`,yt=/[^\p{L}\d]+/giu;function bt(e){let t=e.trim();t=t.replace(gt,vt).replace(_t,vt),t=t.replace(yt,`\0`);let n=0,r=t.length;for(;t.charAt(n)===`\0`;)n++;if(n===r)return[];for(;t.charAt(r-1)===`\0`;)r--;return t.slice(n,r).split(/\0/g)}var xt=e=>`validationError`in(e.response?.data?.details??{}),St=e=>`applicationError`in(e.response?.data?.details??{}),Ct=e=>(e.response?.status??-1)>=400&&(e.response?.status??-1)<500;function j(e,t={explicitPathsToArguments:{},spreadPathsToArguments:{},singleArgumentUnchanged:!1},n=[]){if(typeof e!=`object`||!e)throw e;if(xt(e))return wt(e,t,n);if(St(e))return Tt(e);if(Ct(e)){let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i={applicationError:{description:n,code:ht(n),data:{}},requestId:e.requestId};return M(e,{message:JSON.stringify({message:r,details:i},null,2),extraProperties:{details:i,status:t}})}return Et(e)}var wt=(e,t,n)=>{let r=e.response?.data,i=e.requestId,{fieldViolations:a}=r.details.validationError,o=Dt(t,a,n)?.sort((e,t)=>e.field<t.field?-1:1),s=`INVALID_ARGUMENT: ${o?.map(({field:e,description:t})=>`"${e}" ${t}`)?.join(`, `)}`,c={validationError:{fieldViolations:o},requestId:i};return M(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:e.response?.status,requestId:i}})},M=(e,{message:t,extraProperties:n})=>Object.assign(e,{...n,message:t}),Tt=e=>{let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i=e.response?.data?.details?.applicationError?.description??n,a=e.response?.data?.details?.applicationError?.code??ht(n),o=e.response?.data?.details?.applicationError?.data??{},s=r===i?r:`${r}: ${i}`,c={applicationError:{description:i,code:a,data:o},requestId:e.requestId};return M(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:t,requestId:e.requestId}})},Et=e=>M(e,{message:e.requestId?`System error occurred, request-id: ${e.requestId}`:`System error occurred: ${JSON.stringify(e)}`,extraProperties:{requestId:e.requestId,status:e.response?.status,code:ht(e.response?.statusText??`UNKNOWN`),...!e.response&&{runtimeError:e}}}),Dt=({spreadPathsToArguments:e,explicitPathsToArguments:t,singleArgumentUnchanged:n},r,i)=>{let a={...e,...t},o=Object.keys(a);return r?.filter(e=>!r.some(t=>t.field.length>e.field.length&&t.field.startsWith(e.field)&&o.includes(t.field))).map(e=>{let r=t[e.field];if(r)return{...e,field:Ot(r,i)};let s=o?.sort((e,t)=>t.length-e.length)?.find(t=>e.field.startsWith(t));if(s){let t=a[s];if(t)return{...e,field:e.field.replace(s,Ot(t,i))}}return n?{...e,field:`${i[0]}.${e.field}`}:e})},Ot=(e,t)=>{let n=kt(e);return n==null?e:e.replace(`$[${n}]`,t[n])},kt=e=>{let t=e.match(/\$\[(?<argIndex>\d+)\]/);return t&&t.groups&&Number(t.groups.argIndex)};function At(){let e=typeof $wixContext<`u`&&$wixContext.initWixModules?$wixContext.initWixModules:globalThis.__wix_context__!==void 0&&globalThis.__wix_context__.initWixModules?globalThis.__wix_context__.initWixModules:void 0;if(e)return{initWixModules(t,n){return jt(()=>e(t,n))},fetchWithAuth(){throw Error(`fetchWithAuth is not available in this context`)},graphql(){throw Error(`graphql is not available in this context`)}};let t=typeof $wixContext<`u`?$wixContext.client:h.client===void 0?globalThis.__wix_context__===void 0?void 0:globalThis.__wix_context__.client:h.client,n=typeof $wixContext<`u`?$wixContext.elevatedClient:h.elevatedClient===void 0?globalThis.__wix_context__===void 0?void 0:globalThis.__wix_context__.elevatedClient:h.elevatedClient;if(t||n)return{initWixModules(e,r){if(r){if(!n)throw Error(`An elevated client is required to use elevated modules. Make sure to initialize the Wix context with an elevated client before using elevated SDK modules`);return jt(()=>n.use(e))}if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return jt(()=>t.use(e))},fetchWithAuth:(e,n)=>{if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return t.fetchWithAuth(e,n)},getAuth(){if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return t.auth},async graphql(e,n,r){if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return t.graphql(e,n,r)}}}function jt(e){let t=globalThis.__wix_context__,n={client:h.client,elevatedClient:h.elevatedClient},r;globalThis.__wix_context__=void 0,h.client=void 0,h.elevatedClient=void 0,typeof $wixContext<`u`&&(r={client:$wixContext?.client,elevatedClient:$wixContext?.elevatedClient},delete $wixContext.client,delete $wixContext.elevatedClient);try{return e()}finally{globalThis.__wix_context__=t,h.client=n.client,h.elevatedClient=n.elevatedClient,typeof $wixContext<`u`&&($wixContext.client=r.client,$wixContext.elevatedClient=r.elevatedClient)}}function Mt(e,t){return((...n)=>{let r=At();return r?r.initWixModules(e,t).apply(void 0,n):e.apply(void 0,n)})}function N(e,t=!1){return Mt(e,t)}function Nt(e,t){let n=Ft(e),r=Object.entries(n).some(([e,t])=>e.includes(`.`)||Array.isArray(t)&&t.some(e=>typeof e==`object`));return t&&r?new URLSearchParams({".r":Lt(JSON.stringify(e))}):Object.entries(n).reduce((e,[t,n])=>((Array.isArray(n)?n:[n]).forEach(r=>{r==null||Array.isArray(n)&&typeof r==`object`||e.append(t,r)}),e),new URLSearchParams)}function Pt(e){let t=Xt(Jt(e.host),e.domainToMappings);return on(nn(e.protoPath,e.data||{}),t)}function Ft(e,t=``){let n={};return Object.entries(e).forEach(([e,r])=>{let i=typeof r==`object`&&!!r&&!Array.isArray(r),a=It(t,e);if(i){let e=Ft(r,a);Object.assign(n,e)}else n[a]=r}),n}function It(e,t){return`${e}${e?`.`:``}${t}`}var Lt=e=>{let t=new TextEncoder().encode(e);return(typeof btoa<`u`?btoa(String.fromCodePoint(...t)):Buffer.from(e,`utf-8`).toString(`base64`)).replace(/=/g,``).replace(/\+/g,`-`).replace(/\//g,`_`)},Rt=[`wix.com`,`editorx.com`],zt=`_`,Bt=`*.`,Vt=RegExp(`\\.(${Rt.join(`|`)})$`),Ht=[`42.wixprod.net`,`uw2-edt-1.wixprod.net`,`virginia-edt.wixprod.net`],Ut={"payments.base44.com":`manage.wix.com`,"create.editorx.com":`editor.editorx.com`},Wt=`dev.wix-code.com`,Gt=/{(.*)}/,Kt=RegExp(`\\.(${Ht.join(`|`)})$`),qt=RegExp(`.*\\.${Wt}$`);function Jt(e){return Yt(e).replace(Vt,`._base_domain_`).replace(Kt,`._api_base_domain_`).replace(qt,`*.dev.wix-code.com`)}function Yt(e){return Ut[e]??e}function Xt(e,t){let n=t[e];if(n)return n;let r=Zt(e,t)??Qt(e,t);if(!r){if(en(e)){let e=t[tn];if(e)return e}let n=t[zt];if(n)return n}return r??[]}function Zt(e,t){return Object.entries(t).find(([t])=>{let[,...n]=e.split(`.`);return n.join(`.`)===t})?.[1]}function Qt(e,t){let[n]=Object.entries(t).filter(([t])=>$t(e,t)).sort(([e],[t])=>t.length-e.length);if(!n)return;let[,r]=n;return r}function $t(e,t){if(!t.startsWith(Bt))return!1;let n=t.slice(1);return e.length>n.length&&e.endsWith(n)}function en(e){return!!e.match(/\._base_domain_$/)}var tn=`www._base_domain_`;function nn(e,t){return e.split(`/`).map(e=>rn(e,t)).join(`/`)}function rn(e,t){let n=e.match(Gt)||[],r=n[1];return r?an(t,r,e,e.replace(n[0],``)):e}function an(e,t,n,r){let i=e;for(let e of t.split(`.`)){if(!i)return n;i=i[e]}return`${i}${r}`}function on(e,t){let n=t?.find(t=>e.startsWith(t.destPath));return n?n.srcPath+e.slice(n.destPath.length):e}function sn(e){return e===`NaN`?NaN:e===`Infinity`?1/0:e===`-Infinity`?-1/0:e}var cn=`modulepreload`,ln=function(e,t){return new URL(e,t).href},un={},dn=function(e){return e.pathname.endsWith(`.css`)},fn=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},pn=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=ln(t,n);let r=s(t),i=dn(r);return fn(un,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:cn,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},mn=`x-wix-linguist`,hn=`00000000-0000-0000-0000-000000000000`,gn=`false`,_n=()=>{let e=P(`language`),t=P(`locale`);if(e)return{[mn]:[e,t||e,gn,hn].join(`|`)}};function vn(){let e=null,t=null;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var yn=()=>(typeof window<`u`?window.commonConfig:void 0)??globalThis.commonConfig,P=e=>yn()?.[e],bn=({createHost:e})=>({__type:`host`,create:e=>({}),host:t=>{let{applicationId:n,componentId:r}=t??{},i=typeof window<`u`?window.wixEmbedsAPI:void 0,a=e(t),o=Sn();return{...a,apiBaseUrl:o,getMonitoringClient:i?.getMonitoringClientFunction?.(n,r),essentials:{language:P(`language`),locale:P(`locale`),get passThroughHeaders(){return _n()}}}},auth:e=>{let t=typeof window<`u`?window.wixEmbedsAPI:void 0;!e&&xn()&&(e=t?.getAccessTokenFunction?.());let n=!1,{resolve:r,promise:i}=vn();return{getAuthHeaders:async()=>{if(!e&&n&&(e=await i),!e)throw Error(`Failed to resolve auth token`);return{headers:{Authorization:await e()}}},getAccessTokenInjector:()=>(n=!0,e=>{r(e)})}}});function xn(){return typeof document<`u`&&document.currentScript?.tagName===`SCRIPT`}function Sn(){let e=(typeof window<`u`?window.wixEmbedsAPI:void 0)?.getExternalBaseUrl?.();if(!e)return;let t=new URL(e);return t?.pathname&&t.pathname!==`/`?`${t.hostname}${t.pathname}`:t.hostname}var Cn=({clientSdk:e,applicationId:t})=>({invoke:async({namespace:n,method:r,args:i})=>{if(!e)throw Error(`Wix Site SDK only works in a Wix site environment. Learn more: https://dev.wix.com/docs/sdk/host-modules/site/introduction`);return e.invoke({namespace:n,method:r,args:i,applicationId:t,accessToken:`accessToken`})},getAccessToken:()=>{throw Error(`Not implemented`)},observeState:()=>({disconnect:()=>{}})}),wn=bn({createHost:function(e){let t=(typeof $wixContext<`u`?$wixContext.clientSdk:void 0)??e?.clientSdk??(typeof window<`u`?window?.clientSdk:void 0),{applicationId:n}=e||{};if(!n)throw Error(`"createHost" was called without a required field "applicationId"`);return{channel:Cn({clientSdk:t,applicationId:n}),close:()=>{}}}}),Tn=(e,t)=>{let n=wn.host({applicationId:e,componentId:t}),r=wn.auth();return He({auth:r,host:n}).enableContext(`module`),r.getAccessTokenInjector()},En=e=>Tn(`14bcded7-0066-7c35-14d7-466cb3f09103`,e),Dn={post:`post`,feed:`feed`,relatedPosts:`related-posts`,comments:`comments`,seo:`seo`,likes:`likes`},On=(e,t)=>e&&typeof e[t]==`function`?e:null;function kn(e,t,{feature:n,action:r,level:i=`error`,tags:a,contexts:o}){let s=On(e,`captureException`);if(!s)return;let c=t instanceof Error?t:Error(String(t));s.captureException(c,{level:i,tags:{feature:n,action:r,...a},...o?{contexts:o}:{}})}function An(e){return Object.keys(e).length===1&&`$and`in e&&Array.isArray(e.$and)}function jn(e){return Object.keys(e).length===1&&`$or`in e&&Array.isArray(e.$or)}function Mn(e){return Object.keys(e).length===1&&`$not`in e&&typeof e.$not==`object`}function F(e,t){return e===void 0||Object.keys(e).length===0?t:t===void 0||Object.keys(t).length===0?e:{$and:[...An(e)?e.$and:[e],...An(t)?t.$and:[t]]}}function Nn(e,t){return e===void 0||Object.keys(e).length===0?t:t===void 0||Object.keys(t).length===0?e:{$or:[...jn(e)?e.$or:[e],...jn(t)?t.$or:[t]]}}function Pn(e){if(e!==void 0&&Object.keys(e).length!==0)return Mn(e)?e.$not:{$not:e}}var Fn=class{_items;_fetchNextPage;_fetchPrevPage;_originQuery;_limit;constructor({items:e,originQuery:t,fetchNextPage:n,fetchPrevPage:r,limit:i}){this._items=e,this._fetchNextPage=n,this._fetchPrevPage=r,this._originQuery=t,this._limit=i}get items(){return this._items}get length(){return this._items.length}get pageSize(){return this._limit}get query(){return this._originQuery}async next(){if(!this.hasNext())throw Error(`No next page to fetch`);return await this._fetchNextPage()}async prev(){if(!this.hasPrev())throw Error(`No previous page to fetch`);return await this._fetchPrevPage()}},In=class extends Fn{_nextCursor;_prevCursor;cursors;constructor({items:e,originQuery:t,fetchNextPage:n,fetchPrevPage:r,limit:i,nextCursor:a,prevCursor:o}){super({items:e,originQuery:t,fetchNextPage:n,fetchPrevPage:r,limit:i}),this._nextCursor=a,this._prevCursor=o,this.cursors={next:a,prev:o}}hasNext(){return!!this._nextCursor}hasPrev(){return!!this._prevCursor}},Ln=class extends Fn{_totalCount;_offset;_tooManyToCount;constructor({items:e,fetchNextPage:t,fetchPrevPage:n,offset:r,originQuery:i,limit:a,totalCount:o,tooManyToCount:s}){super({items:e,fetchNextPage:t,fetchPrevPage:n,originQuery:i,limit:a}),this._totalCount=o,this._offset=r,this._tooManyToCount=s}get currentPage(){return this._limit===0?void 0:Math.floor(this._offset/this._limit)}get totalPages(){return this._tooManyToCount||this._limit===0?void 0:Math.ceil(this._totalCount/this._limit)}get totalCount(){return this._tooManyToCount?void 0:this._totalCount}hasNext(){return this._limit!==0&&this.currentPage!==void 0&&this.totalPages!==void 0&&this.currentPage<this.totalPages-1}hasPrev(){return!!(this._limit!==0&&this.currentPage&&this.currentPage>0)}};function Rn(e){let t=n=>({query:n,async find(){try{let r=e.requestTransformer(e.pagingMethod===`CURSOR`&&n.cursorPaging.cursor?{cursorPaging:n.cursorPaging}:n),i=await e.func(r),{[Ke]:a,[qe]:o}=e.responseTransformer(i);if(e.pagingMethod===`OFFSET`){let e=n;return new Ln({items:a??[],fetchNextPage:()=>t({...e,paging:{offset:e.paging.offset+e.paging.limit,limit:e.paging.limit}}).find(),fetchPrevPage:()=>t({...n,paging:{offset:Math.max(e.paging.offset-e.paging.limit,0),limit:e.paging.limit}}).find(),offset:e.paging.offset,limit:e.paging.limit,totalCount:o?.total,tooManyToCount:o?.tooManyToCount,originQuery:this})}let s=n.cursorPaging;return new In({items:a??[],limit:s.limit,originQuery:this,fetchNextPage:()=>t({...n,cursorPaging:{cursor:o?.cursors?.next??void 0,limit:s.limit}}).find(),fetchPrevPage:()=>t({...n,cursorPaging:{cursor:o?.cursors?.prev??void 0,limit:s.limit}}).find(),prevCursor:o?.cursors?.prev??void 0,nextCursor:o?.cursors?.next??void 0})}catch(t){throw e.errorTransformer(t)}},skipTo(e){return t({...n,cursorPaging:{cursor:e,limit:n.cursorPaging.limit}})},eq(r,i){let a=i===void 0?null:i,o={[I(e.transformationPaths,r)]:a};return t({...n,filter:F(n.filter,o)})},ne(r,i){let a=i===void 0?null:i,o={[I(e.transformationPaths,r)]:{$ne:a}};return t({...n,filter:F(n.filter,o)})},ge(r,i){let a={[I(e.transformationPaths,r)]:{$gte:i}};return t({...n,filter:F(n.filter,a)})},gt(r,i){let a={[I(e.transformationPaths,r)]:{$gt:i}};return t({...n,filter:F(n.filter,a)})},le(r,i){let a={[I(e.transformationPaths,r)]:{$lte:i}};return t({...n,filter:F(n.filter,a)})},lt(r,i){let a={[I(e.transformationPaths,r)]:{$lt:i}};return t({...n,filter:F(n.filter,a)})},isNotEmpty(e){return this.ne(e,null)},isEmpty(e){return this.eq(e,null)},startsWith(r,i){let a={[I(e.transformationPaths,r)]:{$startsWith:i}};return t({...n,filter:F(n.filter,a)})},endsWith(r,i){let a={[I(e.transformationPaths,r)]:{$endsWith:i}};return t({...n,filter:F(n.filter,a)})},contains(r,i){let a={[I(e.transformationPaths,r)]:{$contains:i}};return t({...n,filter:F(n.filter,a)})},hasSome(r,...i){let a={[I(e.transformationPaths,r)]:{$hasSome:Array.isArray(i[0])?i[0]:i}};return t({...n,filter:F(n.filter,a)})},hasAll(r,...i){let a={[I(e.transformationPaths,r)]:{$hasAll:Array.isArray(i[0])?i[0]:i}};return t({...n,filter:F(n.filter,a)})},between(e,t,n){return this.ge(e,t).lt(e,n)},in(r,i){let a={[I(e.transformationPaths,r)]:{$in:i}};return t({...n,filter:F(n.filter,a)})},exists(r,i=!0){let a={[I(e.transformationPaths,r)]:{$exists:i}};return t({...n,filter:F(n.filter,a)})},or(e){return t({...n,filter:Nn(n.filter,e.query.filter)})},and(e){return t({...n,filter:F(n.filter,e.query.filter)})},not(e){return t({...n,filter:Pn(e.query.filter)})},ascending(...r){return t({...n,sort:[...n.sort??[],...r.map(t=>({fieldName:I(e.transformationPaths,t),order:`ASC`}))]})},descending(...r){return t({...n,sort:[...n.sort??[],...r.map(t=>({fieldName:I(e.transformationPaths,t),order:`DESC`}))]})},skip(e){return t({...n,paging:{offset:e,limit:`limit`in n.paging?n.paging.limit:50}})},limit(r){if(e.pagingMethod===`CURSOR`){let e=n;return t({...n,cursorPaging:{limit:r,cursor:`cursor`in e.cursorPaging?e.cursorPaging.cursor:void 0}})}let i=n;return t({...n,paging:{limit:r,offset:`offset`in i.paging?i.paging.offset:0}})}});return t({filter:{},...e.pagingMethod===`OFFSET`?{paging:{offset:0,limit:50}}:{cursorPaging:{limit:50}}})}function I(e,t){let n=Object.entries(e).find(([e])=>e===t||t.startsWith(`${e}.`))?.[0];return n?t.replace(n,e[n]):Ye(t,{...e,...Je})}var zn=`filter`,Bn=`sort`,Vn=`cursorPaging`,Hn=`paging`,Un=[zn,Bn,Vn],Wn=[zn,Bn,Hn];function Gn(e,t){return!e||typeof e!=`object`?!1:t.some(t=>e.hasOwnProperty(t))}function Kn(e){return Gn(e,Un)}function qn(e){return Gn(e,Wn)}function Jn(e){let{hasOptionsParameter:t}=e;return function(...n){return t?Xn(n,e):Yn(n,e)}}function Yn(e,t){return e.length===0?t.builderQueryFunction():t.typedQueryFunction(e[0])}function Xn(e,t){switch(e.length){case 0:return t.builderQueryFunction();case 1:return Kn(e[0])||qn(e[0])?t.typedQueryFunction(e[0]):t.builderQueryFunction(e[0]);default:return t.typedQueryFunction(e[0],e[1])}}var Zn=[{path:`like.createdDate`}],Qn=[{path:`likes.createdDate`}];function $n(e){return Pt(Object.assign(e,{domainToMappings:{_:[{srcPath:`/_api/blog-like-service`,destPath:``}],"api._api_base_domain_":[{srcPath:`/blog-like-service`,destPath:``}],"social-blog._base_domain_":[{srcPath:`/_api/blog-like-service`,destPath:``}],"manage._base_domain_":[{srcPath:`/_api/blog-like-service`,destPath:``}],"apps._base_domain_":[{srcPath:`/_api/blog-like-service`,destPath:``}],"www.wixapis.com":[{srcPath:`/blog/v1/likes`,destPath:`/v1/likes`}],"*.dev.wix-code.com":[{srcPath:`/blog/v1/likes`,destPath:`/v1/likes`}]}}))}var er=`@wix/auto_sdk_blog_likes`;function tr(e){function t({host:t}){let n=A(e,[{transformFn:tt,paths:Zn}]);return{entityFqdn:`wix.blog.v1.like`,method:`POST`,methodFqn:`wix.blog.v1.LikeService.CreateLike`,packageName:er,migrationOptions:{optInTransformResponse:!0},url:$n({protoPath:`/v1/likes`,data:n,host:t}),data:n,transformResponse:e=>A(e,[{transformFn:nt,paths:Zn}])}}return t}function nr(e){function t({host:t}){return{entityFqdn:`wix.blog.v1.like`,method:`POST`,methodFqn:`wix.blog.v1.LikeService.QueryLikes`,packageName:er,migrationOptions:{optInTransformResponse:!0},url:$n({protoPath:`/v1/likes/query`,data:e,host:t}),data:e,transformResponse:e=>A(e,[{transformFn:nt,paths:Qn}])}}return t}function rr(e){function t({host:t}){return{entityFqdn:`wix.blog.v1.like`,method:`DELETE`,methodFqn:`wix.blog.v1.LikeService.DeleteLikeByFqdnAndEntityId`,packageName:er,migrationOptions:{optInTransformResponse:!0},url:$n({protoPath:`/v1/likes/fqdn/{fqdn}/entity-id/{entityId}`,data:e,host:t}),params:Nt(e)}}return t}async function ir(e){let{httpClient:t,sideEffects:n}=arguments[1],r=tr(k({like:e?.like}));n?.onSiteCall?.();try{let e=await t.request(r);return n?.onSuccess?.(e),et(e.data)?.like}catch(e){let t=j(e,{spreadPathsToArguments:{},explicitPathsToArguments:{like:`$[0].like`},singleArgumentUnchanged:!1},[`options`]);throw n?.onError?.(e),t}}function ar(){let{httpClient:e,sideEffects:t}=arguments[0];return Rn({func:async n=>{let r=nr(n);t?.onSiteCall?.();try{let n=await e.request(r);return t?.onSuccess?.(n),n}catch(e){throw t?.onError?.(e),e}},requestTransformer:e=>{let t=[e,{}];return k({...t?.[1],query:t?.[0]})},responseTransformer:({data:e})=>{let t=et(A(e,[]));return{items:t?.likes,pagingMetadata:t?.pagingMetadata}},errorTransformer:e=>{throw j(e,{spreadPathsToArguments:{},explicitPathsToArguments:{query:`$[0]`},singleArgumentUnchanged:!1})},pagingMethod:`CURSOR`,transformationPaths:{}})}async function or(e){let{httpClient:t,sideEffects:n}=arguments[1],r=nr(k({query:e}));n?.onSiteCall?.();try{let e=await t.request(r);return n?.onSuccess?.(e),et(e.data)}catch(e){let t=j(e,{spreadPathsToArguments:{},explicitPathsToArguments:{query:`$[0]`},singleArgumentUnchanged:!1},[`query`]);throw n?.onError?.(e),t}}async function sr(e){let{httpClient:t,sideEffects:n}=arguments[1],r=rr(k({fqdn:e?.fqdn,entityId:e?.entityId}));n?.onSiteCall?.();try{let e=await t.request(r);n?.onSuccess?.(e)}catch(e){let t=j(e,{spreadPathsToArguments:{},explicitPathsToArguments:{fqdn:`$[0].fqdn`,entityId:`$[0].entityId`},singleArgumentUnchanged:!1},[`identifiers`]);throw n?.onError?.(e),t}}function cr(e){return t=>ir(t,{httpClient:e})}function lr(e){return()=>ar({httpClient:e})}function ur(e){return t=>or(t,{httpClient:e})}function dr(e){return t=>sr(t,{httpClient:e})}function fr(e){let t=Jn({builderQueryFunction:()=>lr(e)(),typedQueryFunction:t=>ur(e)(t),hasOptionsParameter:!1});function n(e){return t(...arguments)}return n}var pr=N(cr),mr=N(dr),hr=N(fr),gr=[{path:`metrics.averageRating`}];function _r(e){return Pt(Object.assign(e,{domainToMappings:{_:[{srcPath:`/_api/communities-blog-node-api/v3/posts`,destPath:`/v3/posts`}],"apps._base_domain_":[{srcPath:`/_api/communities-blog-node-api/v3/posts`,destPath:`/v3/posts`}],"www._base_domain_":[{srcPath:`/_api/communities-blog-node-api/v3/posts`,destPath:`/v3/posts`}],"www.wixapis.com":[{srcPath:`/v3/posts`,destPath:`/v3/posts`},{srcPath:`/blog/v3/posts`,destPath:`/v3/posts`},{srcPath:`/_api/v3/posts`,destPath:`/v3/posts`}],"manage._base_domain_":[{srcPath:`/_api/communities-blog-node-api/v3/posts`,destPath:`/v3/posts`},{srcPath:`/_api/post-service-api-proxy/v3/bulk/posts`,destPath:`/v3/bulk/posts`}],"*.dev.wix-code.com":[{srcPath:`/_api/communities-blog-node-api/v3/posts`,destPath:`/v3/posts`}],"editor._base_domain_":[{srcPath:`/_api/communities-blog-node-api/v3/posts`,destPath:`/v3/posts`}],"blocks._base_domain_":[{srcPath:`/_api/communities-blog-node-api/v3/posts`,destPath:`/v3/posts`}],"create.editorx":[{srcPath:`/_api/communities-blog-node-api/v3/posts`,destPath:`/v3/posts`}],"editor.wixapps.net":[{srcPath:`/_api/communities-blog-node-api/v3/posts`,destPath:`/v3/posts`}],"dev._base_domain_":[{srcPath:`/_api/communities-blog-node-api/v3/posts`,destPath:`/v3/posts`}]}}))}var vr=`@wix/auto_sdk_blog_posts`;function yr(e){function t({host:t}){return{entityFqdn:`wix.blog.v3.post`,method:`GET`,methodFqn:`com.wixpress.npm.communities.platformized.blog.v3.PostService.GetPostMetrics`,packageName:vr,migrationOptions:{optInTransformResponse:!0},url:_r({protoPath:`/v3/posts/{postId}/metrics`,data:e,host:t}),params:Nt(e),transformResponse:e=>A(e,[{transformFn:sn,paths:gr}])}}return t}async function br(e){let{httpClient:t,sideEffects:n}=arguments[1],r=yr(k({postId:e},[]));n?.onSiteCall?.();try{let e=await t.request(r);return n?.onSuccess?.(e),et(e.data,[])}catch(e){let t=j(e,{spreadPathsToArguments:{},explicitPathsToArguments:{postId:`$[0]`},singleArgumentUnchanged:!1},[`postId`]);throw n?.onError?.(e),t}}function xr(e){return t=>br(t,{httpClient:e})}var Sr=N(xr),Cr=`wix.blog.v3.post`,wr=async e=>{await pr({like:{entityId:e,fqdn:Cr}})},Tr=async e=>{await mr({fqdn:Cr,entityId:e})},Er=100,L,Dr=e=>{let t=[...e.keys()];for(let n=0;n<t.length;n+=Er){let r=t.slice(n,n+Er);hr().eq(`fqdn`,Cr).in(`entityId`,r).limit(r.length).find().then(({items:t})=>{let n=new Set(t.map(e=>e.entityId));for(let t of r)e.get(t)?.forEach(e=>e.resolve(n.has(t)))},t=>{for(let n of r)e.get(n)?.forEach(e=>e.reject(t))})}},Or=e=>new Promise((t,n)=>{if(!L){let e=new Map;L=e,setTimeout(()=>{L=void 0,Dr(e)})}L.set(e,[...L.get(e)??[],{resolve:t,reject:n}])}),kr=e=>typeof e==`number`?e:void 0,Ar=async(e,t=!0)=>{let[n,r]=await Promise.allSettled([Or(e),t?Sr(e):void 0]),i=r.status===`fulfilled`?r.value?.metrics:void 0;return{liked:n.status===`fulfilled`&&n.value,likeCount:kr(i?.likes),viewCount:kr(i?.views),commentCount:kr(i?.comments)}};function R(e){return e}var jr=R(`@wix/site-service-editor-context`),Mr=()=>{try{return!!u(jr).previewMode}catch{return!1}},Nr=R(`@wix/viewer-service-site-members`),Pr=()=>{try{return u(Nr)}catch{return}},Fr={liked:!1,baselineLiked:!1,freshLikeCount:void 0,viewCount:void 0,commentCount:void 0,isLikeCountLoaded:!1},z=`wix-blog:post-like-toggled`,Ir=()=>{let e=window;return e[z]??=new Map},Lr=e=>{Ir().set(e.postId,e.liked),window.dispatchEvent(new CustomEvent(z,{detail:e}))},Rr=(e,t)=>({isLiked:e.liked,likeCount:Math.max(0,(e.freshLikeCount??t)+Number(e.liked)-Number(e.baselineLiked)),isLikeCountLoaded:e.isLikeCountLoaded,viewCount:e.viewCount,commentCount:e.commentCount}),zr=(e,t,n=!1,a,u=!0)=>{let d=Mr()||n,[f,p]=l(Fr),m=c(Fr),h=c(t),g=c(new Set),_=c(!1),v=c(!1),y=c(void 0),b=Pr(),[x,S]=l(0);o(()=>{let e=b?.addMemberLoginListener?.(()=>{Ir().clear(),S(e=>e+1)});return()=>{e!==void 0&&b?.removeMemberLoginListener?.(e)}},[b]);let C=i(e=>{let t=m.current,n={...t,...e};Object.keys(n).every(e=>n[e]===t[e])||(m.current=n,g.current.forEach(e=>e()),r(()=>p(n)))},[]),w=s(()=>({get:()=>Rr(m.current,h.current),subscribe:e=>(g.current.add(e),()=>{g.current.delete(e)})}),[]);o(()=>{h.current!==t&&(h.current=t,g.current.forEach(e=>e()))},[t]),o(()=>{if(y.current!==e&&(y.current=e,C(Fr)),v.current=!1,!e||d){C({isLikeCountLoaded:!0});return}let t=!1;return Ar(e,u).then(({liked:e,likeCount:n,viewCount:r,commentCount:i})=>{t||C({isLikeCountLoaded:!0,viewCount:r,commentCount:i,baselineLiked:e,freshLikeCount:n,...!v.current&&{liked:e}})}).catch(n=>{t||C({isLikeCountLoaded:!0}),kn(a,n,{feature:Dn.likes,action:`read-like-state`,level:`warning`,contexts:{likes:{postId:e}}})}),()=>{t=!0}},[e,d,a,C,x,u]),o(()=>{if(!e)return;let t=e=>{v.current=!0,C({liked:e})},n=Ir().get(e);n!==void 0&&t(n);let r=n=>{let{detail:r}=n;r.postId===e&&t(r.liked)};return window.addEventListener(z,r),()=>window.removeEventListener(z,r)},[e,C]);let T=i(async t=>{if(!e||_.current)return;v.current=!0;let n=!m.current.liked;if(C({liked:n}),Lr({postId:e,liked:n}),!d){_.current=!0;try{await(n?wr(e):Tr(e))}catch(t){C({liked:!n}),Lr({postId:e,liked:!n}),kn(a,t,{feature:Dn.likes,action:n?`like-post`:`unlike-post`,contexts:{likes:{postId:e}}})}finally{_.current=!1}}},[e,d,a,C]);return{...Rr(f,t),toggleLike:T,liveLikes:w}},Br=R(`@wix/site-service-locale`),Vr=R(`@wix/viewer-service-multilingual`),Hr=()=>{let e;try{let{multilingualEnabled:t,currentLocale:n}=u(Vr);t&&n&&!n.primaryLocale&&(e=n.regionalFormat)}catch{}let t,n;try{({locale:t,language:n}=u(Br))}catch{}return e||t||n},Ur=()=>{let e=new Map;return{getOrInsert:(t,n)=>(e.has(t)||e.set(t,n().finally(()=>{e.delete(t)})),e.get(t))}},Wr=async e=>{try{let{default:t}=await e();return t}catch{return}},Gr=({isDev:e,loadMessages:t,loadDevMessages:n})=>{let r=Ur(),i=async r=>{let[i,a]=await Promise.all([Wr(()=>t(r)),!e||!n?void 0:Wr(()=>n(r))]);if(i&&a)return{...i,...a};if(i)return i;if(a)return a;throw Error(`No translation files found for ${r}`)};return e=>r.getOrInsert(e,()=>i(e))},B=e=>typeof e==`string`,V=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},Kr=e=>e==null?``:String(e),qr=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},Jr=/###/g,Yr=e=>e&&e.includes(`###`)?e.replace(Jr,`.`):e,Xr=e=>!e||B(e),H=(e,t,n)=>{let r=B(t)?t.split(`.`):t,i=0;for(;i<r.length-1;){if(Xr(e))return{};let t=Yr(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return Xr(e)?{}:{obj:e,k:Yr(r[i])}},Zr=(e,t,n)=>{let{obj:r,k:i}=H(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=H(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=H(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},Qr=(e,t,n,r)=>{let{obj:i,k:a}=H(e,t,Object);i[a]=i[a]||[],i[a].push(n)},U=(e,t)=>{let{obj:n,k:r}=H(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},$r=(e,t,n)=>{let r=U(e,n);return r===void 0?U(t,n):r},ei=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(Object.prototype.hasOwnProperty.call(e,r)?B(e[r])||e[r]instanceof String||B(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):ei(e[r],t[r],n):e[r]=t[r]);return e},W=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),ti={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`,"/":`&#x2F;`},ni=e=>B(e)?e.replace(/[&<>"'\/]/g,e=>ti[e]):e,ri=class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}},ii=[` `,`,`,`?`,`!`,`;`],ai=new ri(20),oi=(e,t,n)=>{t||=``,n||=``;let r=ii.filter(e=>!t.includes(e)&&!n.includes(e));if(r.length===0)return!0;let i=ai.getRegExp(`(${r.map(e=>e===`?`?`\\?`:e).join(`|`)})`),a=!i.test(e);if(!a){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a},si=(e,t,n=`.`)=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;let r=t.split(n),i=e;for(let e=0;e<r.length;){if(!i||typeof i!=`object`)return;let t,a=``;for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],t!==void 0){if([`string`,`number`,`boolean`].includes(typeof t)&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},G=e=>e?.replace(/_/g,`-`),ci={type:`logger`,log(e){this.output(`log`,e)},warn(e){this.output(`warn`,e)},error(e){this.output(`error`,e)},output(e,t){console?.[e]?.apply?.(console,t)}},K=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||ci,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,`log`,``,!0)}warn(...e){return this.forward(e,`warn`,``,!0)}error(...e){return this.forward(e,`error`,``)}deprecate(...e){return this.forward(e,`warn`,`WARNING DEPRECATED: `,!0)}forward(e,t,n,r){return r&&!this.debug?null:(e=e.map(e=>B(e)?e.replace(/[\r\n\x00-\x1F\x7F]/g,` `):e),B(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t||=this.options,t.prefix=t.prefix||this.prefix,new e(this.logger,t)}},li=class{constructor(){this.observers={}}on(e,t){return e.split(` `).forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}once(e,t){let n=(...r)=>{t(...r),this.off(e,n)};return this.on(e,n),this}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers[`*`]&&Array.from(this.observers[`*`].entries()).forEach(([n,r])=>{for(let i=0;i<r;i++)n(e,...t)})}},ui=new WeakSet,di=class extends li{constructor(e,t={ns:[`translation`],defaultNS:`translation`}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.includes(e)||this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){let i=r.keySeparator===void 0?this.options.keySeparator:r.keySeparator,a=r.ignoreJSONStructure===void 0?this.options.ignoreJSONStructure:r.ignoreJSONStructure,o;e.includes(`.`)?o=e.split(`.`):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):B(n)&&i?o.push(...n.split(i)):o.push(n)));let s=U(this.data,o);return!s&&!t&&!n&&e.includes(`.`)&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!B(n)?s:si(this.data?.[e]?.[t],n,i)}addResource(e,t,n,r,i={silent:!1}){let a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.includes(`.`)&&(o=e.split(`.`),r=t,t=o[1]),this.addNamespaces(t),Zr(this.data,o,r),i.silent||this.emit(`added`,e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(let r in n)(B(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit(`added`,e,t,n)}addResourceBundle(e,t,n,r,i,a={silent:!1,skipCopy:!1}){let o=[e,t];e.includes(`.`)&&(o=e.split(`.`),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=U(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?ei(s,n,i):s={...s,...n},Zr(this.data,o,s),a.silent||this.emit(`added`,e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit(`removed`,e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||=this.options.defaultNS,this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>{let n=t[e];return ui.has(n)?!0:!n||Object.keys(n).length===0?!1:(typeof n==`object`&&ui.add(n),!0)})}toJSON(){return this.data}},fi={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,i)??t}),t}},pi=Symbol(`i18next/PATH_KEY`);function mi(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===pi?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function q(e,t){let{[pi]:n}=e(mi()),r=t?.keySeparator??`.`,i=t?.nsSeparator??`:`,a=t?.enableSelector===`strict`;if(n.length>1&&i){let e=t?.ns,o=a?Array.isArray(e)?e:e?[e]:null:Array.isArray(e)?e:null;if(o&&(a?o:o.length>1?o.slice(1):[]).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}var hi=e=>!B(e)&&typeof e!=`boolean`&&typeof e!=`number`,gi=class e extends li{constructor(e,t={}){super(),qr([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=K.create(`translator`),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(e==null)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let i=hi(r.res);return!(n.returnObjects===!1&&i)}extractFromKey(e,t){let n=t.nsSeparator===void 0?this.options.nsSeparator:t.nsSeparator;n===void 0&&(n=`:`);let r=t.keySeparator===void 0?this.options.keySeparator:t.keySeparator,i=t.ns||this.options.defaultNS||[],a=n&&e.includes(n),o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!oi(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:B(i)?[i]:i};let a=e.split(n);(n!==r||n===r&&this.options.ns.includes(a[0]))&&(i=a.shift()),e=a.join(r)}return{key:e,namespaces:B(i)?[i]:i}}translate(t,n,r){let i=typeof n==`object`?{...n}:n;if(typeof i!=`object`&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i==`object`&&(i={...i}),i||={},t==null)return``;typeof t==`function`&&(t=q(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>typeof e==`function`?q(e,{...this.options,...i}):String(e));let a=i.returnDetails===void 0?this.options.returnDetails:i.returnDetails,o=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,{key:s,namespaces:c}=this.extractFromKey(t[t.length-1],i),l=c[c.length-1],u=i.nsSeparator===void 0?this.options.nsSeparator:i.nsSeparator;u===void 0&&(u=`:`);let d=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()===`cimode`)return f?a?{res:`${l}${u}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:`${l}${u}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:s;let p=this.resolve(t,i),m=p?.res,h=p?.usedKey||s,g=p?.exactUsedKey||s,_=[`[object Number]`,`[object Function]`,`[object RegExp]`],v=i.joinArrays===void 0?this.options.joinArrays:i.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,b=i.count!==void 0&&!B(i.count),x=e.hasDefaultValue(i),S=b?this.pluralResolver.getSuffix(d,i.count,i):``,C=i.ordinal&&b?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):``,w=b&&!i.ordinal&&i.count===0,T=w&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${S}`]||i[`defaultValue${C}`]||i.defaultValue,E=m;y&&!m&&x&&(E=T);let ee=hi(E),te=Object.prototype.toString.apply(E);if(y&&E&&ee&&!_.includes(te)&&!(B(v)&&Array.isArray(E))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,E,{...i,ns:c}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(p.res=e,p.usedParams=this.getUsedParamsDetails(i),p):e}if(o){let e=Array.isArray(E),t=e?[]:{},n=e?g:h;for(let e in E)if(Object.prototype.hasOwnProperty.call(E,e)){let r=`${n}${o}${e}`;t[e]=x&&!m?this.translate(r,{...i,defaultValue:hi(T)?T[e]:void 0,joinArrays:!1,ns:c}):this.translate(r,{...i,joinArrays:!1,ns:c}),t[e]===r&&(t[e]=E[e])}m=t}}else if(y&&B(v)&&Array.isArray(m))m=m.join(v),m&&=this.extendTranslation(m,t,i,r);else{let e=!1,n=!1;!this.isValidLookup(m)&&x&&(e=!0,m=T),this.isValidLookup(m)||(n=!0,m=s);let a=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:m,c=x&&T!==m&&this.options.updateMissing;if(n||e||c){if(this.logger.log(c?`updateKey`:`missingKey`,d,l,b&&!c?`${s}${this.pluralResolver.getSuffix(d,i.count,i)}`:s,c?T:m),o){let e=this.resolve(s,{...i,keySeparator:!1});e&&e.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 e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else this.options.saveMissingTo===`all`?e=this.languageUtils.toResolveHierarchy(i.lng||this.language):e.push(i.lng||this.language);let n=(e,t,n)=>{let r=x&&n!==m?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,r,c,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,r,c,i),this.emit(`missingKey`,e,l,t,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,i);w&&i[`defaultValue${this.options.pluralSeparator}zero`]&&!t.includes(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],s+t,i[`defaultValue${t}`]||T)})}):n(e,s,T))}m=this.extendTranslation(m,t,i,p,r),n&&m===s&&this.options.appendNamespaceToMissingKey&&(m=`${l}${u}${s}`),(n||e)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${s}`:s,e?m:void 0,i))}return a?(p.res=m,p.usedParams=this.getUsedParamsDetails(i),p):m}extendTranslation(e,t,n,r,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let a=B(e)&&(n?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:n.interpolation.skipOnVariables),o;if(a){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let s=n.replace&&!B(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),a){let t=e.match(this.interpolator.nestingRegexp),r=t&&t.length;o<r&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...e)=>i?.[0]===e[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null):this.translate(...e,t),n)),n.interpolation&&this.interpolator.reset()}let a=n.postProcess||this.options.postProcess,o=B(a)?[a]:a;return e!=null&&o?.length&&n.applyPostProcessor!==!1&&(e=fi.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,i,a,o;return B(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>typeof e==`function`?q(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),c=s.key;r=c;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));let u=t.count!==void 0&&!B(t.count),d=u&&!t.ordinal&&t.count===0,f=t.context!==void 0&&(B(t.context)||typeof t.context==`number`)&&t.context!==``,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(e=>{this.isValidLookup(n)||(o=e,!this.checkedLoadedFor[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(this.checkedLoadedFor[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(`, `)}" won't get resolved as namespace "${o}" 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!!!`)),p.forEach(r=>{if(this.isValidLookup(n))return;a=r;let o=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,c,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&e.startsWith(i)&&o.push(c+e.replace(i,this.options.pluralSeparator)),o.push(c+e),d&&o.push(c+n)),f){let r=`${c}${this.options.contextSeparator||`_`}${t.context}`;o.push(r),u&&(t.ordinal&&e.startsWith(i)&&o.push(r+e.replace(i,this.options.pluralSeparator)),o.push(r+e),d&&o.push(r+n))}}let s;for(;s=o.pop();)this.isValidLookup(n)||(i=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e===``)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){let t=[`defaultValue`,`ordinal`,`context`,`replace`,`lng`,`lngs`,`fallbackLng`,`ns`,`keySeparator`,`nsSeparator`,`returnObjects`,`returnDetails`,`joinArrays`,`postProcess`,`interpolation`],n=e.replace&&!B(e.replace),r=n?e.replace:e;if(n&&e.count!==void 0&&(r={...r,count:e.count}),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(let e of t)delete r[e]}return r}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.startsWith(`defaultValue`)&&e[t]!==void 0)return!0;return!1}},_i=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=K.create(`languageUtils`),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(e){if(e=G(e),!e||!e.includes(`-`))return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=G(e),!e||!e.includes(`-`))return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(B(e)&&e.includes(`-`)){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load===`languageOnly`||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>e===r?!0:!e.includes(`-`)&&!r.includes(`-`)?!1:!!(e.includes(`-`)&&!r.includes(`-`)&&e.slice(0,e.indexOf(`-`))===r||e.startsWith(r)&&r.length>1))}),t||=this.getFallbackCodes(this.options.fallbackLng)[0],t}getFallbackCodes(e,t){if(!e)return[];if(typeof e==`function`&&(e=e(t)),B(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||=e[this.getScriptPartFromCode(t)],n||=e[this.formatLanguageCode(t)],n||=e[this.getLanguagePartFromCode(t)],n||=e.default,n||[]}toResolveHierarchy(e,t){let n=this.options.fallbackLng,r=Array.isArray(n)?n.join(`|`):n;r!==this._cachedFallbackLng&&(this.resolveHierarchyCache={},this._cachedFallbackLng=r);let i=t===void 0||t===!1||B(t),a=t===void 0&&typeof this.options.fallbackLng==`function`,o=B(e)&&i&&!a,s=null;if(o){let n;n=t===void 0?`undefined`:t===!1?`boolean:false`:`string:${t}`,s=`${e.length}:${e}|${n}`}if(s!==null){let e=this.resolveHierarchyCache[s];if(e!==void 0)return e.slice()}let c=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),l=[],u=e=>{e&&(this.isSupportedCode(e)?l.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return B(e)&&(e.includes(`-`)||e.includes(`_`))?(this.options.load!==`languageOnly`&&u(this.formatLanguageCode(e)),this.options.load!==`languageOnly`&&this.options.load!==`currentOnly`&&u(this.getScriptPartFromCode(e)),this.options.load!==`currentOnly`&&u(this.getLanguagePartFromCode(e))):B(e)&&u(this.formatLanguageCode(e)),c.forEach(e=>{let t=this.formatLanguageCode(e);l.includes(t)||u(t)}),s===null?l:(this.resolveHierarchyCache[s]=l,l.slice())}},vi={zero:0,one:1,two:2,few:3,many:4,other:5},yi={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},bi=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=K.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=G(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch{if(typeof Intl>`u`)return this.logger.error(`No Intl support, please use an Intl polyfill!`),yi;if(!e.match(/-|_/))return yi;let n=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(n,t)}return this.pluralRulesCache[i]=a,a}needsPlural(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?n.resolvedOptions().pluralCategories.sort((e,t)=>vi[e]-vi[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:``}${e}`):[]}getSuffix(e,t,n={}){let r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:``}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix(`dev`,t,n))}},xi=(e,t,n,r=`.`,i=!0)=>{let a=$r(e,t,n);return!a&&i&&B(n)&&(a=si(e,n,r),a===void 0&&(a=si(t,n,r))),a},Si=e=>e.replace(/\$/g,`$$$$`),Ci=class{constructor(e={}){this.logger=K.create(`interpolator`),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||={escapeValue:!0};let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:_}=e.interpolation;this.escape=t===void 0?ni:t,this.escapeValue=n===void 0||n,this.useRawValueToEscape=r!==void 0&&r,this.prefix=i?W(i):a||`{{`,this.suffix=o?W(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u?W(u):`-`,this.unescapeSuffix=this.unescapePrefix?``:l?W(l):``,this.nestingPrefix=d?W(d):f||W(`$t(`),this.nestingSuffix=p?W(p):m||W(`)`),this.nestingOptionsSeparator=h||`,`,this.maxReplaces=g||1e3,this.alwaysFormat=_!==void 0&&_,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,`g`);this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']|"[^"]*"|'[^']*'|\\((?:[^()"']|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,a,o,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(!e.includes(this.formatSeparator)){let i=xi(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),a=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(xi(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...r,...t,interpolationkey:a})};this.resetRegExp(),!this.escapeValue&&typeof e==`string`&&/\$t\([^)]*\{[^}]*\{\{/.test(e)&&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.`);let l=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=r?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:r.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>e},{regex:this.regexp,safeValue:e=>this.escapeValue?this.escape(e):e}].forEach(t=>{for(o=0;i=t.regex.exec(e);){let n=i[1].trim();if(a=c(n),a===void 0){if(typeof l==`function`){let t=l(e,i,r);a=B(t)?t:``}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a=``;else if(u){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=``}else!B(a)&&!this.useRawValueToEscape&&(a=Kr(a));let s=t.safeValue(a);if(e=e.replace(i[0],Si(s)),u?(t.regex.lastIndex+=s.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,i,a,o=(e,t)=>{let n=this.nestingOptionsSeparator;if(!e.includes(n))return e;let r=e.split(RegExp(`${W(n)}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,a);let o=i.match(/'/g),s=i.match(/"/g);((o?.length??0)%2==0&&!s||(s?.length??0)%2!=0)&&(i=i.replace(/'/g,`"`));try{a=JSON.parse(i),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return a.defaultValue&&a.defaultValue.includes(this.prefix)&&delete a.defaultValue,e},s=new RegExp(this.nestingRegexp),c=``,l=0;for(;r=s.exec(e);){let u=[];a={...n},a=a.replace&&!B(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let d=/{.*}/s.test(r[1])?r[1].lastIndexOf(`}`)+1:r[1].indexOf(this.formatSeparator);if(d!==-1&&(u=r[1].slice(d).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,d)),i=t(o.call(this,r[1].trim(),a),a),i&&r[0]===e&&!B(i))return i;B(i)||(i=Kr(i)),i||=(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),``),u.length&&(i=u.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),i.trim())),c+=e.slice(l,r.index)+Kr(i),l=s.lastIndex,this.regexp.lastIndex=0}return l?c+e.slice(l):e}},wi=e=>{let t=e.toLowerCase().trim(),n={};if(e.includes(`(`)){let r=e.split(`(`);t=r[0].toLowerCase().trim();let i=r[1].slice(0,-1);t===`currency`&&!i.includes(`:`)?n.currency||=i.trim():t===`relativetime`&&!i.includes(`:`)?n.range||=i.trim():i.split(`;`).forEach(e=>{if(e){let[t,...r]=e.split(`:`),i=r.join(`:`).trim().replace(/^'+|'+$/g,``),a=t.trim();n[a]||(n[a]=i),i===`false`&&(n[a]=!1),i===`true`&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},Ti=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});let o=r+JSON.stringify(a),s=t[o];return s||(s=e(G(r),i),t[o]=s),s(n)}},Ei=e=>(t,n,r)=>e(G(n),r)(t),Di=class{constructor(e={}){this.logger=K.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?Ti:Ei;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:`currency`});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||`day`)}),list:n((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Ti(t)}format(e,t,n,r={}){if(!t||e==null)return e;let i=t.split(this.formatSeparator),a=[];for(let e=0;e<i.length;e++){let t=i[e];for(;t.indexOf(`(`)>-1&&!t.includes(`)`)&&e+1<i.length;)t=`${t}${this.formatSeparator}${i[++e]}`;a.push(t)}return a.reduce((e,t)=>{let{formatName:i,formatOptions:a}=wi(t);if(this.formats[i]){let t=e;try{let o=r?.formatParams?.[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...a,...r,...o})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${i}`),e},e)}},Oi=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},ki=class extends li{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=K.create(`backendConnector`),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{Qr(n.loaded,[i],a),Oi(n,e),t&&n.errors.push(t),n.pendingCount===0&&!n.done&&(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{o[e][t]===void 0&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit(`loaded`,o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,i=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});return}this.readingCalls++;let o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}o&&s&&r<this.maxRetries?setTimeout(()=>{this.read(e,t,n,r+1,i*2,a)},i):a(o,s)},s=this.backend[n].bind(this.backend);if(s.length===2)try{let n=s(e,t);n&&typeof n.then==`function`?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(e){o(e)}else return s(e,t,o)}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`),r&&r();B(e)&&(e=this.languageUtils.toResolveHierarchy(e)),B(t)&&(t=[t]);let i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=``){let n=e.split(`|`),r=n[0],i=n[1];this.read(r,i,`read`,void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,i,a={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t))this.logger.warn(`did not save key "${n}" as the namespace "${t}" 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!!!`);else if(n!=null&&n!==``){if(this.backend?.create){let s={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let i;i=c.length===5?c(e,t,n,r,s):c(e,t,n,r),i&&typeof i.then==`function`?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}else c(e,t,n,r,o,s)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}},Ai=()=>({debug:!1,initAsync:!0,ns:[`translation`],defaultNS:[`translation`],fallbackLng:[`dev`],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:`all`,preload:!1,keySeparator:`.`,nsSeparator:`:`,pluralSeparator:`_`,contextSeparator:`_`,enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:`fallback`,saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]==`object`&&(t=e[1]),B(e[1])&&(t.defaultValue=e[1]),B(e[2])&&(t.tDescription=e[2]),typeof e[2]==`object`||typeof e[3]==`object`){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,prefix:`{{`,suffix:`}}`,formatSeparator:`,`,unescapePrefix:`-`,nestingPrefix:`$t(`,nestingSuffix:`)`,nestingOptionsSeparator:`,`,maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),ji=e=>(B(e.ns)&&(e.ns=[e.ns]),B(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),B(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes(`cimode`)&&(e.supportedLngs=e.supportedLngs.concat([`cimode`])),e),Mi=()=>{},Ni=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},J=class e extends li{constructor(e={},t){if(super(),this.options=ji(e),this.services={},this.logger=K,this.modules={external:[]},Ni(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e==`function`&&(t=e,e={}),e.defaultNS==null&&e.ns&&(B(e.ns)?e.defaultNS=e.ns:e.ns.includes(`translation`)||(e.defaultNS=e.ns[0]));let n=Ai();this.options={...n,...this.options,...ji(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!=`function`&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler);let r=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?K.init(r(this.modules.logger),this.options):K.init(null,this.options);let e;e=this.modules.formatter?this.modules.formatter:Di;let t=new _i(this.options);this.store=new di(this.options.resources,this.options);let n=this.services;n.logger=K,n.resourceStore=this.store,n.languageUtils=t,n.pluralResolver=new bi(t,{prepend:this.options.pluralSeparator}),e&&(n.formatter=r(e),n.formatter.init&&n.formatter.init(n,this.options),this.options.interpolation.format=n.formatter.format.bind(n.formatter)),n.interpolator=new Ci(this.options),n.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},n.backendConnector=new ki(r(this.modules.backend),n.resourceStore,n,this.options),n.backendConnector.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(n.languageDetector=r(this.modules.languageDetector),n.languageDetector.init&&n.languageDetector.init(n,this.options.detection,this.options)),this.modules.i18nFormat&&(n.i18nFormat=r(this.modules.i18nFormat),n.i18nFormat.init&&n.i18nFormat.init(this)),this.translator=new gi(this.services,this.options),this.translator.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||=Mi,this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!==`dev`&&(this.options.lng=e[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn(`init: no languageDetector is used and no lng is defined`),[`getResource`,`hasResourceBundle`,`getResourceBundle`,`getDataByLanguage`].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),[`addResource`,`addResources`,`addResourceBundle`,`removeResourceBundle`].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let i=V(),a=()=>{let e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn(`init: i18next is already initialized. You should call init just once!`),this.isInitialized=!0,this.options.isClone||this.logger.log(`initialized`,this.options),this.emit(`initialized`,this.options),i.resolve(n),t(e,n)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),i}loadResources(e,t=Mi){let n=t,r=B(e)?e:this.language;if(typeof e==`function`&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()===`cimode`&&(!this.options.preload||this.options.preload.length===0))return n();let e=[],t=t=>{t&&t!==`cimode`&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{t!==`cimode`&&(e.includes(t)||e.push(t))})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{!e&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=V();return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e||=this.languages,t||=this.options.ns,n||=Mi,this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);if(!e.type)throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);return e.type===`backend`&&(this.modules.backend=e),(e.type===`logger`||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type===`languageDetector`&&(this.modules.languageDetector=e),e.type===`i18nFormat`&&(this.modules.i18nFormat=e),e.type===`postProcessor`&&fi.addPostProcessor(e),e.type===`formatter`&&(this.modules.formatter=e),e.type===`3rdParty`&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&![`cimode`,`dev`].includes(e)){for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(![`cimode`,`dev`].includes(t)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&!this.languages.includes(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let n=V();this.emit(`languageChanging`,e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,a)=>{a?this.isLanguageChangingTo===e&&(r(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit(`languageChanged`,a),this.logger.log(`languageChanged`,a)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},a=t=>{!e&&!t&&this.services.languageDetector&&(t=[]);let n=B(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(B(t)?[t]:t);a&&(this.language||r(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,e=>{i(e,a)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),n}getFixedT(e,t,n,r){let i=r?.scopeNs,a=(e,t,...r)=>{let o;o=typeof t==`object`?{...t}:this.options.overloadTranslationOptionHandler([e,t].concat(r)),o.lng=o.lng||a.lng,o.lngs=o.lngs||a.lngs;let s=o.ns!==void 0&&o.ns!==null;o.ns=o.ns||a.ns,o.keyPrefix!==``&&(o.keyPrefix=o.keyPrefix||n||a.keyPrefix);let c={...this.options,...o};Array.isArray(i)&&!s&&(c.ns=i),typeof o.keyPrefix==`function`&&(o.keyPrefix=q(o.keyPrefix,c));let l=this.options.keySeparator||`.`,u;return o.keyPrefix&&Array.isArray(e)?u=e.map(e=>(typeof e==`function`&&(e=q(e,c)),`${o.keyPrefix}${l}${e}`)):(typeof e==`function`&&(e=q(e,c)),u=o.keyPrefix?`${o.keyPrefix}${l}${e}`:e),this.t(u,o)};return B(e)?a.lng=e:a.lngs=e,a.ns=t,a.keyPrefix=n,a}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn(`hasLoadedNamespace: i18next was not initialized`,this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn(`hasLoadedNamespace: i18n.languages were undefined or empty`,this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()===`cimode`)return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return n===-1||n===0||n===2};if(t.precheck){let e=t.precheck(this,a);if(e!==void 0)return e}if(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages)return!0;let{languageUtils:o}=this.services,s=t.lng?o.isSupportedCode(n)&&o.toResolveHierarchy(n,!1)[0]:n;return!(s&&!a(s,e)||r&&!a(i,e))}loadNamespaces(e,t){let n=V();return this.options.ns?(B(e)&&(e=[e]),e.forEach(e=>{this.options.ns.includes(e)||this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=V();B(e)&&(e=[e]);let r=this.options.preload||[],i=e.filter(e=>!r.includes(e)&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language),!e)return`rtl`;try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch{}let t=`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`.split(`.`),n=this.services?.languageUtils||new _i(Ai());return e.toLowerCase().indexOf(`-latn`)>1?`ltr`:t.includes(n.getLanguagePartFromCode(e))||e.toLowerCase().indexOf(`-arab`)>1?`rtl`:`ltr`}static createInstance(t={},n){let r=new e(t,n);return r.createInstance=e.createInstance,r}cloneInstance(t={},n=Mi){let r=t.forkResourceStore;r&&delete t.forkResourceStore;let i={...this.options,preload:!1,...t,isClone:!0},a=new e(i);if((t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),[`store`,`services`,`language`].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new di(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{}),i),a.services.resourceStore=a.store),t.interpolation){let e={...Ai().interpolation,...this.options.interpolation,...t.interpolation},n={...i,interpolation:e};a.services.interpolator=new Ci(n)}return a.translator=new gi(a.services,i),a.translator.on(`*`,(e,...t)=>{a.emit(e,...t)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}.createInstance();J.createInstance,J.dir,J.init,J.loadResources,J.reloadResources,J.use,J.changeLanguage,J.getFixedT,J.t,J.exists,J.setDefaultNamespace,J.hasLoadedNamespace,J.loadNamespaces,J.loadLanguages;var Pi=({locale:e,asyncMessagesLoader:t,messages:n,useSuspense:r=!1,disableAutoInit:i=!1,bindI18n:a},{icu:o}={})=>{let s={lng:e,fallbackLng:`en`,keySeparator:!1,react:{useSuspense:r,bindI18n:a},_polyfill:{isLoading:!1}},c=J.createInstance(i?s:void 0);return o&&c.use(o),t&&c.use({type:`backend`,read:async(e,n,r)=>{try{return r(null,await t(e))}catch(e){return r(e,null)}}}),n&&(s.resources={[e]:{translation:n}}),i||c.init(s),c};function Fi(e,t){let n=t&&t.cache?t.cache:Gi,r=t&&t.serializer?t.serializer:Ui;return(t&&t.strategy?t.strategy:Bi)(e,{cache:n,serializer:r})}function Ii(e){return e==null||typeof e==`number`||typeof e==`boolean`}function Li(e,t,n,r){let i=Ii(r)?r:n(r),a=t.get(i);return a===void 0&&(a=e.call(this,r),t.set(i,a)),a}function Ri(e,t,n){let r=Array.prototype.slice.call(arguments,3),i=n(r),a=t.get(i);return a===void 0&&(a=e.apply(this,r),t.set(i,a)),a}function zi(e,t,n,r,i){return n.bind(t,e,r,i)}function Bi(e,t){let n=e.length===1?Li:Ri;return zi(e,this,n,t.cache.create(),t.serializer)}function Vi(e,t){return zi(e,this,Ri,t.cache.create(),t.serializer)}function Hi(e,t){return zi(e,this,Li,t.cache.create(),t.serializer)}var Ui=function(){return JSON.stringify(arguments)},Wi=class{constructor(){this.cache=Object.create(null)}get(e){return this.cache[e]}set(e,t){this.cache[e]=t}},Gi={create:function(){return new Wi}},Ki={variadic:Vi,monadic:Hi},qi=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function Ji(e){let t={};return e.replace(qi,e=>{let n=e.length;switch(e[0]){case`G`:t.era=n===4?`long`:n===5?`narrow`:`short`;break;case`y`:t.year=n===2?`2-digit`:`numeric`;break;case`Y`:case`u`:case`U`:case`r`:throw RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case`q`:case`Q`:throw RangeError("`q/Q` (quarter) patterns are not supported");case`M`:case`L`:t.month=[`numeric`,`2-digit`,`short`,`long`,`narrow`][n-1];break;case`w`:case`W`:throw RangeError("`w/W` (week) patterns are not supported");case`d`:t.day=[`numeric`,`2-digit`][n-1];break;case`D`:case`F`:case`g`:throw RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case`E`:t.weekday=n===4?`long`:n===5?`narrow`:`short`;break;case`e`:if(n<4)throw RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=[`short`,`long`,`narrow`,`short`][n-3];break;case`c`:if(n<4)throw RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=[`short`,`long`,`narrow`,`short`][n-3];break;case`a`:t.hour12=!0;break;case`b`:case`B`:throw RangeError("`b/B` (period) patterns are not supported, use `a` instead");case`h`:t.hourCycle=`h12`,t.hour=[`numeric`,`2-digit`][n-1];break;case`H`:t.hourCycle=`h23`,t.hour=[`numeric`,`2-digit`][n-1];break;case`K`:t.hourCycle=`h11`,t.hour=[`numeric`,`2-digit`][n-1];break;case`k`:t.hourCycle=`h24`,t.hour=[`numeric`,`2-digit`][n-1];break;case`j`:case`J`:case`C`:throw RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case`m`:t.minute=[`numeric`,`2-digit`][n-1];break;case`s`:t.second=[`numeric`,`2-digit`][n-1];break;case`S`:case`A`:throw RangeError("`S/A` (second) patterns are not supported, use `s` instead");case`z`:t.timeZoneName=n<4?`short`:`long`;break;case`Z`:case`O`:case`v`:case`V`:case`X`:case`x`:throw RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return``}),t}var Yi=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function Xi(e){if(e.length===0)throw Error(`Number skeleton cannot be empty`);let t=e.split(Yi).filter(e=>e.length>0),n=[];for(let e of t){let t=e.split(`/`);if(t.length===0)throw Error(`Invalid number skeleton`);let[r,...i]=t;for(let e of i)if(e.length===0)throw Error(`Invalid number skeleton`);n.push({stem:r,options:i})}return n}function Zi(e){return e.replace(/^(.*?)-/,``)}var Qi=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,$i=/^(@+)?(\+|#+)?[rs]?$/g,ea=/(\*)(0+)|(#+)(0+)|(0+)/g,ta=/^(0+)$/;function na(e){let t={};return e[e.length-1]===`r`?t.roundingPriority=`morePrecision`:e[e.length-1]===`s`&&(t.roundingPriority=`lessPrecision`),e.replace($i,function(e,n,r){return typeof r==`string`?r===`+`?t.minimumSignificantDigits=n.length:n[0]===`#`?t.maximumSignificantDigits=n.length:(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length+(typeof r==`string`?r.length:0)):(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length),``}),t}function ra(e){switch(e){case`sign-auto`:return{signDisplay:`auto`};case`sign-accounting`:case`()`:return{currencySign:`accounting`};case`sign-always`:case`+!`:return{signDisplay:`always`};case`sign-accounting-always`:case`()!`:return{signDisplay:`always`,currencySign:`accounting`};case`sign-except-zero`:case`+?`:return{signDisplay:`exceptZero`};case`sign-accounting-except-zero`:case`()?`:return{signDisplay:`exceptZero`,currencySign:`accounting`};case`sign-never`:case`+_`:return{signDisplay:`never`}}}function ia(e){let t;if(e[0]===`E`&&e[1]===`E`?(t={notation:`engineering`},e=e.slice(2)):e[0]===`E`&&(t={notation:`scientific`},e=e.slice(1)),t){let n=e.slice(0,2);if(n===`+!`?(t.signDisplay=`always`,e=e.slice(2)):n===`+?`&&(t.signDisplay=`exceptZero`,e=e.slice(2)),!ta.test(e))throw Error(`Malformed concise eng/scientific notation`);t.minimumIntegerDigits=e.length}return t}function aa(e){return ra(e)||{}}function oa(e){let t={};for(let n of e){switch(n.stem){case`percent`:case`%`:t.style=`percent`;continue;case`%x100`:t.style=`percent`,t.scale=100;continue;case`currency`:t.style=`currency`,t.currency=n.options[0];continue;case`group-off`:case`,_`:t.useGrouping=!1;continue;case`precision-integer`:case`.`:t.maximumFractionDigits=0;continue;case`measure-unit`:case`unit`:t.style=`unit`,t.unit=Zi(n.options[0]);continue;case`compact-short`:case`K`:t.notation=`compact`,t.compactDisplay=`short`;continue;case`compact-long`:case`KK`:t.notation=`compact`,t.compactDisplay=`long`;continue;case`scientific`:t={...t,notation:`scientific`,...n.options.reduce((e,t)=>({...e,...aa(t)}),{})};continue;case`engineering`:t={...t,notation:`engineering`,...n.options.reduce((e,t)=>({...e,...aa(t)}),{})};continue;case`notation-simple`:t.notation=`standard`;continue;case`unit-width-narrow`:t.currencyDisplay=`narrowSymbol`,t.unitDisplay=`narrow`;continue;case`unit-width-short`:t.currencyDisplay=`code`,t.unitDisplay=`short`;continue;case`unit-width-full-name`:t.currencyDisplay=`name`,t.unitDisplay=`long`;continue;case`unit-width-iso-code`:t.currencyDisplay=`symbol`;continue;case`scale`:t.scale=parseFloat(n.options[0]);continue;case`rounding-mode-floor`:t.roundingMode=`floor`;continue;case`rounding-mode-ceiling`:t.roundingMode=`ceil`;continue;case`rounding-mode-down`:t.roundingMode=`trunc`;continue;case`rounding-mode-up`:t.roundingMode=`expand`;continue;case`rounding-mode-half-even`:t.roundingMode=`halfEven`;continue;case`rounding-mode-half-down`:t.roundingMode=`halfTrunc`;continue;case`rounding-mode-half-up`:t.roundingMode=`halfExpand`;continue;case`integer-width`:if(n.options.length>1)throw RangeError(`integer-width stems only accept a single optional option`);n.options[0].replace(ea,function(e,n,r,i,a,o){if(n)t.minimumIntegerDigits=r.length;else if(i&&a)throw Error(`We currently do not support maximum integer digits`);else if(o)throw Error(`We currently do not support exact integer digits`);return``});continue}if(ta.test(n.stem)){t.minimumIntegerDigits=n.stem.length;continue}if(Qi.test(n.stem)){if(n.options.length>1)throw RangeError(`Fraction-precision stems only accept a single optional option`);n.stem.replace(Qi,function(e,n,r,i,a,o){return r===`*`?t.minimumFractionDigits=n.length:i&&i[0]===`#`?t.maximumFractionDigits=i.length:a&&o?(t.minimumFractionDigits=a.length,t.maximumFractionDigits=a.length+o.length):(t.minimumFractionDigits=n.length,t.maximumFractionDigits=n.length),``});let e=n.options[0];e===`w`?t={...t,trailingZeroDisplay:`stripIfInteger`}:e&&(t={...t,...na(e)});continue}if($i.test(n.stem)){t={...t,...na(n.stem)};continue}let e=ra(n.stem);e&&(t={...t,...e});let r=ia(n.stem);r&&(t={...t,...r})}return t}var sa=function(e){return e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]=`EXPECT_ARGUMENT_CLOSING_BRACE`,e[e.EMPTY_ARGUMENT=2]=`EMPTY_ARGUMENT`,e[e.MALFORMED_ARGUMENT=3]=`MALFORMED_ARGUMENT`,e[e.EXPECT_ARGUMENT_TYPE=4]=`EXPECT_ARGUMENT_TYPE`,e[e.INVALID_ARGUMENT_TYPE=5]=`INVALID_ARGUMENT_TYPE`,e[e.EXPECT_ARGUMENT_STYLE=6]=`EXPECT_ARGUMENT_STYLE`,e[e.INVALID_NUMBER_SKELETON=7]=`INVALID_NUMBER_SKELETON`,e[e.INVALID_DATE_TIME_SKELETON=8]=`INVALID_DATE_TIME_SKELETON`,e[e.EXPECT_NUMBER_SKELETON=9]=`EXPECT_NUMBER_SKELETON`,e[e.EXPECT_DATE_TIME_SKELETON=10]=`EXPECT_DATE_TIME_SKELETON`,e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]=`UNCLOSED_QUOTE_IN_ARGUMENT_STYLE`,e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]=`EXPECT_SELECT_ARGUMENT_OPTIONS`,e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]=`EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE`,e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]=`INVALID_PLURAL_ARGUMENT_OFFSET_VALUE`,e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]=`EXPECT_SELECT_ARGUMENT_SELECTOR`,e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]=`EXPECT_PLURAL_ARGUMENT_SELECTOR`,e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]=`EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT`,e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]=`EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT`,e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]=`INVALID_PLURAL_ARGUMENT_SELECTOR`,e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]=`DUPLICATE_PLURAL_ARGUMENT_SELECTOR`,e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]=`DUPLICATE_SELECT_ARGUMENT_SELECTOR`,e[e.MISSING_OTHER_CLAUSE=22]=`MISSING_OTHER_CLAUSE`,e[e.INVALID_TAG=23]=`INVALID_TAG`,e[e.INVALID_TAG_NAME=25]=`INVALID_TAG_NAME`,e[e.UNMATCHED_CLOSING_TAG=26]=`UNMATCHED_CLOSING_TAG`,e[e.UNCLOSED_TAG=27]=`UNCLOSED_TAG`,e}({});function ca(e){return e.type===0}function la(e){return e.type===1}function ua(e){return e.type===2}function da(e){return e.type===3}function fa(e){return e.type===4}function pa(e){return e.type===5}function ma(e){return e.type===6}function ha(e){return e.type===7}function ga(e){return e.type===8}function _a(e){return!!(e&&typeof e==`object`&&e.type===0)}function va(e){return!!(e&&typeof e==`object`&&e.type===1)}var ya=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,Y={"001":[`H`,`h`],419:[`h`,`H`,`hB`,`hb`],AC:[`H`,`h`,`hb`,`hB`],AD:[`H`,`hB`],AE:[`h`,`hB`,`hb`,`H`],AF:[`H`,`hb`,`hB`,`h`],AG:[`h`,`hb`,`H`,`hB`],AI:[`H`,`h`,`hb`,`hB`],AL:[`h`,`H`,`hB`],AM:[`H`,`hB`],AO:[`H`,`hB`],AR:[`h`,`H`,`hB`,`hb`],AS:[`h`,`H`],AT:[`H`,`hB`],AU:[`h`,`hb`,`H`,`hB`],AW:[`H`,`hB`],AX:[`H`],AZ:[`H`,`hB`,`h`],BA:[`H`,`hB`,`h`],BB:[`h`,`hb`,`H`,`hB`],BD:[`h`,`hB`,`H`],BE:[`H`,`hB`],BF:[`H`,`hB`],BG:[`H`,`hB`,`h`],BH:[`h`,`hB`,`hb`,`H`],BI:[`H`,`h`],BJ:[`H`,`hB`],BL:[`H`,`hB`],BM:[`h`,`hb`,`H`,`hB`],BN:[`hb`,`hB`,`h`,`H`],BO:[`h`,`H`,`hB`,`hb`],BQ:[`H`],BR:[`H`,`hB`],BS:[`h`,`hb`,`H`,`hB`],BT:[`h`,`H`],BW:[`H`,`h`,`hb`,`hB`],BY:[`H`,`h`],BZ:[`H`,`h`,`hb`,`hB`],CA:[`h`,`hb`,`H`,`hB`],CC:[`H`,`h`,`hb`,`hB`],CD:[`hB`,`H`],CF:[`H`,`h`,`hB`],CG:[`H`,`hB`],CH:[`H`,`hB`,`h`],CI:[`H`,`hB`],CK:[`H`,`h`,`hb`,`hB`],CL:[`h`,`H`,`hB`,`hb`],CM:[`H`,`h`,`hB`],CN:[`H`,`hB`,`hb`,`h`],CO:[`h`,`H`,`hB`,`hb`],CP:[`H`],CR:[`h`,`H`,`hB`,`hb`],CU:[`h`,`H`,`hB`,`hb`],CV:[`H`,`hB`],CW:[`H`,`hB`],CX:[`H`,`h`,`hb`,`hB`],CY:[`h`,`H`,`hb`,`hB`],CZ:[`H`],DE:[`H`,`hB`],DG:[`H`,`h`,`hb`,`hB`],DJ:[`h`,`H`],DK:[`H`],DM:[`h`,`hb`,`H`,`hB`],DO:[`h`,`H`,`hB`,`hb`],DZ:[`h`,`hB`,`hb`,`H`],EA:[`H`,`h`,`hB`,`hb`],EC:[`h`,`H`,`hB`,`hb`],EE:[`H`,`hB`],EG:[`h`,`hB`,`hb`,`H`],EH:[`h`,`hB`,`hb`,`H`],ER:[`h`,`H`],ES:[`H`,`hB`,`h`,`hb`],ET:[`hB`,`hb`,`h`,`H`],FI:[`H`],FJ:[`h`,`hb`,`H`,`hB`],FK:[`H`,`h`,`hb`,`hB`],FM:[`h`,`hb`,`H`,`hB`],FO:[`H`,`h`],FR:[`H`,`hB`],GA:[`H`,`hB`],GB:[`H`,`h`,`hb`,`hB`],GD:[`h`,`hb`,`H`,`hB`],GE:[`H`,`hB`,`h`],GF:[`H`,`hB`],GG:[`H`,`h`,`hb`,`hB`],GH:[`h`,`H`],GI:[`H`,`h`,`hb`,`hB`],GL:[`H`,`h`],GM:[`h`,`hb`,`H`,`hB`],GN:[`H`,`hB`],GP:[`H`,`hB`],GQ:[`H`,`hB`,`h`,`hb`],GR:[`h`,`H`,`hb`,`hB`],GS:[`H`,`h`,`hb`,`hB`],GT:[`h`,`H`,`hB`,`hb`],GU:[`h`,`hb`,`H`,`hB`],GW:[`H`,`hB`],GY:[`h`,`hb`,`H`,`hB`],HK:[`h`,`hB`,`hb`,`H`],HN:[`h`,`H`,`hB`,`hb`],HR:[`H`,`hB`],HU:[`H`,`h`],IC:[`H`,`h`,`hB`,`hb`],ID:[`H`],IE:[`H`,`h`,`hb`,`hB`],IL:[`H`,`hB`],IM:[`H`,`h`,`hb`,`hB`],IN:[`h`,`H`],IO:[`H`,`h`,`hb`,`hB`],IQ:[`h`,`hB`,`hb`,`H`],IR:[`hB`,`H`],IS:[`H`],IT:[`H`,`hB`],JE:[`H`,`h`,`hb`,`hB`],JM:[`h`,`hb`,`H`,`hB`],JO:[`h`,`hB`,`hb`,`H`],JP:[`H`,`K`,`h`],KE:[`hB`,`hb`,`H`,`h`],KG:[`H`,`h`,`hB`,`hb`],KH:[`hB`,`h`,`H`,`hb`],KI:[`h`,`hb`,`H`,`hB`],KM:[`H`,`h`,`hB`,`hb`],KN:[`h`,`hb`,`H`,`hB`],KP:[`h`,`H`,`hB`,`hb`],KR:[`h`,`H`,`hB`,`hb`],KW:[`h`,`hB`,`hb`,`H`],KY:[`h`,`hb`,`H`,`hB`],KZ:[`H`,`hB`],LA:[`H`,`hb`,`hB`,`h`],LB:[`h`,`hB`,`hb`,`H`],LC:[`h`,`hb`,`H`,`hB`],LI:[`H`,`hB`,`h`],LK:[`H`,`h`,`hB`,`hb`],LR:[`h`,`hb`,`H`,`hB`],LS:[`h`,`H`],LT:[`H`,`h`,`hb`,`hB`],LU:[`H`,`h`,`hB`],LV:[`H`,`hB`,`hb`,`h`],LY:[`h`,`hB`,`hb`,`H`],MA:[`H`,`h`,`hB`,`hb`],MC:[`H`,`hB`],MD:[`H`,`hB`],ME:[`H`,`hB`,`h`],MF:[`H`,`hB`],MG:[`H`,`h`],MH:[`h`,`hb`,`H`,`hB`],MK:[`H`,`h`,`hb`,`hB`],ML:[`H`],MM:[`hB`,`hb`,`H`,`h`],MN:[`H`,`h`,`hb`,`hB`],MO:[`h`,`hB`,`hb`,`H`],MP:[`h`,`hb`,`H`,`hB`],MQ:[`H`,`hB`],MR:[`h`,`hB`,`hb`,`H`],MS:[`H`,`h`,`hb`,`hB`],MT:[`H`,`h`],MU:[`H`,`h`],MV:[`H`,`h`],MW:[`h`,`hb`,`H`,`hB`],MX:[`h`,`H`,`hB`,`hb`],MY:[`hb`,`hB`,`h`,`H`],MZ:[`H`,`hB`],NA:[`h`,`H`,`hB`,`hb`],NC:[`H`,`hB`],NE:[`H`],NF:[`H`,`h`,`hb`,`hB`],NG:[`H`,`h`,`hb`,`hB`],NI:[`h`,`H`,`hB`,`hb`],NL:[`H`,`hB`],NO:[`H`,`h`],NP:[`H`,`h`,`hB`],NR:[`H`,`h`,`hb`,`hB`],NU:[`H`,`h`,`hb`,`hB`],NZ:[`h`,`hb`,`H`,`hB`],OM:[`h`,`hB`,`hb`,`H`],PA:[`h`,`H`,`hB`,`hb`],PE:[`h`,`H`,`hB`,`hb`],PF:[`H`,`h`,`hB`],PG:[`h`,`H`],PH:[`h`,`hB`,`hb`,`H`],PK:[`h`,`hB`,`H`],PL:[`H`,`h`],PM:[`H`,`hB`],PN:[`H`,`h`,`hb`,`hB`],PR:[`h`,`H`,`hB`,`hb`],PS:[`h`,`hB`,`hb`,`H`],PT:[`H`,`hB`],PW:[`h`,`H`],PY:[`h`,`H`,`hB`,`hb`],QA:[`h`,`hB`,`hb`,`H`],RE:[`H`,`hB`],RO:[`H`,`hB`],RS:[`H`,`hB`,`h`],RU:[`H`],RW:[`H`,`h`],SA:[`h`,`hB`,`hb`,`H`],SB:[`h`,`hb`,`H`,`hB`],SC:[`H`,`h`,`hB`],SD:[`h`,`hB`,`hb`,`H`],SE:[`H`],SG:[`h`,`hb`,`H`,`hB`],SH:[`H`,`h`,`hb`,`hB`],SI:[`H`,`hB`],SJ:[`H`],SK:[`H`],SL:[`h`,`hb`,`H`,`hB`],SM:[`H`,`h`,`hB`],SN:[`H`,`h`,`hB`],SO:[`h`,`H`],SR:[`H`,`hB`],SS:[`h`,`hb`,`H`,`hB`],ST:[`H`,`hB`],SV:[`h`,`H`,`hB`,`hb`],SX:[`H`,`h`,`hb`,`hB`],SY:[`h`,`hB`,`hb`,`H`],SZ:[`h`,`hb`,`H`,`hB`],TA:[`H`,`h`,`hb`,`hB`],TC:[`h`,`hb`,`H`,`hB`],TD:[`h`,`H`,`hB`],TF:[`H`,`h`,`hB`],TG:[`H`,`hB`],TH:[`H`,`h`],TJ:[`H`,`h`],TL:[`H`,`hB`,`hb`,`h`],TM:[`H`,`h`],TN:[`h`,`hB`,`hb`,`H`],TO:[`h`,`H`],TR:[`H`,`hB`],TT:[`h`,`hb`,`H`,`hB`],TW:[`hB`,`hb`,`h`,`H`],TZ:[`hB`,`hb`,`H`,`h`],UA:[`H`,`hB`,`h`],UG:[`hB`,`hb`,`H`,`h`],UM:[`h`,`hb`,`H`,`hB`],US:[`h`,`hb`,`H`,`hB`],UY:[`h`,`H`,`hB`,`hb`],UZ:[`H`,`hB`,`h`],VA:[`H`,`h`,`hB`],VC:[`h`,`hb`,`H`,`hB`],VE:[`h`,`H`,`hB`,`hb`],VG:[`h`,`hb`,`H`,`hB`],VI:[`h`,`hb`,`H`,`hB`],VN:[`H`,`h`],VU:[`h`,`H`],WF:[`H`,`hB`],WS:[`h`,`H`],XK:[`H`,`hB`,`h`],YE:[`h`,`hB`,`hb`,`H`],YT:[`H`,`hB`],ZA:[`H`,`h`,`hb`,`hB`],ZM:[`h`,`hb`,`H`,`hB`],ZW:[`H`,`h`],"af-ZA":[`H`,`h`,`hB`,`hb`],"ar-001":[`h`,`hB`,`hb`,`H`],"ca-ES":[`H`,`h`,`hB`],"en-001":[`h`,`hb`,`H`,`hB`],"en-HK":[`h`,`hb`,`H`,`hB`],"en-IL":[`H`,`h`,`hb`,`hB`],"en-MY":[`h`,`hb`,`H`,`hB`],"es-BR":[`H`,`h`,`hB`,`hb`],"es-ES":[`H`,`h`,`hB`,`hb`],"es-GQ":[`H`,`h`,`hB`,`hb`],"fr-CA":[`H`,`h`,`hB`],"gl-ES":[`H`,`h`,`hB`],"gu-IN":[`hB`,`hb`,`h`,`H`],"hi-IN":[`hB`,`h`,`H`],"it-CH":[`H`,`h`,`hB`],"it-IT":[`H`,`h`,`hB`],"kn-IN":[`hB`,`h`,`H`],"ku-SY":[`H`,`hB`],"ml-IN":[`hB`,`h`,`H`],"mr-IN":[`hB`,`hb`,`h`,`H`],"pa-IN":[`hB`,`hb`,`h`,`H`],"ta-IN":[`hB`,`h`,`hb`,`H`],"te-IN":[`hB`,`h`,`H`],"zu-ZA":[`H`,`hB`,`hb`,`h`]};function ba(e,t){let n=``;for(let r=0;r<e.length;r++){let i=e.charAt(r);if(i===`j`){let a=0;for(;r+1<e.length&&e.charAt(r+1)===i;)a++,r++;let o=1+(a&1),s=a<2?1:3+(a>>1),c=xa(t);for((c==`H`||c==`k`)&&(s=0);s-->0;)n+=`a`;for(;o-->0;)n=c+n}else n+=i===`J`?`H`:i}return n}function xa(e){let t=e.hourCycle;if(t===void 0){let n=e;t=n.getHourCycles?.()[0]??n.hourCycles?.[0]}if(t)switch(t){case`h24`:return`k`;case`h23`:return`H`;case`h12`:return`h`;case`h11`:return`K`;default:throw Error(`Invalid hourCycle`)}let n=e.language,r;return n!==`root`&&(r=e.maximize().region),(Y[`${n}-${r}`]||Y[r||``]||Y[n||``]||Y[`${n}-001`]||Y[`001`])[0].charAt(0)}var Sa=RegExp(`^${ya.source}*`),Ca=RegExp(`${ya.source}*$`);function X(e,t){return{start:e,end:t}}var wa=!!Object.fromEntries,Ta=!!String.prototype.trimStart,Ea=!!String.prototype.trimEnd,Da=wa?Object.fromEntries:function(e){let t={};for(let[n,r]of e)t[n]=r;return t},Oa=Ta?function(e){return e.trimStart()}:function(e){return e.replace(Sa,``)},ka=Ea?function(e){return e.trimEnd()}:function(e){return e.replace(Ca,``)},Aa=RegExp(`([^\\p{White_Space}\\p{Pattern_Syntax}]*)`,`yu`);function ja(e,t){return Aa.lastIndex=t,Aa.exec(e)[1]??``}function Ma(e){if(e.length===0)return null;let t=1,n=1;for(let r=0;r<e.length;){let i=e.charCodeAt(r);switch(i){case 35:case 39:case 60:case 123:case 125:return null}if(i===10)t++,n=1,r++;else if(n++,i>=55296&&i<=56319&&r+1<e.length){let t=e.charCodeAt(r+1);r+=t>=56320&&t<=57343?2:1}else r++}return{offset:e.length,line:t,column:n}}var Na=class{constructor(e,t={}){this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}parse(){if(this.offset()!==0)throw Error(`parser can only be used once`);if(this.message.length>0){let e=this.message.charCodeAt(0);if(e!==35&&e!==39&&e!==60&&e!==123&&e!==125){let e=Ma(this.message);if(e){let t=this.clonePosition();return this.position=e,{val:[{type:0,value:this.message,location:X(t,this.clonePosition())}],err:null}}}}return this.parseMessage(0,``,!1)}parseMessage(e,t,n){let r=[];for(;!this.isEOF();){let i=this.char();if(i===123){let t=this.parseArgument(e,n);if(t.err)return t;r.push(t.val)}else if(i===125&&e>0)break;else if(i===35&&(t===`plural`||t===`selectordinal`)){let e=this.clonePosition();this.bump(),r.push({type:7,location:X(e,this.clonePosition())})}else if(i===60&&!this.ignoreTag&&this.peek()===47){if(n)break;return this.error(26,X(this.clonePosition(),this.clonePosition()))}else if(i===60&&!this.ignoreTag&&Pa(this.peek()||0)){let n=this.parseTag(e,t);if(n.err)return n;r.push(n.val)}else{let n=this.parseLiteral(e,t);if(n.err)return n;r.push(n.val)}}return{val:r,err:null}}parseTag(e,t){let n=this.clonePosition();this.bump();let r=this.parseTagName();if(this.bumpSpace(),this.bumpIf(`/>`))return{val:{type:0,value:`<${r}/>`,location:X(n,this.clonePosition())},err:null};if(this.bumpIf(`>`)){let i=this.parseMessage(e+1,t,!0);if(i.err)return i;let a=i.val,o=this.clonePosition();if(this.bumpIf(`</`)){if(this.isEOF()||!Pa(this.char()))return this.error(23,X(o,this.clonePosition()));let e=this.clonePosition();return r===this.parseTagName()?(this.bumpSpace(),this.bumpIf(`>`)?{val:{type:8,value:r,children:a,location:X(n,this.clonePosition())},err:null}:this.error(23,X(o,this.clonePosition()))):this.error(26,X(e,this.clonePosition()))}return this.error(27,X(n,this.clonePosition()))}return this.error(23,X(n,this.clonePosition()))}parseTagName(){let e=this.offset();for(this.bump();!this.isEOF()&&Ia(this.char());)this.bump();return this.message.slice(e,this.offset())}parseLiteral(e,t){let n=this.clonePosition(),r=``;for(;;){let n=this.tryParseQuote(t);if(n){r+=n;continue}let i=this.tryParseUnquoted(e,t);if(i){r+=i;continue}let a=this.tryParseLeftAngleBracket();if(a)r+=a;else break}let i=X(n,this.clonePosition());return{val:{type:0,value:r,location:i},err:null}}tryParseLeftAngleBracket(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!Fa(this.peek()||0))?(this.bump(),`<`):null}tryParseQuote(e){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),`'`;case 123:case 60:case 62:case 125:break;case 35:if(e===`plural`||e===`selectordinal`)break;return null;default:return null}this.bump();let t=[this.char()];for(this.bump();!this.isEOF();){let e=this.char();if(e===39){if(this.peek()===39)t.push(39),this.bump();else{this.bump();break}}else t.push(e);this.bump()}return String.fromCodePoint(...t)}tryParseUnquoted(e,t){if(this.isEOF())return null;let n=this.char();return n===60||n===123||n===35&&(t===`plural`||t===`selectordinal`)||n===125&&e>0?null:(this.bump(),String.fromCodePoint(n))}parseArgument(e,t){let n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(1,X(n,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(2,X(n,this.clonePosition()));let r=this.parseIdentifierIfPossible().value;if(!r)return this.error(3,X(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(1,X(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:1,value:r,location:X(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(1,X(n,this.clonePosition())):this.parseArgumentOptions(e,t,r,n);default:return this.error(3,X(n,this.clonePosition()))}}parseIdentifierIfPossible(){let e=this.clonePosition(),t=this.offset(),n=ja(this.message,t),r=t+n.length;return this.bumpTo(r),{value:n,location:X(e,this.clonePosition())}}parseArgumentOptions(e,t,n,r){let i=this.clonePosition(),a=this.parseIdentifierIfPossible().value,o=this.clonePosition();switch(a){case``:return this.error(4,X(i,o));case`number`:case`date`:case`time`:{this.bumpSpace();let e=null;if(this.bumpIf(`,`)){this.bumpSpace();let t=this.clonePosition(),n=this.parseSimpleArgStyleIfPossible();if(n.err)return n;let r=ka(n.val);if(r.length===0)return this.error(6,X(this.clonePosition(),this.clonePosition()));e={style:r,styleLocation:X(t,this.clonePosition())}}let t=this.tryParseArgumentClose(r);if(t.err)return t;let i=X(r,this.clonePosition());if(e&&e.style.startsWith(`::`)){let t=Oa(e.style.slice(2));if(a===`number`){let r=this.parseNumberSkeletonFromString(t,e.styleLocation);return r.err?r:{val:{type:2,value:n,location:i,style:r.val},err:null}}{if(t.length===0)return this.error(10,i);let r=t;this.locale&&(r=ba(t,this.locale));let o={type:1,pattern:r,location:e.styleLocation,parsedOptions:this.shouldParseSkeletons?Ji(r):{}};return{val:{type:a===`date`?3:4,value:n,location:i,style:o},err:null}}}return{val:{type:a===`number`?2:a===`date`?3:4,value:n,location:i,style:e?.style??null},err:null}}case`plural`:case`selectordinal`:case`select`:{let i=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(`,`))return this.error(12,X(i,{...i}));this.bumpSpace();let o=this.parseIdentifierIfPossible(),s=0;if(a!==`select`&&o.value===`offset`){if(!this.bumpIf(`:`))return this.error(13,X(this.clonePosition(),this.clonePosition()));this.bumpSpace();let e=this.tryParseDecimalInteger(13,14);if(e.err)return e;this.bumpSpace(),o=this.parseIdentifierIfPossible(),s=e.val}let c=this.tryParsePluralOrSelectOptions(e,a,t,o);if(c.err)return c;let l=this.tryParseArgumentClose(r);if(l.err)return l;let u=X(r,this.clonePosition());return a===`select`?{val:{type:5,value:n,options:Da(c.val),location:u},err:null}:{val:{type:6,value:n,options:Da(c.val),offset:s,pluralType:a===`plural`?`cardinal`:`ordinal`,location:u},err:null}}default:return this.error(5,X(i,o))}}tryParseArgumentClose(e){return this.isEOF()||this.char()!==125?this.error(1,X(e,this.clonePosition())):(this.bump(),{val:!0,err:null})}parseSimpleArgStyleIfPossible(){let e=0,t=this.clonePosition();for(;!this.isEOF();)switch(this.char()){case 39:{this.bump();let e=this.clonePosition();if(!this.bumpUntil(`'`))return this.error(11,X(e,this.clonePosition()));this.bump();break}case 123:e+=1,this.bump();break;case 125:if(e>0)--e;else return{val:this.message.slice(t.offset,this.offset()),err:null};break;default:this.bump()}return{val:this.message.slice(t.offset,this.offset()),err:null}}parseNumberSkeletonFromString(e,t){let n=[];try{n=Xi(e)}catch{return this.error(7,t)}return{val:{type:0,tokens:n,location:t,parsedOptions:this.shouldParseSkeletons?oa(n):{}},err:null}}tryParsePluralOrSelectOptions(e,t,n,r){let i=!1,a=[],o=new Set,{value:s,location:c}=r;for(;;){if(s.length===0){let e=this.clonePosition();if(t!==`select`&&this.bumpIf(`=`)){let t=this.tryParseDecimalInteger(16,19);if(t.err)return t;c=X(e,this.clonePosition()),s=this.message.slice(e.offset,this.offset())}else break}if(o.has(s))return this.error(t===`select`?21:20,c);s===`other`&&(i=!0),this.bumpSpace();let r=this.clonePosition();if(!this.bumpIf(`{`))return this.error(t===`select`?17:18,X(this.clonePosition(),this.clonePosition()));let l=this.parseMessage(e+1,t,n);if(l.err)return l;let u=this.tryParseArgumentClose(r);if(u.err)return u;a.push([s,{value:l.val,location:X(r,this.clonePosition())}]),o.add(s),this.bumpSpace(),{value:s,location:c}=this.parseIdentifierIfPossible()}return a.length===0?this.error(t===`select`?15:16,X(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!i?this.error(22,X(this.clonePosition(),this.clonePosition())):{val:a,err:null}}tryParseDecimalInteger(e,t){let n=1,r=this.clonePosition();this.bumpIf(`+`)||this.bumpIf(`-`)&&(n=-1);let i=!1,a=0;for(;!this.isEOF();){let e=this.char();if(e>=48&&e<=57)i=!0,a=a*10+(e-48),this.bump();else break}let o=X(r,this.clonePosition());return i?(a*=n,Number.isSafeInteger(a)?{val:a,err:null}:this.error(t,o)):this.error(e,o)}offset(){return this.position.offset}isEOF(){return this.offset()===this.message.length}clonePosition(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}}char(){let e=this.position.offset;if(e>=this.message.length)throw Error(`out of bound`);let t=this.message.codePointAt(e);if(t===void 0)throw Error(`Offset ${e} is at invalid UTF-16 code unit boundary`);return t}error(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}}bump(){if(this.isEOF())return;let e=this.char();e===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}bumpIf(e){if(this.message.startsWith(e,this.offset())){for(let t=0;t<e.length;t++)this.bump();return!0}return!1}bumpUntil(e){let t=this.offset(),n=this.message.indexOf(e,t);return n>=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)}bumpTo(e){if(this.offset()>e)throw Error(`targetOffset ${e} must be greater than or equal to the current offset ${this.offset()}`);for(e=Math.min(e,this.message.length);;){let t=this.offset();if(t===e)break;if(t>e)throw Error(`targetOffset ${e} is at invalid UTF-16 code unit boundary`);if(this.bump(),this.isEOF())break}}bumpSpace(){for(;!this.isEOF()&&La(this.char());)this.bump()}peek(){if(this.isEOF())return null;let e=this.char(),t=this.offset();return this.message.charCodeAt(t+(e>=65536?2:1))??null}};function Pa(e){return e>=97&&e<=122||e>=65&&e<=90}function Fa(e){return Pa(e)||e===47}function Ia(e){return e===45||e===46||e>=48&&e<=57||e===95||e>=97&&e<=122||e>=65&&e<=90||e==183||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function La(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function Ra(e){e.forEach(e=>{if(delete e.location,pa(e)||ma(e))for(let t in e.options)delete e.options[t].location,Ra(e.options[t].value);else ua(e)&&_a(e.style)||(da(e)||fa(e))&&va(e.style)?delete e.style.location:ga(e)&&Ra(e.children)})}function za(e,t={}){t={shouldParseSkeletons:!0,requiresOtherClause:!0,...t};let n=new Na(e,t).parse();if(n.err){let e=SyntaxError(sa[n.err.kind]);throw e.location=n.err.location,e.originalMessage=n.err.message,e}return t?.captureLocation||Ra(n.val),n.val}var Ba=class extends Error{constructor(e,t,n){super(e),this.code=t,this.originalMessage=n}toString(){return`[formatjs Error: ${this.code}] ${this.message}`}},Va=class extends Ba{constructor(e,t,n,r){super(`Invalid values for "${e}": "${t}". Options are "${Object.keys(n).join(`", "`)}"`,`INVALID_VALUE`,r)}},Ha=class extends Ba{constructor(e,t,n){super(`Value for "${e}" must be of type ${t}`,`INVALID_VALUE`,n)}},Ua=class extends Ba{constructor(e,t){super(`The intl string context variable "${e}" was not provided to the string "${t}"`,`MISSING_VALUE`,t)}};function Wa(e){return e.length<2?e:e.reduce((e,t)=>{let n=e[e.length-1];return!n||n.type!==0||t.type!==0?e.push(t):n.value+=t.value,e},[])}function Ga(e){return typeof e==`function`}function Ka(e,t,n,r,i,a,o){if(e.length===1&&ca(e[0]))return[{type:0,value:e[0].value}];let s=[];for(let c of e){if(ca(c)){s.push({type:0,value:c.value});continue}if(ha(c)){typeof a==`number`&&s.push({type:0,value:n.getNumberFormat(t).format(a)});continue}let{value:e}=c;if(!(i&&e in i))throw new Ua(e,o);let l=i[e];if(la(c))(!l||typeof l==`string`||typeof l==`number`||typeof l==`bigint`)&&(l=typeof l==`string`||typeof l==`number`||typeof l==`bigint`?String(l):``),s.push({type:typeof l==`string`?0:1,value:l});else if(da(c)){let e=typeof c.style==`string`?r.date[c.style]:va(c.style)?c.style.parsedOptions:void 0;s.push({type:0,value:n.getDateTimeFormat(t,e).format(l)})}else if(fa(c)){let e=typeof c.style==`string`?r.time[c.style]:va(c.style)?c.style.parsedOptions:r.time.medium;s.push({type:0,value:n.getDateTimeFormat(t,e).format(l)})}else if(ua(c)){let e=typeof c.style==`string`?r.number[c.style]:_a(c.style)?c.style.parsedOptions:void 0;if(e&&e.scale){let t=e.scale||1;if(typeof l==`bigint`){if(!Number.isInteger(t))throw TypeError(`Cannot apply fractional scale ${t} to bigint value. Scale must be an integer when formatting bigint.`);l*=BigInt(t)}else l*=t}s.push({type:0,value:n.getNumberFormat(t,e).format(l)})}else{if(ga(c)){let{children:e,value:l}=c,u=i[l];if(!Ga(u))throw new Ha(l,`function`,o);let d=u(Ka(e,t,n,r,i,a).map(e=>e.value));Array.isArray(d)||(d=[d]),s.push(...d.map(e=>({type:typeof e==`string`?0:1,value:e})))}if(pa(c)){let e=l,a=(Object.prototype.hasOwnProperty.call(c.options,e)?c.options[e]:void 0)||c.options.other;if(!a)throw new Va(c.value,l,Object.keys(c.options),o);s.push(...Ka(a.value,t,n,r,i))}else if(ma(c)){let e=`=${l}`,a=Object.prototype.hasOwnProperty.call(c.options,e)?c.options[e]:void 0;if(!a){if(!Intl.PluralRules)throw new Ba(`Intl.PluralRules is not available in this environment.
2
2
  Try polyfilling it using "@formatjs/intl-pluralrules"
3
- `,`MISSING_INTL_API`,o);let e=typeof l==`bigint`?Number(l):l,r=n.getPluralRules(t,{type:c.pluralType}).select(e-(c.offset||0));a=(Object.prototype.hasOwnProperty.call(c.options,r)?c.options[r]:void 0)||c.options.other}if(!a)throw new za(c.value,l,Object.keys(c.options),o);let u=typeof l==`bigint`?Number(l):l;s.push(...Y(a.value,t,n,r,i,u-(c.offset||0)))}}}return Ha(s)}function Wa(e,t){return t?{...e,...t,...Object.keys(e).reduce((n,r)=>(n[r]={...e[r],...t[r]},n),{})}:e}function Ga(e,t){return t?Object.keys(e).reduce((n,r)=>(n[r]=Wa(e[r],t[r]),n),{...e}):e}function Ka(e){return{create(){return{get(t){return e[t]},set(t,n){e[t]=n}}}}}function qa(e={number:{},dateTime:{},pluralRules:{}}){return{getNumberFormat:Ni((...e)=>new Intl.NumberFormat(...e),{cache:Ka(e.number),strategy:Wi.variadic}),getDateTimeFormat:Ni((...e)=>new Intl.DateTimeFormat(...e),{cache:Ka(e.dateTime),strategy:Wi.variadic}),getPluralRules:Ni((...e)=>new Intl.PluralRules(...e),{cache:Ka(e.pluralRules),strategy:Wi.variadic})}}var Ja=class e{constructor(t,n=e.defaultLocale,r,i){if(this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=e=>{let t=this.formatToParts(e);if(t.length===1)return t[0].value;let n=t.reduce((e,t)=>(!e.length||t.type!==0||typeof e[e.length-1]!=`string`?e.push(t.value):e[e.length-1]+=t.value,e),[]);return n.length<=1?n[0]||``:n},this.formatToParts=e=>Y(this.ast,this.locales,this.formatters,this.formats,e,void 0,this.message),this.resolvedOptions=()=>({locale:this.resolvedLocale?.toString()||Intl.NumberFormat.supportedLocalesOf(this.locales)[0]}),this.getAst=()=>this.ast,this.locales=n,this.resolvedLocale=e.resolveLocale(n),typeof t==`string`){if(this.message=t,!e.__parse)throw TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");let{...n}=i||{};this.ast=e.__parse(t,{...n,locale:this.resolvedLocale})}else this.ast=t;if(!Array.isArray(this.ast))throw TypeError(`A message must be provided as a String or AST.`);this.formats=Ga(e.formats,r),this.formatters=i&&i.formatters||qa(this.formatterCache)}static{this.memoizedDefaultLocale=null}static get defaultLocale(){return e.memoizedDefaultLocale||=new Intl.NumberFormat().resolvedOptions().locale,e.memoizedDefaultLocale}static{this.resolveLocale=e=>{if(Intl.Locale===void 0)return;let t=Intl.NumberFormat.supportedLocalesOf(e);return t.length>0?new Intl.Locale(t[0]):new Intl.Locale(typeof e==`string`?e:e[0])}}static{this.__parse=La}static{this.formats={number:{integer:{maximumFractionDigits:0},currency:{style:`currency`},percent:{style:`percent`}},date:{short:{month:`numeric`,day:`numeric`,year:`2-digit`},medium:{month:`short`,day:`numeric`,year:`numeric`},long:{month:`long`,day:`numeric`,year:`numeric`},full:{weekday:`long`,month:`long`,day:`numeric`,year:`numeric`}},time:{short:{hour:`numeric`,minute:`numeric`},medium:{hour:`numeric`,minute:`numeric`,second:`numeric`},long:{hour:`numeric`,minute:`numeric`,second:`numeric`,timeZoneName:`short`},full:{hour:`numeric`,minute:`numeric`,second:`numeric`,timeZoneName:`short`}}}}},Ya=[`__proto__`,`constructor`,`prototype`];function Xa(e,t,n){function r(e){return e&&e.indexOf(`###`)>-1?e.replace(/###/g,`.`):e}function i(){return!e||typeof e==`string`}for(var a=typeof t==`string`?t.split(`.`):[].concat(t);a.length>1;){if(i())return{};var o=r(a.shift());if(Ya.indexOf(o)>-1)return{};!e[o]&&n&&(e[o]=new n),e=e[o]}if(i())return{};var s=r(a.shift());return Ya.indexOf(s)>-1?{}:{obj:e,k:s}}function Za(e,t,n){var r=Xa(e,t,Object),i=r.obj,a=r.k;i!==void 0&&(i[a]=n)}function Qa(e,t){var n=Xa(e,t),r=n.obj,i=n.k;if(r)return r[i]}function $a(e){return[...arguments].slice(1).forEach(function(t){if(t)for(var n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];Ya.indexOf(i)>-1||e[i]===void 0&&(e[i]=t[i])}}),e}function eo(e,t){return ao(e)||io(e,t)||no(e,t)||to()}function to(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
4
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function no(e,t){if(e){if(typeof e==`string`)return ro(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ro(e,t):void 0}}function ro(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function io(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function ao(e){if(Array.isArray(e))return e}function oo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function X(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?oo(Object(n),!0).forEach(function(t){so(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oo(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function so(e,t,n){return(t=fo(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function co(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function lo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,fo(r.key),r)}}function uo(e,t,n){return t&&lo(e.prototype,t),n&&lo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function fo(e){var t=po(e,`string`);return Z(t)==`symbol`?t:t+``}function po(e,t){if(Z(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Z(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Z(e){"@babel/helpers - typeof";return Z=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Z(e)}var mo=`https://www.i18next.com/how-to/using-icu-or-mf2`,ho=[`zero`,`one`,`two`,`few`,`many`,`other`];function go(){return{memoize:!0,memoizeFallback:!1,bindI18n:``,bindI18nStore:``,parseErrorHandler:function(e,t,n,r){return n},parseLngForICU:function(e){return e},escapeVariables:!1}}function _o(e,t,n,r){return n&&t&&Z(t)===`object`?`${r} resolved to an object or array, but i18next-icu does not support returnObjects or joinArrays and returns the raw value unformatted.`:n&&typeof t==`string`&&t.indexOf(`{{`)>-1?`${r} could not be parsed (${e.message}). It contains "{{": i18next interpolation like {{name}} does not work with ICU, use {name}.`:`${r} could not be ${n?`parsed`:`formatted`}: ${e.message}`}var vo=function(){function e(t){co(this,e),this.type=`i18nFormat`,this.mem={},this.warned=new Set,this.init(null,t)}return uo(e,[{key:`init`,value:function(e,t){var n=this,r=e&&e.options&&e.options.i18nFormat||{};if(this.options=$a(r,t,this.options||{},go()),this.formats=this.options.formats,e){var i=this.options,a=i.bindI18n,o=i.bindI18nStore,s=i.memoize;e.IntlMessageFormat=Ja,e.ICU=this,this.i18next=e,this.debug=!!(e.options&&e.options.debug),this.debug&&e.options.interpolation&&e.options.interpolation.escapeValue!==!1&&!this.options.escapeVariables&&this.warn(`interpolation.escapeValue is not applied, values are inserted without HTML escaping. Set the i18next-icu option escapeVariables: true to escape them, or interpolation.escapeValue: false if your output is escaped elsewhere (e.g. by React).`),s&&(a&&e.on(a,function(){return n.clearCache()}),o&&e.store.on(o,function(){return n.clearCache()}))}}},{key:`addUserDefinedFormats`,value:function(e){this.formats=this.formats?X(X({},this.formats),e):e,this.clearCache()}},{key:`parse`,value:function(e,t,n,r,i,a){var o=a&&a.resolved&&a.resolved.res,s=this.options.memoize&&[n,r,i],c;if(this.options.memoize){var l=Qa(this.mem,s);l&&l.res===e&&(c=l.fc)}try{c||(this.debug&&typeof e==`string`&&e.indexOf(`$t(`)>-1&&this.firstTime(`nesting ${n} ${r} ${i}`)&&this.warn(`key "${i}" (${n}/${r}) contains "$t(", but i18next-icu does not support nesting, the text is output as is.`),c=new Ja(e,this.options.parseLngForICU(n),this.formats,{ignoreTag:!0}),this.options.memoize&&(this.options.memoizeFallback||!a||o)&&Za(this.mem,s,{res:e,fc:c}));var u=t&&t.replace&&Z(t.replace)===`object`?X(X({},t),t.replace):t;return c.format(this.escapeVariableValues(u))}catch(a){return this.debug&&this.firstTime(`error ${n} ${r} ${i}`)&&this.warn(_o(a,e,!c,`key "${i}" (${n}/${r})`)),this.options.parseErrorHandler(a,i,e,t)}}},{key:`addLookupKeys`,value:function(e,t,n,r,i){return this.debug&&i&&this.checkSuffixKeys(t,n,r,i),e}},{key:`checkSuffixKeys`,value:function(e,t,n,r){var i=r.count,a=r.context,o=this.i18next.options,s=o.pluralSeparator,c=s===void 0?`_`:s,l=o.contextSeparator,u=l===void 0?`_`:l,d=this.i18next.services.resourceStore,f=`key "${e}" (${t}/${n})`;if(i!==void 0&&this.firstTime(`plural ${t} ${n} ${e}`)){var p=ho.concat(ho.map(function(e){return`ordinal${c}${e}`})).map(function(t){return`${e}${c}${t}`}).filter(function(e){return d.getResource(t,n,e)!==void 0});p.length&&this.warn(`${f} was called with count, but i18next-icu does not look up plural suffix keys (${p.join(`, `)}). Put the plural into the message: {count, plural, one {# item} other {# items}}.`)}var m=`${e}${u}${a}`;a!==void 0&&a!==``&&this.firstTime(`context ${t} ${n} ${m}`)&&d.getResource(t,n,m)!==void 0&&this.warn(`${f} was called with context "${a}", but i18next-icu does not look up context keys (${m}). Use a select in the message: {context, select, ${a} {...} other {...}}.`)}},{key:`firstTime`,value:function(e){return!this.warned.has(e)&&(this.warned.add(e),!0)}},{key:`warn`,value:function(e){this.i18next.services.logger.warn(`i18next-icu: ${e} See ${mo}`)}},{key:`clearCache`,value:function(){this.mem={}}},{key:`escapeVariableValues`,value:function(e){if(!this.options.escapeVariables||!e||Z(e)!==`object`)return e;for(var t={},n=0,r=Object.entries(e);n<r.length;n++){var i=eo(r[n],2),a=i[0],o=i[1];t[a]=typeof o==`string`?o.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`):o}return t}}]),e}();vo.type=`i18nFormat`;function yo({icuOptions:e={},...t}){let{parseErrorHandler:n=void 0}=t;return Mi(t,{icu:new vo({parseErrorHandler:n,bindI18n:t.bindI18n,...e})})}var bo=(e,t,n,r)=>{let i=[n,{code:t,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(i,`warn`,`react-i18next::`,!0);Q(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console?.warn&&console.warn(...i)},xo={},So=(e,t,n,r)=>{Q(n)&&xo[n]||(Q(n)&&(xo[n]=new Date),bo(e,t,n,r))},Co=(e,t)=>()=>{if(e.isInitialized)t();else{let n=()=>{setTimeout(()=>{e.off(`initialized`,n)},0),t()};e.on(`initialized`,n)}},wo=(e,t,n)=>{e.loadNamespaces(t,Co(e,n))},To=(e,t,n,r)=>{if(Q(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return wo(e,n,r);n.forEach(t=>{e.options.ns.indexOf(t)<0&&e.options.ns.push(t)}),e.loadLanguages(t,Co(e,r))},Eo=(e,t,n={})=>!t.languages||!t.languages.length?(So(t,`NO_LANGUAGES`,`i18n.languages were undefined or empty`,{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(t,r)=>{if(n.bindI18n&&n.bindI18n.indexOf(`languageChanging`)>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}),Q=e=>typeof e==`string`,Do=e=>typeof e==`object`&&!!e,Oo=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,ko={"&amp;":`&`,"&#38;":`&`,"&lt;":`<`,"&#60;":`<`,"&gt;":`>`,"&#62;":`>`,"&apos;":`'`,"&#39;":`'`,"&quot;":`"`,"&#34;":`"`,"&nbsp;":` `,"&#160;":` `,"&copy;":`©`,"&#169;":`©`,"&reg;":`®`,"&#174;":`®`,"&hellip;":`…`,"&#8230;":`…`,"&#x2F;":`/`,"&#47;":`/`},Ao=e=>ko[e],jo={bindI18n:`languageChanged`,bindI18nStore:``,transEmptyNodeValue:``,transSupportBasicHtmlNodes:!0,transWrapTextNodes:``,transKeepBasicHtmlNodesFor:[`br`,`strong`,`i`,`p`],useSuspense:!0,unescape:e=>e.replace(Oo,Ao)},Mo=()=>jo,No,Po=()=>No,Fo=t(),Io=class{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}},Lo=(e,t)=>{let n=c();return o(()=>{n.current=t?n.current:e},[e,t]),n.current},Ro=(e,t,n,r)=>e.getFixedT(t,n,r),zo=(e,t,n,r)=>i(Ro(e,t,n,r),[e,t,n,r]),Bo=(e,t={})=>{let{i18n:n}=t,{i18n:r,defaultNS:i}=a(Fo)||{},s=n||r||Po();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new Io),!s){So(s,`NO_I18NEXT_INSTANCE`,`useTranslation: You will need to pass in an i18next instance by using initReactI18next`);let e=(e,t)=>Q(t)?t:Do(t)&&Q(t.defaultValue)?t.defaultValue:Array.isArray(e)?e[e.length-1]:e,t=[e,{},!1];return t.t=e,t.i18n={},t.ready=!1,t}s.options.react?.wait&&So(s,`DEPRECATED_OPTION`,`useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.`);let u={...Mo(),...s.options.react,...t},{useSuspense:d,keyPrefix:f}=u,p=e||i||s.options?.defaultNS;p=Q(p)?[p]:p||[`translation`],s.reportNamespaces.addUsedNamespaces?.(p);let m=(s.isInitialized||s.initializedStoreOnce)&&p.every(e=>Eo(e,s,u)),h=zo(s,t.lng||null,u.nsMode===`fallback`?p:p[0],f),g=()=>h,_=()=>Ro(s,t.lng||null,u.nsMode===`fallback`?p:p[0],f),[v,y]=l(g),b=p.join();t.lng&&(b=`${t.lng}${b}`);let x=Lo(b),S=c(!0);o(()=>{let{bindI18n:e,bindI18nStore:n}=u;S.current=!0,!m&&!d&&(t.lng?To(s,t.lng,p,()=>{S.current&&y(_)}):wo(s,p,()=>{S.current&&y(_)})),m&&x&&x!==b&&S.current&&y(_);let r=()=>{S.current&&y(_)};return e&&s?.on(e,r),n&&s?.store.on(n,r),()=>{S.current=!1,s&&e&&e?.split(` `).forEach(e=>s.off(e,r)),n&&s&&n.split(` `).forEach(e=>s.store.off(e,r))}},[s,b]),o(()=>{S.current&&m&&y(g)},[s,f,m]);let C=[v,s,m];if(C.t=v,C.i18n=s,C.ready=m,m||!m&&!d)return C;throw new Promise(e=>{t.lng?To(s,t.lng,p,()=>e()):wo(s,p,()=>e())})};function Vo({i18n:e,defaultNS:t,children:r}){let i=s(()=>({i18n:e,defaultNS:t}),[e,t]);return n(Fo.Provider,{value:i},r)}var Ho=I(`@wix/site-service-renderer-configuration`),Uo=()=>{let e,t;try{e=u(Ho).languageCode}catch{}try{t=u(Rr).language}catch{}return e||t},Wo=`wix-warmup-data`,Go=null;function Ko(e){if(typeof document<`u`)try{let t=document.getElementById(Wo)?.textContent;return t?(Go?.text!==t&&(Go={text:t,data:JSON.parse(t).builderComponentsWarmupData??{}}),Go.data[e]??void 0):void 0}catch{return}}var qo=`blog-builder:i18n`,Jo=()=>Ko(qo),Yo=new Map;function Xo(e,t){let n=Yo.get(e);if(n)return n;let r=Jo(),i=r?.locale===e?r.messages:void 0,a=yo({locale:e,useSuspense:!0,...i?{messages:i}:{asyncMessagesLoader:t}});return Yo.set(e,a),a}var Zo=(e,t,n)=>{let r=t.lastIndexOf(`?`),i=e[r===-1||r<t.lastIndexOf(`/`)?t:t.slice(0,r)];return i?typeof i==`function`?i():Promise.resolve(i):new Promise((e,r)=>{(typeof queueMicrotask==`function`?queueMicrotask:setTimeout)(r.bind(null,Error(`Unknown variable dynamic import: `+t+(t.split(`/`).length===n?``:`. Note that variables only represent file names one level deep.`))))})},Qo=e=>e.split(`-`)[0]??e;Ur({isDev:!1,loadMessages:e=>Zo(Object.assign({"../assets/locale/messages_en.dev.json":()=>pn(()=>Promise.resolve().then(()=>es),void 0,import.meta.url),"../assets/locale/messages_en.json":()=>pn(()=>Promise.resolve().then(()=>ns),void 0,import.meta.url)}),`../assets/locale/messages_${Qo(e)}.json`,4),loadDevMessages:e=>Zo(Object.assign({"../assets/locale/messages_en.dev.json":()=>pn(()=>Promise.resolve().then(()=>es),void 0,import.meta.url)}),`../assets/locale/messages_${Qo(e)}.dev.json`,4)});function $o(e){let t=Uo(),n=Jo()?.locale??t??`en`;return{i18n:Xo(n,e),locale:n}}var es=m({default:()=>ts}),ts={"post.time-to-read":`{count, plural, one {# min read} other {# min read}}`,"post.view-count":`{count, plural, one {{formatted} view} other {{formatted} views}}`,"post.comment-count":`{count, plural, one {{formatted} comment} other {{formatted} comments}}`,"post.like-count":`{count, plural, one {{formatted} like} other {{formatted} likes}}`,"post-list.empty-state.title":`No posts yet`,"post-list.empty-state.description":`Once posts are published, they will appear here.`,"related-posts.empty-state.title":`No related posts yet`,"related-posts.empty-state.description":`Once more posts are published, they will appear here.`,"post-actions.like":`Like post`,"post-actions.unlike":`Unlike post`,"post-actions.share":`Share post`,"post-actions.share-dialog":`Share post`,"post-actions.link-copied":`Link copied`,"post-actions.copy-manually":`Copy the link below to share this post.`,"post-actions.link-label":`Post link`,"post-actions.copy-link":`Copy link`,"post-actions.close":`Close`,"post-counters.loading-likes":`Loading likes`,"cover-media.play":`Play video`,"cover-media.placeholder-alt":`Post cover image`,"post-comments.loading":`Loading comments…`,"post-comments.no-post":`No post resolved for this URL yet.`,"post-comments.unavailable":`Comments are unavailable — no app instance.`,"post-comments.demo-notice":`Sample comments are shown while editing. Visitors will see real comments.`,"canvas.post-title":`Post Title`,"canvas.author-name":`Author Name`,"canvas.excerpt":`Share the key idea of your post here. This short summary shows on feed cards and in search results, and tells readers why the post is worth their time.`,"canvas.content":`This is where the full post appears. Write your story here, add images, galleries and video from the dashboard, and use headings and quotes to keep it easy to read.`,"canvas.category":`Category`,"canvas.category-numbered":`Category {number}`,"canvas.tag-numbered":`Tag {number}`,"canvas.author-photo-alt":`Author photo`,"category-header.all-posts":`All Posts`},ns=m({default:()=>is,title:()=>rs}),rs=`My App`,is={"canvas.category":`Category`,"post-list.empty-state.description":`Once posts are published, they will appear here.`,"canvas.tag-numbered":`Tag {number}`,"cover-media.play":`Play video`,"post-comments.unavailable":`Comments are unavailable — no app instance.`,"post-counters.loading-likes":`Loading likes`,"post-comments.loading":`Loading comments…`,"post-actions.like":`Like post`,"canvas.content":`This is where the full post appears. Write your story here, add images, galleries and video from the dashboard, and use headings and quotes to keep it easy to read.`,"related-posts.empty-state.title":`No related posts yet`,"post.time-to-read":`{count, plural, one {# min read} other {# min read}}`,"post-actions.link-copied":`Link copied`,"category-header.all-posts":`All Posts`,"post-actions.copy-manually":`Copy the link below to share this post.`,"post-actions.copy-link":`Copy link`,"cover-media.placeholder-alt":`Post cover image`,"post-actions.link-label":`Post link`,"post-list.empty-state.title":`No posts yet`,"post-actions.share-dialog":`Share post`,"canvas.post-title":`Post Title`,"post-actions.unlike":`Unlike post`,"post-comments.no-post":`No post resolved for this URL yet.`,"post.like-count":`{count, plural, one {{formatted} like} other {{formatted} likes}}`,"canvas.category-numbered":`Category {number}`,"post.comment-count":`{count, plural, one {{formatted} comment} other {{formatted} comments}}`,"post-actions.share":`Share post`,"post.view-count":`{count, plural, one {{formatted} view} other {{formatted} views}}`,"post-actions.close":`Close`,"canvas.category-description":`Add a short description of this category so readers know what they will find here. It shows under the category title, above the posts.`,"canvas.author-photo-alt":`Author photo`,"canvas.author-name":`Author Name`,"post-comments.demo-notice":`Sample comments are shown while editing. Visitors will see real comments.`,title:rs,"related-posts.empty-state.description":`Once more posts are published, they will appear here.`,"canvas.excerpt":`Share the key idea of your post here. This short summary shows on feed cards and in search results, and tells readers why the post is worth their time.`},as=Object.assign({"../assets/locale/messages_en.dev.json":es,"../assets/locale/messages_en.json":ns}),os=(e,t)=>{let n=as[`../assets/locale/messages_${Qo(e)}${t}.json`];return n?Promise.resolve(n):Promise.reject(Error(`no messages file`))},ss=Ur({isDev:!1,loadMessages:e=>os(e,``),loadDevMessages:e=>os(e,`.dev`)}),cs=(e,t,n)=>typeof e!=`number`||!Number.isFinite(e)||e<0?``:new Intl.NumberFormat(n,t===`compact`?{notation:`compact`,maximumFractionDigits:1}:void 0).format(e),$={timeToRead:`post.time-to-read`,viewCount:`post.view-count`,commentCount:`post.comment-count`,likeCount:`post.like-count`,noPostsTitle:`post-list.empty-state.title`,noPostsDescription:`post-list.empty-state.description`,noRelatedPostsTitle:`related-posts.empty-state.title`,noRelatedPostsDescription:`related-posts.empty-state.description`,canvasPostTitle:`canvas.post-title`,canvasAuthorName:`canvas.author-name`,canvasExcerpt:`canvas.excerpt`,canvasContent:`canvas.content`,canvasCategory:`canvas.category`,canvasCategoryNumbered:`canvas.category-numbered`,canvasTagNumbered:`canvas.tag-numbered`,canvasCoverAlt:`cover-media.placeholder-alt`,canvasAuthorPhotoAlt:`canvas.author-photo-alt`},ls=(e,t)=>{let n=n=>r=>e(n,{count:r,formatted:cs(r,`full`,t)});return{timeToRead:t=>e($.timeToRead,{count:t}),viewCount:n($.viewCount),commentCount:n($.commentCount),likeCount:n($.likeCount),noPostsEmptyState:()=>({title:e($.noPostsTitle),description:e($.noPostsDescription)}),noRelatedPostsEmptyState:()=>({title:e($.noRelatedPostsTitle),description:e($.noRelatedPostsDescription)}),canvas:{postTitle:()=>e($.canvasPostTitle),authorName:()=>e($.canvasAuthorName),excerpt:()=>e($.canvasExcerpt),content:()=>e($.canvasContent),category:()=>e($.canvasCategory),categoryNumbered:t=>e($.canvasCategoryNumbered,{number:t}),tagNumbered:t=>e($.canvasTagNumbered,{number:t}),coverAlt:()=>e($.canvasCoverAlt),authorPhotoAlt:()=>e($.canvasAuthorPhotoAlt)}}},us=e=>e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`),ds=e=>({text:e,html:`<p>${us(e)}</p>`,linkList:[]}),fs=t(null);fs.displayName=`PostItemContext`;function ps(){return a(fs)}function ms({postData:t,children:n}){let r=Br(),{t:i,ready:a}=Bo(void 0,{useSuspense:!1}),o=s(()=>ls(i,r),[i,r]),{isLiked:c,likeCount:l,isLikeCountLoaded:u,viewCount:d,commentCount:p,toggleLike:m,liveLikes:h}=Lr(t.recentPostItem.slug?t._id:void 0,0),g=s(()=>({...t,isLiked:c,isLikeCountLoaded:u,toggleLike:m,liveLikes:h,likeCountValue:l,viewCountValue:d??t.initialViewCount,commentCountValue:p??t.initialCommentCount,likeCount:ds(a?o.likeCount(l):``),viewCount:d===void 0||!a?t.viewCount:ds(o.viewCount(d)),commentCount:p===void 0||!a?t.commentCount:ds(o.commentCount(p))}),[t,c,l,u,d,p,m,h,o,a]),_=s(()=>({currentPostId:t.recentPostItem.slug?t._id:void 0,categoryIds:void 0,relatedPostIds:void 0}),[t]),v=s(()=>{let e=g.itemCategoryLabel.text;return{title:g.itemTitle,excerpt:g.itemExcerpt,coverImage:g.itemCoverImage,coverMedia:g.itemCoverMedia,richContent:{nodes:[]},authorName:g.authorName,authorImage:g.authorImage,timeToRead:g.timeToRead,publishedDate:g.itemPublishedDate,viewCount:g.viewCount,commentCount:g.commentCount,likeCount:g.likeCount,postCategories:e?[{_id:e,label:e,itemCategoryLabel:g.itemCategoryLabel,itemCategoryLink:void 0,categoryItem:{label:e,slug:``}}]:[],itemCategoryLabel:g.itemCategoryLabel,postTags:[],hasCoverImage:g.itemCoverMedia!==void 0&&g.itemCoverImage!==void 0,hasExcerpt:!!g.itemExcerpt.text.trim(),hasTags:!1,publishedDateValue:g.publishedDateValue,minutesToReadValue:g.minutesToReadValue,viewCountValue:g.viewCountValue,commentCountValue:g.commentCountValue,isLiked:g.isLiked,likeCountValue:g.likeCountValue,isLikeCountLoaded:g.isLikeCountLoaded,toggleLike:g.toggleLike,liveLikes:g.liveLikes,clockValue:g.clockValue,postUrl:g.itemLink?.href,itemLink:g.itemLink,commentingEnabled:g.commentingEnabled,relatedPostsSource:_,isLoadingPost:!1,hasError:!1,isEmpty:!1}},[g,_]);return f(fs.Provider,{value:g,children:f(e,{value:v,children:n})})}function hs({postData:e,children:t}){let{i18n:n}=$o(ss);return e===void 0?f(d,{children:t}):f(Vo,{i18n:n,children:f(ms,{postData:e,children:t})})}var gs=Dn(`e26c0f39-8db2-4b56-8c9b-fd1457f917e0`);export{hs as PostItemContextProvider,hs as default,gs as injectAccessTokenGetter,ps as usePostListItemContext};
5
- //# sourceMappingURL=context-provider-e26c0f39-8db2-4b56-8c9b-fd1457f917e0-BNGMNHsp.js.map
3
+ `,`MISSING_INTL_API`,o);let e=typeof l==`bigint`?Number(l):l,r=n.getPluralRules(t,{type:c.pluralType}).select(e-(c.offset||0));a=(Object.prototype.hasOwnProperty.call(c.options,r)?c.options[r]:void 0)||c.options.other}if(!a)throw new Va(c.value,l,Object.keys(c.options),o);let u=typeof l==`bigint`?Number(l):l;s.push(...Ka(a.value,t,n,r,i,u-(c.offset||0)))}}}return Wa(s)}function qa(e,t){return t?{...e,...t,...Object.keys(e).reduce((n,r)=>(n[r]={...e[r],...t[r]},n),{})}:e}function Ja(e,t){return t?Object.keys(e).reduce((n,r)=>(n[r]=qa(e[r],t[r]),n),{...e}):e}function Ya(e){return{create(){return{get(t){return e[t]},set(t,n){e[t]=n}}}}}function Xa(e={number:{},dateTime:{},pluralRules:{}}){return{getNumberFormat:Fi((...e)=>new Intl.NumberFormat(...e),{cache:Ya(e.number),strategy:Ki.variadic}),getDateTimeFormat:Fi((...e)=>new Intl.DateTimeFormat(...e),{cache:Ya(e.dateTime),strategy:Ki.variadic}),getPluralRules:Fi((...e)=>new Intl.PluralRules(...e),{cache:Ya(e.pluralRules),strategy:Ki.variadic})}}var Za=class e{constructor(t,n=e.defaultLocale,r,i){if(this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=e=>{let t=this.formatToParts(e);if(t.length===1)return t[0].value;let n=t.reduce((e,t)=>(!e.length||t.type!==0||typeof e[e.length-1]!=`string`?e.push(t.value):e[e.length-1]+=t.value,e),[]);return n.length<=1?n[0]||``:n},this.formatToParts=e=>Ka(this.ast,this.locales,this.formatters,this.formats,e,void 0,this.message),this.resolvedOptions=()=>({locale:this.resolvedLocale?.toString()||Intl.NumberFormat.supportedLocalesOf(this.locales)[0]}),this.getAst=()=>this.ast,this.locales=n,this.resolvedLocale=e.resolveLocale(n),typeof t==`string`){if(this.message=t,!e.__parse)throw TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");let{...n}=i||{};this.ast=e.__parse(t,{...n,locale:this.resolvedLocale})}else this.ast=t;if(!Array.isArray(this.ast))throw TypeError(`A message must be provided as a String or AST.`);this.formats=Ja(e.formats,r),this.formatters=i&&i.formatters||Xa(this.formatterCache)}static{this.memoizedDefaultLocale=null}static get defaultLocale(){return e.memoizedDefaultLocale||=new Intl.NumberFormat().resolvedOptions().locale,e.memoizedDefaultLocale}static{this.resolveLocale=e=>{if(Intl.Locale===void 0)return;let t=Intl.NumberFormat.supportedLocalesOf(e);return t.length>0?new Intl.Locale(t[0]):new Intl.Locale(typeof e==`string`?e:e[0])}}static{this.__parse=za}static{this.formats={number:{integer:{maximumFractionDigits:0},currency:{style:`currency`},percent:{style:`percent`}},date:{short:{month:`numeric`,day:`numeric`,year:`2-digit`},medium:{month:`short`,day:`numeric`,year:`numeric`},long:{month:`long`,day:`numeric`,year:`numeric`},full:{weekday:`long`,month:`long`,day:`numeric`,year:`numeric`}},time:{short:{hour:`numeric`,minute:`numeric`},medium:{hour:`numeric`,minute:`numeric`,second:`numeric`},long:{hour:`numeric`,minute:`numeric`,second:`numeric`,timeZoneName:`short`},full:{hour:`numeric`,minute:`numeric`,second:`numeric`,timeZoneName:`short`}}}}},Qa=[`__proto__`,`constructor`,`prototype`];function $a(e,t,n){function r(e){return e&&e.indexOf(`###`)>-1?e.replace(/###/g,`.`):e}function i(){return!e||typeof e==`string`}for(var a=typeof t==`string`?t.split(`.`):[].concat(t);a.length>1;){if(i())return{};var o=r(a.shift());if(Qa.indexOf(o)>-1)return{};!e[o]&&n&&(e[o]=new n),e=e[o]}if(i())return{};var s=r(a.shift());return Qa.indexOf(s)>-1?{}:{obj:e,k:s}}function eo(e,t,n){var r=$a(e,t,Object),i=r.obj,a=r.k;i!==void 0&&(i[a]=n)}function to(e,t){var n=$a(e,t),r=n.obj,i=n.k;if(r)return r[i]}function no(e){return[...arguments].slice(1).forEach(function(t){if(t)for(var n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];Qa.indexOf(i)>-1||e[i]===void 0&&(e[i]=t[i])}}),e}function ro(e,t){return co(e)||so(e,t)||ao(e,t)||io()}function io(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
4
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ao(e,t){if(e){if(typeof e==`string`)return oo(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?oo(e,t):void 0}}function oo(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function so(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function co(e){if(Array.isArray(e))return e}function lo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function uo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?lo(Object(n),!0).forEach(function(t){fo(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lo(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function fo(e,t,n){return(t=go(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function po(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function mo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,go(r.key),r)}}function ho(e,t,n){return t&&mo(e.prototype,t),n&&mo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function go(e){var t=_o(e,`string`);return Z(t)==`symbol`?t:t+``}function _o(e,t){if(Z(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Z(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Z(e){"@babel/helpers - typeof";return Z=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Z(e)}var vo=`https://www.i18next.com/how-to/using-icu-or-mf2`,yo=[`zero`,`one`,`two`,`few`,`many`,`other`];function bo(){return{memoize:!0,memoizeFallback:!1,bindI18n:``,bindI18nStore:``,parseErrorHandler:function(e,t,n,r){return n},parseLngForICU:function(e){return e},escapeVariables:!1}}function xo(e,t,n,r){return n&&t&&Z(t)===`object`?`${r} resolved to an object or array, but i18next-icu does not support returnObjects or joinArrays and returns the raw value unformatted.`:n&&typeof t==`string`&&t.indexOf(`{{`)>-1?`${r} could not be parsed (${e.message}). It contains "{{": i18next interpolation like {{name}} does not work with ICU, use {name}.`:`${r} could not be ${n?`parsed`:`formatted`}: ${e.message}`}var So=function(){function e(t){po(this,e),this.type=`i18nFormat`,this.mem={},this.warned=new Set,this.init(null,t)}return ho(e,[{key:`init`,value:function(e,t){var n=this,r=e&&e.options&&e.options.i18nFormat||{};if(this.options=no(r,t,this.options||{},bo()),this.formats=this.options.formats,e){var i=this.options,a=i.bindI18n,o=i.bindI18nStore,s=i.memoize;e.IntlMessageFormat=Za,e.ICU=this,this.i18next=e,this.debug=!!(e.options&&e.options.debug),this.debug&&e.options.interpolation&&e.options.interpolation.escapeValue!==!1&&!this.options.escapeVariables&&this.warn(`interpolation.escapeValue is not applied, values are inserted without HTML escaping. Set the i18next-icu option escapeVariables: true to escape them, or interpolation.escapeValue: false if your output is escaped elsewhere (e.g. by React).`),s&&(a&&e.on(a,function(){return n.clearCache()}),o&&e.store.on(o,function(){return n.clearCache()}))}}},{key:`addUserDefinedFormats`,value:function(e){this.formats=this.formats?uo(uo({},this.formats),e):e,this.clearCache()}},{key:`parse`,value:function(e,t,n,r,i,a){var o=a&&a.resolved&&a.resolved.res,s=this.options.memoize&&[n,r,i],c;if(this.options.memoize){var l=to(this.mem,s);l&&l.res===e&&(c=l.fc)}try{c||(this.debug&&typeof e==`string`&&e.indexOf(`$t(`)>-1&&this.firstTime(`nesting ${n} ${r} ${i}`)&&this.warn(`key "${i}" (${n}/${r}) contains "$t(", but i18next-icu does not support nesting, the text is output as is.`),c=new Za(e,this.options.parseLngForICU(n),this.formats,{ignoreTag:!0}),this.options.memoize&&(this.options.memoizeFallback||!a||o)&&eo(this.mem,s,{res:e,fc:c}));var u=t&&t.replace&&Z(t.replace)===`object`?uo(uo({},t),t.replace):t;return c.format(this.escapeVariableValues(u))}catch(a){return this.debug&&this.firstTime(`error ${n} ${r} ${i}`)&&this.warn(xo(a,e,!c,`key "${i}" (${n}/${r})`)),this.options.parseErrorHandler(a,i,e,t)}}},{key:`addLookupKeys`,value:function(e,t,n,r,i){return this.debug&&i&&this.checkSuffixKeys(t,n,r,i),e}},{key:`checkSuffixKeys`,value:function(e,t,n,r){var i=r.count,a=r.context,o=this.i18next.options,s=o.pluralSeparator,c=s===void 0?`_`:s,l=o.contextSeparator,u=l===void 0?`_`:l,d=this.i18next.services.resourceStore,f=`key "${e}" (${t}/${n})`;if(i!==void 0&&this.firstTime(`plural ${t} ${n} ${e}`)){var p=yo.concat(yo.map(function(e){return`ordinal${c}${e}`})).map(function(t){return`${e}${c}${t}`}).filter(function(e){return d.getResource(t,n,e)!==void 0});p.length&&this.warn(`${f} was called with count, but i18next-icu does not look up plural suffix keys (${p.join(`, `)}). Put the plural into the message: {count, plural, one {# item} other {# items}}.`)}var m=`${e}${u}${a}`;a!==void 0&&a!==``&&this.firstTime(`context ${t} ${n} ${m}`)&&d.getResource(t,n,m)!==void 0&&this.warn(`${f} was called with context "${a}", but i18next-icu does not look up context keys (${m}). Use a select in the message: {context, select, ${a} {...} other {...}}.`)}},{key:`firstTime`,value:function(e){return!this.warned.has(e)&&(this.warned.add(e),!0)}},{key:`warn`,value:function(e){this.i18next.services.logger.warn(`i18next-icu: ${e} See ${vo}`)}},{key:`clearCache`,value:function(){this.mem={}}},{key:`escapeVariableValues`,value:function(e){if(!this.options.escapeVariables||!e||Z(e)!==`object`)return e;for(var t={},n=0,r=Object.entries(e);n<r.length;n++){var i=ro(r[n],2),a=i[0],o=i[1];t[a]=typeof o==`string`?o.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`):o}return t}}]),e}();So.type=`i18nFormat`;function Co({icuOptions:e={},...t}){let{parseErrorHandler:n=void 0}=t;return Pi(t,{icu:new So({parseErrorHandler:n,bindI18n:t.bindI18n,...e})})}var wo=(e,t,n,r)=>{let i=[n,{code:t,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(i,`warn`,`react-i18next::`,!0);Q(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console?.warn&&console.warn(...i)},To={},Eo=(e,t,n,r)=>{Q(n)&&To[n]||(Q(n)&&(To[n]=new Date),wo(e,t,n,r))},Do=(e,t)=>()=>{if(e.isInitialized)t();else{let n=()=>{setTimeout(()=>{e.off(`initialized`,n)},0),t()};e.on(`initialized`,n)}},Oo=(e,t,n)=>{e.loadNamespaces(t,Do(e,n))},ko=(e,t,n,r)=>{if(Q(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return Oo(e,n,r);n.forEach(t=>{e.options.ns.indexOf(t)<0&&e.options.ns.push(t)}),e.loadLanguages(t,Do(e,r))},Ao=(e,t,n={})=>!t.languages||!t.languages.length?(Eo(t,`NO_LANGUAGES`,`i18n.languages were undefined or empty`,{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(t,r)=>{if(n.bindI18n&&n.bindI18n.indexOf(`languageChanging`)>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}),Q=e=>typeof e==`string`,jo=e=>typeof e==`object`&&!!e,Mo=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,No={"&amp;":`&`,"&#38;":`&`,"&lt;":`<`,"&#60;":`<`,"&gt;":`>`,"&#62;":`>`,"&apos;":`'`,"&#39;":`'`,"&quot;":`"`,"&#34;":`"`,"&nbsp;":` `,"&#160;":` `,"&copy;":`©`,"&#169;":`©`,"&reg;":`®`,"&#174;":`®`,"&hellip;":`…`,"&#8230;":`…`,"&#x2F;":`/`,"&#47;":`/`},Po=e=>No[e],Fo={bindI18n:`languageChanged`,bindI18nStore:``,transEmptyNodeValue:``,transSupportBasicHtmlNodes:!0,transWrapTextNodes:``,transKeepBasicHtmlNodesFor:[`br`,`strong`,`i`,`p`],useSuspense:!0,unescape:e=>e.replace(Mo,Po)},Io=()=>Fo,Lo,Ro=()=>Lo,zo=t(),Bo=class{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}},Vo=(e,t)=>{let n=c();return o(()=>{n.current=t?n.current:e},[e,t]),n.current},Ho=(e,t,n,r)=>e.getFixedT(t,n,r),Uo=(e,t,n,r)=>i(Ho(e,t,n,r),[e,t,n,r]),Wo=(e,t={})=>{let{i18n:n}=t,{i18n:r,defaultNS:i}=a(zo)||{},s=n||r||Ro();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new Bo),!s){Eo(s,`NO_I18NEXT_INSTANCE`,`useTranslation: You will need to pass in an i18next instance by using initReactI18next`);let e=(e,t)=>Q(t)?t:jo(t)&&Q(t.defaultValue)?t.defaultValue:Array.isArray(e)?e[e.length-1]:e,t=[e,{},!1];return t.t=e,t.i18n={},t.ready=!1,t}s.options.react?.wait&&Eo(s,`DEPRECATED_OPTION`,`useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.`);let u={...Io(),...s.options.react,...t},{useSuspense:d,keyPrefix:f}=u,p=e||i||s.options?.defaultNS;p=Q(p)?[p]:p||[`translation`],s.reportNamespaces.addUsedNamespaces?.(p);let m=(s.isInitialized||s.initializedStoreOnce)&&p.every(e=>Ao(e,s,u)),h=Uo(s,t.lng||null,u.nsMode===`fallback`?p:p[0],f),g=()=>h,_=()=>Ho(s,t.lng||null,u.nsMode===`fallback`?p:p[0],f),[v,y]=l(g),b=p.join();t.lng&&(b=`${t.lng}${b}`);let x=Vo(b),S=c(!0);o(()=>{let{bindI18n:e,bindI18nStore:n}=u;S.current=!0,!m&&!d&&(t.lng?ko(s,t.lng,p,()=>{S.current&&y(_)}):Oo(s,p,()=>{S.current&&y(_)})),m&&x&&x!==b&&S.current&&y(_);let r=()=>{S.current&&y(_)};return e&&s?.on(e,r),n&&s?.store.on(n,r),()=>{S.current=!1,s&&e&&e?.split(` `).forEach(e=>s.off(e,r)),n&&s&&n.split(` `).forEach(e=>s.store.off(e,r))}},[s,b]),o(()=>{S.current&&m&&y(g)},[s,f,m]);let C=[v,s,m];if(C.t=v,C.i18n=s,C.ready=m,m||!m&&!d)return C;throw new Promise(e=>{t.lng?ko(s,t.lng,p,()=>e()):Oo(s,p,()=>e())})};function Go({i18n:e,defaultNS:t,children:r}){let i=s(()=>({i18n:e,defaultNS:t}),[e,t]);return n(zo.Provider,{value:i},r)}var Ko=R(`@wix/site-service-renderer-configuration`),qo=()=>{let e,t;try{e=u(Ko).languageCode}catch{}try{t=u(Br).language}catch{}return e||t},Jo=`wix-warmup-data`,Yo=null;function Xo(e){if(typeof document<`u`)try{let t=document.getElementById(Jo)?.textContent;return t?(Yo?.text!==t&&(Yo={text:t,data:JSON.parse(t).builderComponentsWarmupData??{}}),Yo.data[e]??void 0):void 0}catch{return}}var Zo=`blog-builder:i18n`,Qo=()=>Xo(Zo),$o=new Map;function es(e,t){let n=$o.get(e);if(n)return n;let r=Qo(),i=r?.locale===e?r.messages:void 0,a=Co({locale:e,useSuspense:!0,...i?{messages:i}:{asyncMessagesLoader:t}});return $o.set(e,a),a}var ts=(e,t,n)=>{let r=t.lastIndexOf(`?`),i=e[r===-1||r<t.lastIndexOf(`/`)?t:t.slice(0,r)];return i?typeof i==`function`?i():Promise.resolve(i):new Promise((e,r)=>{(typeof queueMicrotask==`function`?queueMicrotask:setTimeout)(r.bind(null,Error(`Unknown variable dynamic import: `+t+(t.split(`/`).length===n?``:`. Note that variables only represent file names one level deep.`))))})},ns=e=>e.split(`-`)[0]??e;Gr({isDev:!1,loadMessages:e=>ts(Object.assign({"../assets/locale/messages_en.dev.json":()=>pn(()=>Promise.resolve().then(()=>is),void 0,import.meta.url),"../assets/locale/messages_en.json":()=>pn(()=>Promise.resolve().then(()=>os),void 0,import.meta.url)}),`../assets/locale/messages_${ns(e)}.json`,4),loadDevMessages:e=>ts(Object.assign({"../assets/locale/messages_en.dev.json":()=>pn(()=>Promise.resolve().then(()=>is),void 0,import.meta.url)}),`../assets/locale/messages_${ns(e)}.dev.json`,4)});function rs(e){let t=qo(),n=Qo()?.locale??t??`en`;return{i18n:es(n,e),locale:n}}var is=m({default:()=>as}),as={"post.time-to-read":`{count, plural, one {# min read} other {# min read}}`,"post.view-count":`{count, plural, one {{formatted} view} other {{formatted} views}}`,"post.comment-count":`{count, plural, one {{formatted} comment} other {{formatted} comments}}`,"post.like-count":`{count, plural, one {{formatted} like} other {{formatted} likes}}`,"post-list.empty-state.title":`No posts yet`,"post-list.empty-state.description":`Once posts are published, they will appear here.`,"related-posts.empty-state.title":`No related posts yet`,"related-posts.empty-state.description":`Once more posts are published, they will appear here.`,"post-actions.like":`Like post`,"post-actions.unlike":`Unlike post`,"post-actions.share":`Share post`,"post-actions.share-dialog":`Share post`,"post-actions.link-copied":`Link copied`,"post-actions.copy-manually":`Copy the link below to share this post.`,"post-actions.link-label":`Post link`,"post-actions.copy-link":`Copy link`,"post-actions.close":`Close`,"post-counters.loading-likes":`Loading likes`,"cover-media.play":`Play video`,"cover-media.placeholder-alt":`Post cover image`,"post-comments.loading":`Loading comments…`,"post-comments.no-post":`No post resolved for this URL yet.`,"post-comments.unavailable":`Comments are unavailable — no app instance.`,"post-comments.demo-notice":`Sample comments are shown while editing. Visitors will see real comments.`,"canvas.post-title":`Post Title`,"canvas.author-name":`Author Name`,"canvas.excerpt":`Share the key idea of your post here. This short summary shows on feed cards and in search results, and tells readers why the post is worth their time.`,"canvas.content":`This is where the full post appears. Write your story here, add images, galleries and video from the dashboard, and use headings and quotes to keep it easy to read.`,"canvas.category":`Category`,"canvas.category-numbered":`Category {number}`,"canvas.tag-numbered":`Tag {number}`,"canvas.author-photo-alt":`Author photo`,"category-header.all-posts":`All Posts`},os=m({default:()=>cs,title:()=>ss}),ss=`My App`,cs={"canvas.category":`Category`,"post-list.empty-state.description":`Once posts are published, they will appear here.`,"canvas.tag-numbered":`Tag {number}`,"cover-media.play":`Play video`,"post-comments.unavailable":`Comments are unavailable — no app instance.`,"post-counters.loading-likes":`Loading likes`,"post-comments.loading":`Loading comments…`,"post-actions.like":`Like post`,"canvas.content":`This is where the full post appears. Write your story here, add images, galleries and video from the dashboard, and use headings and quotes to keep it easy to read.`,"related-posts.empty-state.title":`No related posts yet`,"post.time-to-read":`{count, plural, one {# min read} other {# min read}}`,"post-actions.link-copied":`Link copied`,"category-header.all-posts":`All Posts`,"post-actions.copy-manually":`Copy the link below to share this post.`,"post-actions.copy-link":`Copy link`,"cover-media.placeholder-alt":`Post cover image`,"post-actions.link-label":`Post link`,"post-list.empty-state.title":`No posts yet`,"post-actions.share-dialog":`Share post`,"canvas.post-title":`Post Title`,"post-actions.unlike":`Unlike post`,"post-comments.no-post":`No post resolved for this URL yet.`,"post.like-count":`{count, plural, one {{formatted} like} other {{formatted} likes}}`,"canvas.category-numbered":`Category {number}`,"post.comment-count":`{count, plural, one {{formatted} comment} other {{formatted} comments}}`,"post-actions.share":`Share post`,"post.view-count":`{count, plural, one {{formatted} view} other {{formatted} views}}`,"post-actions.close":`Close`,"canvas.category-description":`Add a short description of this category so readers know what they will find here. It shows under the category title, above the posts.`,"canvas.author-photo-alt":`Author photo`,"canvas.author-name":`Author Name`,"post-comments.demo-notice":`Sample comments are shown while editing. Visitors will see real comments.`,title:ss,"related-posts.empty-state.description":`Once more posts are published, they will appear here.`,"canvas.excerpt":`Share the key idea of your post here. This short summary shows on feed cards and in search results, and tells readers why the post is worth their time.`},ls=Object.assign({"../assets/locale/messages_en.dev.json":is,"../assets/locale/messages_en.json":os}),us=(e,t)=>{let n=ls[`../assets/locale/messages_${ns(e)}${t}.json`];return n?Promise.resolve(n):Promise.reject(Error(`no messages file`))},ds=Gr({isDev:!1,loadMessages:e=>us(e,``),loadDevMessages:e=>us(e,`.dev`)}),fs=(e,t,n)=>typeof e!=`number`||!Number.isFinite(e)||e<0?``:new Intl.NumberFormat(n,t===`compact`?{notation:`compact`,maximumFractionDigits:1}:void 0).format(e),$={timeToRead:`post.time-to-read`,viewCount:`post.view-count`,commentCount:`post.comment-count`,likeCount:`post.like-count`,noPostsTitle:`post-list.empty-state.title`,noPostsDescription:`post-list.empty-state.description`,noRelatedPostsTitle:`related-posts.empty-state.title`,noRelatedPostsDescription:`related-posts.empty-state.description`,canvasPostTitle:`canvas.post-title`,canvasAuthorName:`canvas.author-name`,canvasExcerpt:`canvas.excerpt`,canvasContent:`canvas.content`,canvasCategory:`canvas.category`,canvasCategoryNumbered:`canvas.category-numbered`,canvasTagNumbered:`canvas.tag-numbered`,canvasCoverAlt:`cover-media.placeholder-alt`,canvasAuthorPhotoAlt:`canvas.author-photo-alt`},ps=(e,t)=>{let n=n=>r=>e(n,{count:r,formatted:fs(r,`full`,t)});return{timeToRead:t=>e($.timeToRead,{count:t}),viewCount:n($.viewCount),commentCount:n($.commentCount),likeCount:n($.likeCount),noPostsEmptyState:()=>({title:e($.noPostsTitle),description:e($.noPostsDescription)}),noRelatedPostsEmptyState:()=>({title:e($.noRelatedPostsTitle),description:e($.noRelatedPostsDescription)}),canvas:{postTitle:()=>e($.canvasPostTitle),authorName:()=>e($.canvasAuthorName),excerpt:()=>e($.canvasExcerpt),content:()=>e($.canvasContent),category:()=>e($.canvasCategory),categoryNumbered:t=>e($.canvasCategoryNumbered,{number:t}),tagNumbered:t=>e($.canvasTagNumbered,{number:t}),coverAlt:()=>e($.canvasCoverAlt),authorPhotoAlt:()=>e($.canvasAuthorPhotoAlt)}}},ms=e=>e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`),hs=e=>({text:e,html:`<p>${ms(e)}</p>`,linkList:[]}),gs=t(null);gs.displayName=`PostItemContext`;function _s(){return a(gs)}function vs({postData:t,children:n}){let r=Hr(),{t:i,ready:a}=Wo(void 0,{useSuspense:!1}),o=s(()=>ps(i,r),[i,r]),{isLiked:c,likeCount:l,isLikeCountLoaded:u,toggleLike:d,liveLikes:p}=zr(t.recentPostItem.slug?t._id:void 0,t.initialLikeCount??0,!1,void 0,!1),m=s(()=>({...t,isLiked:c,isLikeCountLoaded:u,toggleLike:d,liveLikes:p,likeCountValue:l,viewCountValue:t.initialViewCount,commentCountValue:t.initialCommentCount,likeCount:hs(a?o.likeCount(l):``)}),[t,c,l,u,d,p,o,a]),h=s(()=>({currentPostId:t.recentPostItem.slug?t._id:void 0,categoryIds:void 0,relatedPostIds:void 0}),[t]),g=s(()=>{let e=m.itemCategoryLabel.text;return{title:m.itemTitle,excerpt:m.itemExcerpt,coverImage:m.itemCoverImage,coverMedia:m.itemCoverMedia,richContent:{nodes:[]},authorName:m.authorName,authorImage:m.authorImage,timeToRead:m.timeToRead,publishedDate:m.itemPublishedDate,viewCount:m.viewCount,commentCount:m.commentCount,likeCount:m.likeCount,postCategories:e?[{_id:e,label:e,itemCategoryLabel:m.itemCategoryLabel,itemCategoryLink:void 0,categoryItem:{label:e,slug:``}}]:[],itemCategoryLabel:m.itemCategoryLabel,postTags:[],hasCoverImage:m.itemCoverMedia!==void 0&&m.itemCoverImage!==void 0,hasExcerpt:!!m.itemExcerpt.text.trim(),hasTags:!1,publishedDateValue:m.publishedDateValue,minutesToReadValue:m.minutesToReadValue,viewCountValue:m.viewCountValue,commentCountValue:m.commentCountValue,isLiked:m.isLiked,likeCountValue:m.likeCountValue,isLikeCountLoaded:m.isLikeCountLoaded,toggleLike:m.toggleLike,liveLikes:m.liveLikes,clockValue:m.clockValue,postUrl:m.itemLink?.href,itemLink:m.itemLink,commentingEnabled:m.commentingEnabled,relatedPostsSource:h,isLoadingPost:!1,hasError:!1,isEmpty:!1}},[m,h]);return f(gs.Provider,{value:m,children:f(e,{value:g,children:n})})}function ys({postData:e,children:t}){let{i18n:n}=rs(ds);return e===void 0?f(d,{children:t}):f(Go,{i18n:n,children:f(vs,{postData:e,children:t})})}var bs=En(`e26c0f39-8db2-4b56-8c9b-fd1457f917e0`);export{ys as PostItemContextProvider,ys as default,bs as injectAccessTokenGetter,_s as usePostListItemContext};
5
+ //# sourceMappingURL=context-provider-e26c0f39-8db2-4b56-8c9b-fd1457f917e0-BjNAKlo_.js.map