Files
korean_comments_action/js/korean_comments_action-main.mjs
T

36 lines
351 KiB
JavaScript
Raw Normal View History

2026-09-19 09:45:20 +00:00
var Oe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Qo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function El(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ku={exports:{}},Xt=ku.exports={},Le,Be;function Mo(){throw new Error("setTimeout has not been defined")}function To(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Le=setTimeout:Le=Mo}catch{Le=Mo}try{typeof clearTimeout=="function"?Be=clearTimeout:Be=To}catch{Be=To}})();function $u(e){if(Le===setTimeout)return setTimeout(e,0);if((Le===Mo||!Le)&&setTimeout)return Le=setTimeout,setTimeout(e,0);try{return Le(e,0)}catch{try{return Le.call(null,e,0)}catch{return Le.call(this,e,0)}}}function _l(e){if(Be===clearTimeout)return clearTimeout(e);if((Be===To||!Be)&&clearTimeout)return Be=clearTimeout,clearTimeout(e);try{return Be(e)}catch{try{return Be.call(null,e)}catch{return Be.call(this,e)}}}var Te=[],un=!1,qe,Hn=-1;function Al(){!un||!qe||(un=!1,qe.length?Te=qe.concat(Te):Hn=-1,Te.length&&Fu())}function Fu(){if(!un){var e=$u(Al);un=!0;for(var t=Te.length;t;){for(qe=Te,Te=[];++Hn<t;)qe&&qe[Hn].run();Hn=-1,t=Te.length}qe=null,un=!1,_l(e)}}Xt.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];Te.push(new Gu(e,t)),Te.length===1&&!un&&$u(Fu)};function Gu(e,t){this.fun=e,this.array=t}Gu.prototype.run=function(){this.fun.apply(null,this.array)},Xt.title="browser",Xt.browser=!0,Xt.env={},Xt.argv=[],Xt.version="",Xt.versions={};function De(){}Xt.on=De,Xt.addListener=De,Xt.once=De,Xt.off=De,Xt.removeListener=De,Xt.removeAllListeners=De,Xt.emit=De,Xt.prependListener=De,Xt.prependOnceListener=De,Xt.listeners=function(e){return[]},Xt.binding=function(e){throw new Error("process.binding is not supported")},Xt.cwd=function(){return"/"},Xt.chdir=function(e){throw new Error("process.chdir is not supported")},Xt.umask=function(){return 0};var Sl=ku.exports;const vt=El(Sl);var fr,js;function Ou(){if(js)return fr;js=1;var e={};return fr=typeof vt=="object"&&e&&e.NODE_DEBUG&&/\bsemver\b/i.test(e.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{},fr}var hr,Ds;function Vu(){if(Ds)return hr;Ds=1;const e="2.0.0",t=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,r=16,o=t-6;return hr={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:o,MAX_SAFE_INTEGER:n,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},hr}var pr={exports:{}},Ms;function Nl(){return Ms||(Ms=1,(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:o}=Vu(),s=Ou();t=e.exports={};const u=t.re=[],i=t.safeRe=[],f=t.src=[],h=t.safeSrc=[],a=t.t={};let p=0;const d="[a-zA-Z0-9-]",I=[["\\s",1],["\\d",o],[d,r]],S=R=>{for(const[v,E]of I)R=R.split(`${v}*`).join(`${v}{0,${E}}`).split(`${v}+`).join(`${v}{1,${E}}`);return R},w=(R,v,E)=>{const x=S(v),N=p++;s(R,N,v),a[R]=N,f[N]=v,h[N]=x,u[N]=new RegExp(v,E?"g":void 0),i[N]=new RegExp(x,E?"g":void 0)};w("NUMERICIDENTIFIER","0|[1-9]\\d*"),w("NUMERICIDENTIFIERLOOSE","\\d+"),w("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),w("MAINVERSION",`(${f[a.NUMERICIDENTIFIER]})\\.(${f[a.NUMERICIDENTIFIER]})\\.(${f[a.NUMERICIDENTIFIER]})`),w("MAINVERSIONLOOSE",`(${f[a.NUMERICIDENTIFIERLOOSE]})\\.(${f[a.NUMERICIDENTIFIERLOOSE]})\\.(${f[a.NUMERICIDENTIFIERLOOSE]})`),w("PRERELEASEIDENTIFIER",`(?:${f[a.NONNUMERICIDENTIFIER]}|${f[a.NUMERICIDENTIFIER]})`),w("PRERELEASEIDENTIFIERLOOSE",`(?:${f[a.NONNUMERICIDENTIFIER]}|${f[a.NUMERICIDENTIFIERLOOSE]})`),w("PRERELEASE",`(?:-(${f[a.PRERELEASEIDENTIFIER]}(?:\\.${f[a.PRERELEASEIDENTIFIER]})*))`),w("PRERELEASELOOSE",`(?:-?(${f[a.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${f[a.PRERELEASEIDENTIFIERLOOSE]})*))`),w("BUILDIDENTIFIER",`${d}+`),w("BUILD",`(?:\\+(${f[a.BUILDIDENTIFIER]}(?:\\.${f[a.BUILDIDENTIFIER]})*))`),w("FULLPLAIN",`v?${f[a.MAINVERSION]}${f[a.P
Stack trace:
2026-09-19 09:45:20 +00:00
${t.stack}`),o)}log(t,n,r){if(!(typeof this.context?.level=="number"&&t<this.context?.level))switch(typeof n=="object"&&r?.error===void 0&&(r.error=n),t){case qt.Debug:console.debug(this.formatMessage(n,qt.Debug,r),r);break;case qt.Info:console.info(this.formatMessage(n,qt.Info,r),r);break;case qt.Warn:console.warn(this.formatMessage(n,qt.Warn,r),r);break;case qt.Error:console.error(this.formatMessage(n,qt.Error,r),r);break;case qt.Fatal:default:console.error(this.formatMessage(n,qt.Fatal,r),r);break}}debug(t,n){this.log(qt.Debug,t,Object.assign({},this.context,n))}info(t,n){this.log(qt.Info,t,Object.assign({},this.context,n))}warn(t,n){this.log(qt.Warn,t,Object.assign({},this.context,n))}error(t,n){this.log(qt.Error,t,Object.assign({},this.context,n))}fatal(t,n){this.log(qt.Fatal,t,Object.assign({},this.context,n))}}function Jl(e){return new Xl(e)}class ql{context;factory;constructor(t){this.context={},this.factory=t}setApp(t){return this.context.app=t,this}setLogLevel(t){return this.context.level=t,this}setUid(t){return this.context.uid=t,this}detectUser(){const t=Ko();return t!==null&&(this.context.uid=t.uid),this}detectLogLevel(){const t=this,n=()=>{document.readyState==="complete"||document.readyState==="interactive"?(t.context.level=window._oc_config?.loglevel??qt.Warn,window._oc_debug&&(t.context.level=qt.Debug),document.removeEventListener("readystatechange",n)):document.addEventListener("readystatechange",n)};return n(),this}build(){return this.context.level===void 0&&this.detectLogLevel(),this.factory(this.context)}}function Ql(){return new ql(Jl)}function zs(e){return e&&e.split("/").map(encodeURIComponent).join("/")}function Xu(e,t){return e=e.replace(/\\/g,"/").replace(/\/+$/g,"").replace(/.*\//,""),e}function Ws(e){e=e.replaceAll(/\\/g,"/");const t=e.split("/");return t.length<=1?".":(t.pop(),t.length===1&&t[0]===""?"/":t.join("/"))}function Zl(e){const t=Xu(e),n=t.lastIndexOf(".");return n>0?t.substring(n):""}function Kl(...e){if(arguments.length<1)return"";const t=e.filter(f=>f.length>0);if(t.length<1)return"";const n=t[t.length-1],r=t[0].charAt(0)==="/",o=n.charAt(n.length-1)==="/",s=t.reduce((f,h)=>f.concat(h.split("/")),[]);let u=!r;const i=s.reduce((f,h)=>h===""?f:u?(u=!1,f+h):f+"/"+h,"");return o?i+"/":i}window._nc_files_scope??={},window._nc_files_scope.v4_0??={};const Ot=window._nc_files_scope.v4_0,Ge=Ql().setApp("@nextcloud/files").detectUser().build(),Ju=Object.freeze({Folder:"folder",File:"file"}),Ee=Object.freeze({NONE:0,READ:1,UPDATE:2,CREATE:4,WRITE:4,DELETE:8,SHARE:16,ALL:31}),qu=Object.freeze({NEW:"new",FAILED:"failed",LOADING:"loading",LOCKED:"locked"});function Qu(e,t){return e.match(t)!==null}function ke(e,t){if(e.id&&typeof e.id!="number"&&typeof e.id!="string")throw new Error("Invalid id type of value");if(!e.source)throw new Error("Missing mandatory source");try{new URL(e.source)}catch{throw new Error("Invalid source format, source must be a valid URL")}if(!e.source.startsWith("http"))throw new Error("Invalid source format, only http(s) is supported");if(!e.root)throw new Error("Missing mandatory root");if(typeof e.root!="string")throw new Error("Invalid root type");if(!e.root.startsWith("/"))throw new Error("Root must start with a leading slash");if(!e.source.includes(e.root))throw new Error("Root must be part of the source");if(Qu(e.source,t)){const n=e.source.match(t)[0];if(!e.source.includes(Kl(n,e.root)))throw new Error("The root must be relative to the service. e.g /files/emma")}if(e.displayname&&typeof e.displayname!="string")throw new Error("Invalid displayname type");if(e.mtime&&!(e.mtime instanceof Date))throw new Error("Invalid mtime type");if(e.crtime&&!(e.crtime instanceof Date))throw new Error("Invalid crtime type");if(!e.mime||typeof e.mime!="string"||!e.mime.match(/^[-\w.]+\/[-+\w.]+$/gi))throw new Error("Missing or invalid mandatory mime");if("size"in e&&typeof e.size!="number"&&e.size!==void 0)throw new Error("Invalid size type");if("permissions"in e&&e.permissions!==void 0&&!(typeof e.permissions=="number"&&e.permissions>=Ee.NONE&&e.permissions<=Ee.ALL))throw new E
`)>-1&&(K?st=st.split(`
`).map(function(B){return" "+B}).join(`
`).slice(2):st=`
`+st.split(`
`).map(function(B){return" "+B}).join(`
`))):st=z.stylize("[Circular]","special")),O(nt)){if(K&&Y.match(/^\d+$/))return st;nt=JSON.stringify(""+Y),nt.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(nt=nt.slice(1,-1),nt=z.stylize(nt,"name")):(nt=nt.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),nt=z.stylize(nt,"string"))}return nt+": "+st}function R(z,H,Q){var T=z.reduce(function(Y,K){return K.indexOf(`
`)>=0,Y+K.replace(/\u001b\[\d\d?m/g,"").length+1},0);return T>60?Q[0]+(H===""?"":H+`
`)+" "+z.join(`,
`)+" "+Q[1]:Q[0]+H+" "+z.join(", ")+" "+Q[1]}e.types=Hf();function v(z){return Array.isArray(z)}e.isArray=v;function E(z){return typeof z=="boolean"}e.isBoolean=E;function x(z){return z===null}e.isNull=x;function N(z){return z==null}e.isNullOrUndefined=N;function P(z){return typeof z=="number"}e.isNumber=P;function M(z){return typeof z=="string"}e.isString=M;function F(z){return typeof z=="symbol"}e.isSymbol=F;function O(z){return z===void 0}e.isUndefined=O;function q(z){return j(z)&&At(z)==="[object RegExp]"}e.isRegExp=q,e.types.isRegExp=q;function j(z){return typeof z=="object"&&z!==null}e.isObject=j;function ct(z){return j(z)&&At(z)==="[object Date]"}e.isDate=ct,e.types.isDate=ct;function G(z){return j(z)&&(At(z)==="[object Error]"||z instanceof Error)}e.isError=G,e.types.isNativeError=G;function rt(z){return typeof z=="function"}e.isFunction=rt;function pt(z){return z===null||typeof z=="boolean"||typeof z=="number"||typeof z=="string"||typeof z=="symbol"||typeof z>"u"}e.isPrimitive=pt,e.isBuffer=Xf();function At(z){return Object.prototype.toString.call(z)}function Et(z){return z<10?"0"+z.toString(10):z.toString(10)}var lt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function mt(){var z=new Date,H=[Et(z.getHours()),Et(z.getMinutes()),Et(z.getSeconds())].join(":");return[z.getDate(),lt[z.getMonth()],H].join(" ")}e.log=function(){console.log("%s - %s",mt(),e.format.apply(e,arguments))},e.inherits=Qe(),e._extend=function(z,H){if(!H||!j(H))return z;for(var Q=Object.keys(H),T=Q.length;T--;)z[Q[T]]=H[Q[T]];return z};function Nt(z,H){return Object.prototype.hasOwnProperty.call(z,H)}var yt=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;e.promisify=function(z){if(typeof z!="function")throw new TypeError('The "original" argument must be of type Function');if(yt&&z[yt]){var H=z[yt];if(typeof H!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(H,yt,{value:H,enumerable:!1,writable:!1,configurable:!0}),H}function H(){for(var Q,T,Y=new Promise(function(st,L){Q=st,T=L}),K=[],nt=0;nt<arguments.length;nt++)K.push(arguments[nt]);K.push(function(st,L){st?T(st):Q(L)});try{z.apply(this,K)}catch(st){T(st)}return Y}return Object.setPrototypeOf(H,Object.getPrototypeOf(z)),yt&&Object.defineProperty(H,yt,{value:H,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(H,n(z))},e.promisify.custom=yt;function Tt(z,H){if(!z){var Q=new Error("Promise was rejected with a falsy value");Q.reason=z,z=Q}return H(z)}function ft(z){if(typeof z!="function")throw new TypeError('The "original" argument must be of type Function');function H(){for(var Q=[],T=0;T<arguments.length;T++)Q.push(arguments[T]);var Y=Q.pop();if(typeof Y!="function")throw new TypeError("The last argument must be of type Function");var K=this,nt=function(){return Y.apply(K,arguments)};z.apply(this,Q).then(function(st){vt.nextTick(nt.bind(null,null,st))},function(st){vt.nextTick(Tt.bind(null,st,nt))})}return Object.setPrototypeOf(H,Object.getPrototypeOf(z)),Object.defineProperties(H,n(z)),H}e.callbackify=ft})(Ks)),Ks}var Qr,Ii;function Jf(){if(Ii)return Qr;Ii=1;function e(S,w){var R=Object.keys(S);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(S);w&&(v=v.filter(function(E){return Object.getOwnPropertyDescriptor(S,E).enumerable})),R.push.apply(R,v)}return R}function t(S){for(var w=1;w<arguments.length;w++){var R=arguments[w]!=null?arguments[w]:{};w%2?e(Object(R),!0).forEach(function(v){n(S,v,R[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(S,Object.getOwnPropertyDescriptors(R)):e(Object(R)).forEach(function(v){Object.defineProperty(S,v,Object.getOwnPropertyDescriptor(R,v))})}return S}function n(S,w,R){return w=u(w),w in S?Object.defineProperty(S,w,{value:R,enumerable:!0,configurable:!0,writable:!0}):S[w]=R,S}function r(S,w){if(!(S instanceof w))throw new TypeError("Cannot call a class as a function")}function o(S,w){for(var R=0;R<w.length;R++){var v=w[R];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writabl
`||b==="\r"||b===" "}function M(b){return b==='"'||b==="'"}function F(b){return b===">"||P(b)}function O(b,y){return b.test(y)}function q(b,y){return!O(b,y)}var j=0;t.STATE={BEGIN:j++,BEGIN_WHITESPACE:j++,TEXT:j++,TEXT_ENTITY:j++,OPEN_WAKA:j++,SGML_DECL:j++,SGML_DECL_QUOTED:j++,DOCTYPE:j++,DOCTYPE_QUOTED:j++,DOCTYPE_DTD:j++,DOCTYPE_DTD_QUOTED:j++,COMMENT_STARTING:j++,COMMENT:j++,COMMENT_ENDING:j++,COMMENT_ENDED:j++,CDATA:j++,CDATA_ENDING:j++,CDATA_ENDING_2:j++,PROC_INST:j++,PROC_INST_BODY:j++,PROC_INST_ENDING:j++,OPEN_TAG:j++,OPEN_TAG_SLASH:j++,ATTRIB:j++,ATTRIB_NAME:j++,ATTRIB_NAME_SAW_WHITE:j++,ATTRIB_VALUE:j++,ATTRIB_VALUE_QUOTED:j++,ATTRIB_VALUE_CLOSED:j++,ATTRIB_VALUE_UNQUOTED:j++,ATTRIB_VALUE_ENTITY_Q:j++,ATTRIB_VALUE_ENTITY_U:j++,CLOSE_TAG:j++,CLOSE_TAG_SAW_WHITE:j++,SCRIPT:j++,SCRIPT_ENDING:j++},t.XML_ENTITIES=Object.assign(Object.create(null),{amp:"&",gt:">",lt:"<",quot:'"',apos:"'"}),t.ENTITIES=Object.assign(Object.create(null),{amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830}),Object.keys(t.ENTITIES).forEach(function(b){var y=t.ENTITIES[b],k=typeof y=="number"?String.fromCharCode(y):y;t.ENTITIES[b]=k});for(var ct in t.STATE)t.STATE[t.STATE[ct]]=ct;j=t.STATE;function G(b,y,k){b[y]&&b[y](k)}function rt(b){var y=b&&b.match(/(?:^|\s)encoding\s*=\s*(['"])([^'"]+)\1/i);return y?y[2]:null}function pt(b){return b?b.toLowerCase().replace(/[^a-z0-9]/g,""):null}function At(b,y){const k=pt(b),D=pt(y);return!k||!D?!0:D==="utf16"?k==="utf16le"||k==="utf16be":k===D}function Et(b,y){if(!(!b.strict||!b.encoding||!y||y.name!=="xml")){var k=rt(y.body);k&&!At(b.encoding,k)&&ft(b,"XML declaration enco
Line: `+b.line+`
Column: `+b.column+`
Char: `+b.c),y=new Error(y),b.error=y,G(b,"onerror",y),b}function Tt(b){return b.sawRoot&&!b.closedRoot&&ft(b,"Unclosed root tag"),b.state!==j.BEGIN&&b.state!==j.BEGIN_WHITESPACE&&b.state!==j.TEXT&&yt(b,"Unexpected end"),mt(b),b.c="",b.closed=!0,G(b,"onend"),r.call(b,b.strict,b.opt),b}function ft(b,y){if(typeof b!="object"||!(b instanceof r))throw new Error("bad call to strictFail");b.strict&&yt(b,y)}function z(b){b.strict||(b.tagName=b.tagName[b.looseCase]());var y=b.tags[b.tags.length-1]||b,k=b.tag={name:b.tagName,attributes:{}};b.opt.xmlns&&(k.ns=y.ns),b.attribList.length=0,lt(b,"onopentagstart",k)}function H(b,y){var k=b.indexOf(":"),D=k<0?["",b]:b.split(":"),ot=D[0],_t=D[1];return y&&b==="xmlns"&&(ot="xmlns",_t=""),{prefix:ot,local:_t}}function Q(b){if(b.strict||(b.attribName=b.attribName[b.looseCase]()),b.attribList.indexOf(b.attribName)!==-1||b.tag.attributes.hasOwnProperty(b.attribName)){b.attribName=b.attribValue="";return}if(b.opt.xmlns){var y=H(b.attribName,!0),k=y.prefix,D=y.local;if(k==="xmlns")if(D==="xml"&&b.attribValue!==S)ft(b,"xml: prefix must be bound to "+S+`
Actual: `+b.attribValue);else if(D==="xmlns"&&b.attribValue!==w)ft(b,"xmlns: prefix must be bound to "+w+`
Actual: `+b.attribValue);else{var ot=b.tag,_t=b.tags[b.tags.length-1]||b;ot.ns===_t.ns&&(ot.ns=Object.create(_t.ns)),ot.ns[D]=b.attribValue}b.attribList.push([b.attribName,b.attribValue])}else b.tag.attributes[b.attribName]=b.attribValue,lt(b,"onattribute",{name:b.attribName,value:b.attribValue});b.attribName=b.attribValue=""}function T(b,y){if(b.opt.xmlns){var k=b.tag,D=H(b.tagName);k.prefix=D.prefix,k.local=D.local,k.uri=k.ns[D.prefix]||"",k.prefix&&!k.uri&&(ft(b,"Unbound namespace prefix: "+JSON.stringify(b.tagName)),k.uri=D.prefix);var ot=b.tags[b.tags.length-1]||b;k.ns&&ot.ns!==k.ns&&Object.keys(k.ns).forEach(function(Pt){lt(b,"onopennamespace",{prefix:Pt,uri:k.ns[Pt]})});for(var _t=0,X=b.attribList.length;_t<X;_t++){var wt=b.attribList[_t],Bt=wt[0],dt=wt[1],gt=H(Bt,!0),Ut=gt.prefix,Wt=gt.local,ne=Ut===""?"":k.ns[Ut]||"",$t={name:Bt,value:dt,prefix:Ut,local:Wt,uri:ne};Ut&&Ut!=="xmlns"&&!ne&&(ft(b,"Unbound namespace prefix: "+JSON.stringify(Ut)),$t.uri=Ut),b.tag.attributes[Bt]=$t,lt(b,"onattribute",$t)}b.attribList.length=0}b.tag.isSelfClosing=!!y,b.sawRoot=!0,b.tags.push(b.tag),lt(b,"onopentag",b.tag),y||(!b.noscript&&b.tagName.toLowerCase()==="script"?b.state=j.SCRIPT:b.state=j.TEXT,b.tag=null,b.tagName=""),b.attribName=b.attribValue="",b.attribList.length=0}function Y(b){if(!b.tagName){ft(b,"Weird empty close tag."),b.textNode+="</>",b.state=j.TEXT;return}if(b.script){if(b.tagName!=="script"){b.script+="</"+b.tagName+">",b.tagName="",b.state=j.SCRIPT;return}lt(b,"onscript",b.script),b.script=""}var y=b.tags.length,k=b.tagName;b.strict||(k=k[b.looseCase]());for(var D=k;y--;){var ot=b.tags[y];if(ot.name!==D)ft(b,"Unexpected close tag");else break}if(y<0){ft(b,"Unmatched closing tag: "+b.tagName),b.textNode+="</"+b.tagName+">",b.state=j.TEXT;return}b.tagName=k;for(var _t=b.tags.length;_t-- >y;){var X=b.tag=b.tags.pop();b.tagName=b.tag.name,lt(b,"onclosetag",b.tagName);var wt={};for(var Bt in X.ns)wt[Bt]=X.ns[Bt];var dt=b.tags[b.tags.length-1]||b;b.opt.xmlns&&X.ns!==dt.ns&&Object.keys(X.ns).forEach(function(gt){var Ut=X.ns[gt];lt(b,"onclosenamespace",{prefix:gt,uri:Ut})})}y===0&&(b.closedRoot=!0),b.tagName=b.attribValue=b.attribName="",b.attribList.length=0,b.state=j.TEXT}function K(b){var y=b.entity,k=y.toLowerCase(),D,ot="";return b.ENTITIES[y]?b.ENTITIES[y]:b.ENTITIES[k]?b.ENTITIES[k]:(y=k,y.charAt(0)==="#"&&(y.charAt(1)==="x"?(y=y.slice(2),D=parseInt(y,16),ot=D.toString(16)):(y=y.slice(1),D=parseInt(y,10),ot=D.toString(10))),y=y.replace(/^0+/,""),isNaN(D)||ot.toLowerCase()!==y||D<0||D>1114111||!nt(D)?(ft(b,"Invalid character entity"),"&"+b.entity+";"):String.fromCodePoint(D))}function nt(b){return b===9||b===10||b===13||b>=32&&b<=55295||b>=57344&&b<=65533||b>=65536&&b<=1114111}function st(b,y){y==="<"?(b.state=j.OPEN_WAKA,b.startTagPosition=b.position):P(y)||(ft(b,"Non-whitespace before first tag."),b.textNode=y,b.state=j.TEXT)}function L(b,y){var k="";return y<b.length&&(k=b.charAt(y)),k}function B(b){var y=this;if(this.error)throw this.error;if(y.closed)return yt(y,"Cannot write after close. Assign an onready handler.");if(b===null)return Tt(y);typeof b=="object"&&(b=b.toString());for(var k=0,D="";D=L(b,k++),y.c=D,!!D;)switch(y.trackPosition&&(y.position++,D===`
`?(y.line++,y.column=0):y.column++),y.state){case j.BEGIN:if(y.state=j.BEGIN_WHITESPACE,D==="\uFEFF")continue;st(y,D);continue;case j.BEGIN_WHITESPACE:st(y,D);continue;case j.TEXT:if(y.sawRoot&&!y.closedRoot){for(var ot=k-1;D&&D!=="<"&&D!=="&";)D=L(b,k++),D&&y.trackPosition&&(y.position++,D===`
`?(y.line++,y.column=0):y.column++);y.textNode+=b.substring(ot,k-1)}D==="<"&&!(y.sawRoot&&y.closedRoot&&!y.strict)?(y.state=j.OPEN_WAKA,y.startTagPosition=y.position):(!P(D)&&(!y.sawRoot||y.closedRoot)&&ft(y,"Text data outside of root node."),D==="&"?y.state=j.TEXT_ENTITY:y.textNode+=D);continue;case j.SCRIPT:D==="<"?y.state=j.SCRIPT_ENDING:y.script+=D;continue;case j.SCRIPT_ENDING:D==="/"?y.state=j.CLOSE_TAG:(y.script+="<"+D,y.state=j.SCRIPT);continue;case j.OPEN_WAKA:if(D==="!")y.state=j.SGML_DECL,y.sgmlDecl="";else if(!P(D))if(O(v,D))y.state=j.OPEN_TAG,y.tagName=D;else if(D==="/")y.state=j.CLOSE_TAG,y.tagName="";else if(D==="?")y.state=j.PROC_INST,y.procInstName=y.procInstBody="";else{if(ft(y,"Unencoded <"),y.startTagPosition+1<y.position){var _t=y.position-y.startTagPosition;D=new Array(_t).join(" ")+D}y.textNode+="<"+D,y.state=j.TEXT}continue;case j.SGML_DECL:if(y.sgmlDecl+D==="--"){y.state=j.COMMENT,y.comment="",y.sgmlDecl="";continue}y.doctype&&y.doctype!==!0&&y.sgmlDecl?(y.state=j.DOCTYPE_DTD,y.doctype+="<!"+y.sgmlDecl+D,y.sgmlDecl=""):d.test(y.sgmlDecl+D)?(lt(y,"onopencdata"),y.state=j.CDATA,y.sgmlDecl="",y.cdata=""):I.test(y.sgmlDecl+D)?(y.state=j.DOCTYPE,(y.doctype||y.sawRoot)&&ft(y,"Inappropriately located doctype declaration"),y.doctype="",y.sgmlDecl=""):D===">"?(lt(y,"onsgmldeclaration",y.sgmlDecl),y.sgmlDecl="",y.state=j.TEXT):(M(D)&&(y.state=j.SGML_DECL_QUOTED),y.sgmlDecl+=D);continue;case j.SGML_DECL_QUOTED:D===y.q&&(y.state=j.SGML_DECL,y.q=""),y.sgmlDecl+=D;continue;case j.DOCTYPE:D===">"?(y.state=j.TEXT,lt(y,"ondoctype",y.doctype),y.doctype=!0):(y.doctype+=D,D==="["?y.state=j.DOCTYPE_DTD:M(D)&&(y.state=j.DOCTYPE_QUOTED,y.q=D));continue;case j.DOCTYPE_QUOTED:y.doctype+=D,D===y.q&&(y.q="",y.state=j.DOCTYPE);continue;case j.DOCTYPE_DTD:D==="]"?(y.doctype+=D,y.state=j.DOCTYPE):D==="<"?(y.state=j.OPEN_WAKA,y.startTagPosition=y.position):M(D)?(y.doctype+=D,y.state=j.DOCTYPE_DTD_QUOTED,y.q=D):y.doctype+=D;continue;case j.DOCTYPE_DTD_QUOTED:y.doctype+=D,D===y.q&&(y.state=j.DOCTYPE_DTD,y.q="");continue;case j.COMMENT:D==="-"?y.state=j.COMMENT_ENDING:y.comment+=D;continue;case j.COMMENT_ENDING:D==="-"?(y.state=j.COMMENT_ENDED,y.comment=Nt(y.opt,y.comment),y.comment&&lt(y,"oncomment",y.comment),y.comment=""):(y.comment+="-"+D,y.state=j.COMMENT);continue;case j.COMMENT_ENDED:D!==">"?(ft(y,"Malformed comment"),y.comment+="--"+D,y.state=j.COMMENT):y.doctype&&y.doctype!==!0?y.state=j.DOCTYPE_DTD:y.state=j.TEXT;continue;case j.CDATA:for(var ot=k-1;D&&D!=="]";)D=L(b,k++),D&&y.trackPosition&&(y.position++,D===`
`?(y.line++,y.column=0):y.column++);y.cdata+=b.substring(ot,k-1),D==="]"&&(y.state=j.CDATA_ENDING);continue;case j.CDATA_ENDING:D==="]"?y.state=j.CDATA_ENDING_2:(y.cdata+="]"+D,y.state=j.CDATA);continue;case j.CDATA_ENDING_2:D===">"?(y.cdata&&lt(y,"oncdata",y.cdata),lt(y,"onclosecdata"),y.cdata="",y.state=j.TEXT):D==="]"?y.cdata+="]":(y.cdata+="]]"+D,y.state=j.CDATA);continue;case j.PROC_INST:D==="?"?y.state=j.PROC_INST_ENDING:P(D)?y.state=j.PROC_INST_BODY:y.procInstName+=D;continue;case j.PROC_INST_BODY:if(!y.procInstBody&&P(D))continue;D==="?"?y.state=j.PROC_INST_ENDING:y.procInstBody+=D;continue;case j.PROC_INST_ENDING:if(D===">"){const dt={name:y.procInstName,body:y.procInstBody};Et(y,dt),lt(y,"onprocessinginstruction",dt),y.procInstName=y.procInstBody="",y.state=j.TEXT}else y.procInstBody+="?"+D,y.state=j.PROC_INST_BODY;continue;case j.OPEN_TAG:O(E,D)?y.tagName+=D:(z(y),D===">"?T(y):D==="/"?y.state=j.OPEN_TAG_SLASH:(P(D)||ft(y,"Invalid character in tag name"),y.state=j.ATTRIB));continue;case j.OPEN_TAG_SLASH:D===">"?(T(y,!0),Y(y)):(ft(y,"Forward-slash in opening tag not followed by >"),y.state=j.ATTRIB);continue;case j.ATTRIB:if(P(D))continue;D===">"?T(y):D==="/"?y.state=j.OPEN_TAG_SLASH:O(v,D)?(y.attribName=D,y.attribValue="",y.state=j.ATTRIB_NAME):ft(y,"Invalid attribute name");continue;case j.ATTRIB_NAME:D==="="?y.state=j.ATTRIB_VALUE:D===">"?(ft(y,"Attribute without value"),y.attribValue=y.attribName,Q(y),T(y)):P(D)?y.state=j.ATTRIB_NAME_SAW_WHITE:O(E,D)?y.attribName+=D:ft(y,"Invalid attribute name");continue;case j.ATTRIB_NAME_SAW_WHITE:if(D==="=")y.state=j.ATTRIB_VALUE;else{if(P(D))continue;ft(y,"Attribute without value"),y.tag.attributes[y.attribName]="",y.attribValue="",lt(y,"onattribute",{name:y.attribName,value:""}),y.attribName="",D===">"?T(y):O(v,D)?(y.attribName=D,y.state=j.ATTRIB_NAME):(ft(y,"Invalid attribute name"),y.state=j.ATTRIB)}continue;case j.ATTRIB_VALUE:if(P(D))continue;M(D)?(y.q=D,y.state=j.ATTRIB_VALUE_QUOTED):(y.opt.unquotedAttributeValues||yt(y,"Unquoted attribute value"),y.state=j.ATTRIB_VALUE_UNQUOTED,y.attribValue=D);continue;case j.ATTRIB_VALUE_QUOTED:if(D!==y.q){D==="&"?y.state=j.ATTRIB_VALUE_ENTITY_Q:y.attribValue+=D;continue}Q(y),y.q="",y.state=j.ATTRIB_VALUE_CLOSED;continue;case j.ATTRIB_VALUE_CLOSED:P(D)?y.state=j.ATTRIB:D===">"?T(y):D==="/"?y.state=j.OPEN_TAG_SLASH:O(v,D)?(ft(y,"No whitespace between attributes"),y.attribName=D,y.attribValue="",y.state=j.ATTRIB_NAME):ft(y,"Invalid attribute name");continue;case j.ATTRIB_VALUE_UNQUOTED:if(!F(D)){D==="&"?y.state=j.ATTRIB_VALUE_ENTITY_U:y.attribValue+=D;continue}Q(y),D===">"?T(y):y.state=j.ATTRIB;continue;case j.CLOSE_TAG:if(y.tagName)D===">"?Y(y):O(E,D)?y.tagName+=D:y.script?(y.script+="</"+y.tagName+D,y.tagName="",y.state=j.SCRIPT):(P(D)||ft(y,"Invalid tagname in closing tag"),y.state=j.CLOSE_TAG_SAW_WHITE);else{if(P(D))continue;q(v,D)?y.script?(y.script+="</"+D,y.state=j.SCRIPT):ft(y,"Invalid tagname in closing tag."):y.tagName=D}continue;case j.CLOSE_TAG_SAW_WHITE:if(P(D))continue;D===">"?Y(y):ft(y,"Invalid characters in closing tag");continue;case j.TEXT_ENTITY:case j.ATTRIB_VALUE_ENTITY_Q:case j.ATTRIB_VALUE_ENTITY_U:var X,wt;switch(y.state){case j.TEXT_ENTITY:X=j.TEXT,wt="textNode";break;case j.ATTRIB_VALUE_ENTITY_Q:X=j.ATTRIB_VALUE_QUOTED,wt="attribValue";break;case j.ATTRIB_VALUE_ENTITY_U:X=j.ATTRIB_VALUE_UNQUOTED,wt="attribValue";break}if(D===";"){var Bt=K(y);y.opt.unparsedEntities&&!Object.values(t.XML_ENTITIES).includes(Bt)?((y.entityCount+=1)>y.opt.maxEntityCount&&yt(y,"Parsed entity count exceeds max entity count"),(y.entityDepth+=1)>y.opt.maxEntityDepth&&yt(y,"Parsed entity depth exceeds max entity depth"),y.entity="",y.state=X,y.write(Bt),y.entityDepth-=1):(y[wt]+=Bt,y.entity="",y.state=X)}else O(y.entity.length?N:x,D)?y.entity+=D:(ft(y,"Invalid character in entity name"),y[wt]+="&"+y.entity+D,y.entity="",y.state=X);continue;default:throw new Error(y,"Unknown state: "+y.state)}return y.position>=y.bufferCheckPosition&&o(y),y}String.fromCodePoint||(function(){var b=String.fromCharCode,y=Math.floor,k=function(){var D
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ph(e,t){return lh(e)||fh(e,t)||dh(e,t)||hh()}function dh(e,t){if(e){if(typeof e=="string")return Yi(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Yi(e,t):void 0}}const mc=Object.entries,Hi=Object.setPrototypeOf,gh=Object.isFrozen,mh=Object.getPrototypeOf,yh=Object.getOwnPropertyDescriptor;let Zt=Object.freeze,re=Object.seal,on=Object.create,yc=typeof Reflect<"u"&&Reflect,ko=yc.apply,$o=yc.construct;Zt||(Zt=function(e){return e}),re||(re=function(e){return e}),ko||(ko=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return e.apply(t,r)}),$o||($o=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)});const Je=Qt(Array.prototype.forEach),bh=Qt(Array.prototype.lastIndexOf),Xi=Qt(Array.prototype.pop),wn=Qt(Array.prototype.push),wh=Qt(Array.prototype.splice),cn=Array.isArray,In=Qt(String.prototype.toLowerCase),po=Qt(String.prototype.toString),Ji=Qt(String.prototype.match),vn=Qt(String.prototype.replace),qi=Qt(String.prototype.indexOf),vh=Qt(String.prototype.trim),Eh=Qt(Number.prototype.toString),_h=Qt(Boolean.prototype.toString),Qi=typeof BigInt>"u"?null:Qt(BigInt.prototype.toString),Zi=typeof Symbol>"u"?null:Qt(Symbol.prototype.toString),me=Qt(Object.prototype.hasOwnProperty),En=Qt(Object.prototype.toString),ie=Qt(RegExp.prototype.test),Ye=Ah(TypeError);function Qt(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return ko(e,t,r)}}function Ah(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return $o(e,n)}}function It(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:In;if(Hi&&Hi(e,null),!cn(t))return e;let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){const s=n(o);s!==o&&(gh(t)||(t[r]=s),o=s)}e[o]=!0}return e}function Sh(e){for(let t=0;t<e.length;t++)me(e,t)||(e[t]=null);return e}function ve(e){const t=on(null);for(const r of mc(e)){var n=ph(r,2);const o=n[0],s=n[1];me(e,o)&&(cn(s)?t[o]=Sh(s):s&&typeof s=="object"&&s.constructor===Object?t[o]=ve(s):t[o]=s)}return t}function Nh(e){switch(typeof e){case"string":return e;case"number":return Eh(e);case"boolean":return _h(e);case"bigint":return Qi?Qi(e):"0";case"symbol":return Zi?Zi(e):"Symbol()";case"undefined":return En(e);case"function":case"object":{if(e===null)return En(e);const t=e,n=Ae(t,"toString");if(typeof n=="function"){const r=n(t);return typeof r=="string"?r:En(r)}return En(e)}default:return En(e)}}function Ae(e,t){for(;e!==null;){const r=yh(e,t);if(r){if(r.get)return Qt(r.get);if(typeof r.value=="function")return Qt(r.value)}e=mh(e)}function n(){return null}return n}function Ih(e){try{return ie(e,""),!0}catch{return!1}}const Ki=Zt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),go=Zt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","ent
`+Ue),$t&&(Ue=kn(Ue)),j&&at?Et(Ue):Ue},t.setConfig=function(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ur(C),c=!0,g=k,_=ot},t.clearConfig=function(){Ke=null,c=!1,g=null,_=null,j=G,ct=""},t.isValidAttribute=function(C,J,et){Ke||ur({});const ut=Yt(C),ht=Yt(J);return Ps(ut,ht,et)},t.addHook=function(C,J){typeof J=="function"&&me(Q,C)&&wn(Q[C],J)},t.removeHook=function(C,J){if(me(Q,C)){if(J!==void 0){const et=bh(Q[C],J);return et===-1?void 0:wh(Q[C],et,1)[0]}return Xi(Q[C])}},t.removeHooks=function(C){me(Q,C)&&(Q[C]=[])},t.removeAllHooks=function(){Q=au()},t}wc(),globalThis._nc_l10n_locale??=typeof document<"u"&&document.documentElement.dataset.locale||Intl.DateTimeFormat().resolvedOptions().locale.replaceAll(/-/g,"_"),globalThis._nc_l10n_language??=typeof document<"u"&&document.documentElement.lang||(globalThis.navigator?.language??"en"),globalThis._oc_l10n_registry_translations??={},globalThis._oc_l10n_registry_plural_functions??={};class zh extends of{}function vc(){return Ot.registry??=new zh,Ot.registry}function Wh(){return vc()}const Yh=Object.freeze({DEFAULT:"default",HIDDEN:"hidden"});function Hh(e){if(Jh(e),Ot.fileActions??=new Map,Ot.fileActions.has(e.id)){Ge.error(`FileAction ${e.id} already registered`,{action:e});return}Ot.fileActions.set(e.id,e),vc().dispatchTypedEvent("register:action",new CustomEvent("register:action",{detail:e}))}function Xh(){return Ot.fileActions?[...Ot.fileActions.values()]:[]}function Jh(e){if(!e.id||typeof e.id!="string")throw new Error("Invalid id");if(!e.displayName||typeof e.displayName!="function")throw new Error("Invalid displayName function");if("title"in e&&typeof e.title!="function")throw new Error("Invalid title function");if(!e.iconSvgInline||typeof e.iconSvgInline!="function")throw new Error("Invalid iconSvgInline function");if(!e.exec||typeof e.exec!="function")throw new Error("Invalid exec function");if("enabled"in e&&typeof e.enabled!="function")throw new Error("Invalid enabled function");if("execBatch"in e&&typeof e.execBatch!="function")throw new Error("Invalid execBatch function");if("order"in e&&typeof e.order!="number")throw new Error("Invalid order");if(e.destructive!==void 0&&typeof e.destructive!="boolean")throw new Error("Invalid destructive flag");if("parent"in e&&typeof e.parent!="string")throw new Error("Invalid parent");if(e.default&&!Object.values(Yh).includes(e.default))throw new Error("Invalid default");if("inline"in e&&typeof e.inline!="function")throw new Error("Invalid inline function");if("renderInline"in e&&typeof e.renderInline!="function")throw new Error("Invalid renderInline function");if("hotkey"in e&&e.hotkey!==void 0){if(typeof e.hotkey!="object")throw new Error("Invalid hotkey configuration");if(typeof e.hotkey.key!="string"||!e.hotkey.key)throw new Error("Missing or invalid hotkey key");if(typeof e.hotkey.description!="string"||!e.hotkey.description)throw new Error("Missing or invalid hotkey description")}}function qh(e){if(Qh(e),Ot.filesSidebarActions??=new Map,Ot.filesSidebarActions.has(e.id)){Ge.warn(`Sidebar action with id "${e.id}" already registered. Skipping.`);return}Ot.filesSidebarActions.set(e.id,e),Ge.debug(`New sidebar action with id "${e.id}" registered.`)}function Qh(e){if(typeof e!="object")throw new Error("Sidebar action is not an object");if(!e.id||typeof e.id!="string"||e.id!==CSS.escape(e.id))throw new Error("Sidebar actions need to have an id conforming to the HTML id attribute specifications");if(!e.displayName||typeof e.displayName!="function")throw new Error("Sidebar actions need to have a displayName function");if(!e.iconSvgInline||typeof e.iconSvgInline!="function")throw new Error("Sidebar actions need to have a iconSvgInline function");if(!e.enabled||typeof e.enabled!="function")throw new Error("Sidebar actions need to have an enabled function");if(!e.onClick||typeof e.onClick!="function")throw new Error("Sidebar actions need to have an onClick function")}function Ec(e){if(Zh(e),Ot.filesSidebarTabs??=new Map,Ot.filesSidebarTabs.has(e.id)){Ge.warn(`Sidebar tab with id "${e.id}" already registered
caused by: ${pe.fullStack(n)}`:t.stack??""}static info(t){Eo(t);const n={},r=pe.cause(t);return r&&Object.assign(n,pe.info(r)),t._info&&Object.assign(n,t._info),n}toString(){let t=this.name||this.constructor.name||this.constructor.prototype.name;return this.message&&(t=`${t}: ${this.message}`),t}}var op=kt(47),qn=kt.n(op);const uu="__PATH_SEPARATOR_POSIX__",cu="__PATH_SEPARATOR_WINDOWS__";function Vt(e){try{const t=e.replace(/\//g,uu).replace(/\\\\/g,cu);return encodeURIComponent(t).split(cu).join("\\\\").split(uu).join("/")}catch(t){throw new pe(t,"Failed encoding path")}}function lu(e){return e.startsWith("/")?e:"/"+e}function Cn(e){let t=e;return t[0]!=="/"&&(t="/"+t),/^.+\/$/.test(t)&&(t=t.substr(0,t.length-1)),t}function sp(e){let t=new(rp())(e).pathname;return t.length<=0&&(t="/"),Cn(t)}function zt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(function(){return(function(r){var o=[];if(r.length===0)return"";if(typeof r[0]!="string")throw new TypeError("Url must be a string. Received "+r[0]);if(r[0].match(/^[^/:]+:\/*$/)&&r.length>1){var s=r.shift();r[0]=s+r[0]}r[0].match(/^file:\/\/\//)?r[0]=r[0].replace(/^([^/:]+):\/*/,"$1:///"):r[0]=r[0].replace(/^([^/:]+):\/*/,"$1://");for(var u=0;u<r.length;u++){var i=r[u];if(typeof i!="string")throw new TypeError("Url must be a string. Received "+i);i!==""&&(u>0&&(i=i.replace(/^[\/]+/,"")),i=u<r.length-1?i.replace(/[\/]+$/,""):i.replace(/[\/]+$/,"/"),o.push(i))}var f=o.join("/"),h=(f=f.replace(/\/(\?|&|#[^!])/g,"$1")).split("?");return h.shift()+(h.length>0?"?":"")+h.join("&")})(typeof arguments[0]=="object"?arguments[0]:[].slice.call(arguments))})(t.reduce(((r,o,s)=>((s===0||o!=="/"||o==="/"&&r[r.length-1]!=="/")&&r.push(o),r)),[]))}var ap=kt(542),_n=kt.n(ap);function fu(e,t){const n=e.url.replace("//",""),r=n.indexOf("/")==-1?"/":n.slice(n.indexOf("/")),o=e.method?e.method.toUpperCase():"GET",s=!!/(^|,)\s*auth\s*($|,)/.test(t.qop)&&"auth",u=`00000000${t.nc}`.slice(-8),i=(function(d,I,S,w,R,v,E){const x=E||_n()(`${I}:${S}:${w}`);return d&&d.toLowerCase()==="md5-sess"?_n()(`${x}:${R}:${v}`):x})(t.algorithm,t.username,t.realm,t.password,t.nonce,t.cnonce,t.ha1),f=_n()(`${o}:${r}`),h=s?_n()(`${i}:${t.nonce}:${u}:${t.cnonce}:${s}:${f}`):_n()(`${i}:${t.nonce}:${f}`),a={username:t.username,realm:t.realm,nonce:t.nonce,uri:r,qop:s,response:h,nc:u,cnonce:t.cnonce,algorithm:t.algorithm,opaque:t.opaque},p=[];for(const d in a)a[d]&&(d==="qop"||d==="nc"||d==="algorithm"?p.push(`${d}=${a[d]}`):p.push(`${d}="${a[d]}"`));return`Digest ${p.join(", ")}`}function Ac(e){return(e.headers&&e.headers.get("www-authenticate")||"").split(/\s/)[0].toLowerCase()==="digest"}var ip=kt(101),Sc=kt.n(ip);function hu(e){return Sc().decode(e)}function pu(e,t){var n;return`Basic ${n=`${e}:${t}`,Sc().encode(n)}`}const du=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:typeof window<"u"?window:globalThis,up=du.fetch.bind(du);let ye=(function(e){return e.Auto="auto",e.Digest="digest",e.None="none",e.Password="password",e.Token="token",e})({}),Ve=(function(e){return e.DataTypeNoLength="data-type-no-length",e.InvalidAuthType="invalid-auth-type",e.InvalidOutputFormat="invalid-output-format",e.LinkUnsupportedAuthType="link-unsupported-auth",e.InvalidUpdateRange="invalid-update-range",e.NotSupported="not-supported",e})({});function Nc(e,t,n,r,o){switch(e.authType){case ye.Auto:t&&n&&(e.headers.Authorization=pu(t,n));break;case ye.Digest:e.digest=(function(u,i,f){return{username:u,password:i,ha1:f,nc:0,algorithm:"md5",hasDigestAuth:!1}})(t,n,o);break;case ye.None:break;case ye.Password:e.headers.Authorization=pu(t,n);break;case ye.Token:e.headers.Authorization=`${(s=r).token_type} ${s.access_token}`;break;default:throw new pe({info:{code:Ve.InvalidAuthType}},`Invalid auth type: ${e.authType}`)}var s}kt(345),kt(800);const gu="@@HOTPATCHER",cp=()=>{};function _o(e){return{original:e,methods:[e],final:!1}}class lp{constructor(){this._configuration={registry:{},getEmptyAction:"null"},this.__type__=gu}get configuration(){return this._configuration}get getEmptyAction(){re
`);const t=new Fe("!xml");let n=t,r="";this.matcher.reset(),this.entityDecoder.reset(),this.entityExpansionCount=0,this.currentExpandedLength=0;const o=this.options,s=new Xp(o.processEntities),u=e.length;for(let i=0;i<u;i++)if(e[i]==="<"){const f=e.charCodeAt(i+1);if(f===47){const h=ln(e,">",i,"Closing Tag is not closed.");let a=e.substring(i+2,h).trim();if(o.removeNSPrefix){const d=a.indexOf(":");d!==-1&&(a=a.substr(d+1))}a=Ro(o.transformTagName,a,"",o).tagName,n&&(r=this.saveTextToParentTag(r,n,this.readonlyMatcher));const p=this.matcher.getCurrentTag();if(a&&o.unpairedTagsSet.has(a))throw new Error(`Unpaired tag can not be used as closing tag: </${a}>`);p&&o.unpairedTagsSet.has(p)&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,n=this.tagsNodeStack.pop(),r="",i=h}else if(f===63){let h=Wo(e,i,!1,"?>");if(!h)throw new Error("Pi Tag is not closed.");r=this.saveTextToParentTag(r,n,this.readonlyMatcher);const a=this.buildAttributesMap(h.tagExp,this.matcher,h.tagName,!0);if(a){const p=a[this.options.attributeNamePrefix+"version"];this.entityDecoder.setXmlVersion(Number(p)||1)}if(!(o.ignoreDeclaration&&h.tagName==="?xml"||o.ignorePiTags)){const p=new Fe(h.tagName);p.add(o.textNodeName,""),h.tagName!==h.tagExp&&h.attrExpPresent&&o.ignoreAttributes!==!0&&(p[":@"]=a),this.addChild(n,p,this.readonlyMatcher,i)}i=h.closeIndex+1}else if(f===33&&e.charCodeAt(i+2)===45&&e.charCodeAt(i+3)===45){const h=ln(e,"-->",i+4,"Comment is not closed.");if(o.commentPropName){const a=e.substring(i+4,h-2);r=this.saveTextToParentTag(r,n,this.readonlyMatcher),n.add(o.commentPropName,[{[o.textNodeName]:a}])}i=h}else if(f===33&&e.charCodeAt(i+2)===68){const h=s.readDocType(e,i);this.entityDecoder.addInputEntities(h.entities),i=h.i}else if(f===33&&e.charCodeAt(i+2)===91){const h=ln(e,"]]>",i,"CDATA is not closed.")-2,a=e.substring(i+9,h);r=this.saveTextToParentTag(r,n,this.readonlyMatcher);let p=this.parseTextData(a,n.tagname,this.readonlyMatcher,!0,!1,!0,!0);p==null&&(p=""),o.cdataPropName?n.add(o.cdataPropName,[{[o.textNodeName]:a}]):n.add(o.textNodeName,p),i=h+2}else{let h=Wo(e,i,o.removeNSPrefix);if(!h){const N=e.substring(Math.max(0,i-50),Math.min(u,i+50));throw new Error(`readTagExp returned undefined at position ${i}. Context: "${N}"`)}let a=h.tagName;const p=h.rawTagName;let d=h.tagExp,I=h.attrExpPresent,S=h.closeIndex;if({tagName:a,tagExp:d}=Ro(o.transformTagName,a,d,o),o.strictReservedNames&&(a===o.commentPropName||a===o.cdataPropName||a===o.textNodeName||a===o.attributesGroupName))throw new Error(`Invalid tag name: ${a}`);n&&r&&n.tagname!=="!xml"&&(r=this.saveTextToParentTag(r,n,this.readonlyMatcher,!1));const w=n;w&&o.unpairedTagsSet.has(w.tagname)&&(n=this.tagsNodeStack.pop(),this.matcher.pop());let R=!1;d.length>0&&d.lastIndexOf("/")===d.length-1&&(R=!0,a[a.length-1]==="/"?(a=a.substr(0,a.length-1),d=a):d=d.substr(0,d.length-1),I=a!==d);let v,E=null;v=ad(p),a!==t.tagname&&this.matcher.push(a,{},v),a!==d&&I&&(E=this.buildAttributesMap(d,this.matcher,a),E&&sd(E,o)),a!==t.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode());const x=i;if(this.isCurrentNodeStopNode){let N="";if(R)i=h.closeIndex;else if(o.unpairedTagsSet.has(a))i=h.closeIndex;else{const M=this.readStopNodeData(e,p,S+1);if(!M)throw new Error(`Unexpected end of ${p}`);i=M.i,N=M.tagContent}const P=new Fe(a);E&&(P[":@"]=E),P.add(o.textNodeName,N),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(n,P,this.readonlyMatcher,x)}else{if(R){({tagName:a,tagExp:d}=Ro(o.transformTagName,a,d,o));const N=new Fe(a);E&&(N[":@"]=E),this.addChild(n,N,this.readonlyMatcher,x),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else{if(o.unpairedTagsSet.has(a)){const N=new Fe(a);E&&(N[":@"]=E),this.addChild(n,N,this.readonlyMatcher,x),this.matcher.pop(),this.isCurrentNodeStopNode=!1,i=h.closeIndex;continue}{const N=new Fe(a);if(this.tagsNodeStack.length>o.maxNestedTags)throw new Error("Maximum nested tags exceeded");this.tagsNodeStack.push(n),E&&(N[":@"]=E),this.addChild(n,N,this.readonlyMatcher,x),n=N}}r="",i=S}}}else r+=e[i];return t.c
`||e==="\r"}function Ru(e,t){const n=t;for(;t<e.length;t++)if(!(e[t]!="?"&&e[t]!=" ")){const r=e.substr(n,t-n);if(t>5&&r==="xml")return Ht("InvalidXml","XML declaration allowed only at the start of the document.",fe(e,t));if(e[t]=="?"&&e[t+1]==">"){t++;break}}return t}function xu(e,t){if(e.length>t+5&&e[t+1]==="-"&&e[t+2]==="-"){for(t+=3;t<e.length;t++)if(e[t]==="-"&&e[t+1]==="-"&&e[t+2]===">"){t+=2;break}}else if(e.length>t+8&&e[t+1]==="D"&&e[t+2]==="O"&&e[t+3]==="C"&&e[t+4]==="T"&&e[t+5]==="Y"&&e[t+6]==="P"&&e[t+7]==="E"){let n=1;for(t+=8;t<e.length;t++)if(e[t]==="<")n++;else if(e[t]===">"&&(n--,n===0))break}else if(e.length>t+9&&e[t+1]==="["&&e[t+2]==="C"&&e[t+3]==="D"&&e[t+4]==="A"&&e[t+5]==="T"&&e[t+6]==="A"&&e[t+7]==="["){for(t+=8;t<e.length;t++)if(e[t]==="]"&&e[t+1]==="]"&&e[t+2]===">"){t+=2;break}}return t}function Nd(e,t){let n="",r="",o=!1;for(;t<e.length;t++){if(e[t]==='"'||e[t]==="'")r===""?r=e[t]:r!==e[t]||(r="");else if(e[t]===">"&&r===""){o=!0;break}n+=e[t]}return r===""&&{value:n,index:t,tagClosed:o}}const Id=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function Pu(e,t){const n=Mc(e,Id),r={};for(let o=0;o<n.length;o++){if(n[o][1].length===0)return Ht("InvalidAttr","Attribute '"+n[o][2]+"' has no space in starting.",Nn(n[o]));if(n[o][3]!==void 0&&n[o][4]===void 0)return Ht("InvalidAttr","Attribute '"+n[o][2]+"' is without value.",Nn(n[o]));if(n[o][3]===void 0&&!t.allowBooleanAttributes)return Ht("InvalidAttr","boolean attribute '"+n[o][2]+"' is not allowed.",Nn(n[o]));const s=n[o][2];if(!xd(s))return Ht("InvalidAttr","Attribute '"+s+"' is an invalid name.",Nn(n[o]));if(Object.prototype.hasOwnProperty.call(r,s))return Ht("InvalidAttr","Attribute '"+s+"' is repeated.",Nn(n[o]));r[s]=1}return!0}function Rd(e,t){if(e[++t]===";")return-1;if(e[t]==="#")return(function(r,o){let s=/\d/;for(r[o]==="x"&&(o++,s=/[\da-fA-F]/);o<r.length;o++){if(r[o]===";")return o;if(!r[o].match(s))break}return-1})(e,++t);let n=0;for(;t<e.length;t++,n++)if(!(e[t].match(/\w/)&&n<20)){if(e[t]===";")break;return-1}return t}function Ht(e,t,n){return{err:{code:e,msg:t,line:n.line||n,col:n.col}}}function xd(e){return ar(e)}function fe(e,t){const n=e.substring(0,t).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function Nn(e){return e.startIndex+e[1].length}class zc{constructor(t){this.externalEntities={},this.options=Hp(t)}parse(t,n){if(typeof t!="string"&&t.toString)t=t.toString();else if(typeof t!="string")throw new Error("XML data is accepted in String or Bytes[] form.");if(n){n===!0&&(n={});const s=(function(u,i){i=Object.assign({},Sd,i);const f=[];let h=!1,a=!1;u[0]==="\uFEFF"&&(u=u.substr(1));for(let p=0;p<u.length;p++)if(u[p]==="<"&&u[p+1]==="?"){if(p+=2,p=Ru(u,p),p.err)return p}else{if(u[p]!=="<"){if(Iu(u[p]))continue;return Ht("InvalidChar","char '"+u[p]+"' is not expected.",fe(u,p))}{let d=p;if(p++,u[p]==="!"){p=xu(u,p);continue}{let I=!1;u[p]==="/"&&(I=!0,p++);let S="";for(;p<u.length&&u[p]!==">"&&u[p]!==" "&&u[p]!==" "&&u[p]!==`
`&&u[p]!=="\r";p++)S+=u[p];if(S=S.trim(),S[S.length-1]==="/"&&(S=S.substring(0,S.length-1),p--),!ar(S)){let v;return v=S.trim().length===0?"Invalid space after '<'.":"Tag '"+S+"' is an invalid name.",Ht("InvalidTag",v,fe(u,p))}const w=Nd(u,p);if(w===!1)return Ht("InvalidAttr","Attributes for '"+S+"' have open quote.",fe(u,p));let R=w.value;if(p=w.index,R[R.length-1]==="/"){const v=p-R.length;R=R.substring(0,R.length-1);const E=Pu(R,i);if(E!==!0)return Ht(E.err.code,E.err.msg,fe(u,v+E.err.line));h=!0}else if(I){if(!w.tagClosed)return Ht("InvalidTag","Closing tag '"+S+"' doesn't have proper closing.",fe(u,p));if(R.trim().length>0)return Ht("InvalidTag","Closing tag '"+S+"' can't have attributes or invalid starting.",fe(u,d));if(f.length===0)return Ht("InvalidTag","Closing tag '"+S+"' has not been opened.",fe(u,d));{const v=f.pop();if(S!==v.tagName){let E=fe(u,v.tagStartPos);return Ht("InvalidTag","Expected closing tag '"+v.tagName+"' (opened in line "+E.line+", col "+E.col+") instead of closing tag '"+S+"'.",fe(u,d))}f.length==0&&(a=!0)}}else{const v=Pu(R,i);if(v!==!0)return Ht(v.err.code,v.err.msg,fe(u,p-R.length+v.err.line));if(a===!0)return Ht("InvalidXml","Multiple possible root nodes found.",fe(u,p));i.unpairedTags.indexOf(S)!==-1||f.push({tagName:S,tagStartPos:d}),h=!0}for(p++;p<u.length;p++)if(u[p]==="<"){if(u[p+1]==="!"){p++,p=xu(u,p);continue}if(u[p+1]!=="?")break;if(p=Ru(u,++p),p.err)return p}else if(u[p]==="&"){const v=Rd(u,p);if(v==-1)return Ht("InvalidChar","char '&' is not expected.",fe(u,p));p=v}else if(a===!0&&!Iu(u[p]))return Ht("InvalidXml","Extra text at the end",fe(u,p));u[p]==="<"&&p--}}}return h?f.length==1?Ht("InvalidTag","Unclosed tag '"+f[0].tagName+"'.",fe(u,f[0].tagStartPos)):!(f.length>0)||Ht("InvalidXml","Invalid '"+JSON.stringify(f.map((p=>p.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):Ht("InvalidXml","Start tag expected.",1)})(t,n);if(s!==!0)throw Error(`${s.err.msg}:${s.err.line}:${s.err.col}`)}const r=new id(this.options,this.externalEntities),o=r.parseXml(t);return this.options.preserveOrder||o===void 0?o:vd(o,this.options,r.matcher,r.readonlyMatcher)}addEntity(t,n){if(n.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(t.indexOf("&")!==-1||t.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(n==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=n}static getMetaDataSymbol(){return Fe.getMetaDataSymbol()}}var Pd=kt(829),Me=kt.n(Pd),sn=(function(e){return e.Array="array",e.Object="object",e.Original="original",e})(sn||{});function Cu(e){return typeof e=="string"?e:e.toString(".",!1)}function Wc(e,t){if(!e.endsWith("propstat.prop.displayname"))return t}function Yn(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:sn.Original;const r=Me().get(e,t);return n==="array"&&Array.isArray(r)===!1?[r]:n==="object"&&Array.isArray(r)?r[0]:r}function ir(e,t){return t=t??{attributeNamePrefix:"@",attributeParsers:[],tagParsers:[Wc]},new Promise((n=>{n((function(r){const{multistatus:o}=r;if(o==="")return{multistatus:{response:[]}};if(!o)throw new Error("Invalid response: No root multistatus found");const s={multistatus:Array.isArray(o)?o[0]:o};return Me().set(s,"multistatus.response",Yn(s,"multistatus.response",sn.Array)),Me().set(s,"multistatus.response",Me().get(s,"multistatus.response").map((u=>(function(i){const f=Object.assign({},i);return f.status?Me().set(f,"status",Yn(f,"status",sn.Object)):(Me().set(f,"propstat",Yn(f,"propstat",sn.Object)),Me().set(f,"propstat.prop",Yn(f,"propstat.prop",sn.Object))),f})(u)))),s})((function(r){let{attributeNamePrefix:o,attributeParsers:s,entityDecoder:u,tagParsers:i}=r;const f={allowBooleanAttributes:!0,attributeNamePrefix:o,textNodeName:"text",ignoreAttributes:!1,removeNSPrefix:!0,jPath:!1,numberParseOptions:{hex:!0,leadingZeros:!1},attributeValueProcessor(h,a,p){const d=Cu(p);for(const I of s)try{const S=I(d,a);if(S!==a)return S}catch{}return a},tagValueProcessor(h,a,p){const d=Cu(p);for(const I of i)try{const S=I
`);const r=[];if(t.stopNodes&&Array.isArray(t.stopNodes))for(let o=0;o<t.stopNodes.length;o++){const s=t.stopNodes[o];typeof s=="string"?r.push(new hn(s)):s instanceof hn&&r.push(s)}return Xc(e,t,n,new ps,r)}function Xc(e,t,n,r,o){let s="",u=!1;if(t.maxNestedTags&&r.getDepth()>t.maxNestedTags)throw new Error("Maximum nested tags exceeded");if(!Array.isArray(e)){if(e!=null){let i=e.toString();return i=Ho(i,t),i}return""}for(let i=0;i<e.length;i++){const f=e[i],h=qc(f);if(h===void 0)continue;const a=Yd(f[":@"],t);r.push(h,a);const p=Xd(r,o);if(h===t.textNodeName){let w=f[h];p||(w=t.tagValueProcessor(h,w),w=Ho(w,t)),u&&(s+=n),s+=w,u=!1,r.pop();continue}if(h===t.cdataPropName){u&&(s+=n);const w=f[h][0][t.textNodeName];s+=`<![CDATA[${String(w).replace(/\]\]>/g,"]]]]><![CDATA[>")}]]>`,u=!1,r.pop();continue}if(h===t.commentPropName){const w=f[h][0][t.textNodeName];s+=n+`<!--${String(w).replace(/--/g,"- -").replace(/-$/,"- ")}-->`,u=!0,r.pop();continue}if(h[0]==="?"){const w=Mu(f[":@"],t,p),R=h==="?xml"?"":n;let v=f[h][0][t.textNodeName];v=v.length!==0?" "+v:"",s+=R+`<${h}${v}${w}?>`,u=!0,r.pop();continue}let d=n;d!==""&&(d+=t.indentBy);const I=n+`<${h}${Mu(f[":@"],t,p)}`;let S;S=p?Jc(f[h],t):Xc(f[h],t,d,r,o),t.unpairedTags.indexOf(h)!==-1?t.suppressUnpairedNode?s+=I+">":s+=I+"/>":S&&S.length!==0||!t.suppressEmptyNode?S&&S.endsWith(">")?s+=I+`>${S}${n}</${h}>`:(s+=I+">",S&&n!==""&&(S.includes("/>")||S.includes("</"))?s+=n+t.indentBy+S+n:s+=S,s+=`</${h}>`):s+=I+"/>",u=!0,r.pop()}return s}function Yd(e,t){if(!e||t.ignoreAttributes)return null;const n={};let r=!1;for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o.startsWith(t.attributeNamePrefix)?o.substr(t.attributeNamePrefix.length):o]=e[o],r=!0);return r?n:null}function Jc(e,t){if(!Array.isArray(e))return e!=null?e.toString():"";let n="";for(let r=0;r<e.length;r++){const o=e[r],s=qc(o);if(s===t.textNodeName)n+=o[s];else if(s===t.cdataPropName)n+=o[s][0][t.textNodeName];else if(s===t.commentPropName)n+=o[s][0][t.textNodeName];else{if(s&&s[0]==="?")continue;if(s){const u=Hd(o[":@"],t),i=Jc(o[s],t);i&&i.length!==0?n+=`<${s}${u}>${i}</${s}>`:n+=`<${s}${u}/>`}}}return n}function Hd(e,t){let n="";if(e&&!t.ignoreAttributes)for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;let o=e[r];o===!0&&t.suppressBooleanAttributes?n+=` ${r.substr(t.attributeNamePrefix.length)}`:n+=` ${r.substr(t.attributeNamePrefix.length)}="${o}"`}return n}function qc(e){const t=Object.keys(e);for(let n=0;n<t.length;n++){const r=t[n];if(Object.prototype.hasOwnProperty.call(e,r)&&r!==":@")return r}}function Mu(e,t,n){let r="";if(e&&!t.ignoreAttributes)for(let o in e){if(!Object.prototype.hasOwnProperty.call(e,o))continue;let s;n?s=e[o]:(s=t.attributeValueProcessor(o,e[o]),s=Ho(s,t)),s===!0&&t.suppressBooleanAttributes?r+=` ${o.substr(t.attributeNamePrefix.length)}`:r+=` ${o.substr(t.attributeNamePrefix.length)}="${s}"`}return r}function Xd(e,t){if(!t||t.length===0)return!1;for(let n=0;n<t.length;n++)if(e.matches(t[n]))return!0;return!1}function Ho(e,t){if(e&&e.length>0&&t.processEntities)for(let n=0;n<t.entities.length;n++){const r=t.entities[n];e=e.replace(r.regex,r.val)}return e}const Jd={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1,maxNestedTags:100,jPath:!0};function Se(e){if(this.options=Object.assign({},Jd,e),this.options.stopNodes&&Array.isArray(this.options.stopNodes)&&(this.options.stopNodes=this.options.stopNodes.map((n=>typeof n=="string"&&n.startsWith("*.")?".."+n.substring(2):n))),this.stopNodeExpressions=[],this.option
`,this.newLine=`
`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function qd(e,t,n,r){const o=this.extractAttributes(e);if(r.push(t,o),this.checkStopNode(r)){const u=this.buildRawContent(e),i=this.buildAttributesForStopNode(e);return r.pop(),this.buildObjectNode(u,t,i,n)}const s=this.j2x(e,n+1,r);return r.pop(),e[this.options.textNodeName]!==void 0&&Object.keys(e).length===1?this.buildTextValNode(e[this.options.textNodeName],t,s.attrStr,n,r):this.buildObjectNode(s.val,t,s.attrStr,n)}function Qd(e){return this.options.indentBy.repeat(e)}function Zd(e){return!(!e.startsWith(this.options.attributeNamePrefix)||e===this.options.textNodeName)&&e.substr(this.attrPrefixLen)}Se.prototype.build=function(e){if(this.options.preserveOrder)return Wd(e,this.options);{Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e});const t=new ps;return this.j2x(e,0,t).val}},Se.prototype.j2x=function(e,t,n){let r="",o="";if(this.options.maxNestedTags&&n.getDepth()>=this.options.maxNestedTags)throw new Error("Maximum nested tags exceeded");const s=this.options.jPath?n.toString():n,u=this.checkStopNode(n);for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i))if(e[i]===void 0)this.isAttribute(i)&&(o+="");else if(e[i]===null)this.isAttribute(i)||i===this.options.cdataPropName?o+="":i[0]==="?"?o+=this.indentate(t)+"<"+i+"?"+this.tagEndChar:o+=this.indentate(t)+"<"+i+"/"+this.tagEndChar;else if(e[i]instanceof Date)o+=this.buildTextValNode(e[i],i,"",t,n);else if(typeof e[i]!="object"){const f=this.isAttribute(i);if(f&&!this.ignoreAttributesFn(f,s))r+=this.buildAttrPairStr(f,""+e[i],u);else if(!f)if(i===this.options.textNodeName){let h=this.options.tagValueProcessor(i,""+e[i]);o+=this.replaceEntitiesValue(h)}else{n.push(i);const h=this.checkStopNode(n);if(n.pop(),h){const a=""+e[i];o+=a===""?this.indentate(t)+"<"+i+this.closeTag(i)+this.tagEndChar:this.indentate(t)+"<"+i+">"+a+"</"+i+this.tagEndChar}else o+=this.buildTextValNode(e[i],i,"",t,n)}}else if(Array.isArray(e[i])){const f=e[i].length;let h="",a="";for(let p=0;p<f;p++){const d=e[i][p];if(d!==void 0)if(d===null)i[0]==="?"?o+=this.indentate(t)+"<"+i+"?"+this.tagEndChar:o+=this.indentate(t)+"<"+i+"/"+this.tagEndChar;else if(typeof d=="object")if(this.options.oneListGroup){n.push(i);const I=this.j2x(d,t+1,n);n.pop(),h+=I.val,this.options.attributesGroupName&&d.hasOwnProperty(this.options.attributesGroupName)&&(a+=I.attrStr)}else h+=this.processTextOrObjNode(d,i,t,n);else if(this.options.oneListGroup){let I=this.options.tagValueProcessor(i,d);I=this.replaceEntitiesValue(I),h+=I}else{n.push(i);const I=this.checkStopNode(n);if(n.pop(),I){const S=""+d;h+=S===""?this.indentate(t)+"<"+i+this.closeTag(i)+this.tagEndChar:this.indentate(t)+"<"+i+">"+S+"</"+i+this.tagEndChar}else h+=this.buildTextValNode(d,i,"",t,n)}}this.options.oneListGroup&&(h=this.buildObjectNode(h,i,a,t)),o+=h}else if(this.options.attributesGroupName&&i===this.options.attributesGroupName){const f=Object.keys(e[i]),h=f.length;for(let a=0;a<h;a++)r+=this.buildAttrPairStr(f[a],""+e[i][f[a]],u)}else o+=this.processTextOrObjNode(e[i],i,t,n);return{attrStr:r,val:o}},Se.prototype.buildAttrPairStr=function(e,t,n){return n||(t=this.options.attributeValueProcessor(e,""+t),t=this.replaceEntitiesValue(t)),this.options.suppressBooleanAttributes&&t==="true"?" "+e:" "+e+'="'+t+'"'},Se.prototype.extractAttributes=function(e){if(!e||typeof e!="object")return null;const t={};let n=!1;if(this.options.attributesGroupName&&e[this.options.attributesGroupName]){const r=e[this.options.attributesGroupName];for(let o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o.startsWith(this.options.attributeNamePrefix)?o.substring(this.options.attributeNamePrefix.length):o]=r[o],n=!0)}else for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;const o=this.isAttribute(r);o&&(t[o]=e[r],n=!0)}return n?t:null},Se.prototype.buildRawContent=function(e){if(typeof e=="string")return e;if(typeof e!="object"||e===null)return String(e);if(e[this.options.textNodeName]!==void 0)retur
<d:propfind ${bg()}>
<d:prop>${yg()}</d:prop>
</d:propfind>`});if(Do.get(e.source)!==t)return;const r="data"in n?n.data:n,o=Ag(r,e.root).attributes["comments-count"],s=e.attributes["comments-count"],u=typeof s=="number"?s:typeof s=="string"?Number.parseInt(s,10):0;typeof o=="number"&&o!==u&&(e.update({"comments-count":o}),Yu("files:node:updated",e))}async function Rg(){const e=Date.now()+5e3;for(;Date.now()<e;){const t=window.OCA?.Comments?.View;if(t)return t;await new Promise(n=>window.setTimeout(n,50))}throw new Error("Nextcloud Comments view is unavailable")}function xg(){return class extends HTMLElement{commentsView;container;currentNode;mutationObserver;refreshTimers=new Map;renderGeneration=0;active=!1;folder;view;get node(){return this.currentNode}set node(e){this.currentNode=e,this.renderComments()}connectedCallback(){this.style.display="block",this.style.height="100%",this.style.overflow="auto",this.container=document.createElement("div"),this.container.className="korean-comments-action__content",this.append(this.container),typeof MutationObserver<"u"&&(this.mutationObserver=new MutationObserver(()=>this.scheduleCountRefresh()),this.mutationObserver.observe(this.container,{childList:!0,subtree:!0})),this.renderComments()}disconnectedCallback(){this.renderGeneration+=1,this.mutationObserver?.disconnect(),this.mutationObserver=void 0;for(const e of this.refreshTimers.values())window.clearTimeout(e);this.refreshTimers.clear(),this.commentsView?.$unmount(),this.commentsView=void 0,this.container=void 0,this.replaceChildren()}async renderComments(){const e=this.currentNode,t=e?.fileid;if(!this.isConnected||!this.container||!e||t===void 0)return;if(this.commentsView){await this.commentsView.update(t),this.scheduleCountRefresh();return}const n=++this.renderGeneration;try{const r=await Rg();if(n!==this.renderGeneration||!this.isConnected||!this.container)return;this.commentsView=new r("files",{el:this.container,props:{resourceId:t}}),this.scheduleCountRefresh()}catch(r){n===this.renderGeneration&&this.renderRetry(r)}}renderRetry(e){if(!this.container)return;console.error("Could not initialize the native Comments view",e);const t=document.createElement("p");t.textContent="댓글 화면을 불러오지 못했습니다.";const n=document.createElement("button");n.type="button",n.textContent="다시 시도",n.addEventListener("click",()=>{this.renderComments()}),this.container.replaceChildren(t,n)}scheduleCountRefresh(){const e=this.currentNode;if(!e)return;const t=e.source,n=this.refreshTimers.get(t);n!==void 0&&window.clearTimeout(n);const r=window.setTimeout(()=>{this.refreshTimers.delete(t),Ig(e).catch(o=>{console.error("Could not refresh the comment count",o)})},200);this.refreshTimers.set(t,r)}}}mg("oc:comments-count"),Ec({id:Jo,displayName:"댓글",iconSvgInline:bs,order:45,tagName:jo,enabled({node:e}){return rl()&&e.root.startsWith("/files/")&&e.permissions!==Ee.NONE&&e.fileid!==void 0},onInit(){return window.customElements.get(jo)||window.customElements.define(jo,xg()),Promise.resolve()}});let ol=!1;const xn={id:"korean-comments-action",displayName:()=>"",title:e=>{const t=Uu(e);return t>0?`댓글 ${t}개`:"댓글 작성"},iconSvgInline:e=>Uu(e)>0?bs:Sg,enabled(e){return qo(e)&&(!ol||Ng(e)===0)},async exec(e){const[t]=e.nodes;if(!t||!qo(e))return!1;try{const n=_c();return n.isOpen&&n.node?.source===t.source?n.setActiveTab(Jo):n.open(t,Jo),null}catch(n){return console.error("Could not open the comments-only sidebar",n),!1}},inline:()=>!0,order:-45};function sl(e){if(e.id!=="comments-unread"||typeof e.enabled!="function")return!1;const t=e.enabled;return e.displayName=xn.displayName,e.title=xn.title,e.iconSvgInline=()=>bs,e.exec=xn.exec,e.inline=xn.inline,e.enabled=n=>qo(n)&&t(n)===!0,ol=!0,!0}for(const e of Xh())sl(e);Wh().addEventListener("register:action",e=>{sl(e.detail)}),Hh(xn);
//# sourceMappingURL=korean_comments_action-main.mjs.map