2 lines
49 KiB
JavaScript
2 lines
49 KiB
JavaScript
!function(){"use strict";function t(t){return t.split("-").every(function(t){return/[a-z0-9]+/i.test(t)})}function e(e){return e?(Array.isArray(e)||(e=[e]),e.map(function(e){switch(void 0===e?"undefined":J(e)){case"string":break;case"object":e=e.toString();break;default:throw new TypeError("Locales should be strings, "+JSON.stringify(e)+" isn't.")}if(!t(e))throw new RangeError("The locale "+JSON.stringify(e)+" is not a structurally valid BCP 47 language tag.");return e}).reduce(function(t,e){return t.indexOf(e)<0&&t.push(e),t},[])):[]}function r(){return"undefined"!=typeof window&&window.navigator&&(window.navigator.userLanguage||window.navigator.language)||"en-US"}function n(t,e){do{if(t[e])return e;e=e.replace(/-?[^-]*$/,"")}while(e);return null}function i(t,e){var i=!0,o=!1,a=void 0;try{for(var s,u=e[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var l=s.value,c=n(t,l);if(c)return c}}catch(t){o=!0,a=t}finally{try{!i&&u.return&&u.return()}finally{if(o)throw a}}return n(t,r())}function o(t){var e=t.style;if(!e)return"cardinal";if(["cardinal","ordinal"].indexOf(e)<0)throw new RangeError("Not a valid plural syle: "+JSON.stringify(e));return e}function a(t){return(new Y).getResource(t)}function s(t,e){return Object.assign({},t,u(e))}function u(t){var e={},r=!0,n=!1,i=void 0;try{for(var o,a=Object.keys(t)[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value;e[s]=t[s].value}}catch(t){n=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(n)throw i}}return e}function l(t,e){var r=t.ctx;return e.reduce(function(t,e){return t+e.valueOf(r).length},0)}function c(t,e,r){return e[r]?e[r]:(t.errors.push(new RangeError("No default")),new et)}function h(t,e){var r=e.name,n=t.ctx,i=t.errors,o=n.messages.get(r);return o||(i.push(new ReferenceError("Unknown message: "+r)),new et(r))}function f(t,e){var r=e.name,n=t.ctx,i=t.errors,o=n.messages.get(r);return o?o.tags?o.tags.map(function(t){return new it(t)}):(i.push(new RangeError('No tags in message "'+r+'"')),new et(r)):(i.push(new ReferenceError("Unknown message: "+r)),new et(r))}function v(t,e){var r=e.id,n=e.key,i=h(t,r);if(i instanceof et)return i;var o=t.ctx,a=t.errors,s=y(t,n);if(function(t){return Array.isArray(t)&&"sel"===t[0].type&&null===t[0].exp}(i.val)){var u=!0,l=!1,c=void 0;try{for(var f,v=i.val[0].vars[Symbol.iterator]();!(u=(f=v.next()).done);u=!0){var d=f.value,g=y(t,d.key);if(s.match(o,g))return d}}catch(t){l=!0,c=t}finally{try{!u&&v.return&&v.return()}finally{if(l)throw c}}}return a.push(new ReferenceError("Unknown variant: "+s.valueOf(o))),y(t,i)}function d(t,e){var r=e.id,n=e.name,i=h(t,r);if(i instanceof et)return i;if(i.attrs)for(var o in i.attrs)if(n===o)return i.attrs[n];return t.errors.push(new ReferenceError("Unknown attribute: "+n)),y(t,i)}function g(t,e){var r=e.exp,n=e.vars,i=e.def;if(null===r)return c(t,n,i);var o="ref"===r.type?f(t,r):y(t,r);if(o instanceof et)return c(t,n,i);var a=!0,s=!1,u=void 0;try{for(var l,h=n[Symbol.iterator]();!(a=(l=h.next()).done);a=!0){var v=l.value,d=y(t,v.key);if(d instanceof rt||d instanceof it){var g=t.ctx;if(d.match(g,o))return v}}}catch(t){s=!0,u=t}finally{try{!a&&h.return&&h.return()}finally{if(s)throw u}}return c(t,n,i)}function y(t,e){if("string"==typeof e||e instanceof et)return e;if(Array.isArray(e))return w(t,e);switch(e.type){case"sym":return new it(e.name);case"num":return new rt(e.val);case"ext":return m(t,e);case"fun":return p(t,e);case"call":return b(t,e);case"ref":return y(t,h(t,e));case"attr":return y(t,d(t,e));case"var":return y(t,v(t,e));case"sel":return y(t,g(t,e));case void 0:if(void 0!==e.val)return y(t,e.val);return t.errors.push(new RangeError("No value")),new et;default:return new et}}function m(t,e){var r=e.name,n=t.args,i=t.errors;if(!n||!n.hasOwnProperty(r))return i.push(new ReferenceError("Unknown external: "+r)),new et(r);var o=n[r];if(o instanceof tt)return o;switch(void 0===o?"undefined":J(o)){case"string":return o;case"number":return new rt(o);case"object":if(o instanceof Date)return new nt(o);default:return i.push(new TypeError("Unsupported external type: "+r+", "+(void 0===o?"undefined":J(o)))),new et(r)}}function p(t,e){var r=e.name,n=t.ctx.functions,i=t.errors,o=n[r]||ot[r];return o?"function"!=typeof o?(i.push(new TypeError("Function "+r+"() is not callable")),new et(r+"()")):o:(i.push(new ReferenceError("Unknown function: "+r+"()")),new et(r+"()"))}function b(t,e){var r=e.fun,n=e.args,i=p(t,r);if(i instanceof et)return i;var o=[],a=[],s=!0,u=!1,l=void 0;try{for(var c,h=n[Symbol.iterator]();!(s=(c=h.next()).done);s=!0){var f=c.value;"narg"===f.type?a[f.name]=y(t,f.val):o.push(y(t,f))}}catch(t){u=!0,l=t}finally{try{!s&&h.return&&h.return()}finally{if(u)throw l}}return i(o,a)}function w(t,e){var r=t.ctx,n=t.dirty,i=t.errors;if(n.has(e))return i.push(new RangeError("Cyclic reference")),new et;n.add(e);var o=[],a=!0,s=!1,u=void 0;try{for(var c,h=e[Symbol.iterator]();!(a=(c=h.next()).done);a=!0){var f=c.value;if("string"!=typeof f){var v=y(t,f);if(r.useIsolating&&o.push(st),Array.isArray(v)){var d=l(t,v);d>at?(i.push(new RangeError("Too many characters in placeable ("+d+", max allowed is "+at+")")),o.push(new et)):o.push.apply(o,G(v))}else o.push(v);r.useIsolating&&o.push(ut)}else o.push(f)}}catch(t){s=!0,u=t}finally{try{!a&&h.return&&h.return()}finally{if(s)throw u}}return n.delete(e),o}function _(t,e,r){return y({ctx:t,args:e,errors:arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],dirty:new WeakSet},r)}function x(t){if(ct.hasOwnProperty(t))return new dt(ct[t]);var e=new dt(t);return ht.includes(e.language)?(e.region=e.language,e.string=e.language+"-"+e.region,e):null}function k(t,e,r){var n=new Set,i=new Set(e.map(function(t){return new dt(t,!0)})),o=!0,a=!1,s=void 0;try{t:for(var u,l=t[Symbol.iterator]();!(o=(u=l.next()).done);o=!0){var c=u.value,h=c.toLowerCase(),f=new dt(h);if(void 0!==f.language){var v=!0,d=!1,g=void 0;try{for(var y,m=e[Symbol.iterator]();!(v=(y=m.next()).done);v=!0){var p=y.value;if(h===p.toLowerCase()){n.add(p);var b=!0,w=!1,_=void 0;try{for(var x,k=i[Symbol.iterator]();!(b=(x=k.next()).done);b=!0){var S=x.value;if(S.isEqual(f)){i.delete(S);break}}}catch(t){w=!0,_=t}finally{try{!b&&k.return&&k.return()}finally{if(w)throw _}}if("lookup"===r)return Array.from(n);if("matching"===r)continue t;break}}}catch(t){d=!0,g=t}finally{try{!v&&m.return&&m.return()}finally{if(d)throw g}}var E=!0,A=!1,O=void 0;try{for(var C,L=i[Symbol.iterator]();!(E=(C=L.next()).done);E=!0){var N=C.value;if(f.matches(N)){if(n.add(N.string),i.delete(N),"lookup"===r)return Array.from(n);if("matching"===r)continue t;break}}}catch(t){A=!0,O=t}finally{try{!E&&L.return&&L.return()}finally{if(A)throw O}}if(f.addLikelySubtags()){var R=!0,P=!1,j=void 0;try{for(var z,T=i[Symbol.iterator]();!(R=(z=T.next()).done);R=!0){var I=z.value;if(f.matches(I)){if(n.add(I.string),i.delete(I),"lookup"===r)return Array.from(n);if("matching"===r)continue t;break}}}catch(t){P=!0,j=t}finally{try{!R&&T.return&&T.return()}finally{if(P)throw j}}}f.setVariantRange();var F=!0,W=!1,q=void 0;try{for(var M,D=i[Symbol.iterator]();!(F=(M=D.next()).done);F=!0){var U=M.value;if(f.matches(U)){if(n.add(U.string),i.delete(U),"lookup"===r)return Array.from(n);if("matching"===r)continue t;break}}}catch(t){W=!0,q=t}finally{try{!F&&D.return&&D.return()}finally{if(W)throw q}}f.setRegionRange();var V=!0,J=!1,K=void 0;try{for(var B,H=i[Symbol.iterator]();!(V=(B=H.next()).done);V=!0){var X=B.value;if(f.matches(X)){if(n.add(X.string),i.delete(X),"lookup"===r)return Array.from(n);if("matching"===r)continue t;break}}}catch(t){J=!0,K=t}finally{try{!V&&H.return&&H.return()}finally{if(J)throw K}}}}}catch(t){a=!0,s=t}finally{try{!o&&l.return&&l.return()}finally{if(a)throw s}}return Array.from(n)}function S(t,e,r,n,i){var o=t[e];if(void 0!==o){if("boolean"===r?o=new Boolean(o):"string"===r&&(o=String(o)),void 0!==n&&-1===n.indexOf(o))throw new Error("Invalid option value");return o}return i}function E(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=S(r,"defaultLocale","string"),i=S(r,"likelySubtags","object",void 0),o=S(r,"strategy","string",["filtering","matching","lookup"],"filtering");if("lookup"===o&&!n)throw new Error("defaultLocale cannot be undefined for strategy `lookup`");var a=Array.from(Object(t)).map(function(t){return String(t)}),s=Array.from(Object(e)).map(function(t){return String(t)}),u=k(a,s,o,i);return"lookup"===o?0===u.length&&u.push(n):n&&!u.includes(n)&&u.push(n),u}function A(t,e){var r=$(e,1),n=r[0];return n?n.fetch().then(function(e){var r=t(n.lang);return e.filter(function(t){return null!==t}).forEach(function(t){return r.addMessages(t)}),mt.set(n,r),r}):Promise.resolve(null)}function O(t,e){return t.length===e.length&&t.every(function(t,r){return t.lang===e[r].lang})}function C(t,e,r,n,i){var o=[],a={errors:new Array(n.length),withoutFatal:new Array(n.length),hasFatalErrors:!1};return a.translations=n.map(function(n,s){if(i&&!i.errors[s])return i.translations[s];o.length=0;var u=e(n[1]),l=t(r,o,n[0],u);return 0===o.length?l:(a.errors[s]=o.slice(),o.some(L)?a.hasFatalErrors||(a.hasFatalErrors=!0):a.withoutFatal[s]=!0,i&&i.withoutFatal[s]?(a.withoutFatal[s]=!0,i.translations[s]):l)}),a}function L(t){return t instanceof gt}function N(t,e){var r=e.value;if("string"==typeof r)if(bt.test(r)){var n=t.ownerDocument.createElementNS("http://www.w3.org/1999/xhtml","template");n.innerHTML=r,R(t,n.content)}else t.textContent=r;if(null!==e.attrs)for(var i in e.attrs)j({name:i},t)&&t.setAttribute(i,e.attrs[i])}function R(t,e){for(var r=e.ownerDocument.createDocumentFragment(),n=void 0,i=void 0,o=void 0;o=e.childNodes[0];)if(e.removeChild(o),o.nodeType!==o.TEXT_NODE){var a=T(o),s=z(t,o,a);if(s)R(s,o),r.appendChild(s);else if(P(o)){var u=o.ownerDocument.createElement(o.nodeName);R(u,o),r.appendChild(u)}else r.appendChild(e.ownerDocument.createTextNode(o.textContent))}else r.appendChild(o);if(t.textContent="",t.appendChild(r),e.attributes)for(n=0,i;i=e.attributes[n];n++)j(i,t)&&t.setAttribute(i.name,i.value)}function P(t){var e=wt[t.namespaceURI];return!!e&&-1!==e.indexOf(t.tagName.toLowerCase())}function j(t,e){var r=_t[e.namespaceURI];if(!r)return!1;var n=t.name.toLowerCase(),i=e.tagName.toLowerCase();if(-1!==r.global.indexOf(n))return!0;if(!r[i])return!1;if(-1!==r[i].indexOf(n))return!0;if("http://www.w3.org/1999/xhtml"===e.namespaceURI&&"input"===i&&"value"===n){var o=e.type.toLowerCase();if("submit"===o||"button"===o||"reset"===o)return!0}return!1}function z(t,e,r){for(var n,i=0,o=0;n=t.children[o];o++)if(n.nodeType===n.ELEMENT_NODE&&n.tagName.toLowerCase()===e.tagName.toLowerCase()){if(i===r)return n;i++}return null}function T(t){for(var e=0,r=void 0;r=t.previousElementSibling;)r.tagName===t.tagName&&e++;return e}function I(t){return["ar","he","fa","ps","ur"].indexOf(t.split("-")[0])>=0?"rtl":"ltr"}function F(t){return new Promise(function(e,r){var n=new XMLHttpRequest;n.overrideMimeType&&n.overrideMimeType("text/plain"),n.open("GET",t,!0),n.addEventListener("load",function(n){n.target.status===Et||0===n.target.status?e(n.target.responseText):r(new Error(t+" not found"))}),n.addEventListener("error",function(){return r(new Error(t+" failed to load"))}),n.addEventListener("timeout",function(){return r(new Error(t+" timed out"))}),n.send(null)})}function W(t,e){return F(t.replace("{locale}",e)).catch(function(){return null})}function q(){var t=document.readyState;return"interactive"===t||"completed"===t?Promise.resolve():new Promise(function(t){return document.addEventListener("readystatechange",t,{once:!0})})}function M(t){return new lt(t)}function D(t,e,r,n){function i(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:navigator.languages,i=E(n,e,{defaultLocale:t}),o=i.map(function(t){return new At(t,r)});return Promise.resolve(o)}if("main"===n)document.l10n=new St(i,M),document.l10n.ready=q().then(function(){return document.l10n.connectRoot(document.documentElement),document.l10n.translateDocument()}).then(function(){window.addEventListener("languagechange",document.l10n)});else{var o=new kt(i,M,n,document.l10n);document.l10n.delegates.set(n,o)}}var U=[function(t){return"other"},function(t){return 1==t?"one":"other"},function(t){return 0==t||1==t?"one":"other"},function(t){var e=String(t).split("."),r=!e[1];return 1==t&&r?"one":"other"}],V={cardinal:{af:U[1],ak:U[2],am:function(t){return t>=0&&t<=1?"one":"other"},ar:function(t){var e=String(t).split("."),r=Number(e[0])==t,n=r&&e[0].slice(-2);return 0==t?"zero":1==t?"one":2==t?"two":n>=3&&n<=10?"few":n>=11&&n<=99?"many":"other"},as:function(t){return t>=0&&t<=1?"one":"other"},asa:U[1],ast:U[3],az:U[1],be:function(t){var e=String(t).split("."),r=Number(e[0])==t,n=r&&e[0].slice(-1),i=r&&e[0].slice(-2);return 1==n&&11!=i?"one":n>=2&&n<=4&&(i<12||i>14)?"few":r&&0==n||n>=5&&n<=9||i>=11&&i<=14?"many":"other"},bem:U[1],bez:U[1],bg:U[1],bh:U[2],bm:U[0],bn:function(t){return t>=0&&t<=1?"one":"other"},bo:U[0],br:function(t){var e=String(t).split("."),r=Number(e[0])==t,n=r&&e[0].slice(-1),i=r&&e[0].slice(-2),o=r&&e[0].slice(-6);return 1==n&&11!=i&&71!=i&&91!=i?"one":2==n&&12!=i&&72!=i&&92!=i?"two":(3==n||4==n||9==n)&&(i<10||i>19)&&(i<70||i>79)&&(i<90||i>99)?"few":0!=t&&r&&0==o?"many":"other"},brx:U[1],bs:function(t){var e=String(t).split("."),r=e[0],n=e[1]||"",i=!e[1],o=r.slice(-1),a=r.slice(-2),s=n.slice(-1),u=n.slice(-2);return i&&1==o&&11!=a||1==s&&11!=u?"one":i&&o>=2&&o<=4&&(a<12||a>14)||s>=2&&s<=4&&(u<12||u>14)?"few":"other"},ca:U[3],ce:U[1],cgg:U[1],chr:U[1],ckb:U[1],cs:function(t){var e=String(t).split("."),r=e[0],n=!e[1];return 1==t&&n?"one":r>=2&&r<=4&&n?"few":n?"other":"many"},cy:function(t){return 0==t?"zero":1==t?"one":2==t?"two":3==t?"few":6==t?"many":"other"},da:function(t){var e=String(t).split("."),r=e[0],n=Number(e[0])==t;return 1!=t&&(n||0!=r&&1!=r)?"other":"one"},de:U[3],dsb:function(t){var e=String(t).split("."),r=e[0],n=e[1]||"",i=!e[1],o=r.slice(-2),a=n.slice(-2);return i&&1==o||1==a?"one":i&&2==o||2==a?"two":i&&(3==o||4==o)||3==a||4==a?"few":"other"},dv:U[1],dz:U[0],ee:U[1],el:U[1],en:U[3],eo:U[1],es:U[1],et:U[3],eu:U[1],fa:function(t){return t>=0&&t<=1?"one":"other"},ff:function(t){return t>=0&&t<2?"one":"other"},fi:U[3],fil:function(t){var e=String(t).split("."),r=e[0],n=e[1]||"",i=!e[1],o=r.slice(-1),a=n.slice(-1);return i&&(1==r||2==r||3==r)||i&&4!=o&&6!=o&&9!=o||!i&&4!=a&&6!=a&&9!=a?"one":"other"},fo:U[1],fr:function(t){return t>=0&&t<2?"one":"other"},fur:U[1],fy:U[3],ga:function(t){var e=String(t).split("."),r=Number(e[0])==t;return 1==t?"one":2==t?"two":r&&t>=3&&t<=6?"few":r&&t>=7&&t<=10?"many":"other"},gd:function(t){var e=String(t).split("."),r=Number(e[0])==t;return 1==t||11==t?"one":2==t||12==t?"two":r&&t>=3&&t<=10||r&&t>=13&&t<=19?"few":"other"},gl:U[3],gsw:U[1],gu:function(t){return t>=0&&t<=1?"one":"other"},guw:U[2],gv:function(t){var e=String(t).split("."),r=e[0],n=!e[1],i=r.slice(-1),o=r.slice(-2);return n&&1==i?"one":n&&2==i?"two":!n||0!=o&&20!=o&&40!=o&&60!=o&&80!=o?n?"other":"many":"few"},ha:U[1],haw:U[1],he:function(t){var e=String(t).split("."),r=e[0],n=!e[1],i=Number(e[0])==t,o=i&&e[0].slice(-1);return 1==t&&n?"one":2==r&&n?"two":n&&(t<0||t>10)&&i&&0==o?"many":"other"},hi:function(t){return t>=0&&t<=1?"one":"other"},hr:function(t){var e=String(t).split("."),r=e[0],n=e[1]||"",i=!e[1],o=r.slice(-1),a=r.slice(-2),s=n.slice(-1),u=n.slice(-2);return i&&1==o&&11!=a||1==s&&11!=u?"one":i&&o>=2&&o<=4&&(a<12||a>14)||s>=2&&s<=4&&(u<12||u>14)?"few":"other"},hsb:function(t){var e=String(t).split("."),r=e[0],n=e[1]||"",i=!e[1],o=r.slice(-2),a=n.slice(-2);return i&&1==o||1==a?"one":i&&2==o||2==a?"two":i&&(3==o||4==o)||3==a||4==a?"few":"other"},hu:U[1],hy:function(t){return t>=0&&t<2?"one":"other"},id:U[0],ig:U[0],ii:U[0],in:U[0],is:function(t){var e=String(t).split("."),r=e[0],n=Number(e[0])==t,i=r.slice(-1),o=r.slice(-2);return n&&1==i&&11!=o||!n?"one":"other"},it:U[3],iu:function(t){return 1==t?"one":2==t?"two":"other"},iw:function(t){var e=String(t).split("."),r=e[0],n=!e[1],i=Number(e[0])==t,o=i&&e[0].slice(-1);return 1==t&&n?"one":2==r&&n?"two":n&&(t<0||t>10)&&i&&0==o?"many":"other"},ja:U[0],jbo:U[0],jgo:U[1],ji:U[3],jmc:U[1],jv:U[0],jw:U[0],ka:U[1],kab:function(t){return t>=0&&t<2?"one":"other"},kaj:U[1],kcg:U[1],kde:U[0],kea:U[0],kk:U[1],kkj:U[1],kl:U[1],km:U[0],kn:function(t){return t>=0&&t<=1?"one":"other"},ko:U[0],ks:U[1],ksb:U[1],ksh:function(t){return 0==t?"zero":1==t?"one":"other"},ku:U[1],kw:function(t){return 1==t?"one":2==t?"two":"other"},ky:U[1],lag:function(t){var e=String(t).split("."),r=e[0];return 0==t?"zero":0!=r&&1!=r||0==t?"other":"one"},lb:U[1],lg:U[1],lkt:U[0],ln:U[2],lo:U[0],lt:function(t){var e=String(t).split("."),r=e[1]||"",n=Number(e[0])==t,i=n&&e[0].slice(-1),o=n&&e[0].slice(-2);return 1==i&&(o<11||o>19)?"one":i>=2&&i<=9&&(o<11||o>19)?"few":0!=r?"many":"other"},lv:function(t){var e=String(t).split("."),r=e[1]||"",n=r.length,i=Number(e[0])==t,o=i&&e[0].slice(-1),a=i&&e[0].slice(-2),s=r.slice(-2),u=r.slice(-1);return i&&0==o||a>=11&&a<=19||2==n&&s>=11&&s<=19?"zero":1==o&&11!=a||2==n&&1==u&&11!=s||2!=n&&1==u?"one":"other"},mas:U[1],mg:U[2],mgo:U[1],mk:function(t){var e=String(t).split("."),r=e[0],n=e[1]||"",i=!e[1],o=r.slice(-1),a=n.slice(-1);return i&&1==o||1==a?"one":"other"},ml:U[1],mn:U[1],mo:function(t){var e=String(t).split("."),r=!e[1],n=Number(e[0])==t,i=n&&e[0].slice(-2);return 1==t&&r?"one":!r||0==t||1!=t&&i>=1&&i<=19?"few":"other"},mr:function(t){return t>=0&&t<=1?"one":"other"},ms:U[0],mt:function(t){var e=String(t).split("."),r=Number(e[0])==t,n=r&&e[0].slice(-2);return 1==t?"one":0==t||n>=2&&n<=10?"few":n>=11&&n<=19?"many":"other"},my:U[0],nah:U[1],naq:function(t){return 1==t?"one":2==t?"two":"other"},nb:U[1],nd:U[1],ne:U[1],nl:U[3],nn:U[1],nnh:U[1],no:U[1],nqo:U[0],nr:U[1],nso:U[2],ny:U[1],nyn:U[1],om:U[1],or:U[1],os:U[1],pa:U[2],pap:U[1],pl:function(t){var e=String(t).split("."),r=e[0],n=!e[1],i=r.slice(-1),o=r.slice(-2);return 1==t&&n?"one":n&&i>=2&&i<=4&&(o<12||o>14)?"few":n&&1!=r&&(0==i||1==i)||n&&i>=5&&i<=9||n&&o>=12&&o<=14?"many":"other"},prg:function(t){var e=String(t).split("."),r=e[1]||"",n=r.length,i=Number(e[0])==t,o=i&&e[0].slice(-1),a=i&&e[0].slice(-2),s=r.slice(-2),u=r.slice(-1);return i&&0==o||a>=11&&a<=19||2==n&&s>=11&&s<=19?"zero":1==o&&11!=a||2==n&&1==u&&11!=s||2!=n&&1==u?"one":"other"},ps:U[1],pt:function(t){var e=String(t).split(".");return Number(e[0])==t&&t>=0&&t<=2&&2!=t?"one":"other"},"pt-PT":U[3],rm:U[1],ro:function(t){var e=String(t).split("."),r=!e[1],n=Number(e[0])==t,i=n&&e[0].slice(-2);return 1==t&&r?"one":!r||0==t||1!=t&&i>=1&&i<=19?"few":"other"},rof:U[1],root:U[0],ru:function(t){var e=String(t).split("."),r=e[0],n=!e[1],i=r.slice(-1),o=r.slice(-2);return n&&1==i&&11!=o?"one":n&&i>=2&&i<=4&&(o<12||o>14)?"few":n&&0==i||n&&i>=5&&i<=9||n&&o>=11&&o<=14?"many":"other"},rwk:U[1],sah:U[0],saq:U[1],sdh:U[1],se:function(t){return 1==t?"one":2==t?"two":"other"},seh:U[1],ses:U[0],sg:U[0],sh:function(t){var e=String(t).split("."),r=e[0],n=e[1]||"",i=!e[1],o=r.slice(-1),a=r.slice(-2),s=n.slice(-1),u=n.slice(-2);return i&&1==o&&11!=a||1==s&&11!=u?"one":i&&o>=2&&o<=4&&(a<12||a>14)||s>=2&&s<=4&&(u<12||u>14)?"few":"other"},shi:function(t){var e=String(t).split("."),r=Number(e[0])==t;return t>=0&&t<=1?"one":r&&t>=2&&t<=10?"few":"other"},si:function(t){var e=String(t).split("."),r=e[0],n=e[1]||"";return 0==t||1==t||0==r&&1==n?"one":"other"},sk:function(t){var e=String(t).split("."),r=e[0],n=!e[1];return 1==t&&n?"one":r>=2&&r<=4&&n?"few":n?"other":"many"},sl:function(t){var e=String(t).split("."),r=e[0],n=!e[1],i=r.slice(-2);return n&&1==i?"one":n&&2==i?"two":n&&(3==i||4==i)||!n?"few":"other"},sma:function(t){return 1==t?"one":2==t?"two":"other"},smi:function(t){return 1==t?"one":2==t?"two":"other"},smj:function(t){return 1==t?"one":2==t?"two":"other"},smn:function(t){return 1==t?"one":2==t?"two":"other"},sms:function(t){return 1==t?"one":2==t?"two":"other"},sn:U[1],so:U[1],sq:U[1],sr:function(t){var e=String(t).split("."),r=e[0],n=e[1]||"",i=!e[1],o=r.slice(-1),a=r.slice(-2),s=n.slice(-1),u=n.slice(-2);return i&&1==o&&11!=a||1==s&&11!=u?"one":i&&o>=2&&o<=4&&(a<12||a>14)||s>=2&&s<=4&&(u<12||u>14)?"few":"other"},ss:U[1],ssy:U[1],st:U[1],sv:U[3],sw:U[3],syr:U[1],ta:U[1],te:U[1],teo:U[1],th:U[0],ti:U[2],tig:U[1],tk:U[1],tl:function(t){var e=String(t).split("."),r=e[0],n=e[1]||"",i=!e[1],o=r.slice(-1),a=n.slice(-1);return i&&(1==r||2==r||3==r)||i&&4!=o&&6!=o&&9!=o||!i&&4!=a&&6!=a&&9!=a?"one":"other"},tn:U[1],to:U[0],tr:U[1],ts:U[1],tzm:function(t){var e=String(t).split("."),r=Number(e[0])==t;return 0==t||1==t||r&&t>=11&&t<=99?"one":"other"},ug:U[1],uk:function(t){var e=String(t).split("."),r=e[0],n=!e[1],i=r.slice(-1),o=r.slice(-2);return n&&1==i&&11!=o?"one":n&&i>=2&&i<=4&&(o<12||o>14)?"few":n&&0==i||n&&i>=5&&i<=9||n&&o>=11&&o<=14?"many":"other"},ur:U[3],uz:U[1],ve:U[1],vi:U[0],vo:U[1],vun:U[1],wa:U[2],wae:U[1],wo:U[0],xh:U[1],xog:U[1],yi:U[3],yo:U[0],zh:U[0],zu:function(t){return t>=0&&t<=1?"one":"other"}},ordinal:{af:U[0],am:U[0],ar:U[0],as:function(t){return 1==t||5==t||7==t||8==t||9==t||10==t?"one":2==t||3==t?"two":4==t?"few":6==t?"many":"other"},az:function(t){var e=String(t).split("."),r=e[0],n=r.slice(-1),i=r.slice(-2),o=r.slice(-3);return 1==n||2==n||5==n||7==n||8==n||20==i||50==i||70==i||80==i?"one":3==n||4==n||100==o||200==o||300==o||400==o||500==o||600==o||700==o||800==o||900==o?"few":0==r||6==n||40==i||60==i||90==i?"many":"other"},be:function(t){var e=String(t).split("."),r=Number(e[0])==t,n=r&&e[0].slice(-1),i=r&&e[0].slice(-2);return 2!=n&&3!=n||12==i||13==i?"other":"few"},bg:U[0],bn:function(t){return 1==t||5==t||7==t||8==t||9==t||10==t?"one":2==t||3==t?"two":4==t?"few":6==t?"many":"other"},bs:U[0],ca:function(t){return 1==t||3==t?"one":2==t?"two":4==t?"few":"other"},ce:U[0],cs:U[0],cy:function(t){return 0==t||7==t||8==t||9==t?"zero":1==t?"one":2==t?"two":3==t||4==t?"few":5==t||6==t?"many":"other"},da:U[0],de:U[0],dsb:U[0],el:U[0],en:function(t){var e=String(t).split("."),r=Number(e[0])==t,n=r&&e[0].slice(-1),i=r&&e[0].slice(-2);return 1==n&&11!=i?"one":2==n&&12!=i?"two":3==n&&13!=i?"few":"other"},es:U[0],et:U[0],eu:U[0],fa:U[0],fi:U[0],fil:U[1],fr:U[1],fy:U[0],ga:U[1],gl:U[0],gu:function(t){return 1==t?"one":2==t||3==t?"two":4==t?"few":6==t?"many":"other"},he:U[0],hi:function(t){return 1==t?"one":2==t||3==t?"two":4==t?"few":6==t?"many":"other"},hr:U[0],hsb:U[0],hu:function(t){return 1==t||5==t?"one":"other"},hy:U[1],id:U[0],in:U[0],is:U[0],it:function(t){return 11==t||8==t||80==t||800==t?"many":"other"},iw:U[0],ja:U[0],ka:function(t){var e=String(t).split("."),r=e[0],n=r.slice(-2);return 1==r?"one":0==r||n>=2&&n<=20||40==n||60==n||80==n?"many":"other"},kk:function(t){var e=String(t).split("."),r=Number(e[0])==t,n=r&&e[0].slice(-1);return 6==n||9==n||r&&0==n&&0!=t?"many":"other"},km:U[0],kn:U[0],ko:U[0],ky:U[0],lo:U[1],lt:U[0],lv:U[0],mk:function(t){var e=String(t).split("."),r=e[0],n=r.slice(-1),i=r.slice(-2);return 1==n&&11!=i?"one":2==n&&12!=i?"two":7!=n&&8!=n||17==i||18==i?"other":"many"},ml:U[0],mn:U[0],mo:U[1],mr:function(t){return 1==t?"one":2==t||3==t?"two":4==t?"few":"other"},ms:U[1],my:U[0],nb:U[0],ne:function(t){var e=String(t).split(".");return Number(e[0])==t&&t>=1&&t<=4?"one":"other"},nl:U[0],pa:U[0],pl:U[0],prg:U[0],pt:U[0],ro:U[1],root:U[0],ru:U[0],sh:U[0],si:U[0],sk:U[0],sl:U[0],sq:function(t){var e=String(t).split("."),r=Number(e[0])==t,n=r&&e[0].slice(-1),i=r&&e[0].slice(-2);return 1==t?"one":4==n&&14!=i?"many":"other"},sr:U[0],sv:function(t){var e=String(t).split("."),r=Number(e[0])==t,n=r&&e[0].slice(-1),i=r&&e[0].slice(-2);return 1!=n&&2!=n||11==i||12==i?"other":"one"},sw:U[0],ta:U[0],te:U[0],th:U[0],tl:U[1],tr:U[0],uk:function(t){var e=String(t).split("."),r=Number(e[0])==t,n=r&&e[0].slice(-1),i=r&&e[0].slice(-2);return 3==n&&13!=i?"few":"other"},ur:U[0],uz:U[0],vi:U[1],zh:U[0],zu:U[0]}},J="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},K=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},B=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),H=function t(e,r,n){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,r);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,r,n)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(n)},X=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},Z=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},$=function(){function t(t,e){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){i=!0,o=t}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}return r}return function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),G=function(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)},Q=function(){function t(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};K(this,t);var a=e(r);this.style=o(n),this.locale=i(V[this.style],a),this.select=V[this.style][this.locale]}return B(t,[{key:"resolvedOptions",value:function(){return{locale:this.locale,style:this.style}}}],[{key:"supportedLocalesOf",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e(t),a=o(r);return i.filter(function(t){return n(V[a],t)})}}]),t}();"undefined"==typeof Intl?"undefined"!=typeof global?global.Intl={PluralRules:Q}:"undefined"!=typeof window?window.Intl={PluralRules:Q}:this.Intl={PluralRules:Q}:!Intl.PluralRules||"undefined"!=typeof ClobberIntlPluralRules&&ClobberIntlPluralRules?Intl.PluralRules=Q:"undefined"!=typeof console&&(console.warn("Intl.PluralRules already exists, and has NOT been replaced by this polyfill"),console.log("To force, set a global ClobberIntlPluralRules = true")),"undefined"!=typeof navigator&&void 0===navigator.languages&&(navigator.languages=[navigator.language]),"undefined"==typeof Intl&&(window.Intl={});var Y=function(){function t(){K(this,t)}return B(t,[{key:"getResource",value:function(t){this._source=t,this._index=0,this._length=t.length;var e={},r=[];for(this.getWS();this._index<this._length;){try{this.getEntry(e)}catch(t){if(!(t instanceof SyntaxError))throw t;r.push(t);var n=this._findNextEntryStart();this._index=-1===n?this._length:n}this.getWS()}return[e,r]}},{key:"getEntry",value:function(t){if(0!==this._index&&"\n"!==this._source[this._index-1])throw this.error("Expected new line and a new entry");var e=this._source[this._index];return"/"===e?void this.getComment():"["===e?void this.getSection():void("\n"!==e&&this.getMessage(t))}},{key:"getSection",value:function(){if(this._index+=1,"["!==this._source[this._index])throw this.error('Expected "[[" to open a section');if(this._index+=1,this.getLineWS(),this.getSymbol(),this.getLineWS(),"]"!==this._source[this._index]||"]"!==this._source[this._index+1])throw this.error('Expected "]]" to close a section');this._index+=2}},{key:"getMessage",value:function(t){var e=this.getIdentifier(),r=null,n=null;this.getLineWS();var i=this._source[this._index],o=void 0;if("="===i?(this._index++,this.getLineWS(),o=this.getPattern()):this.getWS(),i=this._source[this._index],"\n"===i&&(this._index++,this.getLineWS(),i=this._source[this._index]),"."===i&&(r=this.getAttributes()),"#"===i){if(null!==r)throw this.error("Tags cannot be added to a message with attributes.");n=this.getTags()}if(null===n&&null===r&&"string"==typeof o)t[e]=o;else{if(void 0===o&&null===n&&null===r)throw this.error('Expected a value (like: " = value") or\n an attribute (like: ".key = value")');t[e]={val:o},r&&(t[e].attrs=r),n&&(t[e].tags=n)}}},{key:"getWS",value:function(){for(var t=this._source.charCodeAt(this._index);32===t||10===t||9===t||13===t;)t=this._source.charCodeAt(++this._index)}},{key:"getLineWS",value:function(){for(var t=this._source.charCodeAt(this._index);32===t||9===t;)t=this._source.charCodeAt(++this._index)}},{key:"getIdentifier",value:function(){var t=this._index,e=this._source.charCodeAt(this._index);if(!(e>=97&&e<=122||e>=65&&e<=90||95===e))throw this.error("Expected an identifier (starting with [a-zA-Z_])");for(e=this._source.charCodeAt(++this._index);e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||95===e||45===e;)e=this._source.charCodeAt(++this._index);return this._source.slice(t,this._index)}},{key:"getSymbol",value:function(){var t="",e=this._index,r=this._source.charCodeAt(this._index);if(r>=97&&r<=122||r>=65&&r<=90||95===r||32===r)r=this._source.charCodeAt(++this._index);else if(0===t.length)throw this.error("Expected a keyword (starting with [a-zA-Z_])");for(;r>=97&&r<=122||r>=65&&r<=90||r>=48&&r<=57||95===r||45===r||32===r;)r=this._source.charCodeAt(++this._index);for(;32===this._source.charCodeAt(this._index-1);)this._index--;return t+=this._source.slice(e,this._index),{type:"sym",name:t}}},{key:"getString",value:function(){for(var t="";++this._index<this._length;){var e=this._source[this._index];if('"'===e)break;if("\n"===e)break;t+=e}return this._index++,t}},{key:"getPattern",value:function(){var t=this._index,e=this._source.indexOf("\n",this._index);-1===e&&(e=this._length);var r=t!==e?this._source.slice(t,e):void 0;return void 0!==r&&r.includes("{")?this.getComplexPattern():(this._index=e+1," "===this._source[this._index]?(this._index=t,this.getComplexPattern()):r)}},{key:"getComplexPattern",value:function(){var t="",e=[],r=0,n=this._source[this._index];for("\\"!==n||'"'!==this._source[this._index+1]&&"{"!==this._source[this._index+1]&&"\\"!==this._source[this._index+1]||(t+=this._source[this._index+1],this._index+=2,n=this._source[this._index]);this._index<this._length;)if("\n"!==n){if("\\"===n){var i=this._source[this._index+1];'"'!==i&&"{"!==i||(n=i,this._index++)}else if("{"===n){if(t.length&&e.push(t),r>99)throw this.error("Too many placeables, maximum allowed is 100");t="",e.push(this.getPlaceable()),this._index++,n=this._source[this._index],r++;continue}n&&(t+=n),this._index++,n=this._source[this._index]}else{if(this._index++," "!==this._source[this._index])break;if(this.getLineWS(),"}"===this._source[this._index]||"["===this._source[this._index]||"*"===this._source[this._index]||"#"===this._source[this._index]||"."===this._source[this._index])break;t.length&&(t+="\n"),n=this._source[this._index]}return 0===e.length?t.length?t:void 0:(t.length&&e.push(t),e)}},{key:"getPlaceable",value:function(){var t=++this._index;if(this.getWS(),"*"===this._source[this._index]||"["===this._source[this._index]&&"]"!==this._source[this._index+1]){var e=this.getVariants();return{type:"sel",exp:null,vars:e[0],def:e[1]}}this._index=t,this.getLineWS();var r=this.getSelectorExpression(),n=void 0;this.getWS();var i=this._source[this._index];if("}"!==i){if("-"!==i||">"!==this._source[this._index+1])throw this.error('Expected "}", "," or "->"');if(this._index+=2,this.getLineWS(),"\n"!==this._source[this._index])throw this.error("Variants should be listed in a new line");if(this.getWS(),n=this.getVariants(),0===n[0].length)throw this.error("Expected members for the select expression")}return void 0===n?r:{type:"sel",exp:r,vars:n[0],def:n[1]}}},{key:"getSelectorExpression",value:function(){var t=this.getLiteral()
|
||
;if("ref"!==t.type)return t;if("."===this._source[this._index]){this._index++;var e=this.getIdentifier();return this._index++,{type:"attr",id:t,name:e}}if("["===this._source[this._index]){this._index++;var r=this.getVariantKey();return this._index++,{type:"var",id:t,key:r}}if("("===this._source[this._index]){this._index++;var n=this.getCallArgs();return this._index++,t.type="fun",{type:"call",fun:t,args:n}}return t}},{key:"getCallArgs",value:function(){var t=[];if(")"===this._source[this._index])return t;for(;this._index<this._length;){this.getLineWS();var e=this.getSelectorExpression();if("ref"!==e.type||void 0!==e.namespace)t.push(e);else if(this.getLineWS(),":"===this._source[this._index]){this._index++,this.getLineWS();var r=this.getSelectorExpression();if("string"!=typeof r&&!Array.isArray(r)&&"num"!==r.type)throw this._index=this._source.lastIndexOf(":",this._index)+1,this.error("Expected string in quotes, number.");t.push({type:"narg",name:e.name,val:r})}else t.push(e);if(this.getLineWS(),")"===this._source[this._index])break;if(","!==this._source[this._index])throw this.error('Expected "," or ")"');this._index++}return t}},{key:"getNumber",value:function(){var t="",e=this._source.charCodeAt(this._index);if(45===e&&(t+="-",e=this._source.charCodeAt(++this._index)),e<48||e>57)throw this.error('Unknown literal "'+t+'"');for(;e>=48&&e<=57;)t+=this._source[this._index++],e=this._source.charCodeAt(this._index);if(46===e){if(t+=this._source[this._index++],(e=this._source.charCodeAt(this._index))<48||e>57)throw this.error('Unknown literal "'+t+'"');for(;e>=48&&e<=57;)t+=this._source[this._index++],e=this._source.charCodeAt(this._index)}return{type:"num",val:t}}},{key:"getAttributes",value:function(){for(var t={};this._index<this._length;){if("."!==this._source[this._index])break;this._index++;var e=this.getIdentifier();this.getLineWS(),this._index++,this.getLineWS();var r=this.getPattern();t[e]="string"==typeof r?r:{val:r},this.getWS()}return t}},{key:"getTags",value:function(){for(var t=[];this._index<this._length;){if("#"!==this._source[this._index])break;this._index++;var e=this.getSymbol();t.push(e.name),this.getWS()}return t}},{key:"getVariants",value:function(){for(var t=[],e=0,r=void 0;this._index<this._length;){var n=this._source[this._index];if(("["!==n||"["===this._source[this._index+1])&&"*"!==n)break;if("*"===n&&(this._index++,r=e),"["!==this._source[this._index])throw this.error('Expected "["');this._index++;var i=this.getVariantKey();this.getLineWS();var o={key:i,val:this.getPattern()};t[e++]=o,this.getWS()}return[t,r]}},{key:"getVariantKey",value:function(){var t=this._source.charCodeAt(this._index),e=void 0;if(e=t>=48&&t<=57||45===t?this.getNumber():this.getSymbol(),"]"!==this._source[this._index])throw this.error('Expected "]"');return this._index++,e}},{key:"getLiteral",value:function(){var t=this._source.charCodeAt(this._index);return t>=48&&t<=57||45===t?this.getNumber():34===t?this.getString():36===t?(this._index++,{type:"ext",name:this.getIdentifier()}):{type:"ref",name:this.getIdentifier()}}},{key:"getComment",value:function(){for(var t=this._source.indexOf("\n",this._index);-1!==t&&"/"===this._source[t+1]&&"/"===this._source[t+2]&&(this._index=t+3,-1!==(t=this._source.indexOf("\n",this._index))););this._index=-1===t?this._length:t+1}},{key:"error",value:function(t){return new SyntaxError(t)}},{key:"_findNextEntryStart",value:function(){for(var t=this._index;;){if(0===t||"\n"===this._source[t-1]){var e=this._source.charCodeAt(t);if(e>=97&&e<=122||e>=65&&e<=90||95===e||47===e||91===e)break}if(-1===(t=this._source.indexOf("\n",t)))break;t++}return t}}]),t}(),tt=function(){function t(e,r){K(this,t),this.value=e,this.opts=r}return B(t,[{key:"valueOf",value:function(){throw new Error("Subclasses of FluentType must implement valueOf.")}}]),t}(),et=function(t){function e(){return K(this,e),Z(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return X(e,t),B(e,[{key:"valueOf",value:function(){return this.value||"???"}}]),e}(tt),rt=function(t){function e(t,r){return K(this,e),Z(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,parseFloat(t),r))}return X(e,t),B(e,[{key:"valueOf",value:function(t){return t._memoizeIntlObject(Intl.NumberFormat,this.opts).format(this.value)}},{key:"match",value:function(t,r){return r instanceof e&&this.value===r.value}}]),e}(tt),nt=function(t){function e(t,r){return K(this,e),Z(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,new Date(t),r))}return X(e,t),B(e,[{key:"valueOf",value:function(t){return t._memoizeIntlObject(Intl.DateTimeFormat,this.opts).format(this.value)}}]),e}(tt),it=function(t){function e(){return K(this,e),Z(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return X(e,t),B(e,[{key:"valueOf",value:function(){return this.value}},{key:"match",value:function(t,r){if(r instanceof e)return this.value===r.value;if("string"==typeof r)return this.value===r;if(r instanceof rt){var n=t._memoizeIntlObject(Intl.PluralRules,r.opts);return this.value===n.select(r.value)}if(Array.isArray(r)){return r.map(function(t){return t.value}).includes(this.value)}return!1}}]),e}(tt),ot={NUMBER:function(t,e){var r=$(t,1),n=r[0];return new rt(n.value,s(n.opts,e))},DATETIME:function(t,e){var r=$(t,1),n=r[0];return new nt(n.value,s(n.opts,e))}},at=2500,st="",ut="",lt=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.functions,i=void 0===n?{}:n,o=r.useIsolating,a=void 0===o||o;K(this,t),this.locales=Array.isArray(e)?e:[e],this.functions=i,this.useIsolating=a,this.messages=new Map,this.intls=new WeakMap}return B(t,[{key:"addMessages",value:function(t){var e=a(t),r=$(e,2),n=r[0],i=r[1];for(var o in n)this.messages.set(o,n[o]);return i}},{key:"formatToParts",value:function(t,e,r){if("string"==typeof t)return[t];if("string"==typeof t.val)return[t.val];if(void 0===t.val)return null;var n=_(this,e,t,r);return n instanceof et?null:n}},{key:"format",value:function(t,e,r){var n=this;if("string"==typeof t)return t;if("string"==typeof t.val)return t.val;if(void 0===t.val)return null;var i=_(this,e,t,r);return i instanceof et?null:i.map(function(t){return t.valueOf(n)}).join("")}},{key:"_memoizeIntlObject",value:function(t,e){var r=this.intls.get(t)||{},n=JSON.stringify(e);return r[n]||(r[n]=new t(this.locales,e),this.intls.set(t,r)),r[n]}}]),t}(),ct={ar:"ar-arab-eg","az-arab":"az-arab-ir","az-ir":"az-arab-ir",be:"be-cyrl-by",da:"da-latn-dk",el:"el-grek-gr",en:"en-latn-us",fa:"fa-arab-ir",ja:"ja-jpan-jp",ko:"ko-kore-kr",pt:"pt-latn-br",sr:"sr-cyrl-rs","sr-ru":"sr-latn-ru",sv:"sv-latn-se",ta:"ta-taml-in",uk:"uk-cyrl-ua",zh:"zh-hans-cn","zh-gb":"zh-hant-gb","zh-us":"zh-hant-us"},ht=["az","bg","cs","de","es","fi","fr","hu","it","lt","lv","nl","pl","ro","ru"],ft=new RegExp("^([a-z]{2,3}|\\*)(?:-([a-z]{4}|\\*))?(?:-([a-z]{2}|\\*))?(?:-([a-z]{3}|\\*))?$","i"),vt=["language","script","region","variant"],dt=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];K(this,t);var n=ft.exec(e.replace(/_/g,"-"));if(n){var i=r?"*":void 0,o=n[1]||i,a=n[2]||i,s=n[3]||i,u=n[4]||i;this.language=o,this.script=a,this.region=s,this.variant=u,this.string=e}}return B(t,[{key:"isEqual",value:function(t){var e=this;return vt.every(function(r){return e[r]===t[r]})}},{key:"matches",value:function(t){var e=this;return vt.every(function(r){return"*"===e[r]||"*"===t[r]||void 0===e[r]&&void 0===t[r]||void 0!==e[r]&&void 0!==t[r]&&e[r].toLowerCase()===t[r].toLowerCase()})}},{key:"setVariantRange",value:function(){this.variant="*"}},{key:"setRegionRange",value:function(){this.region="*"}},{key:"addLikelySubtags",value:function(){var t=this,e=x(this.string.toLowerCase());return!!e&&(vt.forEach(function(r){return t[r]=e[r]}),this.string=e.string,!0)}}]),t}(),gt=function(t){function e(t,r,n){K(this,e);var i=Z(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return i.name="L10nError",i.message=t,i.id=r,i.lang=n,i}return X(e,t),e}(function(t){function e(){var e=Reflect.construct(t,Array.from(arguments));return Object.setPrototypeOf(e,Object.getPrototypeOf(this)),e}return e.prototype=Object.create(t.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t,e}(Error)),yt=new WeakMap,mt=new WeakMap,pt=function(){function t(e,r){K(this,t);var n=function(t){return A(r,t)};yt.set(this,{requestBundles:e,createHeadContext:n}),this.interactive=e().then(function(t){return n(t).then(function(){return t})})}return B(t,[{key:"requestLanguages",value:function(t){var e=yt.get(this),r=e.requestBundles,n=e.createHeadContext;return this.interactive=Promise.all([this.interactive,r(t)]).then(function(t){var e=$(t,2),r=e[0],i=e[1];return O(r,i)?r:n(i).then(function(){return i})})}},{key:"formatWithFallback",value:function(t,e,r,n,i){var o=this;if(!e)return i.translations;var a=C(n,this.sanitizeArgs,e,r,i);if("undefined"!=typeof console&&a.errors.forEach(function(t){return t?t.forEach(function(t){return console.warn(t)}):null}),!a.hasFatalErrors)return a.translations;var s=t.slice(1);return(0,yt.get(this).createHeadContext)(s).then(function(t){return o.formatWithFallback(s,t,r,n,a)})}},{key:"formatEntities",value:function(t){var e=this;return this.interactive.then(function(r){return e.formatWithFallback(r,mt.get(r[0]),t,e.entityFromContext)})}},{key:"formatValues",value:function(){for(var t=this,e=arguments.length,r=Array(e),n=0;n<e;n++)r[n]=arguments[n];var i=r.map(function(t){return Array.isArray(t)?t:[t,null]});return this.interactive.then(function(e){return t.formatWithFallback(e,mt.get(e[0]),i,t.valueFromContext)})}},{key:"formatValue",value:function(t,e){return this.formatValues([t,e]).then(function(t){return $(t,1)[0]})}},{key:"sanitizeArgs",value:function(t){return t}},{key:"entityFromContext",value:function(t,e,r,n){var i=t.messages.get(r);if(void 0===i)return e.push(new gt("Unknown entity: "+r)),{value:r,attrs:null};var o={value:t.format(i,n,e),attrs:null};if(i.attrs){o.attrs={};for(var a in i.attrs){var s=t.format(i.attrs[a],n,e);null!==s&&(o.attrs[a]=s)}}return o}},{key:"valueFromContext",value:function(t,e,r,n){var i=t.messages.get(r);return void 0===i?(e.push(new gt("Unknown entity: "+r)),r):t.format(i,n,e)}}]),t}(),bt=/<|&#?\w+;/,wt={"http://www.w3.org/1999/xhtml":["a","em","strong","small","s","cite","q","dfn","abbr","data","time","code","var","samp","kbd","sub","sup","i","b","u","mark","ruby","rt","rp","bdi","bdo","span","br","wbr"]},_t={"http://www.w3.org/1999/xhtml":{global:["title","aria-label","aria-valuetext","aria-moz-hint"],a:["download"],area:["download","alt"],input:["alt","placeholder"],menuitem:["label"],menu:["label"],optgroup:["label"],option:["label"],track:["label"],img:["alt"],textarea:["placeholder"],th:["abbr"]},"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul":{global:["accesskey","aria-label","aria-valuetext","aria-moz-hint","label"],key:["key","keycode"],textbox:["placeholder"],toolbarbutton:["tooltiptext"]}},xt={"&":"&","<":"<",">":">"},kt=function(t){function e(t,r,n,i){K(this,e);var o=Z(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r));return o.name=n,o.query="[data-l10n-with="+n+"]",o.roots=new Set,o.observer=i,o}return X(e,t),B(e,[{key:"handleEvent",value:function(){return this.requestLanguages()}},{key:"requestLanguages",value:function(t){var r=this;H(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"requestLanguages",this).call(this,t).then(function(){return r.translateRoots()})}},{key:"setAttributes",value:function(t,e,r){return t.setAttribute("data-l10n-id",e),r&&t.setAttribute("data-l10n-args",JSON.stringify(r)),t}},{key:"getAttributes",value:function(t){return{id:t.getAttribute("data-l10n-id"),args:JSON.parse(t.getAttribute("data-l10n-args"))}}},{key:"connectRoot",value:function(t){this.roots.add(t),this.observer&&this.observer.observeRoot(t)}},{key:"disconnectRoot",value:function(t){return this.roots.delete(t),this.observer&&this.observer.unobserveRoot(t),0===this.roots.size}},{key:"translateRoots",value:function(){var t=this,e=Array.from(this.roots);return Promise.all(e.map(function(e){return t.translateRoot(e)}))}},{key:"translateRoot",value:function(t){var e=this;return this.translateRootContent(t).then(function(){return e.interactive}).then(function(e){var r=e.map(function(t){return t.lang}),n=t.hasAttribute("langs");t.setAttribute("langs",r.join(" ")),t.setAttribute("lang",r[0]),t.setAttribute("dir",I(r[0])),n&&t.dispatchEvent(new CustomEvent("DOMRetranslated",{bubbles:!1,cancelable:!1}))})}},{key:"translateRootContent",value:function(t){var e=this,r=document.getAnonymousNodes?document.getAnonymousNodes(t):null;return r?Promise.all([t].concat(G(r)).map(function(t){return e.translateFragment(t)})):this.translateFragment(t)}},{key:"translateFragment",value:function(t){return this.translateElements(this.getTranslatables(t))}},{key:"translateElements",value:function(t){var e=this;if(!t.length)return Promise.resolve([]);var r=t.map(this.getKeysForElement);return this.formatEntities(r).then(function(r){return e.applyTranslations(t,r)})}},{key:"translateElement",value:function(t){var e=this;return this.formatEntities([this.getKeysForElement(t)]).then(function(r){return e.applyTranslations([t],r)})}},{key:"applyTranslations",value:function(t,e){this.observer&&this.observer.pauseObserving();for(var r=0;r<t.length;r++)N(t[r],e[r]);this.observer&&this.observer.resumeObserving()}},{key:"getTranslatables",value:function(t){var e=Array.from(t.querySelectorAll(this.query));if("function"==typeof t.hasAttribute&&t.hasAttribute("data-l10n-id")){t.getAttribute("data-l10n-with")===this.name&&e.push(t)}return e}},{key:"getKeysForElement",value:function(t){return[t.getAttribute("data-l10n-id"),JSON.parse(t.getAttribute("data-l10n-args")||null)]}},{key:"sanitizeArgs",value:function(t){for(var e in t){var r=t[e];"string"==typeof r&&(t[e]=r.replace(/[&<>]/g,function(t){return xt[t]}))}return t}}]),e}(pt),St=function(t){function e(t,r){K(this,e);var n=Z(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r,"main"));return n.query='[data-l10n-with="main"], [data-l10n-id]:not([data-l10n-with])',n.delegates=new Map,n.observer=n,n.observedRoots=new Set,n.mutationObserver=new MutationObserver(function(t){return n.translateMutations(t)}),n.observerConfig={attributes:!0,characterData:!1,childList:!0,subtree:!0,attributeFilter:["data-l10n-id","data-l10n-args","data-l10n-with"]},n}return X(e,t),B(e,[{key:"requestLanguages",value:function(t){var r=this,n=[H(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"requestLanguages",this).call(this,t)].concat(Array.from(this.delegates.values(),function(e){return e.requestLanguages(t)}));return Promise.all(n).then(function(){return r.translateDocument()})}},{key:"observeRoot",value:function(t){this.observedRoots.add(t),this.mutationObserver.observe(t,this.observerConfig)}},{key:"unobserveRoot",value:function(t){this.observedRoots.delete(t),this.pauseObserving(),this.resumeObserving()}},{key:"pauseObserving",value:function(){this.mutationObserver.disconnect()}},{key:"resumeObserving",value:function(){var t=!0,e=!1,r=void 0;try{for(var n,i=this.observedRoots[Symbol.iterator]();!(t=(n=i.next()).done);t=!0){var o=n.value;this.mutationObserver.observe(o,this.observerConfig)}}catch(t){e=!0,r=t}finally{try{!t&&i.return&&i.return()}finally{if(e)throw r}}}},{key:"translateMutations",value:function(t){var e=!0,r=!1,n=void 0;try{for(var i,o=t[Symbol.iterator]();!(e=(i=o.next()).done);e=!0){var a=i.value;switch(a.type){case"attributes":this.translateElement(a.target);break;case"childList":var s=!0,u=!1,l=void 0;try{for(var c,h=a.addedNodes[Symbol.iterator]();!(s=(c=h.next()).done);s=!0){var f=c.value;f.nodeType===f.ELEMENT_NODE&&(f.childElementCount?this.translateFragment(f):f.hasAttribute("data-l10n-id")&&this.translateElement(f))}}catch(t){u=!0,l=t}finally{try{!s&&h.return&&h.return()}finally{if(u)throw l}}}}}catch(t){r=!0,n=t}finally{try{!e&&o.return&&o.return()}finally{if(r)throw n}}}},{key:"translateDocument",value:function(){var t=[this].concat(G(this.delegates.values()));return Promise.all(t.map(function(t){return t.translateRoots()}))}},{key:"translateFragment",value:function(t){var r=[H(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"translateFragment",this).call(this,t)].concat(Array.from(this.delegates.values(),function(e){return e.translateFragment(t)}));return Promise.all(r)}},{key:"translateElement",value:function(t){var e=t.getAttribute("data-l10n-with"),r=void 0;if(e&&"main"!==e){if(!this.delegates.has(e)){var n=new gt("Unknown Localization: "+e+".");return Promise.reject(n)}r=this.delegates.get(e)}else r=this;return r.formatEntities([r.getKeysForElement(t)]).then(function(e){return r.applyTranslations([t],e)})}},{key:"getTranslatables",value:function(t){var e=Array.from(t.querySelectorAll(this.query));if("function"==typeof t.hasAttribute&&t.hasAttribute("data-l10n-id")){var r=t.getAttribute("data-l10n-with");r&&r!==this.name||e.push(t)}return e}}]),e}(kt),Et=200,At=function(){function t(e,r){K(this,t),this.lang=e,this.loaded=!1,this.resIds=r}return B(t,[{key:"fetch",value:function(){var t=this;return this.loaded||(this.loaded=Promise.all(this.resIds.map(function(e){return W(e,t.lang)}))),this.loaded}}]),t}(),Ot=function(t){var e=[],r=null,n=null,i=Array.from(t.querySelectorAll('meta[name="availableLanguages"],meta[name="defaultLanguage"],meta[name="appVersion"]')),o=!0,a=!1,s=void 0;try{for(var u,l=i[Symbol.iterator]();!(o=(u=l.next()).done);o=!0){var c=u.value,h=c.getAttribute("name"),f=c.getAttribute("content").trim();switch(h){case"availableLanguages":e=f.split(",").map(function(t){return t.trim()});break;case"defaultLanguage":r=f;break;case"appVersion":n=f}}}catch(t){a=!0,s=t}finally{try{!o&&l.return&&l.return()}finally{if(a)throw s}}return{defaultLang:r,availableLangs:e,appVersion:n}}(document.head),Ct=Ot.defaultLang,Lt=Ot.availableLangs;(function(t){return Array.prototype.map.call(t.querySelectorAll('link[rel="localization"]'),function(t){return[t.getAttribute("href"),t.getAttribute("name")||"main"]}).reduce(function(t,e){var r=$(e,2),n=r[0],i=r[1];return t.set(i,(t.get(i)||[]).concat(n))},new Map)})(document.head).forEach(function(t,e){return D(Ct,Lt,t,e)})}(); |