function G(t,e){var r=0,n,i;e=e||{};function c(){var o=n,l=arguments.length,d,u;t:for(;o;){if(o.args.length!==arguments.length){o=o.next;continue}for(u=0;u=0),f.type){case"b":s=parseInt(s,10).toString(2);break;case"c":s=String.fromCharCode(parseInt(s,10));break;case"d":case"i":s=parseInt(s,10);break;case"j":s=JSON.stringify(s,null,f.width?parseInt(f.width):0);break;case"e":s=f.precision?parseFloat(s).toExponential(f.precision):parseFloat(s).toExponential();break;case"f":s=f.precision?parseFloat(s).toFixed(f.precision):parseFloat(s);break;case"g":s=f.precision?String(Number(s.toPrecision(f.precision))):parseFloat(s);break;case"o":s=(parseInt(s,10)>>>0).toString(8);break;case"s":s=String(s),s=f.precision?s.substring(0,f.precision):s;break;case"t":s=String(!!s),s=f.precision?s.substring(0,f.precision):s;break;case"T":s=Object.prototype.toString.call(s).slice(8,-1).toLowerCase(),s=f.precision?s.substring(0,f.precision):s;break;case"u":s=parseInt(s,10)>>>0;break;case"v":s=s.valueOf(),s=f.precision?s.substring(0,f.precision):s;break;case"x":s=(parseInt(s,10)>>>0).toString(16);break;case"X":s=(parseInt(s,10)>>>0).toString(16).toUpperCase();break}e.json.test(f.type)?w+=s:(e.number.test(f.type)&&(!S||f.sign)?(a=S?"+":"-",s=s.toString().replace(e.sign,"")):a="",m=f.pad_char?f.pad_char==="0"?"0":f.pad_char.charAt(1):" ",E=f.width-(a+s).length,A=f.width&&E>0?m.repeat(E):"",w+=f.align?a+s+A:m==="0"?a+A+s:A+a+s)}return w}var c=Object.create(null);function o(l){if(c[l])return c[l];for(var d=l,u,_=[],s=0;d;){if((u=e.text.exec(d))!==null)_.push(u[0]);else if((u=e.modulo.exec(d))!==null)_.push("%");else if((u=e.placeholder.exec(d))!==null){if(u[2]){s|=1;var w=[],y=u[2],x=[];if((x=e.key.exec(y))!==null)for(w.push(x[1]);(y=y.substring(x[0].length))!=="";)if((x=e.key_access.exec(y))!==null)w.push(x[1]);else if((x=e.index_access.exec(y))!==null)w.push(x[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");u[2]=w}else s|=2;if(s===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");_.push({placeholder:u[0],param_no:u[1],keys:u[2],sign:u[3],pad_char:u[4],align:u[5],width:u[6],precision:u[7],type:u[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");d=d.substring(u[0].length)}return c[l]=_}t.sprintf=r,t.vsprintf=n,typeof window<"u"&&(window.sprintf=r,window.vsprintf=n)})()})(K);const q=J(K),B=G(console.error);function ut(t,...e){try{return q.sprintf(t,...e)}catch(r){return r instanceof Error&&B(`sprintf error: `+r.toString()),t}}var k,U,T,X;k={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1};U=["(","?"];T={")":["("],":":["?","?:"]};X=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;function Q(t){for(var e=[],r=[],n,i,c,o;n=t.match(X);){for(i=n[0],c=t.substr(0,n.index).trim(),c&&e.push(c);o=r.pop();){if(T[i]){if(T[i][0]===o){i=T[i][1]||i;break}}else if(U.indexOf(o)>=0||k[o]":function(t,e){return t>e},">=":function(t,e){return t>=e},"==":function(t,e){return t===e},"!=":function(t,e){return t!==e},"&&":function(t,e){return t&&e},"||":function(t,e){return t||e},"?:":function(t,e,r){if(t)throw e;return r}};function W(t,e){var r=[],n,i,c,o,l,d;for(n=0;n{const n=new j({}),i=new Set,c=()=>{i.forEach(a=>a())},o=a=>(i.add(a),()=>i.delete(a)),l=(a="default")=>n.data[a],d=(a,p="default")=>{var h;n.data[p]={...n.data[p],...a},n.data[p][""]={...H[""],...(h=n.data[p])==null?void 0:h[""]},delete n.pluralForms[p]},u=(a,p)=>{d(a,p),c()},_=(a,p="default")=>{var h;n.data[p]={...n.data[p],...a,"":{...H[""],...(h=n.data[p])==null?void 0:h[""],...a==null?void 0:a[""]}},delete n.pluralForms[p],c()},s=(a,p)=>{n.data={},n.pluralForms={},u(a,p)},w=(a="default",p,h,b,v)=>(n.data[a]||d(void 0,a),n.dcnpgettext(a,p,h,b,v)),y=(a="default")=>a,x=(a,p)=>{let h=w(p,void 0,a);return r?(h=r.applyFilters("i18n.gettext",h,a,p),r.applyFilters("i18n.gettext_"+y(p),h,a,p)):h},f=(a,p,h)=>{let b=w(h,p,a);return r?(b=r.applyFilters("i18n.gettext_with_context",b,a,p,h),r.applyFilters("i18n.gettext_with_context_"+y(h),b,a,p,h)):b},A=(a,p,h,b)=>{let v=w(b,void 0,a,p,h);return r?(v=r.applyFilters("i18n.ngettext",v,a,p,h,b),r.applyFilters("i18n.ngettext_"+y(b),v,a,p,h,b)):v},m=(a,p,h,b,v)=>{let F=w(v,b,a,p,h);return r?(F=r.applyFilters("i18n.ngettext_with_context",F,a,p,h,b,v),r.applyFilters("i18n.ngettext_with_context_"+y(v),F,a,p,h,b,v)):F},E=()=>f("ltr","text direction")==="rtl",S=(a,p,h)=>{var F,R;const b=p?p+""+a:a;let v=!!((R=(F=n.data)==null?void 0:F[h??"default"])!=null&&R[b]);return r&&(v=r.applyFilters("i18n.has_translation",v,a,p,h),v=r.applyFilters("i18n.has_translation_"+y(h),v,a,p,h)),v};if(t&&u(t,e),r){const a=p=>{et.test(p)&&c()};r.addAction("hookAdded","core/i18n",a),r.addAction("hookRemoved","core/i18n",a)}return{getLocaleData:l,setLocaleData:u,addLocaleData:_,resetLocaleData:s,subscribe:o,__:x,_x:f,_n:A,_nx:m,isRTL:E,hasTranslation:S}};function Z(t){return typeof t!="string"||t===""?(console.error("The namespace must be a non-empty string."),!1):/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(t)?!0:(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)}function L(t){return typeof t!="string"||t===""?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(t)?(console.error("The hook name cannot begin with `__`."),!1):/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(t)?!0:(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)}function P(t,e){return function(n,i,c,o=10){const l=t[e];if(!L(n)||!Z(i))return;if(typeof c!="function"){console.error("The hook callback must be a function.");return}if(typeof o!="number"){console.error("If specified, the hook priority must be a number.");return}const d={callback:c,priority:o,namespace:i};if(l[n]){const u=l[n].handlers;let _;for(_=u.length;_>0&&!(o>=u[_-1].priority);_--);_===u.length?u[_]=d:u.splice(_,0,d),l.__current.forEach(s=>{s.name===n&&s.currentIndex>=_&&s.currentIndex++})}else l[n]={handlers:[d],runs:0};n!=="hookAdded"&&t.doAction("hookAdded",n,i,c,o)}}function O(t,e,r=!1){return function(i,c){const o=t[e];if(!L(i)||!r&&!Z(c))return;if(!o[i])return 0;let l=0;if(r)l=o[i].handlers.length,o[i]={runs:o[i].runs,handlers:[]};else{const d=o[i].handlers;for(let u=d.length-1;u>=0;u--)d[u].namespace===c&&(d.splice(u,1),l++,o.__current.forEach(_=>{_.name===i&&_.currentIndex>=u&&_.currentIndex--}))}return i!=="hookRemoved"&&t.doAction("hookRemoved",i,c),l}}function I(t,e){return function(n,i){const c=t[e];return typeof i<"u"?n in c&&c[n].handlers.some(o=>o.namespace===i):n in c}}function z(t,e,r=!1){return function(i,...c){const o=t[e];o[i]||(o[i]={handlers:[],runs:0}),o[i].runs++;const l=o[i].handlers;if(!l||!l.length)return r?c[0]:void 0;const d={name:i,currentIndex:0};for(o.__current.push(d);d.currentIndex"u"?typeof i.__current[0]<"u":i.__current[0]?n===i.__current[0].name:!1}}function $(t,e){return function(n){const i=t[e];if(L(n))return i[n]&&i[n].runs?i[n].runs:0}}class rt{constructor(){this.actions=Object.create(null),this.actions.__current=[],this.filters=Object.create(null),this.filters.__current=[],this.addAction=P(this,"actions"),this.addFilter=P(this,"filters"),this.removeAction=O(this,"actions"),this.removeFilter=O(this,"filters"),this.hasAction=I(this,"actions"),this.hasFilter=I(this,"filters"),this.removeAllActions=O(this,"actions",!0),this.removeAllFilters=O(this,"filters",!0),this.doAction=z(this,"actions"),this.applyFilters=z(this,"filters",!0),this.currentAction=C(this,"actions"),this.currentFilter=C(this,"filters"),this.doingAction=M(this,"actions"),this.doingFilter=M(this,"filters"),this.didAction=$(this,"actions"),this.didFilter=$(this,"filters")}}function st(){return new rt}const it=st(),g=nt(void 0,void 0,it),ct=g.getLocaleData.bind(g),lt=g.setLocaleData.bind(g),ft=g.resetLocaleData.bind(g),pt=g.subscribe.bind(g),dt=g.__.bind(g),ht=g._x.bind(g),_t=g._n.bind(g),gt=g._nx.bind(g),yt=g.isRTL.bind(g),bt=g.hasTranslation.bind(g);export{dt as _,at as a,_t as b,ot as c,gt as d,ht as e,nt as f,J as g,g as h,yt as i,ct as j,bt as k,lt as l,pt as m,ft as r,ut as s};