@tryghost/sodo-search 1.8.12 → 1.8.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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tryghost/sodo-search",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.14",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": "https://github.com/TryGhost/Ghost",
|
|
6
6
|
"author": "Ghost Foundation",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"registry": "https://registry.npmjs.org/"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@tryghost/debug": "
|
|
17
|
+
"@tryghost/debug": "catalog:",
|
|
18
18
|
"@tryghost/i18n": "workspace:*",
|
|
19
19
|
"flexsearch": "0.8.153",
|
|
20
20
|
"react": "17.0.2",
|
package/umd/sodo-search.min.js
CHANGED
|
@@ -63,5 +63,5 @@ Add a <Suspense fallback=...> component higher in the tree to provide a loading
|
|
|
63
63
|
* @license MIT
|
|
64
64
|
*/function dd(e,t){if(e===t)return 0;for(var n=e.length,r=t.length,s=0,o=Math.min(n,r);s<o;++s)if(e[s]!==t[s]){n=e[s],r=t[s];break}return n<r?-1:r<n?1:0}function ns(e){return pe.Buffer&&typeof pe.Buffer.isBuffer=="function"?pe.Buffer.isBuffer(e):!!(e!=null&&e._isBuffer)}var qe=hd,r1=Object.prototype.hasOwnProperty,pd=Array.prototype.slice,gd=function(){return(function(){}).name==="foo"}();function md(e){return Object.prototype.toString.call(e)}function yd(e){return ns(e)||typeof pe.ArrayBuffer!="function"?!1:typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e?!!(e instanceof DataView||e.buffer&&e.buffer instanceof ArrayBuffer):!1}var W=Ih.exports=xd,s1=/\s*function\s+([^\(\s]*)\s*/;function vd(e){if(qe.isFunction(e)){if(gd)return e.name;var t=e.toString(),n=t.match(s1);return n&&n[1]}}W.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=o1(this),this.generatedMessage=!0);var n=t.stackStartFunction||Ae;if(Error.captureStackTrace)Error.captureStackTrace(this,n);else{var r=new Error;if(r.stack){var s=r.stack,o=vd(n),i=s.indexOf(`
|
|
65
65
|
`+o);if(i>=0){var l=s.indexOf(`
|
|
66
|
-
`,i+1);s=s.substring(l+1)}this.stack=s}}},qe.inherits(W.AssertionError,Error);function wd(e,t){return typeof e=="string"?e.length<t?e:e.slice(0,t):e}function Sd(e){if(gd||!qe.isFunction(e))return qe.inspect(e);var t=vd(e),n=t?": "+t:"";return"[Function"+n+"]"}function o1(e){return wd(Sd(e.actual),128)+" "+e.operator+" "+wd(Sd(e.expected),128)}function Ae(e,t,n,r,s){throw new W.AssertionError({message:n,actual:e,expected:t,operator:r,stackStartFunction:s})}W.fail=Ae;function xd(e,t){e||Ae(e,!0,t,"==",W.ok)}W.ok=xd,W.equal=function(t,n,r){t!=n&&Ae(t,n,r,"==",W.equal)},W.notEqual=function(t,n,r){t==n&&Ae(t,n,r,"!=",W.notEqual)},W.deepEqual=function(t,n,r){Hn(t,n,!1)||Ae(t,n,r,"deepEqual",W.deepEqual)},W.deepStrictEqual=function(t,n,r){Hn(t,n,!0)||Ae(t,n,r,"deepStrictEqual",W.deepStrictEqual)};function Hn(e,t,n,r){if(e===t)return!0;if(ns(e)&&ns(t))return dd(e,t)===0;if(qe.isDate(e)&&qe.isDate(t))return e.getTime()===t.getTime();if(qe.isRegExp(e)&&qe.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if((e===null||typeof e!="object")&&(t===null||typeof t!="object"))return n?e===t:e==t;if(yd(e)&&yd(t)&&md(e)===md(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return dd(new Uint8Array(e.buffer),new Uint8Array(t.buffer))===0;if(ns(e)!==ns(t))return!1;r=r||{actual:[],expected:[]};var s=r.actual.indexOf(e);return s!==-1&&s===r.expected.indexOf(t)?!0:(r.actual.push(e),r.expected.push(t),i1(e,t,n,r))}function Cd(e){return Object.prototype.toString.call(e)=="[object Arguments]"}function i1(e,t,n,r){if(e==null||t===null||t===void 0)return!1;if(qe.isPrimitive(e)||qe.isPrimitive(t))return e===t;if(n&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var s=Cd(e),o=Cd(t);if(s&&!o||!s&&o)return!1;if(s)return e=pd.call(e),t=pd.call(t),Hn(e,t,n);var i=jd(e),l=jd(t),a,u;if(i.length!==l.length)return!1;for(i.sort(),l.sort(),u=i.length-1;u>=0;u--)if(i[u]!==l[u])return!1;for(u=i.length-1;u>=0;u--)if(a=i[u],!Hn(e[a],t[a],n,r))return!1;return!0}W.notDeepEqual=function(t,n,r){Hn(t,n,!1)&&Ae(t,n,r,"notDeepEqual",W.notDeepEqual)},W.notDeepStrictEqual=$d;function $d(e,t,n){Hn(e,t,!0)&&Ae(e,t,n,"notDeepStrictEqual",$d)}W.strictEqual=function(t,n,r){t!==n&&Ae(t,n,r,"===",W.strictEqual)},W.notStrictEqual=function(t,n,r){t===n&&Ae(t,n,r,"!==",W.notStrictEqual)};function kd(e,t){if(!e||!t)return!1;if(Object.prototype.toString.call(t)=="[object RegExp]")return t.test(e);try{if(e instanceof t)return!0}catch{}return Error.isPrototypeOf(t)?!1:t.call({},e)===!0}function l1(e){var t;try{e()}catch(n){t=n}return t}function Pd(e,t,n,r){var s;if(typeof t!="function")throw new TypeError('"block" argument must be a function');typeof n=="string"&&(r=n,n=null),s=l1(t),r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),e&&!s&&Ae(s,n,"Missing expected exception"+r);var o=typeof r=="string",i=!e&&qe.isError(s),l=!e&&s&&!n;if((i&&o&&kd(s,n)||l)&&Ae(s,n,"Got unwanted exception"+r),e&&s&&n&&!kd(s,n)||!e&&s)throw s}W.throws=function(e,t,n){Pd(!0,e,t,n)},W.doesNotThrow=function(e,t,n){Pd(!1,e,t,n)},W.ifError=function(e){if(e)throw e};function Ed(e,t){e||Ae(e,!0,t,"==",Ed)}W.strict=n1(Ed,W,{equal:W.strictEqual,deepEqual:W.deepStrictEqual,notEqual:W.notStrictEqual,notDeepEqual:W.notDeepStrictEqual}),W.strict.strict=W.strict;var jd=Object.keys||function(e){var t=[];for(var n in e)r1.call(e,n)&&t.push(n);return t},a1=Ih.exports,u1=a1,c1=function(e){var t,n,r,s,o;for(t=Error.prepareStackTrace,Error.prepareStackTrace=function(i,l){return Error.prepareStackTrace=t,l},n=new Error().stack,o=0;o<n.length&&n[o].getFileName()!==__filename;)o++;u1(o<n.length,"Unexpected: unable to find caller/index.js in the stack"),e=!e||isNaN(e)?1:e>n.length-2?n.length-2:e,n=n.slice(o+e+1);do s=n.shift(),r=s&&s.getFileName();while(n.length&&r==="module.js");return r};const f1=Dn,h1=Dn,Ad=j0,d1=c1;sa.getCallerRoot=function(){try{return Ad(d1(2))}catch{return}},sa.getProcessRoot=function(){let t=process.cwd();const n=h1.join(t,"current");try{f1.statSync(n).isDirectory()&&(t=n)}catch{}try{return Ad(t)}catch{return}};var p1=sa,wa={exports:{}},Sa,Td;function g1(){if(Td)return Sa;Td=1;var e=1e3,t=e*60,n=t*60,r=n*24,s=r*7,o=r*365.25;Sa=function(f,h){h=h||{};var c=typeof f;if(c==="string"&&f.length>0)return i(f);if(c==="number"&&isFinite(f))return h.long?a(f):l(f);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(f))};function i(f){if(f=String(f),!(f.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(f);if(h){var c=parseFloat(h[1]),m=(h[2]||"ms").toLowerCase();switch(m){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*s;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}}}function l(f){var h=Math.abs(f);return h>=r?Math.round(f/r)+"d":h>=n?Math.round(f/n)+"h":h>=t?Math.round(f/t)+"m":h>=e?Math.round(f/e)+"s":f+"ms"}function a(f){var h=Math.abs(f);return h>=r?u(f,h,r,"day"):h>=n?u(f,h,n,"hour"):h>=t?u(f,h,t,"minute"):h>=e?u(f,h,e,"second"):f+" ms"}function u(f,h,c,m){var v=h>=c*1.5;return Math.round(f/c)+" "+m+(v?"s":"")}return Sa}function m1(e){n.debug=n,n.default=n,n.coerce=a,n.disable=i,n.enable=s,n.enabled=l,n.humanize=g1(),n.destroy=u,Object.keys(e).forEach(f=>{n[f]=e[f]}),n.names=[],n.skips=[],n.formatters={};function t(f){let h=0;for(let c=0;c<f.length;c++)h=(h<<5)-h+f.charCodeAt(c),h|=0;return n.colors[Math.abs(h)%n.colors.length]}n.selectColor=t;function n(f){let h,c=null,m,v;function w(...d){if(!w.enabled)return;const p=w,g=Number(new Date),S=g-(h||g);p.diff=S,p.prev=h,p.curr=g,h=g,d[0]=n.coerce(d[0]),typeof d[0]!="string"&&d.unshift("%O");let y=0;d[0]=d[0].replace(/%([a-zA-Z%])/g,(C,P)=>{if(C==="%%")return"%";y++;const T=n.formatters[P];if(typeof T=="function"){const N=d[y];C=T.call(p,N),d.splice(y,1),y--}return C}),n.formatArgs.call(p,d),(p.log||n.log).apply(p,d)}return w.namespace=f,w.useColors=n.useColors(),w.color=n.selectColor(f),w.extend=r,w.destroy=n.destroy,Object.defineProperty(w,"enabled",{enumerable:!0,configurable:!1,get:()=>c!==null?c:(m!==n.namespaces&&(m=n.namespaces,v=n.enabled(f)),v),set:d=>{c=d}}),typeof n.init=="function"&&n.init(w),w}function r(f,h){const c=n(this.namespace+(typeof h>"u"?":":h)+f);return c.log=this.log,c}function s(f){n.save(f),n.namespaces=f,n.names=[],n.skips=[];const h=(typeof f=="string"?f:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const c of h)c[0]==="-"?n.skips.push(c.slice(1)):n.names.push(c)}function o(f,h){let c=0,m=0,v=-1,w=0;for(;c<f.length;)if(m<h.length&&(h[m]===f[c]||h[m]==="*"))h[m]==="*"?(v=m,w=c,m++):(c++,m++);else if(v!==-1)m=v+1,w++,c=w;else return!1;for(;m<h.length&&h[m]==="*";)m++;return m===h.length}function i(){const f=[...n.names,...n.skips.map(h=>"-"+h)].join(",");return n.enable(""),f}function l(f){for(const h of n.skips)if(o(f,h))return!1;for(const h of n.names)if(o(f,h))return!0;return!1}function a(f){return f instanceof Error?f.stack||f.message:f}function u(){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 n.enable(n.load()),n}var y1=m1;(function(e,t){t.formatArgs=r,t.save=s,t.load=o,t.useColors=n,t.storage=i(),t.destroy=(()=>{let a=!1;return()=>{a||(a=!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`."))}})(),t.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 n(){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 a;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&&(a=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(a[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(a){if(a[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+a[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const u="color: "+this.color;a.splice(1,0,u,"color: inherit");let f=0,h=0;a[0].replace(/%[a-zA-Z%]/g,c=>{c!=="%%"&&(f++,c==="%c"&&(h=f))}),a.splice(h,0,u)}t.log=console.debug||console.log||(()=>{});function s(a){try{a?t.storage.setItem("debug",a):t.storage.removeItem("debug")}catch{}}function o(){let a;try{a=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch{}return!a&&typeof process<"u"&&"env"in process&&(a=process.env.DEBUG),a}function i(){try{return localStorage}catch{}}e.exports=y1(t);const{formatters:l}=e.exports;l.j=function(a){try{return JSON.stringify(a)}catch(u){return"[UnexpectedJSONParseError]: "+u.message}}})(wa,wa.exports);var v1=wa.exports;const w1=p1,Od=v1;ra.exports=function(t){const n=w1.getCallerRoot();let r;try{const s=en("/node_modules/.pnpm/@tryghost+debug@0.1.40/node_modules/@tryghost/debug/lib")(n+"/package.json");s.alias?r=s.alias:r=s.name}catch{r="undefined"}return Od(r+":"+t)},ra.exports._base=Od;var S1=ra.exports,x1=S1;const C1=[{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"}],$1=E0,Nd=Dn,xa=Dn,Ca=x1("i18n"),Ld=C1,_d=Ld.map(e=>e.code);function Rd(e,t){return e.reduce((n,r)=>{let s;try{s=en("/ghost/i18n/lib")(`../locales/${r}/${t}.json`)}catch{s=en("/ghost/i18n/lib")(`../locales/en/${t}.json`)}return n[r]={[t]:{...s,...s.default&&typeof s.default=="object"?s.default:{}}},n},{})}function k1(e,t){if(!t)return{[e]:{theme:{}}};let n=[];try{n=xa.readdirSync(t).filter(o=>o.endsWith(".json")).map(o=>o.replace(".json",""))}catch{n=[e,"en"]}return[...new Set([e,...n,"en"])].reduce((s,o)=>{let i,l=!1;const a=Nd.join(t,`${o}.json`);if(xa.existsSync(a))try{delete require.cache[en("/ghost/i18n/lib").resolve(a)],i=en("/ghost/i18n/lib")(a)}catch{Ca(`Error loading theme locale file: ${o}`),l=!0}else l=!0;if(l)if(o!=="en")try{const u=Nd.join(t,"en.json");xa.existsSync(u)?(delete require.cache[en("/ghost/i18n/lib").resolve(u)],i=en("/ghost/i18n/lib")(u)):i={}}catch{i={}}else Ca("Theme en.json file not found"),i={};return s[o]={theme:{...i,...i.default&&typeof i.default=="object"?i.default:{}}},s},{})}Qr.exports=(e="en",t="portal",n={})=>{const r=$1.createInstance(),s={prefix:"{",suffix:"}"};t==="theme"&&(s.escapeValue=!1);let o;return t!=="theme"?o=Rd(_d,t):(Ca(`generateThemeResources: ${e}, ${n.themePath}`),o=k1(e,n.themePath)),r.init({lng:e,nsSeparator:!1,keySeparator:!1,returnEmptyString:!1,fallbackLng:{no:["nb","en"],default:["en"]},ns:t,defaultNS:t,interpolation:s,resources:o}),r},Qr.exports.SUPPORTED_LOCALES=_d,Qr.exports.LOCALE_DATA=Ld,Qr.exports.generateResources=Rd;var P1=Qr.exports;const rs=P1;In.exports=rs,In.exports.default=rs,In.exports.LOCALE_DATA=rs.LOCALE_DATA,In.exports.SUPPORTED_LOCALES=rs.SUPPORTED_LOCALES,In.exports.generateResources=rs.generateResources;var E1=In.exports;const j1=Fo(E1);class A1 extends ft.Component{constructor(t){super(t);const n=this.props.locale||"en",r=j1(n,"search"),s=r.dir()||"ltr",o=new qm({adminUrl:t.adminUrl,apiKey:t.apiKey,dir:s});this.state={searchIndex:o,showPopup:!1,indexStarted:!1,indexComplete:!1,t:r.t,dir:s,scrollbarWidth:0},this.inputRef=ft.createRef()}componentDidMount(){const t=this.getScrollbarWidth();this.setState({scrollbarWidth:t}),this.initSetup()}componentDidUpdate(t,n){var r,s,o;if(n.showPopup!==this.state.showPopup)try{this.state.showPopup?(this.bodyScroll=(o=(s=(r=window.document)==null?void 0:r.body)==null?void 0:s.style)==null?void 0:o.overflow,this.bodyMargin=window.getComputedStyle(document.body).getPropertyValue("margin-right"),window.document.body.style.overflow="hidden",this.state.scrollbarWidth&&document.body.scrollHeight>window.innerHeight&&(window.document.body.style.marginRight=`calc(${this.bodyMargin} + ${this.state.scrollbarWidth}px)`)):(window.document.body.style.overflow=this.bodyScroll||"",!this.bodyMargin||this.bodyMargin==="0px"?window.document.body.style.marginRight="":window.document.body.style.marginRight=this.bodyMargin)}catch{}this.state.showPopup!==(n==null?void 0:n.showPopup)&&!this.state.showPopup&&this.setState({searchValue:""}),this.state.showPopup&&!this.state.indexStarted&&this.setupSearchIndex()}async setupSearchIndex(){this.setState({indexStarted:!0}),await this.state.searchIndex.init(),this.setState({indexComplete:!0})}componentWillUnmount(){window.removeEventListener("hashchange",this.hashHandler,!1),window.removeEventListener("keydown",this.handleKeyDown,!1)}initSetup(){this.handleSearchUrl(),this.addKeyboardShortcuts(),this.setupCustomTriggerButton(),this.hashHandler=()=>{this.handleSearchUrl()},window.addEventListener("hashchange",this.hashHandler,!1)}getScrollbarWidth(){const t=document.createElement("div");t.style.visibility="hidden",t.style.overflow="scroll",document.body.appendChild(t);const n=t.offsetWidth-t.clientWidth;return document.body.removeChild(t),n}setupCustomTriggerButton(){this.clickHandler=t=>{t.preventDefault(),this.setState({showPopup:!0});const n=document.createElement("input");n.style.opacity="0",n.style.position="fixed",n.style.top="0",document.body.appendChild(n),n.focus(),setTimeout(()=>{this.inputRef.current.focus(),document.body.removeChild(n)},150)},this.customTriggerButtons=this.getCustomTriggerButtons(),this.customTriggerButtons.forEach(t=>{t.removeEventListener("click",this.clickHandler),t.addEventListener("click",this.clickHandler)})}getCustomTriggerButtons(){return document.querySelectorAll("[data-ghost-search]")||[]}handleSearchUrl(){const[t]=window.location.hash.substr(1).split("?");(t==="/search"||t==="/search/")&&(this.setState({showPopup:!0}),window.history.replaceState("",document.title,window.location.pathname))}addKeyboardShortcuts(){const t=this.getCustomTriggerButtons();t!=null&&t.length&&(this.handleKeyDown=n=>{if(n.key==="k"&&n.metaKey)return this.setState({showPopup:!0}),n.preventDefault(),n.stopPropagation(),!1},document.addEventListener("keydown",this.handleKeyDown))}render(){return A.jsx(we.Provider,{value:{page:"search",showPopup:this.state.showPopup,adminUrl:this.props.adminUrl,stylesUrl:this.props.stylesUrl,searchIndex:this.state.searchIndex,indexComplete:this.state.indexComplete,searchValue:this.state.searchValue,inputRef:this.inputRef,onAction:()=>{},dispatch:(t,n)=>{t==="update"&&this.setState({...this.state,...n})},t:this.state.t,dir:this.state.dir},children:A.jsx(bf,{})})}}const Fd="sodo-search-root";function T1(){const e=document.createElement("div");e.id=Fd,document.body.appendChild(e)}function O1(){const e=document.querySelector("script[data-sodo-search]");if(e){const t=e.dataset.sodoSearch,n=e.dataset.key,r=e.dataset.styles,s=e.dataset.locale||"en";return{adminUrl:t,apiKey:n,stylesUrl:r,locale:s}}return{}}function N1(){T1()}function L1(){var o;const{adminUrl:e,apiKey:t,stylesUrl:n,locale:r}=O1(),s=(o=e||window.location.origin)==null?void 0:o.replace(/\/+$/,"");N1(),rm.render(A.jsx(ft.StrictMode,{children:A.jsx(A1,{adminUrl:s,apiKey:t,stylesUrl:n,locale:r})}),document.getElementById(Fd))}L1()});
|
|
66
|
+
`,i+1);s=s.substring(l+1)}this.stack=s}}},qe.inherits(W.AssertionError,Error);function wd(e,t){return typeof e=="string"?e.length<t?e:e.slice(0,t):e}function Sd(e){if(gd||!qe.isFunction(e))return qe.inspect(e);var t=vd(e),n=t?": "+t:"";return"[Function"+n+"]"}function o1(e){return wd(Sd(e.actual),128)+" "+e.operator+" "+wd(Sd(e.expected),128)}function Ae(e,t,n,r,s){throw new W.AssertionError({message:n,actual:e,expected:t,operator:r,stackStartFunction:s})}W.fail=Ae;function xd(e,t){e||Ae(e,!0,t,"==",W.ok)}W.ok=xd,W.equal=function(t,n,r){t!=n&&Ae(t,n,r,"==",W.equal)},W.notEqual=function(t,n,r){t==n&&Ae(t,n,r,"!=",W.notEqual)},W.deepEqual=function(t,n,r){Hn(t,n,!1)||Ae(t,n,r,"deepEqual",W.deepEqual)},W.deepStrictEqual=function(t,n,r){Hn(t,n,!0)||Ae(t,n,r,"deepStrictEqual",W.deepStrictEqual)};function Hn(e,t,n,r){if(e===t)return!0;if(ns(e)&&ns(t))return dd(e,t)===0;if(qe.isDate(e)&&qe.isDate(t))return e.getTime()===t.getTime();if(qe.isRegExp(e)&&qe.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if((e===null||typeof e!="object")&&(t===null||typeof t!="object"))return n?e===t:e==t;if(yd(e)&&yd(t)&&md(e)===md(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return dd(new Uint8Array(e.buffer),new Uint8Array(t.buffer))===0;if(ns(e)!==ns(t))return!1;r=r||{actual:[],expected:[]};var s=r.actual.indexOf(e);return s!==-1&&s===r.expected.indexOf(t)?!0:(r.actual.push(e),r.expected.push(t),i1(e,t,n,r))}function Cd(e){return Object.prototype.toString.call(e)=="[object Arguments]"}function i1(e,t,n,r){if(e==null||t===null||t===void 0)return!1;if(qe.isPrimitive(e)||qe.isPrimitive(t))return e===t;if(n&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var s=Cd(e),o=Cd(t);if(s&&!o||!s&&o)return!1;if(s)return e=pd.call(e),t=pd.call(t),Hn(e,t,n);var i=jd(e),l=jd(t),a,u;if(i.length!==l.length)return!1;for(i.sort(),l.sort(),u=i.length-1;u>=0;u--)if(i[u]!==l[u])return!1;for(u=i.length-1;u>=0;u--)if(a=i[u],!Hn(e[a],t[a],n,r))return!1;return!0}W.notDeepEqual=function(t,n,r){Hn(t,n,!1)&&Ae(t,n,r,"notDeepEqual",W.notDeepEqual)},W.notDeepStrictEqual=$d;function $d(e,t,n){Hn(e,t,!0)&&Ae(e,t,n,"notDeepStrictEqual",$d)}W.strictEqual=function(t,n,r){t!==n&&Ae(t,n,r,"===",W.strictEqual)},W.notStrictEqual=function(t,n,r){t===n&&Ae(t,n,r,"!==",W.notStrictEqual)};function kd(e,t){if(!e||!t)return!1;if(Object.prototype.toString.call(t)=="[object RegExp]")return t.test(e);try{if(e instanceof t)return!0}catch{}return Error.isPrototypeOf(t)?!1:t.call({},e)===!0}function l1(e){var t;try{e()}catch(n){t=n}return t}function Pd(e,t,n,r){var s;if(typeof t!="function")throw new TypeError('"block" argument must be a function');typeof n=="string"&&(r=n,n=null),s=l1(t),r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),e&&!s&&Ae(s,n,"Missing expected exception"+r);var o=typeof r=="string",i=!e&&qe.isError(s),l=!e&&s&&!n;if((i&&o&&kd(s,n)||l)&&Ae(s,n,"Got unwanted exception"+r),e&&s&&n&&!kd(s,n)||!e&&s)throw s}W.throws=function(e,t,n){Pd(!0,e,t,n)},W.doesNotThrow=function(e,t,n){Pd(!1,e,t,n)},W.ifError=function(e){if(e)throw e};function Ed(e,t){e||Ae(e,!0,t,"==",Ed)}W.strict=n1(Ed,W,{equal:W.strictEqual,deepEqual:W.deepStrictEqual,notEqual:W.notStrictEqual,notDeepEqual:W.notDeepStrictEqual}),W.strict.strict=W.strict;var jd=Object.keys||function(e){var t=[];for(var n in e)r1.call(e,n)&&t.push(n);return t},a1=Ih.exports,u1=a1,c1=function(e){var t,n,r,s,o;for(t=Error.prepareStackTrace,Error.prepareStackTrace=function(i,l){return Error.prepareStackTrace=t,l},n=new Error().stack,o=0;o<n.length&&n[o].getFileName()!==__filename;)o++;u1(o<n.length,"Unexpected: unable to find caller/index.js in the stack"),e=!e||isNaN(e)?1:e>n.length-2?n.length-2:e,n=n.slice(o+e+1);do s=n.shift(),r=s&&s.getFileName();while(n.length&&r==="module.js");return r};const f1=Dn,h1=Dn,Ad=j0,d1=c1;sa.getCallerRoot=function(){try{return Ad(d1(2))}catch{return}},sa.getProcessRoot=function(){let t=process.cwd();const n=h1.join(t,"current");try{f1.statSync(n).isDirectory()&&(t=n)}catch{}try{return Ad(t)}catch{return}};var p1=sa,wa={exports:{}},Sa,Td;function g1(){if(Td)return Sa;Td=1;var e=1e3,t=e*60,n=t*60,r=n*24,s=r*7,o=r*365.25;Sa=function(f,h){h=h||{};var c=typeof f;if(c==="string"&&f.length>0)return i(f);if(c==="number"&&isFinite(f))return h.long?a(f):l(f);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(f))};function i(f){if(f=String(f),!(f.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(f);if(h){var c=parseFloat(h[1]),m=(h[2]||"ms").toLowerCase();switch(m){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*s;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}}}function l(f){var h=Math.abs(f);return h>=r?Math.round(f/r)+"d":h>=n?Math.round(f/n)+"h":h>=t?Math.round(f/t)+"m":h>=e?Math.round(f/e)+"s":f+"ms"}function a(f){var h=Math.abs(f);return h>=r?u(f,h,r,"day"):h>=n?u(f,h,n,"hour"):h>=t?u(f,h,t,"minute"):h>=e?u(f,h,e,"second"):f+" ms"}function u(f,h,c,m){var v=h>=c*1.5;return Math.round(f/c)+" "+m+(v?"s":"")}return Sa}function m1(e){n.debug=n,n.default=n,n.coerce=a,n.disable=i,n.enable=s,n.enabled=l,n.humanize=g1(),n.destroy=u,Object.keys(e).forEach(f=>{n[f]=e[f]}),n.names=[],n.skips=[],n.formatters={};function t(f){let h=0;for(let c=0;c<f.length;c++)h=(h<<5)-h+f.charCodeAt(c),h|=0;return n.colors[Math.abs(h)%n.colors.length]}n.selectColor=t;function n(f){let h,c=null,m,v;function w(...d){if(!w.enabled)return;const p=w,g=Number(new Date),S=g-(h||g);p.diff=S,p.prev=h,p.curr=g,h=g,d[0]=n.coerce(d[0]),typeof d[0]!="string"&&d.unshift("%O");let y=0;d[0]=d[0].replace(/%([a-zA-Z%])/g,(C,P)=>{if(C==="%%")return"%";y++;const T=n.formatters[P];if(typeof T=="function"){const N=d[y];C=T.call(p,N),d.splice(y,1),y--}return C}),n.formatArgs.call(p,d),(p.log||n.log).apply(p,d)}return w.namespace=f,w.useColors=n.useColors(),w.color=n.selectColor(f),w.extend=r,w.destroy=n.destroy,Object.defineProperty(w,"enabled",{enumerable:!0,configurable:!1,get:()=>c!==null?c:(m!==n.namespaces&&(m=n.namespaces,v=n.enabled(f)),v),set:d=>{c=d}}),typeof n.init=="function"&&n.init(w),w}function r(f,h){const c=n(this.namespace+(typeof h>"u"?":":h)+f);return c.log=this.log,c}function s(f){n.save(f),n.namespaces=f,n.names=[],n.skips=[];const h=(typeof f=="string"?f:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const c of h)c[0]==="-"?n.skips.push(c.slice(1)):n.names.push(c)}function o(f,h){let c=0,m=0,v=-1,w=0;for(;c<f.length;)if(m<h.length&&(h[m]===f[c]||h[m]==="*"))h[m]==="*"?(v=m,w=c,m++):(c++,m++);else if(v!==-1)m=v+1,w++,c=w;else return!1;for(;m<h.length&&h[m]==="*";)m++;return m===h.length}function i(){const f=[...n.names,...n.skips.map(h=>"-"+h)].join(",");return n.enable(""),f}function l(f){for(const h of n.skips)if(o(f,h))return!1;for(const h of n.names)if(o(f,h))return!0;return!1}function a(f){return f instanceof Error?f.stack||f.message:f}function u(){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 n.enable(n.load()),n}var y1=m1;(function(e,t){t.formatArgs=r,t.save=s,t.load=o,t.useColors=n,t.storage=i(),t.destroy=(()=>{let a=!1;return()=>{a||(a=!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`."))}})(),t.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 n(){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 a;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&&(a=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(a[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(a){if(a[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+a[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const u="color: "+this.color;a.splice(1,0,u,"color: inherit");let f=0,h=0;a[0].replace(/%[a-zA-Z%]/g,c=>{c!=="%%"&&(f++,c==="%c"&&(h=f))}),a.splice(h,0,u)}t.log=console.debug||console.log||(()=>{});function s(a){try{a?t.storage.setItem("debug",a):t.storage.removeItem("debug")}catch{}}function o(){let a;try{a=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch{}return!a&&typeof process<"u"&&"env"in process&&(a=process.env.DEBUG),a}function i(){try{return localStorage}catch{}}e.exports=y1(t);const{formatters:l}=e.exports;l.j=function(a){try{return JSON.stringify(a)}catch(u){return"[UnexpectedJSONParseError]: "+u.message}}})(wa,wa.exports);var v1=wa.exports;const w1=p1,Od=v1;ra.exports=function(t){const n=w1.getCallerRoot();let r;try{const s=en("/node_modules/.pnpm/@tryghost+debug@2.1.0/node_modules/@tryghost/debug/lib")(n+"/package.json");s.alias?r=s.alias:r=s.name}catch{r="undefined"}return Od(r+":"+t)},ra.exports._base=Od;var S1=ra.exports,x1=S1;const C1=[{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"}],$1=E0,Nd=Dn,xa=Dn,Ca=x1("i18n"),Ld=C1,_d=Ld.map(e=>e.code);function Rd(e,t){return e.reduce((n,r)=>{let s;try{s=en("/ghost/i18n/lib")(`../locales/${r}/${t}.json`)}catch{s=en("/ghost/i18n/lib")(`../locales/en/${t}.json`)}return n[r]={[t]:{...s,...s.default&&typeof s.default=="object"?s.default:{}}},n},{})}function k1(e,t){if(!t)return{[e]:{theme:{}}};let n=[];try{n=xa.readdirSync(t).filter(o=>o.endsWith(".json")).map(o=>o.replace(".json",""))}catch{n=[e,"en"]}return[...new Set([e,...n,"en"])].reduce((s,o)=>{let i,l=!1;const a=Nd.join(t,`${o}.json`);if(xa.existsSync(a))try{delete require.cache[en("/ghost/i18n/lib").resolve(a)],i=en("/ghost/i18n/lib")(a)}catch{Ca(`Error loading theme locale file: ${o}`),l=!0}else l=!0;if(l)if(o!=="en")try{const u=Nd.join(t,"en.json");xa.existsSync(u)?(delete require.cache[en("/ghost/i18n/lib").resolve(u)],i=en("/ghost/i18n/lib")(u)):i={}}catch{i={}}else Ca("Theme en.json file not found"),i={};return s[o]={theme:{...i,...i.default&&typeof i.default=="object"?i.default:{}}},s},{})}Qr.exports=(e="en",t="portal",n={})=>{const r=$1.createInstance(),s={prefix:"{",suffix:"}"};t==="theme"&&(s.escapeValue=!1);let o;return t!=="theme"?o=Rd(_d,t):(Ca(`generateThemeResources: ${e}, ${n.themePath}`),o=k1(e,n.themePath)),r.init({lng:e,nsSeparator:!1,keySeparator:!1,returnEmptyString:!1,fallbackLng:{no:["nb","en"],default:["en"]},ns:t,defaultNS:t,interpolation:s,resources:o}),r},Qr.exports.SUPPORTED_LOCALES=_d,Qr.exports.LOCALE_DATA=Ld,Qr.exports.generateResources=Rd;var P1=Qr.exports;const rs=P1;In.exports=rs,In.exports.default=rs,In.exports.LOCALE_DATA=rs.LOCALE_DATA,In.exports.SUPPORTED_LOCALES=rs.SUPPORTED_LOCALES,In.exports.generateResources=rs.generateResources;var E1=In.exports;const j1=Fo(E1);class A1 extends ft.Component{constructor(t){super(t);const n=this.props.locale||"en",r=j1(n,"search"),s=r.dir()||"ltr",o=new qm({adminUrl:t.adminUrl,apiKey:t.apiKey,dir:s});this.state={searchIndex:o,showPopup:!1,indexStarted:!1,indexComplete:!1,t:r.t,dir:s,scrollbarWidth:0},this.inputRef=ft.createRef()}componentDidMount(){const t=this.getScrollbarWidth();this.setState({scrollbarWidth:t}),this.initSetup()}componentDidUpdate(t,n){var r,s,o;if(n.showPopup!==this.state.showPopup)try{this.state.showPopup?(this.bodyScroll=(o=(s=(r=window.document)==null?void 0:r.body)==null?void 0:s.style)==null?void 0:o.overflow,this.bodyMargin=window.getComputedStyle(document.body).getPropertyValue("margin-right"),window.document.body.style.overflow="hidden",this.state.scrollbarWidth&&document.body.scrollHeight>window.innerHeight&&(window.document.body.style.marginRight=`calc(${this.bodyMargin} + ${this.state.scrollbarWidth}px)`)):(window.document.body.style.overflow=this.bodyScroll||"",!this.bodyMargin||this.bodyMargin==="0px"?window.document.body.style.marginRight="":window.document.body.style.marginRight=this.bodyMargin)}catch{}this.state.showPopup!==(n==null?void 0:n.showPopup)&&!this.state.showPopup&&this.setState({searchValue:""}),this.state.showPopup&&!this.state.indexStarted&&this.setupSearchIndex()}async setupSearchIndex(){this.setState({indexStarted:!0}),await this.state.searchIndex.init(),this.setState({indexComplete:!0})}componentWillUnmount(){window.removeEventListener("hashchange",this.hashHandler,!1),window.removeEventListener("keydown",this.handleKeyDown,!1)}initSetup(){this.handleSearchUrl(),this.addKeyboardShortcuts(),this.setupCustomTriggerButton(),this.hashHandler=()=>{this.handleSearchUrl()},window.addEventListener("hashchange",this.hashHandler,!1)}getScrollbarWidth(){const t=document.createElement("div");t.style.visibility="hidden",t.style.overflow="scroll",document.body.appendChild(t);const n=t.offsetWidth-t.clientWidth;return document.body.removeChild(t),n}setupCustomTriggerButton(){this.clickHandler=t=>{t.preventDefault(),this.setState({showPopup:!0});const n=document.createElement("input");n.style.opacity="0",n.style.position="fixed",n.style.top="0",document.body.appendChild(n),n.focus(),setTimeout(()=>{this.inputRef.current.focus(),document.body.removeChild(n)},150)},this.customTriggerButtons=this.getCustomTriggerButtons(),this.customTriggerButtons.forEach(t=>{t.removeEventListener("click",this.clickHandler),t.addEventListener("click",this.clickHandler)})}getCustomTriggerButtons(){return document.querySelectorAll("[data-ghost-search]")||[]}handleSearchUrl(){const[t]=window.location.hash.substr(1).split("?");(t==="/search"||t==="/search/")&&(this.setState({showPopup:!0}),window.history.replaceState("",document.title,window.location.pathname))}addKeyboardShortcuts(){const t=this.getCustomTriggerButtons();t!=null&&t.length&&(this.handleKeyDown=n=>{if(n.key==="k"&&n.metaKey)return this.setState({showPopup:!0}),n.preventDefault(),n.stopPropagation(),!1},document.addEventListener("keydown",this.handleKeyDown))}render(){return A.jsx(we.Provider,{value:{page:"search",showPopup:this.state.showPopup,adminUrl:this.props.adminUrl,stylesUrl:this.props.stylesUrl,searchIndex:this.state.searchIndex,indexComplete:this.state.indexComplete,searchValue:this.state.searchValue,inputRef:this.inputRef,onAction:()=>{},dispatch:(t,n)=>{t==="update"&&this.setState({...this.state,...n})},t:this.state.t,dir:this.state.dir},children:A.jsx(bf,{})})}}const Fd="sodo-search-root";function T1(){const e=document.createElement("div");e.id=Fd,document.body.appendChild(e)}function O1(){const e=document.querySelector("script[data-sodo-search]");if(e){const t=e.dataset.sodoSearch,n=e.dataset.key,r=e.dataset.styles,s=e.dataset.locale||"en";return{adminUrl:t,apiKey:n,stylesUrl:r,locale:s}}return{}}function N1(){T1()}function L1(){var o;const{adminUrl:e,apiKey:t,stylesUrl:n,locale:r}=O1(),s=(o=e||window.location.origin)==null?void 0:o.replace(/\/+$/,"");N1(),rm.render(A.jsx(ft.StrictMode,{children:A.jsx(A1,{adminUrl:s,apiKey:t,stylesUrl:n,locale:r})}),document.getElementById(Fd))}L1()});
|
|
67
67
|
//# sourceMappingURL=sodo-search.min.js.map
|