Anvil/assets/runtime-D6MmngXK.js

6 lines
48 KiB
JavaScript
Raw Normal View History

2024-07-09 20:40:57 +02:00
import{d as O,w as ce}from"./index-BCQHTg7S.js";import{g as tt}from"./_commonjsHelpers-Cpj98o6Y.js";import{_ as b,a as J,b as rt,c as K}from"./tslib.es6-pJfR_DrR.js";var nt=function(t){return it(t)&&!at(t)};function it(e){return!!e&&typeof e=="object"}function at(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||ht(e)}var st=typeof Symbol=="function"&&Symbol.for,ot=st?Symbol.for("react.element"):60103;function ht(e){return e.$$typeof===ot}function ut(e){return Array.isArray(e)?[]:{}}function j(e,t){return t.clone!==!1&&t.isMergeableObject(e)?A(ut(e),e,t):e}function lt(e,t,r){return e.concat(t).map(function(n){return j(n,r)})}function ft(e,t){if(!t.customMerge)return A;var r=t.customMerge(e);return typeof r=="function"?r:A}function ct(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function ve(e){return Object.keys(e).concat(ct(e))}function Me(e,t){try{return t in e}catch{return!1}}function mt(e,t){return Me(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function pt(e,t,r){var n={};return r.isMergeableObject(e)&&ve(e).forEach(function(i){n[i]=j(e[i],r)}),ve(t).forEach(function(i){mt(e,i)||(Me(e,i)&&r.isMergeableObject(t[i])?n[i]=ft(i,r)(e[i],t[i],r):n[i]=j(t[i],r))}),n}function A(e,t,r){r=r||{},r.arrayMerge=r.arrayMerge||lt,r.isMergeableObject=r.isMergeableObject||nt,r.cloneUnlessOtherwiseSpecified=j;var n=Array.isArray(t),i=Array.isArray(e),a=n===i;return a?n?r.arrayMerge(e,t,r):pt(e,t,r):j(t,r)}A.all=function(t,r){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(n,i){return A(n,i,r)},{})};var bt=A,gt=bt;const Et=tt(gt);var m;(function(e){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"})(m||(m={}));var g;(function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"})(g||(g={}));var P;(function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"})(P||(P={}));function de(e){return e.type===g.literal}function xt(e){return e.type===g.argument}function Ce(e){return e.type===g.number}function we(e){return e.type===g.date}function Re(e){return e.type===g.time}function Ue(e){return e.type===g.select}function Ge(e){return e.type===g.plural}function vt(e){return e.type===g.pound}function De(e){ret
2024-06-16 17:30:30 +02:00
Try polyfilling it using "@formatjs/intl-pluralrules"
2024-07-05 16:28:36 +02:00
`,I.MISSING_INTL_API,o);var R=r.getPluralRules(t,{type:s.pluralType}).select(l-(s.offset||0));y=s.options[R]||s.options.other}if(!y)throw new Ae(s.value,l,Object.keys(s.options),o);h.push.apply(h,W(y.value,t,r,n,i,l-(s.offset||0)));continue}}return rr(h)}function ir(e,t){return t?b(b(b({},e||{}),t||{}),Object.keys(e).reduce(function(r,n){return r[n]=b(b({},e[n]),t[n]||{}),r},{})):e}function ar(e,t){return t?Object.keys(e).reduce(function(r,n){return r[n]=ir(e[n],t[n]),r},b({},e)):e}function ne(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,r){e[t]=r}}}}}function sr(e){return e===void 0&&(e={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:te(function(){for(var t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return new((t=Intl.NumberFormat).bind.apply(t,K([void 0],r,!1)))},{cache:ne(e.number),strategy:re.variadic}),getDateTimeFormat:te(function(){for(var t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return new((t=Intl.DateTimeFormat).bind.apply(t,K([void 0],r,!1)))},{cache:ne(e.dateTime),strategy:re.variadic}),getPluralRules:te(function(){for(var t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return new((t=Intl.PluralRules).bind.apply(t,K([void 0],r,!1)))},{cache:ne(e.pluralRules),strategy:re.variadic})}}var Je=function(){function e(t,r,n,i){var a=this;if(r===void 0&&(r=e.defaultLocale),this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(f){var u=a.formatToParts(f);if(u.length===1)return u[0].value;var s=u.reduce(function(c,l){return!c.length||l.type!==x.literal||typeof c[c.length-1]!="string"?c.push(l.value):c[c.length-1]+=l.value,c},[]);return s.length<=1?s[0]||"":s},this.formatToParts=function(f){return W(a.ast,a.locales,a.formatters,a.formats,f,void 0,a.message)},this.resolvedOptions=function(){var f;return{locale:((f=a.resolvedLocale)===null||f===void 0?void 0:f.toString())||Intl.NumberFormat.supportedLocalesOf(a.locales)[0]}},this.getAst=function(){return a.ast},this.locales=r,this.resolvedLocale=e.resolveLocale(r),typeof t=="string"){if(this.message=t,!e.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");var o=i||{};o.formatters;var h=rt(o,["formatters"]);this.ast=e.__parse(t,b(b({},h),{locale:this.resolvedLocale}))}else this.ast=t;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=ar(e.formats,n),this.formatters=i&&i.formatters||sr(this.formatterCache)}return Object.defineProperty(e,"defaultLocale",{get:function(){return e.memoizedDefaultLocale||(e.memoizedDefaultLocale=new Intl.NumberFormat().resolvedOptions().locale),e.memoizedDefaultLocale},enumerable:!1,configurable:!0}),e.memoizedDefaultLocale=null,e.resolveLocale=function(t){if(!(typeof Intl.Locale>"u")){var r=Intl.NumberFormat.supportedLocalesOf(t);return r.length>0?new Intl.Locale(r[0]):new Intl.Locale(typeof t=="string"?t:t[0])}},e.__parse=Zt,e.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"}}},e}();function or(e,t){if(t==null)return;if(t in e)return e[t];const r=t.split(".");let n=e;for(let i=0;i<r.length;i++)if(typeof n=="object"){if(i>0){const a=r.slice(i,r.length).join(".");if(a in n){n=n[a];break}}n=n[r[i]]}else n=void 0;return n}const _={},hr=(e,t,r)=>r&&(t in _||(_[t]={}),e in _[t]||(_[t][e]=r),r),qe=(e,t)=>{if(t==null)return;if(t in _&&e in _[t])return _[t][e];const r=X(t);for(let n=0;n<r.length;n++){const i=r[n],a=lr(i,e);if(a)return hr(e,t,a)}};let be;const L=ce({});function ur(e){return be[e]||null}function ge(e){return
2024-06-16 17:30:30 +02:00
2024-07-05 16:28:36 +02:00
Note: there are at least one loader still registered to this locale that wasn't executed.`:""}`)}const _r={fallbackLocale:null,loadingDelay:200,formats:dr,warnOnMissingMessages:!0,handleMissingMessage:void 0,ignoreTag:!0},G=_r;function N(){return G}function Qr(e){const t=e,{formats:r}=t,n=vr(t,["formats"]);let i=e.fallbackLocale;if(e.initialLocale)try{Je.resolveLocale(e.initialLocale)&&(i=e.initialLocale)}catch{console.warn(`[svelte-i18n] The initial locale "${e.initialLocale}" is not a valid locale.`)}return n.warnOnMissingMessages&&(delete n.warnOnMissingMessages,n.handleMissingMessage==null?n.handleMissingMessage=yr:console.warn('[svelte-i18n] The "warnOnMissingMessages" option is deprecated. Please use the "handleMissingMessage" option instead.')),Object.assign(G,n,{initialLocale:i}),r&&("number"in r&&Object.assign(G.formats.number,r.number),"date"in r&&Object.assign(G.formats.date,r.date),"time"in r&&Object.assign(G.formats.time,r.time)),M.set(i)}const ie=ce(!1);var Hr=Object.defineProperty,Tr=Object.defineProperties,Br=Object.getOwnPropertyDescriptors,Ie=Object.getOwnPropertySymbols,Sr=Object.prototype.hasOwnProperty,Ar=Object.prototype.propertyIsEnumerable,Ne=(e,t,r)=>t in e?Hr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Pr=(e,t)=>{for(var r in t||(t={}))Sr.call(t,r)&&Ne(e,r,t[r]);if(Ie)for(var r of Ie(t))Ar.call(t,r)&&Ne(e,r,t[r]);return e},Ir=(e,t)=>Tr(e,Br(t));let fe;const z=ce(null);function Oe(e){return e.split("-").map((t,r,n)=>n.slice(0,r+1).join("-")).reverse()}function X(e,t=N().fallbackLocale){const r=Oe(e);return t?[...new Set([...r,...Oe(t)])]:r}function H(){return fe??void 0}z.subscribe(e=>{fe=e??void 0,typeof window<"u"&&e!=null&&document.documentElement.setAttribute("lang",e)});const Nr=e=>{if(e&&fr(e)&&Z(e)){const{loadingDelay:t}=N();let r;return typeof window<"u"&&H()!=null&&t?r=window.setTimeout(()=>ie.set(!0),t):ie.set(!0),Ye(e).then(()=>{z.set(e)}).finally(()=>{clearTimeout(r),ie.set(!1)})}return z.set(e)},M=Ir(Pr({},z),{set:Nr}),Y=e=>{const t=Object.create(null);return n=>{const i=JSON.stringify(n);return i in t?t[i]:t[i]=e(n)}};var Or=Object.defineProperty,Q=Object.getOwnPropertySymbols,Ke=Object.prototype.hasOwnProperty,et=Object.prototype.propertyIsEnumerable,Le=(e,t,r)=>t in e?Or(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ee=(e,t)=>{for(var r in t||(t={}))Ke.call(t,r)&&Le(e,r,t[r]);if(Q)for(var r of Q(t))et.call(t,r)&&Le(e,r,t[r]);return e},C=(e,t)=>{var r={};for(var n in e)Ke.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Q)for(var n of Q(e))t.indexOf(n)<0&&et.call(e,n)&&(r[n]=e[n]);return r};const V=(e,t)=>{const{formats:r}=N();if(e in r&&t in r[e])return r[e][t];throw new Error(`[svelte-i18n] Unknown "${t}" ${e} format.`)},Lr=Y(e=>{var t=e,{locale:r,format:n}=t,i=C(t,["locale","format"]);if(r==null)throw new Error('[svelte-i18n] A "locale" must be set to format numbers');return n&&(i=V("number",n)),new Intl.NumberFormat(r,i)}),Mr=Y(e=>{var t=e,{locale:r,format:n}=t,i=C(t,["locale","format"]);if(r==null)throw new Error('[svelte-i18n] A "locale" must be set to format dates');return n?i=V("date",n):Object.keys(i).length===0&&(i=V("date","short")),new Intl.DateTimeFormat(r,i)}),Cr=Y(e=>{var t=e,{locale:r,format:n}=t,i=C(t,["locale","format"]);if(r==null)throw new Error('[svelte-i18n] A "locale" must be set to format time values');return n?i=V("time",n):Object.keys(i).length===0&&(i=V("time","short")),new Intl.DateTimeFormat(r,i)}),wr=(e={})=>{var t=e,{locale:r=H()}=t,n=C(t,["locale"]);return Lr(Ee({locale:r},n))},Rr=(e={})=>{var t=e,{locale:r=H()}=t,n=C(t,["locale"]);return Mr(Ee({locale:r},n))},Ur=(e={})=>{var t=e,{locale:r=H()}=t,n=C(t,["locale"]);return Cr(Ee({locale:r},n))},Gr=Y((e,t=H())=>new Je(e,t,N().formats,{ignoreTag:N().ignoreTag})),Dr=(e,t={})=>{var r,n,i,a;let o=t;typeof e=="object"&&(o=e,e=o.id);const{values:h,locale:f=H(),default:u}=o;if(f==null)throw new Error("[svelte-i18n] Cannot format a message without first setting the initial locale.");let s=qe(e,f);if(!s)s=(a=(i=(n=(r=N()).handleMissingMessage)==null?void 0:n.call(r,{local