관리-도구
편집 파일: default-i18n.bz7purh4.js
var ot=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function G(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ut(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var s=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:function(){return t[n]}})}),r}function J(t,e){var r=0,n,s;e=e||{};function a(){var o=n,l=arguments.length,d,c;t:for(;o;){if(o.args.length!==arguments.length){o=o.next;continue}for(c=0;c<l;c++)if(o.args[c]!==arguments[c]){o=o.next;continue t}return o!==n&&(o===s&&(s=o.prev),o.prev.next=o.next,o.next&&(o.next.prev=o.prev),o.next=n,o.prev=null,n.prev=o,n=o),o.val}for(d=new Array(l),c=0;c<l;c++)d[c]=arguments[c];return o={args:d,val:t.apply(null,d)},n?(n.prev=o,o.next=n):s=o,r===e.maxSize?(s=s.prev,s.next=null):r++,n=o,o.val}return a.clear=function(){n=null,s=null,r=0},a}var K={};(function(t){(function(){var e={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function r(l){return s(o(l),arguments)}function n(l,d){return r.apply(null,[l].concat(d||[]))}function s(l,d){var c=1,_=l.length,i,w="",y,x,f,A,m,E,S,u;for(y=0;y<_;y++)if(typeof l[y]=="string")w+=l[y];else if(typeof l[y]=="object"){if(f=l[y],f.keys)for(i=d[c],x=0;x<f.keys.length;x++){if(i==null)throw new Error(r('[sprintf] Cannot access property "%s" of undefined value "%s"',f.keys[x],f.keys[x-1]));i=i[f.keys[x]]}else f.param_no?i=d[f.param_no]:i=d[c++];if(e.not_type.test(f.type)&&e.not_primitive.test(f.type)&&i instanceof Function&&(i=i()),e.numeric_arg.test(f.type)&&typeof i!="number"&&isNaN(i))throw new TypeError(r("[sprintf] expecting number but found %T",i));switch(e.number.test(f.type)&&(S=i>=0),f.type){case"b":i=parseInt(i,10).toString(2);break;case"c":i=String.fromCharCode(parseInt(i,10));break;case"d":case"i":i=parseInt(i,10);break;case"j":i=JSON.stringify(i,null,f.width?parseInt(f.width):0);break;case"e":i=f.precision?parseFloat(i).toExponential(f.precision):parseFloat(i).toExponential();break;case"f":i=f.precision?parseFloat(i).toFixed(f.precision):parseFloat(i);break;case"g":i=f.precision?String(Number(i.toPrecision(f.precision))):parseFloat(i);break;case"o":i=(parseInt(i,10)>>>0).toString(8);break;case"s":i=String(i),i=f.precision?i.substring(0,f.precision):i;break;case"t":i=String(!!i),i=f.precision?i.substring(0,f.precision):i;break;case"T":i=Object.prototype.toString.call(i).slice(8,-1).toLowerCase(),i=f.precision?i.substring(0,f.precision):i;break;case"u":i=parseInt(i,10)>>>0;break;case"v":i=i.valueOf(),i=f.precision?i.substring(0,f.precision):i;break;case"x":i=(parseInt(i,10)>>>0).toString(16);break;case"X":i=(parseInt(i,10)>>>0).toString(16).toUpperCase();break}e.json.test(f.type)?w+=i:(e.number.test(f.type)&&(!S||f.sign)?(u=S?"+":"-",i=i.toString().replace(e.sign,"")):u="",m=f.pad_char?f.pad_char==="0"?"0":f.pad_char.charAt(1):" ",E=f.width-(u+i).length,A=f.width&&E>0?m.repeat(E):"",w+=f.align?u+i+A:m==="0"?u+A+i:A+u+i)}return w}var a=Object.create(null);function o(l){if(a[l])return a[l];for(var d=l,c,_=[],i=0;d;){if((c=e.text.exec(d))!==null)_.push(c[0]);else if((c=e.modulo.exec(d))!==null)_.push("%");else if((c=e.placeholder.exec(d))!==null){if(c[2]){i|=1;var w=[],y=c[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");c[2]=w}else i|=2;if(i===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");_.push({placeholder:c[0],param_no:c[1],keys:c[2],sign:c[3],pad_char:c[4],align:c[5],width:c[6],precision:c[7],type:c[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");d=d.substring(c[0].length)}return a[l]=_}t.sprintf=r,t.vsprintf=n,typeof window<"u"&&(window.sprintf=r,window.vsprintf=n)})()})(K);const q=G(K),B=J(console.error);function at(t,...e){try{return q.sprintf(t,...e)}catch(r){return r instanceof Error&&B(`sprintf error: `+r.toString()),t}}var k,U,O,X;k={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1};U=["(","?"];O={")":["("],":":["?","?:"]};X=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;function Q(t){for(var e=[],r=[],n,s,a,o;n=t.match(X);){for(s=n[0],a=t.substr(0,n.index).trim(),a&&e.push(a);o=r.pop();){if(O[s]){if(O[s][0]===o){s=O[s][1]||s;break}}else if(U.indexOf(o)>=0||k[o]<k[s]){r.push(o);break}e.push(o)}O[s]||r.push(s),t=t.substr(n.index+s.length)}return t=t.trim(),t&&e.push(t),e.concat(r.reverse())}var V={"!":function(t){return!t},"*":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){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){return t||e},"?:":function(t,e,r){if(t)throw e;return r}};function W(t,e){var r=[],n,s,a,o,l,d;for(n=0;n<t.length;n++){if(l=t[n],o=V[l],o){for(s=o.length,a=Array(s);s--;)a[s]=r.pop();try{d=o.apply(null,a)}catch(c){return c}}else e.hasOwnProperty(l)?d=e[l]:d=+l;r.push(d)}return r[0]}function Y(t){var e=Q(t);return function(r){return W(e,r)}}function N(t){var e=Y(t);return function(r){return+e({n:r})}}var H={contextDelimiter:"",onMissingKey:null};function tt(t){var e,r,n;for(e=t.split(";"),r=0;r<e.length;r++)if(n=e[r].trim(),n.indexOf("plural=")===0)return n.substr(7)}function D(t,e){var r;this.data=t,this.pluralForms={},this.options={};for(r in H)this.options[r]=e!==void 0&&r in e?e[r]:H[r]}D.prototype.getPluralForm=function(t,e){var r=this.pluralForms[t],n,s,a;return r||(n=this.data[t][""],a=n["Plural-Forms"]||n["plural-forms"]||n.plural_forms,typeof a!="function"&&(s=tt(n["Plural-Forms"]||n["plural-forms"]||n.plural_forms),a=N(s)),r=this.pluralForms[t]=a),r(e)};D.prototype.dcnpgettext=function(t,e,r,n,s){var a,o,l;return s===void 0?a=0:a=this.getPluralForm(t,s),o=r,e&&(o=e+this.options.contextDelimiter+r),l=this.data[t][o],l&&l[a]?l[a]:(this.options.onMissingKey&&this.options.onMissingKey(r,t),a===0?r:n)};const L={"":{plural_forms(t){return t===1?0:1}}},et=/^i18n\.(n?gettext|has_translation)(_|$)/,nt=(t,e,r)=>{const n=new D({}),s=new Set,a=()=>{s.forEach(u=>u())},o=u=>(s.add(u),()=>s.delete(u)),l=(u="default")=>n.data[u],d=(u,p="default")=>{var h;n.data[p]={...n.data[p],...u},n.data[p][""]={...L[""],...(h=n.data[p])==null?void 0:h[""]},delete n.pluralForms[p]},c=(u,p)=>{d(u,p),a()},_=(u,p="default")=>{var h;n.data[p]={...n.data[p],...u,"":{...L[""],...(h=n.data[p])==null?void 0:h[""],...u==null?void 0:u[""]}},delete n.pluralForms[p],a()},i=(u,p)=>{n.data={},n.pluralForms={},c(u,p)},w=(u="default",p,h,b,v)=>(n.data[u]||d(void 0,u),n.dcnpgettext(u,p,h,b,v)),y=(u="default")=>u,x=(u,p)=>{let h=w(p,void 0,u);return r?(h=r.applyFilters("i18n.gettext",h,u,p),r.applyFilters("i18n.gettext_"+y(p),h,u,p)):h},f=(u,p,h)=>{let b=w(h,p,u);return r?(b=r.applyFilters("i18n.gettext_with_context",b,u,p,h),r.applyFilters("i18n.gettext_with_context_"+y(h),b,u,p,h)):b},A=(u,p,h,b)=>{let v=w(b,void 0,u,p,h);return r?(v=r.applyFilters("i18n.ngettext",v,u,p,h,b),r.applyFilters("i18n.ngettext_"+y(b),v,u,p,h,b)):v},m=(u,p,h,b,v)=>{let F=w(v,b,u,p,h);return r?(F=r.applyFilters("i18n.ngettext_with_context",F,u,p,h,b,v),r.applyFilters("i18n.ngettext_with_context_"+y(v),F,u,p,h,b,v)):F},E=()=>f("ltr","text direction")==="rtl",S=(u,p,h)=>{var F,j;const b=p?p+""+u:u;let v=!!((j=(F=n.data)==null?void 0:F[h??"default"])!=null&&j[b]);return r&&(v=r.applyFilters("i18n.has_translation",v,u,p,h),v=r.applyFilters("i18n.has_translation_"+y(h),v,u,p,h)),v};if(r){const u=p=>{et.test(p)&&a()};r.addAction("hookAdded","core/i18n",u),r.addAction("hookRemoved","core/i18n",u)}return{getLocaleData:l,setLocaleData:c,addLocaleData:_,resetLocaleData:i,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 R(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,s,a,o=10){const l=t[e];if(!R(n)||!Z(s))return;if(typeof a!="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:a,priority:o,namespace:s};if(l[n]){const c=l[n].handlers;let _;for(_=c.length;_>0&&!(o>=c[_-1].priority);_--);_===c.length?c[_]=d:c.splice(_,0,d),l.__current.forEach(i=>{i.name===n&&i.currentIndex>=_&&i.currentIndex++})}else l[n]={handlers:[d],runs:0};n!=="hookAdded"&&t.doAction("hookAdded",n,s,a,o)}}function T(t,e,r=!1){return function(s,a){const o=t[e];if(!R(s)||!r&&!Z(a))return;if(!o[s])return 0;let l=0;if(r)l=o[s].handlers.length,o[s]={runs:o[s].runs,handlers:[]};else{const d=o[s].handlers;for(let c=d.length-1;c>=0;c--)d[c].namespace===a&&(d.splice(c,1),l++,o.__current.forEach(_=>{_.name===s&&_.currentIndex>=c&&_.currentIndex--}))}return s!=="hookRemoved"&&t.doAction("hookRemoved",s,a),l}}function I(t,e){return function(n,s){const a=t[e];return typeof s<"u"?n in a&&a[n].handlers.some(o=>o.namespace===s):n in a}}function z(t,e,r=!1){return function(s,...a){const o=t[e];o[s]||(o[s]={handlers:[],runs:0}),o[s].runs++;const l=o[s].handlers;if(!l||!l.length)return r?a[0]:void 0;const d={name:s,currentIndex:0};for(o.__current.push(d);d.currentIndex<l.length;){const _=l[d.currentIndex].callback.apply(null,a);r&&(a[0]=_),d.currentIndex++}if(o.__current.pop(),r)return a[0]}}function C(t,e){return function(){var a;var n;const s=t[e];return(n=(a=s.__current[s.__current.length-1])==null?void 0:a.name)!==null&&n!==void 0?n:null}}function M(t,e){return function(n){const s=t[e];return typeof n>"u"?typeof s.__current[0]<"u":s.__current[0]?n===s.__current[0].name:!1}}function $(t,e){return function(n){const s=t[e];if(R(n))return s[n]&&s[n].runs?s[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=T(this,"actions"),this.removeFilter=T(this,"filters"),this.hasAction=I(this,"actions"),this.hasFilter=I(this,"filters"),this.removeAllActions=T(this,"actions",!0),this.removeAllFilters=T(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 it(){return new rt}const st=it(),g=nt(void 0,void 0,st);g.getLocaleData.bind(g);const ct=g.setLocaleData.bind(g);g.resetLocaleData.bind(g);g.subscribe.bind(g);const lt=g.__.bind(g);g._x.bind(g);const ft=g._n.bind(g);g._nx.bind(g);const pt=g.isRTL.bind(g);g.hasTranslation.bind(g);export{lt as _,ft as a,ct as b,ot as c,ut as d,G as g,pt as i,at as s};