@tryghost/comments-ui 1.5.13 → 1.5.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tryghost/comments-ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.5.
|
|
4
|
+
"version": "1.5.14",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -86,9 +86,9 @@
|
|
|
86
86
|
"dev": "pnpm build && concurrently --kill-others --names preview,build \"pnpm preview --host -l silent\" \"pnpm build:watch\"",
|
|
87
87
|
"dev:test": "vite build && vite preview --port 7175",
|
|
88
88
|
"build": "vite build",
|
|
89
|
-
"build:watch": "vite build --watch",
|
|
89
|
+
"build:watch": "vite build --watch --mode development",
|
|
90
90
|
"preview": "vite preview",
|
|
91
|
-
"test": "pnpm test:unit
|
|
91
|
+
"test": "pnpm test:unit",
|
|
92
92
|
"test:unit": "vitest run --coverage",
|
|
93
93
|
"test:acceptance": "NODE_OPTIONS='--experimental-specifier-resolution=node --no-warnings' VITE_TEST=true playwright test",
|
|
94
94
|
"test:acceptance:slowmo": "TIMEOUT=100000 PLAYWRIGHT_SLOWMO=1000 pnpm test:acceptance --headed",
|
package/umd/comments-ui.min.js
CHANGED
|
@@ -115,5 +115,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
115
115
|
`)+" "+N.join(`,
|
|
116
116
|
`)+" "+G[1]:G[0]+L+" "+N.join(", ")+" "+G[1]}function k(N){return Array.isArray(N)}n.isArray=k;function S(N){return typeof N=="boolean"}n.isBoolean=S;function R(N){return N===null}n.isNull=R;function O(N){return N==null}n.isNullOrUndefined=O;function U(N){return typeof N=="number"}n.isNumber=U;function H(N){return typeof N=="string"}n.isString=H;function Q(N){return typeof N=="symbol"}n.isSymbol=Q;function oe(N){return N===void 0}n.isUndefined=oe;function Z(N){return Y(N)&&X(N)==="[object RegExp]"}n.isRegExp=Z;function Y(N){return typeof N=="object"&&N!==null}n.isObject=Y;function ae(N){return Y(N)&&X(N)==="[object Date]"}n.isDate=ae;function fe(N){return Y(N)&&(X(N)==="[object Error]"||N instanceof Error)}n.isError=fe;function B(N){return typeof N=="function"}n.isFunction=B;function V(N){return N===null||typeof N=="boolean"||typeof N=="number"||typeof N=="string"||typeof N=="symbol"||typeof N>"u"}n.isPrimitive=V,n.isBuffer=xA();function X(N){return Object.prototype.toString.call(N)}function me(N){return N<10?"0"+N.toString(10):N.toString(10)}var he=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ne(){var N=new Date,L=[me(N.getHours()),me(N.getMinutes()),me(N.getSeconds())].join(":");return[N.getDate(),he[N.getMonth()],L].join(" ")}n.log=function(){console.log("%s - %s",Ne(),n.format.apply(n,arguments))},n.inherits=SA(),n._extend=function(N,L){if(!L||!Y(L))return N;for(var G=Object.keys(L),ke=G.length;ke--;)N[G[ke]]=L[G[ke]];return N};function Le(N,L){return Object.prototype.hasOwnProperty.call(N,L)}})(wm)),wm}var z0;function EA(){if(z0)return Td.exports;z0=1;var n=$A()();function e(B,V){if(B===V)return 0;for(var X=B.length,me=V.length,he=0,Ne=Math.min(X,me);he<Ne;++he)if(B[he]!==V[he]){X=B[he],me=V[he];break}return X<me?-1:me<X?1:0}function t(B){return ri.Buffer&&typeof ri.Buffer.isBuffer=="function"?ri.Buffer.isBuffer(B):!!(B!=null&&B._isBuffer)}var o=CA(),r=Object.prototype.hasOwnProperty,s=Array.prototype.slice,l=(function(){return(function(){}).name==="foo"})();function c(B){return Object.prototype.toString.call(B)}function d(B){return t(B)||typeof ri.ArrayBuffer!="function"?!1:typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(B):B?!!(B instanceof DataView||B.buffer&&B.buffer instanceof ArrayBuffer):!1}var m=Td.exports=R,p=/\s*function\s+([^\(\s]*)\s*/;function h(B){if(o.isFunction(B)){if(l)return B.name;var V=B.toString(),X=V.match(p);return X&&X[1]}}m.AssertionError=function(V){this.name="AssertionError",this.actual=V.actual,this.expected=V.expected,this.operator=V.operator,V.message?(this.message=V.message,this.generatedMessage=!1):(this.message=k(this),this.generatedMessage=!0);var X=V.stackStartFunction||S;if(Error.captureStackTrace)Error.captureStackTrace(this,X);else{var me=new Error;if(me.stack){var he=me.stack,Ne=h(X),Le=he.indexOf(`
|
|
117
117
|
`+Ne);if(Le>=0){var N=he.indexOf(`
|
|
118
|
-
`,Le+1);he=he.substring(N+1)}this.stack=he}}},o.inherits(m.AssertionError,Error);function g(B,V){return typeof B=="string"?B.length<V?B:B.slice(0,V):B}function b(B){if(l||!o.isFunction(B))return o.inspect(B);var V=h(B),X=V?": "+V:"";return"[Function"+X+"]"}function k(B){return g(b(B.actual),128)+" "+B.operator+" "+g(b(B.expected),128)}function S(B,V,X,me,he){throw new m.AssertionError({message:X,actual:B,expected:V,operator:me,stackStartFunction:he})}m.fail=S;function R(B,V){B||S(B,!0,V,"==",m.ok)}m.ok=R,m.equal=function(V,X,me){V!=X&&S(V,X,me,"==",m.equal)},m.notEqual=function(V,X,me){V==X&&S(V,X,me,"!=",m.notEqual)},m.deepEqual=function(V,X,me){O(V,X,!1)||S(V,X,me,"deepEqual",m.deepEqual)},m.deepStrictEqual=function(V,X,me){O(V,X,!0)||S(V,X,me,"deepStrictEqual",m.deepStrictEqual)};function O(B,V,X,me){if(B===V)return!0;if(t(B)&&t(V))return e(B,V)===0;if(o.isDate(B)&&o.isDate(V))return B.getTime()===V.getTime();if(o.isRegExp(B)&&o.isRegExp(V))return B.source===V.source&&B.global===V.global&&B.multiline===V.multiline&&B.lastIndex===V.lastIndex&&B.ignoreCase===V.ignoreCase;if((B===null||typeof B!="object")&&(V===null||typeof V!="object"))return X?B===V:B==V;if(d(B)&&d(V)&&c(B)===c(V)&&!(B instanceof Float32Array||B instanceof Float64Array))return e(new Uint8Array(B.buffer),new Uint8Array(V.buffer))===0;if(t(B)!==t(V))return!1;me=me||{actual:[],expected:[]};var he=me.actual.indexOf(B);return he!==-1&&he===me.expected.indexOf(V)?!0:(me.actual.push(B),me.expected.push(V),H(B,V,X,me))}function U(B){return Object.prototype.toString.call(B)=="[object Arguments]"}function H(B,V,X,me){if(B==null||V===null||V===void 0)return!1;if(o.isPrimitive(B)||o.isPrimitive(V))return B===V;if(X&&Object.getPrototypeOf(B)!==Object.getPrototypeOf(V))return!1;var he=U(B),Ne=U(V);if(he&&!Ne||!he&&Ne)return!1;if(he)return B=s.call(B),V=s.call(V),O(B,V,X);var Le=fe(B),N=fe(V),L,G;if(Le.length!==N.length)return!1;for(Le.sort(),N.sort(),G=Le.length-1;G>=0;G--)if(Le[G]!==N[G])return!1;for(G=Le.length-1;G>=0;G--)if(L=Le[G],!O(B[L],V[L],X,me))return!1;return!0}m.notDeepEqual=function(V,X,me){O(V,X,!1)&&S(V,X,me,"notDeepEqual",m.notDeepEqual)},m.notDeepStrictEqual=Q;function Q(B,V,X){O(B,V,!0)&&S(B,V,X,"notDeepStrictEqual",Q)}m.strictEqual=function(V,X,me){V!==X&&S(V,X,me,"===",m.strictEqual)},m.notStrictEqual=function(V,X,me){V===X&&S(V,X,me,"!==",m.notStrictEqual)};function oe(B,V){if(!B||!V)return!1;if(Object.prototype.toString.call(V)=="[object RegExp]")return V.test(B);try{if(B instanceof V)return!0}catch{}return Error.isPrototypeOf(V)?!1:V.call({},B)===!0}function Z(B){var V;try{B()}catch(X){V=X}return V}function Y(B,V,X,me){var he;if(typeof V!="function")throw new TypeError('"block" argument must be a function');typeof X=="string"&&(me=X,X=null),he=Z(V),me=(X&&X.name?" ("+X.name+").":".")+(me?" "+me:"."),B&&!he&&S(he,X,"Missing expected exception"+me);var Ne=typeof me=="string",Le=!B&&o.isError(he),N=!B&&he&&!X;if((Le&&Ne&&oe(he,X)||N)&&S(he,X,"Got unwanted exception"+me),B&&he&&X&&!oe(he,X)||!B&&he)throw he}m.throws=function(B,V,X){Y(!0,B,V,X)},m.doesNotThrow=function(B,V,X){Y(!1,B,V,X)},m.ifError=function(B){if(B)throw B};function ae(B,V){B||S(B,!0,V,"==",ae)}m.strict=n(ae,m,{equal:m.strictEqual,deepEqual:m.deepStrictEqual,notEqual:m.notStrictEqual,notDeepEqual:m.notDeepStrictEqual}),m.strict.strict=m.strict;var fe=Object.keys||function(B){var V=[];for(var X in B)r.call(B,X)&&V.push(X);return V};return Td.exports}var xm,F0;function RA(){if(F0)return xm;F0=1;var n=EA();return xm=function(e){var t,o,r,s,l;for(t=Error.prepareStackTrace,Error.prepareStackTrace=function(c,d){return Error.prepareStackTrace=t,d},o=new Error().stack,l=0;l<o.length&&o[l].getFileName()!==__filename;)l++;n(l<o.length,"Unexpected: unable to find caller/index.js in the stack"),e=!e||isNaN(e)?1:e>o.length-2?o.length-2:e,o=o.slice(l+e+1);do s=o.shift(),r=s&&s.getFileName();while(o.length&&r==="module.js");return r},xm}var U0;function NA(){if(U0)return pl;U0=1;const n=Tr,e=Tr,t=JD(),o=RA();return pl.getCallerRoot=function(){try{return t(o(2))}catch{return}},pl.getProcessRoot=function(){let s=process.cwd();const l=e.join(s,"current");try{n.statSync(l).isDirectory()&&(s=l)}catch{}try{return t(s)}catch{return}},pl}var Sm,_0;function DA(){return _0||(_0=1,Sm=NA()),Sm}var gl={exports:{}},Cm,H0;function AA(){if(H0)return Cm;H0=1;var n=1e3,e=n*60,t=e*60,o=t*24,r=o*7,s=o*365.25;Cm=function(p,h){h=h||{};var g=typeof p;if(g==="string"&&p.length>0)return l(p);if(g==="number"&&isFinite(p))return h.long?d(p):c(p);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(p))};function l(p){if(p=String(p),!(p.length>100)){var h=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(p);if(h){var g=parseFloat(h[1]),b=(h[2]||"ms").toLowerCase();switch(b){case"years":case"year":case"yrs":case"yr":case"y":return g*s;case"weeks":case"week":case"w":return g*r;case"days":case"day":case"d":return g*o;case"hours":case"hour":case"hrs":case"hr":case"h":return g*t;case"minutes":case"minute":case"mins":case"min":case"m":return g*e;case"seconds":case"second":case"secs":case"sec":case"s":return g*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return g;default:return}}}}function c(p){var h=Math.abs(p);return h>=o?Math.round(p/o)+"d":h>=t?Math.round(p/t)+"h":h>=e?Math.round(p/e)+"m":h>=n?Math.round(p/n)+"s":p+"ms"}function d(p){var h=Math.abs(p);return h>=o?m(p,h,o,"day"):h>=t?m(p,h,t,"hour"):h>=e?m(p,h,e,"minute"):h>=n?m(p,h,n,"second"):p+" ms"}function m(p,h,g,b){var k=h>=g*1.5;return Math.round(p/g)+" "+b+(k?"s":"")}return Cm}var Em,V0;function OA(){if(V0)return Em;V0=1;function n(e){o.debug=o,o.default=o,o.coerce=m,o.disable=c,o.enable=s,o.enabled=d,o.humanize=AA(),o.destroy=p,Object.keys(e).forEach(h=>{o[h]=e[h]}),o.names=[],o.skips=[],o.formatters={};function t(h){let g=0;for(let b=0;b<h.length;b++)g=(g<<5)-g+h.charCodeAt(b),g|=0;return o.colors[Math.abs(g)%o.colors.length]}o.selectColor=t;function o(h){let g,b=null,k,S;function R(...O){if(!R.enabled)return;const U=R,H=Number(new Date),Q=H-(g||H);U.diff=Q,U.prev=g,U.curr=H,g=H,O[0]=o.coerce(O[0]),typeof O[0]!="string"&&O.unshift("%O");let oe=0;O[0]=O[0].replace(/%([a-zA-Z%])/g,(Y,ae)=>{if(Y==="%%")return"%";oe++;const fe=o.formatters[ae];if(typeof fe=="function"){const B=O[oe];Y=fe.call(U,B),O.splice(oe,1),oe--}return Y}),o.formatArgs.call(U,O),(U.log||o.log).apply(U,O)}return R.namespace=h,R.useColors=o.useColors(),R.color=o.selectColor(h),R.extend=r,R.destroy=o.destroy,Object.defineProperty(R,"enabled",{enumerable:!0,configurable:!1,get:()=>b!==null?b:(k!==o.namespaces&&(k=o.namespaces,S=o.enabled(h)),S),set:O=>{b=O}}),typeof o.init=="function"&&o.init(R),R}function r(h,g){const b=o(this.namespace+(typeof g>"u"?":":g)+h);return b.log=this.log,b}function s(h){o.save(h),o.namespaces=h,o.names=[],o.skips=[];const g=(typeof h=="string"?h:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const b of g)b[0]==="-"?o.skips.push(b.slice(1)):o.names.push(b)}function l(h,g){let b=0,k=0,S=-1,R=0;for(;b<h.length;)if(k<g.length&&(g[k]===h[b]||g[k]==="*"))g[k]==="*"?(S=k,R=b,k++):(b++,k++);else if(S!==-1)k=S+1,R++,b=R;else return!1;for(;k<g.length&&g[k]==="*";)k++;return k===g.length}function c(){const h=[...o.names,...o.skips.map(g=>"-"+g)].join(",");return o.enable(""),h}function d(h){for(const g of o.skips)if(l(h,g))return!1;for(const g of o.names)if(l(h,g))return!0;return!1}function m(h){return h instanceof Error?h.stack||h.message:h}function p(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return o.enable(o.load()),o}return Em=n,Em}var Y0;function TA(){return Y0||(Y0=1,(function(n,e){e.formatArgs=o,e.save=r,e.load=s,e.useColors=t,e.storage=l(),e.destroy=(()=>{let d=!1;return()=>{d||(d=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function t(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let d;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(d=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(d[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function o(d){if(d[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+d[0]+(this.useColors?"%c ":" ")+"+"+n.exports.humanize(this.diff),!this.useColors)return;const m="color: "+this.color;d.splice(1,0,m,"color: inherit");let p=0,h=0;d[0].replace(/%[a-zA-Z%]/g,g=>{g!=="%%"&&(p++,g==="%c"&&(h=p))}),d.splice(h,0,m)}e.log=console.debug||console.log||(()=>{});function r(d){try{d?e.storage.setItem("debug",d):e.storage.removeItem("debug")}catch{}}function s(){let d;try{d=e.storage.getItem("debug")||e.storage.getItem("DEBUG")}catch{}return!d&&typeof process<"u"&&"env"in process&&(d=process.env.DEBUG),d}function l(){try{return localStorage}catch{}}n.exports=OA()(e);const{formatters:c}=n.exports;c.j=function(d){try{return JSON.stringify(d)}catch(m){return"[UnexpectedJSONParseError]: "+m.message}}})(gl,gl.exports)),gl.exports}var q0;function PA(){if(q0)return ml.exports;q0=1;const n=DA(),e=TA();return ml.exports=function(o){const r=n.getCallerRoot();let s;try{const l=er("/node_modules/.pnpm/@tryghost+debug@2.2.3/node_modules/@tryghost/debug/lib")(r+"/package.json");l.alias?s=l.alias:s=l.name}catch{s="undefined"}return e(s+":"+o)},ml.exports._base=e,ml.exports}var Rm,J0;function jA(){return J0||(J0=1,Rm=PA()),Rm}const MA=[{code:"af",label:"Afrikaans"},{code:"ar",label:"Arabic"},{code:"bg",label:"Bulgarian"},{code:"bn",label:"Bengali"},{code:"bs",label:"Bosnian"},{code:"ca",label:"Catalan"},{code:"cs",label:"Czech"},{code:"da",label:"Danish"},{code:"de",label:"German"},{code:"de-CH",label:"Swiss German"},{code:"el",label:"Greek"},{code:"en",label:"English"},{code:"eo",label:"Esperanto"},{code:"es",label:"Spanish"},{code:"et",label:"Estonian"},{code:"eu",label:"Basque"},{code:"fa",label:"Persian/Farsi"},{code:"fi",label:"Finnish"},{code:"fr",label:"French"},{code:"gd",label:"Gaelic (Scottish)"},{code:"he",label:"Hebrew"},{code:"hi",label:"Hindi"},{code:"hr",label:"Croatian"},{code:"hu",label:"Hungarian"},{code:"id",label:"Indonesian"},{code:"is",label:"Icelandic"},{code:"it",label:"Italian"},{code:"ja",label:"Japanese"},{code:"ko",label:"Korean"},{code:"kz",label:"Kazakh"},{code:"lt",label:"Lithuanian"},{code:"lv",label:"Latvian"},{code:"mk",label:"Macedonian"},{code:"mn",label:"Mongolian"},{code:"ms",label:"Malay"},{code:"nb",label:"Norwegian Bokmål"},{code:"ne",label:"Nepali"},{code:"nl",label:"Dutch"},{code:"nn",label:"Norwegian Nynorsk"},{code:"pa",label:"Punjabi"},{code:"pl",label:"Polish"},{code:"pt",label:"Portuguese"},{code:"pt-BR",label:"Portuguese (Brazil)"},{code:"ro",label:"Romanian"},{code:"ru",label:"Russian"},{code:"si",label:"Sinhala"},{code:"sk",label:"Slovak"},{code:"sl",label:"Slovenian"},{code:"sq",label:"Albanian"},{code:"sr",label:"Serbian"},{code:"sr-Cyrl",label:"Serbian (Cyrillic)"},{code:"sv",label:"Swedish"},{code:"sw",label:"Swahili"},{code:"ta",label:"Tamil"},{code:"th",label:"Thai"},{code:"tr",label:"Turkish"},{code:"uk",label:"Ukrainian"},{code:"ur",label:"Urdu"},{code:"uz",label:"Uzbek"},{code:"vi",label:"Vietnamese"},{code:"zh",label:"Chinese"},{code:"zh-Hant",label:"Traditional Chinese"}];var W0;function LA(){if(W0)return Or.exports;W0=1;const n=qD(),e=Tr,t=Tr,o=jA()("i18n"),r=MA,s=r.map(d=>d.code);function l(d,m){return d.reduce((p,h)=>{let g;try{g=er("/ghost/i18n/lib")(`../locales/${h}/${m}.json`)}catch{g=er("/ghost/i18n/lib")(`../locales/en/${m}.json`)}return p[h]={[m]:{...g,...g.default&&typeof g.default=="object"?g.default:{}}},p},{})}function c(d,m){if(!m)return{[d]:{theme:{}}};let p=[];try{p=t.readdirSync(m).filter(b=>b.endsWith(".json")).map(b=>b.replace(".json",""))}catch{p=[d,"en"]}return[...new Set([d,...p,"en"])].reduce((g,b)=>{let k,S=!1;const R=e.join(m,`${b}.json`);if(t.existsSync(R))try{delete require.cache[er("/ghost/i18n/lib").resolve(R)],k=er("/ghost/i18n/lib")(R)}catch{o(`Error loading theme locale file: ${b}`),S=!0}else S=!0;if(S)if(b!=="en")try{const O=e.join(m,"en.json");t.existsSync(O)?(delete require.cache[er("/ghost/i18n/lib").resolve(O)],k=er("/ghost/i18n/lib")(O)):k={}}catch{k={}}else o("Theme en.json file not found"),k={};return g[b]={theme:{...k,...k.default&&typeof k.default=="object"?k.default:{}}},g},{})}return Or.exports=(d="en",m="portal",p={})=>{const h=n.createInstance(),g={prefix:"{",suffix:"}"};(m==="theme"||m==="portal")&&(g.escapeValue=!1);let b;return m!=="theme"?b=l(s,m):(o(`generateThemeResources: ${d}, ${p.themePath}`),b=c(d,p.themePath)),h.init({lng:d,nsSeparator:!1,keySeparator:!1,returnEmptyString:!1,fallbackLng:{no:["nb","en"],default:["en"]},ns:m,defaultNS:m,interpolation:g,resources:b}),h},Or.exports.SUPPORTED_LOCALES=s,Or.exports.LOCALE_DATA=r,Or.exports.generateResources=l,Or.exports}var K0;function IA(){if(K0)return Zo.exports;K0=1;const n=LA();return Zo.exports=n,Zo.exports.default=n,Zo.exports.LOCALE_DATA=n.LOCALE_DATA,Zo.exports.SUPPORTED_LOCALES=n.SUPPORTED_LOCALES,Zo.exports.generateResources=n.generateResources,Zo.exports}var BA=IA();const zA=ii(BA);function FA({siteUrl:n=window.location.origin,apiUrl:e,apiKey:t}){const o="members/api";function r({type:m,resource:p,params:h=""}){return`${n.replace(/\/$/,"")}/${o}/${p}/${h}`}function s({resource:m,params:p={}}){if(e&&t){const h=new URLSearchParams({...p,key:t});return`${e.replace(/\/$/,"")}/${m}/?${h.toString()}`}return""}function l({url:m,method:p="GET",headers:h={},credentials:g=void 0,body:b=void 0}){return fetch(m,{method:p,headers:h,credentials:g,body:b})}let c=null;const d={site:{settings(){const m=s({resource:"settings"});return l({url:m,method:"GET",headers:{"Content-Type":"application/json"}}).then(function(p){if(p.ok)return p.json();throw new Error("Failed to fetch site data")})}},member:{identity(){const m=r({type:"members",resource:"session"});return l({url:m,credentials:"same-origin"}).then(function(p){return!p.ok||p.status===204?null:p.text()})},sessionData(){const m=r({type:"members",resource:"member"});return l({url:m,credentials:"same-origin"}).then(function(p){return!p.ok||p.status===204?null:p.json()})},update({name:m,expertise:p}){const h=r({type:"members",resource:"member"});return l({url:h,method:"PUT",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({name:m,expertise:p})}).then(function(b){return b.ok?b.json():null})}},comments:{async count({postId:m}){const p=m?`?ids=${m}`:"",h=r({type:"members",resource:"comments/counts",params:p}),b=await(await l({url:h,method:"GET",headers:{"Content-Type":"application/json"},credentials:"same-origin"})).json();return m?b[m]:b},browse({page:m,postId:p,order:h}){let g=null;c&&!h&&(g=`created_at:<=${c}`);const b=new URLSearchParams;b.set("limit","20"),g&&b.set("filter",g),b.set("page",m.toString()),h&&b.set("order",h);const k=r({type:"members",resource:`comments/post/${p}`,params:`?${b.toString()}`}),S=l({url:k,method:"GET",headers:{"Content-Type":"application/json"},credentials:"same-origin"}).then(function(R){if(R.ok)return R.json();throw new Error("Failed to fetch comments")});return c||S.then(R=>{const O=R.comments[0];O&&(c=O.created_at)}),S},async replies({commentId:m,afterReplyId:p,limit:h,page:g}){if(h==="all"){const R=[];let O=1,U=!0;for(;U;){const H=await this.replies({commentId:m,limit:100,page:O});R.push(...H.comments),U=!!H.meta?.pagination?.next&&H.comments.length>0,O+=1}return{comments:R,meta:{pagination:{next:!1}}}}const b=new URLSearchParams;b.set("limit",(h??5).toString()),g&&b.set("page",g.toString()),p&&b.set("filter",`id:>'${p}'`);const k=r({type:"members",resource:`comments/${m}/replies`,params:`?${b.toString()}`}),S=await l({url:k,method:"GET",headers:{"Content-Type":"application/json"},credentials:"same-origin"});if(S.ok)return S.json();throw new Error("Failed to fetch replies")},add({comment:m}){const p={comments:[m]},h=r({type:"members",resource:"comments"});return l({url:h,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(p)}).then(function(g){if(g.ok)return g.json();throw new Error("Failed to add comment")})},edit({comment:m}){const p={comments:[m]},h=r({type:"members",resource:`comments/${m.id}`});return l({url:h,method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(p)}).then(function(g){if(g.ok)return g.json();throw new Error("Failed to edit comment")})},read(m){const p=r({type:"members",resource:`comments/${m}`});return l({url:p,method:"GET",credentials:"same-origin"}).then(function(h){if(h.ok)return h.json();throw new Error("Failed to read comment")})},like({comment:m}){const p=r({type:"members",resource:`comments/${m.id}/like`});return l({url:p,method:"POST",headers:{"Content-Type":"application/json"}}).then(function(h){if(h.ok)return"Success";throw new Error("Failed to like comment")})},unlike({comment:m}){const p={comments:[m]},h=r({type:"members",resource:`comments/${m.id}/like`});return l({url:h,method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify(p)}).then(function(g){if(g.ok)return"Success";throw new Error("Failed to unlike comment")})},dislike({comment:m}){const p=r({type:"members",resource:`comments/${m.id}/dislike`});return l({url:p,method:"POST",headers:{"Content-Type":"application/json"}}).then(function(h){if(h.ok)return"Success";throw new Error("Failed to dislike comment")})},undislike({comment:m}){const p={comments:[m]},h=r({type:"members",resource:`comments/${m.id}/dislike`});return l({url:h,method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify(p)}).then(function(g){if(g.ok)return"Success";throw new Error("Failed to undislike comment")})},report({comment:m}){const p=r({type:"members",resource:`comments/${m.id}/report`});return l({url:p,method:"POST",headers:{"Content-Type":"application/json"}}).then(function(h){if(h.ok)return"Success";throw new Error("Failed to report comment")})}},init:(()=>{})};return d.init=async()=>{const[m]=await Promise.all([d.member.sessionData()]);let p={},h=null;try{const g=await d.site.settings();g.settings.labs&&Object.assign(p,g.settings.labs),h=g.settings.support_email_address||null}catch{p={}}return{member:m,labs:p,supportEmail:h}},d}function yl(n,e){for(const t of n){if(t.id===e)return t;for(const o of t.replies||[])if(o.id===e)return o}}async function UA({state:n,api:e,options:t,order:o}){let r=1;n.pagination&&n.pagination.page&&(r=n.pagination.page+1);let s;return n.admin&&n.adminApi?s=await n.adminApi.browse({page:r,postId:t.postId,order:o||n.order,memberUuid:n.member?.uuid}):s=await e.comments.browse({page:r,postId:t.postId,order:o||n.order}),{comments:[...n.comments,...s.comments].filter((d,m,p)=>p.findIndex(h=>h.id===d.id)===m),pagination:s.meta.pagination}}function _A({data:n}){return{commentsIsLoading:n}}async function HA({state:n,data:{order:e},options:t,api:o,dispatchAction:r}){r("setCommentsIsLoading",!0);try{let s;return n.admin&&n.adminApi?s=await n.adminApi.browse({page:1,postId:t.postId,order:e,memberUuid:n.member?.uuid}):s=await o.comments.browse({page:1,postId:t.postId,order:e}),{comments:[...s.comments],pagination:s.meta.pagination,order:e,commentsIsLoading:!1}}catch(s){throw console.error("Failed to set order:",s),n.commentsIsLoading=!1,s}}async function VA({state:n,api:e,data:t}){const r=(await e.comments.add({comment:t})).comments[0];return{comments:[r,...n.comments],commentCount:n.commentCount+1,commentIdToScrollTo:r.id}}async function YA({state:n,api:e,data:{reply:t,parent:o}}){const s=(await e.comments.add({comment:{...t,parent_id:o.id}})).comments[0],l=await e.comments.replies({commentId:o.id,limit:"all"}),c=l.comments.some(d=>d.id===s.id)?l.comments:[...l.comments,s];return{comments:n.comments.map(d=>d.id===o.id?{...d,replies:c,count:{...d.count,replies:c.length}}:d),commentCount:n.commentCount+1,commentIdToScrollTo:s.id}}async function qA({state:n,data:e}){return n.adminApi&&await n.adminApi.hideComment(e.id),{comments:n.comments.map(t=>{const o=t.replies.map(r=>r.id===e.id?{...r,status:"hidden"}:r);return t.id===e.id?{...t,status:"hidden",replies:o}:{...t,replies:o}}),commentCount:n.commentCount-1}}async function JA({state:n,api:e,data:t}){n.adminApi&&await n.adminApi.showComment({id:t.id});let o;n.admin&&n.adminApi?o=await n.adminApi.read({commentId:t.id,memberUuid:n.member?.uuid}):o=await e.comments.read(t.id);const r=o.comments[0];return{comments:n.comments.map(s=>{const l=s.replies.map(c=>c.id===t.id?r:c);return s.id===t.id?r:{...s,replies:l}}),commentCount:n.commentCount+1}}async function WA({state:n,data:e,dispatchAction:t}){return n.adminApi&&(await n.adminApi.pinComment({id:e.id}),t("setOrder",{order:n.order})),null}async function KA({state:n,data:e,dispatchAction:t}){return n.adminApi&&(await n.adminApi.unpinComment({id:e.id}),t("setOrder",{order:n.order})),null}async function GA({state:n,data:e}){return{comments:n.comments.map(t=>{const o=t.replies.map(r=>r.id===e.id?e.expectedLiked!==void 0&&r.liked!==e.expectedLiked||e.expectedDisliked!==void 0&&!!r.disliked!==e.expectedDisliked||e.expectedVotePending!==void 0&&!!r.votePending!==e.expectedVotePending?r:{...r,liked:e.liked,disliked:e.restoreDisliked??(e.liked?!1:r.disliked),votePending:e.votePending??r.votePending,count:{...r.count,likes:e.liked?r.count.likes+1:r.count.likes-1}}:r);return t.id===e.id?e.expectedLiked!==void 0&&t.liked!==e.expectedLiked?{...t,replies:o}:e.expectedDisliked!==void 0&&!!t.disliked!==e.expectedDisliked?{...t,replies:o}:e.expectedVotePending!==void 0&&!!t.votePending!==e.expectedVotePending?{...t,replies:o}:{...t,liked:e.liked,disliked:e.restoreDisliked??(e.liked?!1:t.disliked),votePending:e.votePending??t.votePending,replies:o,count:{...t.count,likes:e.liked?t.count.likes+1:t.count.likes-1}}:{...t,replies:o}})}}async function QA({state:n,data:e}){const t=o=>e.disliked&&e.wasLiked?o-1:e.restoreLiked?o+1:o;return{comments:n.comments.map(o=>{const r=o.replies.map(s=>s.id===e.id?e.expectedDisliked!==void 0&&s.disliked!==e.expectedDisliked||e.expectedLiked!==void 0&&s.liked!==e.expectedLiked||e.expectedVotePending!==void 0&&!!s.votePending!==e.expectedVotePending?s:{...s,disliked:e.disliked,liked:e.restoreLiked??(e.disliked?!1:s.liked),votePending:e.votePending??s.votePending,count:{...s.count,likes:t(s.count.likes)}}:s);return o.id===e.id?e.expectedDisliked!==void 0&&o.disliked!==e.expectedDisliked?{...o,replies:r}:e.expectedLiked!==void 0&&o.liked!==e.expectedLiked?{...o,replies:r}:e.expectedVotePending!==void 0&&!!o.votePending!==e.expectedVotePending?{...o,replies:r}:{...o,disliked:e.disliked,liked:e.restoreLiked??(e.disliked?!1:o.liked),votePending:e.votePending??o.votePending,replies:r,count:{...o.count,likes:t(o.count.likes)}}:{...o,replies:r}})}}async function XA({state:n,data:e}){return{comments:n.comments.map(t=>{const o=t.replies.map(r=>r.id===e.id?e.expectedVotePending!==void 0&&!!r.votePending!==e.expectedVotePending?r:{...r,votePending:e.votePending}:r);return t.id===e.id?e.expectedVotePending!==void 0&&!!t.votePending!==e.expectedVotePending?{...t,replies:o}:{...t,votePending:e.votePending,replies:o}:{...t,replies:o}})}}async function ZA({state:n,api:e,data:t,dispatchAction:o}){const r=yl(n.comments,t.id);if(r?.votePending)return{};const s=r?.disliked??!1;o("updateCommentLikeState",{id:t.id,liked:!0,wasDisliked:s,votePending:!0});try{return await e.comments.like({comment:t}),o("updateCommentVotePendingState",{id:t.id,votePending:!1,expectedVotePending:!0}),{}}catch{o("updateCommentLikeState",{id:t.id,liked:!1,restoreDisliked:s,expectedLiked:!0,expectedVotePending:!0,votePending:!1})}}async function eO({state:n,api:e,data:t,dispatchAction:o}){if(yl(n.comments,t.id)?.votePending)return{};o("updateCommentLikeState",{id:t.id,liked:!1,votePending:!0});try{return await e.comments.unlike({comment:t}),o("updateCommentVotePendingState",{id:t.id,votePending:!1,expectedVotePending:!0}),{}}catch{o("updateCommentLikeState",{id:t.id,liked:!0,expectedLiked:!1,expectedDisliked:!1,expectedVotePending:!0,votePending:!1})}}async function tO({state:n,api:e,data:t,dispatchAction:o}){const r=yl(n.comments,t.id);if(r?.votePending)return{};const s=r?.liked??!1;o("updateCommentDislikeState",{id:t.id,disliked:!0,wasLiked:s,votePending:!0});try{return await e.comments.dislike({comment:t}),o("updateCommentVotePendingState",{id:t.id,votePending:!1,expectedVotePending:!0}),{}}catch{o("updateCommentDislikeState",{id:t.id,disliked:!1,restoreLiked:s,expectedDisliked:!0,expectedVotePending:!0,votePending:!1})}}async function nO({state:n,api:e,data:t,dispatchAction:o}){if(yl(n.comments,t.id)?.votePending)return{};o("updateCommentDislikeState",{id:t.id,disliked:!1,votePending:!0});try{return await e.comments.undislike({comment:t}),o("updateCommentVotePendingState",{id:t.id,votePending:!1,expectedVotePending:!0}),{}}catch{o("updateCommentDislikeState",{id:t.id,disliked:!0,expectedDisliked:!1,expectedLiked:!1,expectedVotePending:!0,votePending:!1})}}async function oO({api:n,data:e}){return await n.comments.report({comment:e}),{}}function G0(n,e){return n.some(t=>t.in_reply_to_id===e)}function rO(n,e){return n.status==="deleted"||!e&&n.status==="hidden"}function iO(n,e){let t=n,o=!1;do o=!1,t=t.filter(r=>!rO(r,e)||G0(t,r.id)?!0:(o=!0,!1));while(o);return t}function Q0(n){return Math.max((n||0)-1,0)}async function sO({state:n,api:e,data:t,dispatchAction:o}){await e.comments.edit({comment:{id:t.id,status:"deleted"}});const r=n.comments.find(s=>s.id===t.id);return r&&(!r.replies||r.replies.length===0)?(o("setOrder",{order:n.order}),null):{comments:n.comments.map(s=>{if(s.id===t.id)return s.replies.length>0?{...s,status:"deleted"}:null;const l=s.replies.length,c=s.replies.find(b=>b.id===t.id),d=c?G0(s.replies,c.id):!1,m=s.replies.reduce((b,k)=>k.id!==t.id?(b.push(k),b):(d&&b.push({...k,status:"deleted",html:null}),b),[]),p=iO(m,n.isAdmin),h=l!==p.length||d,g={...s,replies:p};if(h&&c&&!["hidden","deleted"].includes(c.status)){const b=!c.in_reply_to_id||c.in_reply_to_id===s.id;g.count={...g.count,replies:Q0(g.count?.replies),direct_replies:b?Q0(g.count?.direct_replies):g.count?.direct_replies}}return g}).filter(Boolean),commentCount:n.commentCount-1}}async function aO({state:n,api:e,data:{comment:t,parent:o}}){return t=(await e.comments.edit({comment:t})).comments[0],{comments:n.comments.map(s=>o&&o.id===s.id?{...s,replies:s.replies.map(l=>l.id===t.id?t:l)}:s.id===t.id?t:s)}}async function lO({data:n,state:e,api:t}){const{name:o,expertise:r}=n,s={},l=e?.member?.name;o&&l!==o&&(s.name=o);const c=e?.member?.expertise;if(r!==void 0&&c!==r&&(s.expertise=r),Object.keys(s).length>0)try{const d=await t.member.update(s);if(!d)throw new Error("Failed to update member");return{member:d,success:!0}}catch(d){return{success:!1,error:d}}return null}function cO({data:n}){return{popup:n}}function uO(){return{popup:null}}function dO({data:n,state:e}){const t=e.openCommentForms.filter(r=>r.hasUnsavedChanges),o=t.findIndex(r=>r.id===n.id);return o>-1?(t[o]=n,{openCommentForms:t}):{openCommentForms:[...t,n]}}function mO({data:n}){return{commentIdToHighlight:n}}function pO({data:{commentId:n},dispatchAction:e}){return setTimeout(()=>{e("setHighlightComment",null)},3e3),{commentIdToHighlight:n}}function fO({data:{id:n,hasUnsavedChanges:e},state:t}){return{openCommentForms:t.openCommentForms.map(r=>r.id===n?{...r,hasUnsavedChanges:e}:{...r})}}function hO({data:n,state:e}){return{openCommentForms:e.openCommentForms.filter(t=>t.id!==n)}}function gO({data:n}){return{commentIdToScrollTo:n}}function yO({data:n}){return{commentIdFromHash:n}}const X0={openPopup:cO,closePopup:uO,closeCommentForm:hO,setCommentFormHasUnsavedChanges:fO,setScrollTarget:gO,setHashCommentId:yO},bO={addComment:VA,editComment:aO,hideComment:qA,pinComment:WA,unpinComment:KA,deleteComment:sO,showComment:JA,likeComment:ZA,unlikeComment:eO,dislikeComment:tO,undislikeComment:nO,reportComment:oO,addReply:YA,loadMoreComments:UA,openCommentForm:dO,updateMember:lO,setOrder:HA,highlightComment:pO,setHighlightComment:mO,setCommentsIsLoading:_A,updateCommentLikeState:GA,updateCommentDislikeState:QA,updateCommentVotePendingState:XA};function kO(n){return!!X0[n]}async function vO({action:n,data:e,state:t,api:o,adminApi:r,options:s,dispatchAction:l}){const c=bO[n];return c?await c({data:e,state:t,api:o,adminApi:r,options:s,dispatchAction:l})||{}:{}}function wO({action:n,data:e,state:t,api:o,adminApi:r,options:s}){const l=X0[n];return l?l({data:e,state:t,api:o,adminApi:r,options:s})||{}:{}}function $O({adminUrl:n}){const e=document.querySelector('iframe[data-frame="admin-auth"]');let t=1;const o={},r=new URL(n).origin;let s=null;window.addEventListener("message",function(d){if(d.origin!==r)return;let m=null;try{m=JSON.parse(d.data)}catch{return}const p=o[m.uid];p&&(delete o[m.uid],p(m.error,m.result))});function l(d,m){return new Promise((p,h)=>{function g(b,k){return b?h(b):p(k)}t+=1,o[t]=g,e.contentWindow.postMessage(JSON.stringify({uid:t,action:d,...m}),r)})}return{async getUser(){const d=await l("getUser");return!d||!d.users?null:d.users[0]},async hideComment(d){return await l("hideComment",{id:d})},async showComment({id:d}){return await l("showComment",{id:d})},async pinComment({id:d}){return await l("pinComment",{id:d})},async unpinComment({id:d}){return await l("unpinComment",{id:d})},async browse({page:d,postId:m,order:p,memberUuid:h}){let g=null;s&&!p&&(g=`created_at:<=${s}`);const b=new URLSearchParams;b.set("limit","20"),g&&b.set("filter",g),b.set("page",d.toString()),p&&b.set("order",p),h&&b.set("impersonate_member_uuid",h);const k=await l("browseComments",{postId:m,params:b.toString()});if(!s){const S=k.comments[0];S&&(s=S.created_at)}return k},async replies({commentId:d,afterReplyId:m,limit:p,memberUuid:h}){const g=new URLSearchParams;return p&&g.set("limit",p.toString()),m&&g.set("filter",`id:>'${m}'`),h&&g.set("impersonate_member_uuid",h),await l("getReplies",{commentId:d,params:g.toString()})},async read({commentId:d,memberUuid:m}){const p=new URLSearchParams;return m&&p.set("impersonate_member_uuid",m),await l("readComment",{commentId:d,...p.toString()&&{params:p.toString()}})}}}function xO(n){const e=Ee.useCallback(()=>{const s=n.dataset,l=s.ghostComments||window.location.origin,c=s.key,d=s.api,m=s.admin,p=s.postId||"",h=s.colorScheme,g=s.avatarSaturation?parseInt(s.avatarSaturation):void 0,b=s.accentColor??"#000000",k=s.commentsEnabled,S=s.title==="null"?null:s.title??"",R=s.count==="true",O=s.publication??"";return{locale:s.locale??"en",siteUrl:l,apiKey:c,apiUrl:d,postId:p,adminUrl:m,colorScheme:h,avatarSaturation:g,accentColor:b,commentsEnabled:k,title:S,showCount:R,publication:O}},[n]),t=P.useMemo(()=>e(),[]),[o,r]=Ee.useState(t);return Ee.useEffect(()=>{const s=new MutationObserver(l=>{l.some(c=>c.type==="attributes")&&r(e())});return s.observe(n,{attributes:!0}),()=>{s.disconnect()}},[n,e]),o}const SO=["Owner","Administrator","Super Editor"],Nm="count__net_score desc, created_at desc";function Dm(n,e){return n.some(t=>t.id===e||t.replies?.some(o=>o.id===e))}const CO=({scriptTag:n,initialCommentId:e})=>{const t=xO(n),[o,r]=P.useState({initStatus:"running",member:null,admin:null,comments:[],pagination:null,commentCount:0,openCommentForms:[],popup:null,labs:{},order:Nm,adminApi:null,commentsIsLoading:!1,commentIdToHighlight:null,commentIdToScrollTo:e,commentIdFromHash:e,showMissingCommentNotice:!1,supportEmail:null,isMember:!1,isAdmin:!1,isPaidOnly:!1,hasRequiredTier:!0,isCommentingDisabled:!1}),s=Ee.createRef(),l=Ee.useMemo(()=>FA({siteUrl:t.siteUrl,apiUrl:t.apiUrl,apiKey:t.apiKey}),[t]),c=P.useCallback(U=>{r(H=>(typeof U=="function"&&(U=U(H)),{...H,...U}))},[r]),d=P.useCallback(async(U,H)=>{if(kO(U)){c(Q=>wO({action:U,data:H,state:Q,api:l,adminApi:Q.adminApi,options:t}));return}return new Promise(Q=>{c(oe=>(vO({action:U,data:H,state:oe,api:l,adminApi:oe.adminApi,options:t,dispatchAction:d}).then(Z=>{const Y={...Z};Q(Y),c(Y)}).catch(console.error),{}))})},[l,t]),m=P.useMemo(()=>zA(t.locale,"comments"),[t.locale]),p={...t,...o,t:m.t,dispatchAction:d,openFormCount:P.useMemo(()=>o.openCommentForms.length,[o.openCommentForms])},h=async()=>{if(!(o.adminApi||!t.adminUrl))try{const U=$O({adminUrl:t.adminUrl});let H=null;try{if(H=await U.getUser(),(!H||!H.roles.some(Q=>SO.includes(Q.name)))&&(H=null),H){const Q=await U.browse({page:1,postId:t.postId,order:o.order,memberUuid:o.member?.uuid});c(oe=>oe.pagination&&oe.pagination.page>1||e?{adminApi:U,admin:H,isAdmin:!0}:{adminApi:U,admin:H,isAdmin:!0,comments:Q.comments,pagination:Q.meta.pagination})}}catch(Q){console.warn("[Comments] Failed to fetch admin endpoint:",Q)}c({adminApi:U,admin:H,isAdmin:!!H})}catch(U){console.error("[Comments] Failed to initialize admin authentication:",U)}},g=async(U=o.order)=>{const H=l.comments.browse({page:1,postId:t.postId,order:U}),Q=l.comments.count({postId:t.postId}),[oe,Z]=await Promise.all([H,Q]);return{comments:oe.comments,pagination:oe.meta.pagination,count:Z}},b=async U=>{try{const Q=(await l.comments.read(U)).comments?.[0];return Q&&Q.status==="published"?Q:null}catch{return null}},k=async(U,H,Q,oe,Z=o.order)=>{let Y=Q,ae=oe;for(;!Dm(Y,U)&&ae.page<ae.pages&&!(H&&Y.some(B=>B.id===H));){const fe=await l.comments.browse({page:ae.page+1,postId:t.postId,order:Z});Y=[...Y,...fe.comments],ae=fe.meta.pagination}return{comments:Y,pagination:ae}},S=async(U,H,Q,oe,Z=o.order)=>{const Y=H.parent_id,{comments:ae,pagination:fe}=await k(U,Y,Q,oe,Z);let B=ae;if(Y&&!Dm(B,U)){const{comments:V}=await l.comments.replies({commentId:Y,limit:"all"});B=B.map(X=>X.id===Y?{...X,replies:V}:X)}return{comments:B,pagination:fe,found:Dm(B,U)}},R=async()=>{try{const{member:U,labs:H,supportEmail:Q}=await l.init(),{count:oe,comments:Z,pagination:Y}=await g(Nm),ae=Nm;let fe=Z,B=Y,V=!1;if(e&&B){const N=await b(e);if(N){const L=await S(e,N,fe,B,ae);fe=L.comments,B=L.pagination,V=L.found}}const me=!!U,he=t.commentsEnabled==="paid",Le=!!U?.paid||!he;c({member:U,initStatus:"success",comments:fe,pagination:B,commentCount:oe,order:ae,labs:H,commentsIsLoading:!1,commentIdToHighlight:null,commentIdToScrollTo:V?e:null,commentIdFromHash:V?e:null,showMissingCommentNotice:!!e&&!V,supportEmail:Q,isMember:me,isPaidOnly:he,hasRequiredTier:Le,isCommentingDisabled:U?.can_comment===!1})}catch(U){console.error("[Comments] Failed to initialize:",U),c({initStatus:"failed"})}};P.useEffect(()=>{if(e){R();return}const U=new IntersectionObserver(H=>{H.forEach(Q=>{Q.isIntersecting&&(R(),s.current&&U.unobserve(s.current))})},{root:null,rootMargin:"0px",threshold:.1});return s.current&&U.observe(s.current),()=>{s.current&&U.unobserve(s.current)}},[s.current,e]);const O=o.initStatus==="success";return x.jsxs($c.Provider,{value:p,children:[x.jsx(DN,{ref:s,children:x.jsx(SN,{done:O})}),O&&t.adminUrl&&x.jsx(ww,{adminUrl:t.adminUrl,onLoad:h}),x.jsx(LN,{})]})};function EO(){let n=document.currentScript;if(!n)throw new Error("[Comments-UI] Cannot find current script tag");return n}function RO(n){if(n.previousElementSibling&&n.previousElementSibling.id===Ar)return n.previousElementSibling;if(!n.parentElement)throw new Error("[Comments-UI] Script tag does not have a parent element");const e=document.createElement("div");return e.id=Ar,n.parentElement.insertBefore(e,n),e}function NO(){const n=new URL(window.location.href);n.searchParams.get("token")&&(n.searchParams.delete("token"),window.history.replaceState({},document.title,n.href))}function DO(){const n=EO(),e=RO(n),t=wc(window.location.hash);try{NO(),wy.render(x.jsx(Ee.StrictMode,{children:x.jsx(CO,{initialCommentId:t,scriptTag:n})}),e)}catch(o){console.error(o)}}DO()}));
|
|
118
|
+
`,Le+1);he=he.substring(N+1)}this.stack=he}}},o.inherits(m.AssertionError,Error);function g(B,V){return typeof B=="string"?B.length<V?B:B.slice(0,V):B}function b(B){if(l||!o.isFunction(B))return o.inspect(B);var V=h(B),X=V?": "+V:"";return"[Function"+X+"]"}function k(B){return g(b(B.actual),128)+" "+B.operator+" "+g(b(B.expected),128)}function S(B,V,X,me,he){throw new m.AssertionError({message:X,actual:B,expected:V,operator:me,stackStartFunction:he})}m.fail=S;function R(B,V){B||S(B,!0,V,"==",m.ok)}m.ok=R,m.equal=function(V,X,me){V!=X&&S(V,X,me,"==",m.equal)},m.notEqual=function(V,X,me){V==X&&S(V,X,me,"!=",m.notEqual)},m.deepEqual=function(V,X,me){O(V,X,!1)||S(V,X,me,"deepEqual",m.deepEqual)},m.deepStrictEqual=function(V,X,me){O(V,X,!0)||S(V,X,me,"deepStrictEqual",m.deepStrictEqual)};function O(B,V,X,me){if(B===V)return!0;if(t(B)&&t(V))return e(B,V)===0;if(o.isDate(B)&&o.isDate(V))return B.getTime()===V.getTime();if(o.isRegExp(B)&&o.isRegExp(V))return B.source===V.source&&B.global===V.global&&B.multiline===V.multiline&&B.lastIndex===V.lastIndex&&B.ignoreCase===V.ignoreCase;if((B===null||typeof B!="object")&&(V===null||typeof V!="object"))return X?B===V:B==V;if(d(B)&&d(V)&&c(B)===c(V)&&!(B instanceof Float32Array||B instanceof Float64Array))return e(new Uint8Array(B.buffer),new Uint8Array(V.buffer))===0;if(t(B)!==t(V))return!1;me=me||{actual:[],expected:[]};var he=me.actual.indexOf(B);return he!==-1&&he===me.expected.indexOf(V)?!0:(me.actual.push(B),me.expected.push(V),H(B,V,X,me))}function U(B){return Object.prototype.toString.call(B)=="[object Arguments]"}function H(B,V,X,me){if(B==null||V===null||V===void 0)return!1;if(o.isPrimitive(B)||o.isPrimitive(V))return B===V;if(X&&Object.getPrototypeOf(B)!==Object.getPrototypeOf(V))return!1;var he=U(B),Ne=U(V);if(he&&!Ne||!he&&Ne)return!1;if(he)return B=s.call(B),V=s.call(V),O(B,V,X);var Le=fe(B),N=fe(V),L,G;if(Le.length!==N.length)return!1;for(Le.sort(),N.sort(),G=Le.length-1;G>=0;G--)if(Le[G]!==N[G])return!1;for(G=Le.length-1;G>=0;G--)if(L=Le[G],!O(B[L],V[L],X,me))return!1;return!0}m.notDeepEqual=function(V,X,me){O(V,X,!1)&&S(V,X,me,"notDeepEqual",m.notDeepEqual)},m.notDeepStrictEqual=Q;function Q(B,V,X){O(B,V,!0)&&S(B,V,X,"notDeepStrictEqual",Q)}m.strictEqual=function(V,X,me){V!==X&&S(V,X,me,"===",m.strictEqual)},m.notStrictEqual=function(V,X,me){V===X&&S(V,X,me,"!==",m.notStrictEqual)};function oe(B,V){if(!B||!V)return!1;if(Object.prototype.toString.call(V)=="[object RegExp]")return V.test(B);try{if(B instanceof V)return!0}catch{}return Error.isPrototypeOf(V)?!1:V.call({},B)===!0}function Z(B){var V;try{B()}catch(X){V=X}return V}function Y(B,V,X,me){var he;if(typeof V!="function")throw new TypeError('"block" argument must be a function');typeof X=="string"&&(me=X,X=null),he=Z(V),me=(X&&X.name?" ("+X.name+").":".")+(me?" "+me:"."),B&&!he&&S(he,X,"Missing expected exception"+me);var Ne=typeof me=="string",Le=!B&&o.isError(he),N=!B&&he&&!X;if((Le&&Ne&&oe(he,X)||N)&&S(he,X,"Got unwanted exception"+me),B&&he&&X&&!oe(he,X)||!B&&he)throw he}m.throws=function(B,V,X){Y(!0,B,V,X)},m.doesNotThrow=function(B,V,X){Y(!1,B,V,X)},m.ifError=function(B){if(B)throw B};function ae(B,V){B||S(B,!0,V,"==",ae)}m.strict=n(ae,m,{equal:m.strictEqual,deepEqual:m.deepStrictEqual,notEqual:m.notStrictEqual,notDeepEqual:m.notDeepStrictEqual}),m.strict.strict=m.strict;var fe=Object.keys||function(B){var V=[];for(var X in B)r.call(B,X)&&V.push(X);return V};return Td.exports}var xm,F0;function RA(){if(F0)return xm;F0=1;var n=EA();return xm=function(e){var t,o,r,s,l;for(t=Error.prepareStackTrace,Error.prepareStackTrace=function(c,d){return Error.prepareStackTrace=t,d},o=new Error().stack,l=0;l<o.length&&o[l].getFileName()!==__filename;)l++;n(l<o.length,"Unexpected: unable to find caller/index.js in the stack"),e=!e||isNaN(e)?1:e>o.length-2?o.length-2:e,o=o.slice(l+e+1);do s=o.shift(),r=s&&s.getFileName();while(o.length&&r==="module.js");return r},xm}var U0;function NA(){if(U0)return pl;U0=1;const n=Tr,e=Tr,t=JD(),o=RA();return pl.getCallerRoot=function(){try{return t(o(2))}catch{return}},pl.getProcessRoot=function(){let s=process.cwd();const l=e.join(s,"current");try{n.statSync(l).isDirectory()&&(s=l)}catch{}try{return t(s)}catch{return}},pl}var Sm,_0;function DA(){return _0||(_0=1,Sm=NA()),Sm}var gl={exports:{}},Cm,H0;function AA(){if(H0)return Cm;H0=1;var n=1e3,e=n*60,t=e*60,o=t*24,r=o*7,s=o*365.25;Cm=function(p,h){h=h||{};var g=typeof p;if(g==="string"&&p.length>0)return l(p);if(g==="number"&&isFinite(p))return h.long?d(p):c(p);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(p))};function l(p){if(p=String(p),!(p.length>100)){var h=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(p);if(h){var g=parseFloat(h[1]),b=(h[2]||"ms").toLowerCase();switch(b){case"years":case"year":case"yrs":case"yr":case"y":return g*s;case"weeks":case"week":case"w":return g*r;case"days":case"day":case"d":return g*o;case"hours":case"hour":case"hrs":case"hr":case"h":return g*t;case"minutes":case"minute":case"mins":case"min":case"m":return g*e;case"seconds":case"second":case"secs":case"sec":case"s":return g*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return g;default:return}}}}function c(p){var h=Math.abs(p);return h>=o?Math.round(p/o)+"d":h>=t?Math.round(p/t)+"h":h>=e?Math.round(p/e)+"m":h>=n?Math.round(p/n)+"s":p+"ms"}function d(p){var h=Math.abs(p);return h>=o?m(p,h,o,"day"):h>=t?m(p,h,t,"hour"):h>=e?m(p,h,e,"minute"):h>=n?m(p,h,n,"second"):p+" ms"}function m(p,h,g,b){var k=h>=g*1.5;return Math.round(p/g)+" "+b+(k?"s":"")}return Cm}var Em,V0;function OA(){if(V0)return Em;V0=1;function n(e){o.debug=o,o.default=o,o.coerce=m,o.disable=c,o.enable=s,o.enabled=d,o.humanize=AA(),o.destroy=p,Object.keys(e).forEach(h=>{o[h]=e[h]}),o.names=[],o.skips=[],o.formatters={};function t(h){let g=0;for(let b=0;b<h.length;b++)g=(g<<5)-g+h.charCodeAt(b),g|=0;return o.colors[Math.abs(g)%o.colors.length]}o.selectColor=t;function o(h){let g,b=null,k,S;function R(...O){if(!R.enabled)return;const U=R,H=Number(new Date),Q=H-(g||H);U.diff=Q,U.prev=g,U.curr=H,g=H,O[0]=o.coerce(O[0]),typeof O[0]!="string"&&O.unshift("%O");let oe=0;O[0]=O[0].replace(/%([a-zA-Z%])/g,(Y,ae)=>{if(Y==="%%")return"%";oe++;const fe=o.formatters[ae];if(typeof fe=="function"){const B=O[oe];Y=fe.call(U,B),O.splice(oe,1),oe--}return Y}),o.formatArgs.call(U,O),(U.log||o.log).apply(U,O)}return R.namespace=h,R.useColors=o.useColors(),R.color=o.selectColor(h),R.extend=r,R.destroy=o.destroy,Object.defineProperty(R,"enabled",{enumerable:!0,configurable:!1,get:()=>b!==null?b:(k!==o.namespaces&&(k=o.namespaces,S=o.enabled(h)),S),set:O=>{b=O}}),typeof o.init=="function"&&o.init(R),R}function r(h,g){const b=o(this.namespace+(typeof g>"u"?":":g)+h);return b.log=this.log,b}function s(h){o.save(h),o.namespaces=h,o.names=[],o.skips=[];const g=(typeof h=="string"?h:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const b of g)b[0]==="-"?o.skips.push(b.slice(1)):o.names.push(b)}function l(h,g){let b=0,k=0,S=-1,R=0;for(;b<h.length;)if(k<g.length&&(g[k]===h[b]||g[k]==="*"))g[k]==="*"?(S=k,R=b,k++):(b++,k++);else if(S!==-1)k=S+1,R++,b=R;else return!1;for(;k<g.length&&g[k]==="*";)k++;return k===g.length}function c(){const h=[...o.names,...o.skips.map(g=>"-"+g)].join(",");return o.enable(""),h}function d(h){for(const g of o.skips)if(l(h,g))return!1;for(const g of o.names)if(l(h,g))return!0;return!1}function m(h){return h instanceof Error?h.stack||h.message:h}function p(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return o.enable(o.load()),o}return Em=n,Em}var Y0;function TA(){return Y0||(Y0=1,(function(n,e){e.formatArgs=o,e.save=r,e.load=s,e.useColors=t,e.storage=l(),e.destroy=(()=>{let d=!1;return()=>{d||(d=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function t(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let d;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(d=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(d[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function o(d){if(d[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+d[0]+(this.useColors?"%c ":" ")+"+"+n.exports.humanize(this.diff),!this.useColors)return;const m="color: "+this.color;d.splice(1,0,m,"color: inherit");let p=0,h=0;d[0].replace(/%[a-zA-Z%]/g,g=>{g!=="%%"&&(p++,g==="%c"&&(h=p))}),d.splice(h,0,m)}e.log=console.debug||console.log||(()=>{});function r(d){try{d?e.storage.setItem("debug",d):e.storage.removeItem("debug")}catch{}}function s(){let d;try{d=e.storage.getItem("debug")||e.storage.getItem("DEBUG")}catch{}return!d&&typeof process<"u"&&"env"in process&&(d=process.env.DEBUG),d}function l(){try{return localStorage}catch{}}n.exports=OA()(e);const{formatters:c}=n.exports;c.j=function(d){try{return JSON.stringify(d)}catch(m){return"[UnexpectedJSONParseError]: "+m.message}}})(gl,gl.exports)),gl.exports}var q0;function PA(){if(q0)return ml.exports;q0=1;const n=DA(),e=TA();return ml.exports=function(o){const r=n.getCallerRoot();let s;try{const l=er("/node_modules/.pnpm/@tryghost+debug@2.2.3_supports-color@5.5.0/node_modules/@tryghost/debug/lib")(r+"/package.json");l.alias?s=l.alias:s=l.name}catch{s="undefined"}return e(s+":"+o)},ml.exports._base=e,ml.exports}var Rm,J0;function jA(){return J0||(J0=1,Rm=PA()),Rm}const MA=[{code:"af",label:"Afrikaans"},{code:"ar",label:"Arabic"},{code:"bg",label:"Bulgarian"},{code:"bn",label:"Bengali"},{code:"bs",label:"Bosnian"},{code:"ca",label:"Catalan"},{code:"cs",label:"Czech"},{code:"da",label:"Danish"},{code:"de",label:"German"},{code:"de-CH",label:"Swiss German"},{code:"el",label:"Greek"},{code:"en",label:"English"},{code:"eo",label:"Esperanto"},{code:"es",label:"Spanish"},{code:"et",label:"Estonian"},{code:"eu",label:"Basque"},{code:"fa",label:"Persian/Farsi"},{code:"fi",label:"Finnish"},{code:"fr",label:"French"},{code:"gd",label:"Gaelic (Scottish)"},{code:"he",label:"Hebrew"},{code:"hi",label:"Hindi"},{code:"hr",label:"Croatian"},{code:"hu",label:"Hungarian"},{code:"id",label:"Indonesian"},{code:"is",label:"Icelandic"},{code:"it",label:"Italian"},{code:"ja",label:"Japanese"},{code:"ko",label:"Korean"},{code:"kz",label:"Kazakh"},{code:"lt",label:"Lithuanian"},{code:"lv",label:"Latvian"},{code:"mk",label:"Macedonian"},{code:"mn",label:"Mongolian"},{code:"ms",label:"Malay"},{code:"nb",label:"Norwegian Bokmål"},{code:"ne",label:"Nepali"},{code:"nl",label:"Dutch"},{code:"nn",label:"Norwegian Nynorsk"},{code:"pa",label:"Punjabi"},{code:"pl",label:"Polish"},{code:"pt",label:"Portuguese"},{code:"pt-BR",label:"Portuguese (Brazil)"},{code:"ro",label:"Romanian"},{code:"ru",label:"Russian"},{code:"si",label:"Sinhala"},{code:"sk",label:"Slovak"},{code:"sl",label:"Slovenian"},{code:"sq",label:"Albanian"},{code:"sr",label:"Serbian"},{code:"sr-Cyrl",label:"Serbian (Cyrillic)"},{code:"sv",label:"Swedish"},{code:"sw",label:"Swahili"},{code:"ta",label:"Tamil"},{code:"th",label:"Thai"},{code:"tr",label:"Turkish"},{code:"uk",label:"Ukrainian"},{code:"ur",label:"Urdu"},{code:"uz",label:"Uzbek"},{code:"vi",label:"Vietnamese"},{code:"zh",label:"Chinese"},{code:"zh-Hant",label:"Traditional Chinese"}];var W0;function LA(){if(W0)return Or.exports;W0=1;const n=qD(),e=Tr,t=Tr,o=jA()("i18n"),r=MA,s=r.map(d=>d.code);function l(d,m){return d.reduce((p,h)=>{let g;try{g=er("/ghost/i18n/lib")(`../locales/${h}/${m}.json`)}catch{g=er("/ghost/i18n/lib")(`../locales/en/${m}.json`)}return p[h]={[m]:{...g,...g.default&&typeof g.default=="object"?g.default:{}}},p},{})}function c(d,m){if(!m)return{[d]:{theme:{}}};let p=[];try{p=t.readdirSync(m).filter(b=>b.endsWith(".json")).map(b=>b.replace(".json",""))}catch{p=[d,"en"]}return[...new Set([d,...p,"en"])].reduce((g,b)=>{let k,S=!1;const R=e.join(m,`${b}.json`);if(t.existsSync(R))try{delete require.cache[er("/ghost/i18n/lib").resolve(R)],k=er("/ghost/i18n/lib")(R)}catch{o(`Error loading theme locale file: ${b}`),S=!0}else S=!0;if(S)if(b!=="en")try{const O=e.join(m,"en.json");t.existsSync(O)?(delete require.cache[er("/ghost/i18n/lib").resolve(O)],k=er("/ghost/i18n/lib")(O)):k={}}catch{k={}}else o("Theme en.json file not found"),k={};return g[b]={theme:{...k,...k.default&&typeof k.default=="object"?k.default:{}}},g},{})}return Or.exports=(d="en",m="portal",p={})=>{const h=n.createInstance(),g={prefix:"{",suffix:"}"};(m==="theme"||m==="portal")&&(g.escapeValue=!1);let b;return m!=="theme"?b=l(s,m):(o(`generateThemeResources: ${d}, ${p.themePath}`),b=c(d,p.themePath)),h.init({lng:d,nsSeparator:!1,keySeparator:!1,returnEmptyString:!1,fallbackLng:{no:["nb","en"],default:["en"]},ns:m,defaultNS:m,interpolation:g,resources:b}),h},Or.exports.SUPPORTED_LOCALES=s,Or.exports.LOCALE_DATA=r,Or.exports.generateResources=l,Or.exports}var K0;function IA(){if(K0)return Zo.exports;K0=1;const n=LA();return Zo.exports=n,Zo.exports.default=n,Zo.exports.LOCALE_DATA=n.LOCALE_DATA,Zo.exports.SUPPORTED_LOCALES=n.SUPPORTED_LOCALES,Zo.exports.generateResources=n.generateResources,Zo.exports}var BA=IA();const zA=ii(BA);function FA({siteUrl:n=window.location.origin,apiUrl:e,apiKey:t}){const o="members/api";function r({type:m,resource:p,params:h=""}){return`${n.replace(/\/$/,"")}/${o}/${p}/${h}`}function s({resource:m,params:p={}}){if(e&&t){const h=new URLSearchParams({...p,key:t});return`${e.replace(/\/$/,"")}/${m}/?${h.toString()}`}return""}function l({url:m,method:p="GET",headers:h={},credentials:g=void 0,body:b=void 0}){return fetch(m,{method:p,headers:h,credentials:g,body:b})}let c=null;const d={site:{settings(){const m=s({resource:"settings"});return l({url:m,method:"GET",headers:{"Content-Type":"application/json"}}).then(function(p){if(p.ok)return p.json();throw new Error("Failed to fetch site data")})}},member:{identity(){const m=r({type:"members",resource:"session"});return l({url:m,credentials:"same-origin"}).then(function(p){return!p.ok||p.status===204?null:p.text()})},sessionData(){const m=r({type:"members",resource:"member"});return l({url:m,credentials:"same-origin"}).then(function(p){return!p.ok||p.status===204?null:p.json()})},update({name:m,expertise:p}){const h=r({type:"members",resource:"member"});return l({url:h,method:"PUT",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({name:m,expertise:p})}).then(function(b){return b.ok?b.json():null})}},comments:{async count({postId:m}){const p=m?`?ids=${m}`:"",h=r({type:"members",resource:"comments/counts",params:p}),b=await(await l({url:h,method:"GET",headers:{"Content-Type":"application/json"},credentials:"same-origin"})).json();return m?b[m]:b},browse({page:m,postId:p,order:h}){let g=null;c&&!h&&(g=`created_at:<=${c}`);const b=new URLSearchParams;b.set("limit","20"),g&&b.set("filter",g),b.set("page",m.toString()),h&&b.set("order",h);const k=r({type:"members",resource:`comments/post/${p}`,params:`?${b.toString()}`}),S=l({url:k,method:"GET",headers:{"Content-Type":"application/json"},credentials:"same-origin"}).then(function(R){if(R.ok)return R.json();throw new Error("Failed to fetch comments")});return c||S.then(R=>{const O=R.comments[0];O&&(c=O.created_at)}),S},async replies({commentId:m,afterReplyId:p,limit:h,page:g}){if(h==="all"){const R=[];let O=1,U=!0;for(;U;){const H=await this.replies({commentId:m,limit:100,page:O});R.push(...H.comments),U=!!H.meta?.pagination?.next&&H.comments.length>0,O+=1}return{comments:R,meta:{pagination:{next:!1}}}}const b=new URLSearchParams;b.set("limit",(h??5).toString()),g&&b.set("page",g.toString()),p&&b.set("filter",`id:>'${p}'`);const k=r({type:"members",resource:`comments/${m}/replies`,params:`?${b.toString()}`}),S=await l({url:k,method:"GET",headers:{"Content-Type":"application/json"},credentials:"same-origin"});if(S.ok)return S.json();throw new Error("Failed to fetch replies")},add({comment:m}){const p={comments:[m]},h=r({type:"members",resource:"comments"});return l({url:h,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(p)}).then(function(g){if(g.ok)return g.json();throw new Error("Failed to add comment")})},edit({comment:m}){const p={comments:[m]},h=r({type:"members",resource:`comments/${m.id}`});return l({url:h,method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(p)}).then(function(g){if(g.ok)return g.json();throw new Error("Failed to edit comment")})},read(m){const p=r({type:"members",resource:`comments/${m}`});return l({url:p,method:"GET",credentials:"same-origin"}).then(function(h){if(h.ok)return h.json();throw new Error("Failed to read comment")})},like({comment:m}){const p=r({type:"members",resource:`comments/${m.id}/like`});return l({url:p,method:"POST",headers:{"Content-Type":"application/json"}}).then(function(h){if(h.ok)return"Success";throw new Error("Failed to like comment")})},unlike({comment:m}){const p={comments:[m]},h=r({type:"members",resource:`comments/${m.id}/like`});return l({url:h,method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify(p)}).then(function(g){if(g.ok)return"Success";throw new Error("Failed to unlike comment")})},dislike({comment:m}){const p=r({type:"members",resource:`comments/${m.id}/dislike`});return l({url:p,method:"POST",headers:{"Content-Type":"application/json"}}).then(function(h){if(h.ok)return"Success";throw new Error("Failed to dislike comment")})},undislike({comment:m}){const p={comments:[m]},h=r({type:"members",resource:`comments/${m.id}/dislike`});return l({url:h,method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify(p)}).then(function(g){if(g.ok)return"Success";throw new Error("Failed to undislike comment")})},report({comment:m}){const p=r({type:"members",resource:`comments/${m.id}/report`});return l({url:p,method:"POST",headers:{"Content-Type":"application/json"}}).then(function(h){if(h.ok)return"Success";throw new Error("Failed to report comment")})}},init:(()=>{})};return d.init=async()=>{const[m]=await Promise.all([d.member.sessionData()]);let p={},h=null;try{const g=await d.site.settings();g.settings.labs&&Object.assign(p,g.settings.labs),h=g.settings.support_email_address||null}catch{p={}}return{member:m,labs:p,supportEmail:h}},d}function yl(n,e){for(const t of n){if(t.id===e)return t;for(const o of t.replies||[])if(o.id===e)return o}}async function UA({state:n,api:e,options:t,order:o}){let r=1;n.pagination&&n.pagination.page&&(r=n.pagination.page+1);let s;return n.admin&&n.adminApi?s=await n.adminApi.browse({page:r,postId:t.postId,order:o||n.order,memberUuid:n.member?.uuid}):s=await e.comments.browse({page:r,postId:t.postId,order:o||n.order}),{comments:[...n.comments,...s.comments].filter((d,m,p)=>p.findIndex(h=>h.id===d.id)===m),pagination:s.meta.pagination}}function _A({data:n}){return{commentsIsLoading:n}}async function HA({state:n,data:{order:e},options:t,api:o,dispatchAction:r}){r("setCommentsIsLoading",!0);try{let s;return n.admin&&n.adminApi?s=await n.adminApi.browse({page:1,postId:t.postId,order:e,memberUuid:n.member?.uuid}):s=await o.comments.browse({page:1,postId:t.postId,order:e}),{comments:[...s.comments],pagination:s.meta.pagination,order:e,commentsIsLoading:!1}}catch(s){throw console.error("Failed to set order:",s),n.commentsIsLoading=!1,s}}async function VA({state:n,api:e,data:t}){const r=(await e.comments.add({comment:t})).comments[0];return{comments:[r,...n.comments],commentCount:n.commentCount+1,commentIdToScrollTo:r.id}}async function YA({state:n,api:e,data:{reply:t,parent:o}}){const s=(await e.comments.add({comment:{...t,parent_id:o.id}})).comments[0],l=await e.comments.replies({commentId:o.id,limit:"all"}),c=l.comments.some(d=>d.id===s.id)?l.comments:[...l.comments,s];return{comments:n.comments.map(d=>d.id===o.id?{...d,replies:c,count:{...d.count,replies:c.length}}:d),commentCount:n.commentCount+1,commentIdToScrollTo:s.id}}async function qA({state:n,data:e}){return n.adminApi&&await n.adminApi.hideComment(e.id),{comments:n.comments.map(t=>{const o=t.replies.map(r=>r.id===e.id?{...r,status:"hidden"}:r);return t.id===e.id?{...t,status:"hidden",replies:o}:{...t,replies:o}}),commentCount:n.commentCount-1}}async function JA({state:n,api:e,data:t}){n.adminApi&&await n.adminApi.showComment({id:t.id});let o;n.admin&&n.adminApi?o=await n.adminApi.read({commentId:t.id,memberUuid:n.member?.uuid}):o=await e.comments.read(t.id);const r=o.comments[0];return{comments:n.comments.map(s=>{const l=s.replies.map(c=>c.id===t.id?r:c);return s.id===t.id?r:{...s,replies:l}}),commentCount:n.commentCount+1}}async function WA({state:n,data:e,dispatchAction:t}){return n.adminApi&&(await n.adminApi.pinComment({id:e.id}),t("setOrder",{order:n.order})),null}async function KA({state:n,data:e,dispatchAction:t}){return n.adminApi&&(await n.adminApi.unpinComment({id:e.id}),t("setOrder",{order:n.order})),null}async function GA({state:n,data:e}){return{comments:n.comments.map(t=>{const o=t.replies.map(r=>r.id===e.id?e.expectedLiked!==void 0&&r.liked!==e.expectedLiked||e.expectedDisliked!==void 0&&!!r.disliked!==e.expectedDisliked||e.expectedVotePending!==void 0&&!!r.votePending!==e.expectedVotePending?r:{...r,liked:e.liked,disliked:e.restoreDisliked??(e.liked?!1:r.disliked),votePending:e.votePending??r.votePending,count:{...r.count,likes:e.liked?r.count.likes+1:r.count.likes-1}}:r);return t.id===e.id?e.expectedLiked!==void 0&&t.liked!==e.expectedLiked?{...t,replies:o}:e.expectedDisliked!==void 0&&!!t.disliked!==e.expectedDisliked?{...t,replies:o}:e.expectedVotePending!==void 0&&!!t.votePending!==e.expectedVotePending?{...t,replies:o}:{...t,liked:e.liked,disliked:e.restoreDisliked??(e.liked?!1:t.disliked),votePending:e.votePending??t.votePending,replies:o,count:{...t.count,likes:e.liked?t.count.likes+1:t.count.likes-1}}:{...t,replies:o}})}}async function QA({state:n,data:e}){const t=o=>e.disliked&&e.wasLiked?o-1:e.restoreLiked?o+1:o;return{comments:n.comments.map(o=>{const r=o.replies.map(s=>s.id===e.id?e.expectedDisliked!==void 0&&s.disliked!==e.expectedDisliked||e.expectedLiked!==void 0&&s.liked!==e.expectedLiked||e.expectedVotePending!==void 0&&!!s.votePending!==e.expectedVotePending?s:{...s,disliked:e.disliked,liked:e.restoreLiked??(e.disliked?!1:s.liked),votePending:e.votePending??s.votePending,count:{...s.count,likes:t(s.count.likes)}}:s);return o.id===e.id?e.expectedDisliked!==void 0&&o.disliked!==e.expectedDisliked?{...o,replies:r}:e.expectedLiked!==void 0&&o.liked!==e.expectedLiked?{...o,replies:r}:e.expectedVotePending!==void 0&&!!o.votePending!==e.expectedVotePending?{...o,replies:r}:{...o,disliked:e.disliked,liked:e.restoreLiked??(e.disliked?!1:o.liked),votePending:e.votePending??o.votePending,replies:r,count:{...o.count,likes:t(o.count.likes)}}:{...o,replies:r}})}}async function XA({state:n,data:e}){return{comments:n.comments.map(t=>{const o=t.replies.map(r=>r.id===e.id?e.expectedVotePending!==void 0&&!!r.votePending!==e.expectedVotePending?r:{...r,votePending:e.votePending}:r);return t.id===e.id?e.expectedVotePending!==void 0&&!!t.votePending!==e.expectedVotePending?{...t,replies:o}:{...t,votePending:e.votePending,replies:o}:{...t,replies:o}})}}async function ZA({state:n,api:e,data:t,dispatchAction:o}){const r=yl(n.comments,t.id);if(r?.votePending)return{};const s=r?.disliked??!1;o("updateCommentLikeState",{id:t.id,liked:!0,wasDisliked:s,votePending:!0});try{return await e.comments.like({comment:t}),o("updateCommentVotePendingState",{id:t.id,votePending:!1,expectedVotePending:!0}),{}}catch{o("updateCommentLikeState",{id:t.id,liked:!1,restoreDisliked:s,expectedLiked:!0,expectedVotePending:!0,votePending:!1})}}async function eO({state:n,api:e,data:t,dispatchAction:o}){if(yl(n.comments,t.id)?.votePending)return{};o("updateCommentLikeState",{id:t.id,liked:!1,votePending:!0});try{return await e.comments.unlike({comment:t}),o("updateCommentVotePendingState",{id:t.id,votePending:!1,expectedVotePending:!0}),{}}catch{o("updateCommentLikeState",{id:t.id,liked:!0,expectedLiked:!1,expectedDisliked:!1,expectedVotePending:!0,votePending:!1})}}async function tO({state:n,api:e,data:t,dispatchAction:o}){const r=yl(n.comments,t.id);if(r?.votePending)return{};const s=r?.liked??!1;o("updateCommentDislikeState",{id:t.id,disliked:!0,wasLiked:s,votePending:!0});try{return await e.comments.dislike({comment:t}),o("updateCommentVotePendingState",{id:t.id,votePending:!1,expectedVotePending:!0}),{}}catch{o("updateCommentDislikeState",{id:t.id,disliked:!1,restoreLiked:s,expectedDisliked:!0,expectedVotePending:!0,votePending:!1})}}async function nO({state:n,api:e,data:t,dispatchAction:o}){if(yl(n.comments,t.id)?.votePending)return{};o("updateCommentDislikeState",{id:t.id,disliked:!1,votePending:!0});try{return await e.comments.undislike({comment:t}),o("updateCommentVotePendingState",{id:t.id,votePending:!1,expectedVotePending:!0}),{}}catch{o("updateCommentDislikeState",{id:t.id,disliked:!0,expectedDisliked:!1,expectedLiked:!1,expectedVotePending:!0,votePending:!1})}}async function oO({api:n,data:e}){return await n.comments.report({comment:e}),{}}function G0(n,e){return n.some(t=>t.in_reply_to_id===e)}function rO(n,e){return n.status==="deleted"||!e&&n.status==="hidden"}function iO(n,e){let t=n,o=!1;do o=!1,t=t.filter(r=>!rO(r,e)||G0(t,r.id)?!0:(o=!0,!1));while(o);return t}function Q0(n){return Math.max((n||0)-1,0)}async function sO({state:n,api:e,data:t,dispatchAction:o}){await e.comments.edit({comment:{id:t.id,status:"deleted"}});const r=n.comments.find(s=>s.id===t.id);return r&&(!r.replies||r.replies.length===0)?(o("setOrder",{order:n.order}),null):{comments:n.comments.map(s=>{if(s.id===t.id)return s.replies.length>0?{...s,status:"deleted"}:null;const l=s.replies.length,c=s.replies.find(b=>b.id===t.id),d=c?G0(s.replies,c.id):!1,m=s.replies.reduce((b,k)=>k.id!==t.id?(b.push(k),b):(d&&b.push({...k,status:"deleted",html:null}),b),[]),p=iO(m,n.isAdmin),h=l!==p.length||d,g={...s,replies:p};if(h&&c&&!["hidden","deleted"].includes(c.status)){const b=!c.in_reply_to_id||c.in_reply_to_id===s.id;g.count={...g.count,replies:Q0(g.count?.replies),direct_replies:b?Q0(g.count?.direct_replies):g.count?.direct_replies}}return g}).filter(Boolean),commentCount:n.commentCount-1}}async function aO({state:n,api:e,data:{comment:t,parent:o}}){return t=(await e.comments.edit({comment:t})).comments[0],{comments:n.comments.map(s=>o&&o.id===s.id?{...s,replies:s.replies.map(l=>l.id===t.id?t:l)}:s.id===t.id?t:s)}}async function lO({data:n,state:e,api:t}){const{name:o,expertise:r}=n,s={},l=e?.member?.name;o&&l!==o&&(s.name=o);const c=e?.member?.expertise;if(r!==void 0&&c!==r&&(s.expertise=r),Object.keys(s).length>0)try{const d=await t.member.update(s);if(!d)throw new Error("Failed to update member");return{member:d,success:!0}}catch(d){return{success:!1,error:d}}return null}function cO({data:n}){return{popup:n}}function uO(){return{popup:null}}function dO({data:n,state:e}){const t=e.openCommentForms.filter(r=>r.hasUnsavedChanges),o=t.findIndex(r=>r.id===n.id);return o>-1?(t[o]=n,{openCommentForms:t}):{openCommentForms:[...t,n]}}function mO({data:n}){return{commentIdToHighlight:n}}function pO({data:{commentId:n},dispatchAction:e}){return setTimeout(()=>{e("setHighlightComment",null)},3e3),{commentIdToHighlight:n}}function fO({data:{id:n,hasUnsavedChanges:e},state:t}){return{openCommentForms:t.openCommentForms.map(r=>r.id===n?{...r,hasUnsavedChanges:e}:{...r})}}function hO({data:n,state:e}){return{openCommentForms:e.openCommentForms.filter(t=>t.id!==n)}}function gO({data:n}){return{commentIdToScrollTo:n}}function yO({data:n}){return{commentIdFromHash:n}}const X0={openPopup:cO,closePopup:uO,closeCommentForm:hO,setCommentFormHasUnsavedChanges:fO,setScrollTarget:gO,setHashCommentId:yO},bO={addComment:VA,editComment:aO,hideComment:qA,pinComment:WA,unpinComment:KA,deleteComment:sO,showComment:JA,likeComment:ZA,unlikeComment:eO,dislikeComment:tO,undislikeComment:nO,reportComment:oO,addReply:YA,loadMoreComments:UA,openCommentForm:dO,updateMember:lO,setOrder:HA,highlightComment:pO,setHighlightComment:mO,setCommentsIsLoading:_A,updateCommentLikeState:GA,updateCommentDislikeState:QA,updateCommentVotePendingState:XA};function kO(n){return!!X0[n]}async function vO({action:n,data:e,state:t,api:o,adminApi:r,options:s,dispatchAction:l}){const c=bO[n];return c?await c({data:e,state:t,api:o,adminApi:r,options:s,dispatchAction:l})||{}:{}}function wO({action:n,data:e,state:t,api:o,adminApi:r,options:s}){const l=X0[n];return l?l({data:e,state:t,api:o,adminApi:r,options:s})||{}:{}}function $O({adminUrl:n}){const e=document.querySelector('iframe[data-frame="admin-auth"]');let t=1;const o={},r=new URL(n).origin;let s=null;window.addEventListener("message",function(d){if(d.origin!==r)return;let m=null;try{m=JSON.parse(d.data)}catch{return}const p=o[m.uid];p&&(delete o[m.uid],p(m.error,m.result))});function l(d,m){return new Promise((p,h)=>{function g(b,k){return b?h(b):p(k)}t+=1,o[t]=g,e.contentWindow.postMessage(JSON.stringify({uid:t,action:d,...m}),r)})}return{async getUser(){const d=await l("getUser");return!d||!d.users?null:d.users[0]},async hideComment(d){return await l("hideComment",{id:d})},async showComment({id:d}){return await l("showComment",{id:d})},async pinComment({id:d}){return await l("pinComment",{id:d})},async unpinComment({id:d}){return await l("unpinComment",{id:d})},async browse({page:d,postId:m,order:p,memberUuid:h}){let g=null;s&&!p&&(g=`created_at:<=${s}`);const b=new URLSearchParams;b.set("limit","20"),g&&b.set("filter",g),b.set("page",d.toString()),p&&b.set("order",p),h&&b.set("impersonate_member_uuid",h);const k=await l("browseComments",{postId:m,params:b.toString()});if(!s){const S=k.comments[0];S&&(s=S.created_at)}return k},async replies({commentId:d,afterReplyId:m,limit:p,memberUuid:h}){const g=new URLSearchParams;return p&&g.set("limit",p.toString()),m&&g.set("filter",`id:>'${m}'`),h&&g.set("impersonate_member_uuid",h),await l("getReplies",{commentId:d,params:g.toString()})},async read({commentId:d,memberUuid:m}){const p=new URLSearchParams;return m&&p.set("impersonate_member_uuid",m),await l("readComment",{commentId:d,...p.toString()&&{params:p.toString()}})}}}function xO(n){const e=Ee.useCallback(()=>{const s=n.dataset,l=s.ghostComments||window.location.origin,c=s.key,d=s.api,m=s.admin,p=s.postId||"",h=s.colorScheme,g=s.avatarSaturation?parseInt(s.avatarSaturation):void 0,b=s.accentColor??"#000000",k=s.commentsEnabled,S=s.title==="null"?null:s.title??"",R=s.count==="true",O=s.publication??"";return{locale:s.locale??"en",siteUrl:l,apiKey:c,apiUrl:d,postId:p,adminUrl:m,colorScheme:h,avatarSaturation:g,accentColor:b,commentsEnabled:k,title:S,showCount:R,publication:O}},[n]),t=P.useMemo(()=>e(),[]),[o,r]=Ee.useState(t);return Ee.useEffect(()=>{const s=new MutationObserver(l=>{l.some(c=>c.type==="attributes")&&r(e())});return s.observe(n,{attributes:!0}),()=>{s.disconnect()}},[n,e]),o}const SO=["Owner","Administrator","Super Editor"],Nm="count__net_score desc, created_at desc";function Dm(n,e){return n.some(t=>t.id===e||t.replies?.some(o=>o.id===e))}const CO=({scriptTag:n,initialCommentId:e})=>{const t=xO(n),[o,r]=P.useState({initStatus:"running",member:null,admin:null,comments:[],pagination:null,commentCount:0,openCommentForms:[],popup:null,labs:{},order:Nm,adminApi:null,commentsIsLoading:!1,commentIdToHighlight:null,commentIdToScrollTo:e,commentIdFromHash:e,showMissingCommentNotice:!1,supportEmail:null,isMember:!1,isAdmin:!1,isPaidOnly:!1,hasRequiredTier:!0,isCommentingDisabled:!1}),s=Ee.createRef(),l=Ee.useMemo(()=>FA({siteUrl:t.siteUrl,apiUrl:t.apiUrl,apiKey:t.apiKey}),[t]),c=P.useCallback(U=>{r(H=>(typeof U=="function"&&(U=U(H)),{...H,...U}))},[r]),d=P.useCallback(async(U,H)=>{if(kO(U)){c(Q=>wO({action:U,data:H,state:Q,api:l,adminApi:Q.adminApi,options:t}));return}return new Promise(Q=>{c(oe=>(vO({action:U,data:H,state:oe,api:l,adminApi:oe.adminApi,options:t,dispatchAction:d}).then(Z=>{const Y={...Z};Q(Y),c(Y)}).catch(console.error),{}))})},[l,t]),m=P.useMemo(()=>zA(t.locale,"comments"),[t.locale]),p={...t,...o,t:m.t,dispatchAction:d,openFormCount:P.useMemo(()=>o.openCommentForms.length,[o.openCommentForms])},h=async()=>{if(!(o.adminApi||!t.adminUrl))try{const U=$O({adminUrl:t.adminUrl});let H=null;try{if(H=await U.getUser(),(!H||!H.roles.some(Q=>SO.includes(Q.name)))&&(H=null),H){const Q=await U.browse({page:1,postId:t.postId,order:o.order,memberUuid:o.member?.uuid});c(oe=>oe.pagination&&oe.pagination.page>1||e?{adminApi:U,admin:H,isAdmin:!0}:{adminApi:U,admin:H,isAdmin:!0,comments:Q.comments,pagination:Q.meta.pagination})}}catch(Q){console.warn("[Comments] Failed to fetch admin endpoint:",Q)}c({adminApi:U,admin:H,isAdmin:!!H})}catch(U){console.error("[Comments] Failed to initialize admin authentication:",U)}},g=async(U=o.order)=>{const H=l.comments.browse({page:1,postId:t.postId,order:U}),Q=l.comments.count({postId:t.postId}),[oe,Z]=await Promise.all([H,Q]);return{comments:oe.comments,pagination:oe.meta.pagination,count:Z}},b=async U=>{try{const Q=(await l.comments.read(U)).comments?.[0];return Q&&Q.status==="published"?Q:null}catch{return null}},k=async(U,H,Q,oe,Z=o.order)=>{let Y=Q,ae=oe;for(;!Dm(Y,U)&&ae.page<ae.pages&&!(H&&Y.some(B=>B.id===H));){const fe=await l.comments.browse({page:ae.page+1,postId:t.postId,order:Z});Y=[...Y,...fe.comments],ae=fe.meta.pagination}return{comments:Y,pagination:ae}},S=async(U,H,Q,oe,Z=o.order)=>{const Y=H.parent_id,{comments:ae,pagination:fe}=await k(U,Y,Q,oe,Z);let B=ae;if(Y&&!Dm(B,U)){const{comments:V}=await l.comments.replies({commentId:Y,limit:"all"});B=B.map(X=>X.id===Y?{...X,replies:V}:X)}return{comments:B,pagination:fe,found:Dm(B,U)}},R=async()=>{try{const{member:U,labs:H,supportEmail:Q}=await l.init(),{count:oe,comments:Z,pagination:Y}=await g(Nm),ae=Nm;let fe=Z,B=Y,V=!1;if(e&&B){const N=await b(e);if(N){const L=await S(e,N,fe,B,ae);fe=L.comments,B=L.pagination,V=L.found}}const me=!!U,he=t.commentsEnabled==="paid",Le=!!U?.paid||!he;c({member:U,initStatus:"success",comments:fe,pagination:B,commentCount:oe,order:ae,labs:H,commentsIsLoading:!1,commentIdToHighlight:null,commentIdToScrollTo:V?e:null,commentIdFromHash:V?e:null,showMissingCommentNotice:!!e&&!V,supportEmail:Q,isMember:me,isPaidOnly:he,hasRequiredTier:Le,isCommentingDisabled:U?.can_comment===!1})}catch(U){console.error("[Comments] Failed to initialize:",U),c({initStatus:"failed"})}};P.useEffect(()=>{if(e){R();return}const U=new IntersectionObserver(H=>{H.forEach(Q=>{Q.isIntersecting&&(R(),s.current&&U.unobserve(s.current))})},{root:null,rootMargin:"0px",threshold:.1});return s.current&&U.observe(s.current),()=>{s.current&&U.unobserve(s.current)}},[s.current,e]);const O=o.initStatus==="success";return x.jsxs($c.Provider,{value:p,children:[x.jsx(DN,{ref:s,children:x.jsx(SN,{done:O})}),O&&t.adminUrl&&x.jsx(ww,{adminUrl:t.adminUrl,onLoad:h}),x.jsx(LN,{})]})};function EO(){let n=document.currentScript;if(!n)throw new Error("[Comments-UI] Cannot find current script tag");return n}function RO(n){if(n.previousElementSibling&&n.previousElementSibling.id===Ar)return n.previousElementSibling;if(!n.parentElement)throw new Error("[Comments-UI] Script tag does not have a parent element");const e=document.createElement("div");return e.id=Ar,n.parentElement.insertBefore(e,n),e}function NO(){const n=new URL(window.location.href);n.searchParams.get("token")&&(n.searchParams.delete("token"),window.history.replaceState({},document.title,n.href))}function DO(){const n=EO(),e=RO(n),t=wc(window.location.hash);try{NO(),wy.render(x.jsx(Ee.StrictMode,{children:x.jsx(CO,{initialCommentId:t,scriptTag:n})}),e)}catch(o){console.error(o)}}DO()}));
|
|
119
119
|
//# sourceMappingURL=comments-ui.min.js.map
|