@transifex/native 7.1.3 → 7.1.4

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.
@@ -1,3 +1,3 @@
1
1
  /*! For license information please see browser.native.js.LICENSE.txt */
2
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Transifex=e():t.Transifex=e()}(this,(()=>(()=>{var t={151:t=>{var e={utf8:{stringToBytes:function(t){return e.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(e.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],r=0;r<t.length;r++)e.push(255&t.charCodeAt(r));return e},bytesToString:function(t){for(var e=[],r=0;r<t.length;r++)e.push(String.fromCharCode(t[r]));return e.join("")}}};t.exports=e},945:(t,e,r)=>{var n="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==r.g&&r.g,i=function(){function t(){this.fetch=!1,this.DOMException=n.DOMException}return t.prototype=n,new t}();!function(t){!function(e){var r=void 0!==t&&t||"undefined"!=typeof self&&self||void 0!==r&&r,n="URLSearchParams"in r,i="Symbol"in r&&"iterator"in Symbol,o="FileReader"in r&&"Blob"in r&&function(){try{return new Blob,!0}catch(t){return!1}}(),s="FormData"in r,a="ArrayBuffer"in r;if(a)var h=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(t){return t&&h.indexOf(Object.prototype.toString.call(t))>-1};function u(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw new TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function l(t){return"string"!=typeof t&&(t=String(t)),t}function f(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return i&&(e[Symbol.iterator]=function(){return e}),e}function p(t){this.map={},t instanceof p?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function d(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function y(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function g(t){var e=new FileReader,r=y(e);return e.readAsArrayBuffer(t),r}function E(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function b(){return this.bodyUsed=!1,this._initBody=function(t){var e;this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:o&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:s&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:n&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():a&&o&&(e=t)&&DataView.prototype.isPrototypeOf(e)?(this._bodyArrayBuffer=E(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(t)||c(t))?this._bodyArrayBuffer=E(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o&&(this.blob=function(){var t=d(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?d(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer)):this.blob().then(g)}),this.text=function(){var t,e,r,n=d(this);if(n)return n;if(this._bodyBlob)return t=this._bodyBlob,r=y(e=new FileReader),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},s&&(this.formData=function(){return this.text().then(v)}),this.json=function(){return this.text().then(JSON.parse)},this}p.prototype.append=function(t,e){t=u(t),e=l(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},p.prototype.delete=function(t){delete this.map[u(t)]},p.prototype.get=function(t){return t=u(t),this.has(t)?this.map[t]:null},p.prototype.has=function(t){return this.map.hasOwnProperty(u(t))},p.prototype.set=function(t,e){this.map[u(t)]=l(e)},p.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},p.prototype.keys=function(){var t=[];return this.forEach((function(e,r){t.push(r)})),f(t)},p.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),f(t)},p.prototype.entries=function(){var t=[];return this.forEach((function(e,r){t.push([r,e])})),f(t)},i&&(p.prototype[Symbol.iterator]=p.prototype.entries);var m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function T(t,e){if(!(this instanceof T))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var r,n,i=(e=e||{}).body;if(t instanceof T){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new p(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,i||null==t._bodyInit||(i=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new p(e.headers)),this.method=(n=(r=e.method||this.method||"GET").toUpperCase(),m.indexOf(n)>-1?n:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==e.cache&&"no-cache"!==e.cache)){var o=/([?&])_=[^&]*/;o.test(this.url)?this.url=this.url.replace(o,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function v(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(i))}})),e}function _(t,e){if(!(this instanceof _))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===e.statusText?"":""+e.statusText,this.headers=new p(e.headers),this.url=e.url||"",this._initBody(t)}T.prototype.clone=function(){return new T(this,{body:this._bodyInit})},b.call(T.prototype),b.call(_.prototype),_.prototype.clone=function(){return new _(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},_.error=function(){var t=new _(null,{status:0,statusText:""});return t.type="error",t};var H=[301,302,303,307,308];_.redirect=function(t,e){if(-1===H.indexOf(e))throw new RangeError("Invalid status code");return new _(null,{status:e,headers:{location:t}})},e.DOMException=r.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function A(t,n){return new Promise((function(i,s){var h=new T(t,n);if(h.signal&&h.signal.aborted)return s(new e.DOMException("Aborted","AbortError"));var c=new XMLHttpRequest;function u(){c.abort()}c.onload=function(){var t,e,r={status:c.status,statusText:c.statusText,headers:(t=c.getAllResponseHeaders()||"",e=new p,t.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(t){return 0===t.indexOf("\n")?t.substr(1,t.length):t})).forEach((function(t){var r=t.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();e.append(n,i)}})),e)};r.url="responseURL"in c?c.responseURL:r.headers.get("X-Request-URL");var n="response"in c?c.response:c.responseText;setTimeout((function(){i(new _(n,r))}),0)},c.onerror=function(){setTimeout((function(){s(new TypeError("Network request failed"))}),0)},c.ontimeout=function(){setTimeout((function(){s(new TypeError("Network request failed"))}),0)},c.onabort=function(){setTimeout((function(){s(new e.DOMException("Aborted","AbortError"))}),0)},c.open(h.method,function(t){try{return""===t&&r.location.href?r.location.href:t}catch(e){return t}}(h.url),!0),"include"===h.credentials?c.withCredentials=!0:"omit"===h.credentials&&(c.withCredentials=!1),"responseType"in c&&(o?c.responseType="blob":a&&h.headers.get("Content-Type")&&-1!==h.headers.get("Content-Type").indexOf("application/octet-stream")&&(c.responseType="arraybuffer")),!n||"object"!=typeof n.headers||n.headers instanceof p?h.headers.forEach((function(t,e){c.setRequestHeader(e,t)})):Object.getOwnPropertyNames(n.headers).forEach((function(t){c.setRequestHeader(t,l(n.headers[t]))})),h.signal&&(h.signal.addEventListener("abort",u),c.onreadystatechange=function(){4===c.readyState&&h.signal.removeEventListener("abort",u)}),c.send(void 0===h._bodyInit?null:h._bodyInit)}))}A.polyfill=!0,r.fetch||(r.fetch=A,r.Headers=p,r.Request=T,r.Response=_),e.Headers=p,e.Request=T,e.Response=_,e.fetch=A}({})}(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var o=n.fetch?n:i;(e=o.fetch).default=o.fetch,e.fetch=o.fetch,e.Headers=o.Headers,e.Request=o.Request,e.Response=o.Response,t.exports=e},939:t=>{var e,r;e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&r.rotl(t,8)|4278255360&r.rotl(t,24);for(var e=0;e<t.length;e++)t[e]=r.endian(t[e]);return t},randomBytes:function(t){for(var e=[];t>0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],r=0,n=0;r<t.length;r++,n+=8)e[n>>>5]|=t[r]<<24-n%32;return e},wordsToBytes:function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},bytesToHex:function(t){for(var e=[],r=0;r<t.length;r++)e.push((t[r]>>>4).toString(16)),e.push((15&t[r]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e},bytesToBase64:function(t){for(var r=[],n=0;n<t.length;n+=3)for(var i=t[n]<<16|t[n+1]<<8|t[n+2],o=0;o<4;o++)8*n+6*o<=8*t.length?r.push(e.charAt(i>>>6*(3-o)&63)):r.push("=");return r.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var r=[],n=0,i=0;n<t.length;i=++n%4)0!=i&&r.push((e.indexOf(t.charAt(n-1))&Math.pow(2,-2*i+8)-1)<<2*i|e.indexOf(t.charAt(n))>>>6-2*i);return r}},t.exports=r},206:t=>{function e(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}t.exports=function(t){return null!=t&&(e(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&e(t.slice(0,0))}(t)||!!t._isBuffer)}},503:(t,e,r)=>{var n,i,o,s,a;n=r(939),i=r(151).utf8,o=r(206),s=r(151).bin,(a=function(t,e){t.constructor==String?t=e&&"binary"===e.encoding?s.stringToBytes(t):i.stringToBytes(t):o(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||t.constructor===Uint8Array||(t=t.toString());for(var r=n.bytesToWords(t),h=8*t.length,c=1732584193,u=-271733879,l=-1732584194,f=271733878,p=0;p<r.length;p++)r[p]=16711935&(r[p]<<8|r[p]>>>24)|4278255360&(r[p]<<24|r[p]>>>8);r[h>>>5]|=128<<h%32,r[14+(h+64>>>9<<4)]=h;var d=a._ff,y=a._gg,g=a._hh,E=a._ii;for(p=0;p<r.length;p+=16){var b=c,m=u,T=l,v=f;c=d(c,u,l,f,r[p+0],7,-680876936),f=d(f,c,u,l,r[p+1],12,-389564586),l=d(l,f,c,u,r[p+2],17,606105819),u=d(u,l,f,c,r[p+3],22,-1044525330),c=d(c,u,l,f,r[p+4],7,-176418897),f=d(f,c,u,l,r[p+5],12,1200080426),l=d(l,f,c,u,r[p+6],17,-1473231341),u=d(u,l,f,c,r[p+7],22,-45705983),c=d(c,u,l,f,r[p+8],7,1770035416),f=d(f,c,u,l,r[p+9],12,-1958414417),l=d(l,f,c,u,r[p+10],17,-42063),u=d(u,l,f,c,r[p+11],22,-1990404162),c=d(c,u,l,f,r[p+12],7,1804603682),f=d(f,c,u,l,r[p+13],12,-40341101),l=d(l,f,c,u,r[p+14],17,-1502002290),c=y(c,u=d(u,l,f,c,r[p+15],22,1236535329),l,f,r[p+1],5,-165796510),f=y(f,c,u,l,r[p+6],9,-1069501632),l=y(l,f,c,u,r[p+11],14,643717713),u=y(u,l,f,c,r[p+0],20,-373897302),c=y(c,u,l,f,r[p+5],5,-701558691),f=y(f,c,u,l,r[p+10],9,38016083),l=y(l,f,c,u,r[p+15],14,-660478335),u=y(u,l,f,c,r[p+4],20,-405537848),c=y(c,u,l,f,r[p+9],5,568446438),f=y(f,c,u,l,r[p+14],9,-1019803690),l=y(l,f,c,u,r[p+3],14,-187363961),u=y(u,l,f,c,r[p+8],20,1163531501),c=y(c,u,l,f,r[p+13],5,-1444681467),f=y(f,c,u,l,r[p+2],9,-51403784),l=y(l,f,c,u,r[p+7],14,1735328473),c=g(c,u=y(u,l,f,c,r[p+12],20,-1926607734),l,f,r[p+5],4,-378558),f=g(f,c,u,l,r[p+8],11,-2022574463),l=g(l,f,c,u,r[p+11],16,1839030562),u=g(u,l,f,c,r[p+14],23,-35309556),c=g(c,u,l,f,r[p+1],4,-1530992060),f=g(f,c,u,l,r[p+4],11,1272893353),l=g(l,f,c,u,r[p+7],16,-155497632),u=g(u,l,f,c,r[p+10],23,-1094730640),c=g(c,u,l,f,r[p+13],4,681279174),f=g(f,c,u,l,r[p+0],11,-358537222),l=g(l,f,c,u,r[p+3],16,-722521979),u=g(u,l,f,c,r[p+6],23,76029189),c=g(c,u,l,f,r[p+9],4,-640364487),f=g(f,c,u,l,r[p+12],11,-421815835),l=g(l,f,c,u,r[p+15],16,530742520),c=E(c,u=g(u,l,f,c,r[p+2],23,-995338651),l,f,r[p+0],6,-198630844),f=E(f,c,u,l,r[p+7],10,1126891415),l=E(l,f,c,u,r[p+14],15,-1416354905),u=E(u,l,f,c,r[p+5],21,-57434055),c=E(c,u,l,f,r[p+12],6,1700485571),f=E(f,c,u,l,r[p+3],10,-1894986606),l=E(l,f,c,u,r[p+10],15,-1051523),u=E(u,l,f,c,r[p+1],21,-2054922799),c=E(c,u,l,f,r[p+8],6,1873313359),f=E(f,c,u,l,r[p+15],10,-30611744),l=E(l,f,c,u,r[p+6],15,-1560198380),u=E(u,l,f,c,r[p+13],21,1309151649),c=E(c,u,l,f,r[p+4],6,-145523070),f=E(f,c,u,l,r[p+11],10,-1120210379),l=E(l,f,c,u,r[p+2],15,718787259),u=E(u,l,f,c,r[p+9],21,-343485551),c=c+b>>>0,u=u+m>>>0,l=l+T>>>0,f=f+v>>>0}return n.endian([c,u,l,f])})._ff=function(t,e,r,n,i,o,s){var a=t+(e&r|~e&n)+(i>>>0)+s;return(a<<o|a>>>32-o)+e},a._gg=function(t,e,r,n,i,o,s){var a=t+(e&n|r&~n)+(i>>>0)+s;return(a<<o|a>>>32-o)+e},a._hh=function(t,e,r,n,i,o,s){var a=t+(e^r^n)+(i>>>0)+s;return(a<<o|a>>>32-o)+e},a._ii=function(t,e,r,n,i,o,s){var a=t+(r^(e|~n))+(i>>>0)+s;return(a<<o|a>>>32-o)+e},a._blocksize=16,a._digestsize=16,t.exports=function(t,e){if(null==t)throw new Error("Illegal argument "+t);var r=n.wordsToBytes(a(t,e));return e&&e.asBytes?r:e&&e.asString?s.bytesToString(r):n.bytesToHex(r)}}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n](o,o.exports,r),o.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{FETCHING_LOCALES:()=>$t,FETCHING_TRANSLATIONS:()=>jt,LOCALES_FETCHED:()=>Yt,LOCALES_FETCH_FAILED:()=>zt,LOCALE_CHANGED:()=>Kt,MessageFormatRenderer:()=>le,PseudoTranslationPolicy:()=>ae,SourceErrorPolicy:()=>ce,SourceStringPolicy:()=>he,TRANSLATIONS_FETCHED:()=>Vt,TRANSLATIONS_FETCH_FAILED:()=>Xt,ThrowErrorPolicy:()=>ue,createNativeInstance:()=>fe,escape:()=>Gt,explodePlurals:()=>re,generateHashedKey:()=>Dt,generateKey:()=>Ut,implodePlurals:()=>ne,isPluralized:()=>ie,isString:()=>Ft,normalizeLocale:()=>xt,offEvent:()=>qt,onEvent:()=>Wt,sendEvent:()=>Jt,sleep:()=>kt,t:()=>de,tx:()=>pe});var t=r(945),e=r.n(t);class i{constructor(){this.translationsByLocale={}}update(t,e){const r=this.translationsByLocale[t]||{};this.translationsByLocale[t]={...r,...e}}getTranslations(t){return this.translationsByLocale[t]||{}}hasTranslations(t){return!!this.translationsByLocale[t]}isStale(t){return!this.hasTranslations(t)}get(t,e){return this.getTranslations(e)[t]||""}}class o{handle(t,e,r,n){return e}}class s{handle(t,e,r){return t}}var a=function(t,e){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},a(t,e)};function h(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var c,u,l,f=function(){return f=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},f.apply(this,arguments)};function p(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i<o;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))}function d(t){return t.type===u.literal}function y(t){return t.type===u.argument}function g(t){return t.type===u.number}function E(t){return t.type===u.date}function b(t){return t.type===u.time}function m(t){return t.type===u.select}function T(t){return t.type===u.plural}function v(t){return t.type===u.pound}function _(t){return t.type===u.tag}function H(t){return!(!t||"object"!=typeof t||t.type!==l.number)}function A(t){return!(!t||"object"!=typeof t||t.type!==l.dateTime)}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError,function(t){t[t.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",t[t.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",t[t.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",t[t.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",t[t.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",t[t.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",t[t.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",t[t.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",t[t.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",t[t.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",t[t.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",t[t.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",t[t.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",t[t.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",t[t.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",t[t.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",t[t.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",t[t.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",t[t.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",t[t.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",t[t.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",t[t.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",t[t.INVALID_TAG=23]="INVALID_TAG",t[t.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",t[t.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",t[t.UNCLOSED_TAG=27]="UNCLOSED_TAG"}(c||(c={})),function(t){t[t.literal=0]="literal",t[t.argument=1]="argument",t[t.number=2]="number",t[t.date=3]="date",t[t.time=4]="time",t[t.select=5]="select",t[t.plural=6]="plural",t[t.pound=7]="pound",t[t.tag=8]="tag"}(u||(u={})),function(t){t[t.number=0]="number",t[t.dateTime=1]="dateTime"}(l||(l={}));var B=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,w=/(?:[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 S(t){var e={};return t.replace(w,(function(t){var r=t.length;switch(t[0]){case"G":e.era=4===r?"long":5===r?"narrow":"short";break;case"y":e.year=2===r?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":e.month=["numeric","2-digit","short","long","narrow"][r-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":e.day=["numeric","2-digit"][r-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":e.weekday=4===r?"long":5===r?"narrow":"short";break;case"e":if(r<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");e.weekday=["short","long","narrow","short"][r-4];break;case"c":if(r<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");e.weekday=["short","long","narrow","short"][r-4];break;case"a":e.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":e.hourCycle="h12",e.hour=["numeric","2-digit"][r-1];break;case"H":e.hourCycle="h23",e.hour=["numeric","2-digit"][r-1];break;case"K":e.hourCycle="h11",e.hour=["numeric","2-digit"][r-1];break;case"k":e.hourCycle="h24",e.hour=["numeric","2-digit"][r-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":e.minute=["numeric","2-digit"][r-1];break;case"s":e.second=["numeric","2-digit"][r-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":e.timeZoneName=r<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""})),e}var L=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i,P=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,I=/^(@+)?(\+|#+)?[rs]?$/g,O=/(\*)(0+)|(#+)(0+)|(0+)/g,C=/^(0+)$/;function N(t){var e={};return"r"===t[t.length-1]?e.roundingPriority="morePrecision":"s"===t[t.length-1]&&(e.roundingPriority="lessPrecision"),t.replace(I,(function(t,r,n){return"string"!=typeof n?(e.minimumSignificantDigits=r.length,e.maximumSignificantDigits=r.length):"+"===n?e.minimumSignificantDigits=r.length:"#"===r[0]?e.maximumSignificantDigits=r.length:(e.minimumSignificantDigits=r.length,e.maximumSignificantDigits=r.length+("string"==typeof n?n.length:0)),""})),e}function R(t){switch(t){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 M(t){var e;if("E"===t[0]&&"E"===t[1]?(e={notation:"engineering"},t=t.slice(2)):"E"===t[0]&&(e={notation:"scientific"},t=t.slice(1)),e){var r=t.slice(0,2);if("+!"===r?(e.signDisplay="always",t=t.slice(2)):"+?"===r&&(e.signDisplay="exceptZero",t=t.slice(2)),!C.test(t))throw new Error("Malformed concise eng/scientific notation");e.minimumIntegerDigits=t.length}return e}function U(t){return R(t)||{}}function D(t){for(var e={},r=0,n=t;r<n.length;r++){var i=n[r];switch(i.stem){case"percent":case"%":e.style="percent";continue;case"%x100":e.style="percent",e.scale=100;continue;case"currency":e.style="currency",e.currency=i.options[0];continue;case"group-off":case",_":e.useGrouping=!1;continue;case"precision-integer":case".":e.maximumFractionDigits=0;continue;case"measure-unit":case"unit":e.style="unit",e.unit=i.options[0].replace(/^(.*?)-/,"");continue;case"compact-short":case"K":e.notation="compact",e.compactDisplay="short";continue;case"compact-long":case"KK":e.notation="compact",e.compactDisplay="long";continue;case"scientific":e=f(f(f({},e),{notation:"scientific"}),i.options.reduce((function(t,e){return f(f({},t),U(e))}),{}));continue;case"engineering":e=f(f(f({},e),{notation:"engineering"}),i.options.reduce((function(t,e){return f(f({},t),U(e))}),{}));continue;case"notation-simple":e.notation="standard";continue;case"unit-width-narrow":e.currencyDisplay="narrowSymbol",e.unitDisplay="narrow";continue;case"unit-width-short":e.currencyDisplay="code",e.unitDisplay="short";continue;case"unit-width-full-name":e.currencyDisplay="name",e.unitDisplay="long";continue;case"unit-width-iso-code":e.currencyDisplay="symbol";continue;case"scale":e.scale=parseFloat(i.options[0]);continue;case"rounding-mode-floor":e.roundingMode="floor";continue;case"rounding-mode-ceiling":e.roundingMode="ceil";continue;case"rounding-mode-down":e.roundingMode="trunc";continue;case"rounding-mode-up":e.roundingMode="expand";continue;case"rounding-mode-half-even":e.roundingMode="halfEven";continue;case"rounding-mode-half-down":e.roundingMode="halfTrunc";continue;case"rounding-mode-half-up":e.roundingMode="halfExpand";continue;case"integer-width":if(i.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(O,(function(t,r,n,i,o,s){if(r)e.minimumIntegerDigits=n.length;else{if(i&&o)throw new Error("We currently do not support maximum integer digits");if(s)throw new Error("We currently do not support exact integer digits")}return""}));continue}if(C.test(i.stem))e.minimumIntegerDigits=i.stem.length;else if(P.test(i.stem)){if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(P,(function(t,r,n,i,o,s){return"*"===n?e.minimumFractionDigits=r.length:i&&"#"===i[0]?e.maximumFractionDigits=i.length:o&&s?(e.minimumFractionDigits=o.length,e.maximumFractionDigits=o.length+s.length):(e.minimumFractionDigits=r.length,e.maximumFractionDigits=r.length),""}));var o=i.options[0];"w"===o?e=f(f({},e),{trailingZeroDisplay:"stripIfInteger"}):o&&(e=f(f({},e),N(o)))}else if(I.test(i.stem))e=f(f({},e),N(i.stem));else{var s=R(i.stem);s&&(e=f(f({},e),s));var a=M(i.stem);a&&(e=f(f({},e),a))}}return e}var G,F={"001":["H","h"],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","hB","h","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","hB","h","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"],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","hB","h","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"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["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"],"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 x(t){var e=t.hourCycle;if(void 0===e&&t.hourCycles&&t.hourCycles.length&&(e=t.hourCycles[0]),e)switch(e){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var r,n=t.language;return"root"!==n&&(r=t.maximize().region),(F[r||""]||F[n||""]||F["".concat(n,"-001")]||F["001"])[0]}var k=new RegExp("^".concat(B.source,"*")),j=new RegExp("".concat(B.source,"*$"));function V(t,e){return{start:t,end:e}}var X=!!String.prototype.startsWith&&"_a".startsWith("a",1),K=!!String.fromCodePoint,$=!!Object.fromEntries,Y=!!String.prototype.codePointAt,z=!!String.prototype.trimStart,Z=!!String.prototype.trimEnd,W=Number.isSafeInteger?Number.isSafeInteger:function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t&&Math.abs(t)<=9007199254740991},q=!0;try{q="a"===(null===(G=ot("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===G?void 0:G[0])}catch(t){q=!1}var J,Q=X?function(t,e,r){return t.startsWith(e,r)}:function(t,e,r){return t.slice(r,r+e.length)===e},tt=K?String.fromCodePoint:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r,n="",i=t.length,o=0;i>o;){if((r=t[o++])>1114111)throw RangeError(r+" is not a valid code point");n+=r<65536?String.fromCharCode(r):String.fromCharCode(55296+((r-=65536)>>10),r%1024+56320)}return n},et=$?Object.fromEntries:function(t){for(var e={},r=0,n=t;r<n.length;r++){var i=n[r],o=i[0],s=i[1];e[o]=s}return e},rt=Y?function(t,e){return t.codePointAt(e)}:function(t,e){var r=t.length;if(!(e<0||e>=r)){var n,i=t.charCodeAt(e);return i<55296||i>56319||e+1===r||(n=t.charCodeAt(e+1))<56320||n>57343?i:n-56320+(i-55296<<10)+65536}},nt=z?function(t){return t.trimStart()}:function(t){return t.replace(k,"")},it=Z?function(t){return t.trimEnd()}:function(t){return t.replace(j,"")};function ot(t,e){return new RegExp(t,e)}if(q){var st=ot("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");J=function(t,e){var r;return st.lastIndex=e,null!==(r=st.exec(t)[1])&&void 0!==r?r:""}}else J=function(t,e){for(var r=[];;){var n=rt(t,e);if(void 0===n||ct(n)||ut(n))break;r.push(n),e+=n>=65536?2:1}return tt.apply(void 0,r)};var at=function(){function t(t,e){void 0===e&&(e={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!e.ignoreTag,this.locale=e.locale,this.requiresOtherClause=!!e.requiresOtherClause,this.shouldParseSkeletons=!!e.shouldParseSkeletons}return t.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},t.prototype.parseMessage=function(t,e,r){for(var n=[];!this.isEOF();){var i=this.char();if(123===i){if((o=this.parseArgument(t,r)).err)return o;n.push(o.val)}else{if(125===i&&t>0)break;if(35!==i||"plural"!==e&&"selectordinal"!==e){if(60===i&&!this.ignoreTag&&47===this.peek()){if(r)break;return this.error(c.UNMATCHED_CLOSING_TAG,V(this.clonePosition(),this.clonePosition()))}if(60===i&&!this.ignoreTag&&ht(this.peek()||0)){if((o=this.parseTag(t,e)).err)return o;n.push(o.val)}else{var o;if((o=this.parseLiteral(t,e)).err)return o;n.push(o.val)}}else{var s=this.clonePosition();this.bump(),n.push({type:u.pound,location:V(s,this.clonePosition())})}}}return{val:n,err:null}},t.prototype.parseTag=function(t,e){var r=this.clonePosition();this.bump();var n=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:u.literal,value:"<".concat(n,"/>"),location:V(r,this.clonePosition())},err:null};if(this.bumpIf(">")){var i=this.parseMessage(t+1,e,!0);if(i.err)return i;var o=i.val,s=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!ht(this.char()))return this.error(c.INVALID_TAG,V(s,this.clonePosition()));var a=this.clonePosition();return n!==this.parseTagName()?this.error(c.UNMATCHED_CLOSING_TAG,V(a,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:u.tag,value:n,children:o,location:V(r,this.clonePosition())},err:null}:this.error(c.INVALID_TAG,V(s,this.clonePosition())))}return this.error(c.UNCLOSED_TAG,V(r,this.clonePosition()))}return this.error(c.INVALID_TAG,V(r,this.clonePosition()))},t.prototype.parseTagName=function(){var t,e=this.offset();for(this.bump();!this.isEOF()&&(45===(t=this.char())||46===t||t>=48&&t<=57||95===t||t>=97&&t<=122||t>=65&&t<=90||183==t||t>=192&&t<=214||t>=216&&t<=246||t>=248&&t<=893||t>=895&&t<=8191||t>=8204&&t<=8205||t>=8255&&t<=8256||t>=8304&&t<=8591||t>=11264&&t<=12271||t>=12289&&t<=55295||t>=63744&&t<=64975||t>=65008&&t<=65533||t>=65536&&t<=983039);)this.bump();return this.message.slice(e,this.offset())},t.prototype.parseLiteral=function(t,e){for(var r=this.clonePosition(),n="";;){var i=this.tryParseQuote(e);if(i)n+=i;else{var o=this.tryParseUnquoted(t,e);if(o)n+=o;else{var s=this.tryParseLeftAngleBracket();if(!s)break;n+=s}}}var a=V(r,this.clonePosition());return{val:{type:u.literal,value:n,location:a},err:null}},t.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(ht(t=this.peek()||0)||47===t)?null:(this.bump(),"<");var t},t.prototype.tryParseQuote=function(t){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===t||"selectordinal"===t)break;return null;default:return null}this.bump();var e=[this.char()];for(this.bump();!this.isEOF();){var r=this.char();if(39===r){if(39!==this.peek()){this.bump();break}e.push(39),this.bump()}else e.push(r);this.bump()}return tt.apply(void 0,e)},t.prototype.tryParseUnquoted=function(t,e){if(this.isEOF())return null;var r=this.char();return 60===r||123===r||35===r&&("plural"===e||"selectordinal"===e)||125===r&&t>0?null:(this.bump(),tt(r))},t.prototype.parseArgument=function(t,e){var r=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(c.EXPECT_ARGUMENT_CLOSING_BRACE,V(r,this.clonePosition()));if(125===this.char())return this.bump(),this.error(c.EMPTY_ARGUMENT,V(r,this.clonePosition()));var n=this.parseIdentifierIfPossible().value;if(!n)return this.error(c.MALFORMED_ARGUMENT,V(r,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(c.EXPECT_ARGUMENT_CLOSING_BRACE,V(r,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:u.argument,value:n,location:V(r,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(c.EXPECT_ARGUMENT_CLOSING_BRACE,V(r,this.clonePosition())):this.parseArgumentOptions(t,e,n,r);default:return this.error(c.MALFORMED_ARGUMENT,V(r,this.clonePosition()))}},t.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),e=this.offset(),r=J(this.message,e),n=e+r.length;return this.bumpTo(n),{value:r,location:V(t,this.clonePosition())}},t.prototype.parseArgumentOptions=function(t,e,r,n){var i,o=this.clonePosition(),s=this.parseIdentifierIfPossible().value,a=this.clonePosition();switch(s){case"":return this.error(c.EXPECT_ARGUMENT_TYPE,V(o,a));case"number":case"date":case"time":this.bumpSpace();var h=null;if(this.bumpIf(",")){this.bumpSpace();var p=this.clonePosition();if((v=this.parseSimpleArgStyleIfPossible()).err)return v;if(0===(E=it(v.val)).length)return this.error(c.EXPECT_ARGUMENT_STYLE,V(this.clonePosition(),this.clonePosition()));h={style:E,styleLocation:V(p,this.clonePosition())}}if((_=this.tryParseArgumentClose(n)).err)return _;var d=V(n,this.clonePosition());if(h&&Q(null==h?void 0:h.style,"::",0)){var y=nt(h.style.slice(2));if("number"===s)return(v=this.parseNumberSkeletonFromString(y,h.styleLocation)).err?v:{val:{type:u.number,value:r,location:d,style:v.val},err:null};if(0===y.length)return this.error(c.EXPECT_DATE_TIME_SKELETON,d);var g=y;this.locale&&(g=function(t,e){for(var r="",n=0;n<t.length;n++){var i=t.charAt(n);if("j"===i){for(var o=0;n+1<t.length&&t.charAt(n+1)===i;)o++,n++;var s=1+(1&o),a=o<2?1:3+(o>>1),h=x(e);for("H"!=h&&"k"!=h||(a=0);a-- >0;)r+="a";for(;s-- >0;)r=h+r}else r+="J"===i?"H":i}return r}(y,this.locale));var E={type:l.dateTime,pattern:g,location:h.styleLocation,parsedOptions:this.shouldParseSkeletons?S(g):{}};return{val:{type:"date"===s?u.date:u.time,value:r,location:d,style:E},err:null}}return{val:{type:"number"===s?u.number:"date"===s?u.date:u.time,value:r,location:d,style:null!==(i=null==h?void 0:h.style)&&void 0!==i?i:null},err:null};case"plural":case"selectordinal":case"select":var b=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(c.EXPECT_SELECT_ARGUMENT_OPTIONS,V(b,f({},b)));this.bumpSpace();var m=this.parseIdentifierIfPossible(),T=0;if("select"!==s&&"offset"===m.value){if(!this.bumpIf(":"))return this.error(c.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,V(this.clonePosition(),this.clonePosition()));var v;if(this.bumpSpace(),(v=this.tryParseDecimalInteger(c.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,c.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return v;this.bumpSpace(),m=this.parseIdentifierIfPossible(),T=v.val}var _,H=this.tryParsePluralOrSelectOptions(t,s,e,m);if(H.err)return H;if((_=this.tryParseArgumentClose(n)).err)return _;var A=V(n,this.clonePosition());return"select"===s?{val:{type:u.select,value:r,options:et(H.val),location:A},err:null}:{val:{type:u.plural,value:r,options:et(H.val),offset:T,pluralType:"plural"===s?"cardinal":"ordinal",location:A},err:null};default:return this.error(c.INVALID_ARGUMENT_TYPE,V(o,a))}},t.prototype.tryParseArgumentClose=function(t){return this.isEOF()||125!==this.char()?this.error(c.EXPECT_ARGUMENT_CLOSING_BRACE,V(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},t.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,e=this.clonePosition();!this.isEOF();)switch(this.char()){case 39:this.bump();var r=this.clonePosition();if(!this.bumpUntil("'"))return this.error(c.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,V(r,this.clonePosition()));this.bump();break;case 123:t+=1,this.bump();break;case 125:if(!(t>0))return{val:this.message.slice(e.offset,this.offset()),err:null};t-=1;break;default:this.bump()}return{val:this.message.slice(e.offset,this.offset()),err:null}},t.prototype.parseNumberSkeletonFromString=function(t,e){var r=[];try{r=function(t){if(0===t.length)throw new Error("Number skeleton cannot be empty");for(var e=[],r=0,n=t.split(L).filter((function(t){return t.length>0}));r<n.length;r++){var i=n[r].split("/");if(0===i.length)throw new Error("Invalid number skeleton");for(var o=i[0],s=i.slice(1),a=0,h=s;a<h.length;a++)if(0===h[a].length)throw new Error("Invalid number skeleton");e.push({stem:o,options:s})}return e}(t)}catch(t){return this.error(c.INVALID_NUMBER_SKELETON,e)}return{val:{type:l.number,tokens:r,location:e,parsedOptions:this.shouldParseSkeletons?D(r):{}},err:null}},t.prototype.tryParsePluralOrSelectOptions=function(t,e,r,n){for(var i,o=!1,s=[],a=new Set,h=n.value,u=n.location;;){if(0===h.length){var l=this.clonePosition();if("select"===e||!this.bumpIf("="))break;var f=this.tryParseDecimalInteger(c.EXPECT_PLURAL_ARGUMENT_SELECTOR,c.INVALID_PLURAL_ARGUMENT_SELECTOR);if(f.err)return f;u=V(l,this.clonePosition()),h=this.message.slice(l.offset,this.offset())}if(a.has(h))return this.error("select"===e?c.DUPLICATE_SELECT_ARGUMENT_SELECTOR:c.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,u);"other"===h&&(o=!0),this.bumpSpace();var p=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===e?c.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:c.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,V(this.clonePosition(),this.clonePosition()));var d=this.parseMessage(t+1,e,r);if(d.err)return d;var y=this.tryParseArgumentClose(p);if(y.err)return y;s.push([h,{value:d.val,location:V(p,this.clonePosition())}]),a.add(h),this.bumpSpace(),h=(i=this.parseIdentifierIfPossible()).value,u=i.location}return 0===s.length?this.error("select"===e?c.EXPECT_SELECT_ARGUMENT_SELECTOR:c.EXPECT_PLURAL_ARGUMENT_SELECTOR,V(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!o?this.error(c.MISSING_OTHER_CLAUSE,V(this.clonePosition(),this.clonePosition())):{val:s,err:null}},t.prototype.tryParseDecimalInteger=function(t,e){var r=1,n=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(r=-1);for(var i=!1,o=0;!this.isEOF();){var s=this.char();if(!(s>=48&&s<=57))break;i=!0,o=10*o+(s-48),this.bump()}var a=V(n,this.clonePosition());return i?W(o*=r)?{val:o,err:null}:this.error(e,a):this.error(t,a)},t.prototype.offset=function(){return this.position.offset},t.prototype.isEOF=function(){return this.offset()===this.message.length},t.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},t.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var e=rt(this.message,t);if(void 0===e)throw Error("Offset ".concat(t," is at invalid UTF-16 code unit boundary"));return e},t.prototype.error=function(t,e){return{val:null,err:{kind:t,message:this.message,location:e}}},t.prototype.bump=function(){if(!this.isEOF()){var t=this.char();10===t?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=t<65536?1:2)}},t.prototype.bumpIf=function(t){if(Q(this.message,t,this.offset())){for(var e=0;e<t.length;e++)this.bump();return!0}return!1},t.prototype.bumpUntil=function(t){var e=this.offset(),r=this.message.indexOf(t,e);return r>=0?(this.bumpTo(r),!0):(this.bumpTo(this.message.length),!1)},t.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".concat(t," must be greater than or equal to the current offset ").concat(this.offset()));for(t=Math.min(t,this.message.length);;){var e=this.offset();if(e===t)break;if(e>t)throw Error("targetOffset ".concat(t," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},t.prototype.bumpSpace=function(){for(;!this.isEOF()&&ct(this.char());)this.bump()},t.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),e=this.offset(),r=this.message.charCodeAt(e+(t>=65536?2:1));return null!=r?r:null},t}();function ht(t){return t>=97&&t<=122||t>=65&&t<=90}function ct(t){return t>=9&&t<=13||32===t||133===t||t>=8206&&t<=8207||8232===t||8233===t}function ut(t){return t>=33&&t<=35||36===t||t>=37&&t<=39||40===t||41===t||42===t||43===t||44===t||45===t||t>=46&&t<=47||t>=58&&t<=59||t>=60&&t<=62||t>=63&&t<=64||91===t||92===t||93===t||94===t||96===t||123===t||124===t||125===t||126===t||161===t||t>=162&&t<=165||166===t||167===t||169===t||171===t||172===t||174===t||176===t||177===t||182===t||187===t||191===t||215===t||247===t||t>=8208&&t<=8213||t>=8214&&t<=8215||8216===t||8217===t||8218===t||t>=8219&&t<=8220||8221===t||8222===t||8223===t||t>=8224&&t<=8231||t>=8240&&t<=8248||8249===t||8250===t||t>=8251&&t<=8254||t>=8257&&t<=8259||8260===t||8261===t||8262===t||t>=8263&&t<=8273||8274===t||8275===t||t>=8277&&t<=8286||t>=8592&&t<=8596||t>=8597&&t<=8601||t>=8602&&t<=8603||t>=8604&&t<=8607||8608===t||t>=8609&&t<=8610||8611===t||t>=8612&&t<=8613||8614===t||t>=8615&&t<=8621||8622===t||t>=8623&&t<=8653||t>=8654&&t<=8655||t>=8656&&t<=8657||8658===t||8659===t||8660===t||t>=8661&&t<=8691||t>=8692&&t<=8959||t>=8960&&t<=8967||8968===t||8969===t||8970===t||8971===t||t>=8972&&t<=8991||t>=8992&&t<=8993||t>=8994&&t<=9e3||9001===t||9002===t||t>=9003&&t<=9083||9084===t||t>=9085&&t<=9114||t>=9115&&t<=9139||t>=9140&&t<=9179||t>=9180&&t<=9185||t>=9186&&t<=9254||t>=9255&&t<=9279||t>=9280&&t<=9290||t>=9291&&t<=9311||t>=9472&&t<=9654||9655===t||t>=9656&&t<=9664||9665===t||t>=9666&&t<=9719||t>=9720&&t<=9727||t>=9728&&t<=9838||9839===t||t>=9840&&t<=10087||10088===t||10089===t||10090===t||10091===t||10092===t||10093===t||10094===t||10095===t||10096===t||10097===t||10098===t||10099===t||10100===t||10101===t||t>=10132&&t<=10175||t>=10176&&t<=10180||10181===t||10182===t||t>=10183&&t<=10213||10214===t||10215===t||10216===t||10217===t||10218===t||10219===t||10220===t||10221===t||10222===t||10223===t||t>=10224&&t<=10239||t>=10240&&t<=10495||t>=10496&&t<=10626||10627===t||10628===t||10629===t||10630===t||10631===t||10632===t||10633===t||10634===t||10635===t||10636===t||10637===t||10638===t||10639===t||10640===t||10641===t||10642===t||10643===t||10644===t||10645===t||10646===t||10647===t||10648===t||t>=10649&&t<=10711||10712===t||10713===t||10714===t||10715===t||t>=10716&&t<=10747||10748===t||10749===t||t>=10750&&t<=11007||t>=11008&&t<=11055||t>=11056&&t<=11076||t>=11077&&t<=11078||t>=11079&&t<=11084||t>=11085&&t<=11123||t>=11124&&t<=11125||t>=11126&&t<=11157||11158===t||t>=11159&&t<=11263||t>=11776&&t<=11777||11778===t||11779===t||11780===t||11781===t||t>=11782&&t<=11784||11785===t||11786===t||11787===t||11788===t||11789===t||t>=11790&&t<=11798||11799===t||t>=11800&&t<=11801||11802===t||11803===t||11804===t||11805===t||t>=11806&&t<=11807||11808===t||11809===t||11810===t||11811===t||11812===t||11813===t||11814===t||11815===t||11816===t||11817===t||t>=11818&&t<=11822||11823===t||t>=11824&&t<=11833||t>=11834&&t<=11835||t>=11836&&t<=11839||11840===t||11841===t||11842===t||t>=11843&&t<=11855||t>=11856&&t<=11857||11858===t||t>=11859&&t<=11903||t>=12289&&t<=12291||12296===t||12297===t||12298===t||12299===t||12300===t||12301===t||12302===t||12303===t||12304===t||12305===t||t>=12306&&t<=12307||12308===t||12309===t||12310===t||12311===t||12312===t||12313===t||12314===t||12315===t||12316===t||12317===t||t>=12318&&t<=12319||12320===t||12336===t||64830===t||64831===t||t>=65093&&t<=65094}function lt(t){t.forEach((function(t){if(delete t.location,m(t)||T(t))for(var e in t.options)delete t.options[e].location,lt(t.options[e].value);else g(t)&&H(t.style)||(E(t)||b(t))&&A(t.style)?delete t.style.location:_(t)&&lt(t.children)}))}function ft(t,e){void 0===e&&(e={}),e=f({shouldParseSkeletons:!0,requiresOtherClause:!0},e);var r=new at(t,e).parse();if(r.err){var n=SyntaxError(c[r.err.kind]);throw n.location=r.err.location,n.originalMessage=r.err.message,n}return(null==e?void 0:e.captureLocation)||lt(r.val),r.val}function pt(t,e){var r=e&&e.cache?e.cache:vt,n=e&&e.serializer?e.serializer:bt;return(e&&e.strategy?e.strategy:Et)(t,{cache:r,serializer:n})}function dt(t,e,r,n){var i,o=null==(i=n)||"number"==typeof i||"boolean"==typeof i?n:r(n),s=e.get(o);return void 0===s&&(s=t.call(this,n),e.set(o,s)),s}function yt(t,e,r){var n=Array.prototype.slice.call(arguments,3),i=r(n),o=e.get(i);return void 0===o&&(o=t.apply(this,n),e.set(i,o)),o}function gt(t,e,r,n,i){return r.bind(e,t,n,i)}function Et(t,e){return gt(t,this,1===t.length?dt:yt,e.cache.create(),e.serializer)}var bt=function(){return JSON.stringify(arguments)};function mt(){this.cache=Object.create(null)}mt.prototype.get=function(t){return this.cache[t]},mt.prototype.set=function(t,e){this.cache[t]=e};var Tt,vt={create:function(){return new mt}},_t={variadic:function(t,e){return gt(t,this,yt,e.cache.create(),e.serializer)},monadic:function(t,e){return gt(t,this,dt,e.cache.create(),e.serializer)}};!function(t){t.MISSING_VALUE="MISSING_VALUE",t.INVALID_VALUE="INVALID_VALUE",t.MISSING_INTL_API="MISSING_INTL_API"}(Tt||(Tt={}));var Ht,At=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.code=r,i.originalMessage=n,i}return h(e,t),e.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},e}(Error),Bt=function(t){function e(e,r,n,i){return t.call(this,'Invalid values for "'.concat(e,'": "').concat(r,'". Options are "').concat(Object.keys(n).join('", "'),'"'),Tt.INVALID_VALUE,i)||this}return h(e,t),e}(At),wt=function(t){function e(e,r,n){return t.call(this,'Value for "'.concat(e,'" must be of type ').concat(r),Tt.INVALID_VALUE,n)||this}return h(e,t),e}(At),St=function(t){function e(e,r){return t.call(this,'The intl string context variable "'.concat(e,'" was not provided to the string "').concat(r,'"'),Tt.MISSING_VALUE,r)||this}return h(e,t),e}(At);function Lt(t){return"function"==typeof t}function Pt(t,e,r,n,i,o,s){if(1===t.length&&d(t[0]))return[{type:Ht.literal,value:t[0].value}];for(var a=[],h=0,c=t;h<c.length;h++){var u=c[h];if(d(u))a.push({type:Ht.literal,value:u.value});else if(v(u))"number"==typeof o&&a.push({type:Ht.literal,value:r.getNumberFormat(e).format(o)});else{var l=u.value;if(!i||!(l in i))throw new St(l,s);var f=i[l];if(y(u))f&&"string"!=typeof f&&"number"!=typeof f||(f="string"==typeof f||"number"==typeof f?String(f):""),a.push({type:"string"==typeof f?Ht.literal:Ht.object,value:f});else if(E(u)){var p="string"==typeof u.style?n.date[u.style]:A(u.style)?u.style.parsedOptions:void 0;a.push({type:Ht.literal,value:r.getDateTimeFormat(e,p).format(f)})}else if(b(u))p="string"==typeof u.style?n.time[u.style]:A(u.style)?u.style.parsedOptions:n.time.medium,a.push({type:Ht.literal,value:r.getDateTimeFormat(e,p).format(f)});else if(g(u))(p="string"==typeof u.style?n.number[u.style]:H(u.style)?u.style.parsedOptions:void 0)&&p.scale&&(f*=p.scale||1),a.push({type:Ht.literal,value:r.getNumberFormat(e,p).format(f)});else{if(_(u)){var B=u.children,w=u.value,S=i[w];if(!Lt(S))throw new wt(w,"function",s);var L=S(Pt(B,e,r,n,i,o).map((function(t){return t.value})));Array.isArray(L)||(L=[L]),a.push.apply(a,L.map((function(t){return{type:"string"==typeof t?Ht.literal:Ht.object,value:t}})))}if(m(u)){if(!(P=u.options[f]||u.options.other))throw new Bt(u.value,f,Object.keys(u.options),s);a.push.apply(a,Pt(P.value,e,r,n,i))}else if(T(u)){var P;if(!(P=u.options["=".concat(f)])){if(!Intl.PluralRules)throw new At('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',Tt.MISSING_INTL_API,s);var I=r.getPluralRules(e,{type:u.pluralType}).select(f-(u.offset||0));P=u.options[I]||u.options.other}if(!P)throw new Bt(u.value,f,Object.keys(u.options),s);a.push.apply(a,Pt(P.value,e,r,n,i,f-(u.offset||0)))}}}}return(O=a).length<2?O:O.reduce((function(t,e){var r=t[t.length-1];return r&&r.type===Ht.literal&&e.type===Ht.literal?r.value+=e.value:t.push(e),t}),[]);var O}function It(t){return{create:function(){return{get:function(e){return t[e]},set:function(e,r){t[e]=r}}}}}!function(t){t[t.literal=0]="literal",t[t.object=1]="object"}(Ht||(Ht={}));var Ot=function(){function t(e,r,n,i){var o,s,a,h=this;if(void 0===r&&(r=t.defaultLocale),this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(t){var e=h.formatToParts(t);if(1===e.length)return e[0].value;var r=e.reduce((function(t,e){return t.length&&e.type===Ht.literal&&"string"==typeof t[t.length-1]?t[t.length-1]+=e.value:t.push(e.value),t}),[]);return r.length<=1?r[0]||"":r},this.formatToParts=function(t){return Pt(h.ast,h.locales,h.formatters,h.formats,t,void 0,h.message)},this.resolvedOptions=function(){var t;return{locale:(null===(t=h.resolvedLocale)||void 0===t?void 0:t.toString())||Intl.NumberFormat.supportedLocalesOf(h.locales)[0]}},this.getAst=function(){return h.ast},this.locales=r,this.resolvedLocale=t.resolveLocale(r),"string"==typeof e){if(this.message=e,!t.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");var c=i||{},u=(c.formatters,function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]])}return r}(c,["formatters"]));this.ast=t.__parse(e,f(f({},u),{locale:this.resolvedLocale}))}else this.ast=e;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=(s=t.formats,(a=n)?Object.keys(s).reduce((function(t,e){var r,n;return t[e]=(r=s[e],(n=a[e])?f(f(f({},r||{}),n||{}),Object.keys(r).reduce((function(t,e){return t[e]=f(f({},r[e]),n[e]||{}),t}),{})):r),t}),f({},s)):s),this.formatters=i&&i.formatters||(void 0===(o=this.formatterCache)&&(o={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:pt((function(){for(var t,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return new((t=Intl.NumberFormat).bind.apply(t,p([void 0],e,!1)))}),{cache:It(o.number),strategy:_t.variadic}),getDateTimeFormat:pt((function(){for(var t,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return new((t=Intl.DateTimeFormat).bind.apply(t,p([void 0],e,!1)))}),{cache:It(o.dateTime),strategy:_t.variadic}),getPluralRules:pt((function(){for(var t,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return new((t=Intl.PluralRules).bind.apply(t,p([void 0],e,!1)))}),{cache:It(o.pluralRules),strategy:_t.variadic})})}return Object.defineProperty(t,"defaultLocale",{get:function(){return t.memoizedDefaultLocale||(t.memoizedDefaultLocale=(new Intl.NumberFormat).resolvedOptions().locale),t.memoizedDefaultLocale},enumerable:!1,configurable:!0}),t.memoizedDefaultLocale=null,t.resolveLocale=function(t){if(void 0!==Intl.Locale){var e=Intl.NumberFormat.supportedLocalesOf(t);return e.length>0?new Intl.Locale(e[0]):new Intl.Locale("string"==typeof t?t:t[0])}},t.__parse=ft,t.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"}}},t}();const Ct=Ot;class Nt{render(t,e,r){const n=(e||"").split("_")[0];let i;try{i=new Ct(t,n,void 0,{ignoreTag:!0})}catch(e){i=new Ct(t,void 0,void 0,{ignoreTag:!0})}return i.format(r)}}var Rt=r(503),Mt=r.n(Rt);function Ut(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e._key?e._key:e._context?`${t}::${e._context}`:`${t}`}function Dt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e._key)return e._key;let r="";return e._context&&(r=e._context,r=r.replace(/,/g,":")),Mt()(`5:${t}:${r}`)}function Gt(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function Ft(t){return"[object String]"===Object.prototype.toString.call(t)}function xt(t){const e=t.split("-");let r;return r=1===e.length?t:[e[0],e[1].toUpperCase()].join("_"),r}function kt(t){return new Promise((e=>{setTimeout((()=>{e()}),t)}))}const jt="FETCHING_TRANSLATIONS",Vt="TRANSLATIONS_FETCHED",Xt="TRANSLATIONS_FETCH_FAILED",Kt="LOCALE_CHANGED",$t="FETCHING_LOCALES",Yt="LOCALES_FETCHED",zt="LOCALES_FETCH_FAILED",Zt={};function Wt(t,e){Zt[t]=Zt[t]||[],Zt[t].push(e)}function qt(t,e){const r=Zt[t]||[],n=r.indexOf(e);-1!==n&&r.splice(n,1)}function Jt(t,e,r){(Zt[t]||[]).forEach((t=>{t(e,r)}))}const Qt=["zero","one","two","few","many","other"];function te(t){const e=t.indexOf("{");if(-1===e)return[null,null];let r=t.substring(0,e).trim();if("="===r[0]){if(r=r.substring(1),Number.isNaN(parseInt(r,10))||parseInt(r,10)!==parseFloat(r))return[null,null];if(r=parseInt(r,10),r=Qt[r],void 0===r)return[null,null]}else if(-1===Qt.indexOf(r))return[null,null];return[r,t.substring(e)]}function ee(t){let[e,r]=[0,!1],n=0;for(;n<t.length;){const i=t[n];if("'"===i){const e=t[n+1];"'"===e?n+=1:r?r=!1:"{"!==e&&"}"!==e||(r=!0)}else if("{"===i)r||(e+=1);else if("}"===i&&(r||(e-=1),0===e))return[t.substring(1,n),t.substring(n+1).trim()];n+=1}return[null,null]}function re(t){const e=[null,{other:t}];let[r,n]=function(t){if(!(t.length>1&&"{"===t[0]&&"}"===t[t.length-1]))return[null,null];const e=t.indexOf(",");if(-1===e)return[null,null];const r=t.indexOf(",",e+1);if(-1===r)return[null,null];const n=t.substring(1,e).trim(),i=t.substring(e+1,r).trim();return/^[\w_]+$/.test(n)&&"plural"===i?[n,t.substring(r+1,t.length-1).trim()]:[null,null]}(t);if(null==r)return e;const i={};let o,s;if([o,n]=te(n),null==o)return e;if([s,n]=ee(n.trim()),null==s)return e;for(i[o]=s;n.trim();){if([o,n]=te(n.trim()),null==o)return e;if([s,n]=ee(n.trim()),null==s)return e;i[o]=s}return(1!==Object.keys(i).length||"other"in i)&&"one"in i&&"other"in i?[r,i]:e}function ne(t){const e=[`{${arguments.length>1&&void 0!==arguments[1]?arguments[1]:"???"}, plural,`];for(const r of Qt)if(r in t){const n=t[r];e.push(` ${r} {${n}}`)}return e.push("}"),e.join("")}function ie(t){const e=re(t)[1];return Object.keys(e).length>1}class oe{constructor(){this.cdsHost="https://cds.svc.transifex.net",this.token="",this.secret="",this.filterTags="",this.filterStatus="",this.fetchTimeout=0,this.fetchInterval=250,this.cache=new i,this.missingPolicy=new s,this.errorPolicy=new o,this.stringRenderer=new Nt,this.currentLocale="",this.locales=[],this.languages=[],this.childInstances=[]}init(t){const e=this;["cdsHost","token","secret","cache","filterTags","filterStatus","fetchTimeout","fetchInterval","missingPolicy","errorPolicy","stringRenderer","currentLocale"].forEach((r=>{void 0!==t[r]&&(e[r]=t[r])})),this.fetchedTags={}}translate(t,e){return this.translateLocale(this.currentLocale,t,e)}translateLocale(t,e,r){try{let n=this.cache.get(Ut(e,r),t);n||(n=this.cache.get(Dt(e,r),t)),n&&n.startsWith("{???")&&ie(e)&&(n=`{${e.substring(1,e.indexOf(",")).trim()}${n.substring(4)}`);let i=!1;if(n||(i=!0,n=e),r&&r._escapeVars){const e={};Object.keys(r).forEach((t=>{const n=r[t];e[t]=Ft(n)?Gt(n):n})),n=this.stringRenderer.render(n,t,e)}else n=this.stringRenderer.render(n,t,r);return i&&t&&(n=this.missingPolicy.handle(n,t,r)),Ft(n)||(n=`${n}`),n}catch(n){return this.errorPolicy.handle(n,`${e}`,t,r)}}async fetchTranslations(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=r.filterTags||this.filterTags;if(!r.refresh&&!this.cache.isStale(t)&&(!n&&this.cache.hasTranslations(t)||n&&-1!==(this.fetchedTags[t]||[]).indexOf(n)))return;n&&(t in this.fetchedTags||(this.fetchedTags[t]=[]),-1===this.fetchedTags[t].indexOf(n)&&this.fetchedTags[t].push(n));const i=e=>(Jt(Xt,{localeCode:t,filterTags:n},this),e);try{let r;Jt(jt,{localeCode:t,filterTags:n},this);let o=202;const s=Date.now();for(;202===o;){let a=`${this.cdsHost}/content/${t}`;const h=[];if(n&&h.push(`filter[tags]=${n}`),this.filterStatus&&h.push(`filter[status]=${this.filterStatus}`),h.length&&(a=`${a}?${h.join("&")}`),r=await e()(a,{method:"GET",headers:{Authorization:`Bearer ${this.token}`,"Accept-version":"v2","X-NATIVE-SDK":"txjs/browser/7.1.3"},signal:this.fetchTimeout>0?AbortSignal.timeout(this.fetchTimeout):void 0}),!r.ok)throw await this._fetchError(r);if(o=r.status,this.fetchTimeout>0&&Date.now()-s>=this.fetchTimeout)throw i(new Error("Fetch translations timeout"));202===o&&this.fetchInterval>0&&await kt(this.fetchInterval)}const a=await r.json();if(!a||!a.data)throw i(new Error("Could not fetch translations"));{const e={};Object.keys(a.data).forEach((t=>{a.data[t].string&&(e[t]=a.data[t].string)})),this.cache.update(t,e),Jt(Vt,{localeCode:t,filterTags:n},this)}}catch(t){throw i(t)}}async invalidateCDS(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.token)throw new Error("token is not defined");if(!this.secret)throw new Error("secret is not defined");const r=t.purge?"purge":"invalidate",n=await e()(`${this.cdsHost}/${r}`,{method:"POST",headers:{Authorization:`Bearer ${this.token}:${this.secret}`,"Accept-version":"v2","Content-Type":"application/json;charset=utf-8","X-NATIVE-SDK":"txjs/browser/7.1.3"}});if(!n.ok)throw await this._fetchError(n);return await n.json()}async pushSource(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.token)throw new Error("token is not defined");if(!this.secret)throw new Error("secret is not defined");const n={Authorization:`Bearer ${this.token}:${this.secret}`,"Accept-version":"v2","Content-Type":"application/json;charset=utf-8","X-NATIVE-SDK":"txjs/browser/7.1.3"},i=await e()(`${this.cdsHost}/content`,{method:"POST",headers:n,body:JSON.stringify({data:t,meta:{purge:!!r.purge,override_tags:!!r.overrideTags,override_occurrences:!!r.overrideOccurrences}})});if(!i.ok)throw await this._fetchError(i);const o=await i.json(),s=`${this.cdsHost}${o.data.links.job}`;if(r.noWait)return{jobUrl:s};let a={status:""};do{await kt(1500);const t=await e()(s,{method:"GET",headers:n});if(!t.ok)throw await this._fetchError(t);const r=await t.json(),{data:i}=r;a={...i.details||{},errors:i.errors||[],status:i.status}}while("pending"===a.status||"processing"===a.status);return{jobUrl:s,...a}}async getLocales(){if(!(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).refresh&&this.locales.length>0)return[...this.locales];if(!this.token)return[];const t=t=>(Jt(zt,null,this),t);try{let r;Jt($t,null,this);let n=202;const i=Date.now();for(;202===n;){if(r=await e()(`${this.cdsHost}/languages`,{method:"GET",headers:{Authorization:`Bearer ${this.token}`,"Accept-version":"v2","X-NATIVE-SDK":"txjs/browser/7.1.3"},signal:this.fetchTimeout>0?AbortSignal.timeout(this.fetchTimeout):void 0}),!r.ok)throw await this._fetchError(r);if(n=r.status,this.fetchTimeout>0&&Date.now()-i>=this.fetchTimeout)throw t(new Error("Get locales timeout"));202===n&&this.fetchInterval>0&&await kt(this.fetchInterval)}const o=await r.json();if(!o||!o.data)throw t(new Error("Could not fetch languages"));this.languages=o.data,this.locales=this.languages.map((t=>t.code)),Jt(Yt,null,this)}catch(e){throw t(e)}return[...this.locales]}getCurrentLocale(){return this.currentLocale}isCurrent(t){return t===this.currentLocale}async setCurrentLocale(t){if(this.isCurrent(t))await this._syncInstances(this.childInstances);else{if(!t)return this.currentLocale="",await this._syncInstances(this.childInstances),void Jt(Kt,this.currentLocale,this);await this.fetchTranslations(t),this.currentLocale=t,await this._syncInstances(this.childInstances),Jt(Kt,t,this)}}async getLanguages(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return await this.getLocales(t),[...this.languages]}async controllerOf(t){if(t===this)throw new Error("Cannot add self as instance");if(-1!==t.childInstances.indexOf(this))throw new Error("Cycle reference error, instance is controller of this");return this.childInstances.push(t),await this._syncInstances([t]),t}async _syncInstances(t){const e=this.getCurrentLocale();if(e)for(let r=0;r<t.length;r++)if(t[r].getCurrentLocale()!==e)try{await t[r].fetchTranslations(e)}catch(t){}t.forEach((t=>{t.getCurrentLocale()!==e&&(t.currentLocale=e,Jt(Kt,e,t))}))}async _fetchError(t){try{const e=await t.text();return new Error(`HTTP ${t.status}: ${e}`)}catch(e){return new Error(`HTTP error ${t.status}`)}}}const se={a:"ȧ",A:"Ȧ",b:"ƀ",B:"Ɓ",c:"ƈ",C:"Ƈ",d:"ḓ",D:"Ḓ",e:"ḗ",E:"Ḗ",f:"ƒ",F:"Ƒ",g:"ɠ",G:"Ɠ",h:"ħ",H:"Ħ",i:"ī",I:"Ī",j:"ĵ",J:"Ĵ",k:"ķ",K:"Ķ",l:"ŀ",L:"Ŀ",m:"ḿ",M:"Ḿ",n:"ƞ",N:"Ƞ",o:"ǿ",O:"Ǿ",p:"ƥ",P:"Ƥ",q:"ɋ",Q:"Ɋ",r:"ř",R:"Ř",s:"ş",S:"Ş",t:"ŧ",T:"Ŧ",v:"ṽ",V:"Ṽ",u:"ŭ",U:"Ŭ",w:"ẇ",W:"Ẇ",x:"ẋ",X:"Ẋ",y:"ẏ",Y:"Ẏ",z:"ẑ",Z:"Ẑ"},ae=class{handle(t,e,r){return t.split(/__txnative__/).map((t=>{let e="";for(let r=0;r<t.length;r+=1){const n=t.charAt(r);if(se[n]){const t=n.toLowerCase();e+="a"===t||"e"===t||"o"===t||"u"===t?se[n]+se[n]:se[n]}else e+=n}return e})).join("__txnative__")}},he=s,ce=o,ue=class{handle(t,e,r,n){throw t||new Error(`Error translating "${e}"`)}},le=Nt,fe=function(t){const e=new oe;return e.t=e.translate.bind(e),t&&e.init(t),e},pe=new oe,de=pe.translate.bind(pe)})(),n})()));
2
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Transifex=e():t.Transifex=e()}(this,(()=>(()=>{var t={151:t=>{var e={utf8:{stringToBytes:function(t){return e.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(e.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],r=0;r<t.length;r++)e.push(255&t.charCodeAt(r));return e},bytesToString:function(t){for(var e=[],r=0;r<t.length;r++)e.push(String.fromCharCode(t[r]));return e.join("")}}};t.exports=e},206:t=>{function e(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}t.exports=function(t){return null!=t&&(e(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&e(t.slice(0,0))}(t)||!!t._isBuffer)}},503:(t,e,r)=>{var n,i,o,s,a;n=r(939),i=r(151).utf8,o=r(206),s=r(151).bin,(a=function(t,e){t.constructor==String?t=e&&"binary"===e.encoding?s.stringToBytes(t):i.stringToBytes(t):o(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||t.constructor===Uint8Array||(t=t.toString());for(var r=n.bytesToWords(t),h=8*t.length,u=1732584193,c=-271733879,l=-1732584194,f=271733878,p=0;p<r.length;p++)r[p]=16711935&(r[p]<<8|r[p]>>>24)|4278255360&(r[p]<<24|r[p]>>>8);r[h>>>5]|=128<<h%32,r[14+(h+64>>>9<<4)]=h;var d=a._ff,y=a._gg,g=a._hh,E=a._ii;for(p=0;p<r.length;p+=16){var b=u,m=c,T=l,v=f;u=d(u,c,l,f,r[p+0],7,-680876936),f=d(f,u,c,l,r[p+1],12,-389564586),l=d(l,f,u,c,r[p+2],17,606105819),c=d(c,l,f,u,r[p+3],22,-1044525330),u=d(u,c,l,f,r[p+4],7,-176418897),f=d(f,u,c,l,r[p+5],12,1200080426),l=d(l,f,u,c,r[p+6],17,-1473231341),c=d(c,l,f,u,r[p+7],22,-45705983),u=d(u,c,l,f,r[p+8],7,1770035416),f=d(f,u,c,l,r[p+9],12,-1958414417),l=d(l,f,u,c,r[p+10],17,-42063),c=d(c,l,f,u,r[p+11],22,-1990404162),u=d(u,c,l,f,r[p+12],7,1804603682),f=d(f,u,c,l,r[p+13],12,-40341101),l=d(l,f,u,c,r[p+14],17,-1502002290),u=y(u,c=d(c,l,f,u,r[p+15],22,1236535329),l,f,r[p+1],5,-165796510),f=y(f,u,c,l,r[p+6],9,-1069501632),l=y(l,f,u,c,r[p+11],14,643717713),c=y(c,l,f,u,r[p+0],20,-373897302),u=y(u,c,l,f,r[p+5],5,-701558691),f=y(f,u,c,l,r[p+10],9,38016083),l=y(l,f,u,c,r[p+15],14,-660478335),c=y(c,l,f,u,r[p+4],20,-405537848),u=y(u,c,l,f,r[p+9],5,568446438),f=y(f,u,c,l,r[p+14],9,-1019803690),l=y(l,f,u,c,r[p+3],14,-187363961),c=y(c,l,f,u,r[p+8],20,1163531501),u=y(u,c,l,f,r[p+13],5,-1444681467),f=y(f,u,c,l,r[p+2],9,-51403784),l=y(l,f,u,c,r[p+7],14,1735328473),u=g(u,c=y(c,l,f,u,r[p+12],20,-1926607734),l,f,r[p+5],4,-378558),f=g(f,u,c,l,r[p+8],11,-2022574463),l=g(l,f,u,c,r[p+11],16,1839030562),c=g(c,l,f,u,r[p+14],23,-35309556),u=g(u,c,l,f,r[p+1],4,-1530992060),f=g(f,u,c,l,r[p+4],11,1272893353),l=g(l,f,u,c,r[p+7],16,-155497632),c=g(c,l,f,u,r[p+10],23,-1094730640),u=g(u,c,l,f,r[p+13],4,681279174),f=g(f,u,c,l,r[p+0],11,-358537222),l=g(l,f,u,c,r[p+3],16,-722521979),c=g(c,l,f,u,r[p+6],23,76029189),u=g(u,c,l,f,r[p+9],4,-640364487),f=g(f,u,c,l,r[p+12],11,-421815835),l=g(l,f,u,c,r[p+15],16,530742520),u=E(u,c=g(c,l,f,u,r[p+2],23,-995338651),l,f,r[p+0],6,-198630844),f=E(f,u,c,l,r[p+7],10,1126891415),l=E(l,f,u,c,r[p+14],15,-1416354905),c=E(c,l,f,u,r[p+5],21,-57434055),u=E(u,c,l,f,r[p+12],6,1700485571),f=E(f,u,c,l,r[p+3],10,-1894986606),l=E(l,f,u,c,r[p+10],15,-1051523),c=E(c,l,f,u,r[p+1],21,-2054922799),u=E(u,c,l,f,r[p+8],6,1873313359),f=E(f,u,c,l,r[p+15],10,-30611744),l=E(l,f,u,c,r[p+6],15,-1560198380),c=E(c,l,f,u,r[p+13],21,1309151649),u=E(u,c,l,f,r[p+4],6,-145523070),f=E(f,u,c,l,r[p+11],10,-1120210379),l=E(l,f,u,c,r[p+2],15,718787259),c=E(c,l,f,u,r[p+9],21,-343485551),u=u+b>>>0,c=c+m>>>0,l=l+T>>>0,f=f+v>>>0}return n.endian([u,c,l,f])})._ff=function(t,e,r,n,i,o,s){var a=t+(e&r|~e&n)+(i>>>0)+s;return(a<<o|a>>>32-o)+e},a._gg=function(t,e,r,n,i,o,s){var a=t+(e&n|r&~n)+(i>>>0)+s;return(a<<o|a>>>32-o)+e},a._hh=function(t,e,r,n,i,o,s){var a=t+(e^r^n)+(i>>>0)+s;return(a<<o|a>>>32-o)+e},a._ii=function(t,e,r,n,i,o,s){var a=t+(r^(e|~n))+(i>>>0)+s;return(a<<o|a>>>32-o)+e},a._blocksize=16,a._digestsize=16,t.exports=function(t,e){if(null==t)throw new Error("Illegal argument "+t);var r=n.wordsToBytes(a(t,e));return e&&e.asBytes?r:e&&e.asString?s.bytesToString(r):n.bytesToHex(r)}},939:t=>{var e,r;e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&r.rotl(t,8)|4278255360&r.rotl(t,24);for(var e=0;e<t.length;e++)t[e]=r.endian(t[e]);return t},randomBytes:function(t){for(var e=[];t>0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],r=0,n=0;r<t.length;r++,n+=8)e[n>>>5]|=t[r]<<24-n%32;return e},wordsToBytes:function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},bytesToHex:function(t){for(var e=[],r=0;r<t.length;r++)e.push((t[r]>>>4).toString(16)),e.push((15&t[r]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e},bytesToBase64:function(t){for(var r=[],n=0;n<t.length;n+=3)for(var i=t[n]<<16|t[n+1]<<8|t[n+2],o=0;o<4;o++)8*n+6*o<=8*t.length?r.push(e.charAt(i>>>6*(3-o)&63)):r.push("=");return r.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var r=[],n=0,i=0;n<t.length;i=++n%4)0!=i&&r.push((e.indexOf(t.charAt(n-1))&Math.pow(2,-2*i+8)-1)<<2*i|e.indexOf(t.charAt(n))>>>6-2*i);return r}},t.exports=r},945:(t,e,r)=>{var n="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==r.g&&r.g,i=function(){function t(){this.fetch=!1,this.DOMException=n.DOMException}return t.prototype=n,new t}();!function(t){!function(e){var n=void 0!==t&&t||"undefined"!=typeof self&&self||void 0!==r.g&&r.g||{},i="URLSearchParams"in n,o="Symbol"in n&&"iterator"in Symbol,s="FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch(t){return!1}}(),a="FormData"in n,h="ArrayBuffer"in n;if(h)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(t){return t&&u.indexOf(Object.prototype.toString.call(t))>-1};function l(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw new TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function f(t){return"string"!=typeof t&&(t=String(t)),t}function p(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return o&&(e[Symbol.iterator]=function(){return e}),e}function d(t){this.map={},t instanceof d?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){if(2!=t.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function y(t){if(!t._noBody)return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function g(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function E(t){var e=new FileReader,r=g(e);return e.readAsArrayBuffer(t),r}function b(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(t){var e;this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:s&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:a&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:i&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():h&&s&&(e=t)&&DataView.prototype.isPrototypeOf(e)?(this._bodyArrayBuffer=b(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):h&&(ArrayBuffer.prototype.isPrototypeOf(t)||c(t))?this._bodyArrayBuffer=b(t):this._bodyText=t=Object.prototype.toString.call(t):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):i&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},s&&(this.blob=function(){var t=y(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer)return y(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer));if(s)return this.blob().then(E);throw new Error("could not read as ArrayBuffer")},this.text=function(){var t,e,r,n,i,o=y(this);if(o)return o;if(this._bodyBlob)return t=this._bodyBlob,r=g(e=new FileReader),i=(n=/charset=([A-Za-z0-9_-]+)/.exec(t.type))?n[1]:"utf-8",e.readAsText(t,i),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a&&(this.formData=function(){return this.text().then(_)}),this.json=function(){return this.text().then(JSON.parse)},this}d.prototype.append=function(t,e){t=l(t),e=f(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},d.prototype.delete=function(t){delete this.map[l(t)]},d.prototype.get=function(t){return t=l(t),this.has(t)?this.map[t]:null},d.prototype.has=function(t){return this.map.hasOwnProperty(l(t))},d.prototype.set=function(t,e){this.map[l(t)]=f(e)},d.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},d.prototype.keys=function(){var t=[];return this.forEach((function(e,r){t.push(r)})),p(t)},d.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),p(t)},d.prototype.entries=function(){var t=[];return this.forEach((function(e,r){t.push([r,e])})),p(t)},o&&(d.prototype[Symbol.iterator]=d.prototype.entries);var T=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function v(t,e){if(!(this instanceof v))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var r,i,o=(e=e||{}).body;if(t instanceof v){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new d(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,o||null==t._bodyInit||(o=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new d(e.headers)),this.method=(i=(r=e.method||this.method||"GET").toUpperCase(),T.indexOf(i)>-1?i:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal||function(){if("AbortController"in n)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(o),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==e.cache&&"no-cache"!==e.cache)){var s=/([?&])_=[^&]*/;s.test(this.url)?this.url=this.url.replace(s,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function _(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(i))}})),e}function H(t,e){if(!(this instanceof H))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===e.statusText?"":""+e.statusText,this.headers=new d(e.headers),this.url=e.url||"",this._initBody(t)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},m.call(v.prototype),m.call(H.prototype),H.prototype.clone=function(){return new H(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},H.error=function(){var t=new H(null,{status:200,statusText:""});return t.ok=!1,t.status=0,t.type="error",t};var A=[301,302,303,307,308];H.redirect=function(t,e){if(-1===A.indexOf(e))throw new RangeError("Invalid status code");return new H(null,{status:e,headers:{location:t}})},e.DOMException=n.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function B(t,r){return new Promise((function(i,o){var a=new v(t,r);if(a.signal&&a.signal.aborted)return o(new e.DOMException("Aborted","AbortError"));var u=new XMLHttpRequest;function c(){u.abort()}if(u.onload=function(){var t,e,r={statusText:u.statusText,headers:(t=u.getAllResponseHeaders()||"",e=new d,t.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(t){return 0===t.indexOf("\n")?t.substr(1,t.length):t})).forEach((function(t){var r=t.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();try{e.append(n,i)}catch(t){console.warn("Response "+t.message)}}})),e)};0===a.url.indexOf("file://")&&(u.status<200||u.status>599)?r.status=200:r.status=u.status,r.url="responseURL"in u?u.responseURL:r.headers.get("X-Request-URL");var n="response"in u?u.response:u.responseText;setTimeout((function(){i(new H(n,r))}),0)},u.onerror=function(){setTimeout((function(){o(new TypeError("Network request failed"))}),0)},u.ontimeout=function(){setTimeout((function(){o(new TypeError("Network request timed out"))}),0)},u.onabort=function(){setTimeout((function(){o(new e.DOMException("Aborted","AbortError"))}),0)},u.open(a.method,function(t){try{return""===t&&n.location.href?n.location.href:t}catch(e){return t}}(a.url),!0),"include"===a.credentials?u.withCredentials=!0:"omit"===a.credentials&&(u.withCredentials=!1),"responseType"in u&&(s?u.responseType="blob":h&&(u.responseType="arraybuffer")),r&&"object"==typeof r.headers&&!(r.headers instanceof d||n.Headers&&r.headers instanceof n.Headers)){var p=[];Object.getOwnPropertyNames(r.headers).forEach((function(t){p.push(l(t)),u.setRequestHeader(t,f(r.headers[t]))})),a.headers.forEach((function(t,e){-1===p.indexOf(e)&&u.setRequestHeader(e,t)}))}else a.headers.forEach((function(t,e){u.setRequestHeader(e,t)}));a.signal&&(a.signal.addEventListener("abort",c),u.onreadystatechange=function(){4===u.readyState&&a.signal.removeEventListener("abort",c)}),u.send(void 0===a._bodyInit?null:a._bodyInit)}))}B.polyfill=!0,n.fetch||(n.fetch=B,n.Headers=d,n.Request=v,n.Response=H),e.Headers=d,e.Request=v,e.Response=H,e.fetch=B}({})}(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var o=n.fetch?n:i;(e=o.fetch).default=o.fetch,e.fetch=o.fetch,e.Headers=o.Headers,e.Request=o.Request,e.Response=o.Response,t.exports=e}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n](o,o.exports,r),o.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{FETCHING_LOCALES:()=>Yt,FETCHING_TRANSLATIONS:()=>Vt,LOCALES_FETCHED:()=>zt,LOCALES_FETCH_FAILED:()=>Zt,LOCALE_CHANGED:()=>$t,MessageFormatRenderer:()=>fe,PseudoTranslationPolicy:()=>he,SourceErrorPolicy:()=>ce,SourceStringPolicy:()=>ue,TRANSLATIONS_FETCHED:()=>Xt,TRANSLATIONS_FETCH_FAILED:()=>Kt,ThrowErrorPolicy:()=>le,createNativeInstance:()=>pe,escape:()=>Ft,explodePlurals:()=>ne,generateHashedKey:()=>Gt,generateKey:()=>Dt,implodePlurals:()=>ie,isPluralized:()=>oe,isString:()=>xt,normalizeLocale:()=>kt,offEvent:()=>Jt,onEvent:()=>qt,sendEvent:()=>Qt,sleep:()=>jt,t:()=>ye,tx:()=>de});var t=r(945),e=r.n(t);class i{constructor(){this.translationsByLocale={}}update(t,e){const r=this.translationsByLocale[t]||{};this.translationsByLocale[t]={...r,...e}}getTranslations(t){return this.translationsByLocale[t]||{}}hasTranslations(t){return!!this.translationsByLocale[t]}isStale(t){return!this.hasTranslations(t)}get(t,e){return this.getTranslations(e)[t]||""}}class o{handle(t,e,r,n){return e}}class s{handle(t,e,r){return t}}var a=function(t,e){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},a(t,e)};function h(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var u=function(){return u=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},u.apply(this,arguments)};function c(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i<o;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))}function l(t,e){var r=e&&e.cache?e.cache:_,n=e&&e.serializer?e.serializer:T;return(e&&e.strategy?e.strategy:y)(t,{cache:r,serializer:n})}function f(t,e,r,n){var i,o=null==(i=n)||"number"==typeof i||"boolean"==typeof i?n:r(n),s=e.get(o);return void 0===s&&(s=t.call(this,n),e.set(o,s)),s}function p(t,e,r){var n=Array.prototype.slice.call(arguments,3),i=r(n),o=e.get(i);return void 0===o&&(o=t.apply(this,n),e.set(i,o)),o}function d(t,e,r,n,i){return r.bind(e,t,n,i)}function y(t,e){return d(t,this,1===t.length?f:p,e.cache.create(),e.serializer)}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var g,E,b,m,T=function(){return JSON.stringify(arguments)},v=function(){function t(){this.cache=Object.create(null)}return t.prototype.get=function(t){return this.cache[t]},t.prototype.set=function(t,e){this.cache[t]=e},t}(),_={create:function(){return new v}},H={variadic:function(t,e){return d(t,this,p,e.cache.create(),e.serializer)},monadic:function(t,e){return d(t,this,f,e.cache.create(),e.serializer)}};function A(t){return t.type===E.literal}function B(t){return t.type===E.argument}function w(t){return t.type===E.number}function S(t){return t.type===E.date}function L(t){return t.type===E.time}function P(t){return t.type===E.select}function I(t){return t.type===E.plural}function O(t){return t.type===E.pound}function C(t){return t.type===E.tag}function N(t){return!(!t||"object"!=typeof t||t.type!==b.number)}function R(t){return!(!t||"object"!=typeof t||t.type!==b.dateTime)}!function(t){t[t.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",t[t.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",t[t.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",t[t.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",t[t.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",t[t.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",t[t.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",t[t.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",t[t.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",t[t.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",t[t.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",t[t.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",t[t.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",t[t.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",t[t.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",t[t.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",t[t.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",t[t.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",t[t.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",t[t.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",t[t.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",t[t.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",t[t.INVALID_TAG=23]="INVALID_TAG",t[t.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",t[t.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",t[t.UNCLOSED_TAG=27]="UNCLOSED_TAG"}(g||(g={})),(m=E||(E={}))[m.literal=0]="literal",m[m.argument=1]="argument",m[m.number=2]="number",m[m.date=3]="date",m[m.time=4]="time",m[m.select=5]="select",m[m.plural=6]="plural",m[m.pound=7]="pound",m[m.tag=8]="tag",function(t){t[t.number=0]="number",t[t.dateTime=1]="dateTime"}(b||(b={}));var M=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,U=/(?:[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 D(t){var e={};return t.replace(U,(function(t){var r=t.length;switch(t[0]){case"G":e.era=4===r?"long":5===r?"narrow":"short";break;case"y":e.year=2===r?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":e.month=["numeric","2-digit","short","long","narrow"][r-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":e.day=["numeric","2-digit"][r-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":e.weekday=4===r?"long":5===r?"narrow":"short";break;case"e":if(r<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");e.weekday=["short","long","narrow","short"][r-4];break;case"c":if(r<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");e.weekday=["short","long","narrow","short"][r-4];break;case"a":e.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":e.hourCycle="h12",e.hour=["numeric","2-digit"][r-1];break;case"H":e.hourCycle="h23",e.hour=["numeric","2-digit"][r-1];break;case"K":e.hourCycle="h11",e.hour=["numeric","2-digit"][r-1];break;case"k":e.hourCycle="h24",e.hour=["numeric","2-digit"][r-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":e.minute=["numeric","2-digit"][r-1];break;case"s":e.second=["numeric","2-digit"][r-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":e.timeZoneName=r<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""})),e}var G=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i,F=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,x=/^(@+)?(\+|#+)?[rs]?$/g,k=/(\*)(0+)|(#+)(0+)|(0+)/g,j=/^(0+)$/;function V(t){var e={};return"r"===t[t.length-1]?e.roundingPriority="morePrecision":"s"===t[t.length-1]&&(e.roundingPriority="lessPrecision"),t.replace(x,(function(t,r,n){return"string"!=typeof n?(e.minimumSignificantDigits=r.length,e.maximumSignificantDigits=r.length):"+"===n?e.minimumSignificantDigits=r.length:"#"===r[0]?e.maximumSignificantDigits=r.length:(e.minimumSignificantDigits=r.length,e.maximumSignificantDigits=r.length+("string"==typeof n?n.length:0)),""})),e}function X(t){switch(t){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 K(t){var e;if("E"===t[0]&&"E"===t[1]?(e={notation:"engineering"},t=t.slice(2)):"E"===t[0]&&(e={notation:"scientific"},t=t.slice(1)),e){var r=t.slice(0,2);if("+!"===r?(e.signDisplay="always",t=t.slice(2)):"+?"===r&&(e.signDisplay="exceptZero",t=t.slice(2)),!j.test(t))throw new Error("Malformed concise eng/scientific notation");e.minimumIntegerDigits=t.length}return e}function $(t){return X(t)||{}}function Y(t){for(var e={},r=0,n=t;r<n.length;r++){var i=n[r];switch(i.stem){case"percent":case"%":e.style="percent";continue;case"%x100":e.style="percent",e.scale=100;continue;case"currency":e.style="currency",e.currency=i.options[0];continue;case"group-off":case",_":e.useGrouping=!1;continue;case"precision-integer":case".":e.maximumFractionDigits=0;continue;case"measure-unit":case"unit":e.style="unit",e.unit=i.options[0].replace(/^(.*?)-/,"");continue;case"compact-short":case"K":e.notation="compact",e.compactDisplay="short";continue;case"compact-long":case"KK":e.notation="compact",e.compactDisplay="long";continue;case"scientific":e=u(u(u({},e),{notation:"scientific"}),i.options.reduce((function(t,e){return u(u({},t),$(e))}),{}));continue;case"engineering":e=u(u(u({},e),{notation:"engineering"}),i.options.reduce((function(t,e){return u(u({},t),$(e))}),{}));continue;case"notation-simple":e.notation="standard";continue;case"unit-width-narrow":e.currencyDisplay="narrowSymbol",e.unitDisplay="narrow";continue;case"unit-width-short":e.currencyDisplay="code",e.unitDisplay="short";continue;case"unit-width-full-name":e.currencyDisplay="name",e.unitDisplay="long";continue;case"unit-width-iso-code":e.currencyDisplay="symbol";continue;case"scale":e.scale=parseFloat(i.options[0]);continue;case"rounding-mode-floor":e.roundingMode="floor";continue;case"rounding-mode-ceiling":e.roundingMode="ceil";continue;case"rounding-mode-down":e.roundingMode="trunc";continue;case"rounding-mode-up":e.roundingMode="expand";continue;case"rounding-mode-half-even":e.roundingMode="halfEven";continue;case"rounding-mode-half-down":e.roundingMode="halfTrunc";continue;case"rounding-mode-half-up":e.roundingMode="halfExpand";continue;case"integer-width":if(i.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(k,(function(t,r,n,i,o,s){if(r)e.minimumIntegerDigits=n.length;else{if(i&&o)throw new Error("We currently do not support maximum integer digits");if(s)throw new Error("We currently do not support exact integer digits")}return""}));continue}if(j.test(i.stem))e.minimumIntegerDigits=i.stem.length;else if(F.test(i.stem)){if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(F,(function(t,r,n,i,o,s){return"*"===n?e.minimumFractionDigits=r.length:i&&"#"===i[0]?e.maximumFractionDigits=i.length:o&&s?(e.minimumFractionDigits=o.length,e.maximumFractionDigits=o.length+s.length):(e.minimumFractionDigits=r.length,e.maximumFractionDigits=r.length),""}));var o=i.options[0];"w"===o?e=u(u({},e),{trailingZeroDisplay:"stripIfInteger"}):o&&(e=u(u({},e),V(o)))}else if(x.test(i.stem))e=u(u({},e),V(i.stem));else{var s=X(i.stem);s&&(e=u(u({},e),s));var a=K(i.stem);a&&(e=u(u({},e),a))}}return e}var z,Z={"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"],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"],"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 W(t){var e=t.hourCycle;if(void 0===e&&t.hourCycles&&t.hourCycles.length&&(e=t.hourCycles[0]),e)switch(e){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var r,n=t.language;return"root"!==n&&(r=t.maximize().region),(Z[r||""]||Z[n||""]||Z["".concat(n,"-001")]||Z["001"])[0]}var q=new RegExp("^".concat(M.source,"*")),J=new RegExp("".concat(M.source,"*$"));function Q(t,e){return{start:t,end:e}}var tt=!!String.prototype.startsWith&&"_a".startsWith("a",1),et=!!String.fromCodePoint,rt=!!Object.fromEntries,nt=!!String.prototype.codePointAt,it=!!String.prototype.trimStart,ot=!!String.prototype.trimEnd,st=Number.isSafeInteger?Number.isSafeInteger:function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t&&Math.abs(t)<=9007199254740991},at=!0;try{at="a"===(null===(z=yt("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===z?void 0:z[0])}catch(t){at=!1}var ht,ut=tt?function(t,e,r){return t.startsWith(e,r)}:function(t,e,r){return t.slice(r,r+e.length)===e},ct=et?String.fromCodePoint:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r,n="",i=t.length,o=0;i>o;){if((r=t[o++])>1114111)throw RangeError(r+" is not a valid code point");n+=r<65536?String.fromCharCode(r):String.fromCharCode(55296+((r-=65536)>>10),r%1024+56320)}return n},lt=rt?Object.fromEntries:function(t){for(var e={},r=0,n=t;r<n.length;r++){var i=n[r],o=i[0],s=i[1];e[o]=s}return e},ft=nt?function(t,e){return t.codePointAt(e)}:function(t,e){var r=t.length;if(!(e<0||e>=r)){var n,i=t.charCodeAt(e);return i<55296||i>56319||e+1===r||(n=t.charCodeAt(e+1))<56320||n>57343?i:n-56320+(i-55296<<10)+65536}},pt=it?function(t){return t.trimStart()}:function(t){return t.replace(q,"")},dt=ot?function(t){return t.trimEnd()}:function(t){return t.replace(J,"")};function yt(t,e){return new RegExp(t,e)}if(at){var gt=yt("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");ht=function(t,e){var r;return gt.lastIndex=e,null!==(r=gt.exec(t)[1])&&void 0!==r?r:""}}else ht=function(t,e){for(var r=[];;){var n=ft(t,e);if(void 0===n||Tt(n)||vt(n))break;r.push(n),e+=n>=65536?2:1}return ct.apply(void 0,r)};var Et,bt=function(){function t(t,e){void 0===e&&(e={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!e.ignoreTag,this.locale=e.locale,this.requiresOtherClause=!!e.requiresOtherClause,this.shouldParseSkeletons=!!e.shouldParseSkeletons}return t.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},t.prototype.parseMessage=function(t,e,r){for(var n=[];!this.isEOF();){var i=this.char();if(123===i){if((o=this.parseArgument(t,r)).err)return o;n.push(o.val)}else{if(125===i&&t>0)break;if(35!==i||"plural"!==e&&"selectordinal"!==e){if(60===i&&!this.ignoreTag&&47===this.peek()){if(r)break;return this.error(g.UNMATCHED_CLOSING_TAG,Q(this.clonePosition(),this.clonePosition()))}if(60===i&&!this.ignoreTag&&mt(this.peek()||0)){if((o=this.parseTag(t,e)).err)return o;n.push(o.val)}else{var o;if((o=this.parseLiteral(t,e)).err)return o;n.push(o.val)}}else{var s=this.clonePosition();this.bump(),n.push({type:E.pound,location:Q(s,this.clonePosition())})}}}return{val:n,err:null}},t.prototype.parseTag=function(t,e){var r=this.clonePosition();this.bump();var n=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:E.literal,value:"<".concat(n,"/>"),location:Q(r,this.clonePosition())},err:null};if(this.bumpIf(">")){var i=this.parseMessage(t+1,e,!0);if(i.err)return i;var o=i.val,s=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!mt(this.char()))return this.error(g.INVALID_TAG,Q(s,this.clonePosition()));var a=this.clonePosition();return n!==this.parseTagName()?this.error(g.UNMATCHED_CLOSING_TAG,Q(a,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:E.tag,value:n,children:o,location:Q(r,this.clonePosition())},err:null}:this.error(g.INVALID_TAG,Q(s,this.clonePosition())))}return this.error(g.UNCLOSED_TAG,Q(r,this.clonePosition()))}return this.error(g.INVALID_TAG,Q(r,this.clonePosition()))},t.prototype.parseTagName=function(){var t,e=this.offset();for(this.bump();!this.isEOF()&&(45===(t=this.char())||46===t||t>=48&&t<=57||95===t||t>=97&&t<=122||t>=65&&t<=90||183==t||t>=192&&t<=214||t>=216&&t<=246||t>=248&&t<=893||t>=895&&t<=8191||t>=8204&&t<=8205||t>=8255&&t<=8256||t>=8304&&t<=8591||t>=11264&&t<=12271||t>=12289&&t<=55295||t>=63744&&t<=64975||t>=65008&&t<=65533||t>=65536&&t<=983039);)this.bump();return this.message.slice(e,this.offset())},t.prototype.parseLiteral=function(t,e){for(var r=this.clonePosition(),n="";;){var i=this.tryParseQuote(e);if(i)n+=i;else{var o=this.tryParseUnquoted(t,e);if(o)n+=o;else{var s=this.tryParseLeftAngleBracket();if(!s)break;n+=s}}}var a=Q(r,this.clonePosition());return{val:{type:E.literal,value:n,location:a},err:null}},t.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(mt(t=this.peek()||0)||47===t)?null:(this.bump(),"<");var t},t.prototype.tryParseQuote=function(t){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===t||"selectordinal"===t)break;return null;default:return null}this.bump();var e=[this.char()];for(this.bump();!this.isEOF();){var r=this.char();if(39===r){if(39!==this.peek()){this.bump();break}e.push(39),this.bump()}else e.push(r);this.bump()}return ct.apply(void 0,e)},t.prototype.tryParseUnquoted=function(t,e){if(this.isEOF())return null;var r=this.char();return 60===r||123===r||35===r&&("plural"===e||"selectordinal"===e)||125===r&&t>0?null:(this.bump(),ct(r))},t.prototype.parseArgument=function(t,e){var r=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE,Q(r,this.clonePosition()));if(125===this.char())return this.bump(),this.error(g.EMPTY_ARGUMENT,Q(r,this.clonePosition()));var n=this.parseIdentifierIfPossible().value;if(!n)return this.error(g.MALFORMED_ARGUMENT,Q(r,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE,Q(r,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:E.argument,value:n,location:Q(r,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE,Q(r,this.clonePosition())):this.parseArgumentOptions(t,e,n,r);default:return this.error(g.MALFORMED_ARGUMENT,Q(r,this.clonePosition()))}},t.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),e=this.offset(),r=ht(this.message,e),n=e+r.length;return this.bumpTo(n),{value:r,location:Q(t,this.clonePosition())}},t.prototype.parseArgumentOptions=function(t,e,r,n){var i,o=this.clonePosition(),s=this.parseIdentifierIfPossible().value,a=this.clonePosition();switch(s){case"":return this.error(g.EXPECT_ARGUMENT_TYPE,Q(o,a));case"number":case"date":case"time":this.bumpSpace();var h=null;if(this.bumpIf(",")){this.bumpSpace();var c=this.clonePosition();if((v=this.parseSimpleArgStyleIfPossible()).err)return v;if(0===(d=dt(v.val)).length)return this.error(g.EXPECT_ARGUMENT_STYLE,Q(this.clonePosition(),this.clonePosition()));h={style:d,styleLocation:Q(c,this.clonePosition())}}if((_=this.tryParseArgumentClose(n)).err)return _;var l=Q(n,this.clonePosition());if(h&&ut(null==h?void 0:h.style,"::",0)){var f=pt(h.style.slice(2));if("number"===s)return(v=this.parseNumberSkeletonFromString(f,h.styleLocation)).err?v:{val:{type:E.number,value:r,location:l,style:v.val},err:null};if(0===f.length)return this.error(g.EXPECT_DATE_TIME_SKELETON,l);var p=f;this.locale&&(p=function(t,e){for(var r="",n=0;n<t.length;n++){var i=t.charAt(n);if("j"===i){for(var o=0;n+1<t.length&&t.charAt(n+1)===i;)o++,n++;var s=1+(1&o),a=o<2?1:3+(o>>1),h=W(e);for("H"!=h&&"k"!=h||(a=0);a-- >0;)r+="a";for(;s-- >0;)r=h+r}else r+="J"===i?"H":i}return r}(f,this.locale));var d={type:b.dateTime,pattern:p,location:h.styleLocation,parsedOptions:this.shouldParseSkeletons?D(p):{}};return{val:{type:"date"===s?E.date:E.time,value:r,location:l,style:d},err:null}}return{val:{type:"number"===s?E.number:"date"===s?E.date:E.time,value:r,location:l,style:null!==(i=null==h?void 0:h.style)&&void 0!==i?i:null},err:null};case"plural":case"selectordinal":case"select":var y=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(g.EXPECT_SELECT_ARGUMENT_OPTIONS,Q(y,u({},y)));this.bumpSpace();var m=this.parseIdentifierIfPossible(),T=0;if("select"!==s&&"offset"===m.value){if(!this.bumpIf(":"))return this.error(g.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Q(this.clonePosition(),this.clonePosition()));var v;if(this.bumpSpace(),(v=this.tryParseDecimalInteger(g.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,g.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return v;this.bumpSpace(),m=this.parseIdentifierIfPossible(),T=v.val}var _,H=this.tryParsePluralOrSelectOptions(t,s,e,m);if(H.err)return H;if((_=this.tryParseArgumentClose(n)).err)return _;var A=Q(n,this.clonePosition());return"select"===s?{val:{type:E.select,value:r,options:lt(H.val),location:A},err:null}:{val:{type:E.plural,value:r,options:lt(H.val),offset:T,pluralType:"plural"===s?"cardinal":"ordinal",location:A},err:null};default:return this.error(g.INVALID_ARGUMENT_TYPE,Q(o,a))}},t.prototype.tryParseArgumentClose=function(t){return this.isEOF()||125!==this.char()?this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE,Q(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},t.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,e=this.clonePosition();!this.isEOF();)switch(this.char()){case 39:this.bump();var r=this.clonePosition();if(!this.bumpUntil("'"))return this.error(g.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Q(r,this.clonePosition()));this.bump();break;case 123:t+=1,this.bump();break;case 125:if(!(t>0))return{val:this.message.slice(e.offset,this.offset()),err:null};t-=1;break;default:this.bump()}return{val:this.message.slice(e.offset,this.offset()),err:null}},t.prototype.parseNumberSkeletonFromString=function(t,e){var r=[];try{r=function(t){if(0===t.length)throw new Error("Number skeleton cannot be empty");for(var e=[],r=0,n=t.split(G).filter((function(t){return t.length>0}));r<n.length;r++){var i=n[r].split("/");if(0===i.length)throw new Error("Invalid number skeleton");for(var o=i[0],s=i.slice(1),a=0,h=s;a<h.length;a++)if(0===h[a].length)throw new Error("Invalid number skeleton");e.push({stem:o,options:s})}return e}(t)}catch(t){return this.error(g.INVALID_NUMBER_SKELETON,e)}return{val:{type:b.number,tokens:r,location:e,parsedOptions:this.shouldParseSkeletons?Y(r):{}},err:null}},t.prototype.tryParsePluralOrSelectOptions=function(t,e,r,n){for(var i,o=!1,s=[],a=new Set,h=n.value,u=n.location;;){if(0===h.length){var c=this.clonePosition();if("select"===e||!this.bumpIf("="))break;var l=this.tryParseDecimalInteger(g.EXPECT_PLURAL_ARGUMENT_SELECTOR,g.INVALID_PLURAL_ARGUMENT_SELECTOR);if(l.err)return l;u=Q(c,this.clonePosition()),h=this.message.slice(c.offset,this.offset())}if(a.has(h))return this.error("select"===e?g.DUPLICATE_SELECT_ARGUMENT_SELECTOR:g.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,u);"other"===h&&(o=!0),this.bumpSpace();var f=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===e?g.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:g.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,Q(this.clonePosition(),this.clonePosition()));var p=this.parseMessage(t+1,e,r);if(p.err)return p;var d=this.tryParseArgumentClose(f);if(d.err)return d;s.push([h,{value:p.val,location:Q(f,this.clonePosition())}]),a.add(h),this.bumpSpace(),h=(i=this.parseIdentifierIfPossible()).value,u=i.location}return 0===s.length?this.error("select"===e?g.EXPECT_SELECT_ARGUMENT_SELECTOR:g.EXPECT_PLURAL_ARGUMENT_SELECTOR,Q(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!o?this.error(g.MISSING_OTHER_CLAUSE,Q(this.clonePosition(),this.clonePosition())):{val:s,err:null}},t.prototype.tryParseDecimalInteger=function(t,e){var r=1,n=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(r=-1);for(var i=!1,o=0;!this.isEOF();){var s=this.char();if(!(s>=48&&s<=57))break;i=!0,o=10*o+(s-48),this.bump()}var a=Q(n,this.clonePosition());return i?st(o*=r)?{val:o,err:null}:this.error(e,a):this.error(t,a)},t.prototype.offset=function(){return this.position.offset},t.prototype.isEOF=function(){return this.offset()===this.message.length},t.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},t.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var e=ft(this.message,t);if(void 0===e)throw Error("Offset ".concat(t," is at invalid UTF-16 code unit boundary"));return e},t.prototype.error=function(t,e){return{val:null,err:{kind:t,message:this.message,location:e}}},t.prototype.bump=function(){if(!this.isEOF()){var t=this.char();10===t?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=t<65536?1:2)}},t.prototype.bumpIf=function(t){if(ut(this.message,t,this.offset())){for(var e=0;e<t.length;e++)this.bump();return!0}return!1},t.prototype.bumpUntil=function(t){var e=this.offset(),r=this.message.indexOf(t,e);return r>=0?(this.bumpTo(r),!0):(this.bumpTo(this.message.length),!1)},t.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".concat(t," must be greater than or equal to the current offset ").concat(this.offset()));for(t=Math.min(t,this.message.length);;){var e=this.offset();if(e===t)break;if(e>t)throw Error("targetOffset ".concat(t," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},t.prototype.bumpSpace=function(){for(;!this.isEOF()&&Tt(this.char());)this.bump()},t.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),e=this.offset(),r=this.message.charCodeAt(e+(t>=65536?2:1));return null!=r?r:null},t}();function mt(t){return t>=97&&t<=122||t>=65&&t<=90}function Tt(t){return t>=9&&t<=13||32===t||133===t||t>=8206&&t<=8207||8232===t||8233===t}function vt(t){return t>=33&&t<=35||36===t||t>=37&&t<=39||40===t||41===t||42===t||43===t||44===t||45===t||t>=46&&t<=47||t>=58&&t<=59||t>=60&&t<=62||t>=63&&t<=64||91===t||92===t||93===t||94===t||96===t||123===t||124===t||125===t||126===t||161===t||t>=162&&t<=165||166===t||167===t||169===t||171===t||172===t||174===t||176===t||177===t||182===t||187===t||191===t||215===t||247===t||t>=8208&&t<=8213||t>=8214&&t<=8215||8216===t||8217===t||8218===t||t>=8219&&t<=8220||8221===t||8222===t||8223===t||t>=8224&&t<=8231||t>=8240&&t<=8248||8249===t||8250===t||t>=8251&&t<=8254||t>=8257&&t<=8259||8260===t||8261===t||8262===t||t>=8263&&t<=8273||8274===t||8275===t||t>=8277&&t<=8286||t>=8592&&t<=8596||t>=8597&&t<=8601||t>=8602&&t<=8603||t>=8604&&t<=8607||8608===t||t>=8609&&t<=8610||8611===t||t>=8612&&t<=8613||8614===t||t>=8615&&t<=8621||8622===t||t>=8623&&t<=8653||t>=8654&&t<=8655||t>=8656&&t<=8657||8658===t||8659===t||8660===t||t>=8661&&t<=8691||t>=8692&&t<=8959||t>=8960&&t<=8967||8968===t||8969===t||8970===t||8971===t||t>=8972&&t<=8991||t>=8992&&t<=8993||t>=8994&&t<=9e3||9001===t||9002===t||t>=9003&&t<=9083||9084===t||t>=9085&&t<=9114||t>=9115&&t<=9139||t>=9140&&t<=9179||t>=9180&&t<=9185||t>=9186&&t<=9254||t>=9255&&t<=9279||t>=9280&&t<=9290||t>=9291&&t<=9311||t>=9472&&t<=9654||9655===t||t>=9656&&t<=9664||9665===t||t>=9666&&t<=9719||t>=9720&&t<=9727||t>=9728&&t<=9838||9839===t||t>=9840&&t<=10087||10088===t||10089===t||10090===t||10091===t||10092===t||10093===t||10094===t||10095===t||10096===t||10097===t||10098===t||10099===t||10100===t||10101===t||t>=10132&&t<=10175||t>=10176&&t<=10180||10181===t||10182===t||t>=10183&&t<=10213||10214===t||10215===t||10216===t||10217===t||10218===t||10219===t||10220===t||10221===t||10222===t||10223===t||t>=10224&&t<=10239||t>=10240&&t<=10495||t>=10496&&t<=10626||10627===t||10628===t||10629===t||10630===t||10631===t||10632===t||10633===t||10634===t||10635===t||10636===t||10637===t||10638===t||10639===t||10640===t||10641===t||10642===t||10643===t||10644===t||10645===t||10646===t||10647===t||10648===t||t>=10649&&t<=10711||10712===t||10713===t||10714===t||10715===t||t>=10716&&t<=10747||10748===t||10749===t||t>=10750&&t<=11007||t>=11008&&t<=11055||t>=11056&&t<=11076||t>=11077&&t<=11078||t>=11079&&t<=11084||t>=11085&&t<=11123||t>=11124&&t<=11125||t>=11126&&t<=11157||11158===t||t>=11159&&t<=11263||t>=11776&&t<=11777||11778===t||11779===t||11780===t||11781===t||t>=11782&&t<=11784||11785===t||11786===t||11787===t||11788===t||11789===t||t>=11790&&t<=11798||11799===t||t>=11800&&t<=11801||11802===t||11803===t||11804===t||11805===t||t>=11806&&t<=11807||11808===t||11809===t||11810===t||11811===t||11812===t||11813===t||11814===t||11815===t||11816===t||11817===t||t>=11818&&t<=11822||11823===t||t>=11824&&t<=11833||t>=11834&&t<=11835||t>=11836&&t<=11839||11840===t||11841===t||11842===t||t>=11843&&t<=11855||t>=11856&&t<=11857||11858===t||t>=11859&&t<=11903||t>=12289&&t<=12291||12296===t||12297===t||12298===t||12299===t||12300===t||12301===t||12302===t||12303===t||12304===t||12305===t||t>=12306&&t<=12307||12308===t||12309===t||12310===t||12311===t||12312===t||12313===t||12314===t||12315===t||12316===t||12317===t||t>=12318&&t<=12319||12320===t||12336===t||64830===t||64831===t||t>=65093&&t<=65094}function _t(t){t.forEach((function(t){if(delete t.location,P(t)||I(t))for(var e in t.options)delete t.options[e].location,_t(t.options[e].value);else w(t)&&N(t.style)||(S(t)||L(t))&&R(t.style)?delete t.style.location:C(t)&&_t(t.children)}))}function Ht(t,e){void 0===e&&(e={}),e=u({shouldParseSkeletons:!0,requiresOtherClause:!0},e);var r=new bt(t,e).parse();if(r.err){var n=SyntaxError(g[r.err.kind]);throw n.location=r.err.location,n.originalMessage=r.err.message,n}return(null==e?void 0:e.captureLocation)||_t(r.val),r.val}!function(t){t.MISSING_VALUE="MISSING_VALUE",t.INVALID_VALUE="INVALID_VALUE",t.MISSING_INTL_API="MISSING_INTL_API"}(Et||(Et={}));var At,Bt=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.code=r,i.originalMessage=n,i}return h(e,t),e.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},e}(Error),wt=function(t){function e(e,r,n,i){return t.call(this,'Invalid values for "'.concat(e,'": "').concat(r,'". Options are "').concat(Object.keys(n).join('", "'),'"'),Et.INVALID_VALUE,i)||this}return h(e,t),e}(Bt),St=function(t){function e(e,r,n){return t.call(this,'Value for "'.concat(e,'" must be of type ').concat(r),Et.INVALID_VALUE,n)||this}return h(e,t),e}(Bt),Lt=function(t){function e(e,r){return t.call(this,'The intl string context variable "'.concat(e,'" was not provided to the string "').concat(r,'"'),Et.MISSING_VALUE,r)||this}return h(e,t),e}(Bt);function Pt(t){return"function"==typeof t}function It(t,e,r,n,i,o,s){if(1===t.length&&A(t[0]))return[{type:At.literal,value:t[0].value}];for(var a=[],h=0,u=t;h<u.length;h++){var c=u[h];if(A(c))a.push({type:At.literal,value:c.value});else if(O(c))"number"==typeof o&&a.push({type:At.literal,value:r.getNumberFormat(e).format(o)});else{var l=c.value;if(!i||!(l in i))throw new Lt(l,s);var f=i[l];if(B(c))f&&"string"!=typeof f&&"number"!=typeof f||(f="string"==typeof f||"number"==typeof f?String(f):""),a.push({type:"string"==typeof f?At.literal:At.object,value:f});else if(S(c)){var p="string"==typeof c.style?n.date[c.style]:R(c.style)?c.style.parsedOptions:void 0;a.push({type:At.literal,value:r.getDateTimeFormat(e,p).format(f)})}else if(L(c))p="string"==typeof c.style?n.time[c.style]:R(c.style)?c.style.parsedOptions:n.time.medium,a.push({type:At.literal,value:r.getDateTimeFormat(e,p).format(f)});else if(w(c))(p="string"==typeof c.style?n.number[c.style]:N(c.style)?c.style.parsedOptions:void 0)&&p.scale&&(f*=p.scale||1),a.push({type:At.literal,value:r.getNumberFormat(e,p).format(f)});else{if(C(c)){var d=c.children,y=c.value,g=i[y];if(!Pt(g))throw new St(y,"function",s);var E=g(It(d,e,r,n,i,o).map((function(t){return t.value})));Array.isArray(E)||(E=[E]),a.push.apply(a,E.map((function(t){return{type:"string"==typeof t?At.literal:At.object,value:t}})))}if(P(c)){if(!(b=c.options[f]||c.options.other))throw new wt(c.value,f,Object.keys(c.options),s);a.push.apply(a,It(b.value,e,r,n,i))}else if(I(c)){var b;if(!(b=c.options["=".concat(f)])){if(!Intl.PluralRules)throw new Bt('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',Et.MISSING_INTL_API,s);var m=r.getPluralRules(e,{type:c.pluralType}).select(f-(c.offset||0));b=c.options[m]||c.options.other}if(!b)throw new wt(c.value,f,Object.keys(c.options),s);a.push.apply(a,It(b.value,e,r,n,i,f-(c.offset||0)))}}}}return(T=a).length<2?T:T.reduce((function(t,e){var r=t[t.length-1];return r&&r.type===At.literal&&e.type===At.literal?r.value+=e.value:t.push(e),t}),[]);var T}function Ot(t){return{create:function(){return{get:function(e){return t[e]},set:function(e,r){t[e]=r}}}}}!function(t){t[t.literal=0]="literal",t[t.object=1]="object"}(At||(At={}));var Ct=function(){function t(e,r,n,i){void 0===r&&(r=t.defaultLocale);var o,s,a,h=this;if(this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(t){var e=h.formatToParts(t);if(1===e.length)return e[0].value;var r=e.reduce((function(t,e){return t.length&&e.type===At.literal&&"string"==typeof t[t.length-1]?t[t.length-1]+=e.value:t.push(e.value),t}),[]);return r.length<=1?r[0]||"":r},this.formatToParts=function(t){return It(h.ast,h.locales,h.formatters,h.formats,t,void 0,h.message)},this.resolvedOptions=function(){var t;return{locale:(null===(t=h.resolvedLocale)||void 0===t?void 0:t.toString())||Intl.NumberFormat.supportedLocalesOf(h.locales)[0]}},this.getAst=function(){return h.ast},this.locales=r,this.resolvedLocale=t.resolveLocale(r),"string"==typeof e){if(this.message=e,!t.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");var f=i||{},p=(f.formatters,function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]])}return r}(f,["formatters"]));this.ast=t.__parse(e,u(u({},p),{locale:this.resolvedLocale}))}else this.ast=e;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=(s=t.formats,(a=n)?Object.keys(s).reduce((function(t,e){var r,n;return t[e]=(r=s[e],(n=a[e])?u(u(u({},r||{}),n||{}),Object.keys(r).reduce((function(t,e){return t[e]=u(u({},r[e]),n[e]||{}),t}),{})):r),t}),u({},s)):s),this.formatters=i&&i.formatters||(void 0===(o=this.formatterCache)&&(o={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:l((function(){for(var t,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return new((t=Intl.NumberFormat).bind.apply(t,c([void 0],e,!1)))}),{cache:Ot(o.number),strategy:H.variadic}),getDateTimeFormat:l((function(){for(var t,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return new((t=Intl.DateTimeFormat).bind.apply(t,c([void 0],e,!1)))}),{cache:Ot(o.dateTime),strategy:H.variadic}),getPluralRules:l((function(){for(var t,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return new((t=Intl.PluralRules).bind.apply(t,c([void 0],e,!1)))}),{cache:Ot(o.pluralRules),strategy:H.variadic})})}return Object.defineProperty(t,"defaultLocale",{get:function(){return t.memoizedDefaultLocale||(t.memoizedDefaultLocale=(new Intl.NumberFormat).resolvedOptions().locale),t.memoizedDefaultLocale},enumerable:!1,configurable:!0}),t.memoizedDefaultLocale=null,t.resolveLocale=function(t){if(void 0!==Intl.Locale){var e=Intl.NumberFormat.supportedLocalesOf(t);return e.length>0?new Intl.Locale(e[0]):new Intl.Locale("string"==typeof t?t:t[0])}},t.__parse=Ht,t.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"}}},t}();const Nt=Ct;class Rt{render(t,e,r){const n=(e||"").split("_")[0];let i;try{i=new Nt(t,n,void 0,{ignoreTag:!0})}catch(e){i=new Nt(t,void 0,void 0,{ignoreTag:!0})}return i.format(r)}}var Mt=r(503),Ut=r.n(Mt);function Dt(t,e={}){return e._key?e._key:e._context?`${t}::${e._context}`:`${t}`}function Gt(t,e={}){if(e._key)return e._key;let r="";return e._context&&(r=e._context,r=r.replace(/,/g,":")),Ut()(`5:${t}:${r}`)}function Ft(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function xt(t){return"[object String]"===Object.prototype.toString.call(t)}function kt(t){const e=t.split("-");let r;return r=1===e.length?t:[e[0],e[1].toUpperCase()].join("_"),r}function jt(t){return new Promise((e=>{setTimeout((()=>{e()}),t)}))}const Vt="FETCHING_TRANSLATIONS",Xt="TRANSLATIONS_FETCHED",Kt="TRANSLATIONS_FETCH_FAILED",$t="LOCALE_CHANGED",Yt="FETCHING_LOCALES",zt="LOCALES_FETCHED",Zt="LOCALES_FETCH_FAILED",Wt={};function qt(t,e){Wt[t]=Wt[t]||[],Wt[t].push(e)}function Jt(t,e){const r=Wt[t]||[],n=r.indexOf(e);-1!==n&&r.splice(n,1)}function Qt(t,e,r){(Wt[t]||[]).forEach((t=>{t(e,r)}))}const te=["zero","one","two","few","many","other"];function ee(t){const e=t.indexOf("{");if(-1===e)return[null,null];let r=t.substring(0,e).trim();if("="===r[0]){if(r=r.substring(1),Number.isNaN(parseInt(r,10))||parseInt(r,10)!==parseFloat(r))return[null,null];if(r=parseInt(r,10),r=te[r],void 0===r)return[null,null]}else if(-1===te.indexOf(r))return[null,null];return[r,t.substring(e)]}function re(t){let[e,r]=[0,!1],n=0;for(;n<t.length;){const i=t[n];if("'"===i){const e=t[n+1];"'"===e?n+=1:r?r=!1:"{"!==e&&"}"!==e||(r=!0)}else if("{"===i)r||(e+=1);else if("}"===i&&(r||(e-=1),0===e))return[t.substring(1,n),t.substring(n+1).trim()];n+=1}return[null,null]}function ne(t){const e=[null,{other:t}];let[r,n]=function(t){if(!(t.length>1&&"{"===t[0]&&"}"===t[t.length-1]))return[null,null];const e=t.indexOf(",");if(-1===e)return[null,null];const r=t.indexOf(",",e+1);if(-1===r)return[null,null];const n=t.substring(1,e).trim(),i=t.substring(e+1,r).trim();return/^[\w_]+$/.test(n)&&"plural"===i?[n,t.substring(r+1,t.length-1).trim()]:[null,null]}(t);if(null==r)return e;const i={};let o,s;if([o,n]=ee(n),null==o)return e;if([s,n]=re(n.trim()),null==s)return e;for(i[o]=s;n.trim();){if([o,n]=ee(n.trim()),null==o)return e;if([s,n]=re(n.trim()),null==s)return e;i[o]=s}return(1!==Object.keys(i).length||"other"in i)&&"one"in i&&"other"in i?[r,i]:e}function ie(t,e="???"){const r=[`{${e}, plural,`];for(const e of te)if(e in t){const n=t[e];r.push(` ${e} {${n}}`)}return r.push("}"),r.join("")}function oe(t){const e=ne(t)[1];return Object.keys(e).length>1}class se{constructor(){this.cdsHost="https://cds.svc.transifex.net",this.token="",this.secret="",this.filterTags="",this.filterStatus="",this.fetchTimeout=0,this.fetchInterval=250,this.cache=new i,this.missingPolicy=new s,this.errorPolicy=new o,this.stringRenderer=new Rt,this.currentLocale="",this.locales=[],this.languages=[],this.childInstances=[]}init(t){const e=this;["cdsHost","token","secret","cache","filterTags","filterStatus","fetchTimeout","fetchInterval","missingPolicy","errorPolicy","stringRenderer","currentLocale"].forEach((r=>{void 0!==t[r]&&(e[r]=t[r])})),this.fetchedTags={}}translate(t,e){return this.translateLocale(this.currentLocale,t,e)}translateLocale(t,e,r){try{let n=this.cache.get(Dt(e,r),t);n||(n=this.cache.get(Gt(e,r),t)),n&&n.startsWith("{???")&&oe(e)&&(n=`{${e.substring(1,e.indexOf(",")).trim()}${n.substring(4)}`);let i=!1;if(n||(i=!0,n=e),r&&r._escapeVars){const e={};Object.keys(r).forEach((t=>{const n=r[t];e[t]=xt(n)?Ft(n):n})),n=this.stringRenderer.render(n,t,e)}else n=this.stringRenderer.render(n,t,r);return i&&t&&(n=this.missingPolicy.handle(n,t,r)),xt(n)||(n=`${n}`),n}catch(n){return this.errorPolicy.handle(n,`${e}`,t,r)}}async fetchTranslations(t,r={}){const n=r.filterTags||this.filterTags;if(!r.refresh&&!this.cache.isStale(t)&&(!n&&this.cache.hasTranslations(t)||n&&-1!==(this.fetchedTags[t]||[]).indexOf(n)))return;n&&(t in this.fetchedTags||(this.fetchedTags[t]=[]),-1===this.fetchedTags[t].indexOf(n)&&this.fetchedTags[t].push(n));const i=e=>(Qt(Kt,{localeCode:t,filterTags:n},this),e);try{let r;Qt(Vt,{localeCode:t,filterTags:n},this);let o=202;const s=Date.now();for(;202===o;){let a=`${this.cdsHost}/content/${t}`;const h=[];if(n&&h.push(`filter[tags]=${n}`),this.filterStatus&&h.push(`filter[status]=${this.filterStatus}`),h.length&&(a=`${a}?${h.join("&")}`),r=await e()(a,{method:"GET",headers:{Authorization:`Bearer ${this.token}`,"Accept-version":"v2","X-NATIVE-SDK":"txjs/browser/7.1.4"},signal:this.fetchTimeout>0?AbortSignal.timeout(this.fetchTimeout):void 0}),!r.ok)throw await this._fetchError(r);if(o=r.status,this.fetchTimeout>0&&Date.now()-s>=this.fetchTimeout)throw i(new Error("Fetch translations timeout"));202===o&&this.fetchInterval>0&&await jt(this.fetchInterval)}const a=await r.json();if(!a||!a.data)throw i(new Error("Could not fetch translations"));{const e={};Object.keys(a.data).forEach((t=>{a.data[t].string&&(e[t]=a.data[t].string)})),this.cache.update(t,e),Qt(Xt,{localeCode:t,filterTags:n},this)}}catch(t){throw i(t)}}async invalidateCDS(t={}){if(!this.token)throw new Error("token is not defined");if(!this.secret)throw new Error("secret is not defined");const r=t.purge?"purge":"invalidate",n=await e()(`${this.cdsHost}/${r}`,{method:"POST",headers:{Authorization:`Bearer ${this.token}:${this.secret}`,"Accept-version":"v2","Content-Type":"application/json;charset=utf-8","X-NATIVE-SDK":"txjs/browser/7.1.4"}});if(!n.ok)throw await this._fetchError(n);return await n.json()}async pushSource(t,r={}){if(!this.token)throw new Error("token is not defined");if(!this.secret)throw new Error("secret is not defined");const n={Authorization:`Bearer ${this.token}:${this.secret}`,"Accept-version":"v2","Content-Type":"application/json;charset=utf-8","X-NATIVE-SDK":"txjs/browser/7.1.4"},i=await e()(`${this.cdsHost}/content`,{method:"POST",headers:n,body:JSON.stringify({data:t,meta:{purge:!!r.purge,override_tags:!!r.overrideTags,override_occurrences:!!r.overrideOccurrences}})});if(!i.ok)throw await this._fetchError(i);const o=await i.json(),s=`${this.cdsHost}${o.data.links.job}`;if(r.noWait)return{jobUrl:s};let a={status:""};do{await jt(1500);const t=await e()(s,{method:"GET",headers:n});if(!t.ok)throw await this._fetchError(t);const r=await t.json(),{data:i}=r;a={...i.details||{},errors:i.errors||[],status:i.status}}while("pending"===a.status||"processing"===a.status);return{jobUrl:s,...a}}async getLocales(t={}){if(!t.refresh&&this.locales.length>0)return[...this.locales];if(!this.token)return[];const r=t=>(Qt(Zt,null,this),t);try{let t;Qt(Yt,null,this);let n=202;const i=Date.now();for(;202===n;){if(t=await e()(`${this.cdsHost}/languages`,{method:"GET",headers:{Authorization:`Bearer ${this.token}`,"Accept-version":"v2","X-NATIVE-SDK":"txjs/browser/7.1.4"},signal:this.fetchTimeout>0?AbortSignal.timeout(this.fetchTimeout):void 0}),!t.ok)throw await this._fetchError(t);if(n=t.status,this.fetchTimeout>0&&Date.now()-i>=this.fetchTimeout)throw r(new Error("Get locales timeout"));202===n&&this.fetchInterval>0&&await jt(this.fetchInterval)}const o=await t.json();if(!o||!o.data)throw r(new Error("Could not fetch languages"));this.languages=o.data,this.locales=this.languages.map((t=>t.code)),Qt(zt,null,this)}catch(t){throw r(t)}return[...this.locales]}getCurrentLocale(){return this.currentLocale}isCurrent(t){return t===this.currentLocale}async setCurrentLocale(t){if(this.isCurrent(t))await this._syncInstances(this.childInstances);else{if(!t)return this.currentLocale="",await this._syncInstances(this.childInstances),void Qt($t,this.currentLocale,this);await this.fetchTranslations(t),this.currentLocale=t,await this._syncInstances(this.childInstances),Qt($t,t,this)}}async getLanguages(t={}){return await this.getLocales(t),[...this.languages]}async controllerOf(t){if(t===this)throw new Error("Cannot add self as instance");if(-1!==t.childInstances.indexOf(this))throw new Error("Cycle reference error, instance is controller of this");return this.childInstances.push(t),await this._syncInstances([t]),t}async _syncInstances(t){const e=this.getCurrentLocale();if(e)for(let r=0;r<t.length;r++)if(t[r].getCurrentLocale()!==e)try{await t[r].fetchTranslations(e)}catch(t){}t.forEach((t=>{t.getCurrentLocale()!==e&&(t.currentLocale=e,Qt($t,e,t))}))}async _fetchError(t){try{const e=await t.text();return new Error(`HTTP ${t.status}: ${e}`)}catch(e){return new Error(`HTTP error ${t.status}`)}}}const ae={a:"ȧ",A:"Ȧ",b:"ƀ",B:"Ɓ",c:"ƈ",C:"Ƈ",d:"ḓ",D:"Ḓ",e:"ḗ",E:"Ḗ",f:"ƒ",F:"Ƒ",g:"ɠ",G:"Ɠ",h:"ħ",H:"Ħ",i:"ī",I:"Ī",j:"ĵ",J:"Ĵ",k:"ķ",K:"Ķ",l:"ŀ",L:"Ŀ",m:"ḿ",M:"Ḿ",n:"ƞ",N:"Ƞ",o:"ǿ",O:"Ǿ",p:"ƥ",P:"Ƥ",q:"ɋ",Q:"Ɋ",r:"ř",R:"Ř",s:"ş",S:"Ş",t:"ŧ",T:"Ŧ",v:"ṽ",V:"Ṽ",u:"ŭ",U:"Ŭ",w:"ẇ",W:"Ẇ",x:"ẋ",X:"Ẋ",y:"ẏ",Y:"Ẏ",z:"ẑ",Z:"Ẑ"},he=class{handle(t,e,r){return t.split(/__txnative__/).map((t=>{let e="";for(let r=0;r<t.length;r+=1){const n=t.charAt(r);if(ae[n]){const t=n.toLowerCase();e+="a"===t||"e"===t||"o"===t||"u"===t?ae[n]+ae[n]:ae[n]}else e+=n}return e})).join("__txnative__")}},ue=s,ce=o,le=class{handle(t,e,r,n){throw t||new Error(`Error translating "${e}"`)}},fe=Rt,pe=function(t){const e=new se;return e.t=e.translate.bind(e),t&&e.init(t),e},de=new se,ye=de.translate.bind(de)})(),n})()));
3
3
  //# sourceMappingURL=browser.native.js.map